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
Removing potential divide by zero error in Orlanski package (attempt #2) #826
Conversation
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 looks good to me, thanks for providing the bug fix. The changes do not affect the verification experiments, but setting CL=CMAX
when denom=0
will.
I have a few cosmetic suggestions (header, indentation, etc) that the not really related to this PR, but will push them once we are happy with the actual code changes.
I agree with @garrettdreyfus that for continuity reasons, |
@samarkhatiwala, do you have any opinion on the |
We decided to leave as it is now (including setting |
Hey @mjlosch , Sounds great! I can run some experiments setting CL to 0 or CMAX when denom is 0. Any suggestions on experimental setups that would help tease out differences between the two choices? My suspicion is that denom equaling 0 is a rare enough case that the choice won't make much of a difference regardless of experimental setup. |
@garrettdreyfus and @mjlosch I am going to do a quick check before/towards merging this PR soon. |
Unfortunately, no, but you could try to run your setup where you discovered the bug, and show the differences between
to
and it's unclear why this is happening. |
- set _RL local var "CL" to real value "0. _d 0" (instead of integer "0") - remove trailing blanks - minor comment improvements (+ help to read the code)
@garrettdreyfus I made minor adjustments (some related to your changes and some minor ones to improve a little bit how this code reads). As expected, the results are unaffected (given it's only minor changes). If you are OK with those we could go and merge this PR soon. |
@garrettdreyfus I will merge your PR very soon (later today) and thanks for your contribution. |
This PR is a bug fix for issue #822 . It removes the possibility of a divide by zero error in the obcs/orlanski_[north,east,south,west].F files.
There is an ongoing discussion about whether when the denominator is zero, CL should be set to 0 or CMAX.
This pull request has not yet been tested in a set up with the orlanski condition enabled in each direction.