Skip to content

(*)Avoid array syntax math in MOM_wave_structure#167

Merged
marshallward merged 2 commits into
NOAA-GFDL:dev/gfdlfrom
Hallberg-NOAA:wave_structure_code_cleanup
Aug 2, 2022
Merged

(*)Avoid array syntax math in MOM_wave_structure#167
marshallward merged 2 commits into
NOAA-GFDL:dev/gfdlfrom
Hallberg-NOAA:wave_structure_code_cleanup

Conversation

@Hallberg-NOAA
Copy link
Copy Markdown
Member

Revised the MOM_wave_structure code to avoid using array syntax in
calculations and subroutine arguments. While making these changes, several
incorrect or missing variable unit descriptions in comments were identified and
corrected. This set of changes is mathematically equivalent, but will result in
changes at the level of roundoff, either because the order of sums was changed
or because divisions are replaced by multiplication by a common reciprocal.
Some debugging safety checks were moved inside of a logical test of the debug
flag for efficiency. One dimensionally inconsistent expression (in vertical and
horizontal distances) was corrected, so that it should now pass the dimensional
consistency checks.

This commit will change answers in any cases that depend on this code, but
because we recently corrected (in MOM6 PR#154) a major bug in this code with a
much larger impact without causing any disruptions, we can be confident that
this code is not yet used in an production runs where minor answer changes could
be problematic. This code change does not alter any answers or output in the
MOM6-examples test suite.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 15, 2022

Codecov Report

Merging #167 (e0d8b01) into dev/gfdl (8b609d0) will increase coverage by 0.22%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##           dev/gfdl     #167      +/-   ##
============================================
+ Coverage     37.41%   37.64%   +0.22%     
============================================
  Files           259      259              
  Lines         71823    70994     -829     
  Branches      13440    13322     -118     
============================================
- Hits          26871    26724     -147     
+ Misses        40009    39354     -655     
+ Partials       4943     4916      -27     
Impacted Files Coverage Δ
src/diagnostics/MOM_wave_structure.F90 0.00% <0.00%> (ø)
src/initialization/MOM_state_initialization.F90 32.89% <0.00%> (+11.42%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us.

Copy link
Copy Markdown

@raphaeldussin raphaeldussin left a comment

Choose a reason for hiding this comment

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

I think the code changes are accurate but found a minor sign error in a comment

Comment thread src/diagnostics/MOM_wave_structure.F90 Outdated
  Revised the MOM_wave_structure code to avoid using array syntax in
calculations and subroutine arguments.  While making these changes, several
incorrect or missing variable unit descriptions in comments were identified and
corrected.  This set of changes is mathematically equivalent, but will result in
changes at the level of roundoff, either because the order of sums was changed
or because divisions are replaced by multiplication by a common reciprocal.
Some debugging safety checks were moved inside of a logical test of the debug
flag for efficiency.  One dimensionally inconsistent expression (in vertical and
horizontal distances) was corrected, so that it should now pass the dimensional
consistency checks.

  This commit will change answers in any cases that depend on this code, but
because we recently corrected (in MOM6 PR#154) a major bug in this code with a
much larger impact without causing any disruptions, we can be confident that
this code is not yet used in an production runs where minor answer changes could
be problematic.  This code change does not alter any answers or output in the
MOM6-examples test suite.
  Corrected a sign error in commented out code in wave_structure, as noted in a
review by Raf Dussin of the previous PR.  All answers are bitwise identical.
@Hallberg-NOAA Hallberg-NOAA force-pushed the wave_structure_code_cleanup branch from f36c7c9 to e0d8b01 Compare July 31, 2022 15:40
@marshallward
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
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.

Approved on behalf of @raphaeldussin

@marshallward marshallward merged commit 97319c9 into NOAA-GFDL:dev/gfdl Aug 2, 2022
@Hallberg-NOAA Hallberg-NOAA deleted the wave_structure_code_cleanup branch February 2, 2023 13:27
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.

3 participants