source: LMDZ6/trunk/libf/misc/lmdz_is_nan.F90

Last change on this file was 5718, checked in by yann meurdesoif, 2 weeks ago

Manage isnan non standard fortran intrinsic function with wrapper that switch to ieee_is_nan when preprocessing key CPP_USE_IEEE_IS_NAN is set.

This is mandatory for nvdia compiler that is not accept the isnan function. Due to not well understood side effect with MPI initialization on irene, for now we offer the 2 possibility, and by default, CPP_USE_IEEE_IS_NAN is set only for nvidia compilers.
YM

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 448 bytes
Line 
1MODULE lmdz_is_nan
2
3CONTAINS
4
5#ifdef CPP_USE_IEEE_IS_NAN 
6
7  ELEMENTAL FUNCTION is_nan(x)
8  USE, INTRINSIC :: ieee_arithmetic, ONLY : IEEE_IS_NAN
9  IMPLICIT NONE
10    REAL, INTENT(IN)    :: x 
11    LOGICAL :: is_nan
12
13    is_nan=IEEE_IS_NAN(x)
14
15  END FUNCTION is_nan
16
17#else
18  ELEMENTAL FUNCTION is_nan(x)
19  IMPLICIT NONE
20    REAL, INTENT(IN)    :: x 
21    LOGICAL :: is_nan
22
23    is_nan=isnan(x) 
24  END FUNCTION is_nan
25#endif
26
27END MODULE lmdz_is_nan
Note: See TracBrowser for help on using the repository browser.