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

+(*)MOM_hor_visc bug fix and loop size cleanup #84

Merged
merged 3 commits into from
Mar 17, 2022

Conversation

Hallberg-NOAA
Copy link
Member

Fixed the bug noted in issue #72 and excessive loop sizes noted in the
unresolved comments in a recent commit, and cleaned up other aspects of
MOM_hor_visc, mostly related to the code that is exercised when USE_GME=True.

  • Fixed the bug with the wrong arrays being used when ADD_LES_VISCOSITY=True
    that was noted in MOM6 issue Potential bug related the add_LES_viscosity option #72.

  • Corrected some of the overly large loop extents that were noted in unresolved
    comments about MOM6 PR Fixes issues with the GME code and get_param calls for Leith options #65.

  • Only log USE_KH_BG_2D if a Laplacian viscosity is used.

  • Use extra calculations in the halos and marching in to avoid unnecessary halo
    updates in smooth_GME if there multiple smoothing passes.

  • Corrected the capitalization of some horizontal indices to follow the MOM6
    convention for indicating the horizontal staggering position.

  • Collected the post_data calls for diagnostics with use_GME with the other
    post data calls to collocate some of the potential inter-PE synchronization
    points.

  • Fixed the indentation of some expressions that were using less than 4 points
    for some continuation lines.

  • Eliminated several unused variables, and fused some loops to allow 2-d
    variables to be replaced with scalars.

With this PR, answers can change when ADD_LES_VISCOSITY=True and there is a
Smagorinsky or Leith Laplacian viscosity and there is a nonzero background.
One run-time parameter is no longer logged if LAPLACIAN=false, so there are
changes to the MOM_parameter_doc files. All answers in the MOM6-examples test
suite are bitwise identical.

  Fixed the bug noted in issue mom-ocean#72 and excessive loop sizes noted in the
unresolved comments in a recent commit, and cleaned up other aspects of
MOM_hor_visc, mostly related to the code that is exercised when USE_GME=True.

 - Fixed the bug with the wrong arrays being used when ADD_LES_VISCOSITY=True
   that was noted in MOM6 issue mom-ocean#72.

 - Corrected some of the overly large loop extents that were noted in unresolved
   comments about MOM6 PR mom-ocean#65.

 - Only log USE_KH_BG_2D if a Laplacian viscosity is used.

 - Use extra calculations in the halos and marching in to avoid unnecessary halo
   updates in smooth_GME if there multiple smoothing passes.

 - Corrected the capitalization of some horizontal indices to follow the MOM6
   convention for indicating the horizontal staggering position.

 - Collected the post_data calls for diagnostics with use_GME with the other
   post data calls to collocate some of the potential inter-PE synchronization
   points.

 - Fixed the indentation of some expressions that were using less than 4 points
   for some continuation lines.

 - Eliminated several unused variables, and fused some loops to allow 2-d
   variables to be replaced with scalars.

  With this PR, answers can change when ADD_LES_VISCOSITY=True and there is a
Smagorinsky or Leith Laplacian viscosity and there is a nonzero background.
One run-time parameter is no longer logged if LAPLACIAN=false, so there are
changes to the MOM_parameter_doc files.  All answers in the MOM6-examples test
suite are bitwise identical.
@Hallberg-NOAA Hallberg-NOAA added answer-changing A change in results (actual or potential) bug Something isn't working enhancement New feature or request labels Mar 10, 2022
@codecov
Copy link

codecov bot commented Mar 10, 2022

Codecov Report

Merging #84 (87c99c9) into dev/gfdl (8c6ae0e) will increase coverage by 0.00%.
The diff coverage is 7.20%.

@@            Coverage Diff            @@
##           dev/gfdl      #84   +/-   ##
=========================================
  Coverage     28.98%   28.98%           
=========================================
  Files           245      245           
  Lines         72185    72188    +3     
=========================================
+ Hits          20922    20926    +4     
+ Misses        51263    51262    -1     
Impacted Files Coverage Δ
src/parameterizations/lateral/MOM_hor_visc.F90 42.55% <7.20%> (+0.25%) ⬆️

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 8c6ae0e...87c99c9. Read the comment docs.

@herrwang0
Copy link

Thanks for addressing the issue regarding add_LES_viscosity.

While we are on this, I think there is another issue (mom-ocean#1544) with modified_leith (I posted in the main repo during the migration and I didn't know the right place to post). It looks like the code is slightly different from the description in the comments (and the literatures I think).

@Hallberg-NOAA Hallberg-NOAA linked an issue Mar 11, 2022 that may be closed by this pull request
Copy link
Member

@gustavo-marques gustavo-marques left a comment

Choose a reason for hiding this comment

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

@Hallberg-NOAA: thank you very much for addressing these issues and improving this module. I have verified that this PR does not change answers when USE_GME = True, including when using different PE layouts.

  Minor code cleanup in response to the code review from Gustavo Marques.  In
particular, this introduces a roundoff-level answer changing code simplification
for code that is only exercised if USE_GME=True.  In all other cases the answers
are bitwise identical.
@Hallberg-NOAA
Copy link
Member Author

I believe that the latest commit should satisfactorily address the suggestion by @gustavo-marques, and that this PR is now ready for pipeline testing.

@marshallward
Copy link
Member

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

Removed parameter:

  • USE_KH_BG_2D (now conditionally logged)

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.

Approving on behalf of @gustavo-marques

@marshallward
Copy link
Member

I can't see any reason what status GitHub is waiting on here, and I've tried the "resubmit" trick to no avail, so I am going to admin-override this PR.

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) bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potential bug related the add_LES_viscosity option
4 participants