MOM6
mom_checksums::is_nan Interface Reference

Detailed Description

Definition at line 77 of file MOM_checksums.F90.

Private functions

logical function is_nan_0d (x)
 This function returns .true. if x is a NaN, and .false. otherwise. More...
 
logical function is_nan_1d (x, skip_mpp)
 This function returns .true. if any element of x is a NaN, and .false. otherwise. More...
 
logical function is_nan_2d (x)
 This function returns .true. if any element of x is a NaN, and .false. otherwise. More...
 
logical function is_nan_3d (x)
 This function returns .true. if any element of x is a NaN, and .false. otherwise. More...
 

Functions and subroutines

◆ is_nan_0d()

logical function mom_checksums::is_nan::is_nan_0d ( real, intent(in)  x)
private

This function returns .true. if x is a NaN, and .false. otherwise.

Parameters
[in]xThe value to be checked for NaNs.

Definition at line 1322 of file MOM_checksums.F90.

1322  real, intent(in) :: x !< The value to be checked for NaNs.
1323  logical :: is_nan_0d
1324 
1325  !is_NaN_0d = (((x < 0.0) .and. (x >= 0.0)) .or. &
1326  ! (.not.(x < 0.0) .and. .not.(x >= 0.0)))
1327  if (((x < 0.0) .and. (x >= 0.0)) .or. &
1328  (.not.(x < 0.0) .and. .not.(x >= 0.0))) then
1329  is_nan_0d = .true.
1330  else
1331  is_nan_0d = .false.
1332  endif
1333 

◆ is_nan_1d()

logical function mom_checksums::is_nan::is_nan_1d ( real, dimension(:), intent(in)  x,
logical, optional  skip_mpp 
)
private

This function returns .true. if any element of x is a NaN, and .false. otherwise.

Parameters
[in]xThe array to be checked for NaNs.
skip_mppIf true, only check this array only on the local PE (default false).

Definition at line 1340 of file MOM_checksums.F90.

1340  real, dimension(:), intent(in) :: x !< The array to be checked for NaNs.
1341  logical :: is_nan_1d
1342  logical, optional :: skip_mpp !< If true, only check this array only on the local PE (default false).
1343 
1344  integer :: i, n
1345  logical :: call_mpp
1346 
1347  n = 0
1348  do i = lbound(x,1), ubound(x,1)
1349  if (is_nan_0d(x(i))) n = n + 1
1350  enddo
1351  call_mpp = .true.
1352  if (present(skip_mpp)) call_mpp = .not.skip_mpp
1353 
1354  if (call_mpp) call sum_across_pes(n)
1355  is_nan_1d = .false.
1356  if (n>0) is_nan_1d = .true.
1357 

◆ is_nan_2d()

logical function mom_checksums::is_nan::is_nan_2d ( real, dimension(:,:), intent(in)  x)
private

This function returns .true. if any element of x is a NaN, and .false. otherwise.

Parameters
[in]xThe array to be checked for NaNs.

Definition at line 1364 of file MOM_checksums.F90.

1364  real, dimension(:,:), intent(in) :: x !< The array to be checked for NaNs.
1365  logical :: is_nan_2d
1366 
1367  integer :: i, j, n
1368 
1369  n = 0
1370  do j = lbound(x,2), ubound(x,2) ; do i = lbound(x,1), ubound(x,1)
1371  if (is_nan_0d(x(i,j))) n = n + 1
1372  enddo ; enddo
1373  call sum_across_pes(n)
1374  is_nan_2d = .false.
1375  if (n>0) is_nan_2d = .true.
1376 

◆ is_nan_3d()

logical function mom_checksums::is_nan::is_nan_3d ( real, dimension(:,:,:), intent(in)  x)
private

This function returns .true. if any element of x is a NaN, and .false. otherwise.

Parameters
[in]xThe array to be checked for NaNs.

Definition at line 1383 of file MOM_checksums.F90.

1383  real, dimension(:,:,:), intent(in) :: x !< The array to be checked for NaNs.
1384  logical :: is_nan_3d
1385 
1386  integer :: i, j, k, n
1387 
1388  n = 0
1389  do k = lbound(x,3), ubound(x,3)
1390  do j = lbound(x,2), ubound(x,2) ; do i = lbound(x,1), ubound(x,1)
1391  if (is_nan_0d(x(i,j,k))) n = n + 1
1392  enddo ; enddo
1393  enddo
1394  call sum_across_pes(n)
1395  is_nan_3d = .false.
1396  if (n>0) is_nan_3d = .true.
1397 

The documentation for this interface was generated from the following file: