MOM6
MOM_checksums.F90 File Reference
#include "version_variable.h"
Include dependency graph for MOM_checksums.F90:

Go to the source code of this file.

Data Types

interface  mom_checksums::hchksum_pair
 Checksums a pair of arrays (2d or 3d) staggered at tracer points. More...
 
interface  mom_checksums::uvchksum
 Checksums a pair velocity arrays (2d or 3d) staggered at C-grid locations. More...
 
interface  mom_checksums::uchksum
 Checksums an array (2d or 3d) staggered at C-grid u points. More...
 
interface  mom_checksums::vchksum
 Checksums an array (2d or 3d) staggered at C-grid v points. More...
 
interface  mom_checksums::bchksum_pair
 Checksums a pair of arrays (2d or 3d) staggered at corner points. More...
 
interface  mom_checksums::hchksum
 Checksums an array (2d or 3d) staggered at tracer points. More...
 
interface  mom_checksums::bchksum
 Checksums an array (2d or 3d) staggered at corner points. More...
 
interface  mom_checksums::qchksum
 This is an older interface that has been renamed Bchksum. More...
 
interface  mom_checksums::chksum
 This is an older interface for 1-, 2-, or 3-D checksums. More...
 
interface  mom_checksums::chk_sum_msg
 Write a message with either checksums or numerical statistics of arrays. More...
 
interface  mom_checksums::is_nan
 Returns .true. if any element of x is a NaN, and .false. otherwise. More...
 

Modules

module  mom_checksums
 Routines to calculate checksums of various array and vector types.
 

Functions/Subroutines

subroutine, public mom_checksums::chksum0 (scalar, mesg, scale, logunit)
 Checksum a scalar field (consistent with array checksums) More...
 
subroutine, public mom_checksums::zchksum (array, mesg, scale, logunit)
 Checksum a 1d array (typically a column). More...
 
integer function subchk (array, scale)
 
subroutine substats (array, aMean, aMin, aMax)
 
subroutine mom_checksums::chksum_pair_h_2d (mesg, arrayA, arrayB, HI, haloshift, omit_corners, scale, logunit)
 Checksums on a pair of 2d arrays staggered at tracer points. More...
 
subroutine mom_checksums::chksum_pair_h_3d (mesg, arrayA, arrayB, HI, haloshift, omit_corners, scale, logunit)
 Checksums on a pair of 3d arrays staggered at tracer points. More...
 
subroutine mom_checksums::chksum_h_2d (array, mesg, HI, haloshift, omit_corners, scale, logunit)
 Checksums a 2d array staggered at tracer points. More...
 
integer function subchk (array, HI, di, dj, scale)
 
subroutine substats (HI, array, aMean, aMin, aMax)
 
subroutine mom_checksums::chksum_pair_b_2d (mesg, arrayA, arrayB, HI, haloshift, symmetric, omit_corners, scale, logunit)
 Checksums on a pair of 2d arrays staggered at q-points. More...
 
subroutine mom_checksums::chksum_pair_b_3d (mesg, arrayA, arrayB, HI, haloshift, symmetric, omit_corners, scale, logunit)
 Checksums on a pair of 3d arrays staggered at q-points. More...
 
subroutine mom_checksums::chksum_b_2d (array, mesg, HI, haloshift, symmetric, omit_corners, scale, logunit)
 Checksums a 2d array staggered at corner points. More...
 
integer function subchk (array, HI, di, dj, scale)
 
subroutine substats (HI, array, sym_stats, aMean, aMin, aMax)
 
subroutine mom_checksums::chksum_uv_2d (mesg, arrayU, arrayV, HI, haloshift, symmetric, omit_corners, scale, logunit)
 Checksums a pair of 2d velocity arrays staggered at C-grid locations. More...
 
subroutine mom_checksums::chksum_uv_3d (mesg, arrayU, arrayV, HI, haloshift, symmetric, omit_corners, scale, logunit)
 Checksums a pair of 3d velocity arrays staggered at C-grid locations. More...
 
subroutine mom_checksums::chksum_u_2d (array, mesg, HI, haloshift, symmetric, omit_corners, scale, logunit)
 Checksums a 2d array staggered at C-grid u points. More...
 
integer function subchk (array, HI, di, dj, scale)
 
subroutine substats (HI, array, sym_stats, aMean, aMin, aMax)
 
subroutine mom_checksums::chksum_v_2d (array, mesg, HI, haloshift, symmetric, omit_corners, scale, logunit)
 Checksums a 2d array staggered at C-grid v points. More...
 
integer function subchk (array, HI, di, dj, scale)
 
subroutine substats (HI, array, sym_stats, aMean, aMin, aMax)
 
subroutine mom_checksums::chksum_h_3d (array, mesg, HI, haloshift, omit_corners, scale, logunit)
 Checksums a 3d array staggered at tracer points. More...
 
integer function subchk (array, HI, di, dj, scale)
 
subroutine substats (HI, array, aMean, aMin, aMax)
 
subroutine mom_checksums::chksum_b_3d (array, mesg, HI, haloshift, symmetric, omit_corners, scale, logunit)
 Checksums a 3d array staggered at corner points. More...
 
integer function subchk (array, HI, di, dj, scale)
 
subroutine substats (HI, array, sym_stats, aMean, aMin, aMax)
 
subroutine mom_checksums::chksum_u_3d (array, mesg, HI, haloshift, symmetric, omit_corners, scale, logunit)
 Checksums a 3d array staggered at C-grid u points. More...
 
integer function subchk (array, HI, di, dj, scale)
 
subroutine substats (HI, array, sym_stats, aMean, aMin, aMax)
 
subroutine mom_checksums::chksum_v_3d (array, mesg, HI, haloshift, symmetric, omit_corners, scale, logunit)
 Checksums a 3d array staggered at C-grid v points. More...
 
integer function subchk (array, HI, di, dj, scale)
 
subroutine substats (HI, array, sym_stats, aMean, aMin, aMax)
 
subroutine mom_checksums::chksum1d (array, mesg, start_i, end_i, compare_PEs)
 chksum1d does a checksum of a 1-dimensional array. More...
 
subroutine mom_checksums::chksum2d (array, mesg)
 chksum2d does a checksum of all data in a 2-d array. More...
 
subroutine mom_checksums::chksum3d (array, mesg)
 chksum3d does a checksum of all data in a 2-d array. More...
 
logical function mom_checksums::is_nan_0d (x)
 This function returns .true. if x is a NaN, and .false. otherwise. More...
 
logical function mom_checksums::is_nan_1d (x, skip_mpp)
 Returns .true. if any element of x is a NaN, and .false. otherwise. More...
 
logical function mom_checksums::is_nan_2d (x)
 Returns .true. if any element of x is a NaN, and .false. otherwise. More...
 
logical function mom_checksums::is_nan_3d (x)
 Returns .true. if any element of x is a NaN, and .false. otherwise. More...
 
subroutine mom_checksums::chk_sum_msg1 (fmsg, bc0, mesg, iounit)
 Write a message including the checksum of the non-shifted array. More...
 
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. More...
 
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. More...
 
subroutine mom_checksums::chk_sum_msg_s (fmsg, bc0, bcS, mesg, iounit)
 Write a message including checksums of non-shifted and southward shifted arrays. More...
 
subroutine mom_checksums::chk_sum_msg_w (fmsg, bc0, bcW, mesg, iounit)
 Write a message including checksums of non-shifted and westward shifted arrays. More...
 
subroutine mom_checksums::chk_sum_msg2 (fmsg, bc0, bcSW, mesg, iounit)
 Write a message including checksums of non-shifted and southwestward shifted arrays. More...
 
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. More...
 
subroutine, public 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. More...
 
subroutine mom_checksums::chksum_error (signal, message)
 A wrapper for MOM_error used in the checksum code. More...
 
integer function mom_checksums::bitcount (x)
 Does a bitcount of a number by first casting to an integer and then using BTEST to check bit by bit. More...
 

Variables

integer, parameter mom_checksums::bc_modulus = 1000000000
 Modulus of checksum bitcount. More...
 
integer, parameter mom_checksums::default_shift =0
 The default array shift. More...
 
logical mom_checksums::calculatestatistics =.true.
 If true, report min, max and mean. More...
 
logical mom_checksums::writechksums =.true.
 If true, report the bitcount checksum. More...
 
logical mom_checksums::checkfornans =.true.
 If true, checks array for NaNs and cause FATAL error is any are found. More...
 

Function/Subroutine Documentation

◆ subchk() [1/9]

integer function chksum_h_2d::subchk ( real, dimension(hi%isd:,hi%jsd:), intent(in)  array,
type(hor_index_type), intent(in)  HI,
integer, intent(in)  di,
integer, intent(in)  dj,
real, intent(in)  scale 
)
private
Parameters
[in]hiA horizontal index type
[in]arrayThe array to be checksummed
[in]dii- direction array shift for this checksum
[in]djj- direction array shift for this checksum
[in]scaleA scaling factor for this array.

Definition at line 335 of file MOM_checksums.F90.

