From 4d9359a93f06021cf8e5a7db0aef36fc89aea6c6 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunke Date: Fri, 25 Nov 2022 10:15:52 -0700 Subject: [PATCH 1/2] bug fixes for snow grain radius, brine conservation check --- columnphysics/icepack_snow.F90 | 5 +++-- columnphysics/icepack_therm_itd.F90 | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/columnphysics/icepack_snow.F90 b/columnphysics/icepack_snow.F90 index 6b8404b0c..221bca747 100644 --- a/columnphysics/icepack_snow.F90 +++ b/columnphysics/icepack_snow.F90 @@ -31,7 +31,8 @@ module icepack_snow real (kind=dbl_kind), parameter, public :: & S_r = 0.033_dbl_kind, & ! irreducible saturation (Anderson 1976) - S_wet= 4.22e-5_dbl_kind ! (um^3/s) wet metamorphism parameters + S_wet= 4.22e5_dbl_kind ! wet metamorphism parameter (um^3/s) + ! = 1.e18 * 4.22e-13 (Oleson 2010) real (kind=dbl_kind) :: & min_rhos, & ! snowtable axis data, assumes linear data @@ -1079,7 +1080,7 @@ subroutine snow_wet_metamorph (dt, dr_wet, rsnw, smice, smliq) dr_wet = c0 fliq = c1 if (smice + smliq > c0 .and. rsnw > c0) then - fliq = min(smliq/(smice + smliq),p1)*c100 + fliq = min(smliq/(smice + smliq),p1) dr_wet = S_wet * fliq**3*dt/(c4*pi*rsnw**2) endif diff --git a/columnphysics/icepack_therm_itd.F90 b/columnphysics/icepack_therm_itd.F90 index 663322ab9..d93a7c47a 100644 --- a/columnphysics/icepack_therm_itd.F90 +++ b/columnphysics/icepack_therm_itd.F90 @@ -236,7 +236,7 @@ subroutine linear_itd (ncat, hin_max, & if (tr_brine) then vbrin(n) = vbrin(n) + trcrn(nt_fbri,n) & - * vicen(n)/real(nilyr,kind=dbl_kind) + * vicen(n) endif do k = 1, nilyr @@ -653,7 +653,7 @@ subroutine linear_itd (ncat, hin_max, & if (tr_brine) then vbrin(n) = vbrin(n) + trcrn(nt_fbri,n) & - * vicen(n)/real(nilyr,kind=dbl_kind) + * vicen(n) endif do k = 1, nilyr From 236023fbdf408110245d7e026a14df06b266c744 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunke Date: Mon, 28 Nov 2022 11:54:35 -0700 Subject: [PATCH 2/2] bug fix for snow drainage; allow drainage for snow aging when meltpond water is not used --- columnphysics/icepack_snow.F90 | 15 +++++++++------ columnphysics/icepack_therm_vertical.F90 | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/columnphysics/icepack_snow.F90 b/columnphysics/icepack_snow.F90 index 221bca747..a2a481743 100644 --- a/columnphysics/icepack_snow.F90 +++ b/columnphysics/icepack_snow.F90 @@ -16,7 +16,7 @@ module icepack_snow use icepack_parameters, only: isnw_T, isnw_Tgrd, isnw_rhos use icepack_parameters, only: snowage_rhos, snowage_Tgrd, snowage_T use icepack_parameters, only: snowage_tau, snowage_kappa, snowage_drdt0 - use icepack_parameters, only: snw_aging_table + use icepack_parameters, only: snw_aging_table, use_smliq_pnd use icepack_therm_shared, only: icepack_ice_temperature use icepack_therm_shared, only: adjust_enthalpy @@ -1161,7 +1161,8 @@ subroutine drain_snow (nslyr, vsnon, aicen, & real (kind=dbl_kind) :: & hslyr, & ! snow layer thickness (m) - hsn ! snow thickness (m) + hsn, & ! snow thickness (m) + sliq ! snow liquid content (kg/m^2) real (kind=dbl_kind), dimension(nslyr) :: & dlin , & ! liquid mass into the layer from above (kg/m^2) @@ -1172,27 +1173,29 @@ subroutine drain_snow (nslyr, vsnon, aicen, & character (len=*), parameter :: subname='(drain_snow)' hsn = c0 + sliq = c0 if (aicen > c0) hsn = vsnon/aicen if (hsn > puny) then dlin (:) = c0 dlout(:) = c0 hslyr = hsn / real(nslyr,kind=dbl_kind) - meltsliq = c0 do k = 1, nslyr massliq(k) = massliq(k) + dlin(k) ! add liquid in from layer above phi_ice(k) = min(c1, massice(k) / (rhoi *hslyr)) phi_liq(k) = massliq(k) / (rhofresh*hslyr) - dlout(k) = max(c0, (phi_liq(k) - S_r*(c1-phi_ice(k))) / rhofresh*hslyr) + dlout(k) = max(c0, (phi_liq(k) - S_r*(c1-phi_ice(k))) * rhofresh * hslyr) massliq(k) = massliq(k) - dlout(k) if (k < nslyr) then dlin(k+1) = dlout(k) else - meltsliq = dlout(nslyr) ! this (re)initializes meltsliq + sliq = dlout(nslyr) ! this (re)initializes meltsliq endif enddo else - meltsliq = meltsliq ! computed in thickness_changes + sliq = meltsliq ! computed in thickness_changes endif + meltsliq = meltsliq + if (use_smliq_pnd) meltsliq = sliq end subroutine drain_snow diff --git a/columnphysics/icepack_therm_vertical.F90 b/columnphysics/icepack_therm_vertical.F90 index 9b71bae15..17e0c1fd1 100644 --- a/columnphysics/icepack_therm_vertical.F90 +++ b/columnphysics/icepack_therm_vertical.F90 @@ -2800,7 +2800,7 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, & endif ! aicen_init - if (snwgrain .and. use_smliq_pnd) then + if (snwgrain) then call drain_snow (nslyr = nslyr, & vsnon = vsnon(n), & aicen = aicen(n), &