From edb54190e680ee2fe52d5a09206efd9a82c61b80 Mon Sep 17 00:00:00 2001 From: Chuck Abolt Date: Thu, 9 May 2024 13:43:01 -0600 Subject: [PATCH] Fix rank problem with ice wedge polygon microtopographic variables --- .../elm/src/biogeophys/CanopyHydrologyMod.F90 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/components/elm/src/biogeophys/CanopyHydrologyMod.F90 b/components/elm/src/biogeophys/CanopyHydrologyMod.F90 index 6fb6fb59d0cc..0c4b0f434f71 100755 --- a/components/elm/src/biogeophys/CanopyHydrologyMod.F90 +++ b/components/elm/src/biogeophys/CanopyHydrologyMod.F90 @@ -839,25 +839,25 @@ subroutine FracH2OSfc(bounds, num_h2osfc, filter_h2osfc, & if (lun_pp%ispolygon(l)) then ! calculate water depth and inundation fraction if column is polygonal - swc = h2osfc(c)/1000 ! convert to m + swc = h2osfc(c)/1000_r8 ! convert to m - if (swc > iwp_microrel - iwp_exclvol) then - d = swc + iwp_exclvol + if (swc > iwp_microrel(c) - iwp_exclvol(c)) then + d = swc + iwp_exclvol(c) else d = 0.0 do k=1,10 - fd = (2_r8*iwp_exclvol - iwp_microrel) * (d/iwp_microrel)**3_r8 & - + (2_r8*iwp_microrel - 3_r8*iwp_exclvol) * (d/iwp_microrel)**2_r8 & + fd = (2_r8*iwp_exclvol(c) - iwp_microrel(c)) * (d/iwp_microrel(c))**3_r8 & + + (2_r8*iwp_microrel(c) - 3_r8*iwp_exclvol(c)) * (d/iwp_microrel(c))**2_r8 & - swc - dfdd = (3_r8/iwp_microrel) * (2_r8*iwp_exclvol - iwp_microrel) * (d/iwp_microrel)**2_r8 & - + (2_r8/iwp_microrel) * (2_r8*iwp_microrel - 3_r8*iwp_exclvol) * (d/iwp_microrel) + dfdd = (3_r8/iwp_microrel(c)) * (2_r8*iwp_exclvol(c) - iwp_microrel(c)) * (d/iwp_microrel(c))**2_r8 & + + (2_r8/iwp_microrel(c)) * (2_r8*iwp_microrel(c) - 3_r8*iwp_exclvol(c)) * (d/iwp_microrel(c)) d = d - fd/dfdd enddo endif !-- update the submerged areal fraction using the new d value - frac_h2osfc(c) = (3_r8/iwp_microrel) * (2_r8*iwp_exclvol - iwp_microrel) * (d/iwp_microrel)**2_r8 & - + (2_r8/iwp_microrel) * (2_r8*iwp_microrel - 3_r8*iwp_exclvol) * (d/iwp_microrel) + frac_h2osfc(c) = (3_r8/iwp_microrel(c)) * (2_r8*iwp_exclvol(c) - iwp_microrel(c)) * (d/iwp_microrel(c))**2_r8 & + + (2_r8/iwp_microrel(c)) * (2_r8*iwp_microrel(c) - 3_r8*iwp_exclvol(c)) * (d/iwp_microrel(c)) else ! calculate water depth and inudation fraction if column is non-polygonal d=0.0