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

Update Icepack z-biogeochemistry and z-aerosols with the MPAS-Sea ice column package #34

Closed
wants to merge 132 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
604d0ad
initial implementation of SNICAR-AD in Icepack, not tested but BFB in…
eclare108213 Aug 4, 2022
60fc58d
adding use_snicar flag (true if shortwave=dEdd_snicar)
eclare108213 Aug 4, 2022
e264065
initializing use_snicar based on shortwave namelist value
eclare108213 Aug 4, 2022
8109ebf
adding a few more arguments to the calling tree
eclare108213 Aug 5, 2022
4ff4e28
Merge pull request #5 from CICE-Consortium/main
eclare108213 Aug 17, 2022
49d1294
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
eclare108213 Aug 22, 2022
3c65376
remove repeat ridging warnings for niter=1
eclare108213 Aug 22, 2022
2bd3504
use 5-band wghtns for snicar
eclare108213 Aug 22, 2022
56a2ccd
basic initialization for snicar tables
eclare108213 Aug 23, 2022
d2f3870
clean up trailing blanks
apcraig Aug 24, 2022
f03e228
Merge pull request #4 from apcraig/snicar-clean01
eclare108213 Aug 24, 2022
cd31ec2
interim commit with some snicar initialization, unconnected and not t…
eclare108213 Aug 25, 2022
a2bbd1d
Add data_dEdd_3band to icepack_init_radiation
apcraig Aug 24, 2022
d2ea5ed
Add ability to set SNICAR SSP data via icepack_parameters
apcraig Aug 24, 2022
4bf19c6
Add reading of SNICAR SSP file in Icepack driver including
apcraig Aug 25, 2022
8cb547a
rebase, update, and test
apcraig Aug 25, 2022
258f623
Merge pull request #5 from apcraig/snwtable
eclare108213 Aug 25, 2022
4e2d90b
Update ssp output
apcraig Aug 25, 2022
e569c4c
Reorder SNICAR SSP test data arrays to be consistent with source code
apcraig Aug 26, 2022
1d6eaa6
Merge pull request #6 from apcraig/sspoutput
eclare108213 Aug 26, 2022
f88b03c
move 5band data to subroutine; enable snicar testing on 1 no-ice grid…
eclare108213 Aug 26, 2022
6d68ee9
move more data to 3- and 5-band initialization routines, use module d…
eclare108213 Aug 26, 2022
b3ca79c
change snicar coefficient names and use module data for them
eclare108213 Aug 26, 2022
8ad73dd
cleaning up argument lists
eclare108213 Aug 26, 2022
89e0d9a
Add additional SNICAR SSP fields
apcraig Aug 27, 2022
93f9f3c
Merge pull request #7 from apcraig/moresspio
eclare108213 Aug 29, 2022
ef37585
set tmask=0 only for land cell
eclare108213 Aug 31, 2022
3e636b2
interim compute_dEdd_5bd subroutine (runs)
eclare108213 Sep 1, 2022
914130b
separate 3-band and 5-band compute_dEdd routines
eclare108213 Sep 1, 2022
0fabd24
Fix errors in calls to compute_dEdd. Some cleanup.
eclare108213 Sep 1, 2022
20d7e03
Remove duplicate Iabs calculation. More cleanup.
eclare108213 Sep 1, 2022
fe21d1f
- Add icepack_shortwave_data
apcraig Sep 1, 2022
a0f0e49
- Add USE_SNICARHC (snicar ssp hard coded tables) to reduce compile time
apcraig Sep 2, 2022
247a8ce
- Remove ssp_bcerad, ssp_bcgrerad from implementation
apcraig Sep 2, 2022
147201a
remove trailing blanks
apcraig Sep 2, 2022
2274b8e
Merge pull request #9 from apcraig/swdata
eclare108213 Sep 6, 2022
f270c73
Cleanup icepack_shortwave_data
apcraig Sep 6, 2022
631816e
update test suite and icepack_in
apcraig Sep 6, 2022
1395476
update scripts if md5sum not available
apcraig Sep 6, 2022
9766cff
Merge pull request #10 from apcraig/swdata1
eclare108213 Sep 6, 2022
0a9d6e7
Clean up shortwave data variable names
apcraig Sep 7, 2022
8f74768
Merge pull request #11 from apcraig/swaero
eclare108213 Sep 7, 2022
045e353
Clean up icepack_shortwave
apcraig Sep 7, 2022
69ed788
- Remove ncat, nilyr, nslyr, nblyr from interface arguments
apcraig Sep 8, 2022
6a46237
Merge pull request #12 from apcraig/swclean
eclare108213 Sep 8, 2022
44d377b
Update implementation of g(k), w0(k) in icepack_shortwave
apcraig Sep 11, 2022
6f8f21b
Get rid of use_snicar flag, redundant with shortwave setting
apcraig Sep 12, 2022
4256d9b
update documentation
eclare108213 Sep 18, 2022
34e5555
updating documentation
eclare108213 Sep 18, 2022
95fb567
use module data rather than hardcoded rhoi
eclare108213 Sep 18, 2022
9178ede
cleanup
apcraig Sep 18, 2022
e0b3292
update namelist and settings documentation
eclare108213 Sep 18, 2022
ee97eab
Merge pull request #13 from apcraig/aerclean
eclare108213 Sep 18, 2022
1a089e8
make icepack_warnings_getall public, snw_ssp_table=unknown, update us…
eclare108213 Sep 23, 2022
b7d7c16
add icepack_warnings_getall to interface module
eclare108213 Sep 23, 2022
64ab4a1
Major cleanup of dEdd module, mainly white space and standard alignme…
eclare108213 Sep 24, 2022
9ae618c
bug fixes for ice/snow layer reciprocal, missing lines as in consorti…
eclare108213 Sep 24, 2022
8aef3f7
Merge pull request #7 from eclare108213/snicar
eclare108213 Sep 30, 2022
20d4a94
mpassi options files
eclare108213 Oct 6, 2022
6704225
remove namelist entries that are the same as the defaults to avoid po…
eclare108213 Oct 6, 2022
d86c54e
Merge pull request #8 from eclare108213/testconfig1
apcraig Oct 7, 2022
90dbfe6
Minor updates consistent with E3SM columnphysics modifications
apcraig Oct 8, 2022
5efe8b7
Update spacing and documentation
apcraig Oct 8, 2022
6b7b63a
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Oct 8, 2022
86d414c
First step in adding Tf
dabail10 Oct 7, 2022
ef314e2
Fix some spacing and logic
dabail10 Oct 7, 2022
1b84132
Fix some documentation
dabail10 Oct 7, 2022
cf64956
Fix documentation formatting
dabail10 Oct 10, 2022
19d61e6
Merge pull request #12 from dabail10/tfrz2
apcraig Oct 11, 2022
125b40b
Merge pull request #10 from apcraig/e3smfix1
apcraig Oct 11, 2022
635f1c4
Merge branch 'cice-consortium/E3SM-icepack-initial-integration' into …
apcraig Oct 11, 2022
881db9a
Merge pull request #11 from apcraig/upd01a
apcraig Oct 11, 2022
1c502fa
namelist parameter to set maximum liquidus temperature
eclare108213 Oct 24, 2022
7cdacdb
Merge branch 'cice-consortium/E3SM-icepack-initial-integration' into …
eclare108213 Oct 24, 2022
93ada33
Merge pull request #13 from E3SM-Project/Tliquidus_limit
eclare108213 Oct 24, 2022
e4d987e
Modifications for bit-for-bit with current main in CICE
apcraig Oct 25, 2022
6a4533b
Merge pull request #14 from apcraig/Tffix
eclare108213 Oct 25, 2022
1429164
update aerosol code for vertical bgc
eclare108213 Nov 11, 2022
5a12967
add init/query/write for hs_ssl_min
eclare108213 Nov 11, 2022
6211458
merge Icepack main to #5bf584f6b7f Nov 17, 2022
apcraig Nov 18, 2022
5a1b9e3
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Nov 18, 2022
64a27d3
Remove redundancy in public declaration
apcraig Nov 18, 2022
8944646
recover main bit-for-bit
apcraig Nov 18, 2022
ae5a4ef
update tfrz_option
apcraig Nov 19, 2022
0899390
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Nov 20, 2022
4d131da
Merge pull request #16 from apcraig/e3smup1
apcraig Nov 21, 2022
bec84e4
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Nov 29, 2022
941e3c5
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Nov 30, 2022
9d08355
Merge pull request #17 from apcraig/snowbrinebugs
eclare108213 Nov 30, 2022
8be0af0
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Dec 15, 2022
a9fc4fa
Merge pull request #18 from apcraig/e3sm_upd133
eclare108213 Dec 15, 2022
c9abc27
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Jan 25, 2023
ef7491f
Merge pull request #19 from apcraig/e3smicep230125
eclare108213 Jan 25, 2023
47e1791
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Feb 2, 2023
87db73b
Merge pull request #20 from apcraig/icep230202
apcraig Feb 3, 2023
7d42edb
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Mar 20, 2023
5f4cd19
Merge pull request #21 from apcraig/icep230317
eclare108213 Mar 24, 2023
dd24d9f
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
eclare108213 Apr 14, 2023
6ca316f
Merge pull request #22 from E3SM-Project/ibranch3
eclare108213 Apr 14, 2023
e5a95e4
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Apr 18, 2023
e3e36a7
Merge pull request #23 from apcraig/icep230418
eclare108213 Apr 21, 2023
c0719d8
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig May 24, 2023
2fc81b4
Merge pull request #24 from apcraig/icep230524
eclare108213 May 26, 2023
dfb8e2c
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
eclare108213 Jul 6, 2023
b2b8066
Merge pull request #25 from E3SM-Project/ibranch4
eclare108213 Jul 7, 2023
d3b0ecc
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Jul 18, 2023
e8e7d7d
Merge pull request #26 from apcraig/main230718
eclare108213 Jul 19, 2023
a5804b0
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Aug 19, 2023
dd48a38
clean up merge
apcraig Aug 20, 2023
e751022
Merge pull request #27 from apcraig/main230819
eclare108213 Aug 21, 2023
5789cb5
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Aug 30, 2023
393b072
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Sep 14, 2023
586b5e5
Merge pull request #28 from apcraig/e3sm230830
eclare108213 Sep 14, 2023
cb0d946
Merge pull request #29 from apcraig/e3sm230914
eclare108213 Sep 14, 2023
b7b68b9
Merge remote-tracking branch 'remotes/eclare/aero1' into current inte…
njeffery Sep 20, 2023
baaa3f4
bring some mushy functions into icepack interface
eclare108213 Sep 25, 2023
1f0b307
elevate snow/mush enthalpy and salinity profile to interface
eclare108213 Sep 25, 2023
78286bf
Merge pull request #31 from E3SM-Project/E3SMrefactor
eclare108213 Sep 26, 2023
636fcbf
Update documentation
apcraig Sep 27, 2023
adcf436
Update documentation
apcraig Sep 28, 2023
e33cc75
Merge pull request #32 from apcraig/e3smdocs1
eclare108213 Sep 29, 2023
6a64845
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Sep 30, 2023
96f2fc7
Merge pull request #33 from apcraig/upd230930
eclare108213 Sep 30, 2023
c1edf6d
Adds changes to Icepack for bgc and zaerosols
njeffery Oct 11, 2023
f4550c1
Merge remote-tracking branch 'origin/njeffery/update-zaerosols-icepac…
njeffery Oct 11, 2023
ddf6e6f
Merge branch 'njeffery/merge-bgc' of https://github.com/njeffery/icep…
apcraig Oct 25, 2023
37a6f97
Remove deprecated field from zbgc
njeffery Oct 31, 2023
1b6bd93
Updates icepack zbgc initialization for optional arguments
njeffery Nov 16, 2023
abdd3d4
Correct initialization of DIC sources and sinks
njeffery Dec 11, 2023
b1e15e9
Fixes to conserve carbon in icepack
njeffery Mar 12, 2024
8934f44
Bug fix in step therm2 for BGC
njeffery Mar 25, 2024
c090b4b
Fix to icepack warning strings
njeffery Mar 28, 2024
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
224 changes: 148 additions & 76 deletions columnphysics/icepack_aerosol.F90

