AquaticEcoDynamics / GLM

Code for the General Lake Model
http://aquatic.science.uwa.edu.au/research/models/GLM/
GNU General Public License v3.0
35 stars 29 forks source link

fixing ice issue #42

Closed rqthomas closed 7 months ago

rqthomas commented 8 months ago

@matthipsey @casper-boon if you approve of the PR it would be great to have it in the glm-aed build so that we can use that version. We are currently needing to compile glm-aed ourselves to handle this issue at Falling Creek Reservoir.

SurfData.delzBlueIce can be zero after the code above but the ice flag hasn't been updated. As a result, the code still has ice=TRUE and enters the if statement around line 1017. Then it calculates the following

EEE = (K_snow*K_ice_white*K_ice_blue)/((SurfData.delzSnow*K_ice_white*K_ice_blue)+(SurfData.delzBlueIce*K_snow*K_ice_blue)+
                                       (SurfData.delzWhiteIce*K_snow*K_ice_white));

which evaluates to inf and causes NaN in surface temperatures.