335  type(hor_index_type), intent(in) :: HI !< A horizontal index type
336  real, dimension(HI%isd:,HI%jsd:), intent(in) :: array !< The array to be checksummed
337  integer, intent(in) :: di !< i- direction array shift for this checksum
338  integer, intent(in) :: dj !< j- direction array shift for this checksum
339  real, intent(in) :: scale !< A scaling factor for this array.
340  integer :: i, j, bc
341  subchk = 0
342  do j=hi%jsc+dj,hi%jec+dj; do i=hi%isc+di,hi%iec+di
343  bc = bitcount(abs(scale*array(i,j)))
344  subchk = subchk + bc
345  enddo ; enddo
346  call sum_across_pes(subchk)
347  subchk=mod(subchk, bc_modulus)

References mom_checksums::bc_modulus, mom_checksums::bitcount(), and subchk().

Here is the call graph for this function:

◆ subchk() [2/9]

integer function chksum_b_2d::subchk ( real, dimension(hi%isdb:,hi%jsdb:), intent(in)  array,
type(hor_index_type), intent(in)  HI,
integer, intent(in)  di,
integer, intent(in)  dj,
real, intent(in)  scale 
)
private
Parameters
[in]hiA horizontal index type
[in]arrayThe array to be checksummed
[in]dii- direction array shift for this checksum
[in]djj- direction array shift for this checksum
[in]scaleA scaling factor for this array.

Definition at line 542 of file MOM_checksums.F90.

542  type(hor_index_type), intent(in) :: HI !< A horizontal index type
543  real, dimension(HI%IsdB:,HI%JsdB:), intent(in) :: array !< The array to be checksummed
544  integer, intent(in) :: di !< i- direction array shift for this checksum
545  integer, intent(in) :: dj !< j- direction array shift for this checksum
546  real, intent(in) :: scale !< A scaling factor for this array.
547  integer :: i, j, bc
548  subchk = 0
549  ! This line deliberately uses the h-point computational domain.
550  do j=hi%jsc+dj,hi%jec+dj; do i=hi%isc+di,hi%iec+di
551  bc = bitcount(abs(scale*array(i,j)))
552  subchk = subchk + bc
553  enddo ; enddo
554  call sum_across_pes(subchk)
555  subchk=mod(subchk, bc_modulus)

References mom_checksums::bc_modulus, mom_checksums::bitcount(), and subchk().

Here is the call graph for this function:

◆ subchk() [3/9]

integer function chksum_u_2d::subchk ( real, dimension(hi%isdb:,hi%jsd:), intent(in)  array,
type(hor_index_type), intent(in)  HI,
integer, intent(in)  di,
integer, intent(in)  dj,
real, intent(in)  scale 
)
private
Parameters
[in]hiA horizontal index type
[in]arrayThe array to be checksummed
[in]dii- direction array shift for this checksum
[in]djj- direction array shift for this checksum
[in]scaleA scaling factor for this array.

Definition at line 753 of file MOM_checksums.F90.

753  type(hor_index_type), intent(in) :: HI !< A horizontal index type
754  real, dimension(HI%IsdB:,HI%jsd:), intent(in) :: array !< The array to be checksummed
755  integer, intent(in) :: di !< i- direction array shift for this checksum
756  integer, intent(in) :: dj !< j- direction array shift for this checksum
757  real, intent(in) :: scale !< A scaling factor for this array.
758  integer :: i, j, bc
759  subchk = 0
760  ! This line deliberately uses the h-point computational domain.
761  do j=hi%jsc+dj,hi%jec+dj; do i=hi%isc+di,hi%iec+di
762  bc = bitcount(abs(scale*array(i,j)))
763  subchk = subchk + bc
764  enddo ; enddo
765  call sum_across_pes(subchk)
766  subchk=mod(subchk, bc_modulus)

References mom_checksums::bc_modulus, mom_checksums::bitcount(), and subchk().

Here is the call graph for this function:

◆ subchk() [4/9]

integer function chksum_v_2d::subchk ( real, dimension(hi%isd:,hi%jsdb:), intent(in)  array,
type(hor_index_type), intent(in)  HI,
integer, intent(in)  di,
integer, intent(in)  dj,
real, intent(in)  scale 
)
private
Parameters
[in]hiA horizontal index type
[in]arrayThe array to be checksummed
[in]dii- direction array shift for this checksum
[in]djj- direction array shift for this checksum
[in]scaleA scaling factor for this array.

Definition at line 907 of file MOM_checksums.F90.

907  type(hor_index_type), intent(in) :: HI !< A horizontal index type
908  real, dimension(HI%isd:,HI%JsdB:), intent(in) :: array !< The array to be checksummed
909  integer, intent(in) :: di !< i- direction array shift for this checksum
910  integer, intent(in) :: dj !< j- direction array shift for this checksum
911  real, intent(in) :: scale !< A scaling factor for this array.
912  integer :: i, j, bc
913  subchk = 0
914  ! This line deliberately uses the h-point computational domain.
915  do j=hi%jsc+dj,hi%jec+dj; do i=hi%isc+di,hi%iec+di
916  bc = bitcount(abs(scale*array(i,j)))
917  subchk = subchk + bc
918  enddo ; enddo
919  call sum_across_pes(subchk)
920  subchk=mod(subchk, bc_modulus)

References mom_checksums::bc_modulus, mom_checksums::bitcount(), and subchk().

Here is the call graph for this function:

◆ subchk() [5/9]

integer function chksum_h_3d::subchk ( real, dimension(hi%isd:,hi%jsd:,:), intent(in)  array,
type(hor_index_type), intent(in)  HI,
integer, intent(in)  di,
integer, intent(in)  dj,
real, intent(in)  scale 
)
private
Parameters
[in]hiA horizontal index type
[in]arrayThe array to be checksummed
[in]dii- direction array shift for this checksum
[in]djj- direction array shift for this checksum
[in]scaleA scaling factor for this array.

Definition at line 1043 of file MOM_checksums.F90.

1043  type(hor_index_type), intent(in) :: HI !< A horizontal index type
1044  real, dimension(HI%isd:,HI%jsd:,:), intent(in) :: array !< The array to be checksummed
1045  integer, intent(in) :: di !< i- direction array shift for this checksum
1046  integer, intent(in) :: dj !< j- direction array shift for this checksum
1047  real, intent(in) :: scale !< A scaling factor for this array.
1048  integer :: i, j, k, bc
1049  subchk = 0
1050  do k=lbound(array,3),ubound(array,3) ; do j=hi%jsc+dj,hi%jec+dj ; do i=hi%isc+di,hi%iec+di
1051  bc = bitcount(abs(scale*array(i,j,k)))
1052  subchk = subchk + bc
1053  enddo ; enddo ; enddo
1054  call sum_across_pes(subchk)
1055  subchk=mod(subchk, bc_modulus)

References mom_checksums::bc_modulus, mom_checksums::bitcount(), and subchk().

Here is the call graph for this function:

◆ subchk() [6/9]

integer function chksum_b_3d::subchk ( real, dimension(hi%isdb:,hi%jsdb:,:), intent(in)  array,
type(hor_index_type), intent(in)  HI,
integer, intent(in)  di,
integer, intent(in)  dj,
real, intent(in)  scale 
)
private
Parameters
[in]hiA horizontal index type
[in]arrayThe array to be checksummed
[in]dii- direction array shift for this checksum
[in]djj- direction array shift for this checksum
[in]scaleA scaling factor for this array.

Definition at line 1194 of file MOM_checksums.F90.

1194  type(hor_index_type), intent(in) :: HI !< A horizontal index type
1195  real, dimension(HI%IsdB:,HI%JsdB:,:), intent(in) :: array !< The array to be checksummed
1196  integer, intent(in) :: di !< i- direction array shift for this checksum
1197  integer, intent(in) :: dj !< j- direction array shift for this checksum
1198  real, intent(in) :: scale !< A scaling factor for this array.
1199  integer :: i, j, k, bc
1200  subchk = 0
1201  ! This line deliberately uses the h-point computational domain.
1202  do k=lbound(array,3),ubound(array,3) ; do j=hi%jsc+dj,hi%jec+dj ; do i=hi%isc+di,hi%iec+di
1203  bc = bitcount(abs(scale*array(i,j,k)))
1204  subchk = subchk + bc
1205  enddo ; enddo ; enddo
1206  call sum_across_pes(subchk)
1207  subchk=mod(subchk, bc_modulus)

References mom_checksums::bc_modulus, mom_checksums::bitcount(), and subchk().

Here is the call graph for this function:

◆ subchk() [7/9]

integer function chksum_u_3d::subchk ( real, dimension(hi%isdb:,hi%jsd:,:), intent(in)  array,
type(hor_index_type), intent(in)  HI,
integer, intent(in)  di,
integer, intent(in)  dj,
real, intent(in)  scale 
)
private
Parameters
[in]hiA horizontal index type
[in]arrayThe array to be checksummed
[in]dii- direction array shift for this checksum
[in]djj- direction array shift for this checksum
[in]scaleA scaling factor for this array.

Definition at line 1348 of file MOM_checksums.F90.

