-fugly-logint ?
Tobias Burnus
burnus@net-b.de
Sun Nov 27 20:54:00 GMT 2011
Tom Roche wrote:
>> IF (LIMIT_Sg == .TRUE.) THEN
>> 1
>> Error: Logicals at (1) must be compared with .eqv. instead of ==
> Can I fix this error without fixing the code? E.g., can one compile
> with something like -fugly-logint (which I see while googling, but not
> in current docs)?
Looking at the source code of gfortran: No, it does not seem to be
possible, sorry.
There is actually a reason that Fortran distinguishes .EQV. from ==:
They have a different precedence (cf. Fortran stanard). Thus, if you
write "==" should it be higher or lower precedence than, e.g., .NOT.?
Besides, one rarely needs to do comparisons with logicals. "IF
(LIMIT_Sg)" is clearer and shortert than "IF (LIMIT_Sg .EQV. .TRUE.)".
> legacy atmospheric-modeling code that has previously been {built with,
> documented for} icc/ifc (except for the most-out-of-date docs, which use
> PGI). Since I'm just building, I'm striving not to edit any sources
> (just build scripts and Makefile's).
It seems to be unavoidable to fix this bug in the atmospheric-modelling
code as gfortran (at least currently) does not allow it.
Tobias
More information about the Fortran
mailing list