View previous topic :: View next topic |
Author |
Message |
Moji
Joined: 30 Sep 2020 Posts: 27
|
Posted: Sun Jan 17, 2021 7:02 pm Post subject: Default Integer KIND 7 compiler option |
|
|
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? |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1896
|
Posted: Sun Jan 17, 2021 7:33 pm Post subject: |
|
|
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). |
|
Back to top |
|
|
Moji
Joined: 30 Sep 2020 Posts: 27
|
Posted: Mon Jan 18, 2021 8:22 am Post subject: |
|
|
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 |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8018 Location: Salford, UK
|
Posted: Mon Jan 18, 2021 9:02 am Post subject: |
|
|
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. |
|
Back to top |
|
|
Moji
Joined: 30 Sep 2020 Posts: 27
|
Posted: Tue Jan 19, 2021 9:31 am Post subject: |
|
|
Okay, I got it. Thank you both for the support |
|
Back to top |
|
|
|