I have a couple places in my code to check for NAN values using the ‘isnan()’ function. I am porting this code from Intel compiler for Windows to PGI fortran for Linux. I have been able to make all other code changed needed for compatibility, but this error message remains and I cannot figure out how to rectify it. I am given the exact line of the file that causes the message and the subroutine within which it was placed.
At the beginning of the subroutine, I am declaring ‘logical isnan’, yet I still get the message. I show below how I am using the function.
do i=1,ncells
if(isnan(var(i)))then
write(nunit,'(F8.0)') -999.0
else
write(nunit,'(F12.6)') var(i)
endif
enddo
Can anyone advise what I might be doing wrong? Thanks