-
Notifications
You must be signed in to change notification settings - Fork 60
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
Acceleration of Zanna-Bolton-2020 parameterization and new features required for NW2 #484
Acceleration of Zanna-Bolton-2020 parameterization and new features required for NW2 #484
Conversation
…equired in NW2 configuration
Thanks for putting in some of these improvements to the solver. Before reviewing this, there's at least one error that need to be fixed.
In logical tests, everything has to be converted to logical (e.g. Also a good idea to start fixing up the documentation: https://github.com/NOAA-GFDL/MOM6/actions/runs/6346687254/job/17240553103?pr=484 All function arguments and derived type parameters must always be documented. |
Codecov Report
@@ Coverage Diff @@
## dev/gfdl #484 +/- ##
=========================================
Coverage 37.82% 37.83%
=========================================
Files 270 270
Lines 78359 78346 -13
Branches 14497 14502 +5
=========================================
+ Hits 29640 29641 +1
+ Misses 43314 43297 -17
- Partials 5405 5408 +3
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Hi @marshallward, I addressed the mentioned problems with doxygen and compilation error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Pperezhogin I'm finally getting around to this. Switching from 2D to 3D halo updates looks like a great improvement, and overall structural changes looks good to me as well.
The others may also want to review these changes, but I have added some comments below. Most are related to style (which, as de facto maintainer of this file, you may have some liberty to tell me if I've gone too far 😄). There were a couple places which looked to me like it may improve performance.
-
The
diff[uv]
copy inZanna_Bolton_2020
seemed unnecessary, since you are already modifying the field. Can this simply be modified in-place? -
The
if (CS%Klower_R_diss > 0)
incompute_stress_divergence
look like they can be moved outside of the do-loops. You may see some improved performance if you invert the if/do blocks.
Other than that, it looks good to me.
I addressed all your comments. Regression did not change, tests are passed. Regarding optimizations, I simplified if statements in loops whenever possible. On my system, it does not affect the runtime. Also, now I update diff[u,v] in-place which makes this module 5% faster. Regarding functions name: I introduced consistent naming for all public elements of the module. |
Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/21028 ✔️ Thanks for patience, @Pperezhogin |
Summary
This PR updates the code of Zanna-Bolton-2020 mesoscale parameterization and seeks three purposes:
NW2
Simulations in NW2 at 1/4 resolution are now available with namelist parameters:
Code details
The code was significantly restructured. The full list of commits is available in a separate branch PR_ZB_2020_NW2_and_acceleration.
Removed/new parameters
The following namelist parameters are no longer available and set to default values:
These parameters were controlling complicated filters options which are not currently used.
The following two parameters are introduced which control the attenuation of the subgrid model in NW2 configuration with typical values:
Acceleration of the code
Overall restructuring of the code with storing precomputed arrays led to acceleration ~ 4 times.
Acceleration of filters is achieved with:
Tests
All tests (grid, layout, nan, rotate, dim, restart, openmp) are passed.
Regression
Regression changed twice: