mom_checksums module reference¶
Routines to calculate checksums of various array and vector types.
Functions/Subroutines¶
Checksum a scalar field (consistent with array checksums) |
|
Checksum a 1d array (typically a column). |
|
Checksums on a pair of 2d arrays staggered at tracer points. |
|
Checksums on a pair of 3d arrays staggered at tracer points. |
|
Checksums a 2d array staggered at tracer points. |
|
Checksums on a pair of 2d arrays staggered at q-points. |
|
Checksums on a pair of 3d arrays staggered at q-points. |
|
Checksums a 2d array staggered at corner points. |
|
Checksums a pair of 2d velocity arrays staggered at C-grid locations. |
|
Checksums a pair of 3d velocity arrays staggered at C-grid locations. |
|
Checksums a 2d array staggered at C-grid u points. |
|
Checksums a 2d array staggered at C-grid v points. |
|
Checksums a 3d array staggered at tracer points. |
|
Checksums a 3d array staggered at corner points. |
|
Checksums a 3d array staggered at C-grid u points. |
|
Checksums a 3d array staggered at C-grid v points. |
|
chksum1d does a checksum of a 1-dimensional array. |
|
chksum2d does a checksum of all data in a 2-d array. |
|
chksum3d does a checksum of all data in a 2-d array. |
|
This function returns .true. |
|
Returns .true. |
|
Returns .true. |
|
Returns .true. |
|
Write a message including the checksum of the non-shifted array. |
|
Write a message including checksums of non-shifted and diagonally shifted arrays. |
|
Write a message including checksums of non-shifted and laterally shifted arrays. |
|
Write a message including checksums of non-shifted and southward shifted arrays. |
|
Write a message including checksums of non-shifted and westward shifted arrays. |
|
Write a message including checksums of non-shifted and southwestward shifted arrays. |
|
Write a message including the global mean, maximum and minimum of an array. |
|
MOM_checksums_init initializes the MOM_checksums module. |
|
A wrapper for MOM_error used in the checksum code. |
|
Does a bitcount of a number by first casting to an integer and then using BTEST to check bit by bit. |
Detailed Description¶
Routines to calculate checksums of various array and vector types.
Function/Subroutine Documentation¶
-
subroutine
mom_checksums/
chksum0
(scalar, mesg, scale, logunit)¶ Checksum a scalar field (consistent with array checksums)
- Parameters
scalar :: [in] The array to be checksummed
mesg :: [in] An identifying message
scale :: [in] A scaling factor for this array.
logunit :: [in] IO unit for checksum logging
- Call to
bc_modulus
bitcount
calculatestatistics
checkfornans
chksum_error
mom_error_handler::is_root_pe
writechksums
-
subroutine
mom_checksums/
zchksum
(array, mesg, scale, logunit)¶ Checksum a 1d array (typically a column).
- Parameters
array :: [in] The array to be checksummed
mesg :: [in] An identifying message
scale :: [in] A scaling factor for this array.
logunit :: [in] IO unit for checksum logging
- Call to
calculatestatistics
checkfornans
chksum_error
mom_error_handler::is_root_pe
subchk
substats
writechksums
-
subroutine
mom_checksums/
chksum_pair_h_2d
(mesg, arrayA, arrayB, HI, haloshift, omit_corners, scale, logunit, scalar_pair)¶ Checksums on a pair of 2d arrays staggered at tracer points.
- Parameters
mesg :: [in] Identifying messages
hi :: [in] A horizontal index type
arraya :: [in] The first array to be checksummed
arrayb :: [in] The second array to be checksummed
haloshift :: [in] The width of halos to check (default 0)
omit_corners :: [in] If true, avoid checking diagonal shifts
scale :: [in] A scaling factor for this array.
logunit :: [in] IO unit for checksum logging
scalar_pair :: [in] If true, then the arrays describe a scalar, rather than vector
- Call to
-
subroutine
mom_checksums/
chksum_pair_h_3d
(mesg, arrayA, arrayB, HI, haloshift, omit_corners, scale, logunit, scalar_pair)¶ Checksums on a pair of 3d arrays staggered at tracer points.
- Parameters
mesg :: [in] Identifying messages
hi :: [in] A horizontal index type
arraya :: [in] The first array to be checksummed
arrayb :: [in] The second array to be checksummed
haloshift :: [in] The width of halos to check (default 0)
omit_corners :: [in] If true, avoid checking diagonal shifts
scale :: [in] A scaling factor for this array.
logunit :: [in] IO unit for checksum logging
scalar_pair :: [in] If true, then the arrays describe a scalar, rather than vector
- Call to
-
subroutine
mom_checksums/
chksum_h_2d
(array_m, mesg, HI_m, haloshift, omit_corners, scale, logunit)¶ Checksums a 2d array staggered at tracer points.
- Parameters
hi_m :: [in] Horizontal index bounds of the model grid
array_m :: [in] Field array on the model grid
mesg :: [in] An identifying message
haloshift :: [in] The width of halos to check (default 0)
omit_corners :: [in] If true, avoid checking diagonal shifts
scale :: [in] A scaling factor for this array.
logunit :: [in] IO unit for checksum logging
- Call to
calculatestatistics
checkfornans
chk_sum_msg_nsew
chksum_error
default_shift
mom_error_handler::is_root_pe
mom_hor_index::rotate_hor_index
subchk
substats
writechksums
- Called from
-
subroutine
mom_checksums/
chksum_pair_b_2d
(mesg, arrayA, arrayB, HI, haloshift, symmetric, omit_corners, scale, logunit, scalar_pair)¶ Checksums on a pair of 2d arrays staggered at q-points.
- Parameters
mesg :: [in] Identifying messages
hi :: [in] A horizontal index type
arraya :: [in] The first array to be checksummed
arrayb :: [in] The second array to be checksummed
symmetric :: [in] If true, do the checksums on the full symmetric computational domain.
haloshift :: [in] The width of halos to check (default 0)
omit_corners :: [in] If true, avoid checking diagonal shifts
scale :: [in] A scaling factor for this array.
logunit :: [in] IO unit for checksum logging
scalar_pair :: [in] If true, then the arrays describe a scalar, rather than vector
- Call to
-
subroutine
mom_checksums/
chksum_pair_b_3d
(mesg, arrayA, arrayB, HI, haloshift, symmetric, omit_corners, scale, logunit, scalar_pair)¶ Checksums on a pair of 3d arrays staggered at q-points.
- Parameters
mesg :: [in] Identifying messages
hi :: [in] A horizontal index type
arraya :: [in] The first array to be checksummed
arrayb :: [in] The second array to be checksummed
haloshift :: [in] The width of halos to check (default 0)
symmetric :: [in] If true, do the checksums on the full symmetric computational domain.
omit_corners :: [in] If true, avoid checking diagonal shifts
scale :: [in] A scaling factor for this array.
logunit :: [in] IO unit for checksum logging
scalar_pair :: [in] If true, then the arrays describe a scalar, rather than vector
- Call to
-
subroutine
mom_checksums/
chksum_b_2d
(array_m, mesg, HI_m, haloshift, symmetric, omit_corners, scale, logunit)¶ Checksums a 2d array staggered at corner points.
- Parameters
hi_m :: [in] A horizontal index type
array_m :: [in] The array to be checksummed
mesg :: [in] An identifying message
haloshift :: [in] The width of halos to check (default 0)
symmetric :: [in] If true, do the checksums on the full symmetric computational domain.
omit_corners :: [in] If true, avoid checking diagonal shifts
scale :: [in] A scaling factor for this array.
logunit :: [in] IO unit for checksum logging
- Call to
calculatestatistics
checkfornans
chk_sum_msg_nsew
chksum_error
default_shift
mom_error_handler::is_root_pe
mom_hor_index::rotate_hor_index
subchk
substats
writechksums
- Called from
-
subroutine
mom_checksums/
chksum_uv_2d
(mesg, arrayU, arrayV, HI, haloshift, symmetric, omit_corners, scale, logunit, scalar_pair)¶ Checksums a pair of 2d velocity arrays staggered at C-grid locations.
- Parameters
mesg :: [in] Identifying messages
hi :: [in] A horizontal index type
arrayu :: [in] The u-component array to be checksummed
arrayv :: [in] The v-component array to be checksummed
haloshift :: [in] The width of halos to check (default 0)
symmetric :: [in] If true, do the checksums on the full symmetric computational domain.
omit_corners :: [in] If true, avoid checking diagonal shifts
scale :: [in] A scaling factor for these arrays.
logunit :: [in] IO unit for checksum logging
scalar_pair :: [in] If true, then the arrays describe a a scalar, rather than vector
- Call to
-
subroutine
mom_checksums/
chksum_uv_3d
(mesg, arrayU, arrayV, HI, haloshift, symmetric, omit_corners, scale, logunit, scalar_pair)¶ Checksums a pair of 3d velocity arrays staggered at C-grid locations.
- Parameters
mesg :: [in] Identifying messages
hi :: [in] A horizontal index type
arrayu :: [in] The u-component array to be checksummed
arrayv :: [in] The v-component array to be checksummed
haloshift :: [in] The width of halos to check (default 0)
symmetric :: [in] If true, do the checksums on the full symmetric computational domain.
omit_corners :: [in] If true, avoid checking diagonal shifts
scale :: [in] A scaling factor for these arrays.
logunit :: [in] IO unit for checksum logging
scalar_pair :: [in] If true, then the arrays describe a a scalar, rather than vector
- Call to
-
subroutine
mom_checksums/
chksum_u_2d
(array_m, mesg, HI_m, haloshift, symmetric, omit_corners, scale, logunit)¶ Checksums a 2d array staggered at C-grid u points.
- Parameters
hi_m :: [in] A horizontal index type
array_m :: [in] The array to be checksummed
mesg :: [in] An identifying message
haloshift :: [in] The width of halos to check (default 0)
symmetric :: [in] If true, do the checksums on the full symmetric computational domain.
omit_corners :: [in] If true, avoid checking diagonal shifts
scale :: [in] A scaling factor for this array.
logunit :: [in] IO unit for checksum logging
- Call to
calculatestatistics
checkfornans
chk_sum_msg_nsew
chk_sum_msg_w
chksum_error
default_shift
mom_error_handler::is_root_pe
mom_hor_index::rotate_hor_index
subchk
substats
writechksums
- Called from
-
subroutine
mom_checksums/
chksum_v_2d
(array_m, mesg, HI_m, haloshift, symmetric, omit_corners, scale, logunit)¶ Checksums a 2d array staggered at C-grid v points.
- Parameters
hi_m :: [in] A horizontal index type
array_m :: [in] The array to be checksummed
mesg :: [in] An identifying message
haloshift :: [in] The width of halos to check (default 0)
symmetric :: [in] If true, do the checksums on the full symmetric computational domain.
omit_corners :: [in] If true, avoid checking diagonal shifts
scale :: [in] A scaling factor for this array.
logunit :: [in] IO unit for checksum logging
- Call to
calculatestatistics
checkfornans
chk_sum_msg_nsew
chk_sum_msg_s
chksum_error
default_shift
mom_error_handler::is_root_pe
mom_hor_index::rotate_hor_index
subchk
substats
writechksums
- Called from
-
subroutine
mom_checksums/
chksum_h_3d
(array_m, mesg, HI_m, haloshift, omit_corners, scale, logunit)¶ Checksums a 3d array staggered at tracer points.
- Parameters
hi_m :: [in] A horizontal index type
array_m :: [in] The array to be checksummed
mesg :: [in] An identifying message
haloshift :: [in] The width of halos to check (default 0)
omit_corners :: [in] If true, avoid checking diagonal shifts
scale :: [in] A scaling factor for this array.
logunit :: [in] IO unit for checksum logging
- Call to
calculatestatistics
checkfornans
chk_sum_msg_nsew
chksum_error
default_shift
mom_error_handler::is_root_pe
mom_hor_index::rotate_hor_index
subchk
substats
writechksums
- Called from
-
subroutine
mom_checksums/
chksum_b_3d
(array_m, mesg, HI_m, haloshift, symmetric, omit_corners, scale, logunit)¶ Checksums a 3d array staggered at corner points.
- Parameters
hi_m :: [in] A horizontal index type
array_m :: [in] The array to be checksummed
mesg :: [in] An identifying message
haloshift :: [in] The width of halos to check (default 0)
symmetric :: [in] If true, do the checksums on the full symmetric computational domain.
omit_corners :: [in] If true, avoid checking diagonal shifts
scale :: [in] A scaling factor for this array.
logunit :: [in] IO unit for checksum logging
- Call to
calculatestatistics
checkfornans
chk_sum_msg_nsew
chksum_error
default_shift
mom_error_handler::is_root_pe
mom_hor_index::rotate_hor_index
subchk
substats
writechksums
- Called from
-
subroutine
mom_checksums/
chksum_u_3d
(array_m, mesg, HI_m, haloshift, symmetric, omit_corners, scale, logunit)¶ Checksums a 3d array staggered at C-grid u points.
- Parameters
hi_m :: [in] A horizontal index type
array_m :: [in] The array to be checksummed
mesg :: [in] An identifying message
haloshift :: [in] The width of halos to check (default 0)
symmetric :: [in] If true, do the checksums on the full symmetric computational domain.
omit_corners :: [in] If true, avoid checking diagonal shifts
scale :: [in] A scaling factor for this array.
logunit :: [in] IO unit for checksum logging
- Call to
calculatestatistics
checkfornans
chk_sum_msg_nsew
chk_sum_msg_w
chksum_error
default_shift
mom_error_handler::is_root_pe
mom_hor_index::rotate_hor_index
subchk
substats
writechksums
- Called from
-
subroutine
mom_checksums/
chksum_v_3d
(array_m, mesg, HI_m, haloshift, symmetric, omit_corners, scale, logunit)¶ Checksums a 3d array staggered at C-grid v points.
- Parameters
hi_m :: [in] A horizontal index type
array_m :: [in] The array to be checksummed
mesg :: [in] An identifying message
haloshift :: [in] The width of halos to check (default 0)
symmetric :: [in] If true, do the checksums on the full symmetric computational domain.
omit_corners :: [in] If true, avoid checking diagonal shifts
scale :: [in] A scaling factor for this array.
logunit :: [in] IO unit for checksum logging
- Call to
calculatestatistics
checkfornans
chk_sum_msg_nsew
chk_sum_msg_s
chksum_error
default_shift
mom_error_handler::is_root_pe
mom_hor_index::rotate_hor_index
subchk
substats
writechksums
- Called from
-
subroutine
mom_checksums/
chksum1d
(array, mesg, start_i, end_i, compare_PEs)¶ chksum1d does a checksum of a 1-dimensional array.
- Parameters
array :: [in] The array to be summed (index starts at 1).
mesg :: [in] An identifying message.
start_i :: [in] The starting index for the sum (default 1)
end_i :: [in] The ending index for the sum (default all)
compare_pes :: [in] If true, compare across PEs instead of summing and list the root_PE value (default true)
- Call to
-
subroutine
mom_checksums/
chksum2d
(array, mesg)¶ chksum2d does a checksum of all data in a 2-d array.
- Parameters
array :: The array to be checksummed
mesg :: An identifying message
- Call to
-
subroutine
mom_checksums/
chksum3d
(array, mesg)¶ chksum3d does a checksum of all data in a 2-d array.
- Parameters
array :: The array to be checksummed
mesg :: An identifying message
- Call to
-
function
mom_checksums/
is_nan_0d
(x) [logical]¶ This function returns .true. if x is a NaN, and .false. otherwise.
-
function
mom_checksums/
is_nan_1d
(x, skip_mpp) [logical]¶ Returns .true. if any element of x is a NaN, and .false. otherwise.
- Parameters
x :: [in] The array to be checked for NaNs.
skip_mpp :: [in] If true, only check this array only on the local PE (default false).
- Call to
-
function
mom_checksums/
is_nan_2d
(x) [logical]¶ Returns .true. if any element of x is a NaN, and .false. otherwise.
- Parameters
x :: [in] The array to be checked for NaNs.
- Call to
-
function
mom_checksums/
is_nan_3d
(x) [logical]¶ Returns .true. if any element of x is a NaN, and .false. otherwise.
- Parameters
x :: [in] The array to be checked for NaNs.
- Call to
-
subroutine
mom_checksums/
chk_sum_msg1
(fmsg, bc0, mesg, iounit)¶ Write a message including the checksum of the non-shifted array.
- Parameters
fmsg :: [in] A checksum code-location specific preamble
mesg :: [in] An identifying message supplied by top-level caller
bc0 :: [in] The bitcount of the non-shifted array
iounit :: [in] Checksum logger IO unit
- Call to
-
subroutine
mom_checksums/
chk_sum_msg5
(fmsg, bc0, bcSW, bcSE, bcNW, bcNE, mesg, iounit)¶ Write a message including checksums of non-shifted and diagonally shifted arrays.
- Parameters
fmsg :: [in] A checksum code-location specific preamble
mesg :: [in] An identifying message supplied by top-level caller
bc0 :: [in] The bitcount of the non-shifted array
bcsw :: [in] The bitcount for SW shifted array
bcse :: [in] The bitcount for SE shifted array
bcnw :: [in] The bitcount for NW shifted array
bcne :: [in] The bitcount for NE shifted array
iounit :: [in] Checksum logger IO unit
- Call to
-
subroutine
mom_checksums/
chk_sum_msg_nsew
(fmsg, bc0, bcN, bcS, bcE, bcW, mesg, iounit)¶ Write a message including checksums of non-shifted and laterally shifted arrays.
- Parameters
fmsg :: [in] A checksum code-location specific preamble
mesg :: [in] An identifying message supplied by top-level caller
bc0 :: [in] The bitcount of the non-shifted array
bcn :: [in] The bitcount for N shifted array
bcs :: [in] The bitcount for S shifted array
bce :: [in] The bitcount for E shifted array
bcw :: [in] The bitcount for W shifted array
iounit :: [in] Checksum logger IO unit
- Call to
- Called from
chksum_b_2d
chksum_b_3d
chksum_h_2d
chksum_h_3d
chksum_u_2d
chksum_u_3d
chksum_v_2d
chksum_v_3d
-
subroutine
mom_checksums/
chk_sum_msg_s
(fmsg, bc0, bcS, mesg, iounit)¶ Write a message including checksums of non-shifted and southward shifted arrays.
- Parameters
fmsg :: [in] A checksum code-location specific preamble
mesg :: [in] An identifying message supplied by top-level caller
bc0 :: [in] The bitcount of the non-shifted array
bcs :: [in] The bitcount of the south-shifted array
iounit :: [in] Checksum logger IO unit
- Call to
- Called from
-
subroutine
mom_checksums/
chk_sum_msg_w
(fmsg, bc0, bcW, mesg, iounit)¶ Write a message including checksums of non-shifted and westward shifted arrays.
- Parameters
fmsg :: [in] A checksum code-location specific preamble
mesg :: [in] An identifying message supplied by top-level caller
bc0 :: [in] The bitcount of the non-shifted array
bcw :: [in] The bitcount of the west-shifted array
iounit :: [in] Checksum logger IO unit
- Call to
- Called from
-
subroutine
mom_checksums/
chk_sum_msg2
(fmsg, bc0, bcSW, mesg, iounit)¶ Write a message including checksums of non-shifted and southwestward shifted arrays.
- Parameters
fmsg :: [in] A checksum code-location specific preamble
mesg :: [in] An identifying message supplied by top-level caller
bc0 :: [in] The bitcount of the non-shifted array
bcsw :: [in] The bitcount of the southwest-shifted array
iounit :: [in] Checksum logger IO unit
- Call to
-
subroutine
mom_checksums/
chk_sum_msg3
(fmsg, aMean, aMin, aMax, mesg, iounit)¶ Write a message including the global mean, maximum and minimum of an array.
- Parameters
fmsg :: [in] A checksum code-location specific preamble
mesg :: [in] An identifying message supplied by top-level caller
amean :: [in] The mean value of the array
amin :: [in] The minimum value of the array
amax :: [in] The maximum value of the array
iounit :: [in] Checksum logger IO unit
- Call to
-
subroutine
mom_checksums/
mom_checksums_init
(param_file)¶ MOM_checksums_init initializes the MOM_checksums module. As it happens, the only thing that it does is to log the version of this module.
- Parameters
param_file :: [in] A structure to parse for run-time parameters
- Called from
-
subroutine
mom_checksums/
chksum_error
(signal, message)¶ A wrapper for MOM_error used in the checksum code.
- Parameters
signal :: [in] An error severity level, such as FATAL or WARNING
message :: [in] An error message
- Call to
- Called from
chksum0
chksum_b_2d
chksum_b_3d
chksum_h_2d
chksum_h_3d
chksum_u_2d
chksum_u_3d
chksum_v_2d
chksum_v_3d
zchksum