-
Notifications
You must be signed in to change notification settings - Fork 231
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
Momentum budget terms multiplied by fractional layer-thicknesses #1163
Conversation
…ed. In these, differet budget terms multiplied by fractional layer thicknesses are saved. Thus, these terms can be added over the whole to obtain the barotropic momentum budget. 'btstep' subroutine in MOM_barotropic module is modified to return fractional thicknesses. Pressure force accelaration multiplied by fractional thickness as diagnostics are added in this commit.
…lied momentum budget terms
…ative vorticity and gradient of kinetic energy
…y allocated if any of the relevant diagnostics are called.
Codecov Report
@@ Coverage Diff @@
## dev/gfdl #1163 +/- ##
============================================
- Coverage 46.08% 45.95% -0.14%
============================================
Files 214 224 +10
Lines 69399 70428 +1029
============================================
+ Hits 31984 32363 +379
- Misses 37415 38065 +650
Continue to review full report at Codecov.
|
Thanks for this pull request @hmkhatri. We spoke about it during the MOM6 developers meeting today, 20 July 2020. @Hallberg-NOAA and @adcroft are happy with the 2d diagnostics. However, they wish to comment out the 3d diagnostics given that we do not know the proper remapping grid option and to retain these diagnostics might confuse future users/developers. Given that we might need to have these diagnostics for debugging in the future, we recommend commenting them and putting a note in the code at each comment. At some point in the near future, after multiple applications of these diagnostics over some months, then we can remove the commented code. But for the meantime, we should just leave the code but have it commented. Please make these changes and update your pull request, at which point we will run through the regression tests and move forward with bringing this code into the main trunk. Thanks again! This is a good step forward with making MOM6 an analyst-friendly code. |
… we do not the proper grid remapping option.
@StephenGriffies Thanks. I agree that the remapping option could be an issue in 3D diagnostics. As suggested, I have commented 3D diagnostics and put a note in all relevant places. |
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.
This PR is getting close to where it needs to be, and it will be a valuable addition when it does get there.
However, there are still a few changes that are needed. First, this is still failing some of the the Travis tests, as indicated by the test report toward the bottom of https://github.com/NOAA-GFDL/MOM6/pull/1163. Looking into the details, there are a couple of new variables that are not being described in dOxygen comments, and some of the new line lengths exceed the 120 character MOM6 limit. Fixing these should not be difficult.
Travis is also reporting that the checksums in the files with all diagnostics have changed, but this is acceptable because this commit is introducing new diagnostics and these checksums are supposed to change.
In addition, there are some allocate statements for pointers (hf_rvxu_2d, hv_rvxv_2d, hf_gKEv_2d, and hf_gKEu_2d at least) that do not have corresponding deallocate statements, which could lead to a memory leak. Because these arrays are not used outside of CorAdCalc, they do not need to be pointers - they could be allocatable arrays. Also, since these are only 2-d, the memory-footprint consequences of making these into automatically allocated arrays (like KEx in the same file) would not be too bad. Please look at these and all the other pointers that are being allocated as a part of this commit to make sure that we are not introducing any memory leaks.
I look forward to seeing the updated version with these minor corrections that we can pull onto dev/gfdl. @hmkhatri, I can help guide you through these fixes if any of this is not clear.
Thanks @Hallberg-NOAA for your careful review. These changes should be straightforward. |
Thanks for the detailed comments @Hallberg-NOAA. I do not understand what you mean by "dOxygen comments". I will change 2D arrays from pointer style to allocatable local arrays and deallocate them after use. Just to be sure, I should use the following style and deallocate after use, right?
|
Take a look here for documentation of MOM6 code https://github.com/NOAA-GFDL/MOM6/wiki In particular, see this page for Doxygen |
@Hallberg-NOAA @StephenGriffies Thanks for the comments. I have implemented the suggested changes. All 3D diagnostics are now commented. For 2D diagnostics, allocatable arrays are used for initialization and these arrays are deallocated after the post-data step. All lines are under 120 characters in length. |
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 for the revisions to this PR. They have neatly addressed all of the previous issues, and I am now happy to approve this PR.
This passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/10886 . It changes the contents of the MOM_parameter_doc files, so there will need to be an update to MOM6-examples after this PR is resolved on the MOM6 repository. |
New diagnostics, i.e. momentum budget terms (
PFu/PFv
,CAu/CAv
etc.) multiplied by fractional layer thicknesses have been added for momentum budget analysis. Fractional thicknesses are already computed in the barotropic step. These fractional thicknesses are now returned in thebtstep
subroutine call in theMOM_dynamics_split_RK2
file and are used across different modules to compute required diagnostics.These depth-integrated budget term diagnostics would be useful in studying barotropic momentum and vorticity budgets, and the depth-integrated budget terms are also implemented in the diagnostics.
@ashao @StephenGriffies @Hallberg-NOAA Could you please review it?