Open xuchongang opened 5 years ago
@xuchongang, I introduced variable soil thickness into the model. This didn't seem to blow up the model when variable soil thickness was turned on, because the 11th layer is not used when variable soil thickness is turned on. Still, this should be fixed for when the model is run regularly just in case you get the 1 in a million chance of getting zwtmm
and zimm
exactly the same.
@mabrunke , when I set the soil depth to 10meter manually, it gave me this error. If the variabile soil depth does not use the soil layer below, then my fix of avoiding dividing by zero should be OK. @bishtgautam , it would be great if you could confirm.
@xuchongang, I propose an alternate fix:
if (abs(zwtmm(c)-zimm(c,j)) < some_small_threshold) then ! Essentially the diff is zero
vol_eq(c,j+1) = watsat(c,j) ! The 11-th layer completely saturated
! Now compute zq
else
! Do the default code
endif
What do you think?
@bishtgautam, I will follow your suggestions and make the change
When the variable soil depth is set so that interface depth is equal to water depth. Namely,
zwtmm(c)=zimm(c,j)
in the following line of code: https://github.com/E3SM-Project/E3SM/blob/master/components/clm/src/biogeophys/SoilWaterMovementMod.F90#L494, it became divided by zero.I will propose the following fix:
Let me know your thoughts @bishtgautam