Skip to content

Commit

Permalink
Fixes to snow-aerosol code to allow multiple snow layers and snicar-ad
Browse files Browse the repository at this point in the history
 -Snow surface layer thickness now properly defined  for multiple snow
 layers.
-Added a length scale and code for spreading  surface atmospheric fluxes into
 the snow interior.  High concentrations, for very thin snow layers and
 thick sea ice,  will cause the snicar-ad code
 to crash.
 -Added a minimum snow thickness condition for atm-aerosol fluxes into
 the snow.  BC and dust now enter the sea ice directly for very thin
 snow thicknesses.
-corrected aerosol  units mg/m3 to kg/m3
-diagnostic verticalSnowAerosolCell now defined
  • Loading branch information
njeffery committed Feb 23, 2021
1 parent 288a7c5 commit e885a85
Show file tree
Hide file tree
Showing 9 changed files with 435 additions and 194 deletions.
4 changes: 2 additions & 2 deletions Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2649,12 +2649,12 @@
packages="pkgTracerVerticalIron"
/>
<var name="verticalAerosolsSnowCell" type="real" dimensions="nzAerosolsSnowLayers nCells Time" name_in_code="verticalAerosolsSnowCell"
units="mg/m^3"
units="kg/m^3"
description="Cell average aerosol for each type and snow bio-grid layer"
packages="pkgTracerZAerosols"
/>
<var name="verticalAerosolsIceCell" type="real" dimensions="nzAerosolsIceLayers nCells Time" name_in_code="verticalAerosolsIceCell"
units="mg/m^3"
units="kg/m^3"
description="Cell average aerosol for each type and ice bio-grid layer"
packages="pkgTracerZAerosols"
/>
Expand Down
231 changes: 149 additions & 82 deletions column/ice_aerosol.F90

Large diffs are not rendered by default.

