You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

la_xisnan.F90 1.1 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. module LA_XISNAN
  2. interface LA_ISNAN
  3. module procedure SISNAN
  4. module procedure DISNAN
  5. end interface
  6. contains
  7. logical function SISNAN( x )
  8. use LA_CONSTANTS, only: wp=>sp
  9. #ifdef USE_IEEE_INTRINSIC
  10. use, intrinsic :: ieee_arithmetic
  11. #elif USE_ISNAN
  12. intrinsic :: isnan
  13. #endif
  14. real(wp) :: x
  15. #ifdef USE_IEEE_INTRINSIC
  16. sisnan = ieee_is_nan(x)
  17. #elif USE_ISNAN
  18. sisnan = isnan(x)
  19. #else
  20. sisnan = SLAISNAN(x,x)
  21. contains
  22. logical function SLAISNAN( x, y )
  23. use LA_CONSTANTS, only: wp=>sp
  24. real(wp) :: x, y
  25. SLAISNAN = ( x.ne.y )
  26. end function SLAISNAN
  27. #endif
  28. end function SISNAN
  29. logical function DISNAN( x )
  30. use LA_CONSTANTS, only: wp=>dp
  31. #ifdef USE_IEEE_INTRINSIC
  32. use, intrinsic :: ieee_arithmetic
  33. #elif USE_ISNAN
  34. intrinsic :: isnan
  35. #endif
  36. real(wp) :: x
  37. #ifdef USE_IEEE_INTRINSIC
  38. DISNAN = ieee_is_nan(x)
  39. #elif USE_ISNAN
  40. DISNAN = isnan(x)
  41. #else
  42. DISNAN = DLAISNAN(x,x)
  43. contains
  44. logical function DLAISNAN( x, y )
  45. use LA_CONSTANTS, only: wp=>dp
  46. real(wp) :: x, y
  47. DLAISNAN = ( x.ne.y )
  48. end function DLAISNAN
  49. #endif
  50. end function DISNAN
  51. end module LA_XISNAN