1348  type(hor_index_type), intent(in) :: HI !< A horizontal index type
1349  real, dimension(HI%IsdB:,HI%jsd:,:), intent(in) :: array !< The array to be checksummed
1350  integer, intent(in) :: di !< i- direction array shift for this checksum
1351  integer, intent(in) :: dj !< j- direction array shift for this checksum
1352  real, intent(in) :: scale !< A scaling factor for this array.
1353  integer :: i, j, k, bc
1354  subchk = 0
1355  ! This line deliberately uses the h-point computational domain.
1356  do k=lbound(array,3),ubound(array,3) ; do j=hi%jsc+dj,hi%jec+dj ; do i=hi%isc+di,hi%iec+di
1357  bc = bitcount(abs(scale*array(i,j,k)))
1358  subchk = subchk + bc
1359  enddo ; enddo ; enddo
1360  call sum_across_pes(subchk)
1361  subchk=mod(subchk, bc_modulus)

References mom_checksums::bc_modulus, mom_checksums::bitcount(), and subchk().

Here is the call graph for this function:

◆ subchk() [8/9]

integer function chksum_v_3d::subchk ( real, dimension(hi%isd:,hi%jsdb:,:), intent(in)  array,
type(hor_index_type), intent(in)  HI,
integer, intent(in)  di,
integer, intent(in)  dj,
real, intent(in)  scale 
)
private
Parameters
[in]hiA horizontal index type
[in]arrayThe array to be checksummed
[in]dii- direction array shift for this checksum
[in]djj- direction array shift for this checksum
[in]scaleA scaling factor for this array.

Definition at line 1502 of file MOM_checksums.F90.

1502  type(hor_index_type), intent(in) :: HI !< A horizontal index type
1503  real, dimension(HI%isd:,HI%JsdB:,:), intent(in) :: array !< The array to be checksummed
1504  integer, intent(in) :: di !< i- direction array shift for this checksum
1505  integer, intent(in) :: dj !< j- direction array shift for this checksum
1506  real, intent(in) :: scale !< A scaling factor for this array.
1507  integer :: i, j, k, bc
1508  subchk = 0
1509  ! This line deliberately uses the h-point computational domain.
1510  do k=lbound(array,3),ubound(array,3) ; do j=hi%jsc+dj,hi%jec+dj ; do i=hi%isc+di,hi%iec+di
1511  bc = bitcount(abs(scale*array(i,j,k)))
1512  subchk = subchk + bc
1513  enddo ; enddo ; enddo
1514  call sum_across_pes(subchk)
1515  subchk=mod(subchk, bc_modulus)

References mom_checksums::bc_modulus, mom_checksums::bitcount(), and subchk().

Here is the call graph for this function:

◆ subchk() [9/9]

integer function zchksum::subchk ( real, dimension(:), intent(in)  array,
real, intent(in)  scale 
)
private
Parameters
[in]arrayThe array to be checksummed
[in]scaleA scaling factor for this array.

Definition at line 167 of file MOM_checksums.F90.

167  real, dimension(:), intent(in) :: array !< The array to be checksummed
168  real, intent(in) :: scale !< A scaling factor for this array.
169  integer :: k, bc
170  subchk = 0
171  do k=lbound(array, 1), ubound(array, 1)
172  bc = bitcount(abs(scale * array(k)))
173  subchk = subchk + bc
174  enddo
175  subchk=mod(subchk, bc_modulus)

References mom_checksums::bc_modulus, and mom_checksums::bitcount().

Referenced by mom_checksums::chksum_b_2d(), mom_checksums::chksum_b_3d(), mom_checksums::chksum_h_2d(), mom_checksums::chksum_h_3d(), mom_checksums::chksum_u_2d(), mom_checksums::chksum_u_3d(), mom_checksums::chksum_v_2d(), mom_checksums::chksum_v_3d(), subchk(), and mom_checksums::zchksum().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ substats() [1/9]

subroutine zchksum::substats ( real, dimension(:), intent(in)  array,
real, intent(out)  aMean,
real, intent(out)  aMin,
real, intent(out)  aMax 
)
private
Parameters
[in]arrayThe array to be checksummed

Definition at line 179 of file MOM_checksums.F90.

179  real, dimension(:), intent(in) :: array !< The array to be checksummed
180  real, intent(out) :: aMean, aMin, aMax
181 
182  integer :: k, n
183 
184  amin = array(1)
185  amax = array(1)
186  n = 0
187  do k=lbound(array,1), ubound(array,1)
188  amin = min(amin, array(k))
189  amax = max(amax, array(k))
190  n = n + 1
191  enddo
192  amean = sum(array(:)) / real(n)

Referenced by mom_checksums::chksum_b_2d(), mom_checksums::chksum_b_3d(), mom_checksums::chksum_h_2d(), mom_checksums::chksum_h_3d(), mom_checksums::chksum_u_2d(), mom_checksums::chksum_u_3d(), mom_checksums::chksum_v_2d(), mom_checksums::chksum_v_3d(), and mom_checksums::zchksum().

