This is an older interface for 1-, 2-, or 3-D checksums.
Definition at line 64 of file MOM_checksums.F90.
|
| subroutine | chksum1d (array, mesg, start_i, end_i, compare_PEs) |
| | chksum1d does a checksum of a 1-dimensional array. More...
|
| |
| subroutine | chksum2d (array, mesg) |
| | chksum2d does a checksum of all data in a 2-d array. More...
|
| |
| subroutine | chksum3d (array, mesg) |
| | chksum3d does a checksum of all data in a 2-d array. More...
|
| |
This is an older interface for 1-, 2-, or 3-D checksums.
Definition at line 64 of file MOM_checksums.F90.
◆ chksum1d()
| subroutine mom_checksums::chksum::chksum1d |
( |
real, dimension(:), intent(in) |
array, |
|
|
character(len=*), intent(in) |
mesg, |
|
|
integer, intent(in), optional |
start_i, |
|
|
integer, intent(in), optional |
end_i, |
|
|
logical, intent(in), optional |
compare_PEs |
|
) |
| |
|
private |
chksum1d does a checksum of a 1-dimensional array.
- Parameters
-
| [in] | array | The array to be summed (index starts at 1). |
| [in] | mesg | An identifying message. |
| [in] | start_i | The starting index for the sum (default 1) |
| [in] | end_i | The ending index for the sum (default all) |
| [in] | compare_pes | If true, compare across PEs instead of summing and list the root_PE value (default true) |
Definition at line 1887 of file MOM_checksums.F90.
1887 real,
dimension(:),
intent(in) :: array
1888 character(len=*),
intent(in) :: mesg
1889 integer,
optional,
intent(in) :: start_i
1890 integer,
optional,
intent(in) :: end_i
1891 logical,
optional,
intent(in) :: compare_PEs
1894 integer :: is, ie, i, bc, sum1, sum_bc
1896 real,
allocatable :: sum_here(:)
1901 is = lbound(array,1) ; ie = ubound(array,1)
1902 if (
present(start_i)) is = start_i
1903 if (
present(end_i)) ie = end_i
1904 compare = .true. ;
if (
present(compare_pes)) compare = compare_pes
1906 sum = 0.0 ; sum_bc = 0
1908 sum = sum + array(i)
1909 bc = bitcount(abs(array(i)))
1910 sum_bc = sum_bc + bc
1913 pe_num = pe_here() + 1 - root_pe() ; npes = num_pes()
1914 allocate(sum_here(npes)) ; sum_here(:) = 0.0 ; sum_here(pe_num) = sum
1915 call sum_across_pes(sum_here,npes)
1918 call sum_across_pes(sum1)
1920 if (.not.compare)
then
1922 do i=1,npes ; sum = sum + sum_here(i) ;
enddo
1924 elseif (is_root_pe())
then
1925 if (sum1 /= npes*sum_bc) &
1926 write(0,
'(A40," bitcounts do not match across PEs: ",I12,1X,I12)') &
1927 mesg, sum1, npes*sum_bc
1928 do i=1,npes ;
if (sum /= sum_here(i))
then
1929 write(0,
'(A40," PE ",i4," sum mismatches root_PE: ",3(ES22.13,1X))') &
1930 mesg, i, sum_here(i), sum, sum_here(i)-sum
1933 deallocate(sum_here)
1936 write(0,
'(A50,1X,ES25.16,1X,I12)') mesg, sum, sum_bc
◆ chksum2d()
| subroutine mom_checksums::chksum::chksum2d |
( |
real, dimension(:,:) |
array, |
|
|
character(len=*) |
mesg |
|
) |
| |
|
private |
chksum2d does a checksum of all data in a 2-d array.
- Parameters
-
| array | The array to be checksummed |
| mesg | An identifying message |
Definition at line 1945 of file MOM_checksums.F90.
1946 real,
dimension(:,:) :: array
1947 character(len=*) :: mesg
1949 integer :: xs,xe,ys,ye,i,j,sum1,bc
1952 xs = lbound(array,1) ; xe = ubound(array,1)
1953 ys = lbound(array,2) ; ye = ubound(array,2)
1955 sum = 0.0 ; sum1 = 0
1956 do i=xs,xe ;
do j=ys,ye
1957 bc = bitcount(abs(array(i,j)))
1960 call sum_across_pes(sum1)
1962 sum = reproducing_sum(array(:,:))
1965 write(0,
'(A50,1X,ES25.16,1X,I12)') mesg, sum, sum1
◆ chksum3d()
| subroutine mom_checksums::chksum::chksum3d |
( |
real, dimension(:,:,:) |
array, |
|
|
character(len=*) |
mesg |
|
) |
| |
|
private |
chksum3d does a checksum of all data in a 2-d array.
- Parameters
-
| array | The array to be checksummed |
| mesg | An identifying message |
Definition at line 1973 of file MOM_checksums.F90.
1974 real,
dimension(:,:,:) :: array
1975 character(len=*) :: mesg
1977 integer :: xs,xe,ys,ye,zs,ze,i,j,k, bc,sum1
1980 xs = lbound(array,1) ; xe = ubound(array,1)
1981 ys = lbound(array,2) ; ye = ubound(array,2)
1982 zs = lbound(array,3) ; ze = ubound(array,3)
1984 sum = 0.0 ; sum1 = 0
1985 do i=xs,xe ;
do j=ys,ye ;
do k=zs,ze
1986 bc = bitcount(abs(array(i,j,k)))
1988 enddo ;
enddo ;
enddo
1990 call sum_across_pes(sum1)
1991 sum = reproducing_sum(array(:,:,:))
1994 write(0,
'(A50,1X,ES25.16,1X,I12)') mesg, sum, sum1
The documentation for this interface was generated from the following file: