Silverfrost Forums

Welcome to our forums

KIND & SELLECTED_INT_KIND

6 Oct 2006 6:23 #1122

At the risk of asking a stupid question ... as I upgrade code from 'FTN77' to 'FTN95', I occasionally get the following output during compilation:

comment 981 - Specifying the kind of the type INTEGER with the constant '2' is non-portable - 'SELECTED_INT_KIND(4)' would be better

I understand what the comment means. However, the suggested portable solution does not seem correct to me. As I understand it:

  • kind = 2 implies 2 bytes of storage i.e integers between -32760ish and +32760ish (can never remember which end gets the extra non-zero value)

  • selected int_kind (4) implies integers between -104 and +104 i.e between -9999 and +9999

I accept that the two can not be mapped exactly onto each other, but I think selected_int_kind (5) is the correct portable solution. What is incorrect: the compiler comment, or my understanding?

Andy

6 Oct 2006 9:02 #1125

Andy

selected_int_kind(5) = 3.

You need INTEGER*4 for to store 99999.

selected_int_kind (n) = 2 for n = 3 or 4.

Please login to reply.