Failure of implicit real*8

Toon Moene toon@moene.org
Tue Feb 22 19:00:00 GMT 2011


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 ...

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).

-- 
Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/
Progress of GNU Fortran: http://gcc.gnu.org/wiki/GFortran#news



More information about the Fortran mailing list