Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A new sea level pond scheme. #515

Open
wants to merge 73 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
9b57443
added pond state vars to history, still need to validate!
davidclemenssewall Dec 18, 2023
bf3b4d2
pond state variables in history and validated
davidclemenssewall Jan 2, 2024
15eb66a
added snow melt
davidclemenssewall Jan 2, 2024
9cfaaa6
code runs with flpndn, no history yet
davidclemenssewall Jan 2, 2024
3c5e913
flpndn and expndn history now working
davidclemenssewall Jan 4, 2024
df2b57c
runs with per-category freshwater fluxes
davidclemenssewall Jan 6, 2024
3b239a7
history output for meltwater fluxes is working
davidclemenssewall Jan 6, 2024
f12a158
rfpnd running, no history yet
davidclemenssewall Jan 8, 2024
0cac7e2
history for rfpnd is now working
davidclemenssewall Jan 8, 2024
ec2700c
pond diagnostic variables mostly complete
davidclemenssewall Jan 8, 2024
4b19f0f
Merge branch 'main' into freshwater_budget to get recent icepack chan…
davidclemenssewall Jan 9, 2024
478e189
Merge branch 'main' into freshwater_budget
davidclemenssewall Mar 18, 2024
3c3b510
updated to do alvl conversion inside icepack_therm_mushy
davidclemenssewall Mar 18, 2024
05890b2
added diagnostic for meltwater lost when ice melts, need to do no-itd…
davidclemenssewall Mar 19, 2024
cee2169
added mipnd budget term to single category case, still have residual
davidclemenssewall Mar 19, 2024
69c23a1
added diagnostic rdpnd for pond drainage due to ridging
davidclemenssewall Apr 7, 2024
32cb57f
added flpnd for lvlpnd ktherm 1, conservation check okay (weird behav…
davidclemenssewall Jul 24, 2024
dec8971
added meltpond_sealvl module, code compiles, need to check science in…
davidclemenssewall Jul 25, 2024
6ba5dd7
added icepack_init_sealvlpnd, output looks reasonable
davidclemenssewall Jul 26, 2024
0e85444
added apnd_sl and tscale_pnd_drain to namelist, output looks reasonable
davidclemenssewall Jul 26, 2024
9f7e765
refactored run_dEdd for sealvl ponds, no change in output for default…
davidclemenssewall Jul 28, 2024
c7e20ad
minor docstring update
davidclemenssewall Jul 29, 2024
5e85220
Merge branch 'main' into sealevelponds
davidclemenssewall Jul 29, 2024
064efdd
added sealvl pond set_nml option
davidclemenssewall Aug 3, 2024
baab761
Merge branch 'main' into sealevelponds
davidclemenssewall Aug 19, 2024
f972ed3
added pond state vars to history, still need to validate!
davidclemenssewall Dec 18, 2023
576db0a
pond state variables in history and validated
davidclemenssewall Jan 2, 2024
999b838
added snow melt
davidclemenssewall Jan 2, 2024
20e262b
code runs with flpndn, no history yet
davidclemenssewall Jan 2, 2024
3fd5c24
flpndn and expndn history now working
davidclemenssewall Jan 4, 2024
c063089
runs with per-category freshwater fluxes
davidclemenssewall Jan 6, 2024
8f69d40
history output for meltwater fluxes is working
davidclemenssewall Jan 6, 2024
4c674c8
rfpnd running, no history yet
davidclemenssewall Jan 8, 2024
81aecff
history for rfpnd is now working
davidclemenssewall Jan 8, 2024
bda0082
pond diagnostic variables mostly complete
davidclemenssewall Jan 8, 2024
a8c6f5c
updated to do alvl conversion inside icepack_therm_mushy
davidclemenssewall Mar 18, 2024
7024137
added diagnostic for meltwater lost when ice melts, need to do no-itd…
davidclemenssewall Mar 19, 2024
5d32671
added mipnd budget term to single category case, still have residual
davidclemenssewall Mar 19, 2024
07539e2
added diagnostic rdpnd for pond drainage due to ridging
davidclemenssewall Apr 7, 2024
4506e05
added flpnd for lvlpnd ktherm 1, conservation check okay (weird behav…
davidclemenssewall Jul 24, 2024
b32e480
added meltpond_sealvl module, code compiles, need to check science in…
davidclemenssewall Jul 25, 2024
a892b8d
added icepack_init_sealvlpnd, output looks reasonable
davidclemenssewall Jul 26, 2024
b6667bc
added apnd_sl and tscale_pnd_drain to namelist, output looks reasonable
davidclemenssewall Jul 26, 2024
d3f1c2b
refactored run_dEdd for sealvl ponds, no change in output for default…
davidclemenssewall Jul 28, 2024
0911fc0
minor docstring update
davidclemenssewall Jul 29, 2024
bf84d62
added sealvl pond set_nml option
davidclemenssewall Aug 3, 2024
b58900f
Add new pndasp variable for the sea level ponds
dabail10 Oct 17, 2024
b46ca27
Add pndasp to the icepack driver
dabail10 Oct 17, 2024
ca7e2df
Fix the sealevel pond restart
dabail10 Oct 24, 2024
396ad04
Merge branch 'CICE-Consortium:main' into sealevelponds
dabail10 Oct 24, 2024
9c6a0b4
Update to latest sealevel ponds branch
dabail10 Nov 5, 2024
09c9a8e
Merge remote-tracking branch 'origin' into sealevelponds
dabail10 Nov 18, 2024
615276a
Update to latest Icepack
dabail10 Nov 18, 2024
c9b7cf3
Merge branch 'main' into sealevelponds after resolving conflicts
davidclemenssewall Jan 3, 2025
0ef2aa0
Merge branch 'sealvlponds' into sealevelponds. sealvlponds is DCS bra…
davidclemenssewall Jan 6, 2025
a700cf9
fixed restart issue by moving icepack_init_sealvlpnd before init_shor…
davidclemenssewall Jan 6, 2025
bc8fa22
Merge branch 'sealvlponds' into sealevelponds. Fix restart issue.
davidclemenssewall Jan 6, 2025
b819e42
added fixed implementation of fixed hypsometry
davidclemenssewall Jan 13, 2025
d85fbe5
moved querying tr_pond_sealvl
davidclemenssewall Jan 13, 2025
250b4a0
Merge branch 'escomp_sealevelponds_InitModfix' into escomp_sealevelponds
davidclemenssewall Jan 13, 2025
7388d7d
Merge pull request #3 from davidclemenssewall/escomp_sealevelponds
dabail10 Jan 14, 2025
7ae6a71
enforced hpond >= 0 in flush_ponds
davidclemenssewall Jan 14, 2025
79ad4f3
refactored flush_pond to be bfb on intel compiler
davidclemenssewall Jan 14, 2025
1cea85b
Merge pull request #4 from davidclemenssewall/escomp_sealevelponds
dabail10 Jan 15, 2025
24783cf
Make pond arguments optional
dabail10 Jan 16, 2025
1f55bd0
partway through documentation updates
davidclemenssewall Feb 14, 2025
beb225b
sealvl pond sg_thermo complete
davidclemenssewall Feb 16, 2025
9406f20
fixes to rendering in sealvl documentation
davidclemenssewall Feb 16, 2025
9b8ecf5
more formatting documentation
davidclemenssewall Feb 16, 2025
510e19a
fixed apnd_sl in documentation
davidclemenssewall Feb 16, 2025
b20c391
Merge branch 'CICE-Consortium:main' into sealevelponds
dabail10 Feb 18, 2025
6517e04
Update some limits on small pond areas
dabail10 Feb 18, 2025
a22acf3
Merge pull request #6 from davidclemenssewall/sealvlponds
dabail10 Feb 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 34 additions & 6 deletions columnphysics/icepack_flux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module icepack_flux
use icepack_parameters, only: c1, emissivity, snwgrain
use icepack_warnings, only: warnstr, icepack_warnings_add
use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted
use icepack_tracers, only: tr_iso
use icepack_tracers, only: tr_iso, tr_pond

implicit none
private
Expand Down Expand Up @@ -64,7 +64,12 @@ subroutine merge_fluxes (aicen, &
Uref, Urefn, &
Qref_iso, Qrefn_iso, &
fiso_ocn, fiso_ocnn, &
fiso_evap, fiso_evapn)
fiso_evap, fiso_evapn,&
flpnd, flpndn, &
expnd, expndn, &
frpnd, frpndn, &
rfpnd, rfpndn, &
ilpnd, ilpndn)

! single category fluxes
real (kind=dbl_kind), intent(in) :: &
Expand Down Expand Up @@ -98,6 +103,11 @@ subroutine merge_fluxes (aicen, &
dsnown , & ! change in snow depth (m)
congeln , & ! congelation ice growth (m)
snoicen , & ! snow-ice growth (m)
flpndn , & ! pond flushing rate due to ice permeability (m/step)
expndn , & ! exponential pond drainage rate (m/step)
frpndn , & ! pond drainage rate due to freeboard constraint (m/step)
rfpndn , & ! runoff rate due to rfrac (m/step)
ilpndn , & ! pond loss/gain due to ice lid (m/step)
fswthrun_vdr, & ! vis dir sw radiation through ice bot (W/m**2)
fswthrun_vdf, & ! vis dif sw radiation through ice bot (W/m**2)
fswthrun_idr, & ! nir dir sw radiation through ice bot (W/m**2)
Expand Down Expand Up @@ -131,10 +141,15 @@ subroutine merge_fluxes (aicen, &
meltsliq, & ! mass of snow melt (kg/m^2)
congel , & ! congelation ice growth (m)
snoice , & ! snow-ice growth (m)
fswthru_vdr, & ! vis dir sw radiation through ice bot (W/m**2)
fswthru_vdf, & ! vis dif sw radiation through ice bot (W/m**2)
fswthru_idr, & ! nir dir sw radiation through ice bot (W/m**2)
fswthru_idf, & ! nir dif sw radiation through ice bot (W/m**2)
flpnd , & ! pond flushing rate due to ice permeability (m/step)
expnd , & ! exponential pond drainage rate (m/step)
frpnd , & ! pond drainage rate due to freeboard constraint (m/step)
rfpnd , & ! runoff rate due to rfrac (m/step)
ilpnd , & ! pond loss/gain (+/-) to ice lid freezing/melting (m/step)
fswthru_vdr , & ! vis dir sw radiation through ice bot (W/m**2)
fswthru_vdf , & ! vis dif sw radiation through ice bot (W/m**2)
fswthru_idr , & ! nir dir sw radiation through ice bot (W/m**2)
fswthru_idf , & ! nir dif sw radiation through ice bot (W/m**2)
dsnow, & ! change in snow depth (m)
Uref ! air speed reference level (m/s)

Expand Down Expand Up @@ -247,6 +262,19 @@ subroutine merge_fluxes (aicen, &
congel = congel + congeln * aicen
if (present(snoicen) .and. present(snoice)) &
snoice = snoice + snoicen * aicen
! Meltwater fluxes
if (tr_pond) then
if (present(flpndn) .and. present(flpnd)) &
flpnd = flpnd + flpndn * aicen
if (present(expndn) .and. present(expnd)) &
expnd = expnd + expndn * aicen
if (present(frpndn) .and. present(frpnd)) &
frpnd = frpnd + frpndn * aicen
if (present(rfpndn) .and. present(rfpnd)) &
rfpnd = rfpnd + rfpndn * aicen
if (present(ilpndn) .and. present(ilpnd)) &
ilpnd = ilpnd + ilpndn * aicen
endif

end subroutine merge_fluxes

Expand Down
2 changes: 2 additions & 0 deletions columnphysics/icepack_intfc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ module icepack_intfc
use icepack_mushy_physics , only: icepack_mushy_liquid_fraction
use icepack_mushy_physics , only: icepack_mushy_temperature_mush

use icepack_meltpond_sealvl, only: icepack_init_sealvlpnd

use icepack_warnings, only: icepack_warnings_clear
use icepack_warnings, only: icepack_warnings_print
use icepack_warnings, only: icepack_warnings_flush
Expand Down
24 changes: 21 additions & 3 deletions columnphysics/icepack_itd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module icepack_itd
use icepack_tracers, only: ncat, nilyr, nslyr, nblyr, ntrcr, nbtrcr, n_aero
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, bio_index
use icepack_tracers, only: tr_pond, tr_pond_lvl, nt_alvl
use icepack_tracers, only: n_iso, tr_iso, nt_smice, nt_rsnw, nt_rhos, nt_sice
use icepack_tracers, only: icepack_compute_tracers
use icepack_parameters, only: skl_bgc, z_tracers, hi_min
Expand Down Expand Up @@ -295,28 +296,36 @@ end subroutine rebin

subroutine reduce_area (hin_max, &
aicen, vicen, &
aicen_init,vicen_init)
aicen_init,vicen_init, &
mipnd, trcrn)

real (kind=dbl_kind), intent(in) :: &
hin_max ! lowest category boundary

real (kind=dbl_kind), intent(inout) :: &
aicen , & ! concentration of ice
vicen ! volume per unit area of ice (m)
vicen , & ! volume per unit area of ice (m)
mipnd ! pond 'drainage' due to ice melting (m / step)

real (kind=dbl_kind), intent(in) :: &
aicen_init, & ! old ice area for category 1 (m)
vicen_init ! old ice volume for category 1 (m)

real (kind=dbl_kind), dimension (:,:), intent(in) :: &
trcrn ! ice tracers

! local variables

real (kind=dbl_kind) :: &
hi0 , & ! initial hi
hi1 , & ! current hi
dhi ! hi1 - hi0
dhi , & ! hi1 - hi0
da ! total change in area complete within this subroutine

character(len=*),parameter :: subname='(reduce_area)'

da = aicen ! store value of aicen at start of the subroutine

hi0 = c0
if (aicen_init > c0) &
hi0 = vicen_init / aicen_init
Expand All @@ -339,6 +348,15 @@ subroutine reduce_area (hin_max, &
endif
endif

da = da - aicen ! -1*change in fractional area over the subroutine
if (tr_pond) then
if (tr_pond_lvl) then
mipnd = da*trcrn(nt_apnd,1)*trcrn(nt_hpnd,1)*trcrn(nt_alvl,1)
else
mipnd = da*trcrn(nt_apnd,1)*trcrn(nt_hpnd,1)
endif
endif

end subroutine reduce_area

!=======================================================================
Expand Down
39 changes: 31 additions & 8 deletions columnphysics/icepack_mechred.F90
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ module icepack_mechred
use icepack_parameters, only: kstrength, krdg_partic, krdg_redist, mu_rdg
use icepack_parameters, only: conserv_check, z_tracers
use icepack_tracers, only: ncat, nilyr, nslyr, nblyr, n_aero
use icepack_tracers, only: tr_pond_topo, tr_aero, tr_iso, tr_brine, ntrcr, nbtrcr
use icepack_tracers, only: tr_aero, tr_iso, tr_brine, ntrcr, nbtrcr
use icepack_tracers, only: tr_pond_lvl, tr_pond_topo, tr_pond_sealvl
use icepack_tracers, only: nt_qice, nt_qsno, nt_fbri, nt_sice
use icepack_tracers, only: nt_alvl, nt_vlvl, nt_aero, nt_isosno, nt_isoice
use icepack_tracers, only: nt_apnd, nt_hpnd
Expand Down Expand Up @@ -108,7 +109,7 @@ subroutine ridge_ice (dt, ndtd, &
dardg1ndt, dardg2ndt, &
dvirdgndt, Tf, &
araftn, vraftn, &
closing )
closing, rdpnd)

integer (kind=int_kind), intent(in) :: &
ndtd ! number of dynamics subcycles
Expand Down Expand Up @@ -165,7 +166,8 @@ subroutine ridge_ice (dt, ndtd, &
closing , & ! rate of closing due to divergence/shear (1/s)
fpond , & ! fresh water flux to ponds (kg/m^2/s)
fresh , & ! fresh water flux to ocean (kg/m^2/s)
fhocn ! net heat flux to ocean (W/m^2)
fhocn , & ! net heat flux to ocean (W/m^2)
rdpnd ! pond drainage due to ridging (m w.e. avg. over cell)

real (kind=dbl_kind), dimension(:), intent(inout), optional :: &
dardg1ndt , & ! rate of fractional area loss by ridging ice (1/s)
Expand Down Expand Up @@ -202,7 +204,8 @@ subroutine ridge_ice (dt, ndtd, &
aksum , & ! ratio of area removed to area ridged
msnow_mlt , & ! mass of snow added to ocean (kg m-2)
esnow_mlt , & ! energy needed to melt snow in ocean (J m-2)
mpond , & ! mass of pond added to ocean (kg m-2)
mpond , & ! thickness of pond water (avg. over grid cell) lost
! due to ridging (m)
closing_net, & ! net rate at which area is removed (1/s)
! (ridging ice area - area of new ridges) / dt
divu_adv , & ! divu as implied by transport scheme (1/s)
Expand Down Expand Up @@ -605,6 +608,7 @@ subroutine ridge_ice (dt, ndtd, &
if (present(fpond)) then
fpond = fpond - mpond ! units change later
endif
if (present(rdpnd)) rdpnd = mpond

!-----------------------------------------------------------------
! Check for fractional ice area > 1.
Expand Down Expand Up @@ -1143,7 +1147,8 @@ subroutine ridge_shift (dt, hin_max, &
real (kind=dbl_kind), intent(inout) :: &
msnow_mlt , & ! mass of snow added to ocean (kg m-2)
esnow_mlt , & ! energy needed to melt snow in ocean (J m-2)
mpond ! mass of pond added to ocean (kg m-2)
mpond ! thickness of pond water, averaged over entire grid
! cell area, lost to ridging (m)

real (kind=dbl_kind), dimension(:), intent(inout) :: &
maero ! aerosol mass added to ocean (kg m-2)
Expand Down Expand Up @@ -1389,11 +1394,26 @@ subroutine ridge_shift (dt, hin_max, &
enddo
endif

if (tr_pond_topo) then
if (z_tracers .and. nbtrcr > 0) then
dzssl = p5/real(nslyr,kind=dbl_kind)
dzint = c1-dzssl
do it = 1, nbtrcr
mbio(it) = mbio(it) + vsrdgn*(c1-fsnowrdg) &
* (trcrn(bio_index(it) + nblyr + 1,n) * dzssl &
+ trcrn(bio_index(it) + nblyr + 2,n) * dzint)
enddo
endif

if (tr_pond_topo .or. tr_pond_sealvl) then
mpond = mpond + ardg1n * trcrn(nt_apnd,n) &
* trcrn(nt_hpnd,n)
endif

if (tr_pond_lvl) then
mpond = mpond + ardg1n * trcrn(nt_apnd,n) &
* trcrn(nt_hpnd,n) * trcrn(nt_alvl,n)
endif

!-----------------------------------------------------------------
! Compute quantities used to apportion ice among categories
! in the nr loop below
Expand Down Expand Up @@ -1741,7 +1761,7 @@ subroutine icepack_step_ridge(dt, ndtd, &
aice, fsalt, &
first_ice, fzsal, &
flux_bio, closing, &
Tf, &
Tf, rdpnd, &
docleanup, dorebin)

real (kind=dbl_kind), intent(in) :: &
Expand Down Expand Up @@ -1817,6 +1837,9 @@ subroutine icepack_step_ridge(dt, ndtd, &
logical (kind=log_kind), dimension(:), intent(inout) :: &
first_ice ! true until ice forms

real (kind=dbl_kind), intent(inout), optional :: &
rdpnd ! pond drainage due to ridging (m w.e. avg. over cell)

logical (kind=log_kind), intent(in), optional :: &
docleanup, & ! if false, do not call cleanup_itd (default true)
dorebin ! if false, do not call rebin in cleanup_itd (default true)
Expand Down Expand Up @@ -1893,7 +1916,7 @@ subroutine icepack_step_ridge(dt, ndtd, &
dardg1ndt, dardg2ndt, &
dvirdgndt, Tf, &
araftn, vraftn, &
closing )
closing, rdpnd )
if (icepack_warnings_aborted(subname)) return

!-----------------------------------------------------------------
Expand Down
38 changes: 33 additions & 5 deletions columnphysics/icepack_meltpond_lvl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ subroutine compute_ponds_lvl(dt, &
qicen, sicen, &
Tsfcn, alvl, &
apnd, hpnd, ipnd, &
meltsliqn)
meltsliqn, frpndn, &
rfpndn, ilpndn, &
flpndn)

real (kind=dbl_kind), intent(in) :: &
dt ! time step (s)
Expand All @@ -62,7 +64,11 @@ subroutine compute_ponds_lvl(dt, &
meltsliqn ! liquid contribution to meltponds in dt (kg/m^2)

real (kind=dbl_kind), intent(inout) :: &
apnd, hpnd, ipnd
apnd, hpnd, ipnd, &
frpndn, & ! pond drainage rate due to freeboard constraint (m/step)
rfpndn, & ! runoff rate due to rfrac (m/step)
ilpndn, & ! pond loss/gain due to ice lid (m/step)
flpndn ! pond flushing rate due to ice permeability (m/s)

real (kind=dbl_kind), dimension (:), intent(in) :: &
qicen, & ! ice layer enthalpy (J m-3)
Expand All @@ -77,7 +83,9 @@ subroutine compute_ponds_lvl(dt, &
! local temporary variables

real (kind=dbl_kind) :: &
volpn ! pond volume per unit area (m)
volpn, & ! pond volume per unit area (m)
hpond_tmp, & ! local variable for hpond before flushing
dvn_temp ! local variable for change in volume due to rfrac

real (kind=dbl_kind), dimension (nilyr) :: &
Tmlt ! melting temperature (C)
Expand Down Expand Up @@ -149,6 +157,12 @@ subroutine compute_ponds_lvl(dt, &
+ melts*rhos &
+ frain* dt)*aicen
endif
! Track lost meltwater dvn is volume of meltwater (m3/m2) captured
! over entire grid cell area. Multiply by (1-rfrac)/rfrac to get
! loss over entire area. And divide by aicen to get loss per unit
! category area (for consistency with melttn, frpndn, etc)
rfpndn = dvn * (c1-rfrac) / (rfrac * aicen)
dvn_temp = dvn

! shrink pond volume under freezing conditions
if (trim(frzpnd) == 'cesm') then
Expand Down Expand Up @@ -188,6 +202,9 @@ subroutine compute_ponds_lvl(dt, &
endif

volpn = volpn + dvn
! Track lost/gained meltwater per unit category area from pond
! lid freezing/melting. Note sign flip relative to dvn convention
ilpndn = (dvn_temp - dvn) / aicen

!-----------------------------------------------------------
! update pond area and depth
Expand All @@ -206,21 +223,31 @@ subroutine compute_ponds_lvl(dt, &

elseif (alvl_tmp*aicen > c10*puny) then ! new ponds
apondn = min (sqrt(volpn/(pndaspect*aicen)), alvl_tmp)
hpondn = pndaspect * apondn
hpondn = pndaspect * apondn ! Possible loss of meltwater if apondn == alvl_tmp

else ! melt water runs off deformed ice
apondn = c0
hpondn = c0
hpondn = c0 ! Loss of meltwater for very deformed ice
endif
apondn = max(apondn, c0)

! limit pond depth to maintain nonnegative freeboard
hpond_tmp = hpondn
hpondn = min(hpondn, ((rhow-rhoi)*hi - rhos*hs)/rhofresh)
! The way apondn is used is very confusing but at this point
! apondn is the fraction of the entire category (level + deformed)
! with ponds on it. Thus, multiplying the change in hpondn (i.e.,
! the meltwater lost from the ponded area) by apondn here yields
! the meltwater height lost averaged over the category area
! analogous to how melttn is defined.
frpndn = (hpond_tmp - hpondn) * apondn

! fraction of grid cell covered by ponds
apondn = apondn * aicen

volpn = hpondn*apondn
! note, this implies that if ponds fully drain or freeze their
! depressions cease to exist and the lid ice also ceases to exist
if (volpn <= c0) then
volpn = c0
apondn = c0
Expand Down Expand Up @@ -250,6 +277,7 @@ subroutine compute_ponds_lvl(dt, &
+ 0.5*dvn/(pndaspect*apondn), alvl_tmp*aicen))
hpondn = c0
if (apondn > puny) hpondn = volpn/apondn
flpndn = -dvn/aicen
endif

endif
Expand Down
Loading