Silverfrost Forums

Welcome to our forums

Default Integer KIND 7 compiler option

17 Jan 2021 6:02 #26922

FTN95 compiler has an option (/INTL), which set the default integer variables to KIND 3. However KIND 3 is not compatible with 64-bit compiler. Is there any option that set the default integer variables to KIND 7, i.e. KIND 3 for 32-bit compiler and KIND 4 for 64-bit compiler?

17 Jan 2021 6:33 #26923

As you can read in the documentation ( https://silverfrost.com/ftn95-help/x64/intro.aspx ), FTN95 permits you to specify KIND=7 for integer variables, which are then treated as KIND=3 for 32-bit programs and as KIND = 4 for 64-bit programs. This feature, however, is one that you have to modify your code to exploit (by specifying a KIND number in declarations).

18 Jan 2021 7:22 #26925

Thanks for sharing the link, but I am already aware of it. I was wondering, if there is an option that you can use as you compile the code that by using it, every variable of type INTEGER will become INTEGER(KIND=7) unless it is explicitly declared as other KINDs. I wanted to avoid manually set the KIND=7 for these integer variables. You can see the /INTL description here: https://www.silverfrost.com/ftn95-help/options/_intl_and_ints.aspx

18 Jan 2021 8:02 #26926

The answer, in theory at least, is to use '/DEFINT_KIND 4' whenever you use /64 on the FTN95 command line.

I wonder what you mean by your comment that 'KIND 3 is not compatible with 64-bit'. There is no general need to upgrade the INTEGER KIND value when moving to 64 bits. The exceptions are where the INTEGERs are memory addresses and these can be changed to KIND=7.

19 Jan 2021 8:31 #26930

Okay, I got it. Thank you both for the support

Please login to reply.