54 changes: 28 additions & 26 deletions column/ice_algae.F90
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ subroutine zbio (dt, nblyr, &
snoice, nbtrcr, &
fsnow, ntrcr, &
trcrn, bio_index, &
aice_old, &
bio_index_o, aice_old, &
vice_old, vsno_old, &
vicen, vsnon, &
aicen, flux_bio_atm,&
n_cat, n_algae, &
aicen, flux_bio_atm,&
n_cat, n_algae, &
n_doc, n_dic, &
n_don, &
n_fed, n_fep, &
Expand Down Expand Up @@ -81,7 +81,8 @@ subroutine zbio (dt, nblyr, &
ntrcr ! number of tracers

integer (kind=int_kind), dimension (nbtrcr), intent(in) :: &
bio_index ! references index of bio tracer (nbtrcr) to tracer array (ntrcr)
bio_index, & ! references index of bio tracer (nbtrcr) to tracer array (ntrcr)
bio_index_o, ! references index of data arrays (eg. kscavz)

real (kind=dbl_kind), intent(in) :: &
dt, & ! time step
Expand Down Expand Up @@ -127,40 +128,40 @@ subroutine zbio (dt, nblyr, &
real (kind=dbl_kind), dimension (nblyr+1), intent(in) :: &
igrid , & ! biology vertical interface points
iTin , & ! salinity vertical interface points
iphin , & ! Porosity on the igrid
iphin , & ! Porosity on the igrid
iDin ! Diffusivity/h on the igrid (1/s)

real (kind=dbl_kind), dimension (nilyr+1), intent(in) :: &
cgrid , & ! CICE vertical coordinate
icgrid , & ! CICE interface coordinate
fswthrul ! visible short wave radiation on icgrid (W/m^2)
cgrid , & ! CICE vertical coordinate
icgrid , & ! CICE interface coordinate
fswthrul ! visible short wave radiation on icgrid (W/m^2)

real (kind=dbl_kind), dimension(:), &
intent(in) :: &
flux_bio_atm ! aerosol/bgc deposition rate (mmol/m^2 s)

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

real (kind=dbl_kind), dimension (nblyr+1), intent(inout) :: &
zfswin ! visible Short wave flux on igrid (W/m^2)
real (kind=dbl_kind), dimension (nblyr+1), intent(inout) :: &
real (kind=dbl_kind), dimension (nblyr+1), intent(inout) :: &
zfswin ! visible Short wave flux on igrid (W/m^2)

real (kind=dbl_kind), dimension (nblyr+1), intent(inout) :: &
Zoo ! N losses to the system from reaction terms
! (ie. zooplankton/bacteria) (mmol/m^3)
! (ie. zooplankton/bacteria) (mmol/m^3)

real (kind=dbl_kind), dimension (nbtrcr), intent(in) :: &
real (kind=dbl_kind), dimension (nbtrcr), intent(in) :: &
!change to inout when updating ocean fields
ocean_bio ! ocean concentrations (mmol/m^3)
ocean_bio ! ocean concentrations (mmol/m^3)

real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: &
bphin ! Porosity on the bgrid

real (kind=dbl_kind), intent(inout):: &
real (kind=dbl_kind), intent(inout):: &
PP_net , & ! net PP (mg C/m^2/d) times aice
grow_net , & ! net specific growth (m/d) times vice
upNO , & ! tot nitrate uptake rate (mmol/m^2/d) times aice
upNO , & ! tot nitrate uptake rate (mmol/m^2/d) times aice
upNH , & ! tot ammonium uptake rate (mmol/m^2/d) times aice
totalChla ! total chla (mg chla/m^2)

Expand Down Expand Up @@ -213,7 +214,7 @@ subroutine zbio (dt, nblyr, &
accuracy = 1.0e-13_dbl_kind

character(len=char_len_long) :: &
warning
warning

real (kind=dbl_kind), dimension (nblyr+1) :: &
zspace ! vertical grid spacing
Expand Down Expand Up @@ -255,25 +256,26 @@ subroutine zbio (dt, nblyr, &
vice_old, vsno_old, &
vicen, vsnon, &
aicen, flux_bio_atm, &
zbgc_atmn, flux_bio_sno)
zbgc_atmn, flux_bio_snom &
bio_index_o)

call z_biogeochemistry (n_cat, dt, &
nilyr, nslyr, &
nblyr, nbtrcr, &
n_algae, n_doc, &
n_algae, n_doc, &
n_dic, n_don, &
n_fed, n_fep, &
n_zaero, first_ice, &
aicen, vicen, &
hice_old, ocean_bio, &
aicen, vicen, &
hice_old, ocean_bio, &
flux_bion, bphin, &
iphin, trcrn, &
iphin, trcrn, &
iDin, sss, &
fswthrul, grow_alg, &
upNOn, upNHn, &
dh_top, dh_bot, &
dh_top_chl, dh_bot_chl,&
zfswin, hbri, &
zfswin, hbri, &
hbri_old, darcy_V, &
darcy_V_chl, bgrid, &
igrid, icgrid, &
Expand Down
89 changes: 45 additions & 44 deletions column/ice_colpkg.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5394,10 +5394,10 @@ subroutine colpkg_biogeochemistry(dt, &

use ice_algae, only: zbio, sklbio
use ice_brine, only: preflushing_changes, compute_microS_mushy, &
update_hbrine, compute_microS
update_hbrine, compute_microS
use ice_colpkg_shared, only: solve_zsal, z_tracers, phi_snow
use ice_colpkg_tracers, only: nt_fbri, tr_brine, &
nt_bgc_S, nt_qice, nt_sice, nt_zbgc_frac, bio_index
nt_bgc_S, nt_qice, nt_sice, nt_zbgc_frac, bio_index, bio_index_o
use ice_constants_colpkg, only: c0, c1, puny, p5
use ice_zsalinity, only: zsalinity
use ice_zbgc_shared, only: zbgc_frac_init
Expand All @@ -5419,7 +5419,7 @@ subroutine colpkg_biogeochemistry(dt, &
real (kind=dbl_kind), dimension (:), intent(inout) :: &
bgrid , & ! biology nondimensional vertical grid points
igrid , & ! biology vertical interface points
cgrid , & ! CICE vertical coordinate
cgrid , & ! CICE vertical coordinate
icgrid , & ! interface grid for CICE (shortwave variable)
ocean_bio , & ! contains all the ocean bgc tracer concentrations
fbio_snoice , & ! fluxes from snow to ice
Expand All @@ -5428,9 +5428,9 @@ subroutine colpkg_biogeochemistry(dt, &
dhbr_bot , & ! brine bottom change
darcy_V , & ! darcy velocity positive up (m/s)
hin_old , & ! old ice thickness
sice_rho , & ! avg sea ice density (kg/m^3)
ice_bio_net , & ! depth integrated tracer (mmol/m^2)
snow_bio_net , & ! depth integrated snow tracer (mmol/m^2)
sice_rho , & ! avg sea ice density (kg/m^3)
ice_bio_net , & ! depth integrated tracer (mmol/m^2)
snow_bio_net , & ! depth integrated snow tracer (mmol/m^2)
flux_bio ! all bio fluxes to ocean

logical (kind=log_kind), dimension (:), intent(inout) :: &
Expand All @@ -5445,26 +5445,26 @@ subroutine colpkg_biogeochemistry(dt, &
real (kind=dbl_kind), dimension (:,:), intent(inout) :: &
Zoo , & ! N losses accumulated in timestep (ie. zooplankton/bacteria)
! mmol/m^3
bphi , & ! porosity of layers
bphi , & ! porosity of layers
bTiz , & ! layer temperatures interpolated on bio grid (C)
zfswin , & ! Shortwave flux into layers interpolated on bio grid (W/m^2)
iDi , & ! igrid Diffusivity (m^2/s)
iki , & ! Ice permeability (m^2)
trcrn ! tracers
iDi , & ! igrid Diffusivity (m^2/s)
iki , & ! Ice permeability (m^2)
trcrn ! tracers

real (kind=dbl_kind), intent(inout) :: &
grow_net , & ! Specific growth rate (/s) per grid cell
PP_net , & ! Total production (mg C/m^2/s) per grid cell
hbri , & ! brine height, area-averaged for comparison with hi (m)
zsal_tot , & ! Total ice salinity in per grid cell (g/m^2)
zsal_tot , & ! Total ice salinity in per grid cell (g/m^2)
fzsal , & ! Total flux of salt to ocean at time step for conservation
fzsal_g , & ! Total gravity drainage flux
upNO , & ! nitrate uptake rate (mmol/m^2/d) times aice
upNH , & ! ammonium uptake rate (mmol/m^2/d) times aice
totalChla ! ice integrated chla and summed over all algal groups (mg/m^2)

logical (kind=log_kind), intent(inout) :: &
Rayleigh_criteria ! .true. means Ra_c was reached
Rayleigh_criteria ! .true. means Ra_c was reached

real (kind=dbl_kind), dimension (:,:), intent(in) :: &
fswpenln ! visible SW entering ice layers (W m-2)
Expand All @@ -5476,11 +5476,11 @@ subroutine colpkg_biogeochemistry(dt, &
meltbn , & ! bottom melt in category n (m)
congeln , & ! congelation ice formation in category n (m)
snoicen , & ! snow-ice formation in category n (m)
salinz , & ! initial salinity profile (ppt)
flux_bio_atm, & ! all bio fluxes to ice from atmosphere
salinz , & ! initial salinity profile (ppt)
flux_bio_atm, & ! all bio fluxes to ice from atmosphere
aicen_init , & ! initial ice concentration, for linear ITD
vicen_init , & ! initial ice volume (m), for linear ITD
vsnon_init , & ! initial snow volume (m), for aerosol
vsnon_init , & ! initial snow volume (m), for aerosol
aicen , & ! concentration of ice
vicen , & ! volume per unit area of ice (m)
vsnon ! volume per unit area of snow (m)
Expand All @@ -5496,7 +5496,7 @@ subroutine colpkg_biogeochemistry(dt, &
logical (kind=log_kind), intent(in) :: &
skl_bgc ! if true, solve skeletal biochemistry

logical (kind=log_kind), intent(inout) :: &
logical (kind=log_kind), intent(inout) :: &
l_stop ! if true, abort the model

character (len=*), intent(inout) :: stop_label
Expand All @@ -5513,7 +5513,7 @@ subroutine colpkg_biogeochemistry(dt, &
hbr_old , & ! old brine thickness before growh/melt
dhice , & ! change due to sublimation/condensation (m)
kavg , & ! average ice permeability (m^2)
bphi_o , & ! surface ice porosity
bphi_o , & ! surface ice porosity
hbrin , & ! brine height
dh_direct ! surface flooding or runoff

Expand All @@ -5525,20 +5525,20 @@ subroutine colpkg_biogeochemistry(dt, &

real (kind=dbl_kind), dimension (nblyr+1) :: &
! Defined on Bio Grid interfaces
iphin , & ! porosity
iphin , & ! porosity
ibrine_sal , & ! brine salinity (ppt)
ibrine_rho , & ! brine_density (kg/m^3)
iTin ! Temperature on the interface grid (oC)

real (kind=dbl_kind) :: &
real (kind=dbl_kind) :: &
sloss ! brine flux contribution from surface runoff (g/m^2)

real (kind=dbl_kind), dimension (ncat) :: &
hbrnInitial, & ! inital brine height
hbrnFinal ! category initial and final brine heights
hbrnFinal ! category initial and final brine heights

! for bgc sk
real (kind=dbl_kind) :: &
real (kind=dbl_kind) :: &
dh_bot_chl , & ! Chlorophyll may or may not flush
dh_top_chl , & ! Chlorophyll may or may not flush
darcy_V_chl
Expand Down Expand Up @@ -5712,7 +5712,8 @@ subroutine colpkg_biogeochemistry(dt, &
congeln(n), snoicen(n), &
nbtrcr, fsnow, &
ntrcr, trcrn(1:ntrcr,n), &
bio_index(1:nbtrcr), aicen_init(n), &
bio_index(1:nbtrcr), bio_index_o(:), &
aicen_init(n), &
vicen_init(n), vsnon_init(n), &
vicen(n), vsnon(n), &
aicen(n), flux_bio_atm(:), &
Expand Down Expand Up @@ -5791,8 +5792,8 @@ end subroutine colpkg_biogeochemistry
subroutine colpkg_init_hbrine(bgrid, igrid, cgrid, &
icgrid, swgrid, nblyr, nilyr, phi_snow)

use ice_constants_colpkg, only: c1, c1p5, c2, p5, c0, rhoi, rhos
use ice_constants_colpkg, only: c1, c1p5, c2, p5, c0, rhoi, rhos, p25

integer (kind=int_kind), intent(in) :: &
nilyr, & ! number of ice layers
nblyr ! number of bio layers
Expand All @@ -5805,75 +5806,75 @@ subroutine colpkg_init_hbrine(bgrid, igrid, cgrid, &

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

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

integer (kind=int_kind) :: &
k , & ! vertical index
n ! thickness category index

real (kind=dbl_kind) :: &
real (kind=dbl_kind) :: &
zspace ! grid spacing for CICE vertical grid


if (phi_snow .le. c0) phi_snow = c1-rhos/rhoi

!-----------------------------------------------------------------
! Calculate bio gridn: 0 to 1 corresponds to ice top to bottom
! Calculate bio gridn: 0 to 1 corresponds to ice top to bottom
!-----------------------------------------------------------------

bgrid(:) = c0 ! zsalinity grid points
bgrid(:) = c0 ! zsalinity grid points
bgrid(nblyr+2) = c1 ! bottom value
igrid(:) = c0 ! bgc interface grid points
igrid(:) = c0 ! bgc interface grid points
igrid(1) = c0 ! ice top
igrid(nblyr+1) = c1 ! ice bottom

zspace = c1/max(c1,(real(nblyr,kind=dbl_kind)))
do k = 2, nblyr+1
bgrid(k) = zspace*(real(k,kind=dbl_kind) - c1p5)
enddo

do k = 2, nblyr
igrid(k) = p5*(bgrid(k+1)+bgrid(k))
enddo

!-----------------------------------------------------------------
! Calculate CICE cgrid for interpolation ice top (0) to bottom (1)
! Calculate CICE cgrid for interpolation ice top (0) to bottom (1)
!-----------------------------------------------------------------

cgrid(1) = c0 ! CICE vertical grid top point
zspace = c1/(real(nilyr,kind=dbl_kind)) ! CICE grid spacing

do k = 2, nilyr+1
cgrid(k) = zspace * (real(k,kind=dbl_kind) - c1p5)
enddo
cgrid(k) = zspace * (real(k,kind=dbl_kind) - c1p5)
enddo

!-----------------------------------------------------------------
! Calculate CICE icgrid for ishortwave interpolation top(0) , bottom (1)
!-----------------------------------------------------------------
icgrid(1) = c0

icgrid(1) = c0
zspace = c1/(real(nilyr,kind=dbl_kind)) ! CICE grid spacing

do k = 2, nilyr+1
icgrid(k) = zspace * (real(k,kind=dbl_kind)-c1)
enddo
enddo

!------------------------------------------------------------------------
! Calculate CICE swgrid for dEdd ice: top of ice (0) , bottom of ice (1)
! Does not include snow
! see ice_shortwave.F90
! swgrid represents the layer index of the delta-eddington ice layer index
!------------------------------------------------------------------------
!------------------------------------------------------------------------
zspace = c1/(real(nilyr,kind=dbl_kind)) ! CICE grid spacing
swgrid(1) = min(c1/60.0_dbl_kind, zspace/c2)
swgrid(1) = min(c1/60.0_dbl_kind, zspace*p25)
swgrid(2) = zspace/c2 !+ swgrid(1)
do k = 3, nilyr+1
swgrid(k) = zspace * (real(k,kind=dbl_kind)-c1p5)
enddo
enddo

end subroutine colpkg_init_hbrine

Expand Down
3 changes: 2 additions & 1 deletion column/ice_colpkg_shared.F90
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ module ice_colpkg_shared

real (kind=dbl_kind), parameter, public :: &
hi_ssl = 0.050_dbl_kind, & ! ice surface scattering layer thickness (m)
hs_ssl = 0.040_dbl_kind ! snow surface scattering layer thickness (m)
hs_ssl = 0.040_dbl_kind, & ! snow surface scattering layer thickness (m)
hs_ssl_min = 5.0e-4_dbl_kind ! minimum snow scattering layer thickness for aerosol accumulation (m)

! snicar 5 band system, set in namelist
logical (kind=log_kind), public :: &
Expand Down
2 changes: 1 addition & 1 deletion column/ice_itd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,7 @@ subroutine zap_snow(dt, nslyr, &
endif ! tr_aero

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

do it = 1, nbtrcr
Expand Down
Loading

0 comments on commit e885a85

Please sign in to comment.