From 9e7012ebc14564410c52ec17a188a7ae5ed07296 Mon Sep 17 00:00:00 2001 From: Emily Collier Date: Fri, 6 Sep 2024 11:17:15 +0200 Subject: [PATCH] bug fix for HCPCT variable for glacierized grid cells (issue #140) --- drivers/wrf/module_sf_noahmpdrv.F | 2 +- src/module_sf_noahmp_glacier.F | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/wrf/module_sf_noahmpdrv.F b/drivers/wrf/module_sf_noahmpdrv.F index 8ffec2c..ae13527 100644 --- a/drivers/wrf/module_sf_noahmpdrv.F +++ b/drivers/wrf/module_sf_noahmpdrv.F @@ -1056,7 +1056,7 @@ SUBROUTINE noahmplsm(ITIMESTEP, YR, JULIAN, COSZIN,XLAT,XLONG, & ! IN FSA, FSR, FIRA, FSH, FGEV, SSOIL, & ! OUT : TRAD, ESOIL, RUNSF, RUNSB, SAG, SALB, & ! OUT : QSNBOT,PONDING,PONDING1,PONDING2, T2MB, Q2MB, & ! OUT : - EMISSI, FPICE, CHB2, QMELT & ! OUT : + EMISSI, FPICE, CHB2, QMELT, HCPCT & ! OUT : #ifdef WRF_HYDRO , sfcheadrt(i,j) & #endif diff --git a/src/module_sf_noahmp_glacier.F b/src/module_sf_noahmp_glacier.F index 5ec65e5..6d5fdcd 100644 --- a/src/module_sf_noahmp_glacier.F +++ b/src/module_sf_noahmp_glacier.F @@ -112,7 +112,7 @@ SUBROUTINE NOAHMP_GLACIER (& FSA ,FSR ,FIRA ,FSH ,FGEV ,SSOIL , & ! OUT : TRAD ,EDIR ,RUNSRF ,RUNSUB ,SAG ,ALBEDO , & ! OUT : QSNBOT ,PONDING ,PONDING1,PONDING2,T2M ,Q2E , & ! OUT : - EMISSI, FPICE, CH2B ,QMELT & ! OUT : + EMISSI, FPICE, CH2B ,QMELT, HCPCT & ! OUT : #ifdef WRF_HYDRO , sfcheadrt & #endif @@ -209,7 +209,8 @@ SUBROUTINE NOAHMP_GLACIER (& REAL :: QDEW !ground surface dew rate [mm/s] REAL :: QVAP !ground surface evap. rate [mm/s] REAL :: LATHEA !latent heat [j/kg] - REAL, INTENT(OUT) :: QMELT !internal pack melt due to phase change [mm/s] + REAL, INTENT(OUT) :: QMELT !internal pack melt due to phase change [mm/s] + REAL, DIMENSION(-NSNOW+1:NSOIL), INTENT(OUT) :: HCPCT !heat capacity [j/m3/k] REAL :: SWDOWN !downward solar [w/m2] REAL :: BEG_WB !beginning water for error check REAL :: ZBOT = -8.0 @@ -245,7 +246,7 @@ SUBROUTINE NOAHMP_GLACIER (& TAUSS ,QSFC , & !inout IMELT ,SNICEV ,SNLIQV ,EPORE ,QMELT ,PONDING, & !out SAG ,FSA ,FSR ,FIRA ,FSH ,FGEV , & !out - TRAD ,T2M ,SSOIL ,LATHEA ,Q2E ,EMISSI, CH2B ) !out + TRAD ,T2M ,SSOIL ,LATHEA ,Q2E ,EMISSI, CH2B, HCPCT ) !out SICE = MAX(0.0, SMC - SH2O) SNEQVO = SNEQV @@ -358,7 +359,7 @@ SUBROUTINE ENERGY_GLACIER (NSNOW ,NSOIL ,ISNOW ,DT ,QSNOW ,RHOAIR , & !i TAUSS ,QSFC , & !inout IMELT ,SNICEV ,SNLIQV ,EPORE ,QMELT ,PONDING, & !out SAG ,FSA ,FSR ,FIRA ,FSH ,FGEV , & !out - TRAD ,T2M ,SSOIL ,LATHEA ,Q2E ,EMISSI, CH2B ) !out + TRAD ,T2M ,SSOIL ,LATHEA ,Q2E ,EMISSI, CH2B, HCPCT) !out ! -------------------------------------------------------------------------------------------------- ! -------------------------------------------------------------------------------------------------- @@ -426,6 +427,7 @@ SUBROUTINE ENERGY_GLACIER (NSNOW ,NSOIL ,ISNOW ,DT ,QSNOW ,RHOAIR , & !i REAL , INTENT(OUT) :: Q2E REAL , INTENT(OUT) :: EMISSI REAL , INTENT(OUT) :: CH2B !sensible heat conductance, canopy air to ZLVL air (m/s) + REAL, DIMENSION(-NSNOW+1:NSOIL) , INTENT(OUT) :: HCPCT !heat capacity [j/m3/k] ! local @@ -438,7 +440,6 @@ SUBROUTINE ENERGY_GLACIER (NSNOW ,NSOIL ,ISNOW ,DT ,QSNOW ,RHOAIR , & !i REAL :: FIRE !emitted IR (w/m2) REAL, DIMENSION(-NSNOW+1:NSOIL) :: FACT !temporary used in phase change REAL, DIMENSION(-NSNOW+1:NSOIL) :: DF !thermal conductivity [w/m/k] - REAL, DIMENSION(-NSNOW+1:NSOIL) :: HCPCT !heat capacity [j/m3/k] REAL :: GAMMA !psychrometric constant (pa/k) REAL :: RHSUR !raltive humidity in surface soil/snow air space (-)