Large diffs are not rendered by default.

886 changes: 631 additions & 255 deletions columnphysics/icepack_algae.F90

Large diffs are not rendered by default.

64 changes: 30 additions & 34 deletions columnphysics/icepack_brine.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
module icepack_brine

use icepack_kinds
use icepack_parameters, only: p01, p001, p5, c0, c1, c2, c1p5, puny
use icepack_parameters, only: p01, p001, p5, c0, c1, c2, c1p5, puny, p25
use icepack_parameters, only: gravit, rhoi, rhow, rhos, depressT
use icepack_parameters, only: salt_loss, min_salin, rhosi
use icepack_parameters, only: dts_b, l_sk
Expand Down Expand Up @@ -62,7 +62,7 @@ subroutine preflushing_changes (aicen, vicen, vsnon, &
meltb, meltt, congel, &
snoice, hice_old, dhice, &
fbri, dhbr_top, dhbr_bot, &
hbr_old, hin,hsn, firstice )
hbr_old, hin, hsn)

real (kind=dbl_kind), intent(in) :: &
aicen , & ! concentration of ice
Expand All @@ -87,9 +87,6 @@ subroutine preflushing_changes (aicen, vicen, vsnon, &
dhbr_bot , & ! brine change in bottom for diagnostics (m)
hice_old ! old ice thickness (m)

logical (kind=log_kind), intent(in) :: &
firstice ! if true, initialized values should be used

! local variables

real (kind=dbl_kind) :: &
Expand Down Expand Up @@ -117,14 +114,6 @@ subroutine preflushing_changes (aicen, vicen, vsnon, &
dhbr_top = meltt - snoice - dhice
dhbr_bot = congel - meltb

if ((hice_old < puny) .OR. (hin_old < puny) .OR. firstice) then
hice_old = hin
dhbr_top = c0
dhbr_bot = c0
dhice = c0
fbri = c1
endif

hbr_old = fbri * hice_old

end subroutine preflushing_changes
Expand All @@ -143,7 +132,7 @@ subroutine compute_microS_mushy (nilyr, nblyr, &
kperm, bphi_min, &
bSin, brine_sal, brine_rho, &
iphin, ibrine_rho, ibrine_sal, &
sice_rho, iDin )
iDin, iSin)

integer (kind=int_kind), intent(in) :: &
nilyr , & ! number of ice layers
Expand All @@ -170,7 +159,7 @@ subroutine compute_microS_mushy (nilyr, nblyr, &
kperm , & ! average ice permeability (m^2)
bphi_min ! surface porosity

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

real (kind=dbl_kind), dimension (nblyr+1), intent(inout) :: &
Expand All @@ -180,7 +169,8 @@ subroutine compute_microS_mushy (nilyr, nblyr, &
iphin , & ! porosity on the igrid
ibrine_rho , & ! brine rho on interface
ibrine_sal , & ! brine sal on interface
iTin ! Temperature on the igrid (oC)
iTin , & ! Temperature on the igrid (oC)
iSin ! Salinity on the igrid (ppt)

real (kind=dbl_kind), dimension (nblyr+2), intent(inout) :: &
bSin , & ! bulk salinity (ppt) on bgrid
Expand All @@ -191,10 +181,15 @@ subroutine compute_microS_mushy (nilyr, nblyr, &
bTin , & ! Temperature on bgrid
bphin ! porosity on bgrid

real (kind=dbl_kind), intent(inout) :: &
sice_rho ! average ice density
! local variables

real (kind=dbl_kind), dimension (nilyr) :: &
cSin , & ! bulk salinity (ppt)
cqin ! enthalpy ()

real (kind=dbl_kind), dimension (nblyr+2) :: &
zTin , & ! Temperature of ice layers on bgrid (C)
zSin , & ! Salinity of ice layers on bgrid (C)
bqin ! enthalpy on the bgrid ()

real (kind=dbl_kind), dimension (nblyr+1) :: &
Expand All @@ -205,7 +200,8 @@ subroutine compute_microS_mushy (nilyr, nblyr, &

real (kind=dbl_kind) :: &
surface_S , & ! salinity of ice above hin > hbr
hinc_old ! mean ice thickness before current melt/growth (m)
hinc_old , & ! mean ice thickness before current melt/growth (m)
hbrc_old ! mean brine thickness before current melt/growth (m)

real (kind=dbl_kind), dimension (ntrcr+2) :: & ! nblyr+2)
trtmp_s , & ! temporary, remapped tracers
Expand All @@ -227,9 +223,13 @@ subroutine compute_microS_mushy (nilyr, nblyr, &
trtmp_q(:) = c0
iDin(:) = c0

do k = 1, nilyr
cSin(k) = trcrn(nt_sice+k-1)
cqin(k) = trcrn(nt_qice+k-1)
enddo

! map Sin and qin (cice) profiles to bgc grid
surface_S = min_salin
hbr_old = min(hbr_old, maxhbr*hice_old)
hinc_old = hice_old

call remap_zbgc(nilyr, &
Expand Down Expand Up @@ -273,10 +273,9 @@ subroutine compute_microS_mushy (nilyr, nblyr, &
bSin, bTin, iTin, &
brine_sal, brine_rho, &
ibrine_sal, ibrine_rho, &
sice_rho, &
bphin, iphin, &
kperm, bphi_min, &
igrid, sss)
kperm, bphi_min, &
igrid, sss, iSin)
if (icepack_warnings_aborted(subname)) return

call calculate_drho(nblyr, igrid, bgrid, &
Expand All @@ -299,9 +298,9 @@ subroutine prepare_hbrine (nblyr, &
bSin, bTin, iTin, &
brine_sal, brine_rho, &
ibrine_sal, ibrine_rho, &
sice_rho, bphin, iphin,&
bphin, iphin, &
kperm, bphi_min, &
i_grid, sss)
i_grid, sss, iSin)

integer (kind=int_kind), intent(in) :: &
nblyr ! number of bio layers
Expand All @@ -318,7 +317,8 @@ subroutine prepare_hbrine (nblyr, &
ibrine_sal , & ! brine salinity on interface (ppt)
iphin , & ! porosity on interface
iTin , & ! Temperature on interface
bphin ! porosity of layers
bphin , & ! porosity of layers
iSin ! Bulk salinity on interface

real (kind=dbl_kind), intent(in) :: &
sss ! sea surface salinity (ppt)
Expand All @@ -327,9 +327,6 @@ subroutine prepare_hbrine (nblyr, &
kperm , & ! harmonic average permeability (m^2)
bphi_min ! minimum porosity

real (kind=dbl_kind), intent(inout) :: &
sice_rho ! avg sea ice density

! local variables

real (kind=dbl_kind), dimension(nblyr+1) :: &
Expand All @@ -348,8 +345,6 @@ subroutine prepare_hbrine (nblyr, &
! calculate equilibrium brine density and gradients
!-----------------------------------------------------------------

sice_rho = c0

do k = 1, nblyr+1

if (k == 1) then
Expand All @@ -366,8 +361,6 @@ subroutine prepare_hbrine (nblyr, &
/ (brine_sal(k)*brine_rho(k)))
bphin (k) = min(c1, bphin(k))
kin (k) = k_o*bphin(k)**exp_h
sice_rho = sice_rho + (rhoi*(c1-bphin(k)) &
+ brine_rho(k)*bphin(k))*igrm
enddo ! k

brine_sal (nblyr+2) = sss
Expand All @@ -379,6 +372,8 @@ subroutine prepare_hbrine (nblyr, &
ibrine_rho(nblyr+1) = brine_rho (nblyr+2)
iTin (1) = bTin(2)
iTin (nblyr+1) = bTin(nblyr+1)
iSin (1) = bSin(2)
iSin (nblyr+1) = bSin(nblyr+1)
iphin (1) = bphin (2)
iphin (nblyr+1) = bphin (nblyr+1)
k_min = MINVAL(kin(2:nblyr+1))
Expand All @@ -401,6 +396,7 @@ subroutine prepare_hbrine (nblyr, &
ibrine_sal(k) = (brine_sal(k+1)*igrp + brine_sal(k)*igrm) * rigr
ibrine_rho(k) = (brine_rho(k+1)*igrp + brine_rho(k)*igrm) * rigr
iTin (k) = (bTin (k+1)*igrp + bTin (k)*igrm) * rigr
iSin (k) = (bSin (k+1)*igrp + bSin (k)*igrm) * rigr
iphin (k) = max(puny, &
(bphin (k+1)*igrp + bphin (k)*igrm) * rigr)
iphin (k) = min(c1, iphin (k))
Expand Down Expand Up @@ -755,7 +751,7 @@ subroutine icepack_init_hbrine(bgrid, igrid, cgrid, &
! 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) !p5 to p25. NJ: allows thinner surface layers
swgrid(2) = zspace/c2 !+ swgrid(1)
do k = 3, nilyr+1
swgrid(k) = zspace * (real(k,kind=dbl_kind)-c1p5)
Expand Down
36 changes: 33 additions & 3 deletions columnphysics/icepack_itd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,7 @@ subroutine zap_small_areas (dt, ntrcr, &
blevels

real (kind=dbl_kind) :: xtmp, sicen ! temporary variables
real (kind=dbl_kind) :: dvssl, dvint ! temporary variables
real (kind=dbl_kind) , dimension (1):: trcr_skl
real (kind=dbl_kind) , dimension (nblyr+1):: bvol

Expand Down Expand Up @@ -1146,7 +1147,6 @@ subroutine zap_small_areas (dt, ntrcr, &
if (skl_bgc .and. nbtrcr > 0) then
blevels = 1
bvol(1) = aicen(n)*sk_l
it = 1
do it = 1, nbtrcr
trcr_skl(1) = trcrn(bio_index(it),n)
call zap_small_bgc(blevels, dflux_bio(it), &
Expand Down Expand Up @@ -1273,6 +1273,36 @@ subroutine zap_small_areas (dt, ntrcr, &
enddo ! it
endif

if (skl_bgc .and. nbtrcr > 0) then
blevels = 1
bvol(1) = (aice-c1)/aice * sk_l
do it = 1, nbtrcr
trcr_skl(1) = trcrn(bio_index(it),n)
call zap_small_bgc(blevels, dflux_bio(it), &
dt, bvol(1:blevels), trcr_skl(blevels))
enddo
elseif (z_tracers .and. nbtrcr > 0) then
blevels = nblyr + 1
bvol(:) = (aice-c1)/aice*vicen(n)/real(nblyr,kind=dbl_kind)*trcrn(nt_fbri,n)
bvol(1) = p5*bvol(1)
bvol(blevels) = p5*bvol(blevels)
do it = 1, nbtrcr
call zap_small_bgc(blevels, dflux_bio(it), &
dt, bvol(1:blevels),trcrn(bio_index(it):bio_index(it)+blevels-1,n))
if (icepack_warnings_aborted(subname)) return
enddo
! zap snow zaerosols
dvssl = p5*vsnon(n)/real(nslyr,kind=dbl_kind) ! snow surface layer
dvint = vsnon(n) - dvssl ! snow interior

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

endif

if (tr_iso) then
do it = 1, n_iso
xtmp = (vsnon(n)*trcrn(nt_isosno+it-1,n) &
Expand Down Expand Up @@ -1414,8 +1444,8 @@ subroutine zap_snow(dt, nslyr, &
endif ! tr_iso

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

do it = 1, nbtrcr
xtmp = (trcrn(bio_index(it)+nblyr+1)*dvssl + &
Expand Down
41 changes: 35 additions & 6 deletions columnphysics/icepack_mechred.F90
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module icepack_mechred
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
use icepack_tracers, only: n_iso
use icepack_tracers, only: n_iso, nblyr, bio_index
use icepack_tracers, only: icepack_compute_tracers

use icepack_warnings, only: warnstr, icepack_warnings_add
Expand Down Expand Up @@ -102,7 +102,7 @@ subroutine ridge_ice (dt, ndtd, &
mu_rdg, tr_brine, &
dardg1dt, dardg2dt, &
dvirdgdt, opening, &
fpond, &
fpond, flux_bio, &
fresh, fhocn, &
faero_ocn, fiso_ocn, &
aparticn, krdgn, &
Expand Down Expand Up @@ -188,6 +188,9 @@ subroutine ridge_ice (dt, ndtd, &
real (kind=dbl_kind), dimension(:), intent(inout), optional :: &
faero_ocn ! aerosol flux to ocean (kg/m^2/s)

real (kind=dbl_kind), dimension(:), intent(inout), optional :: &
flux_bio ! biological and zaerosol flux to ocean (kg/m^2/s)

real (kind=dbl_kind), dimension(:), intent(inout), optional :: &
fiso_ocn ! isotope flux to ocean (kg/m^2/s)

Expand Down Expand Up @@ -221,6 +224,9 @@ subroutine ridge_ice (dt, ndtd, &
real (kind=dbl_kind), dimension (n_aero) :: &
maero ! aerosol mass added to ocean (kg m-2)

real (kind=dbl_kind), dimension (nbtrcr) :: &
mbio ! bio mass added to ocean (mmol or kg m-2)

real (kind=dbl_kind), dimension (n_iso) :: &
miso ! isotope mass added to ocean (kg m-2)

Expand Down Expand Up @@ -273,6 +279,7 @@ subroutine ridge_ice (dt, ndtd, &
msnow_mlt = c0
esnow_mlt = c0
maero (:) = c0
mbio (:) = c0
miso (:) = c0
mpond = c0
ardg1 = c0
Expand Down Expand Up @@ -401,7 +408,8 @@ subroutine ridge_ice (dt, ndtd, &
msnow_mlt, esnow_mlt, &
maero, miso, &
mpond, Tf, &
aredistn, vredistn)
aredistn, vredistn, &
mbio)
if (icepack_warnings_aborted(subname)) return

!-----------------------------------------------------------------
Expand Down Expand Up @@ -591,6 +599,11 @@ subroutine ridge_ice (dt, ndtd, &
faero_ocn(it) = faero_ocn(it) + maero(it)*dti
enddo
endif
if (present(flux_bio)) then
do it = 1, nbtrcr
flux_bio(it) = flux_bio(it) + mbio(it)*dti
enddo
endif
if (present(fiso_ocn)) then
if (tr_iso) then
! check size fiso_ocn vs n_iso ???
Expand Down Expand Up @@ -1086,7 +1099,8 @@ subroutine ridge_shift (ntrcr, dt, &
msnow_mlt, esnow_mlt, &
maero, miso, &
mpond, Tf, &
aredistn, vredistn)
aredistn, vredistn, &
mbio)

integer (kind=int_kind), intent(in) :: &
ncat , & ! number of thickness categories
Expand Down Expand Up @@ -1163,6 +1177,9 @@ subroutine ridge_shift (ntrcr, dt, &
real (kind=dbl_kind), dimension(:), intent(inout) :: &
miso ! isotope mass added to ocean (kg m-2)

real (kind=dbl_kind), dimension(:), intent(inout) :: &
mbio ! biology and zaerosol mass added to ocean (kg m-2)

real (kind=dbl_kind), dimension (:), intent(inout), optional :: &
aredistn , & ! redistribution function: fraction of new ridge area
vredistn ! redistribution function: fraction of new ridge volume
Expand Down Expand Up @@ -1215,7 +1232,9 @@ subroutine ridge_shift (ntrcr, dt, &
hL, hR , & ! left and right limits of integration
expL, expR , & ! exponentials involving hL, hR
tmpfac , & ! factor by which opening/closing rates are cut
wk1 ! work variable
wk1 , & ! work variable
dzssl , & ! fraction of snow surface biotracers
dzint ! fraction of interior snow biotracers

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

Expand Down Expand Up @@ -1386,6 +1405,16 @@ subroutine ridge_shift (ntrcr, dt, &
enddo
endif

if (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) then
mpond = mpond + ardg1n * trcrn(nt_apnd,n) &
* trcrn(nt_hpnd,n)
Expand Down Expand Up @@ -1875,7 +1904,7 @@ subroutine icepack_step_ridge (dt, ndtd, &
mu_rdg, tr_brine, &
dardg1dt, dardg2dt, &
dvirdgdt, opening, &
fpond, &
fpond, flux_bio, &
fresh, fhocn, &
faero_ocn, fiso_ocn, &
aparticn, krdgn, &
Expand Down
Loading
Loading