From 5f7fbe49d5414013fd36d3f0a3ce0b653d4102a6 Mon Sep 17 00:00:00 2001 From: Peter Thornton Date: Thu, 23 May 2024 19:16:56 -0400 Subject: [PATCH] Adds a lower limit to stem allocation to avoid negative states The stem:leaf allocation variable can go negative without this limiter, which can cause negative stem carbon pools. --- components/elm/src/biogeochem/AllocationMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/elm/src/biogeochem/AllocationMod.F90 b/components/elm/src/biogeochem/AllocationMod.F90 index 2795fd42c8ed..001ad75d42cc 100644 --- a/components/elm/src/biogeochem/AllocationMod.F90 +++ b/components/elm/src/biogeochem/AllocationMod.F90 @@ -645,7 +645,7 @@ subroutine Allocation1_PlantNPDemand (bounds, num_soilc, filter_soilc, num_soilp if (stem_leaf(ivt(p)) < 0._r8) then if (stem_leaf(ivt(p)) == -1._r8) then - f3 = (2.7/(1.0+exp(-0.004*(annsum_npp(p) - 300.0)))) - 0.4 + f3 = max((2.7/(1.0+exp(-0.004*(annsum_npp(p) - 300.0)))) - 0.4_r8, 0.2_r8) else f3 = max((-1.0_r8*stem_leaf(ivt(p))*2.7_r8)/(1.0_r8+exp(-0.004_r8*(annsum_npp(p) - & 300.0_r8))) - 0.4_r8, 0.2_r8) @@ -2118,7 +2118,7 @@ subroutine Allocation3_PlantCNPAlloc (bounds , & if (stem_leaf(ivt(p)) < 0._r8) then if (stem_leaf(ivt(p)) == -1._r8) then - f3 = (2.7/(1.0+exp(-0.004*(annsum_npp(p) - 300.0)))) - 0.4 + f3 = max((2.7/(1.0+exp(-0.004*(annsum_npp(p) - 300.0)))) - 0.4_r8, 0.2_r8) else f3 = max((-1.0_r8*stem_leaf(ivt(p))*2.7_r8)/(1.0_r8+exp(-0.004_r8*(annsum_npp(p) - & 300.0_r8))) - 0.4_r8, 0.2_r8)