F90-related question

Tim Prince n8tm@aol.com
Tue Dec 10 22:57:00 GMT 2013


On 12/10/2013 05:27 PM, Toon Moene wrote:
> On 12/10/2013 04:41 PM, Steve Kargl wrote:
>
>> Yeah, I forgot about that additional bit of stupidity with the
>> -fdefault-real-8 option.  REAL, REAL*4 and REAL(4) are all default
>> real kind types, yet the option treats them differently.
>
> Nope, only the REAL declaration indicates a *default* real.
>
> You seem to forget what this option is for: In the 70s, lots of code 
> was developed on Cray supercomputers, for which REAL meant a 64-bit 
> floating point number.
>
> To ease the transition of code written for these computers, 
> -fdefault-real-8 supplied a sweeping, change-all-default-reals (like 
> variables declared REAL, or constants like 0.1) into 64 bit quantities.
>
> That's what it is supposed to do, and that is what it does.  The other 
> conversions have other uses, but they don't serve *this* purpose.
>
-fdefault-real-8 also tends to require going through and removing all 
kind declarations for any variables which are used multiple places.  I 
found out in the last week it's near impossible to combine source from 
various places without doing that.  Promoted default real variables 
don't match any specified KIND, at least not when using certain other 
compilers.

-- 
Tim Prince



More information about the Fortran mailing list