NSSL Microphysics log(0) FPE#1216
Conversation
Fixed a divide by zero problem when the incomplete gamma function is called with a second argument of zero. In this case it now correctly returns the complete gamma. Also, since the gamxinflu lookup table is double precision, calculated values for it are now DP instead of single precision. Very slight differences will result.
|
@davegill Oh, yes, correct. It's late on a Friday... an FPE is an FPE, right? Thanks! Fixed the description. |
|
@weiwangncar @dudhia |
|
@MicroTed |
|
@davegill Sure thing! Please find result of the WRF regression test cases in the attachment. This build is for Commit ID: 8d915e3, requested by: MicroTed for PR: #1216. For any query please send e-mail to David Gill. |
| real :: bxh,bxhl | ||
|
|
||
| real :: alp,ratio,x,y,y7 | ||
| real :: alp,ratio !,x,y,y7 |
There was a problem hiding this comment.
@MicroTed
Ted,
Instead of commenting these out, maybe just remove them?
| alp = float(j)*dqiacralpha | ||
| y = gamma_sp(1.+alp) | ||
| y = gamma_dpr(1.+alp) | ||
| y2 = gamma_dpr(real(2.+alp)) |
There was a problem hiding this comment.
@MicroTed
Ted,
Why are these two lines different? Why does one need real and the other does not?
y = gamma_dpr(1.+alp)
y2 = gamma_dpr(real(2.+alp))
|
@weiwangncar @dudhia |
|
@davegill Haha, I'm sure there's a sordid history behind using the "real" function there, but I don't recall. It is not needed now, clearly. Same goes for those commented variable declarations. I can change those in my master code, too. There's like 15k lines of code and only one of me.... you never know if you'll need that code again, you know ;) |
|
I'm ok with this PR. |
|
if everyone is OK with this PR, I will approve it soon.. |
|
@smileMchen |
|
But the suggested changes have not been made yet.
…On Tue, Jul 14, 2020 at 1:54 PM Dave Gill ***@***.***> wrote:
@smileMchen <https://github.com/smileMchen>
Ming,
Yes, we are OK to approve this one.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1216 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77DNDS6IT3GJ45MFQSDR3SZXXANCNFSM4ODGIR7Q>
.
|
|
The suggested changes have been made internally, so they will appear with the next update. They have no effect, unless there is some compiler complaint that I'm unaware of. |
|
I made the approval, so we're fine.
…On Tue, Jul 14, 2020 at 2:51 PM Ted Mansell ***@***.***> wrote:
The suggested changes have been made internally, so they will appear with
the next update. They have no effect, unless there is some compiler
complaint that I'm unaware of.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1216 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77ECBUOUTK7JJCGIDA3R3TALLANCNFSM4ODGIR7Q>
.
|
TYPE: bug fix
KEYWORDS: floating point exception, log, gamma
SOURCE: Ted Mansell (NSSL)
DESCRIPTION OF CHANGES:
unless compiling with debug checks for FPEs. The problem was when the incomplete gamma function was
called with a second argument of zero. It now correctly returns the complete gamma.
precision. Very slight differences will result.
LIST OF MODIFIED FILES:
phys/module_mp_nssl_2mom.F
ISSUE:
Fixes #1207 "Bug: log(0) in module_mp_nssl_2mom.F"
TESTS CONDUCTED:
RELEASE NOTE:
For NSSL Microphysics, fixed a floating point log(0) and minor change to lookup table.