-
Notifications
You must be signed in to change notification settings - Fork 65
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
MOM6:(*)+Reproducing tracer stocks #73
MOM6:(*)+Reproducing tracer stocks #73
Conversation
Actually calculate the mean temperature and salinity reported by MOM_state_stats(). Due to an oversight, these means were always being reported as 0. This changes the output when the debugging flag DEBUG_CONSERVATION=True. All answers are bitwise identical.
Added the new function global_mass_int_EFP(), which is analogous to global_mass_integral but returns its result in extended fixed point (EFP_type) format and always uses reproducing sums, to facilitate layout-invariant global integrals but with the potential for deferred global reductions so that this last step can be combined for various global reductions for efficiency. All answers are bitwise identical, but there is a new public interface.
Use global_mass_integral for the debugging diagnostics of the tracer amounts before and after diffusion in lateral_boundary_diffusion, and replaced a call to write(*,*) with a call to MOM_mesg to actually write the message. The global_mass_integral uses reproducing sums, and is invariant to layout, while MOM_mesg is preferable for output because it will allow us to more cleanly control how output is handled and which processors do the writing. All solutions are bitwise identical, although some debugging output will change.
Use reproducing sums for tabulating tracer stocks, and move the global sum for the tracer stocks form write_energy into call_tracer_stocks. This involves changes to the type of an argument (from real to EFP_type) for two arguments to the internal routine store_stocks. Existing tracer stock packages will still work, but to benefit from the reproducing sums, they will also have to change their reported values from real to EFP_type. This is demonstrated for two packages (advection_test_tracer and ideal_age_example), where the stocks are now found with calls to global_mass_int_EFP(), replacing the previous explicit sums. With this change, the reported stock values from these packages are identical for different PE layouts and can be much more accurate than before, but they are different from the previously reported values at roundoff (for positive-definite tracers), but it could be larger for tracers with a near-zero mean value. All solutions are bitwise identical, but output changes.
Modified the remaining tracer packages to use the reproducing stocks. The reported stock values from these packages will have changed slightly, but they now reproduce across PE layouts. All solutions are bitwise identical, but output changes.
Each of the commits here is significant and was carefully tested. Please do not do a squash merge on this PR. |
Codecov Report
@@ Coverage Diff @@
## dev/gfdl #73 +/- ##
============================================
+ Coverage 29.00% 29.03% +0.03%
============================================
Files 244 244
Lines 71921 71865 -56
============================================
+ Hits 20861 20869 +8
+ Misses 51060 50996 -64
Continue to review full report at Codecov.
|
Removed trailing white space on two lines. All answers are bitwise identical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR makes improvements to global integration of tracers by computing them in MKS units (rather than rescaled dimensions), and replaces instances of sum()
with reproducible sums. Some of this management is done via a new EFP_type
.
The reproducible sums are a clear improvement, although contributors may need to take note of the use of EFP_type
.
Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/14840 ✔️ |
Use reproducing sums to obtain tracer stocks that are invariant to PE layout
for all tracer packages, and corrected the mean temperature reported to stdout
when DEBUG_CONSERVATION=True, so that it now really does give the mean. All
solutions are bitwise identical, but the output does change.
The commits in this PR include: