-
Notifications
You must be signed in to change notification settings - Fork 61
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
Implementation of Zanna-Bolton-2020 equation discovery model of mesoscale momentum fluxes #344
Conversation
to full momentum tendency.
…and ssd coefficient
Codecov Report
@@ Coverage Diff @@
## dev/gfdl #344 +/- ##
============================================
- Coverage 37.07% 36.96% -0.12%
============================================
Files 264 265 +1
Lines 74347 74641 +294
Branches 13784 13817 +33
============================================
+ Hits 27567 27592 +25
- Misses 41684 41953 +269
Partials 5096 5096
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Thank you very much for this contribution, @Pperezhogin! This looks like a very valuable contribution, and I am looking forward to trying it out in MOM6 configurations.
There are, however, several (mostly minor) things that will need to be addressed with this PR before we could merge this into MOM6.
- This PR is failing the automated testing, as indicated by the red X at Implementation of Zanna-Bolton-2020 equation discovery model of mesoscale momentum fluxes #344. This is just due to trailing white space, but this is not something that is allowed in MOM6, as detailed at https://github.com/NOAA-GFDL/MOM6/wiki/Code-style-guide. It is, however, very easy to find this trailing white spaces using a command like
grep -n ' $' *.F90
. Please correct this in an updated PR. - As detailed in the MOM6 style guide, all arguments to routines must be described with doxygen comments, and all routines must have doxygen comments describing their purpose. These are missing for several of the new internal routines, like
min_max()
andcompute_masks()
. - This PR contains a huge number (106) of commits. Please see the MOM6 discussion on this at Commit and Pull Request Etiquette mom-ocean/MOM6#1335. We would recommend that you consider combining all of these various commits into a single or a few commits that we want to retain in the history for debugging purposes. Each commit within a PR should be tested and be known to give reasonable answers in regression tests (for example). With a big, complicated PR, I will often do my development on one branch, and then redo it with many fewer deliberately selected commits to document the sensible (and well-tested) way points in the PR that will become a part of the official model history that we have to work through when debugging. If you want to retain the PR same name and description, you could use
git push --force
to update your PR in place. The other option is that we could do a squash-merge of this PR so that it appears as a single commit in the history, but that would deprive us of the possibility of putting in useful waypoints to help in any future debugging of the code and the resulting commit message that would result from the concatenation of the 106 messages in the individual commits would probably not be very readable. - Please see the MOM6 style guide about when array-syntax math is acceptable. In general, array syntax math should be avoided for arrays with halos. It can be a very bad idea when working on arrays with halos that might not get filled in on non-reentrant domains, and hence could contain NaNs that could get in the way when debugging, even if they do not propagate through multiplicative masks to bring down a simulation.
- We strongly prefer the use of opaque types to prevent mis-use of code from outside of a module, and to retain greater freedom to revise a module later on. Your ZB2020_CS type is transparent (i.e., it does not have a
private
attribute inside of it), and itsuse_ZB2020
element is being used in horizontal viscosity. Please consider making this type opaque, and return the value ofuse_ZB2020
either as an argument toZB_2020_init
or make that initialization routine into a function that uses this value, and then store that logical in the horizontal viscosity control structure. - A number of the comments describing the new parameters that are being read in via get_param calls in ZB_2020_init will be very cryptic when viewed outside of the context of this module. Bear in mind that these will all be logged in parameter files, and should be somewhat understandable on their own.
- Please do not log all of the new parameters with the new scheme when USE_ZB2020 is false. The easiest way to do this to add the argument
..., do_not_log=.not.CS%use_ZB2020
to all of the get_param_calls in ZB2020_init apart from the first one for "USE_ZB2020" itself. - The parameters read with get_param should have names that better reflect their usage. For example "amplitude" does not give any hint of what it is the amplitude of or what scheme it is used for. "ZB_AMPLITUDE" at least hints that this variable is used the ZB2020 scheme. (Note also that by convention, parameter names are case-sensitive and usually given in all capital letters.)
- Please do not register any of the diagnostics from this module unless it will be used. To avoid doing so, please add a logical test for the value of
CS%use_CP2020
around the register_diag_field calls on lines 122-145 or add a return statement to ZB_2020_init before these calls when it is false. - Please describe the units of each of the real variables in this routine in the comments where they are introduced. Many of these declarations do have descriptions of their units, but they are missing in a number of cases. If the units are arbitrary (e.g., in a linear solver) we describe them with
[arbitrary]
. - Please use the MOM6 error handler via calls like
call MOM_error(WARNING, ...)
orcall MOM_mesg(...)
instead of simple Fortranwrite()
statements. The former allows us to use verbosity controls and helps us manage potentially huge volumes of output from failing parallel runs, while the latter could tie up an entire parallel computer system if there is a message coming from every point on every PE.
Again I would like to repeat my enthusiasm for this new capability, and I hope that you will find these comments to be helpful and not too onerous to address.
…ression are passed.
Hi @Hallberg-NOAA! Thanks for the detailed review! I responded to every bullet point in a separate commit, as you can see in branch PR_ZB_2020. Also, in response to point 3, I created a separate branch with 5 commits representing main development stages for the last year: PR_ZB_2020_combined. The last commit in both branches is the same. The functionality of the resulting code is the same as submitted via PR: Regression did not change, all tests were passed. |
@Pperezhogin I think it would be simpler if we closed this and reopened with your rebased branch, PR_ZB_2020_combined. Otherwise, we would have to squash-merge this one due to the large number of commits. |
Thanks @Pperezhogin ! I'll close this one and move discussion to the other PR. |
Momentum part of equation discovery parameterization of ZB2020.
Compared to paper, new filters are introduced to improve physical and numerical properties.
Some combination of parameters: