-
Notifications
You must be signed in to change notification settings - Fork 234
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
Fix the bug that Rayleigh_[uv] was not initialized in MOM_barotropic #1329
Fix the bug that Rayleigh_[uv] was not initialized in MOM_barotropic #1329
Conversation
initialized in MOM_barotropic
Codecov Report
@@ Coverage Diff @@
## dev/gfdl #1329 +/- ##
============================================
- Coverage 45.75% 45.75% -0.01%
============================================
Files 234 234
Lines 72542 72555 +13
============================================
+ Hits 33189 33194 +5
- Misses 39353 39361 +8
Continue to review full report at Codecov.
|
Thank you for catching this and fixing it. We would not have caught this, as it is currently untested (https://codecov.io/gh/NOAA-GFDL/MOM6/src/dev%2Fgfdl/src/core/MOM_barotropic.F90). (Yet another reminder that our current coverage needs serious attention!) I would suggest the following alternative, however:
This will make two changes:
|
Hi Marshall, I have a few questions related:
It is probably not a big deal in any case. These are more of questions out of curiosity. |
Very reasonable questions! I was trying not to bore with the details.
I don't expect any of this to make a huge difference (one loop in one function is never going to matter too much) so it's up to you how far to go with it. There will be other opportunities to resolve it. |
2. Split the loop that addes Rayleigh drag term to [uv]_accel_bt, so that the if-block is now outside the loop
I decided to make the changes we discussed, so that hopefully the code related to the Rayleigh drag term is in an optimized state. Specifically, the initialization is now conditional and split from other variable. One thing I am not sure about is the about openmp nowait. It looks like it is not used in the first variable updates for In addition, there seems to be bug related to resetting |
Thank you, this looks good. I'll merge this to dev/gfdl (pending testing) once the main candidate has been merged. |
This PR fixes the bug reported in Issue https://github.com/NOAA-GFDL/MOM6/issues/1326.
In the barotropic solver,
Rayleigh_[uv]
are not initialized, and their values are only assigned at points whereCS%lin_drag_[uv]
(which are the linear wave drag piston velocity at u/v point, averaged from the input file) are not zero.Note that this only affects runs with
BT_LINEAR_WAVE_DRAG
= True