Skip to content

Commit

Permalink
Update bgc setup in driver and namelist
Browse files Browse the repository at this point in the history
Fix bug in snow physics hsn_new computation for cases with nslyr=1 (not recommended)
  • Loading branch information
apcraig committed Aug 1, 2024
1 parent b9514dc commit eab632b
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 61 deletions.
2 changes: 1 addition & 1 deletion columnphysics/icepack_algae.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ subroutine algal_dyn (dt, &
real (kind=dbl_kind), dimension(n_doc) :: &
DOCin ! dissolved organic carbon concentration on volume (mmolC/m^3)

real (kind=dbl_kind), dimension(n_dic) :: &
real (kind=dbl_kind), dimension(n_dic) :: &
DICin ! dissolved inorganic carbon concentration on volume (mmolC/m^3)

real (kind=dbl_kind), dimension(n_don) :: & !proteins
Expand Down
2 changes: 1 addition & 1 deletion columnphysics/icepack_snow.F90
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ subroutine snow_redist(dt, wind, ain, vin, vsn, zqsn, &
zqsn(:,n))
if (icepack_warnings_aborted(subname)) return
else
hsn_new(1) = hsn_new(1) + dhsn
hsn_new(n) = hsn_new(n) + dhsn
endif ! nslyr > 1
endif ! |dhsn| > puny
endif ! ain > puny
Expand Down
3 changes: 1 addition & 2 deletions columnphysics/icepack_therm_mushy.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1323,8 +1323,7 @@ subroutine picard_solver(lsnow, lcold, &
! if not converged
if (.not. lconverged) then

call picard_nonconvergence(nilyr, nslyr, &
Tsf0, Tsf, &
call picard_nonconvergence(Tsf0, Tsf, &
zTsn0, zTsn, &
zTin0, zTin, &
zSin0, zSin, &
Expand Down
28 changes: 26 additions & 2 deletions configuration/driver/icedrv_init_column.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,8 @@ subroutine init_zbgc
nlt_bgc_N(:) = 0
nlt_bgc_C(:) = 0
nlt_bgc_chl(:) = 0
nt_bgc_N(:) = 0
! need some valid array indices if unset
nt_bgc_N(:) = max_ntrcr - n_algae*(nblyr+3)
nt_bgc_C(:) = 0
nt_bgc_chl(:) = 0

Expand All @@ -1331,7 +1332,8 @@ subroutine init_zbgc
! vectors of size icepack_max_aero
nlt_zaero(:) = 0
nlt_zaero_sw(:) = 0
nt_zaero(:) = 0
! need some valid array indices if unset
nt_zaero(:) = max_ntrcr - n_zaero*(nblyr+3)
nt_zaero_sw(:) = 0

nlt_bgc_Nit = 0
Expand All @@ -1356,6 +1358,28 @@ subroutine init_zbgc
nt_bgc_hum = 0
nt_zbgc_frac = 0

dictype(:) = -c1

algaltype(1) = algaltype_diatoms
algaltype(2) = algaltype_sp
algaltype(3) = algaltype_phaeo

doctype(1) = doctype_s
doctype(2) = doctype_l

dontype(1) = dontype_protein

fedtype(1) = fedtype_1

feptype(1) = feptype_1

zaerotype(1) = zaerotype_bc1
zaerotype(2) = zaerotype_bc2
zaerotype(3) = zaerotype_dust1
zaerotype(4) = zaerotype_dust2
zaerotype(5) = zaerotype_dust3
zaerotype(6) = zaerotype_dust4

if (skl_bgc) then

nk = 1
Expand Down
90 changes: 45 additions & 45 deletions configuration/scripts/icepack_in
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@
tr_bgc_DON = .false.
tr_bgc_Fe = .false.
grid_o = 0.006
l_sk = 0.024
l_sk = 20.0
grid_oS = 0.0
l_skS = 0.028
phi_snow = -0.3
initbio_frac = 0.8
initbio_frac = 1.0
frazil_scav = 0.8
ratio_Si2N_diatoms = 1.8
ratio_Si2N_sp = 0.0
Expand All @@ -191,29 +191,29 @@
ratio_Fe2DOC_s = 0.1
ratio_Fe2DOC_l = 0.033
fr_resp = 0.05
tau_min = 5200.0
tau_max = 173000.0
algal_vel = 0.0000000111
tau_min = 3600.0
tau_max = 7776000.0
algal_vel = 0.0000001
R_dFe2dust = 0.035
dustFe_sol = 0.005
chlabs_diatoms = 0.03
chlabs_sp = 0.01
chlabs_phaeo = 0.05
alpha2max_low_diatoms = 0.8
alpha2max_low_sp = 0.67
alpha2max_low_phaeo = 0.67
beta2max_diatoms = 0.018
beta2max_sp = 0.0025
beta2max_phaeo = 0.01
alpha2max_low_diatoms = 0.3
alpha2max_low_sp = 0.2
alpha2max_low_phaeo = 0.17
beta2max_diatoms = 0.001
beta2max_sp = 0.001
beta2max_phaeo = 0.04
mu_max_diatoms = 1.44
mu_max_sp = 0.851
mu_max_phaeo = 0.851
grow_Tdep_diatoms = 0.06
grow_Tdep_sp = 0.06
grow_Tdep_phaeo = 0.06
fr_graze_diatoms = 0.0
fr_graze_sp = 0.1
fr_graze_phaeo = 0.1
mu_max_sp = 0.41
mu_max_phaeo = 0.63
grow_Tdep_diatoms = 0.063
grow_Tdep_sp = 0.063
grow_Tdep_phaeo = 0.063
fr_graze_diatoms = 0.19
fr_graze_sp = 0.19
fr_graze_phaeo = 0.19
mort_pre_diatoms = 0.007
mort_pre_sp = 0.007
mort_pre_phaeo = 0.007
Expand All @@ -236,10 +236,10 @@
K_Fe_sp = 0.2
K_Fe_phaeo = 0.1
f_don_protein = 0.6
kn_bac_protein = 0.03
f_don_Am_protein = 0.25
f_doc_s = 0.4
f_doc_l = 0.4
kn_bac_protein = 0.2
f_don_Am_protein = 1.0
f_doc_s = 0.5
f_doc_l = 0.5
f_exude_s = 1.0
f_exude_l = 1.0
k_bac_s = 0.03
Expand All @@ -249,36 +249,36 @@
op_dep_min = 0.1
fr_graze_s = 0.5
fr_graze_e = 0.5
fr_mort2min = 0.5
fr_dFe = 0.3
k_nitrif = 0.0
fr_mort2min = 0.9
fr_dFe = 0.9
k_nitrif = 0.046
t_iron_conv = 3065.0
max_loss = 0.9
max_dfe_doc1 = 0.2
fr_resp_s = 0.75
y_sk_DMS = 0.5
t_sk_conv = 3.0
t_sk_ox = 10.0
fr_resp_s = 0.9
y_sk_DMS = 0.7
t_sk_conv = 5.0
t_sk_ox = 12.0
algaltype_diatoms = 0.0
algaltype_sp = 0.5
algaltype_sp = 0.0
algaltype_phaeo = 0.5
nitratetype = -1.0
ammoniumtype = 1.0
ammoniumtype = 0.0
silicatetype = -1.0
dmspptype = 0.5
dmspdtype = -1.0
humtype = 1.0
doctype_s = 0.5
doctype_l = 0.5
dontype_protein = 0.5
fedtype_1 = 0.5
dmspdtype = 0.0
humtype = 0.0
doctype_s = 0.0
doctype_l = 0.0
dontype_protein = 0.0
fedtype_1 = 0.0
feptype_1 = 0.5
zaerotype_bc1 = 1.0
zaerotype_bc2 = 1.0
zaerotype_dust1 = 1.0
zaerotype_dust2 = 1.0
zaerotype_dust3 = 1.0
zaerotype_dust4 = 1.0
zaerotype_bc1 = 0.0
zaerotype_bc2 = 0.0
zaerotype_dust1 = 0.0
zaerotype_dust2 = 0.0
zaerotype_dust3 = 0.0
zaerotype_dust4 = 0.0
ratio_C2N_diatoms = 7.0
ratio_C2N_sp = 7.0
ratio_C2N_phaeo = 7.0
Expand All @@ -288,6 +288,6 @@
F_abs_chl_diatoms = 2.0
F_abs_chl_sp = 4.0
F_abs_chl_phaeo = 5.0
ratio_C2N_proteins = 7.0
ratio_C2N_proteins = 5.0
/

7 changes: 4 additions & 3 deletions configuration/scripts/options/set_env.bgcispol
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
### Layers
setenv NICELYR 7 # number of vertical layers in the ice
setenv NSNWLYR 1 # number of vertical layers in the snow
setenv NSNWLYR 5 # number of vertical layers in the snow
setenv NICECAT 5 # number of ice thickness categories

### Tracers # match icepack_in tracer_nml to conserve memory
setenv TRAGE 1 # set to 1 for ice age tracer
setenv TRFY 1 # set to 1 for first-year ice area tracer
setenv TRLVL 1 # set to 1 for level and deformed ice tracers
setenv TRPND 1 # set to 1 for melt pond tracers
setenv NTRAERO 0 # number of aerosol tracers
setenv TRSNOW 1 # set to 1 for snow metamorphism tracers
setenv NTRAERO 1 # number of aerosol tracers
# (up to max_aero in ice_domain_size.F90)
# CESM uses 3 aerosol tracers
setenv TRBRI 1 # set to 1 for brine height tracer
Expand All @@ -23,7 +24,7 @@ setenv TRALG 3 # number of algal tracers
# (up to max_algae = 3)
setenv TRDOC 2 # number of dissolve organic carbon
# (up to max_doc = 3)
setenv TRDIC 0 # number of dissolve inorganic carbon
setenv TRDIC 1 # number of dissolve inorganic carbon
# (up to max_dic = 1)
setenv TRDON 1 # number of dissolve organic nitrogen
# (up to max_don = 1)
Expand Down
8 changes: 4 additions & 4 deletions configuration/scripts/options/set_env.bgcnice
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
### Layers
setenv NICELYR 7 # number of vertical layers in the ice
setenv NSNWLYR 1 # number of vertical layers in the snow
setenv NSNWLYR 5 # number of vertical layers in the snow
setenv NICECAT 5 # number of ice thickness categories

### Tracers # match icepack_in tracer_nml to conserve memory
setenv TRAGE 1 # set to 1 for ice age tracer
setenv TRFY 1 # set to 1 for first-year ice area tracer
setenv TRLVL 1 # set to 1 for level and deformed ice tracers
setenv TRPND 1 # set to 1 for melt pond tracers
setenv NTRAERO 0 # number of aerosol tracers
setenv NTRAERO 1 # number of aerosol tracers
# (up to max_aero in ice_domain_size.F90)
# CESM uses 3 aerosol tracers
setenv TRBRI 1 # set to 1 for brine height tracer
Expand All @@ -17,13 +17,13 @@ setenv TRBGCS 0 # set to 1 for skeletal layer tracers
setenv TRBGCZ 1 # set to 1 for zbgc tracers
# (needs TRBGCS = 0 and TRBRI = 1)
setenv NBGCLYR 7 # number of zbgc layers
setenv TRZAERO 0 # number of z aerosol tracers
setenv TRZAERO 3 # number of z aerosol tracers
# (up to max_aero = 6)
setenv TRALG 3 # number of algal tracers
# (up to max_algae = 3)
setenv TRDOC 2 # number of dissolve organic carbon
# (up to max_doc = 3)
setenv TRDIC 0 # number of dissolve inorganic carbon
setenv TRDIC 1 # number of dissolve inorganic carbon
# (up to max_dic = 1)
setenv TRDON 1 # number of dissolve organic nitrogen
# (up to max_don = 1)
Expand Down
2 changes: 1 addition & 1 deletion configuration/scripts/options/set_env.bgcsklnice
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ setenv TRALG 3 # number of algal tracers
# (up to max_algae = 3)
setenv TRDOC 2 # number of dissolve organic carbon
# (up to max_doc = 3)
setenv TRDIC 0 # number of dissolve inorganic carbon
setenv TRDIC 1 # number of dissolve inorganic carbon
# (up to max_dic = 1)
setenv TRDON 1 # number of dissolve organic nitrogen
# (up to max_don = 1)
Expand Down
13 changes: 12 additions & 1 deletion configuration/scripts/options/set_nml.bgcispol
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,16 @@
tr_bgc_PON = .true.
tr_bgc_hum = .true.
tr_bgc_DON = .true.
tr_bgc_Fe = .false.
tr_bgc_Fe = .true.
tfrz_option = 'mushy'
tr_FY = .true.
highfreq = .true.
natmiter = 10
oceanmixed_ice = .false.
kcatbound = 0
tr_snow = .true.
use_smliq_pnd = .true.
snwgrain = .true.
snwredist = 'ITDrdg'
rsnw_fall = 54.526
rsnw_tmax = 2800.0
13 changes: 12 additions & 1 deletion configuration/scripts/options/set_nml.bgcnice
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
ocn_data_file = 'oceanmixed_daily_3.txt'
bgc_data_file = 'nutrients_daily_ISPOL_WOA_field3.txt'
tr_brine = .true.
tr_zaero = .false.
tr_zaero = .true.
z_tracers = .true.
solve_zbgc = .true.
bgc_flux_type = 'Jin2006'
Expand All @@ -25,3 +25,14 @@
tr_bgc_DON = .true.
tr_bgc_Fe = .true.
tfrz_option = 'mushy'
tr_FY = .true.
highfreq = .true.
natmiter = 10
oceanmixed_ice = .false.
kcatbound = 0
tr_snow = .true.
use_smliq_pnd = .true.
snwgrain = .true.
snwredist = 'ITDrdg'
rsnw_fall = 54.526
rsnw_tmax = 2800.0

0 comments on commit eab632b

Please sign in to comment.