Skip to content

Conversation

@Hallberg-NOAA
Copy link
Member

SIS2 reports the global maximum CFL in the seaice.stats files, but in the first timestep when all velocities are zero, it is reporting a maximum CFL of -0.000 with the gnu and Nvidia compilers. This single-line commit replaces any negative zero maximum CFL returned by max_across_PEs() with its absolute value so that only non-negative maximum CFL values are returned. All solutions are bitwise identical, but this does change the entries in the seaice.stats files so it may appear to fail automated regression testing in some cases.

This commit addresses the problem in SIS2 that is noted in #230, but it does not address the underlying question of why this bizarre behavior is happening in the first place.

Copy link
Member

@marshallward marshallward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, the MPI library can strip the sign of zero during any reduction, making it impossible to reproduce signed zeros, so explicit assignment to (positive) zero is the only way to reliably reproduce the sign.

Normally I would say that this is better handled at the MOM_coms level. But the delayed adoption of MOM6 code in SIS2 justifies taking this right away.

The only minor improvement here would be to replace max_CFL = abs(max_CFL) with max_CFL = 0.. But I will approve as it is, and this line can be removed after a future update to max_across_PEs.

  SIS2 reports the global maximum CFL in the seaice.stats files, but in the
first timestep when all velocities are zero, it is reporting a maximum CFL of
-0.000 with the gnu and Nvidia compilers.  This single-line commit replaces any
negative zero maximum CFL returned by `max_across_PEs()` with its absolute value
so that only non-negative maximum CFL values are returned.  All solutions are
bitwise identical, but this does change the entries in the seaice.stats files so
it may appear to fail automated regression testing in some cases.
@Hallberg-NOAA
Copy link
Member Author

This PR completed the pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/SIS2/-/pipelines/29802 with the expected failure due to the changes in some seaice.stats files that were previously reporting negative zero maximum CFL numbers.

@Hallberg-NOAA Hallberg-NOAA merged commit 7e05db4 into NOAA-GFDL:dev/gfdl Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants