Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,26 @@ if [ $retval -ne 0 ] ; then
fi
fi

# testing for Fortran 2003 IEEE features
make fortran_2003_isnan_test > tools/fortran_2003_isnan_test.log 2>&1
rm -f tools/fortran_2003_isnan_test.log
retval=-1
if [ -f tools/fortran_2003_isnan_test.exe ] ; then
retval=0
fi
if [ $retval -ne 0 ] ; then
sed -e '/^ARCH_LOCAL/s/$/ -DNO_ISNAN/' configure.wrf > configure.wrf.edit
mv configure.wrf.edit configure.wrf
echo " "
echo " "
echo "************************** W A R N I N G ************************************"
echo " "
echo "There are some intrinsic Fortran 2003 features in WRF that your compiler does not"
echo "recognize. The isnan function calls have been removed."
echo " "
echo "*****************************************************************************"
fi

# testing for Fortran 2008 intrinsic gamma function
make fortran_2008_gamma_test > tools/fortran_2008_gamma.log 2>&1
rm -f tools/fortran_2008_gamma.log
Expand Down
2 changes: 2 additions & 0 deletions phys/module_sf_noahmplsm.F
Original file line number Diff line number Diff line change
Expand Up @@ -8027,7 +8027,9 @@ SUBROUTINE SPRINKLER_IRRIGATION(parameters,NSOIL,DT,SH2O,SMC,SICE,& !in
ELSE ! Equation (4)
IRRLOSS = 4.337*(EXP(0.077*WINDSPEED))*(((ESAT1-EAIR)*0.01)**(-0.098)) ! [%]
END IF
#if (! defined(NO_ISNAN) )
IF(ISNAN(IRRLOSS))IRRLOSS=4.0 ! In case if IRRLOSS is NaN
#endif

! Sprinkler water (m) for sprinkler fraction
IRSIRATE = IRSIRATE * SIFAC
Expand Down
14 changes: 14 additions & 0 deletions tools/fortran_2003_isnan_test.F
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
PROGRAM fortran_2003_test

IMPLICIT NONE

REAL :: x, y

x = -1.
y = sqrt(x)

IF ( ISNAN(y) ) THEN
PRINT *,'Apparently y is a NaN
ENDIF

END PROGRAM fortran_2003_test