Skip to content

Commit

Permalink
moved apond = apnd*alvl calculation to icepack_step_therm1
Browse files Browse the repository at this point in the history
  • Loading branch information
davidclemenssewall committed Dec 6, 2024
1 parent 29f1d2d commit f0e1cc2
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 48 deletions.
56 changes: 20 additions & 36 deletions columnphysics/icepack_therm_mushy.F90
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ subroutine temperature_changes_salinity(dt, &
fswsfc, fswint, &
Sswabs, Iswabs, &
hilyr, hslyr, &
apnd, hpond, &
apond, hpond, &
zqin, zTin, &
zqsn, zTsn, &
zSin, &
Expand All @@ -56,8 +56,7 @@ subroutine temperature_changes_salinity(dt, &
flwoutn, fsurfn, &
fcondtop, fcondbot, &
fadvheat, snoice, &
smice, smliq, &
alvl)
smice, smliq)

! solve the enthalpy and bulk salinity of the ice for a single column

Expand All @@ -72,17 +71,16 @@ subroutine temperature_changes_salinity(dt, &
shcoef , & ! transfer coefficient for sensible heat
lhcoef , & ! transfer coefficient for latent heat
Tbot , & ! ice bottom surfce temperature (deg C)
sss , & ! sea surface salinity (PSU)
alvl ! melt pond area fraction

sss ! sea surface salinity (PSU)

real (kind=dbl_kind), intent(inout) :: &
fswsfc , & ! SW absorbed at ice/snow surface (W m-2)
fswint ! SW absorbed in ice interior below surface (W m-2)

real (kind=dbl_kind), intent(inout) :: &
hilyr , & ! ice layer thickness (m)
hslyr , & ! snow layer thickness (m)
apnd , & ! melt pond area fraction tracer
apond , & ! melt pond area fraction of category
hpond ! melt pond depth (m)

real (kind=dbl_kind), dimension (:), intent(inout) :: &
Expand Down Expand Up @@ -184,8 +182,8 @@ subroutine temperature_changes_salinity(dt, &
! calculate vertical bulk darcy flow
call flushing_velocity(zTin, phi, &
hin, hsn, &
hilyr, alvl, &
hpond, apnd, &
hilyr, &
hpond, apond, &
dt, w)
if (icepack_warnings_aborted(subname)) return

Expand Down Expand Up @@ -330,7 +328,7 @@ subroutine temperature_changes_salinity(dt, &
endif

! drain ponds from flushing
call flush_pond(w, hpond, apnd, dt, alvl)
call flush_pond(w, hpond, apond, dt)
if (icepack_warnings_aborted(subname)) return

! flood snow ice
Expand Down Expand Up @@ -3066,8 +3064,8 @@ end subroutine explicit_flow_velocities

subroutine flushing_velocity(zTin, phi, &
hin, hsn, &
hilyr, alvl, &
hpond, apnd, &
hilyr, &
hpond, apond, &
dt, w)

! calculate the vertical flushing Darcy velocity (positive downward)
Expand All @@ -3078,9 +3076,8 @@ subroutine flushing_velocity(zTin, phi, &

real(kind=dbl_kind), intent(in) :: &
hilyr , & ! ice layer thickness (m)
alvl , & ! level ice area tracer
hpond , & ! melt pond thickness (m)
apnd , & ! melt pond area (-)
apond , & ! melt pond area fraction of category (-)
hsn , & ! snow thickness (m)
hin , & ! ice thickness (m)
dt ! time step (s)
Expand Down Expand Up @@ -3141,12 +3138,8 @@ subroutine flushing_velocity(zTin, phi, &
perm_harm = real(nilyr,dbl_kind) / perm_harm

! calculate ocean surface height above bottom of ice
if (tr_pond_lvl) then
hocn = (ice_mass + hpond * apnd * rhofresh * alvl + hsn * rhos) / rhow
else
hocn = (ice_mass + hpond * apnd * rhofresh + hsn * rhos) / rhow
endif

hocn = (ice_mass + hpond * apond * rhofresh + hsn * rhos) / rhow

! calculate brine height above bottom of ice
hbrine = hin + hpond

Expand All @@ -3157,12 +3150,8 @@ subroutine flushing_velocity(zTin, phi, &
w = (perm_harm * rhow * gravit * (dhhead / hin)) / viscosity_dyn

! maximum down flow to drain pond
if (tr_pond_lvl) then
w_down_max = (hpond * apnd * alvl) / dt
else
w_down_max = (hpond * apnd) / dt
endif

w_down_max = (hpond * apond) / dt

! limit flow
w = min(w,w_down_max)

Expand All @@ -3183,15 +3172,14 @@ end subroutine flushing_velocity

!=======================================================================

subroutine flush_pond(w, hpond, apnd, dt, alvl)
subroutine flush_pond(w, hpond, apond, dt)

! given a flushing velocity drain the meltponds

real(kind=dbl_kind), intent(in) :: &
w , & ! vertical flushing Darcy flow rate (m s-1)
apnd , & ! melt pond area (-)
dt , & ! time step (s)
alvl ! level ice area tracer
apond , & ! melt pond area fraction of category (-)
dt ! time step (s)

real(kind=dbl_kind), intent(inout) :: &
hpond ! melt pond thickness (m)
Expand All @@ -3205,14 +3193,10 @@ subroutine flush_pond(w, hpond, apnd, dt, alvl)
character(len=*),parameter :: subname='(flush_pond)'

if (tr_pond) then
if (apnd > c0 .and. hpond > c0) then
if (apond > c0 .and. hpond > c0) then

! flush pond through mush
if (tr_pond_lvl) then
hpond = hpond - w * dt / (apnd * alvl)
else
hpond = hpond - w * dt / apnd
endif
hpond = hpond - w * dt / apond

hpond = max(hpond, c0)

Expand Down
40 changes: 28 additions & 12 deletions columnphysics/icepack_therm_vertical.F90
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ subroutine thermo_vertical (dt, aicen, &
vicen, vsnon, &
Tsf, zSin, &
zqin, zqsn, &
apnd, hpond, &
alvl, &
apond, hpond, &
flw, potT, &
Qa, rhoa, &
fsnow, fpond, &
Expand Down Expand Up @@ -123,9 +122,8 @@ subroutine thermo_vertical (dt, aicen, &
! tracers
real (kind=dbl_kind), intent(inout) :: &
Tsf , & ! ice/snow top surface temp, same as Tsfcn (deg C)
apnd , & ! melt pond area fraction
hpond , & ! melt pond depth (m)
alvl ! level ice area fraction
apond , & ! melt pond area fraction of category
hpond ! melt pond depth (m)
! iage ! ice age (s)

logical (kind=log_kind), intent(in), optional :: &
Expand Down Expand Up @@ -316,7 +314,7 @@ subroutine thermo_vertical (dt, aicen, &
fswsfc, fswint, &
Sswabs, Iswabs, &
hilyr, hslyr, &
apnd, hpond, &
apond, hpond, &
zqin, zTin, &
zqsn, zTsn, &
zSin, &
Expand All @@ -326,8 +324,7 @@ subroutine thermo_vertical (dt, aicen, &
flwoutn, fsurfn, &
fcondtopn, fcondbotn, &
fadvocn, snoice, &
smice, smliq, &
alvl)
smice, smliq)
if (icepack_warnings_aborted(subname)) return

else ! ktherm
Expand Down Expand Up @@ -454,7 +451,7 @@ subroutine thermo_vertical (dt, aicen, &
fhocnn = fhocnn + fadvocn ! for ktherm=2

if (hin == c0) then
if (tr_pond_topo) fpond = fpond - aicen * apnd * hpond
if (tr_pond_topo) fpond = fpond - aicen * apond * hpond
endif

!-----------------------------------------------------------------
Expand Down Expand Up @@ -2339,7 +2336,7 @@ subroutine icepack_step_therm1(dt, &
Tsfc , & ! ice/snow surface temperature, Tsfcn
alvl , & ! level ice area fraction
vlvl , & ! level ice volume fraction
apnd , & ! melt pond area fraction
apnd , & ! melt pond area fraction tracer
hpnd , & ! melt pond depth (m)
ipnd , & ! melt pond refrozen lid thickness (m)
iage , & ! volume-weighted ice age
Expand Down Expand Up @@ -2440,6 +2437,7 @@ subroutine icepack_step_therm1(dt, &
smliq ! tracer for mass of liquid in snow (kg/m^3)

real (kind=dbl_kind), dimension(ncat) :: &
apond , & ! melt pond area fraction of category
l_meltsliqn ! mass of snow melt local (kg/m^2)

real (kind=dbl_kind) :: &
Expand Down Expand Up @@ -2529,6 +2527,17 @@ subroutine icepack_step_therm1(dt, &
massicen(:,:) = c0
massliqn(:,:) = c0

!-----------------------------------------------------------------
! Initialize pond area fractions
!-----------------------------------------------------------------
do n= 1, ncat
if (tr_pond_lvl) then
apond(n) = apnd(n) * alvl(n)
else
apond(n) = apnd(n)
endif
enddo

!-----------------------------------------------------------------
! Initialize rate of snow loss to leads
!-----------------------------------------------------------------
Expand Down Expand Up @@ -2559,6 +2568,7 @@ subroutine icepack_step_therm1(dt, &
!-----------------------------------------------------------------

if (formdrag) then
!!!! This should take apond, not apnd, will fix in the next commit
call neutral_drag_coeffs (apnd , &
hpnd , ipnd , &
alvl , vlvl , &
Expand Down Expand Up @@ -2707,8 +2717,7 @@ subroutine icepack_step_therm1(dt, &
vicen=vicen (n), vsnon=vsnon (n), &
Tsf=Tsfc (n), zSin=zSin (:,n), &
zqin=zqin (:,n), zqsn=zqsn (:,n), &
apnd=apnd (n), hpond=hpnd (n), &
alvl=alvl (n), &
apond=apond (n), hpond=hpnd (n), &
flw=flw, potT=potT, &
Qa=Qa, rhoa=rhoa, &
fsnow=fsnow, fpond=fpond, &
Expand Down Expand Up @@ -2740,6 +2749,13 @@ subroutine icepack_step_therm1(dt, &
return
endif

! Translate changes in apond into apnd tracer
if (tr_pond_lvl) then
apnd(n) = apond(n) / alvl(n)
else
apnd(n) = apond(n)
endif

if (snwgrain) then
rsnwn (:,n) = rsnw (:)
smicen(:,n) = smice(:)
Expand Down

0 comments on commit f0e1cc2

Please sign in to comment.