
Opened 23 months ago
Closed 19 months ago
#2257 closed Defect (fixed)
Floating point overflow linked to snow thickness in SI3
Reported by: | skeeley | Owned by: | ![]() |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | SI3 | Version: | release-4.0 |
Severity: | minor | Keywords: | ice, FPE |
Cc: | Branch review: | ||
MP ready?: | Task progress: |
Description
Context
We are having floating point exceptions in rare occasions in icethd.F90.
Analysis
The floating point exceptions happens in the following:
WHERE( h_s_1d(1:npti)>0._wp ) e_s_1d(1:npti,jk) = e_s_1d(1:npti,jk) / (h_s_1d(1:npti) * a_i_1d(1:npti)) * nlay_s
where h_s_1d was extremely small (~1e-300 but >0.0) but a_i_1d identical to 0.0 causing a FPE.
Recommendation
While we can add a hack to check for very small values here to get the code running (and a similar hack in icedyn_adv_umx.F90) to make the code run then we suspect that this may be fixed more elegantly elsewhere by someone who knows the code better…
Happy to test potential fixes!
Commit History (2)
Changeset | Author | Time | ChangeLog |
---|---|---|---|
10786 | clem | 2019-03-20T19:59:24+01:00 | |
10785 | clem | 2019-03-20T19:58:40+01:00 |
Attachments (1)
Change History (8)
comment:1
Changed 23 months ago by skeeley
- Summary changed from Floating point overflow linked snow thickness in SI3 to Floating point overflow linked to snow thickness in SI3
Changed 23 months ago by clem
comment:2
Changed 23 months ago by clem
comment:3
Changed 23 months ago by skeeley
Thanks Clem!
We have the code in for testing now - will let you know.
comment:4
Changed 23 months ago by clevy
- Owner changed from systeam to clem
- Status changed from new to assigned
comment:5
Changed 22 months ago by clem
In 10785:
comment:6
Changed 22 months ago by clem
In 10786:
comment:7
Changed 19 months ago by clem
- Resolution set to fixed
- Status changed from assigned to closed
I have modified one thermodynamic routine(attached here), so that snow thickness becomes 0 when ice completely disappears (I also made sure that we still conserve mass and heat). I do not think other routines should be changed.
However I cannot reproduce your FPE error. Could you try the routine before I commit it?
Thanks