MOM6
|
Provides checksumming functions for debugging.
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.
Data Types | |
interface | check_redundant |
Check for consistency between the duplicated points of a C-grid vector. More... | |
interface | check_redundant_b |
Check for consistency between the duplicated points of a B-grid vector or scalar. More... | |
interface | check_redundant_c |
Check for consistency between the duplicated points of a C-grid vector. More... | |
interface | check_redundant_t |
Check for consistency between the duplicated points of an A-grid vector or scalar. More... | |
interface | vec_chksum |
Do checksums on the components of a C-grid vector. More... | |
interface | vec_chksum_a |
Do checksums on the components of an A-grid vector. More... | |
interface | vec_chksum_b |
Do checksums on the components of a B-grid vector. More... | |
interface | vec_chksum_c |
Do checksums on the components of a C-grid vector. More... | |
Functions/Subroutines | |
subroutine, public | 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. More... | |
subroutine | 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. More... | |
subroutine | 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. More... | |
subroutine | 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. More... | |
subroutine | 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. More... | |
subroutine | 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. More... | |
subroutine | 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. More... | |
subroutine | 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. More... | |
subroutine | 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. More... | |
subroutine | 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. More... | |
subroutine | 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. More... | |
subroutine | chksum_vec_c3d (mesg, u_comp, v_comp, G, halos, scalars) |
Do a checksum and redundant point check on a 3d C-grid vector. More... | |
subroutine | chksum_vec_c2d (mesg, u_comp, v_comp, G, halos, scalars) |
Do a checksum and redundant point check on a 2d C-grid vector. More... | |
subroutine | chksum_vec_b3d (mesg, u_comp, v_comp, G, halos, scalars) |
Do a checksum and redundant point check on a 3d B-grid vector. More... | |
subroutine | chksum_vec_b2d (mesg, u_comp, v_comp, G, halos, scalars, symmetric) |
subroutine | chksum_vec_a3d (mesg, u_comp, v_comp, G, halos, scalars) |
Do a checksum and redundant point check on a 3d C-grid vector. More... | |
subroutine | chksum_vec_a2d (mesg, u_comp, v_comp, G, halos, scalars) |
Do a checksum and redundant point check on a 2d C-grid vector. More... | |
real function, public | totalstuff (HI, hThick, areaT, stuff) |
This function returns the sum over computational domain of all processors of hThick*stuff, where stuff is a 3-d array at tracer points. More... | |
subroutine, public | 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. More... | |
logical function, public | check_column_integral (nk, field, known_answer) |
Returns false if the column integral of a given quantity is within roundoff. More... | |
logical function, public | check_column_integrals (nk_1, field_1, nk_2, field_2, missing_value) |
Returns false if the column integrals of two given quantities are within roundoff of each other. More... | |
Variables | |
integer | max_redundant_prints = 100 |
Maximum number of times to write redundant messages. More... | |
integer, dimension(3) | redundant_prints = 0 |
Counters for controlling redundant printing. More... | |
logical | debug = .false. |
Write out verbose debugging data. More... | |
logical | debug_chksums = .true. |
Perform checksums on arrays. More... | |
logical | debug_redundant = .true. |
Check redundant values on PE boundaries. More... | |
logical function, public mom_debugging::check_column_integral | ( | integer, intent(in) | nk, |
real, dimension(nk), intent(in) | field, | ||
real, intent(in), optional | known_answer | ||
) |
Returns false if the column integral of a given quantity is within roundoff.
[in] | nk | Number of levels in column |
[in] | field | Field to be summed |
[in] | known_answer | If present is the expected sum, If missing, assumed zero |
Definition at line 788 of file MOM_debugging.F90.
logical function, public mom_debugging::check_column_integrals | ( | integer, intent(in) | nk_1, |
real, dimension(nk_1), intent(in) | field_1, | ||
integer, intent(in) | nk_2, | ||
real, dimension(nk_2), intent(in) | field_2, | ||
real, intent(in), optional | missing_value | ||
) |
Returns false if the column integrals of two given quantities are within roundoff of each other.
[in] | nk_1 | Number of levels in field 1 |
[in] | nk_2 | Number of levels in field 2 |
[in] | field_1 | First field to be summed |
[in] | field_2 | Second field to be summed |
[in] | missing_value | If column contains missing values, mask them from the sum |
Definition at line 823 of file MOM_debugging.F90.
Referenced by mom_ale::ale_offline_inputs().
|
private |
Check for consistency between the duplicated points of a 2-D scalar at corner points.
[in] | mesg | An identifying message |
[in,out] | g | The ocean's grid structure |
[in] | array | The array to be checked for consistency |
[in] | is | The starting i-index to check |
[in] | ie | The ending i-index to check |
[in] | js | The starting j-index to check |
[in] | je | The ending j-index to check |
Definition at line 236 of file MOM_debugging.F90.
References max_redundant_prints, mom_error_handler::mom_error(), redundant_prints, and mom_domains::to_all.
Referenced by check_redundant_sb3d().
|
private |
Check for consistency between the duplicated points of a 3-D scalar at corner points.
[in] | mesg | An identifying message |
[in,out] | g | The ocean's grid structure |
[in] | array | The array to be checked for consistency |
[in] | is | The starting i-index to check |
[in] | ie | The ending i-index to check |
[in] | js | The starting j-index to check |
[in] | je | The ending j-index to check |
Definition at line 211 of file MOM_debugging.F90.
References check_redundant_sb2d().
|
private |
Check for consistency between the duplicated points of a 2-D scalar at tracer points.
[in] | mesg | An identifying message |
[in,out] | g | The ocean's grid structure |
[in] | array | The array to be checked for consistency |
[in] | is | The starting i-index to check |
[in] | ie | The ending i-index to check |
[in] | js | The starting j-index to check |
[in] | je | The ending j-index to check |
Definition at line 426 of file MOM_debugging.F90.
References max_redundant_prints, and redundant_prints.
Referenced by check_redundant_st3d().
|
private |
Check for consistency between the duplicated points of a 3-D scalar at tracer points.
[in] | mesg | An identifying message |
[in,out] | g | The ocean's grid structure |
[in] | array | The array to be checked for consistency |
[in] | is | The starting i-index to check |
[in] | ie | The ending i-index to check |
[in] | js | The starting j-index to check |
[in] | je | The ending j-index to check |
Definition at line 401 of file MOM_debugging.F90.
References check_redundant_st2d().
|
private |
Check for consistency between the duplicated points of a 2-D B-grid vector.
[in] | mesg | An identifying message |
[in,out] | g | The ocean's grid structure |
[in] | u_comp | The u-component of the vector to be checked for consistency |
[in] | v_comp | The v-component of the vector to be checked for consistency |
[in] | is | The starting i-index to check |
[in] | ie | The ending i-index to check |
[in] | js | The starting j-index to check |
[in] | je | The ending j-index to check |
[in] | direction | the direction flag to be passed to pass_vector |
Definition at line 325 of file MOM_debugging.F90.
References max_redundant_prints, mom_error_handler::mom_error(), and redundant_prints.
Referenced by check_redundant_vb3d().
|
private |
Check for consistency between the duplicated points of a 3-D B-grid vector.
[in] | mesg | An identifying message |
[in,out] | g | The ocean's grid structure |
[in] | u_comp | The u-component of the vector to be checked for consistency |
[in] | v_comp | The v-component of the vector to be checked for consistency |
[in] | is | The starting i-index to check |
[in] | ie | The ending i-index to check |
[in] | js | The starting j-index to check |
[in] | je | The ending j-index to check |
[in] | direction | the direction flag to be passed to pass_vector |
Definition at line 295 of file MOM_debugging.F90.
References check_redundant_vb2d().
|
private |
Check for consistency between the duplicated points of a 2-D C-grid vector.
[in] | mesg | An identifying message |
[in,out] | g | The ocean's grid structure |
[in] | u_comp | The u-component of the vector to be checked for consistency |
[in] | v_comp | The u-component of the vector to be checked for consistency |
[in] | is | The starting i-index to check |
[in] | ie | The ending i-index to check |
[in] | js | The starting j-index to check |
[in] | je | The ending j-index to check |
[in] | direction | the direction flag to be passed to pass_vector |
Definition at line 136 of file MOM_debugging.F90.
References max_redundant_prints, mom_error_handler::mom_error(), and redundant_prints.
Referenced by check_redundant_vc3d().
|
private |
Check for consistency between the duplicated points of a 3-D C-grid vector.
[in] | mesg | An identifying message |
[in,out] | g | The ocean's grid structure |
[in] | u_comp | The u-component of the vector to be checked for consistency |
[in] | v_comp | The u-component of the vector to be checked for consistency |
[in] | is | The starting i-index to check |
[in] | ie | The ending i-index to check |
[in] | js | The starting j-index to check |
[in] | je | The ending j-index to check |
[in] | direction | the direction flag to be passed to pass_vector |
Definition at line 106 of file MOM_debugging.F90.
References check_redundant_vc2d().
|
private |
Check for consistency between the duplicated points of a 2-D A-grid vector.
[in] | mesg | An identifying message |
[in,out] | g | The ocean's grid structure |
[in] | u_comp | The u-component of the vector to be checked for consistency |
[in] | v_comp | The v-component of the vector to be checked for consistency |
[in] | is | The starting i-index to check |
[in] | ie | The ending i-index to check |
[in] | js | The starting j-index to check |
[in] | je | The ending j-index to check |
[in] | direction | the direction flag to be passed to pass_vector |
Definition at line 501 of file MOM_debugging.F90.
References max_redundant_prints, and redundant_prints.
Referenced by check_redundant_vt3d().
|
private |
Check for consistency between the duplicated points of a 3-D A-grid vector.
[in] | mesg | An identifying message |
[in,out] | g | The ocean's grid structure |
[in] | u_comp | The u-component of the vector to be checked for consistency |
[in] | v_comp | The v-component of the vector to be checked for consistency |
[in] | is | The starting i-index to check |
[in] | ie | The ending i-index to check |
[in] | js | The starting j-index to check |
[in] | je | The ending j-index to check |
[in] | direction | the direction flag to be passed to pass_vector |
Definition at line 471 of file MOM_debugging.F90.
References check_redundant_vt2d().
|
private |
Do a checksum and redundant point check on a 2d C-grid vector.
[in] | mesg | An identifying message |
[in,out] | g | The ocean's grid structure |
[in] | u_comp | The u-component of the vector |
[in] | v_comp | The v-component of the vector |
[in] | halos | The width of halos to check (default 0) |
[in] | scalars | If true this is a pair of scalars that are being checked. |
Definition at line 699 of file MOM_debugging.F90.
References debug_chksums, debug_redundant, and mom_domains::to_all.
|
private |
Do a checksum and redundant point check on a 3d C-grid vector.
[in] | mesg | An identifying message |
[in,out] | g | The ocean's grid structure |
[in] | u_comp | The u-component of the vector |
[in] | v_comp | The v-component of the vector |
[in] | halos | The width of halos to check (default 0) |
[in] | scalars | If true this is a pair of scalars that are being checked. |
Definition at line 672 of file MOM_debugging.F90.
References debug_chksums, debug_redundant, and mom_domains::to_all.
|
private |
[in] | mesg | An identifying message |
[in,out] | g | The ocean's grid structure |
[in] | u_comp | The u-component of the vector |
[in] | v_comp | The v-component of the vector |
[in] | halos | The width of halos to check (default 0) |
[in] | scalars | If true this is a pair of scalars that are being checked. |
[in] | symmetric | If true, do the checksums on the full symmetric computational domain. |
Definition at line 643 of file MOM_debugging.F90.
References debug_chksums, debug_redundant, and mom_domains::to_all.
|
private |
Do a checksum and redundant point check on a 3d B-grid vector.
[in] | mesg | An identifying message |
[in,out] | g | The ocean's grid structure |
[in] | u_comp | The u-component of the vector |
[in] | v_comp | The v-component of the vector |
[in] | halos | The width of halos to check (default 0) |
[in] | scalars | If true this is a pair of scalars that are being checked. |
Definition at line 616 of file MOM_debugging.F90.
References debug_chksums, debug_redundant, and mom_domains::to_all.
|
private |
Do a checksum and redundant point check on a 2d C-grid vector.
[in] | mesg | An identifying message |
[in,out] | g | The ocean's grid structure |
[in] | u_comp | The u-component of the vector |
[in] | v_comp | The v-component of the vector |
[in] | halos | The width of halos to check (default 0) |
[in] | scalars | If true this is a pair of scalars that are being checked. |
Definition at line 590 of file MOM_debugging.F90.
References debug_chksums, debug_redundant, and mom_domains::to_all.
|
private |
Do a checksum and redundant point check on a 3d C-grid vector.
[in] | mesg | An identifying message |
[in,out] | g | The ocean's grid structure |
[in] | u_comp | The u-component of the vector |
[in] | v_comp | The v-component of the vector |
[in] | halos | The width of halos to check (default 0) |
[in] | scalars | If true this is a pair of scalars that are being checked. |
Definition at line 564 of file MOM_debugging.F90.
References debug_chksums, debug_redundant, and mom_domains::to_all.
subroutine, public mom_debugging::mom_debugging_init | ( | type(param_file_type), intent(in) | param_file | ) |
MOM_debugging_init initializes the MOM_debugging module, and sets the parameterts that control which checks are active for MOM6.
[in] | param_file | A structure to parse for run-time parameters |
Definition at line 81 of file MOM_debugging.F90.
References debug, debug_chksums, debug_redundant, and mom_checksums::mom_checksums_init().
real function, public mom_debugging::totalstuff | ( | type(hor_index_type), intent(in) | HI, |
real, dimension(hi%isd:,hi%jsd:,:), intent(in) | hThick, | ||
real, dimension(hi%isd:,hi%jsd:), intent(in) | areaT, | ||
real, dimension(hi%isd:,hi%jsd:,:), intent(in) | stuff | ||
) |
This function returns the sum over computational domain of all processors of hThick*stuff, where stuff is a 3-d array at tracer points.
[in] | hi | A horizontal index type |
[in] | hthick | The array of thicknesses to use as weights |
[in] | areat | The array of cell areas [m2] |
[in] | stuff | The array of stuff to be summed |
Definition at line 727 of file MOM_debugging.F90.
Referenced by totaltands().
subroutine, public mom_debugging::totaltands | ( | type(hor_index_type), intent(in) | HI, |
real, dimension(hi%isd:,hi%jsd:,:), intent(in) | hThick, | ||
real, dimension(hi%isd:,hi%jsd:), intent(in) | areaT, | ||
real, dimension(hi%isd:,hi%jsd:,:), intent(in) | temperature, | ||
real, dimension(hi%isd:,hi%jsd:,:), intent(in) | salinity, | ||
character(len=*), intent(in) | mesg | ||
) |
This subroutine display the total thickness, temperature and salinity as well as the change since the last call.
[in] | hi | A horizontal index type |
[in] | hthick | The array of thicknesses to use as weights |
[in] | areat | The array of cell areas [m2] |
[in] | temperature | The temperature field to sum |
[in] | salinity | The salinity field to sum |
[in] | mesg | An identifying message |
Definition at line 747 of file MOM_debugging.F90.
References mom_error_handler::is_root_pe(), and totalstuff().
|
private |
Write out verbose debugging data.
Definition at line 72 of file MOM_debugging.F90.
Referenced by mom_debugging_init().
|
private |
Perform checksums on arrays.
Definition at line 73 of file MOM_debugging.F90.
Referenced by chksum_vec_a2d(), chksum_vec_a3d(), chksum_vec_b2d(), chksum_vec_b3d(), chksum_vec_c2d(), chksum_vec_c3d(), and mom_debugging_init().
|
private |
Check redundant values on PE boundaries.
Definition at line 74 of file MOM_debugging.F90.
Referenced by chksum_vec_a2d(), chksum_vec_a3d(), chksum_vec_b2d(), chksum_vec_b3d(), chksum_vec_c2d(), chksum_vec_c3d(), and mom_debugging_init().
|
private |
Maximum number of times to write redundant messages.
Definition at line 70 of file MOM_debugging.F90.
Referenced by check_redundant_sb2d(), check_redundant_st2d(), check_redundant_vb2d(), check_redundant_vc2d(), and check_redundant_vt2d().
|
private |
Counters for controlling redundant printing.
Definition at line 71 of file MOM_debugging.F90.
Referenced by check_redundant_sb2d(), check_redundant_st2d(), check_redundant_vb2d(), check_redundant_vc2d(), and check_redundant_vt2d().