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

Minor updates consistent with E3SM columnphysics modifications #10

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
103 changes: 48 additions & 55 deletions columnphysics/icepack_brine.F90
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ subroutine preflushing_changes (aicen, vicen, vsnon, &
hbr_old, hin,hsn, firstice )

real (kind=dbl_kind), intent(in) :: &
aicen , & ! concentration of ice
vicen , & ! volume per unit area of ice (m)
vsnon , & ! volume per unit area of snow (m)
meltb , & ! bottom ice melt (m)
meltt , & ! top ice melt (m)
congel , & ! bottom ice growth (m)
snoice ! top ice growth from flooding (m)
aicen , & ! concentration of ice
vicen , & ! volume per unit area of ice (m)
vsnon , & ! volume per unit area of snow (m)
meltb , & ! bottom ice melt (m)
meltt , & ! top ice melt (m)
congel , & ! bottom ice growth (m)
snoice ! top ice growth from flooding (m)

real (kind=dbl_kind), intent(out) :: &
hbr_old ! old brine height (m)
Expand Down Expand Up @@ -152,45 +152,40 @@ subroutine compute_microS_mushy (nilyr, nblyr, &
nblyr ! number of bio layers

real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: &
bgrid ! biology nondimensional vertical grid points
bgrid ! biology nondimensional vertical grid points

real (kind=dbl_kind), dimension (nblyr+1), intent(in) :: &
igrid ! biology vertical interface points
igrid ! biology vertical interface points

real (kind=dbl_kind), dimension (nilyr+1), intent(in) :: &
cgrid ! CICE vertical coordinate
cgrid ! CICE vertical coordinate

real (kind=dbl_kind), &
intent(in) :: &
real (kind=dbl_kind), intent(in) :: &
hice_old , & ! previous timestep ice height (m)
sss , & ! ocean salinity (ppt)
sst ! ocean temperature (C)

real (kind=dbl_kind), dimension(ntrcr), &
intent(in) :: &
real (kind=dbl_kind), dimension(ntrcr), intent(in) :: &
trcrn

real (kind=dbl_kind), intent(out) :: &
kperm , & ! average ice permeability (m^2)
bphi_min ! surface porosity

real (kind=dbl_kind), intent(inout) :: &
hbr_old ! previous timestep brine height (m)
hbr_old ! previous timestep brine height (m)

real (kind=dbl_kind), dimension (nblyr+1), &
intent(inout) :: &
iDin ! tracer diffusivity/h^2 (1/s) includes gravity drainage/molecular
real (kind=dbl_kind), dimension (nblyr+1), intent(inout) :: &
iDin ! tracer diffusivity/h^2 (1/s) includes gravity drainage/molecular

real (kind=dbl_kind), dimension (nblyr+1), &
intent(inout) :: &
real (kind=dbl_kind), dimension (nblyr+1), intent(inout) :: &
iphin , & ! porosity on the igrid
ibrine_rho , & ! brine rho on interface
ibrine_sal , & ! brine sal on interface
iTin ! Temperature on the igrid (oC)

real (kind=dbl_kind), dimension (nblyr+2), &
intent(inout) :: &
bSin , & ! bulk salinity (ppt) on bgrid
real (kind=dbl_kind), dimension (nblyr+2), intent(inout) :: &
bSin , & ! bulk salinity (ppt) on bgrid
brine_sal , & ! equilibrium brine salinity (ppt)
brine_rho ! internal brine density (kg/m^3)

Expand Down Expand Up @@ -292,7 +287,7 @@ subroutine compute_microS_mushy (nilyr, nblyr, &

do k= 2, nblyr+1
ikin(k) = k_o*iphin(k)**exp_h
iDin(k) = iphin(k)*Dm/hbr_old**2
if (hbr_old .GT. puny) iDin(k) = iphin(k)*Dm/hbr_old**2
if (hbr_old .GE. Ra_c) &
iDin(k) = iDin(k) &
+ l_sk*ikin(k)*gravit/viscos_dynamic*drho(k)/hbr_old**2
Expand All @@ -311,16 +306,14 @@ subroutine prepare_hbrine (nblyr, &
i_grid, sss)

integer (kind=int_kind), intent(in) :: &
nblyr ! number of bio layers
nblyr ! number of bio layers

real (kind=dbl_kind), dimension (:), &
intent(in) :: &
bSin , & ! salinity of ice layers on bio grid (ppt)
bTin , & ! temperature of ice layers on bio grid for history (C)
i_grid ! biology grid interface points
real (kind=dbl_kind), dimension (:), intent(in) :: &
bSin , & ! salinity of ice layers on bio grid (ppt)
bTin , & ! temperature of ice layers on bio grid for history (C)
i_grid ! biology grid interface points

real (kind=dbl_kind), dimension (:), &
intent(inout) :: &
real (kind=dbl_kind), dimension (:), intent(inout) :: &
brine_sal , & ! equilibrium brine salinity (ppt)
brine_rho , & ! internal brine density (kg/m^3)
ibrine_rho , & ! brine density on interface (kg/m^3)
Expand All @@ -342,14 +335,14 @@ subroutine prepare_hbrine (nblyr, &
! local variables

real (kind=dbl_kind), dimension(nblyr+1) :: &
kin ! permeability
kin ! permeability

real (kind=dbl_kind) :: &
k_min, ktemp, &
igrp, igrm, rigr ! grid finite differences

integer (kind=int_kind) :: &
k ! layer index
k ! layer index

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

Expand Down Expand Up @@ -479,7 +472,7 @@ subroutine update_hbrine (meltt, &
! local variables

real (kind=dbl_kind) :: &
hbrmin , & ! thinS or hin
hbrmin , & ! thinS or hin
dhbr_hin , & ! hbr-hin
hbrocn , & ! brine height above sea level (m) hbr-h_ocn
dhbr , & ! change in brine surface
Expand Down Expand Up @@ -587,18 +580,18 @@ subroutine compute_microS (n_cat, nilyr, nblyr, &
ibrine_sal, sice_rho, sloss)

integer (kind=int_kind), intent(in) :: &
n_cat , & ! ice category
nilyr , & ! number of ice layers
nblyr ! number of bio layers
n_cat , & ! ice category
nilyr , & ! number of ice layers
nblyr ! number of bio layers

real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: &
bgrid ! biology nondimensional vertical grid points
bgrid ! biology nondimensional vertical grid points

real (kind=dbl_kind), dimension (nblyr+1), intent(in) :: &
igrid ! biology vertical interface points
igrid ! biology vertical interface points

real (kind=dbl_kind), dimension (nilyr+1), intent(in) :: &
cgrid ! CICE vertical coordinate
cgrid ! CICE vertical coordinate

real (kind=dbl_kind), intent(in) :: &
hice_old , & ! previous timestep ice height (m)
Expand Down Expand Up @@ -807,22 +800,22 @@ subroutine calculate_drho (nblyr, i_grid, b_grid, &
brine_rho, ibrine_rho, drho)

integer (kind=int_kind), intent(in) :: &
nblyr ! number of bio layers
nblyr ! number of bio layers

real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: &
b_grid ! biology nondimensional grid layer points
b_grid ! biology nondimensional grid layer points

real (kind=dbl_kind), dimension (nblyr+1), intent(in) :: &
i_grid ! biology grid interface points
i_grid ! biology grid interface points

real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: &
brine_rho ! Internal brine density (kg/m^3)
brine_rho ! Internal brine density (kg/m^3)

real (kind=dbl_kind), dimension (nblyr + 1), intent(in) :: &
ibrine_rho ! Internal brine density (kg/m^3)
ibrine_rho ! Internal brine density (kg/m^3)

real (kind=dbl_kind), dimension (nblyr+1), intent(out) :: &
drho ! brine difference about grid point (kg/m^3)
drho ! brine difference about grid point (kg/m^3)

! local variables

Expand Down Expand Up @@ -921,7 +914,7 @@ subroutine icepack_init_hbrine(bgrid, igrid, cgrid, &
nblyr ! number of bio layers

real (kind=dbl_kind), intent(inout) :: &
phi_snow !porosity at the ice-snow interface
phi_snow ! porosity at the ice-snow interface

real (kind=dbl_kind), dimension (nblyr+2), intent(out) :: &
bgrid ! biology nondimensional vertical grid points
Expand All @@ -930,9 +923,9 @@ subroutine icepack_init_hbrine(bgrid, igrid, cgrid, &
igrid ! biology vertical interface points

real (kind=dbl_kind), dimension (nilyr+1), intent(out) :: &
cgrid , & ! CICE vertical coordinate
icgrid , & ! interface grid for CICE (shortwave variable)
swgrid ! grid for ice tracers used in dEdd scheme
cgrid , & ! CICE vertical coordinate
icgrid , & ! interface grid for CICE (shortwave variable)
swgrid ! grid for ice tracers used in dEdd scheme

!autodocument_end

Expand Down Expand Up @@ -1013,10 +1006,10 @@ subroutine icepack_init_zsalinity(nblyr,ntrcr_o, Rayleigh_criteria, &
Rayleigh_real, trcrn_bgc, nt_bgc_S, ncat, sss)

integer (kind=int_kind), intent(in) :: &
nblyr, & ! number of biolayers
nblyr , & ! number of biolayers
ntrcr_o, & ! number of non bio tracers
ncat , & ! number of categories
nt_bgc_S ! zsalinity index
ncat , & ! number of categories
nt_bgc_S ! zsalinity index

logical (kind=log_kind), intent(inout) :: &
Rayleigh_criteria
Expand All @@ -1028,7 +1021,7 @@ subroutine icepack_init_zsalinity(nblyr,ntrcr_o, Rayleigh_criteria, &
sss

real (kind=dbl_kind), dimension(:,:), intent(inout):: &
trcrn_bgc ! bgc subset of trcrn
trcrn_bgc ! bgc subset of trcrn

!autodocument_end

Expand Down
14 changes: 6 additions & 8 deletions columnphysics/icepack_itd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ module icepack_itd
use icepack_tracers, only: nt_apnd, nt_hpnd, nt_fbri, tr_brine, nt_bgc_S, bio_index
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: solve_zsal, skl_bgc, z_tracers, hi_min
use icepack_parameters, only: kcatbound, kitd
use icepack_therm_shared, only: Tmin, hi_min
use icepack_therm_shared, only: Tmin
use icepack_warnings, only: warnstr, icepack_warnings_add
use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted
use icepack_zbgc_shared,only: zap_small_bgc
Expand Down Expand Up @@ -1815,9 +1815,6 @@ subroutine icepack_init_itd(ncat, hin_max)
b2 = c3 ! thickness for which participation function is small (m)
b3 = max(rncat*(rncat-1), c2*b2/b1)

hi_min = p01 ! minimum ice thickness allowed (m) for thermo
! note hi_min is reset to 0.1 for kitd=0, below

!-----------------------------------------------------------------
! Choose category boundaries based on one of four options.
!
Expand Down Expand Up @@ -1869,9 +1866,6 @@ subroutine icepack_init_itd(ncat, hin_max)
hin_max(0) = c0 ! minimum ice thickness, m
else
! delta function itd category limits
#ifndef CESMCOUPLED
hi_min = p1 ! minimum ice thickness allowed (m) for thermo
#endif
cc1 = max(1.1_dbl_kind/rncat,hi_min)
cc2 = c25*cc1
cc3 = 2.25_dbl_kind
Expand Down Expand Up @@ -1928,6 +1922,10 @@ subroutine icepack_init_itd(ncat, hin_max)

endif ! kcatbound

if (kitd == 1) then
hin_max(ncat) = 999.9_dbl_kind ! arbitrary big number
endif

end subroutine icepack_init_itd

!=======================================================================
Expand Down
6 changes: 3 additions & 3 deletions columnphysics/icepack_meltpond_cesm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,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, pndaspect, use_smliq_pnd
use icepack_parameters, only: hi_min
use icepack_warnings, only: warnstr, icepack_warnings_add
use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted

Expand All @@ -32,16 +33,15 @@ module icepack_meltpond_cesm

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

subroutine compute_ponds_cesm(dt, hi_min, &
subroutine compute_ponds_cesm(dt, &
rfrac, meltt, &
melts, frain, &
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)
dt ! time step (s)

real (kind=dbl_kind), intent(in) :: &
meltsliqn, & ! liquid input from snow liquid tracer
Expand Down
40 changes: 10 additions & 30 deletions columnphysics/icepack_meltpond_lvl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ module icepack_meltpond_lvl
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, pndaspect, use_smliq_pnd
use icepack_parameters, only: ktherm, frzpnd, dpscale, hi_min
use icepack_tracers, only: nilyr
use icepack_warnings, only: warnstr, icepack_warnings_add
use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted

Expand All @@ -32,10 +34,7 @@ module icepack_meltpond_lvl

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

subroutine compute_ponds_lvl(dt, nilyr, &
ktherm, &
hi_min, dpscale, &
frzpnd, &
subroutine compute_ponds_lvl(dt, &
rfrac, meltt, melts, &
frain, Tair, fsurfn,&
dhs, ffrac, &
Expand All @@ -45,23 +44,10 @@ subroutine compute_ponds_lvl(dt, nilyr, &
apnd, hpnd, ipnd, &
meltsliqn)

integer (kind=int_kind), intent(in) :: &
nilyr, & ! number of ice layers
#ifdef UNDEPRECATE_0LAYER
ktherm ! type of thermodynamics (0 0-layer, 1 BL99, 2 mushy)
#else
ktherm ! type of thermodynamics (-1 none, 1 BL99, 2 mushy)
#endif
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
dt ! time step (s)

character (len=char_len), intent(in) :: &
frzpnd ! pond refreezing parameterization

real (kind=dbl_kind), &
intent(in) :: &
real (kind=dbl_kind), intent(in) :: &
Tsfcn, & ! surface temperature (C)
alvl, & ! fraction of level ice
rfrac, & ! water fraction retained for melt ponds
Expand All @@ -75,20 +61,17 @@ subroutine compute_ponds_lvl(dt, nilyr, &
vsnon, & ! snow volume (m)
meltsliqn ! liquid contribution to meltponds in dt (kg/m^2)

real (kind=dbl_kind), &
intent(inout) :: &
real (kind=dbl_kind), intent(inout) :: &
apnd, hpnd, ipnd

real (kind=dbl_kind), dimension (:), intent(in) :: &
qicen, & ! ice layer enthalpy (J m-3)
sicen ! salinity (ppt)

real (kind=dbl_kind), &
intent(in) :: &
real (kind=dbl_kind), intent(in) :: &
dhs ! depth difference for snow on sea ice and pond ice

real (kind=dbl_kind), &
intent(out) :: &
real (kind=dbl_kind), intent(out) :: &
ffrac ! fraction of fsurfn over pond used to melt ipond

! local temporary variables
Expand Down Expand Up @@ -256,7 +239,7 @@ subroutine compute_ponds_lvl(dt, nilyr, &
deltah = hpondn + hi - draft
pressure_head = gravit * rhow * max(deltah, c0)
Tmlt(:) = -sicen(:) * depressT
call brine_permeability(nilyr, qicen, &
call brine_permeability(qicen, &
sicen, Tmlt, perm)
if (icepack_warnings_aborted(subname)) return
drain = perm*pressure_head*dt / (viscosity_dyn*hi) * dpscale
Expand Down Expand Up @@ -287,13 +270,10 @@ end subroutine compute_ponds_lvl

! determine the liquid fraction of brine in the ice and the permeability

subroutine brine_permeability(nilyr, qicen, salin, Tmlt, perm)
subroutine brine_permeability(qicen, salin, Tmlt, perm)

use icepack_therm_shared, only: calculate_Tin_from_qin

integer (kind=int_kind), intent(in) :: &
nilyr ! number of ice layers

real (kind=dbl_kind), dimension(:), intent(in) :: &
qicen, & ! enthalpy for each ice layer (J m-3)
salin, & ! salinity (ppt)
Expand Down
Loading