Failure of implicit real*8

Manfred Schwarb manfred99@gmx.ch
Tue Feb 22 23:02:00 GMT 2011


Am 22.02.2011 19:22, schrieb Toon Moene:

> N.M. Maclaren wrote:
>
>> By far the most common gotchas in clean, modern Fortran are constants
>> and a few intrinsics. I don't think that I know of another that is of
>> any consequence.
>
> Oh, yeah. In June last year, a very seasoned programmer on our Weather Forecasting Model team showed me the following code:
>
> Call site:
>
> CALL SUB(...,999.0,...)
>
> Subroutine:
>
> SUBROUTINE SUB(...,R,...) ! R corresponds to the actual
> USE KINDS, ONLY :: JPRB ! argument 999.0 above.
> REAL(KIND=JPRB) R ! JPRB is a non-default kind.
>
> and wondered why it didn't work ...
>


In the old days, there was ftnchek, nowadays we have interfaces.

I had to deal quite a bit with fortran code of weather services (NOAA, ECMWF),
it is always the same: Some legacy fortran 66/77 code base, which some
"seasoned" programmers expanded with fortran 9x features (so you can't check
it any more with ftnchek). And then they compile the whole thing
without -Wall and -fbounds-check. As long as you
get no segfaults, everything is OK...

Even for a code base as large as a NWP program, it is possible to construct
the appropriate interfaces in a reasonable time frame (there are tools to do it).

Cheers,
Manfred

> Well, actually, he asked me if that would be a problem. I almost exploded, because we had been digging into this code for quite a while searching for "the bug" (it stopped working after an overhaul).
>




More information about the Fortran mailing list