- #1
- 2,795
- 21
Fortran compiler specific "kind" modifier.
I've recently switched over from the SilverFrost (Salford) FTN95 compiler to the open source g95 compliler. So far everything seems very compatible between the two compilers (as in the same source compiles without modification on either compiler) except for one thing. The "kind" specifier in the Silverfrost implementation seems to be different to that of the g95 implementation.
In the SF ftn95 implementation they use -
kind=1 : int8
kind=2 : int16
kind=3 : int32
kind=4 : int64.
Just now I went to compile a program that had some code like "integer (kind=3) :: i, j, k" and it told me that kind=3 was not a valid integer kind.
I've just made a few quick tests and it seems that g95 integer kinds are defined as follows -
kind=1 : int8
kind=2 : int16
kind=4 : int32
kind=8 : int64.
Can someone please confirm that the above is correct?
BTW. I'm suspecting that the g95 implementation is actually the correct fortran95 standard and the SF ftn95 is the one that's breaking standard.
I've recently switched over from the SilverFrost (Salford) FTN95 compiler to the open source g95 compliler. So far everything seems very compatible between the two compilers (as in the same source compiles without modification on either compiler) except for one thing. The "kind" specifier in the Silverfrost implementation seems to be different to that of the g95 implementation.
In the SF ftn95 implementation they use -
kind=1 : int8
kind=2 : int16
kind=3 : int32
kind=4 : int64.
Just now I went to compile a program that had some code like "integer (kind=3) :: i, j, k" and it told me that kind=3 was not a valid integer kind.
I've just made a few quick tests and it seems that g95 integer kinds are defined as follows -
kind=1 : int8
kind=2 : int16
kind=4 : int32
kind=8 : int64.
Can someone please confirm that the above is correct?
BTW. I'm suspecting that the g95 implementation is actually the correct fortran95 standard and the SF ftn95 is the one that's breaking standard.