mom_debugging module reference¶
Provides checksumming functions for debugging.
Functions/Subroutines¶
MOM_debugging_init initializes the MOM_debugging module, and sets the parameters that control which checks are active for MOM6. |
|
Check for consistency between the duplicated points of a 3-D C-grid vector. |
|
Check for consistency between the duplicated points of a 2-D C-grid vector. |
|
Check for consistency between the duplicated points of a 3-D scalar at corner points. |
|
Check for consistency between the duplicated points of a 2-D scalar at corner points. |
|
Check for consistency between the duplicated points of a 3-D B-grid vector. |
|
Check for consistency between the duplicated points of a 2-D B-grid vector. |
|
Check for consistency between the duplicated points of a 3-D scalar at tracer points. |
|
Check for consistency between the duplicated points of a 2-D scalar at tracer points. |
|
Check for consistency between the duplicated points of a 3-D A-grid vector. |
|
Check for consistency between the duplicated points of a 2-D A-grid vector. |
|
Do a checksum and redundant point check on a 3d C-grid vector. |
|
Do a checksum and redundant point check on a 2d C-grid vector. |
|
Do a checksum and redundant point check on a 3d B-grid vector. |
|
Do a checksum and redundant point check on a 3d C-grid vector. |
|
Do a checksum and redundant point check on a 2d C-grid vector. |
|
This function returns the sum over computational domain of all processors of hThick*stuff, where stuff is a 3-d array at tracer points. |
|
This subroutine display the total thickness, temperature and salinity as well as the change since the last call. |
|
Returns false if the column integral of a given quantity is within roundoff. |
|
Returns false if the column integrals of two given quantities are within roundoff of each other. |
Detailed Description¶
This module contains subroutines that perform various error checking and debugging functions for MOM6. This routine is similar to it counterpart in the SIS2 code, except for the use of the ocean_grid_type and by keeping them separate we retain the ability to set up MOM6 and SIS2 debugging separately.
Function/Subroutine Documentation¶
-
subroutine
mom_debugging/
mom_debugging_init
(param_file)¶ MOM_debugging_init initializes the MOM_debugging module, and sets the parameters that control which checks are active for MOM6.
- Parameters:
param_file :: [in] A structure to parse for run-time parameters
- Call to:
debug
debug_chksums
debug_redundant
mom_checksums::mom_checksums_init
-
subroutine
mom_debugging/
check_redundant_vc3d
(mesg, u_comp, v_comp, G, is, ie, js, je, direction, unscale)¶ Check for consistency between the duplicated points of a 3-D C-grid vector.
- Parameters:
mesg :: [in] An identifying message
g :: [inout] The ocean’s grid structure
u_comp :: [in] The u-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
v_comp :: [in] The u-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
is :: [in] The starting i-index to check
ie :: [in] The ending i-index to check
js :: [in] The starting j-index to check
je :: [in] The ending j-index to check
direction :: [in] the direction flag to be passed to pass_vector
unscale :: [in] A factor that undoes the scaling for the arrays to give consistent output [a A-1 ~> 1]
-
subroutine
mom_debugging/
check_redundant_vc2d
(mesg, u_comp, v_comp, G, is, ie, js, je, direction, unscale)¶ Check for consistency between the duplicated points of a 2-D C-grid vector.
- Parameters:
mesg :: [in] An identifying message
g :: [inout] The ocean’s grid structure
u_comp :: [in] The u-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
v_comp :: [in] The u-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
is :: [in] The starting i-index to check
ie :: [in] The ending i-index to check
js :: [in] The starting j-index to check
je :: [in] The ending j-index to check
direction :: [in] the direction flag to be passed to pass_vector
unscale :: [in] A factor that undoes the scaling for the arrays to give consistent output [a A-1 ~> 1]
- Called from:
-
subroutine
mom_debugging/
check_redundant_sb3d
(mesg, array, G, is, ie, js, je, unscale)¶ Check for consistency between the duplicated points of a 3-D scalar at corner points.
- Parameters:
mesg :: [in] An identifying message
g :: [inout] The ocean’s grid structure
array :: [in] The array to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
is :: [in] The starting i-index to check
ie :: [in] The ending i-index to check
js :: [in] The starting j-index to check
je :: [in] The ending j-index to check
unscale :: [in] A factor that undoes the scaling for the arrays to give consistent output [a A-1 ~> 1]
-
subroutine
mom_debugging/
check_redundant_sb2d
(mesg, array, G, is, ie, js, je, unscale)¶ Check for consistency between the duplicated points of a 2-D scalar at corner points.
- Parameters:
mesg :: [in] An identifying message
g :: [inout] The ocean’s grid structure
array :: [in] The array to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
is :: [in] The starting i-index to check
ie :: [in] The ending i-index to check
js :: [in] The starting j-index to check
je :: [in] The ending j-index to check
unscale :: [in] A factor that undoes the scaling for the arrays to give consistent output [a A-1 ~> 1]
- Called from:
-
subroutine
mom_debugging/
check_redundant_vb3d
(mesg, u_comp, v_comp, G, is, ie, js, je, direction, unscale)¶ Check for consistency between the duplicated points of a 3-D B-grid vector.
- Parameters:
mesg :: [in] An identifying message
g :: [inout] The ocean’s grid structure
u_comp :: [in] The u-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
v_comp :: [in] The v-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
is :: [in] The starting i-index to check
ie :: [in] The ending i-index to check
js :: [in] The starting j-index to check
je :: [in] The ending j-index to check
direction :: [in] the direction flag to be passed to pass_vector
unscale :: [in] A factor that undoes the scaling for the arrays to give consistent output [a A-1 ~> 1]
-
subroutine
mom_debugging/
check_redundant_vb2d
(mesg, u_comp, v_comp, G, is, ie, js, je, direction, unscale)¶ Check for consistency between the duplicated points of a 2-D B-grid vector.
- Parameters:
mesg :: [in] An identifying message
g :: [inout] The ocean’s grid structure
u_comp :: [in] The u-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
v_comp :: [in] The v-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
is :: [in] The starting i-index to check
ie :: [in] The ending i-index to check
js :: [in] The starting j-index to check
je :: [in] The ending j-index to check
direction :: [in] the direction flag to be passed to pass_vector
unscale :: [in] A factor that undoes the scaling for the arrays to give consistent output [a A-1 ~> 1]
- Called from:
-
subroutine
mom_debugging/
check_redundant_st3d
(mesg, array, G, is, ie, js, je, unscale)¶ Check for consistency between the duplicated points of a 3-D scalar at tracer points.
- Parameters:
mesg :: [in] An identifying message
g :: [inout] The ocean’s grid structure
array :: [in] The array to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
is :: [in] The starting i-index to check
ie :: [in] The ending i-index to check
js :: [in] The starting j-index to check
je :: [in] The ending j-index to check
unscale :: [in] A factor that undoes the scaling for the arrays to give consistent output [a A-1 ~> 1]
-
subroutine
mom_debugging/
check_redundant_st2d
(mesg, array, G, is, ie, js, je, unscale)¶ Check for consistency between the duplicated points of a 2-D scalar at tracer points.
- Parameters:
mesg :: [in] An identifying message
g :: [inout] The ocean’s grid structure
array :: [in] The array to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
is :: [in] The starting i-index to check
ie :: [in] The ending i-index to check
js :: [in] The starting j-index to check
je :: [in] The ending j-index to check
unscale :: [in] A factor that undoes the scaling for the arrays to give consistent output [a A-1 ~> 1]
- Called from:
-
subroutine
mom_debugging/
check_redundant_vt3d
(mesg, u_comp, v_comp, G, is, ie, js, je, direction, unscale)¶ Check for consistency between the duplicated points of a 3-D A-grid vector.
- Parameters:
mesg :: [in] An identifying message
g :: [inout] The ocean’s grid structure
u_comp :: [in] The u-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
v_comp :: [in] The v-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
is :: [in] The starting i-index to check
ie :: [in] The ending i-index to check
js :: [in] The starting j-index to check
je :: [in] The ending j-index to check
direction :: [in] the direction flag to be passed to pass_vector
unscale :: [in] A factor that undoes the scaling for the arrays to give consistent output [a A-1 ~> 1]
-
subroutine
mom_debugging/
check_redundant_vt2d
(mesg, u_comp, v_comp, G, is, ie, js, je, direction, unscale)¶ Check for consistency between the duplicated points of a 2-D A-grid vector.
- Parameters:
mesg :: [in] An identifying message
g :: [inout] The ocean’s grid structure
u_comp :: [in] The u-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
v_comp :: [in] The v-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
is :: [in] The starting i-index to check
ie :: [in] The ending i-index to check
js :: [in] The starting j-index to check
je :: [in] The ending j-index to check
direction :: [in] the direction flag to be passed to pass_vector
unscale :: [in] A factor that undoes the scaling for the arrays to give consistent output [a A-1 ~> 1]
- Called from:
-
subroutine
mom_debugging/
chksum_vec_c3d
(mesg, u_comp, v_comp, G, halos, scalars, unscale)¶ Do a checksum and redundant point check on a 3d C-grid vector.
- Parameters:
mesg :: [in] An identifying message
g :: [inout] The ocean’s grid structure
u_comp :: [in] The u-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
v_comp :: [in] The v-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
halos :: [in] The width of halos to check (default 0)
scalars :: [in] If true this is a pair of scalars that are being checked.
unscale :: [in] A factor that undoes the scaling for the arrays to give consistent output [a A-1 ~> 1]
-
subroutine
mom_debugging/
chksum_vec_c2d
(mesg, u_comp, v_comp, G, halos, scalars, unscale)¶ Do a checksum and redundant point check on a 2d C-grid vector.
- Parameters:
mesg :: [in] An identifying message
g :: [inout] The ocean’s grid structure
u_comp :: [in] The u-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
v_comp :: [in] The v-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
halos :: [in] The width of halos to check (default 0)
scalars :: [in] If true this is a pair of scalars that are being checked.
unscale :: [in] A factor that undoes the scaling for the arrays to give consistent output [a A-1 ~> 1]
-
subroutine
mom_debugging/
chksum_vec_b3d
(mesg, u_comp, v_comp, G, halos, scalars, unscale)¶ Do a checksum and redundant point check on a 3d B-grid vector.
- Parameters:
mesg :: [in] An identifying message
g :: [inout] The ocean’s grid structure
u_comp :: [in] The u-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
v_comp :: [in] The v-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
halos :: [in] The width of halos to check (default 0)
scalars :: [in] If true this is a pair of scalars that are being checked.
unscale :: [in] A factor that undoes the scaling for the arrays to give consistent output [a A-1 ~> 1]
-
subroutine
mom_debugging/
chksum_vec_b2d
(mesg, u_comp, v_comp, G, halos, scalars, symmetric, unscale)¶ - Parameters:
mesg :: [in] An identifying message
g :: [inout] The ocean’s grid structure
u_comp :: [in] The u-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
v_comp :: [in] The v-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
halos :: [in] The width of halos to check (default 0)
scalars :: [in] If true this is a pair of scalars that are being checked.
symmetric :: [in] If true, do the checksums on the full symmetric computational domain.
unscale :: [in] A factor that undoes the scaling for the arrays to give consistent output [a A-1 ~> 1]
-
subroutine
mom_debugging/
chksum_vec_a3d
(mesg, u_comp, v_comp, G, halos, scalars, unscale)¶ Do a checksum and redundant point check on a 3d C-grid vector.
- Parameters:
mesg :: [in] An identifying message
g :: [inout] The ocean’s grid structure
u_comp :: [in] The u-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
v_comp :: [in] The v-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
halos :: [in] The width of halos to check (default 0)
scalars :: [in] If true this is a pair of scalars that are being checked.
unscale :: [in] A factor that undoes the scaling for the arrays to give consistent output [a A-1 ~> 1]
-
subroutine
mom_debugging/
chksum_vec_a2d
(mesg, u_comp, v_comp, G, halos, scalars, unscale)¶ Do a checksum and redundant point check on a 2d C-grid vector.
- Parameters:
mesg :: [in] An identifying message
g :: [inout] The ocean’s grid structure
u_comp :: [in] The u-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
v_comp :: [in] The v-component of the vector to be checked for consistency in arbitrary, possibly rescaled units [A ~> a]
halos :: [in] The width of halos to check (default 0)
scalars :: [in] If true this is a pair of scalars that are being checked.
unscale :: [in] A factor that undoes the scaling for the arrays to give consistent output [a A-1 ~> 1]
-
function
mom_debugging/
totalstuff
(HI, hThick, areaT, stuff) [real]¶ This function returns the sum over computational domain of all processors of hThick*stuff, where stuff is a 3-d array at tracer points.
- Parameters:
hi :: [in] A horizontal index type
hthick :: [in] The array of thicknesses to use as weights [m]
areat :: [in] The array of cell areas [m2]
stuff :: [in] The array of stuff to be summed in arbitrary units [a]
- Return:
undefined :: the globally integrated amount of stuff [a m3]
- Called from:
-
subroutine
mom_debugging/
totaltands
(HI, hThick, areaT, temperature, salinity, mesg)¶ This subroutine display the total thickness, temperature and salinity as well as the change since the last call.
- Parameters:
hi :: [in] A horizontal index type
hthick :: [in] The array of thicknesses to use as weights [m]
areat :: [in] The array of cell areas [m2]
temperature :: [in] The temperature field to sum [degC]
salinity :: [in] The salinity field to sum [ppt]
mesg :: [in] An identifying message
- Call to:
-
function
mom_debugging/
check_column_integral
(nk, field, known_answer) [logical]¶ Returns false if the column integral of a given quantity is within roundoff.
- Parameters:
nk :: [in] Number of levels in column
field :: [in] Field to be summed [arbitrary]
known_answer :: [in] If present is the expected sum [arbitrary], If missing, assumed zero
-
function
mom_debugging/
check_column_integrals
(nk_1, field_1, nk_2, field_2, missing_value) [logical]¶ Returns false if the column integrals of two given quantities are within roundoff of each other.
- Parameters:
nk_1 :: [in] Number of levels in field 1
nk_2 :: [in] Number of levels in field 2
field_1 :: [in] First field to be summed [arbitrary]
field_2 :: [in] Second field to be summed [arbitrary]
missing_value :: [in] If column contains missing values, mask them from the sum [arbitrary]
- Called from: