Skip to content

Commit

Permalink
Merge extended nitrogen cycle, M4AGO scheme and preformed Si tracer i…
Browse files Browse the repository at this point in the history
…nto master (#269)

This merge brings in i) the extended nitrogen cycle developments carried out in the ESM2025 project (optionally), ii) the preformed silicate tracer, iii) bluefix (cyanobacteria) only in the euphotic zone (switch available to revert back to MLD, if needed for testing: leuphotic_cya), and iv) the M4AGO sinking scheme (Maerz et al. 2020) as submodule (optionally) into iHAMOCC/BLOM master.

About the extended nitrogen cycle:
The extended nitrogen cycle incorporates two new tracers: ammonium and nitrite.
The extended nitrogen cycle features an explicit representation of the following processes:

 -   ammonification (detritus -> NH4)
 -   updated bluefix approach (N2-fixation) with NH4 release, also adjusted for the new BLOM coordinates (euphotic zone only as option or as before)
 -   2-step nitrification (NH4 -> NO2 and NO2 -> NO3), with N2O release during the first step, both steps resulting in dark-ocean carbon fixation
 -  phytoplankton uptake of NH4 and NO3
 -  canonical denitrification steps (NO3 -> NO2 -> N2O -> N2)
 -  dissimilatory nitrite/nitrate reduction (NO2 -> NH4)
 -  anammox, including dark-ocean carbon fixation

And capabilities for 
 -  online coupled air-sea gas exchange of N2O and NH3 in addition to the previously coupled gas fluxes
 -  online coupled deposition of NOy and NHx

are represented (if applicable, in both the water column and the sediment).
  • Loading branch information
jmaerz authored May 31, 2024
1 parent 81501dc commit 916352e
Show file tree
Hide file tree
Showing 45 changed files with 6,466 additions and 938 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "CVMix-src"]
path = pkgs/CVMix-src
url = [email protected]:CVMix/CVMix-src.git
[submodule "pkgs/M4AGO-sinking-scheme"]
path = pkgs/M4AGO-sinking-scheme
url = [email protected]:jmaerz/M4AGO-sinking-scheme
7 changes: 7 additions & 0 deletions Externals_BLOM.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@ repo_url = https://github.com/CVMix/CVMix-src
local_path = pkgs/CVMix-src
required = True

[M4AGO]
tag = dev-1.0.0
protocol = git
repo_url = https://github.com/jmaerz/M4AGO-sinking-scheme
local_path = pkgs/M4AGO-sinking-scheme
required = True

[externals_description]
schema_version = 1.0.0
42 changes: 35 additions & 7 deletions cesm/mod_cesm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ module mod_cesm
use mod_forcing, only: trxday, srxday, swa, nsf, lip, sop, eva, rnf, rfi, &
fmltfz, sfl, ztx, mty, ustarw, slp, abswnd, &
lamult, lasl, ustokes, vstokes, atmco2, atmbrf, &
flxdms, flxbrf, use_stream_relaxation
flxdms, flxbrf, &
atmn2o,atmnh3,atmnhxdep,atmnoydep, &
use_stream_relaxation
use mod_ben02, only: initai, rdcsic, rdctsf, fnlzai
use mod_seaice, only: ficem
use mod_checksum, only: csdiag, chksummsk
Expand Down Expand Up @@ -81,7 +83,11 @@ module mod_cesm
atmco2_da, & ! Atmospheric CO2 concentration [ppm].
atmbrf_da, & ! Atmospheric bromoform concentration [ppt].
flxdms_da, & ! dms surface flux computed by mediator [kg m-2 s-1]
flxbrf_da ! brf surface flux computed by mediator [kg m-2 s-1]
flxbrf_da, & ! brf surface flux computed by mediator [kg m-2 s-1]
atmn2o_da, & ! Atmospheric nitrous oxide concentration [ppt].
atmnh3_da, & ! Atmopsheric ammonia concentration [ppt].
atmnhxdep_da, & ! Atmospheric nhx deposition field [kgN m-2 s-1].
atmnoydep_da ! Atmospheric noy deposition field [kgN m-2 s-1].

logical :: &
smtfrc ! If true, time smooth CESM forcing fields.
Expand All @@ -93,8 +99,10 @@ module mod_cesm
frzpot, mltpot, swa_da, nsf_da, hmlt_da, lip_da, sop_da, eva_da, &
rnf_da, rfi_da, fmltfz_da, sfl_da, ztx_da, mty_da, ustarw_da, &
slp_da, abswnd_da, ficem_da, lamult_da, lasl_da, flxdms_da, flxbrf_da, &
ustokes_da, vstokes_da, atmco2_da, atmbrf_da, smtfrc, l1ci, l2ci, &
inicon_cesm, inifrc_cesm, getfrc_cesm
ustokes_da, vstokes_da, atmco2_da, atmbrf_da,atmn2o_da,atmnh3_da,&
atmnhxdep_da,atmnoydep_da, &
smtfrc, l1ci, l2ci,inicon_cesm, inifrc_cesm, getfrc_cesm

contains

subroutine inicon_cesm
Expand Down Expand Up @@ -122,9 +130,9 @@ subroutine inifrc_cesm
! If SST restoring is requested prepare interpolation and
! read climatological sea-ice concentration and surface temperature.
if (trxday > 0._r8) then
call initai
call rdcsic
call rdctsf
call initai
call rdcsic
call rdctsf
endif

! If SSS restoring is requested, read climatological sea surface salinity.
Expand Down Expand Up @@ -189,6 +197,10 @@ subroutine getfrc_cesm
vstokes(i, j) = w1*vstokes_da(i, j, l1ci) + w2*vstokes_da(i, j, l2ci)
atmco2(i, j) = w1*atmco2_da(i, j, l1ci) + w2*atmco2_da(i, j, l2ci)
atmbrf(i, j) = w1*atmbrf_da(i, j, l1ci) + w2*atmbrf_da(i, j, l2ci)
atmn2o(i, j) = w1*atmn2o_da(i, j, l1ci) + w2*atmn2o_da(i, j, l2ci)
atmnh3(i, j) = w1*atmnh3_da(i, j, l1ci) + w2*atmnh3_da(i, j, l2ci)
atmnhxdep(i, j) = w1*atmnhxdep_da(i, j, l1ci) + w2*atmnhxdep_da(i, j, l2ci)
atmnoydep(i, j) = w1*atmnoydep_da(i, j, l1ci) + w2*atmnoydep_da(i, j, l2ci)
enddo
enddo
do l = 1, isu(j)
Expand Down Expand Up @@ -228,6 +240,10 @@ subroutine getfrc_cesm
call ncdefvar('vstokes_da', 'x y', ndouble, 8)
call ncdefvar('atmco2_da', 'x y', ndouble, 8)
call ncdefvar('atmbrf_da', 'x y', ndouble, 8)
call ncdefvar('atmn2o_da', 'x y', ndouble, 8)
call ncdefvar('atmnh3_da', 'x y', ndouble, 8)
call ncdefvar('atmnoydep_da', 'x y', ndouble, 8)
call ncdefvar('atmnoydep_da', 'x y', ndouble, 8)
call ncdefvar('ztx_da', 'x y', ndouble, 8)
call ncdefvar('mty_da', 'x y', ndouble, 8)
call ncedef
Expand Down Expand Up @@ -272,6 +288,14 @@ subroutine getfrc_cesm
ip, 1, 1._r8, 0._r8, 8)
call ncwrtr('atmbrf_da', 'x y', atmbrf_da(1 - nbdy, 1 - nbdy, l2ci), &
ip, 1, 1._r8, 0._r8, 8)
call ncwrtr('atmn2o_da', 'x y', atmn2o_da(1 - nbdy, 1 - nbdy, l2ci), &
ip, 1, 1._r8, 0._r8, 8)
call ncwrtr('atmnh3_da', 'x y', atmnh3_da(1 - nbdy, 1 - nbdy, l2ci), &
ip, 1, 1._r8, 0._r8, 8)
call ncwrtr('atmnhxdep_da', 'x y', atmnhxdep_da(1 - nbdy, 1 - nbdy, l2ci), &
ip, 1, 1._r8, 0._r8, 8)
call ncwrtr('atmnoydep_da', 'x y', atmnoydep_da(1 - nbdy, 1 - nbdy, l2ci), &
ip, 1, 1._r8, 0._r8, 8)
call ncwrtr('ztx_da', 'x y', ztx_da(1 - nbdy, 1 - nbdy, l2ci), &
iu, 1, 1._r8, 0._r8, 8)
call ncwrtr('mty_da', 'x y', mty_da(1 - nbdy, 1 - nbdy, l2ci), &
Expand Down Expand Up @@ -307,6 +331,10 @@ subroutine getfrc_cesm
call chksummsk(vstokes, ip, 1, 'vstokes')
call chksummsk(atmco2, ip, 1, 'atmco2')
call chksummsk(atmbrf, ip, 1, 'atmbrf')
call chksummsk(atmn2o, ip, 1, 'atmn2o')
call chksummsk(atmnh3, ip, 1, 'atmnh3')
call chksummsk(atmnhxdep, ip, 1, 'atmnhxdep')
call chksummsk(atmnoydep, ip, 1, 'atmnoydep')
endif

end subroutine getfrc_cesm
Expand Down
1 change: 1 addition & 0 deletions cime_config/buildlib_2.1
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def _main_func():
os.path.join(comp_root_dir_ocn, "channel"),
os.path.join(comp_root_dir_ocn, "single_column"),
os.path.join(comp_root_dir_ocn, "pkgs", "CVMix-src", "src", "shared"),
os.path.join(comp_root_dir_ocn, "pkgs", "M4AGO-sinking-scheme", "src"),
os.path.join(comp_root_dir_ocn, "phy")]

if turbclo != 0 and tracers != 0:
Expand Down
1 change: 1 addition & 0 deletions cime_config/buildlib_2.2
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def _main_func():
os.path.join(comp_root_dir_ocn, "channel"),
os.path.join(comp_root_dir_ocn, "single_column"),
os.path.join(comp_root_dir_ocn, "pkgs", "CVMix-src", "src", "shared"),
os.path.join(comp_root_dir_ocn, "pkgs", "M4AGO-sinking-scheme", "src"),
os.path.join(comp_root_dir_ocn, "phy")]

if turbclo != 0 and tracers != 0:
Expand Down
8 changes: 8 additions & 0 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ def buildnml(case, caseroot, compname):
blom_tracer_modules = case.get_value("BLOM_TRACER_MODULES")
blom_atrc = case.get_value("BLOM_ATRC")
hamocc_ciso = case.get_value("HAMOCC_CISO")
hamocc_extncycle = case.get_value("HAMOCC_EXTNCYCLE")
hamocc_n2oc = case.get_value("HAMOCC_N2OC")
hamocc_atmndepc = case.get_value("HAMOCC_ATMNDEPC")
hamocc_m4ago = case.get_value("HAMOCC_M4AGO")
hamocc_sedbypass = case.get_value("HAMOCC_SEDBYPASS")
hamocc_sedspinup = case.get_value("HAMOCC_SEDSPINUP")
hamocc_sedspinup_yr_start = case.get_value("HAMOCC_SEDSPINUP_YR_START")
Expand Down Expand Up @@ -185,6 +189,10 @@ def buildnml(case, caseroot, compname):
config["blom_tracer_modules"] = blom_tracer_modules
config["blom_atrc"] = blom_atrc
config["hamocc_ciso"] = "yes" if hamocc_ciso else "no"
config["hamocc_extncycle"] = "yes" if hamocc_extncycle else "no"
config["hamocc_n2oc"] = "yes" if hamocc_n2oc else "no"
config["hamocc_atmndepc"] = "yes" if hamocc_atmndepc else "no"
config["hamocc_m4ago"] = "yes" if hamocc_m4ago else "no"
config["hamocc_sedbypass"] = "yes" if hamocc_sedbypass else "no"
config["hamocc_sedspinup"] = "yes" if hamocc_sedspinup else "no"
config["hamocc_sedspinup_yr_start"] = hamocc_sedspinup_yr_start
Expand Down
47 changes: 47 additions & 0 deletions cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,53 @@
<desc>Scenario for nitrogen deposition data. Requires module ecosys</desc>
</entry>

<entry id="HAMOCC_EXTNCYCLE">
<type>logical</type>
<valid_values>TRUE,FALSE</valid_values>
<default_value>FALSE</default_value>
<values>
<value compset="_BGC.*%N2OC">TRUE</value>
<value compset="_BGC.*%NH3C">TRUE</value>
<value compset="_BGC.*%ATMNDEPC">TRUE</value>
</values>
<group>run_component_blom</group>
<file>env_run.xml</file>
<desc>Set preprocessor option to activate the extended nitrogen cycle code. Requires module ecosys</desc>
</entry>

<entry id="HAMOCC_ATMNDEPC">
<type>logical</type>
<valid_values>TRUE,FALSE</valid_values>
<default_value>FALSE</default_value>
<values>
<value compset="_BGC.*%ATMNDEPC">TRUE</value>
</values>
<group>run_component_blom</group>
<file>env_run.xml</file>
<desc>Nitrogen deposition coupled from atmosphere. Requires module ecosys and extncycle</desc>
</entry>

<entry id="HAMOCC_N2OC">
<type>logical</type>
<valid_values>TRUE,FALSE</valid_values>
<default_value>FALSE</default_value>
<values>
<value compset="_BGC.*%N2OC%NH3C">TRUE</value>
</values>
<group>run_component_blom</group>
<file>env_run.xml</file>
<desc>N2O and NH3 fluxes coupled from atmosphere. Requires module ecosys and extncycle</desc>
</entry>

<entry id="HAMOCC_M4AGO">
<type>logical</type>
<valid_values>TRUE,FALSE</valid_values>
<default_value>FALSE</default_value>
<group>run_component_blom</group>
<file>env_run.xml</file>
<desc>Set preprocessor option to activate the M4AGO sinking scheme. Requires module ecosys</desc>
</entry>

<entry id="HAMOCC_CISO">
<type>logical</type>
<valid_values>TRUE,FALSE</valid_values>
Expand Down
Loading

0 comments on commit 916352e

Please sign in to comment.