Potential issues in M7 for Single Precision#2
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| ! The argument is that we miss all value between | ||
| ! EPS(SP)=~1e-7 and EPS(DP)=~2e-16 when running at SP | ||
| ! | ||
| IF (ZVOL(JL) .GE. ZEPS) THEN !eehol: total volume per mode need to be above treshold to avoid div by zero |
There was a problem hiding this comment.
An idea is to devise a the test independent from the precision, for example by using a fixed lower value of 1e-30 (or just 2e-16 so we are closer to what EPS in DP is currently using)
|
Also, in module/mo_ham_m7.F90, this line: zrpav=zeps+0.5_dp*(pm6rp(jl,jk,jm1)+pm6rp(jl,jk,jm2)) does not seem to be safe. With pm6rp in cm, the addition of zeps in SP boils down to a shift by zeps=1.19e-7 cm or ~1 nm. |
| presult = 0.5_dp * (1.0_dp + erf(arg / sqrt(2.0_dp))) | ||
| ccum = 1.0_dp - presult |
There was a problem hiding this comment.
The ERF function is default in Fortran 2003 and above. We could even use the MKL library with Intel, but that can be left for future improvement.
Using erf here removes all the tests on eps and zmin introduced in that subroutine.
|
In general, with EPSILON()=1.19e-7 in SP, we cannot guarantee any longer that it is used correctly throughout the HAM-M7 code, and we need to check this carefully. |
Try to identify and fix potential issues when running in SP.