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 parentheses to continuity_PPM curv_3 expressions #574

Closed

Conversation

Hallberg-NOAA
Copy link
Member

Added parentheses to 8 expressions like curv_3 = h_W(i) + h_E(i) - 2.0*h(i) in zonal_flux_layer(), zonal_flux_thickness(), merid_flux_layer() and merid_flux_thickness(), changing them to curv_3 = (h_W(i) + h_E(i)) - 2.0*h(i). This change enforces the order of arithmetic that is required to give rotational symmetry, but it also is the order that the Intel, GNU, and Nvidia compliers were all already using in these expressions. Moreover, had the order of arithmetic ever been anything else, this would have led to failures in our rotational consistency and redundant point consistency testing, and almost certainly would have been detected before. However, by adding these parentheses, there is a remote chance that the addition of these parentheses could change answers for some compiler or compiler settings we have never tested before. This change should not impact any FMA-enabled calculations. All answers are bitwise identical in the MOM6-examples regression suite as run on Gaea.

  Added parentheses to 8 expressions like `curv_3 = h_W(i) + h_E(i) - 2.0*h(i)`
in zonal_flux_layer, zonal_flux_thickness, merid_flux_layer and
merid_flux_thickness, changing them to `curv_3 = (h_W(i) + h_E(i)) - 2.0*h(i)`.
This change enforces the order of arithmetic that is required to give rotational
symmetry, but it also is the order that the Intel, GNU, and Nvidia compliers
were all already using in these expressions.  Moreover, had the order of
arithmetic ever been anything else, this would have led to failures in our
rotational consistency and redundant point consistency testing, and almost
certainly would have been detected before. However, by adding these parentheses,
there is a remote chance that the addition of these parentheses could change
answers for some compiler or compiler settings we have never tested before.
This change should not impact any FMA-enabled calculations.  All answers are
bitwise identical in the MOM6-examples regression suite as run on Gaea.
Copy link

codecov bot commented Feb 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.21%. Comparing base (86c5ed9) to head (0c35667).
Report is 2 commits behind head on dev/gfdl.

Additional details and impacted files
@@            Coverage Diff            @@
##           dev/gfdl     #574   +/-   ##
=========================================
  Coverage     37.20%   37.21%           
=========================================
  Files           271      271           
  Lines         80475    80472    -3     
  Branches      15008    15008           
=========================================
+ Hits          29943    29944    +1     
+ Misses        44961    44957    -4     
  Partials       5571     5571           

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

@Hallberg-NOAA
Copy link
Member Author

Do to the risk that this PR might change answers in some FMA-enabled runs, we have decided to withdraw it for now, although we do plan to reintroduce if for consideration along with other changes that might change answers when FMAs are enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant