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

+Add user-controlled underflow of tracers #131

Merged

Conversation

Hallberg-NOAA
Copy link
Member

Added the ability to do software-controlled underflow of user-specified tiny
tracer values to 0. This includes the addition of two new runtime parameters,
SALINITY_UNDERFLOW and TEMPERATURE_UNDERFLOW, and the addition of the new
optional argument underflow_conc to register_tracer. There is new code that
optionally underflows tiny values after tracer advection, all three flavors of
tracer diffusion, and after tracer remapping via ALE. By default, underflow is
handled via the machine as before, but with appropriately set tiny values of
SALINITY_UNDERFLOW and TEMPERATURE_UNDERFLOW, of 1e-30 ppt and 1e-30 degC, all
existing test cases pass the dimensional consistency rescaling tests for
temperature and salinity, but doing so does change answers slightly for some
test cases (detectible in the restart files, but not in the ocean.stats files).
By default all answers are bitwise identical, but there are two new runtime
parameters.

@codecov
Copy link

codecov bot commented May 26, 2022

Codecov Report

Merging #131 (5f5073a) into dev/gfdl (ec88923) will decrease coverage by 0.00%.
The diff coverage is 25.92%.

@@             Coverage Diff              @@
##           dev/gfdl     #131      +/-   ##
============================================
- Coverage     33.45%   33.45%   -0.01%     
============================================
  Files           262      262              
  Lines         71388    71413      +25     
  Branches      13323    13336      +13     
============================================
+ Hits          23884    23891       +7     
- Misses        43032    43048      +16     
- Partials       4472     4474       +2     
Impacted Files Coverage Δ
src/ALE/MOM_ALE.F90 42.91% <0.00%> (-0.18%) ⬇️
src/tracer/MOM_lateral_boundary_diffusion.F90 58.69% <0.00%> (-0.41%) ⬇️
src/tracer/MOM_neutral_diffusion.F90 62.87% <0.00%> (-0.22%) ⬇️
src/tracer/MOM_tracer_hor_diff.F90 70.93% <16.66%> (-0.44%) ⬇️
src/tracer/MOM_tracer_advect.F90 57.67% <33.33%> (-0.33%) ⬇️
src/core/MOM.F90 42.83% <50.00%> (+0.07%) ⬆️
src/tracer/MOM_tracer_registry.F90 61.20% <100.00%> (+0.27%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ec88923...5f5073a. Read the comment docs.

@marshallward
Copy link
Member

This could have computational performance implications that should be investigated before merging.

If the underflows can be applied in a separate loop, with the underflow criterion outside of the loop, then that would be a much safer option.

@Hallberg-NOAA Hallberg-NOAA force-pushed the full_tracer_underflow branch from 79a0fda to 1dde1c1 Compare June 3, 2022 09:54
  Added the ability to do software-controlled underflow of user-specified tiny
tracer values to 0.  This includes the addition of two new runtime parameters,
SALINITY_UNDERFLOW and TEMPERATURE_UNDERFLOW, and the addition of the new
optional argument underflow_conc to register_tracer.  There is new code that
optionally underflows tiny values after tracer advection, all three flavors of
tracer diffusion, and after tracer remapping via ALE.  By default, underflow is
handled via the machine as before, but with appropriately set tiny values of
SALINITY_UNDERFLOW and TEMPERATURE_UNDERFLOW, of 1e-30 ppt and 1e-30 degC, all
existing test cases pass the dimensional consistency rescaling tests for
temperature and salinity, but doing so does change answers slightly for some
test cases (detectible in the restart files, but not in the ocean.stats files).
By default all answers are bitwise identical, but there are two new runtime
parameters.
  Moved the new user-controlled tracer underflow code into separate loops, in
response to the reviews of this initial commit, in the hopes that this will
provide better computational performance.  All answers are bitwise identical.
@Hallberg-NOAA Hallberg-NOAA force-pushed the full_tracer_underflow branch from 1dde1c1 to 601036c Compare June 3, 2022 10:07
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.

I'm reasonably confident that potential performance issues have been addressed.

@marshallward marshallward added the Parameter change Input parameter changes (addition, removal, or description) label Jun 6, 2022
@marshallward
Copy link
Member

Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/15715 ✔️ 🟡

New parameters:

  • SALINITY_UNDERFLOW
  • TEMPERATURE_UNDERFLOW

@marshallward marshallward merged commit 4288d41 into NOAA-GFDL:dev/gfdl Jun 6, 2022
@Hallberg-NOAA Hallberg-NOAA deleted the full_tracer_underflow branch July 16, 2022 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Parameter change Input parameter changes (addition, removal, or description)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants