Skip to content

Commit

Permalink
Bug fix introduced in wrf-model#399 where divide by zero can occur if…
Browse files Browse the repository at this point in the history
… LAI is zero
  • Loading branch information
Michael Barlage committed Sep 24, 2018
1 parent 3ced231 commit ac98022
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phys/module_sf_noahmpdrv.F
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ SUBROUTINE noahmplsm(ITIMESTEP, YR, JULIAN, COSZIN,XLAT,XLONG, & ! IN
RB = MAX(RB, 0.0)
! New Calculation of total Canopy/Stomatal Conductance Based on Bonan et al. (2011)
! -- Inverse of Canopy Resistance (below)
IF(RSSUN .le. 0.0 .and. RSSHA .le. 0.0) THEN
IF(RSSUN .le. 0.0 .or. RSSHA .le. 0.0 .or. LAISUN .eq. 0.0 .or. LAISHA .eq. 0.0) THEN
RS (I,J) = 0.0
ELSE
RS (I,J) = ((1.0/(RSSUN+RB)*LAISUN) + ((1.0/(RSSHA+RB))*LAISHA))
Expand Down

0 comments on commit ac98022

Please sign in to comment.