CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Intrinsic Procedure 'ISNAN' in GNU FORTRAN 77 (https://www.cfd-online.com/Forums/main/9013-intrinsic-procedure-isnan-gnu-fortran-77-a.html)

hawk April 12, 2005 19:57

Intrinsic Procedure 'ISNAN' in GNU FORTRAN 77
 
Hi! FORTRAN experts. I need your help.

I am using an 'ISNAN' Intrinsic Procedure in my FORTRAN code. Under Windows with DEC Fortran 77 complier, it is working well. But when I put it to a unix system and compile it with GNU FORTRAN 77 complier, it is not working. And later I found there is not such an Intrinsic Procedures in GNU FORTRAN 77.

What can I do to make my program work under GNU FORTRAN 77? I need your suggestions.

Thank you very much.

jasond April 12, 2005 22:13

Re: Intrinsic Procedure 'ISNAN' in GNU FORTRAN 77
 
You might want to try testing a value for equality with itself. If c=NAN, then (c .eq. c) is false (on my system, anyway).

I had exactly the same problem a few years back, and this was the easiest thing to do in my case. I think that this should work on other compilers, as I think that NAN is never equal to anything. It is a bit kludgy, so there might be a better solution.


All times are GMT -4. The time now is 06:41.