Here is the caller graph for this function:

◆ substats() [2/9]

subroutine chksum_h_2d::substats ( type(hor_index_type), intent(in)  HI,
real, dimension(hi%isd:,hi%jsd:), intent(in)  array,
real, intent(out)  aMean,
real, intent(out)  aMin,
real, intent(out)  aMax 
)
private
Parameters
[in]hiA horizontal index type
[in]arrayThe array to be checksummed

Definition at line 351 of file MOM_checksums.F90.

351  type(hor_index_type), intent(in) :: HI !< A horizontal index type
352  real, dimension(HI%isd:,HI%jsd:), intent(in) :: array !< The array to be checksummed
353  real, intent(out) :: aMean, aMin, aMax
354 
355  integer :: i, j, n
356 
357  amin = array(hi%isc,hi%jsc)
358  amax = array(hi%isc,hi%jsc)
359  n = 0
360  do j=hi%jsc,hi%jec ; do i=hi%isc,hi%iec
361  amin = min(amin, array(i,j))
362  amax = max(amax, array(i,j))
363  n = n + 1
364  enddo ; enddo
365  amean = reproducing_sum(array(hi%isc:hi%iec,hi%jsc:hi%jec))
366  call sum_across_pes(n)
367  call min_across_pes(amin)
368  call max_across_pes(amax)
369  amean = amean / real(n)

◆ substats() [3/9]

subroutine chksum_h_3d::substats ( type(hor_index_type), intent(in)  HI,
real, dimension(hi%isd:,hi%jsd:,:), intent(in)  array,
real, intent(out)  aMean,
real, intent(out)  aMin,
real, intent(out)  aMax 
)
private
Parameters
[in]hiA horizontal index type
[in]arrayThe array to be checksummed

Definition at line 1059 of file MOM_checksums.F90.

1059  type(hor_index_type), intent(in) :: HI !< A horizontal index type
1060  real, dimension(HI%isd:,HI%jsd:,:), intent(in) :: array !< The array to be checksummed
1061  real, intent(out) :: aMean, aMin, aMax
1062 
1063  integer :: i, j, k, n
1064 
1065  amin = array(hi%isc,hi%jsc,1)
1066  amax = array(hi%isc,hi%jsc,1)
1067  n = 0
1068  do k=lbound(array,3),ubound(array,3) ; do j=hi%jsc,hi%jec ; do i=hi%isc,hi%iec
1069  amin = min(amin, array(i,j,k))
1070  amax = max(amax, array(i,j,k))
1071  n = n + 1
1072  enddo ; enddo ; enddo
1073  amean = reproducing_sum(array(hi%isc:hi%iec,hi%jsc:hi%jec,:))
1074  call sum_across_pes(n)
1075  call min_across_pes(amin)
1076  call max_across_pes(amax)
1077  amean = amean / real(n)

◆ substats() [4/9]

subroutine chksum_b_2d::substats ( type(hor_index_type), intent(in)  HI,
real, dimension(hi%isdb:,hi%jsdb:), intent(in)  array,
logical, intent(in)  sym_stats,
real, intent(out)  aMean,
real, intent(out)  aMin,
real, intent(out)  aMax 
)
private
Parameters
[in]hiA horizontal index type
[in]arrayThe array to be checksummed
[in]sym_statsIf true, evaluate the statistics on the full symmetric computational domain.

Definition at line 559 of file MOM_checksums.F90.

559  type(hor_index_type), intent(in) :: HI !< A horizontal index type
560  real, dimension(HI%IsdB:,HI%JsdB:), intent(in) :: array !< The array to be checksummed
561  logical, intent(in) :: sym_stats !< If true, evaluate the statistics on the
562  !! full symmetric computational domain.
563  real, intent(out) :: aMean, aMin, aMax
564 
565  integer :: i, j, n, IsB, JsB
566 
567  isb = hi%isc ; if (sym_stats) isb = hi%isc-1
568  jsb = hi%jsc ; if (sym_stats) jsb = hi%jsc-1
569 
570  amin = array(hi%isc,hi%jsc) ; amax = amin
571  do j=jsb,hi%JecB ; do i=isb,hi%IecB
572  amin = min(amin, array(i,j))
573  amax = max(amax, array(i,j))
574  enddo ; enddo
575  ! This line deliberately uses the h-point computational domain.
576  amean = reproducing_sum(array(hi%isc:hi%iec,hi%jsc:hi%jec))
577  n = (1 + hi%jec - hi%jsc) * (1 + hi%iec - hi%isc)
578  call sum_across_pes(n)
579  call min_across_pes(amin)
580  call max_across_pes(amax)
581  amean = amean / real(n)

◆ substats() [5/9]

