forked from HYCOM/HYCOM-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathisnan.F90
More file actions
36 lines (36 loc) · 716 Bytes
/
isnan.F90
File metadata and controls
36 lines (36 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#if defined(NAN2003)
logical function hycom_isnaninf(a)
use ieee_arithmetic, only : ieee_is_finite
implicit none
!
real a
!
!**********
!*
! 1) return .true. if a is NaN or +Inf or -Inf.
!
! 2) version with ieee_arithmetic intrinsic module
!*
!**********
!
hycom_isnaninf = .not. ieee_is_finite(a)
end function hycom_isnaninf
#else
logical function hycom_isnaninf(a)
implicit none
!
real a
!
!**********
!*
! 1) return .true. if a is NaN or +Inf or -Inf.
!*
!**********
!
hycom_isnaninf = .not. (a.ge.-huge(a) .and. a.le.huge(a))
end
#endif
!
!> Revision history:
!>
!> Jan. 2014 - ieee_arithmetic intrinsic module version via /* NAN2003 */ macro