mom_debugging module reference

Provides checksumming functions for debugging.

More…

Functions/Subroutines

mom_debugging_init()

MOM_debugging_init initializes the MOM_debugging module, and sets the parameterts that control which checks are active for MOM6.

check_redundant_vc3d()

Check for consistency between the duplicated points of a 3-D C-grid vector.

check_redundant_vc2d()

Check for consistency between the duplicated points of a 2-D C-grid vector.

check_redundant_sb3d()

Check for consistency between the duplicated points of a 3-D scalar at corner points.

check_redundant_sb2d()

Check for consistency between the duplicated points of a 2-D scalar at corner points.

check_redundant_vb3d()

Check for consistency between the duplicated points of a 3-D B-grid vector.

check_redundant_vb2d()

Check for consistency between the duplicated points of a 2-D B-grid vector.

check_redundant_st3d()

Check for consistency between the duplicated points of a 3-D scalar at tracer points.

check_redundant_st2d()

Check for consistency between the duplicated points of a 2-D scalar at tracer points.

check_redundant_vt3d()

Check for consistency between the duplicated points of a 3-D A-grid vector.

check_redundant_vt2d()

Check for consistency between the duplicated points of a 2-D A-grid vector.

chksum_vec_c3d()

Do a checksum and redundant point check on a 3d C-grid vector.

chksum_vec_c2d()

Do a checksum and redundant point check on a 2d C-grid vector.

chksum_vec_b3d()

Do a checksum and redundant point check on a 3d B-grid vector.

chksum_vec_b2d()

chksum_vec_a3d()

Do a checksum and redundant point check on a 3d C-grid vector.

chksum_vec_a2d()

Do a checksum and redundant point check on a 2d C-grid vector.

totalstuff()

This function returns the sum over computational domain of all processors of hThick*stuff, where stuff is a 3-d array at tracer points.

totaltands()

This subroutine display the total thickness, temperature and salinity as well as the change since the last call.

check_column_integral()

Returns false if the column integral of a given quantity is within roundoff.

check_column_integrals()

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 parameterts 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)

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

  • v_comp :: [in] The u-component of the vector to be checked for consistency

  • 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

Call to

check_redundant_vc2d

subroutine mom_debugging/check_redundant_vc2d(mesg, u_comp, v_comp, G, is, ie, js, je, direction)

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

  • v_comp :: [in] The u-component of the vector to be checked for consistency

  • 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

Call to

max_redundant_prints mom_error_handler::mom_error redundant_prints

Called from

check_redundant_vc3d

subroutine mom_debugging/check_redundant_sb3d(mesg, array, G, is, ie, js, je)

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

  • 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

Call to

check_redundant_sb2d

subroutine mom_debugging/check_redundant_sb2d(mesg, array, G, is, ie, js, je)

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

  • 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

Call to

max_redundant_prints mom_error_handler::mom_error redundant_prints

Called from

check_redundant_sb3d

subroutine mom_debugging/check_redundant_vb3d(mesg, u_comp, v_comp, G, is, ie, js, je, direction)

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

  • v_comp :: [in] The v-component of the vector to be checked for consistency

  • 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

Call to

check_redundant_vb2d

subroutine mom_debugging/check_redundant_vb2d(mesg, u_comp, v_comp, G, is, ie, js, je, direction)

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

  • v_comp :: [in] The v-component of the vector to be checked for consistency

  • 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

Call to

max_redundant_prints mom_error_handler::mom_error redundant_prints

Called from

check_redundant_vb3d

subroutine mom_debugging/check_redundant_st3d(mesg, array, G, is, ie, js, je)

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

  • 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

Call to

check_redundant_st2d

subroutine mom_debugging/check_redundant_st2d(mesg, array, G, is, ie, js, je)

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

  • 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

Call to

max_redundant_prints redundant_prints

Called from

check_redundant_st3d

subroutine mom_debugging/check_redundant_vt3d(mesg, u_comp, v_comp, G, is, ie, js, je, direction)

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

  • v_comp :: [in] The v-component of the vector to be checked for consistency

  • 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

Call to

check_redundant_vt2d

subroutine mom_debugging/check_redundant_vt2d(mesg, u_comp, v_comp, G, is, ie, js, je, direction)

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

  • v_comp :: [in] The v-component of the vector to be checked for consistency

  • 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

Call to

max_redundant_prints redundant_prints

Called from

check_redundant_vt3d

subroutine mom_debugging/chksum_vec_c3d(mesg, u_comp, v_comp, G, halos, scalars)

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

  • v_comp :: [in] The v-component of the vector

  • halos :: [in] The width of halos to check (default 0)

  • scalars :: [in] If true this is a pair of scalars that are being checked.

Call to

debug_chksums debug_redundant

subroutine mom_debugging/chksum_vec_c2d(mesg, u_comp, v_comp, G, halos, scalars)

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

  • v_comp :: [in] The v-component of the vector

  • halos :: [in] The width of halos to check (default 0)

  • scalars :: [in] If true this is a pair of scalars that are being checked.

Call to

debug_chksums debug_redundant

subroutine mom_debugging/chksum_vec_b3d(mesg, u_comp, v_comp, G, halos, scalars)

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

  • v_comp :: [in] The v-component of the vector

  • halos :: [in] The width of halos to check (default 0)

  • scalars :: [in] If true this is a pair of scalars that are being checked.

Call to

debug_chksums debug_redundant

subroutine mom_debugging/chksum_vec_b2d(mesg, u_comp, v_comp, G, halos, scalars, symmetric)
Parameters
  • mesg :: [in] An identifying message

  • g :: [inout] The ocean’s grid structure

  • u_comp :: [in] The u-component of the vector

  • v_comp :: [in] The v-component of the vector

  • 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.

Call to

debug_chksums debug_redundant

subroutine mom_debugging/chksum_vec_a3d(mesg, u_comp, v_comp, G, halos, scalars)

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

  • v_comp :: [in] The v-component of the vector

  • halos :: [in] The width of halos to check (default 0)

  • scalars :: [in] If true this is a pair of scalars that are being checked.

Call to

debug_chksums debug_redundant

subroutine mom_debugging/chksum_vec_a2d(mesg, u_comp, v_comp, G, halos, scalars)

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

  • v_comp :: [in] The v-component of the vector

  • halos :: [in] The width of halos to check (default 0)

  • scalars :: [in] If true this is a pair of scalars that are being checked.

Call to

debug_chksums debug_redundant

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

  • areat :: [in] The array of cell areas [m2]

  • stuff :: [in] The array of stuff to be summed

Return

undefined :: the globally integrated amoutn of stuff

Called from

totaltands

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

  • areat :: [in] The array of cell areas [m2]

  • temperature :: [in] The temperature field to sum

  • salinity :: [in] The salinity field to sum

  • mesg :: [in] An identifying message

Call to

totalstuff

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

  • known_answer :: [in] If present is the expected sum, 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

  • field_2 :: [in] Second field to be summed

  • missing_value :: [in] If column contains missing values, mask them from the sum

Called from

mom_ale::ale_offline_inputs