Skip to content

Commit

Permalink
Advanced snow physics (#360)
Browse files Browse the repository at this point in the history
* new snow tracer implementation (no physics)

* snow redistribution testing options

* settings for 3 snow layers, the way Icepack wants them

* setenv correction

* add rhosmin, snwlvlfac to namelist, change snwredist opetion from 30percent to bulk, fix domain size

* add ice_snow module; compiles, no hooks from main code, module conversion for Icepack incomplete

* rename ice_snow.F90, add icepack_step_snow, call drain_snow, move adjust_enthalpy, add snowage parameters

* bug fix:  dsnow was not being aggregated from category values

* add calls to new snow physics routines

* call update_state, make optional arguments

* snow interactions with thermo (except dEdd)

* snow interactions in dEdd

* add meltsliq to ponds, clean up

* adding snwgrain namelist flag

* Bug fixes from MPAS-Dev/MPAS-Model#314

* constrain calculations based on configuration options, add diagnostics, initialize, debug, clean up

* make dsnow optional

* snow aging table for dry metamorphism

* env for snwgrain test

* snow documentation, first draft

* snow case settings

* fix step_therm1 interface and some documentation errors

* documentation corrections

* complete step_therm1 interface fix; bug fix in bgc diagnostics

* metamorphism updates to doc with notes for things needing to be checked against the code

* remove unused variable

* add snow tests to base_suite

* initialize snow tracer indices when unused; update documentation

* TRSNOW 0 when not using advanced snow physics

* fix snow restarts, clean up unused flags

* updating snow documentation

* adding snow namelist info to science guide

* update icepack to support snowtable better

* adjust parameter values, test options

* send rsnw to dEdd; limit rsnw below; fix snow SSL for z tracers

* updating snow options in icepack for consistency with cice

* reformulate ice-liquid tracer conversions in snow; limit use of rsnow in dEdd with snwgrain; correct rhos_effn; clean up

* another approach for ice/liquid tracer conversions in snow

* enforce mass conservation of snow ice and liquid tracers, to maintain consistency with rhos based snow volume transport

* create temporary array for rsnow in shortwave calls to avoid array-out-of-bounds error when snwgrain=F

* reset default/initial tracer values when snow disappears; some cleanup

* Bug fix for bulk redistribution precipitation factor.  Commented out shortwave modification for bulk redistribution - it should not be used for production runs without more careful analysis of the energy balance between level and ridged ice.

* Another bug fix for bulk redistribution precipitation factor - average alvl weighted by aice.  Reinstated shortwave modification for bulk redistribution - it works the same as for ITDrdg. Updated documentation.

* cleanup

* remove rnsw_dEdd array, load tracer instead; use rsnw_fall instead of rsnw_fresh in dEdd, set dEdd default value in namelist and tr_snow value in options

* Removed variables that were only for history output, instead using the tracer array directly; the snow_effective_density subroutine was then also unnecessary.

* initialize density tracer; fix history output for CICE

Co-authored-by: apcraig <[email protected]>
  • Loading branch information
eclare108213 and apcraig authored Aug 11, 2021
1 parent 583d961 commit 53ffce0
Show file tree
Hide file tree
Showing 42 changed files with 3,197 additions and 545 deletions.
1 change: 1 addition & 0 deletions columnphysics/icepack_algae.F90
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ subroutine zbio (dt, nblyr, &
if (icepack_warnings_aborted(subname)) return

call merge_bgc_fluxes (dt, nblyr, &
nslyr, &
bio_index, n_algae, &
nbtrcr, aicen, &
vicen, vsnon, &
Expand Down
9 changes: 8 additions & 1 deletion columnphysics/icepack_flux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ subroutine merge_fluxes (aicen, &
fswthru_idr, fswthru_idf,&
melttn, meltsn, meltbn, congeln, snoicen, &
meltt, melts, &
meltb, &
meltb, dsnow, dsnown,&
congel, snoice, &
meltsliq, meltsliqn, &
Uref, Urefn, &
Qref_iso, Qrefn_iso, &
fiso_ocn, fiso_ocnn, &
Expand Down Expand Up @@ -95,6 +96,8 @@ subroutine merge_fluxes (aicen, &
melttn , & ! top ice melt (m)
meltbn , & ! bottom ice melt (m)
meltsn , & ! snow melt (m)
meltsliqn,& ! mass of snow melt (kg/m^2)
dsnown , & ! change in snow depth (m)
congeln , & ! congelation ice growth (m)
snoicen ! snow-ice growth (m)

Expand Down Expand Up @@ -125,6 +128,8 @@ subroutine merge_fluxes (aicen, &
meltt , & ! top ice melt (m)
meltb , & ! bottom ice melt (m)
melts , & ! snow melt (m)
meltsliq, & ! mass of snow melt (kg/m^2)
dsnow , & ! change in snow depth (m)
congel , & ! congelation ice growth (m)
snoice ! snow-ice growth (m)

Expand Down Expand Up @@ -212,6 +217,8 @@ subroutine merge_fluxes (aicen, &
meltt = meltt + melttn * aicen
meltb = meltb + meltbn * aicen
melts = melts + meltsn * aicen
meltsliq = meltsliq + meltsliqn * aicen
dsnow = dsnow + dsnown * aicen
congel = congel + congeln * aicen
snoice = snoice + snoicen * aicen

Expand Down
4 changes: 4 additions & 0 deletions columnphysics/icepack_intfc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ module icepack_intfc
use icepack_wavefracspec, only: icepack_init_wave
use icepack_wavefracspec, only: icepack_step_wavefracture

use icepack_snow, only: icepack_step_snow

use icepack_shortwave, only: icepack_prep_radiation
use icepack_shortwave, only: icepack_step_radiation

Expand Down Expand Up @@ -114,6 +116,8 @@ module icepack_intfc
use icepack_mushy_physics , only: icepack_mushy_liquid_fraction
use icepack_mushy_physics , only: icepack_mushy_temperature_mush

use icepack_snow, only: icepack_init_snow

use icepack_warnings, only: icepack_warnings_clear
use icepack_warnings, only: icepack_warnings_print
use icepack_warnings, only: icepack_warnings_flush
Expand Down
35 changes: 19 additions & 16 deletions columnphysics/icepack_itd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ module icepack_itd
use icepack_kinds
use icepack_parameters, only: c0, c1, c2, c3, c15, c25, c100, p1, p01, p001, p5, puny
use icepack_parameters, only: Lfresh, rhos, ice_ref_salinity, hs_min, cp_ice, Tocnfrz, rhoi
use icepack_parameters, only: rhosi, sk_l, hs_ssl, min_salin
use icepack_parameters, only: rhosi, sk_l, hs_ssl, min_salin, rsnw_fall
use icepack_tracers, only: nt_Tsfc, nt_qice, nt_qsno, nt_aero, nt_isosno, nt_isoice
use icepack_tracers, only: nt_apnd, nt_hpnd, nt_fbri, tr_brine, nt_bgc_S, bio_index
use icepack_tracers, only: n_iso
use icepack_tracers, only: tr_iso
use icepack_tracers, only: n_iso, tr_iso, tr_snow, nt_smice, nt_rsnw, nt_rhos
use icepack_tracers, only: icepack_compute_tracers
use icepack_parameters, only: solve_zsal, skl_bgc, z_tracers
use icepack_parameters, only: kcatbound, kitd
Expand Down Expand Up @@ -1230,11 +1229,15 @@ subroutine zap_small_areas (dt, ntrcr, &

if (ntrcr >= 2) then
do it = 2, ntrcr
if (tr_brine .and. it == nt_fbri) then
trcrn(it,n) = c1
else
trcrn(it,n) = c0
endif
trcrn(it,n) = c0
enddo
endif
if (tr_brine) trcrn(nt_fbri,n) = c1
if (tr_snow) then
do k = 1, nslyr
trcrn(nt_rhos +k-1,n) = rhos
trcrn(nt_smice+k-1,n) = rhos
trcrn(nt_rsnw +k-1,n) = rsnw_fall
enddo
endif
first_ice(n) = .true.
Expand Down Expand Up @@ -1424,14 +1427,14 @@ subroutine zap_snow(dt, nslyr, &
endif ! tr_iso

if (z_tracers) then
dvssl = min(p5*vsnon, hs_ssl*aicen) !snow surface layer
dvint = vsnon- dvssl !snow interior

do it = 1, nbtrcr
xtmp = (trcrn(bio_index(it)+nblyr+1)*dvssl + &
trcrn(bio_index(it)+nblyr+2)*dvint)/dt
dflux_bio(it) = dflux_bio(it) + xtmp
enddo ! it
dvssl = min(p5*vsnon/real(nslyr,kind=dbl_kind), hs_ssl*aicen) ! snow surface layer
dvint = vsnon - dvssl ! snow interior

do it = 1, nbtrcr
xtmp = (trcrn(bio_index(it)+nblyr+1)*dvssl + &
trcrn(bio_index(it)+nblyr+2)*dvint)/dt
dflux_bio(it) = dflux_bio(it) + xtmp
enddo ! it

endif ! z_tracers

Expand Down
31 changes: 19 additions & 12 deletions columnphysics/icepack_meltpond_cesm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module icepack_meltpond_cesm

use icepack_kinds
use icepack_parameters, only: c0, c1, c2, p01, puny
use icepack_parameters, only: rhofresh, rhoi, rhos, Timelt
use icepack_parameters, only: rhofresh, rhoi, rhos, Timelt, pndaspect, use_smliq_pnd
use icepack_warnings, only: warnstr, icepack_warnings_add
use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted

Expand All @@ -32,19 +32,19 @@ module icepack_meltpond_cesm
!=======================================================================

subroutine compute_ponds_cesm(dt, hi_min, &
pndaspect, &
rfrac, meltt, &
melts, frain, &
aicen, vicen, &
Tsfcn, apnd, hpnd)
aicen, vicen, &
Tsfcn, apnd, hpnd, &
meltsliqn)

real (kind=dbl_kind), intent(in) :: &
dt, & ! time step (s)
hi_min, & ! minimum ice thickness allowed for thermo (m)
pndaspect ! ratio of pond depth to pond fraction
hi_min ! minimum ice thickness allowed for thermo (m)

real (kind=dbl_kind), intent(in) :: &
rfrac, & ! water fraction retained for melt ponds
meltsliqn, & ! liquid input from snow liquid tracer
rfrac, & ! water fraction retained for melt ponds
meltt, &
melts, &
frain, &
Expand Down Expand Up @@ -104,11 +104,18 @@ subroutine compute_ponds_cesm(dt, hi_min, &
!-----------------------------------------------------------
! Update pond volume
!-----------------------------------------------------------
volpn = volpn &
+ rfrac/rhofresh*(meltt*rhoi &
+ melts*rhos &
+ frain* dt)&
* aicen
if (use_smliq_pnd) then
volpn = volpn &
+ rfrac/rhofresh*(meltt*rhoi &
+ meltsliqn) &
* aicen
else
volpn = volpn &
+ rfrac/rhofresh*(meltt*rhoi &
+ melts*rhos &
+ frain* dt)&
* aicen
endif

!-----------------------------------------------------------
! Shrink pond volume under freezing conditions
Expand Down
24 changes: 15 additions & 9 deletions columnphysics/icepack_meltpond_lvl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module icepack_meltpond_lvl
use icepack_kinds
use icepack_parameters, only: c0, c1, c2, c10, p01, p5, puny
use icepack_parameters, only: viscosity_dyn, rhoi, rhos, rhow, Timelt, Tffresh, Lfresh
use icepack_parameters, only: gravit, depressT, rhofresh, kice
use icepack_parameters, only: gravit, depressT, rhofresh, kice, pndaspect, use_smliq_pnd
use icepack_warnings, only: warnstr, icepack_warnings_add
use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted

Expand All @@ -35,14 +35,15 @@ module icepack_meltpond_lvl
subroutine compute_ponds_lvl(dt, nilyr, &
ktherm, &
hi_min, dpscale, &
frzpnd, pndaspect, &
frzpnd, &
rfrac, meltt, melts, &
frain, Tair, fsurfn,&
dhs, ffrac, &
aicen, vicen, vsnon, &
qicen, sicen, &
Tsfcn, alvl, &
apnd, hpnd, ipnd)
apnd, hpnd, ipnd, &
meltsliqn)

integer (kind=int_kind), intent(in) :: &
nilyr, & ! number of ice layers
Expand All @@ -51,8 +52,7 @@ subroutine compute_ponds_lvl(dt, nilyr, &
real (kind=dbl_kind), intent(in) :: &
dt, & ! time step (s)
hi_min, & ! minimum ice thickness allowed for thermo (m)
dpscale, & ! alter e-folding time scale for flushing
pndaspect ! ratio of pond depth to pond fraction
dpscale ! alter e-folding time scale for flushing

character (len=char_len), intent(in) :: &
frzpnd ! pond refreezing parameterization
Expand All @@ -69,7 +69,8 @@ subroutine compute_ponds_lvl(dt, nilyr, &
fsurfn,& ! atm-ice surface heat flux (W/m2)
aicen, & ! ice area fraction
vicen, & ! ice volume (m)
vsnon ! snow volume (m)
vsnon, & ! snow volume (m)
meltsliqn ! liquid contribution to meltponds in dt (kg/m^2)

real (kind=dbl_kind), &
intent(inout) :: &
Expand Down Expand Up @@ -154,9 +155,14 @@ subroutine compute_ponds_lvl(dt, nilyr, &
! update pond volume
!-----------------------------------------------------------
! add melt water
dvn = rfrac/rhofresh*(meltt*rhoi &
+ melts*rhos &
+ frain* dt)*aicen
if (use_smliq_pnd) then
dvn = rfrac/rhofresh*(meltt*rhoi &
+ meltsliqn)*aicen
else
dvn = rfrac/rhofresh*(meltt*rhoi &
+ melts*rhos &
+ frain* dt)*aicen
endif

! shrink pond volume under freezing conditions
if (trim(frzpnd) == 'cesm') then
Expand Down
Loading

0 comments on commit 53ffce0

Please sign in to comment.