-
Notifications
You must be signed in to change notification settings - Fork 65
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 backscatter divide by zero #62
Fix backscatter divide by zero #62
Conversation
- I division by zero was encountered when using the back-scatter settings (negative viscosity) in NeverWorld2. It appears hrat_min(I,J) can be zero. Reading the code, it makes sense that hrat_min can be zero. The division was previously made conditional in 14971b4 also when using backscatter, but then only one part of the denomitor was used in the conditional. - I'm not sure why the backscatter setup is repeatedly hitting these edge cases or specific line of code. - This fix uses the entire denominator in the conditional.
- A previous re-factor for optimization introduced some inconsistent capitalization. This made it hard to understand the code, especially with some arrays being re-used at different grid locations.
Codecov Report
@@ Coverage Diff @@
## dev/gfdl #62 +/- ##
=========================================
Coverage 28.94% 28.94%
=========================================
Files 242 242
Lines 71553 71553
=========================================
Hits 20714 20714
Misses 50839 50839
Continue to review full report at Codecov.
|
Not sure if this is relevant, but I think
I never checked the actual values of |
MOM6/src/parameterizations/lateral/MOM_hor_visc.F90 Lines 1000 to 1009 in 6da5c9b
|
Since the potential error in the other block is denoted in the comments, and since we're getting ready for a merge to |
A bug fix and an associated cleanup:
One question for @Hallberg-NOAA : could we ever encounter a divide by zero indicated by comment at top of fc3e3ac ?