subroutine chksum_u_2d::substats ( type(hor_index_type), intent(in)  HI,
real, dimension(hi%isdb:,hi%jsd:), intent(in)  array,
logical, intent(in)  sym_stats,
real, intent(out)  aMean,
real, intent(out)  aMin,
real, intent(out)  aMax 
)
private
Parameters
[in]hiA horizontal index type
[in]arrayThe array to be checksummed
[in]sym_statsIf true, evaluate the statistics on the full symmetric computational domain.

Definition at line 770 of file MOM_checksums.F90.

770  type(hor_index_type), intent(in) :: HI !< A horizontal index type
771  real, dimension(HI%IsdB:,HI%jsd:), intent(in) :: array !< The array to be checksummed
772  logical, intent(in) :: sym_stats !< If true, evaluate the statistics on the
773  !! full symmetric computational domain.
774  real, intent(out) :: aMean, aMin, aMax
775 
776  integer :: i, j, n, IsB
777 
778  isb = hi%isc ; if (sym_stats) isb = hi%isc-1
779 
780  amin = array(hi%isc,hi%jsc) ; amax = amin
781  do j=hi%jsc,hi%jec ; do i=isb,hi%IecB
782  amin = min(amin, array(i,j))
783  amax = max(amax, array(i,j))
784  enddo ; enddo
785  ! This line deliberately uses the h-point computational domain.
786  amean = reproducing_sum(array(hi%isc:hi%iec,hi%jsc:hi%jec))
787  n = (1 + hi%jec - hi%jsc) * (1 + hi%iec - hi%isc)
788  call sum_across_pes(n)
789  call min_across_pes(amin)
790  call max_across_pes(amax)
791  amean = amean / real(n)

◆ substats() [6/9]

subroutine chksum_v_2d::substats ( type(hor_index_type), intent(in)  HI,
real, dimension(hi%isd:,hi%jsdb:), intent(in)  array,
logical, intent(in)  sym_stats,
real, intent(out)  aMean,
real, intent(out)  aMin,
real, intent(out)  aMax 
)
private
Parameters
[in]hiA horizontal index type
[in]arrayThe array to be checksummed
[in]sym_statsIf true, evaluate the statistics on the full symmetric computational domain.

Definition at line 924 of file MOM_checksums.F90.

924  type(hor_index_type), intent(in) :: HI !< A horizontal index type
925  real, dimension(HI%isd:,HI%JsdB:), intent(in) :: array !< The array to be checksummed
926  logical, intent(in) :: sym_stats !< If true, evaluate the statistics on the
927  !! full symmetric computational domain.
928  real, intent(out) :: aMean, aMin, aMax
929 
930  integer :: i, j, n, JsB
931 
932  jsb = hi%jsc ; if (sym_stats) jsb = hi%jsc-1
933 
934  amin = array(hi%isc,hi%jsc) ; amax = amin
935  do j=jsb,hi%JecB ; do i=hi%isc,hi%iec
936  amin = min(amin, array(i,j))
937  amax = max(amax, array(i,j))
938  enddo ; enddo
939  ! This line deliberately uses the h-computational domain.
940  amean = reproducing_sum(array(hi%isc:hi%iec,hi%jsc:hi%jec))
941  n = (1 + hi%jec - hi%jsc) * (1 + hi%iec - hi%isc)
942  call sum_across_pes(n)
943  call min_across_pes(amin)
944  call max_across_pes(amax)
945  amean = amean / real(n)

◆ substats() [7/9]

subroutine chksum_b_3d::substats ( type(hor_index_type), intent(in)  HI,
real, dimension(hi%isdb:,hi%jsdb:,:), intent(in)  array,
logical, intent(in)  sym_stats,
real, intent(out)  aMean,
real, intent(out)  aMin,
real, intent(out)  aMax 
)
private
Parameters
[in]hiA horizontal index type
[in]arrayThe array to be checksummed
[in]sym_statsIf true, evaluate the statistics on the full symmetric computational domain.

Definition at line 1211 of file MOM_checksums.F90.

