Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report negative zero min/max as positive #1009

Merged
merged 1 commit into from
Oct 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ define CMP_RULE

.PRECIOUS: $(foreach b,$(2),results/%/chksum_diag.$(b))
%.$(1).diag: $(foreach b,$(2),results/%/chksum_diag.$(b))
cmp $$^ || true
cmp $$^
endef

$(eval $(call CMP_RULE,regression,symmetric target))
Expand Down Expand Up @@ -255,7 +255,7 @@ results/%/ocean.stats.restart: ../build/symmetric/MOM6
rm -rf work/$*/restart
mkdir -p work/$*/restart
cp -rL $*/* work/$*/restart
mkdir work/$*/restart/RESTART
mkdir -p work/$*/restart/RESTART
# Generate the half-period input namelist
# TODO: Assumes runtime set by DAYMAX, will fail if set by input.nml
cd work/$*/restart \
Expand Down
5 changes: 4 additions & 1 deletion src/framework/MOM_checksums.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1822,8 +1822,11 @@ subroutine chk_sum_msg3(fmsg, aMean, aMin, aMax, mesg, iounit)
real, intent(in) :: aMax !< The maximum value of the array
integer, intent(in) :: iounit !< Checksum logger IO unit

! NOTE: We add zero to aMin and aMax to remove any negative zeros.
! This is due to inconsistencies of signed zero in local vs MPI calculations.

if (is_root_pe()) write(iounit, '(A,3(A,ES25.16,1X),A)') &
fmsg, " mean=", aMean, "min=", aMin, "max=", aMax, trim(mesg)
fmsg, " mean=", aMean, "min=", (0. + aMin), "max=", (0. + aMax), trim(mesg)
end subroutine chk_sum_msg3

!> MOM_checksums_init initializes the MOM_checksums module. As it happens, the
Expand Down