Skip to content

Commit

Permalink
Update rk4_misc.f90
Browse files Browse the repository at this point in the history
Reverse the leaf_excess and wood_excess calculation when: 
if (initp%leaf_water_im2(ico) > rk4max_leaf_water_im2
  • Loading branch information
Lo-hatch authored Apr 28, 2022
1 parent 8154a59 commit ae787d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ED/src/dynamics/rk4_misc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2910,7 +2910,7 @@ subroutine adjust_veg_properties(initp,hdid,csite,ipa,ibuff)
! Leaves have too much water. If possible, send water back to wood. !
! If wood is also saturated, leaves expel the excess water as shedding. !
!---------------------------------------------------------------------------!
leaf_excess = rk4max_leaf_water_im2 - initp%leaf_water_im2(ico)
leaf_excess = initp%leaf_water_im2(ico) - rk4max_leaf_water_im2
wood_demand = min(leaf_excess,max(0.d0 &
,rk4max_wood_water_im2-initp%wood_water_im2(ico)))
leaf_wshed = leaf_excess - wood_demand
Expand Down Expand Up @@ -3104,7 +3104,7 @@ subroutine adjust_veg_properties(initp,hdid,csite,ipa,ibuff)
! the excess water goes to shedding. !
!---------------------------------------------------------------------------!
!----- First guess. --------------------------------------------------------!
wood_excess = rk4max_wood_water_im2 - initp%wood_water_im2(ico)
wood_excess = initp%wood_water_im2(ico) - rk4max_wood_water_im2
leaf_demand = rk4max_leaf_water_im2 - initp%leaf_water_im2(ico)
soil_demand = (soil8(nstop)%slmsts-initp%soil_water(kt)) * dslz8(kt) * wdns8
!----- Bounded guess. ------------------------------------------------------!
Expand Down Expand Up @@ -3151,7 +3151,7 @@ subroutine adjust_veg_properties(initp,hdid,csite,ipa,ibuff)
if (fast_diagnostics) then
initp%avg_wflux_wl (ico) = initp%avg_wflux_wl (ico) &
+ leaf_demand
initp%avg_wflux_gw (ico) = initp%avg_wflux_wl (ico) &
initp%avg_wflux_gw (ico) = initp%avg_wflux_gw (ico) &
- soil_demand
initp%avg_wshed_lg (ico) = initp%avg_wshed_lg (ico) &
+ leaf_wshed
Expand Down

0 comments on commit ae787d4

Please sign in to comment.