Skip to content

Commit 090e323

Browse files
committed
Refactor get_depth_list_checksum
Use field_checksum in get_depth_list_checksum to relocate two rescaling factors into unscale arguments and work in scaled internal variables in that routine. All answers are bitwise identical.
1 parent ad0a8b8 commit 090e323

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/diagnostics/MOM_sum_output.F90

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ module MOM_sum_output
44
! This file is part of MOM6. See LICENSE.md for the license.
55

66
use iso_fortran_env, only : int64
7-
use MOM_checksums, only : is_NaN
8-
use MOM_coms, only : sum_across_PEs, PE_here, root_PE, num_PEs, max_across_PEs, field_chksum
7+
use MOM_checksums, only : is_NaN, field_checksum
8+
use MOM_coms, only : sum_across_PEs, PE_here, root_PE, num_PEs, max_across_PEs
99
use MOM_coms, only : reproducing_sum, reproducing_sum_EFP, EFP_to_real, real_to_EFP
1010
use MOM_coms, only : EFP_type, operator(+), operator(-), assignment(=), EFP_sum_across_PEs
1111
use MOM_error_handler, only : MOM_error, FATAL, WARNING, NOTE, is_root_pe
@@ -1439,22 +1439,23 @@ subroutine get_depth_list_checksums(G, US, depth_chksum, area_chksum)
14391439
character(len=16), intent(out) :: depth_chksum !< Depth checksum hexstring
14401440
character(len=16), intent(out) :: area_chksum !< Area checksum hexstring
14411441

1442+
! Local variables
1443+
real, allocatable :: field(:,:) ! A temporary array with no halos [Z ~> m] or [L2 ~> m2]
14421444
integer :: i, j
1443-
real, allocatable :: field(:,:) ! A temporary array for output converted to MKS units [m] or [m2]
14441445

14451446
allocate(field(G%isc:G%iec, G%jsc:G%jec))
14461447

14471448
! Depth checksum
14481449
do j=G%jsc,G%jec ; do i=G%isc,G%iec
1449-
field(i,j) = US%Z_to_m*(G%bathyT(i,j) + G%Z_ref)
1450+
field(i,j) = G%bathyT(i,j) + G%Z_ref
14501451
enddo ; enddo
1451-
write(depth_chksum, '(Z16)') field_chksum(field(:,:))
1452+
write(depth_chksum, '(Z16)') field_checksum(field(:,:), unscale=US%Z_to_m)
14521453

14531454
! Area checksum
14541455
do j=G%jsc,G%jec ; do i=G%isc,G%iec
1455-
field(i,j) = G%mask2dT(i,j) * US%L_to_m**2*G%areaT(i,j)
1456+
field(i,j) = G%mask2dT(i,j) * G%areaT(i,j)
14561457
enddo ; enddo
1457-
write(area_chksum, '(Z16)') field_chksum(field(:,:))
1458+
write(area_chksum, '(Z16)') field_checksum(field(:,:), unscale=US%L_to_m**2)
14581459

14591460
deallocate(field)
14601461
end subroutine get_depth_list_checksums

0 commit comments

Comments
 (0)