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

Refactor spherical_harmonics_forward #807

Merged

Conversation

Hallberg-NOAA
Copy link
Member

Refactored the spherical_harmonics_forward() routine in MOM_spherical_harmonics to work in rescaled units by making use of the unscale arguments to reproducing_sum(). A total of 4 rescaling variables were moved into unscale arguments, and a block of code that restores the scaling of the output variables was eliminated. The comments describing the units of several variables in this module were made more explicit. The two temporary arrays that store un-summed contributions to the transforms were also moved out of the control structure and made into local variables in the spherical_harmonics_forward() routine to allow for the reuse of that memory. All answers and diagnostics are bitwise identical, and no interfaces are changed.

Copy link

codecov bot commented Jan 19, 2025

Codecov Report

Attention: Patch coverage is 0% with 25 lines in your changes missing coverage. Please review.

Project coverage is 38.16%. Comparing base (54feb6f) to head (82780ac).

Files with missing lines Patch % Lines
...ameterizations/lateral/MOM_spherical_harmonics.F90 0.00% 25 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           dev/gfdl     #807   +/-   ##
=========================================
  Coverage     38.16%   38.16%           
=========================================
  Files           296      296           
  Lines         87234    87228    -6     
  Branches      16283    16280    -3     
=========================================
  Hits          33291    33291           
+ Misses        47956    47950    -6     
  Partials       5987     5987           

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

Copy link

@herrwang0 herrwang0 left a comment

Choose a reason for hiding this comment

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

The changes make sense and look correct to me.

@Hallberg-NOAA Hallberg-NOAA added the refactor Code cleanup with no changes in functionality or results label Jan 19, 2025
  Refactored the spherical_harmonics_forward routine in MOM_spherical_harmonics
to work in rescaled units by making use of the unscale arguments to
reproducing_sum().  A total of 4 rescaling variables were moved into unscale
arguments, and a block of code that restores the scaling of the output variables
was eliminated.  The comments describing the units of several variables in this
module were made more explicit.  The two temporary arrays that store un-summed
contributions to the transforms were also moved out of the control structure and
made into local variables in the spherical_harmonics_forward routine to allow
for the reuse of that memory.  All answers and diagnostics are bitwise
identical, and no interfaces are changed.
@Hallberg-NOAA Hallberg-NOAA force-pushed the refactor_spherical_harmonics branch from 82780ac to de3f5a4 Compare January 23, 2025 10:52
@Hallberg-NOAA
Copy link
Member Author

This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/26163.

@Hallberg-NOAA Hallberg-NOAA merged commit 2ade897 into NOAA-GFDL:dev/gfdl Jan 23, 2025
10 checks passed
@Hallberg-NOAA Hallberg-NOAA deleted the refactor_spherical_harmonics branch January 25, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Code cleanup with no changes in functionality or results
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants