all FORTRAN users at MPI Munich,

a bug of fortran program is found due to floating-point exception handling of FORTRAN on IBM AIX, it produces wrong physics results, of course. It might be interesting for you to know what's happend.

It is default on AIX that an invalid floating-point number given as NaNQ (Not A Number) and the program continues running without any exception handling. If you use this NaNQ as an operant in numerical calculation, it will not affect your final result, because you will get a NaNQ as result. But if you use NaNQ as operant of a logical operation, it is quite dangerous while it uses NaNQ as a number greater than zero, for instance.

Therefore, it is suggested to use option

-qflttrap=overflow:underflow:zerodivide:invalid:inexact:enable

to compile your fortran programs, if you are not sure whether you have used a NaNQ as operant of a logical operation.

The disadvantage of this option is the slow down of performance.


Pan, Yaozhi E-Mail: pan@mppmu.mpg.de Tel: 32308 268 Max-Planck-Institut fuer Physik, Munich, Germany 9-May-1995