1211  type(hor_index_type), intent(in) :: HI !< A horizontal index type
1212  real, dimension(HI%IsdB:,HI%JsdB:,:), intent(in) :: array !< The array to be checksummed
1213  logical, intent(in) :: sym_stats !< If true, evaluate the statistics on the
1214  !! full symmetric computational domain.
1215  real, intent(out) :: aMean, aMin, aMax
1216 
1217  integer :: i, j, k, n, IsB, JsB
1218 
1219  isb = hi%isc ; if (sym_stats) isb = hi%isc-1
1220  jsb = hi%jsc ; if (sym_stats) jsb = hi%jsc-1
1221 
1222  amin = array(hi%isc,hi%jsc,1) ; amax = amin
1223  do k=lbound(array,3),ubound(array,3) ; do j=jsb,hi%JecB ; do i=isb,hi%IecB
1224  amin = min(amin, array(i,j,k))
1225  amax = max(amax, array(i,j,k))
1226  enddo ; enddo ; enddo
1227  amean = reproducing_sum(array(hi%isc:hi%iec,hi%jsc:hi%jec,:))
1228  n = (1 + hi%jec - hi%jsc) * (1 + hi%iec - hi%isc) * size(array,3)
1229  call sum_across_pes(n)
1230  call min_across_pes(amin)
1231  call max_across_pes(amax)
1232  amean = amean / real(n)

◆ substats() [8/9]

subroutine chksum_u_3d::substats ( type(hor_index_type), intent(in)  HI,
real, dimension(hi%isdb:,hi%jsd:,:), intent(in)  array,
logical, intent(in)  sym_stats,
real, intent(out)  aMean,
real, intent(out)  aMin,
real, intent(out)  aMax 
)
private
Parameters
[in]hiA horizontal index type
[in]arrayThe array to be checksummed
[in]sym_statsIf true, evaluate the statistics on the full symmetric computational domain.

Definition at line 1365 of file MOM_checksums.F90.

1365  type(hor_index_type), intent(in) :: HI !< A horizontal index type
1366  real, dimension(HI%IsdB:,HI%jsd:,:), intent(in) :: array !< The array to be checksummed
1367  logical, intent(in) :: sym_stats !< If true, evaluate the statistics on the
1368  !! full symmetric computational domain.
1369  real, intent(out) :: aMean, aMin, aMax
1370 
1371  integer :: i, j, k, n, IsB
1372 
1373  isb = hi%isc ; if (sym_stats) isb = hi%isc-1
1374 
1375  amin = array(hi%isc,hi%jsc,1) ; amax = amin
1376  do k=lbound(array,3),ubound(array,3) ; do j=hi%jsc,hi%jec ; do i=isb,hi%IecB
1377  amin = min(amin, array(i,j,k))
1378  amax = max(amax, array(i,j,k))
1379  enddo ; enddo ; enddo
1380  ! This line deliberately uses the h-point computational domain.
1381  amean = reproducing_sum(array(hi%isc:hi%iec,hi%jsc:hi%jec,:))
1382  n = (1 + hi%jec - hi%jsc) * (1 + hi%iec - hi%isc) * size(array,3)
1383  call sum_across_pes(n)
1384  call min_across_pes(amin)
1385  call max_across_pes(amax)
1386  amean = amean / real(n)

◆ substats() [9/9]

subroutine chksum_v_3d::substats ( type(hor_index_type), intent(in)  HI,
real, dimension(hi%isd:,hi%jsdb:,:), intent(in)  array,
logical, intent(in)  sym_stats,
real, intent(out)  aMean,
real, intent(out)  aMin,
real, intent(out)  aMax 
)
private
Parameters
[in]hiA horizontal index type
[in]arrayThe array to be checksummed
[in]sym_statsIf true, evaluate the statistics on the full symmetric computational domain.
[out]amaxMean/min/max of array over domain

Definition at line 1520 of file MOM_checksums.F90.

1520  type(hor_index_type), intent(in) :: HI !< A horizontal index type
1521  real, dimension(HI%isd:,HI%JsdB:,:), intent(in) :: array !< The array to be checksummed
1522  logical, intent(in) :: sym_stats !< If true, evaluate the statistics on the
1523  !! full symmetric computational domain.
1524  real, intent(out) :: aMean, aMin, aMax !< Mean/min/max of array over domain
1525 
1526  integer :: i, j, k, n, JsB
1527 
1528  jsb = hi%jsc ; if (sym_stats) jsb = hi%jsc-1
1529 
1530  amin = array(hi%isc,hi%jsc,1) ; amax = amin
1531  do k=lbound(array,3),ubound(array,3) ; do j=jsb,hi%JecB ; do i=hi%isc,hi%iec
1532  amin = min(amin, array(i,j,k))
1533  amax = max(amax, array(i,j,k))
1534  enddo ; enddo ; enddo
1535  ! This line deliberately uses the h-point computational domain.
1536  amean = reproducing_sum(array(hi%isc:hi%iec,hi%jsc:hi%jec,:))
1537  n = (1 + hi%jec - hi%jsc) * (1 + hi%iec - hi%isc) * size(array,3)
1538  call sum_across_pes(n)
1539  call min_across_pes(amin)
1540  call max_across_pes(amax)
1541  amean = amean / real(n)
subchk
integer function subchk(array, scale)
Definition: MOM_checksums.F90:167