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

(*)Consolidate conversion of 4 salt tendency diags #840

Open
wants to merge 1 commit into
base: dev/gfdl
Choose a base branch
from

Conversation

Hallberg-NOAA
Copy link
Member

Collected the conversion factors for the 4 salt tendency diagnostics diabatic_salt_tendency, diabatic_salt_tendency_2d, boundary_forcing_salt_tendency and boundary_forcing_heat_tendency_2d out of the calculation of the diagnostics before they are posted and into the conversion argument in their register_diag_field() calls. This change simplifies the code where the diagnostics are calculated, but although all expressions are mathematically equivalent, there is a change in the order of arithmetic with which these 4 diagnostics are calculated, so answers will change at roundoff, although this is unlikely to be detected if the diagnostics are being written as 32 bit floats. All model solutions are bitwise identical.

  Collected the conversion factors for the 4 salt tendency diagnostics
diabatic_salt_tendency, diabatic_salt_tendency_2d, boundary_forcing_salt_tendency
and boundary_forcing_heat_tendency_2d out of the calculation of the diagnostics
before they are posted and into the conversion argument in their
register_diag_field calls.  This change simplifies the code where the
diagnostics are calculated, but although all expressions are mathematically
equivalent, there is a change in the order of arithmetic with which these 4
diagnostics are calculated, so answers will change at roundoff, although this is
unlikely to be detected if the diagnostics are being written as 32 bit floats.
All model solutions are bitwise identical.
@Hallberg-NOAA Hallberg-NOAA added refactor Code cleanup with no changes in functionality or results answer-changing A change in results (actual or potential) labels Feb 23, 2025
Copy link

codecov bot commented Feb 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 38.10%. Comparing base (809d56e) to head (f486837).

Additional details and impacted files
@@             Coverage Diff              @@
##           dev/gfdl     #840      +/-   ##
============================================
- Coverage     38.11%   38.10%   -0.01%     
============================================
  Files           298      298              
  Lines         87642    87640       -2     
  Branches      16416    16416              
============================================
- Hits          33401    33399       -2     
  Misses        48219    48219              
  Partials       6022     6022              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answer-changing A change in results (actual or potential) refactor Code cleanup with no changes in functionality or results
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant