diff --git a/.gitmodules b/.gitmodules
index 18c11683..f3288b67 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@
[submodule "CVMix-src"]
path = pkgs/CVMix-src
url = git@github.com:CVMix/CVMix-src.git
+[submodule "pkgs/M4AGO-sinking-scheme"]
+ path = pkgs/M4AGO-sinking-scheme
+ url = git@github.com:jmaerz/M4AGO-sinking-scheme
diff --git a/Externals_BLOM.cfg b/Externals_BLOM.cfg
index 7952afd5..c8da301e 100644
--- a/Externals_BLOM.cfg
+++ b/Externals_BLOM.cfg
@@ -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
diff --git a/cesm/mod_cesm.F90 b/cesm/mod_cesm.F90
index 1f9cadd8..a46a0267 100644
--- a/cesm/mod_cesm.F90
+++ b/cesm/mod_cesm.F90
@@ -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
@@ -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.
@@ -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
@@ -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.
@@ -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)
@@ -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
@@ -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), &
@@ -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
diff --git a/cime_config/buildlib_2.1 b/cime_config/buildlib_2.1
index a46abbdd..b36dc37d 100755
--- a/cime_config/buildlib_2.1
+++ b/cime_config/buildlib_2.1
@@ -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:
diff --git a/cime_config/buildlib_2.2 b/cime_config/buildlib_2.2
index d069e2eb..ec30963c 100755
--- a/cime_config/buildlib_2.2
+++ b/cime_config/buildlib_2.2
@@ -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:
diff --git a/cime_config/buildnml b/cime_config/buildnml
index 3d53b7b7..6ef0f906 100755
--- a/cime_config/buildnml
+++ b/cime_config/buildnml
@@ -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")
@@ -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
diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml
index 4118b79e..3d462ee0 100644
--- a/cime_config/config_component.xml
+++ b/cime_config/config_component.xml
@@ -140,6 +140,53 @@
Scenario for nitrogen deposition data. Requires module ecosys
+
+ logical
+ TRUE,FALSE
+ FALSE
+
+ TRUE
+ TRUE
+ TRUE
+
+ run_component_blom
+ env_run.xml
+ Set preprocessor option to activate the extended nitrogen cycle code. Requires module ecosys
+
+
+
+ logical
+ TRUE,FALSE
+ FALSE
+
+ TRUE
+
+ run_component_blom
+ env_run.xml
+ Nitrogen deposition coupled from atmosphere. Requires module ecosys and extncycle
+
+
+
+ logical
+ TRUE,FALSE
+ FALSE
+
+ TRUE
+
+ run_component_blom
+ env_run.xml
+ N2O and NH3 fluxes coupled from atmosphere. Requires module ecosys and extncycle
+
+
+
+ logical
+ TRUE,FALSE
+ FALSE
+ run_component_blom
+ env_run.xml
+ Set preprocessor option to activate the M4AGO sinking scheme. Requires module ecosys
+
+
logical
TRUE,FALSE
diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml
index 59b58a09..395f9d3b 100644
--- a/cime_config/namelist_definition_blom.xml
+++ b/cime_config/namelist_definition_blom.xml
@@ -3610,6 +3610,49 @@
File name (incl. full path) for atmopheric N-deposition data
+
+ logical
+ bgcnml
+ bgcnml
+
+ .false.
+ .true.
+
+ Switch to couple nitrogen deposition. Requires do_ndep.
+
+
+
+ logical
+ bgcnml
+ bgcnml
+
+ .false.
+ .true.
+
+ Switch to couple N2O and NH3 fluxes
+
+
+
+ logical
+ bgcnml
+ bgcnml
+
+ .false.
+ .true.
+
+ Switch for M4AGO settling scheme
+
+
+
+ logical
+ bgcnml
+ bgcnml
+
+ .false.
+
+ Switch for cyano-bluefix in euphotic zone only
+
+
logical
bgcnml
@@ -3863,6 +3906,17 @@
(no swa-climatology has been created for other grid configurations)
+
+ logical
+ config_bgc
+ config_bgc
+
+ .false.
+ .true.
+
+ activate the HAMOCC extended nitrogen cycle code
+
+
logical
config_bgc
@@ -4275,214 +4329,909 @@
Sinking parameter: m/d maximum sinking speed
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Half-saturation constant for NH4 uptake by bulk phytoplankton (kmol/m3)
+
-
- char(3)
- diabgc
- diabgc
+
+ real
+ bgcparams
+ bgcparams
- 'hbgcd','hbgcm','hbgcy'
+ None
- add desc
+ Half-saturation constant for NO3 uptake by bulk phytoplankton (kmol/m3)
-
- integer(3)
- diabgc
- diabgc
+
+ real
+ bgcparams
+ bgcparams
- 1,30,365
+ None
- add desc
+ Maximum growth rate denitrification on NO3 at reference T (1/d)
-
- integer(3)
- diabgc
- diabgc
+
+ real
+ bgcparams
+ bgcparams
- 30,30,365
- 1,30,365
- 0,0,0
+ None
- add desc
+ Maximum growth rate for anammox at reference T (1/d)
-
- integer(3)
- diabgc
- diabgc
+
+ real
+ bgcparams
+ bgcparams
- 0,0,0
+ None
- add desc
+ Maximum growth rate denitrification on NO2 at reference T (1/d)
-
- integer(3)
- diabgc
- diabgc
+
+ real
+ bgcparams
+ bgcparams
- 0,0,0
- 1,1,1
+ None
- add desc
+ Maximum growth rate denitrification on N2O at reference T (1/d)
-
- integer(3)
- diabgc
- diabgc
+
+ real
+ bgcparams
+ bgcparams
- 0,1,0
+ None
- add desc
+ Maximum growth rate DNRA on NO2 at reference T (1/d)
-
- integer(3)
- diabgc
- diabgc
+
+ real
+ bgcparams
+ bgcparams
- 0,2,2
- 4,2,2
- 0,0,0
+ None
- Phosphorus (po4) [mol P m-3]
+ Maximum growth rate nitrification on NH4 at reference T (1/d)
-
- integer(3)
- diabgc
- diabgc
+
+ real
+ bgcparams
+ bgcparams
- 0,2,2
- 4,2,2
- 0,0,0
+ None
- Oxygen (o2) [mol O2 m-3]
+ Maximum growth rate nitrification on NO2 at reference T (1/d)
-
- integer(3)
- diabgc
- diabgc
+
+ real
+ bgcparams
+ bgcparams
- 0,2,2
- 4,2,2
- 0,0,0
+ None
- Dissolved iron (dfe) [mol Fe m-3]
+ Sediment: remineralization rate (at reference temperature) (1/(kmol O2/m3 s))
-
- integer(3)
- diabgc
- diabgc
+
+ real
+ bgcparams
+ bgcparams
- 0,2,2
- 4,2,2
- 0,0,0
+ None
- Nitrate (no3) [mol N m-3]
+ Sediment: opal dissolution rate (1/(kmol Si(OH)4/m3 s))
-
- integer(3)
- diabgc
- diabgc
+
+ real
+ bgcparams
+ bgcparams
- 4,2,2
- 4,2,2
- 0,0,0
+ None
- Natural alkalinity (nattalk) [eq m-3]
+ Sediment: CaCO3 dissolution rate (1/(kmol CO3--/m3 s))
-
- integer(3)
- diabgc
- diabgc
+
+ real
+ bgcparams
+ bgcparams
- 0,2,2
- 4,2,2
- 0,0,0
+ None
- add desc
+ SEDIMENT: Maximum growth rate denitrification on NO3 at reference T (1/d)
-
- integer(3)
- diabgc
- diabgc
+
+ real
+ bgcparams
+ bgcparams
- 4,2,2
- 4,2,2
- 0,0,0
+ None
- Dissolved carbon (dissic) [mol C m-3]
+ SEDIMENT: Maximum growth rate for anammox at reference T (1/d)
-
- integer(3)
- diabgc
- diabgc
+
+ real
+ bgcparams
+ bgcparams
- 4,2,2
- 4,2,2
- 0,0,0
+ None
- Phytoplankton (phyc) [mol C m-3]
+ SEDIMENT: Maximum growth rate denitrification on NO2 at reference T (1/d)
-
- integer(3)
- diabgc
- diabgc
+
+ real
+ bgcparams
+ bgcparams
- 0,2,2
- 4,2,2
- 0,0,0
+ None
- pH (ph) [-log10([h+])]
+ SEDIMENT: Maximum growth rate denitrification on N2O at reference T (1/d)
-
- integer(3)
- diabgc
- diabgc
+
+ real
+ bgcparams
+ bgcparams
- 0,2,2
- 4,2,2
- 0,0,0
+ None
- Export production (epc100) [mol C m-2 s-1]
+ SEDIMENT: Maximum growth rate DNRA on NO2 at reference T (1/d)
-
- integer(3)
- diabgc
- diabgc
+
+ real
+ bgcparams
+ bgcparams
- 0,2,2
- 4,2,2
- 0,0,0
+ None
- Si export production (epsi100) [mol Si m-2 s-1]
+ SEDIMENT: Maximum growth rate nitrification on NH4 at reference T (1/d)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ SEDIMENT: Maximum growth rate nitrification on NO2 at reference T (1/d)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Q10 factor for denitrification on NO3 (-)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Shape factor for NO3 denitrification oxygen inhibition function (m3/kmol)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Half-saturation constant for NO3 denitrification (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Q10 factor for anammox (-)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Shape factor for anammox oxygen inhibition function (m3/kmol)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: half saturation constant for O2 limitatio of ammonification in sediment (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Anammox half-saturation constant for oxygen inhibition function (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Anammox half-saturation constant for NO2 limitation (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Q10 factor for denitrification on NO2 (-)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Half-saturation constant for (quadratic) oxygen inhibition function of denitrification on NO2 (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Half-saturation constant for denitrification on NO2 (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Q10 factor for denitrificationj on N2O (-)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Half-saturation constant for (quadratic) oxygen inhibition function of denitrification on N2O (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Half-saturation constant for denitrification on N2O (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Q10 factor for DNRA on NO2 (-)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Half saturation constant for (quadratic) oxygen inhibition function of DNRA on NO2 (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Half-saturation constant for DNRA on NO2 (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Q10 factor for nitrification on NH4 (-)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Half-saturation constant for oxygen limitation of nitrification on NH4 (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Half-saturation constant for nitrification on NH4 (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Q10 factor for nitrification on NO2 (-)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Half-saturation constant for oxygen limitation of nitrification on NO2 (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Sediment: Half-saturation constant for NO2 for nitrification on NO2 (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ atmosphere ammonia mixing ratio (ppt)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ atmosphere laughing gas mixing ratio (ppt)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Half-saturation constant for PO4 uptake by bulk phytoplankton (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Q10 factor for denitrification on NO3 (-)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Shape factor for NO3 denitrification oxygen inhibition function (m3/kmol)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Half-saturation constant for NO3 denitrification (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Q10 factor for anammox (-)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Shape factor for anammox oxygen inhibition function (m3/kmol)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Half-saturation constant for oxygen inhibition function (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Half-saturation constant for NO2 limitation (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Q10 factor for denitrification on NO2 (-)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Half-saturation constant for (quadratic) oxygen inhibition function of denitrification on NO2 (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Half-saturation constant for denitrification on NO2 (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Q10 factor for denitrificationj on N2O (-)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Half-saturation constant for (quadratic) oxygen inhibition function of denitrification on N2O (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Half-saturation constant for denitrification on N2O (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Q10 factor for DNRA on NO2 (-)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Half saturation constant for (quadratic) oxygen inhibition function of DNRA on NO2 (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Half-saturation constant for DNRA on NO2 (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Q10 factor for nitrification on NH4 (-)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Half-saturation constant for oxygen limitation of nitrification on NH4 (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Half-saturation constant for nitrification on NH4 (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Q10 factor for nitrification on NO2 (-)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Half-saturation constant for oxygen limitation of nitrification on NO2 (kmol/m3)
+
+
+
+ real
+ bgcparams
+ bgcparams
+
+ None
+
+ Half-saturation constant for NO2 for nitrification on NO2 (kmol/m3)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ char(3)
+ diabgc
+ diabgc
+
+ 'hbgcd','hbgcm','hbgcy'
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 1,30,365
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 30,30,365
+ 1,30,365
+ 0,0,0
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,0
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,0
+ 1,1,1
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,1,0
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Phosphorus (po4) [mol P m-3]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Oxygen (o2) [mol O2 m-3]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Dissolved iron (dfe) [mol Fe m-3]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Nitrate (no3) [mol N m-3]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Surface nitrite concentration [mol NO2 m-3] - extended N cycle only
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Surface ammonium concentration [mol NH4 m-3] - extended N cycle only
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 4,2,2
+ 4,2,2
+ 0,0,0
+
+ Natural alkalinity (nattalk) [eq m-3]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 4,2,2
+ 4,2,2
+ 0,0,0
+
+ Dissolved carbon (dissic) [mol C m-3]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 4,2,2
+ 4,2,2
+ 0,0,0
+
+ Phytoplankton (phyc) [mol C m-3]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ pH (ph) [-log10([h+])]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Export production (epc100) [mol C m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Si export production (epsi100) [mol Si m-2 s-1]
@@ -4494,10 +5243,694 @@
4,2,2
0,0,0
- Ca export production (epcalc100) [mol Ca m-2 s-1]
+ Ca export production (epcalc100) [mol Ca m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Piston velocity (kwco2) [m s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Piston velocity times solubility (kwco2*kh; moist air) [m s-1 mol kg-1 uatm-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Piston velocity times solubility (kwco2*kh; moist air) [m s-1 mol kg-1 uatm-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ CO2 solubility under moist air assumption (kh) [mol kg-1 atm-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Natural surface PCO2 (spco2) [uatm]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Surface PCO2 under moist air assumption [uatm]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 4,2,2
+ 4,2,2
+ 0,0,0
+
+ Downward CO2 flux (co2fxd) [kg C m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 4,2,2
+ 4,2,2
+ 0,0,0
+
+ Upward CO2 flux (co2fxu) [kg C m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Oxygen flux (fgo2) [mol O2 m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Nitrogen flux (fgn2) [mol N2 m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Surface pN2O under moist air [uatm]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Nitrous oxide flux [mol N2O m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Surface pNH3 under moist air [natm]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Ammonia flux [mol NH3 m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ DMS flux (dmsflux) [mol DMS m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ surface DMS concentration (dms) [mol DMS m-3]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ DMS production (dmsprod) [mol DMS m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ DMS bacterial consuption (dms_bac) [mol DMS m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ DMS decomposition by UV (dms_uv) [mol DMS m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Atmospheric CO2 (atmco2) [ppm]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Atmospheric O2 (atmo2) [ppm]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Atmospheric N2 (atmn2) [ppm]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Atmospheric NH3 [ppt]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Atmospheric N2O [ppt]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Natural dissolved carbon (natdissic) [mol C m-3]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Natural alkalinity (nattalk) [eq m-3]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Natural pH (natph) [-log10([h+])]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Natural surface PCO2 (spco2) [uatm]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Natural net CO2 flux (natco2fx) [kg C m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 0,2,2
+ 0,0,0
+
+ Downward 13CO2 flux (co213fxd) [kg C m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 0,2,2
+ 0,0,0
+
+ Upward 13CO2 flux (co213fxu) [kg C m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Downward 14CO2 flux (co214fxd) [kg C m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Upward 14CO2 flux (co214fxu) [kg C m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ CFC11 flux [mol CFC11 m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ CFC12 flux [mol CFC12 m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ SF6 flux [mol SF6 m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ Atmospheric bromoform [ppt]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 4,2,2
+ 4,2,2
+ 0,0,0
+
+ Primary production (pp) [mol C m-3 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Vertically integrated nitrogen fixation
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ Vertically integrated denitrification
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,0
+ 0,2,2
+ 4,2,2
+
+ NOy nitrogen deposition flux [mol N m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,0
+ 0,2,2
+ 4,2,2
+
+ NHx nitrogen deposition flux [mol N m-2 s-1] - extended N cycle only
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,0
+ 0,0,0
+ 0,0,0
+
+ AMELIST FOR DIAGNOSTIC iHAMOCC OUTPUT
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,2,2
+ 4,2,2
+ 0,0,0
+
+ add desc
-
+
integer(3)
diabgc
diabgc
@@ -4506,10 +5939,10 @@
4,2,2
0,0,0
- Piston velocity (kwco2) [m s-1]
+ add desc
-
+
integer(3)
diabgc
diabgc
@@ -4518,10 +5951,10 @@
4,2,2
0,0,0
- Piston velocity times solubility (kwco2*kh; moist air) [m s-1 mol kg-1 uatm-1]
+ add desc
-
+
integer(3)
diabgc
diabgc
@@ -4530,10 +5963,10 @@
4,2,2
0,0,0
- Piston velocity times solubility (kwco2*kh; moist air) [m s-1 mol kg-1 uatm-1]
+ add desc
-
+
integer(3)
diabgc
diabgc
@@ -4542,10 +5975,10 @@
4,2,2
0,0,0
- CO2 solubility under moist air assumption (kh) [mol kg-1 atm-1]
+ add desc
-
+
integer(3)
diabgc
diabgc
@@ -4554,10 +5987,10 @@
4,2,2
0,0,0
- Natural surface PCO2 (spco2) [uatm]
+ add desc
-
+
integer(3)
diabgc
diabgc
@@ -4566,58 +5999,58 @@
4,2,2
0,0,0
- Surface PCO2 under moist air assumption [uatm]
+ add desc
-
+
integer(3)
diabgc
diabgc
- 4,2,2
+ 0,2,2
4,2,2
0,0,0
- Downward CO2 flux (co2fxd) [kg C m-2 s-1]
+ add desc
-
+
integer(3)
diabgc
diabgc
- 4,2,2
+ 0,2,2
4,2,2
0,0,0
- Upward CO2 flux (co2fxu) [kg C m-2 s-1]
+ add desc
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- Oxygen flux (fgo2) [mol O2 m-2 s-1]
+ add desc
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- Nitrogen flux (fgn2) [mol N2 m-2 s-1]
+ add desc
-
+
integer(3)
diabgc
diabgc
@@ -4626,1196 +6059,1304 @@
4,2,2
0,0,0
- Nitrous oxide flux [mol N2O m-2 s-1]
+ add desc
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- DMS flux (dmsflux) [mol DMS m-2 s-1]
+ add desc
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- surface DMS concentration (dms) [mol DMS m-3]
+ Phosphorus (po4) [mol P m-3]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,4
+ 4,0,4
+ 0,0,0
+
+ Oxygen (o2) [mol O2 m-3]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 2,0,2
+ 0,0,0
+
+ Dissolved iron (dfe) [mol Fe m-3]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 2,0,2
+ 0,0,0
+
+ add desc
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
4,2,2
0,0,0
- DMS production (dmsprod) [mol DMS m-2 s-1]
+ Nitrite concentration [mol NO2 m-3] - extended N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- DMS bacterial consuption (dms_bac) [mol DMS m-2 s-1]
+ Ammonium concentration [mol NH4 m-3] - extended N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- DMS decomposition by UV (dms_uv) [mol DMS m-2 s-1]
+ nitrification rate on NH4 [mol NH4 m-3 s-1] - extended N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- Atmospheric CO2 (atmco2) [ppm]
+ nitrification rate on NO2 [mol NO2 m-3 s-1] - extended N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- Atmospheric O2 (atmo2) [ppm]
+ N2O production rate during nitrification on NH4 [mol N2O m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- Atmospheric N2 (atmn2) [ppm]
+ detritus production during nitrification on NH4 [mol P m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- Natural dissolved carbon (natdissic) [mol C m-3]
+ detritus production during nitrification on NO2 [mol P m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- Natural alkalinity (nattalk) [eq m-3]
+ denitrification rate on NO3 [mol NO3 m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- Natural pH (natph) [-log10([h+])]
+ denitrification rate on NO2 [mol NO2 m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- Natural surface PCO2 (spco2) [uatm]
+ denitrification rate on N20 [mol N20 m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- Natural net CO2 flux (natco2fx) [kg C m-2 s-1]
+ DNRA on NO2 [mol NO2 m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 0,2,2
+ 0,0,2
+ 4,2,2
0,0,0
- Downward 13CO2 flux (co213fxd) [kg C m-2 s-1]
+ anammox N2 production [mol N2 m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 0,2,2
+ 0,0,2
+ 4,2,2
0,0,0
- Upward 13CO2 flux (co213fxu) [kg C m-2 s-1]
+ anammox detritus production [mol P m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- Downward 14CO2 flux (co214fxd) [kg C m-2 s-1]
+ PP consumption of NH4 [mol NH4 m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- Upward 14CO2 flux (co214fxu) [kg C m-2 s-1]
+ PP consumption of NH4 [mol NH4 m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- CFC11 flux [mol CFC11 m-2 s-1]
+ aerob remineralization rate (sev. sources) [mol NH4 m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- CFC12 flux [mol CFC12 m-2 s-1]
+ sulfate-based remin rate on det [mol P m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- SF6 flux [mol SF6 m-2 s-1]
+ M4AGO aggregate mean settling velocity [m/d]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- add desc
+ molecular dynamic viscosity of sea water [kg m-1 s-1]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- add desc
+ stickiness of opal frustule [-]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- add desc
+ stickiness of opal frustule [-]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- add desc
+ maximum aggregate diameter [m]
-
+
integer(3)
diabgc
diabgc
- 4,2,2
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ mean primary particle diameter [m]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ mean primary particle density [kg/m3]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ concentration weighted mean diameter of aggregates [m]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ fractal dimension of aggregates [-]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ slope of aggregate number distribution [-]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ Volume-weighted mean aggregate density [kg m-3]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
4,2,2
0,0,0
- Primary production (pp) [mol C m-3 s-1]
+ Volume-weighted mean aggregate porosity [-]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,2
+ 2,0,2
0,0,0
- Vertically integrated nitrogen fixation
+ add desc
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,2
+ 2,0,2
0,0,0
- Vertically integrated denitrification
+ add desc
-
+
integer(3)
diabgc
diabgc
- 0,0,0
- 0,2,2
- 4,2,2
+ 0,0,2
+ 2,0,2
+ 0,0,0
- Nitrogen deposition flux [mol N m-2 s-1]
+ add desc
-
+
integer(3)
diabgc
diabgc
- 0,0,0
- 0,0,0
+ 0,0,2
+ 2,0,2
0,0,0
- AMELIST FOR DIAGNOSTIC iHAMOCC OUTPUT
+ add desc
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,2
+ 2,0,2
0,0,0
- add desc
+ CaCO3 shells (calc) [mol C m-3]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,2
+ 2,0,2
0,0,0
- add desc
+ Opal shells (opal) [mol Si m-3]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,2
+ 2,0,2
0,0,0
- add desc
+ Carbonate ions (co3) [mol C m-3]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,0
+ 0,0,0
0,0,0
- add desc
+ Nitrous oxide concentration [mol N2O m-3]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,2
+ 2,0,2
0,0,0
add desc
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,2
+ 2,0,2
0,0,0
- add desc
+ Calcite saturation state (omegac) [1]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,2
+ 2,0,2
0,0,0
- add desc
+ Natural aragonite saturation state (natomegaa) [1]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,4
+ 4,0,4
0,0,0
- add desc
+ preformed oxygen (p_o2) [mol O2 m-3]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,4
+ 4,0,4
0,0,0
- add desc
+ Saturated oxygen (satoxy) [mol O2 m-3]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,2
+ 2,0,2
0,0,0
add desc
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,4
4,2,2
0,0,0
- add desc
+ Pre-formed silica [mol m-3]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,2
+ 2,0,2
0,0,0
- add desc
+ preformed alkalinity (p_talk) [eq m-3]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,2
+ 2,0,2
0,0,0
- add desc
+ preformed DIC (p_dic) [mol C m-3]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,2
+ 2,0,2
0,0,0
- add desc
+ saturated DIC (dic_sat) [mol C m-3]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,2
+ 2,0,2
0,0,0
- add desc
+ Natural dissolved carbon (natdissic) [mol C m-3]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,2
+ 2,0,2
0,0,0
- add desc
+ Natural alkalinity (nattalk) [eq m-3]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,2
+ 2,0,2
0,0,0
- add desc
+ Natural carbonate ion concentration (natco3) [mol C m-3]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 4,2,2
+ 0,0,2
+ 2,0,2
0,0,0
- add desc
+ Natural CaCO3 shells (natcalc) [mol C m-3]
-
+
integer(3)
diabgc
diabgc
0,0,2
- 4,2,2
+ 2,0,2
0,0,0
- add desc
+ Natural pH (natph) [-log10([h+])]
-
+
integer(3)
diabgc
diabgc
0,0,2
- 4,2,2
+ 2,0,2
0,0,0
- add desc
+ Natural calcite saturation state (natomegac) [1]
-
+
integer(3)
diabgc
diabgc
0,0,2
- 4,2,2
+ 2,0,2
0,0,0
- add desc
+ Natural aragonite saturation state (natomegaa) [1]
-
+
integer(3)
diabgc
diabgc
0,0,2
- 4,2,2
+ 2,0,2
0,0,0
- add desc
+ Dissolved C13 (dissic13) [mol C m-3]
-
+
integer(3)
diabgc
diabgc
0,0,2
- 4,2,2
+ 2,0,2
0,0,0
- Phosphorus (po4) [mol P m-3]
+ Dissolved C14 (dissic14) [mol C m-3]
-
+
integer(3)
diabgc
diabgc
- 0,0,4
- 4,0,4
+ 0,0,2
+ 0,0,2
0,0,0
- Oxygen (o2) [mol O2 m-3]
+ at-depth variable sediment porosity (as opposed to default: only depth)
-
+
integer(3)
diabgc
diabgc
0,0,2
- 2,0,2
+ 0,0,2
0,0,0
- Dissolved iron (dfe) [mol Fe m-3]
+ delta 14C of DIC [1]
-
+
integer(3)
diabgc
diabgc
0,0,2
- 2,0,2
+ 0,0,2
0,0,0
- add desc
+ Delta 14C of DIC [1]
-
+
integer(3)
diabgc
diabgc
0,0,2
- 2,0,2
+ 0,0,2
0,0,0
- add desc
+ Particulate organic carbon 13 (detoc13) [mol C m-3]
-
+
integer(3)
diabgc
diabgc
0,0,2
- 2,0,2
+ 0,0,2
0,0,0
- add desc
+ Dissolved organic carbon 13 (dissoc13) [mol C m-3]
-
+
integer(3)
diabgc
diabgc
0,0,2
- 2,0,2
+ 0,0,2
0,0,0
- add desc
+ Particulate inorganic carbon 13 (calc13) [mol C m-3]
-
+
integer(3)
diabgc
diabgc
0,0,2
- 2,0,2
+ 0,0,2
0,0,0
- add desc
+ 13C of phytoplankton biomass (phyc13) [mol C m-3]
-
+
integer(3)
diabgc
diabgc
0,0,2
- 2,0,2
+ 0,0,2
0,0,0
- CaCO3 shells (calc) [mol C m-3]
+ 13C of zootoplankton biomass (zooc13) [mol C m-3]
-
+
integer(3)
diabgc
diabgc
0,0,2
- 2,0,2
+ 0,0,2
0,0,0
- Opal shells (opal) [mol Si m-3]
+ CFC11 concentration [mol CFC11 m-3]
-
+
integer(3)
diabgc
diabgc
0,0,2
- 2,0,2
+ 0,0,2
0,0,0
- Carbonate ions (co3) [mol C m-3]
+ CFC12 concentration [mol CFC12 m-3]
-
+
integer(3)
diabgc
diabgc
- 0,0,0
- 0,0,0
+ 0,0,2
+ 0,0,2
0,0,0
- Nitrous oxide concentration [mol N2O m-3]
+ SF6 concentration [mol SF6 m-3]
-
+
integer(3)
diabgc
diabgc
0,0,2
- 2,0,2
+ 0,0,2
0,0,0
- add desc
+ index of point diagnostics (i)
-
+
integer(3)
diabgc
diabgc
0,0,2
- 2,0,2
+ 0,0,2
0,0,0
- Calcite saturation state (omegac) [1]
+ Mass sinking velocity (aggregate scheme) [m d-1]
-
+
integer(3)
diabgc
diabgc
0,0,2
- 2,0,2
+ 0,0,2
0,0,0
- Natural aragonite saturation state (natomegaa) [1]
+ Number sinking velocity (aggregate scheme) [m d-1]
-
+
integer(3)
diabgc
diabgc
- 0,0,4
- 4,0,4
+ 0,0,0
+ 0,0,0
0,0,0
- preformed oxygen (p_o2) [mol O2 m-3]
+ Epsilon exponent (aggregate scheme) [1]
-
+
integer(3)
diabgc
diabgc
- 0,0,4
- 4,0,4
+ 0,0,0
+ 0,0,0
0,0,0
- Saturated oxygen (satoxy) [mol O2 m-3]
+ Average particle size (aggregate scheme)
-
+
integer(3)
diabgc
diabgc
0,0,2
- 2,0,2
- 0,0,0
add desc
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 2,0,2
+ 0,2,2
+ 0,2,2
0,0,0
- preformed alkalinity (p_talk) [eq m-3]
+ add desc
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 2,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- preformed DIC (p_dic) [mol C m-3]
+ Phytoplankton (phyc) [mol C m-3]
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 2,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- saturated DIC (dic_sat) [mol C m-3]
+ Zooplankton (zooc) [mol C m-3]
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 2,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- Natural dissolved carbon (natdissic) [mol C m-3]
+ Dissolved organic carbon (dissoc) [mol C m-3]
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 2,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- Natural alkalinity (nattalk) [eq m-3]
+ Primary production (pp) [mol C m-3 s-1]
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 2,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- Natural carbonate ion concentration (natco3) [mol C m-3]
+ Phosphorus (po4) [mol P m-3]
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 2,0,2
+ 0,4,4
+ 4,4,4
0,0,0
- Natural CaCO3 shells (natcalc) [mol C m-3]
+ Oxygen (o2) [mol O2 m-3]
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 2,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- Natural pH (natph) [-log10([h+])]
+ eposition
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 2,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- Natural calcite saturation state (natomegac) [1]
+ Nitrate (no3) [mol N m-3]
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 2,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- Natural aragonite saturation state (natomegaa) [1]
+ Nitrite concentration [mol NO2 m-3] - extended N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 2,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- Dissolved C13 (dissic13) [mol C m-3]
+ Ammonium concentration [mol NH4 m-3] - extended N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 2,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- Dissolved C14 (dissic14) [mol C m-3]
+ nitrification rate on NH4 [mol NH4 m-3 s-1] - extended N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 0,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- at-depth variable sediment porosity (as opposed to default: only depth)
+ nitrification rate on NO2 [mol NO2 m-3 s-1] - extended N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 0,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- delta 14C of DIC [1]
+ N2O production rate during nitrification on NH4 [mol N2O m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 0,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- Delta 14C of DIC [1]
+ detritus production during nitrification on NH4 [mol P m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 0,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- Particulate organic carbon 13 (detoc13) [mol C m-3]
+ detritus production during nitrification on NO2 [mol P m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 0,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- Dissolved organic carbon 13 (dissoc13) [mol C m-3]
+ denitrification rate on NO3 [mol NO3 m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 0,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- Particulate inorganic carbon 13 (calc13) [mol C m-3]
+ denitrification rate on NO2 [mol NO2 m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 0,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- 13C of phytoplankton biomass (phyc13) [mol C m-3]
+ denitrification rate on N20 [mol N20 m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 0,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- 13C of zootoplankton biomass (zooc13) [mol C m-3]
+ DNRA on NO2 [mol NO2 m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 0,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- CFC11 concentration [mol CFC11 m-3]
+ anammox N2 production [mol N2 m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 0,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- CFC12 concentration [mol CFC12 m-3]
+ anammox detritus production [mol P m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 0,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- SF6 concentration [mol SF6 m-3]
+ PP consumption of NH4 [mol NH4 m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 0,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- index of point diagnostics (i)
+ PP consumption of NH4 [mol NH4 m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 0,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- Mass sinking velocity (aggregate scheme) [m d-1]
+ aerob remineralization rate (sev. sources) [mol NH4 m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,0,2
- 0,0,2
+ 0,2,2
+ 4,2,2
0,0,0
- Number sinking velocity (aggregate scheme) [m d-1]
+ sulfate-based remin rate on det [mol P m-3 s-1] - ext. N cycle only
-
+
integer(3)
diabgc
diabgc
- 0,0,0
- 0,0,0
+ 0,2,2
+ 4,2,2
0,0,0
- Epsilon exponent (aggregate scheme) [1]
+ M4AGO aggregate mean settling velocity [m/d]
-
+
integer(3)
diabgc
diabgc
- 0,0,0
- 0,0,0
+ 0,2,2
+ 4,2,2
0,0,0
- Average particle size (aggregate scheme)
+ molecular dynamic viscosity of sea water [kg m-1 s-1]
-
+
integer(3)
diabgc
diabgc
0,0,2
+ 4,2,2
+ 0,0,0
- add desc
+ stickiness of opal frustule [-]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
- 0,2,2
+ 0,0,2
+ 4,2,2
0,0,0
- add desc
+ stickiness of opal frustule [-]
-
+
integer(3)
diabgc
diabgc
@@ -5824,10 +7365,10 @@
4,2,2
0,0,0
- Phytoplankton (phyc) [mol C m-3]
+ maximum aggregate diameter [m]
-
+
integer(3)
diabgc
diabgc
@@ -5836,10 +7377,10 @@
4,2,2
0,0,0
- Zooplankton (zooc) [mol C m-3]
+ mean primary particle diameter [m]
-
+
integer(3)
diabgc
diabgc
@@ -5848,22 +7389,22 @@
4,2,2
0,0,0
- Dissolved organic carbon (dissoc) [mol C m-3]
+ mean primary particle density [kg/m3]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- Primary production (pp) [mol C m-3 s-1]
+ concentration weighted mean diameter of aggregates [m]
-
+
integer(3)
diabgc
diabgc
@@ -5872,22 +7413,22 @@
4,2,2
0,0,0
- Phosphorus (po4) [mol P m-3]
+ fractal dimension of aggregates [-]
-
+
integer(3)
diabgc
diabgc
- 0,4,4
- 4,4,4
+ 0,2,2
+ 4,2,2
0,0,0
- Oxygen (o2) [mol O2 m-3]
+ slope of aggregate number distribution [-]
-
+
integer(3)
diabgc
diabgc
@@ -5896,19 +7437,19 @@
4,2,2
0,0,0
- eposition
+ Volume-weighted mean aggregate density [kg m-3]
-
+
integer(3)
diabgc
diabgc
- 0,2,2
+ 0,0,2
4,2,2
0,0,0
- Nitrate (no3) [mol N m-3]
+ Volume-weighted mean aggregate porosity [-]
@@ -6077,6 +7618,18 @@
preformed phosphate (p_po4) [mol PO4 m-3]
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,4,4
+ 4,2,2
+ 0,0,0
+
+ Pre-formed silica [mol m-3]
+
+
integer(3)
diabgc
@@ -6473,6 +8026,42 @@
sediment - water-column diffusive flux of nitrate [mol NO3 m-2 s-1]
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ Sediment - water-column diffusive flux of ammonium [mol NH4 m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ Sediment - water-column diffusive flux of N2O [mol N2O m-2 s-1]
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ Sediment - water-column diffusive flux of nitrite [mol NO2 m-2 s-1]
+
+
integer(3)
diabgc
@@ -6485,6 +8074,54 @@
sediment - water-column diffusive flux of silica [mol Si m-2 s-1]
+
+
+
+
+
+
+
+
integer(3)
diabgc
@@ -6557,6 +8194,198 @@
(powno3)[mol N m-3]
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ (pownh4) [mol NH4 m-3] - extended N cycle only
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ (pown2o) [mol N2O m-3] - extended N cycle only
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ (powno2) [mol NO2 m-3] - extended N cycle only
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ nitrification rate on NH4 [mol NH4 m-3 s-1] - extended N cycle only
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ nitrification rate on NO2 [mol NO2 m-3 s-1] - extended N cycle only
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ N2O production rate during nitrification on NH4 [mol N2O m-3 s-1] - ext. N cycle only
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ detritus production during nitrification on NH4 [mol P m-3 s-1] - ext. N cycle only
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ detritus production during nitrification on NO2 [mol P m-3 s-1] - ext. N cycle only
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ denitrification rate on NO3 [mol NO3 m-3 s-1] - ext. N cycle only
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ denitrification rate on NO2 [mol NO2 m-3 s-1] - ext. N cycle only
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ denitrification rate on N20 [mol N20 m-3 s-1] - ext. N cycle only
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ DNRA on NO2 [mol NO2 m-3 s-1] - ext. N cycle only
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ anammox N2 production [mol N2 m-3 s-1] - ext. N cycle only
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ anammox detritus production [mol P m-3 s-1] - ext. N cycle only
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ aerob remineralization rate (sev. sources) [mol NH4 m-3 s-1] - ext. N cycle only
+
+
+
+ integer(3)
+ diabgc
+ diabgc
+
+ 0,0,2
+ 4,2,2
+ 0,0,0
+
+ sulfate-based remin rate on det [mol P m-3 s-1] - ext. N cycle only
+
+
integer(3)
diabgc
diff --git a/cime_config/ocn_in.readme b/cime_config/ocn_in.readme
index d288c614..891e8785 100644
--- a/cime_config/ocn_in.readme
+++ b/cime_config/ocn_in.readme
@@ -363,7 +363,9 @@
! DO_RIVINPT : Logical switch to activate riverine input
! RIVINFILE : File name (incl. full path) for riverine input data
! DO_NDEP : Logical switch to activate N-deposition
+! DO_NDEP_COUPLED: Logical to apply N-deposition fluxes received from the atmosphere (true=atm, false=clim), requires DO_NDEP=TRUE
! NDEPFILE : File name (incl. full path) for atmopheric N-deposition data
+! DO_N2ONH3_COUPLED: Logical switch for interactive coupling of N2O and NH3 fluxes (true=atm, false=fix atmospheric value)
! DO_SEDSPINUP: Logical switch to activate sediment spin-up
! SEDSPIN_YR_S: Start year for sediment spinup
! SEDSPIN_YR_E: End year for sediment spinup
@@ -372,6 +374,8 @@
! OXY, NO3, SIL, D13C, and D14C
! WITH_DMSPH : Logical switch to activate DMS calculation as function of pH
! PI_PH_FILE : File name (incl. full path) for surface PI pH input data.
+! use_M4AGO : Switch for M4AGO settling scheme
+! LEUPHOTIC_CYA : Switch to perform bluefix (cyanobacteria) only in the euphotic zone
! L_3DVARSEDPOR : Logical switch to enable lon-lat-depth variable sediment porosity (as opposed to default: only depth)
! SEDPORFILE : File name (incl. full path) for sediment porosity
!
@@ -400,7 +404,7 @@
! Namelist acronyms:
! GLB_ - global parameters i.e. valid for entire output group
! SRF_ - surface variables (includes some non-surface 2d fields)
-! FLX_ - interior ocean particle fuxes at different depth (2d)
+! FLX_ - (interior) ocean (particle) fluxes at different depth (2d)
! INT_ - vertically integrated fields (2d)
! LYR_ - 3d fields with sigma layers as vertical coordinate
! LVL_ - 3d fields with levitus levels as vertical coordinate
@@ -433,6 +437,8 @@
! ALKALI - Alkalinity (talk) [eq m-3]
! OXYGEN - Oxygen (o2) [mol O2 m-3]
! ANO3 - Nitrate (no3) [mol N m-3]
+! ANO2 - Nitrite (no2) [mol N m-3] - extended N cycle only
+! ANH4 - Ammonium (nh4) [mol N m-3] - extended N cycle only
! PHOSPH - Phosphorus (po4) [mol P m-3]
! IRON - Dissolved iron (dfe) [mol Fe m-3]
! SILICA - Silicate (si) [mol Si m-3]
@@ -447,6 +453,7 @@
! PREFO2 - preformed oxygen (p_o2) [mol O2 m-3]
! O2SAT - Saturated oxygen (satoxy) [mol O2 m-3]
! PREFPO4 - preformed phosphate (p_po4) [mol PO4 m-3]
+! PREFSILICA - preformed silica (p_si) [mol Si m-3]
! PREFALK - preformed alkalinity (p_talk) [eq m-3]
! PREFDIC - preformed DIC (p_dic) [mol C m-3]
! DICSAT - saturated DIC (dic_sat) [mol C m-3]
@@ -458,6 +465,33 @@
! PHOSY - Primary production (pp) [mol C m-3 s-1]
! CO3 - Carbonate ions (co3) [mol C m-3]
! N2O - Nitrous oxide concentration [mol N2O m-3]
+! NITR_NH4 - nitrification rate on NH4 [mol NH4 m-3 s-1] - extended N cycle only
+! NITR_NO2 - nitrification rate on NO2 [mol NO2 m-3 s-1] - extended N cycle only
+! NITR_N2O_PROD - N2O production rate during nitrification on NH4 [mol N2O m-3 s-1] - ext. N cycle only
+! NITR_NH4_OM - detritus production during nitrification on NH4 [mol P m-3 s-1] - ext. N cycle only
+! NITR_NO2_OM - detritus production during nitrification on NO2 [mol P m-3 s-1] - ext. N cycle only
+! DENIT_NO3 - denitrification rate on NO3 [mol NO3 m-3 s-1] - ext. N cycle only
+! DENIT_NO2 - denitrification rate on NO2 [mol NO2 m-3 s-1] - ext. N cycle only
+! DENIT_N2O - denitrification rate on N20 [mol N20 m-3 s-1] - ext. N cycle only
+! DNRA_NO2 - DNRA on NO2 [mol NO2 m-3 s-1] - ext. N cycle only
+! ANMX_N2_PROD - anammox N2 production [mol N2 m-3 s-1] - ext. N cycle only
+! ANMX_OM_PROD - anammox detritus production [mol P m-3 s-1] - ext. N cycle only
+! PHOSY_NH4 - PP consumption of NH4 [mol NH4 m-3 s-1] - ext. N cycle only
+! PHOSY_NO3 - PP consumption of NH4 [mol NH4 m-3 s-1] - ext. N cycle only
+! REMIN_AEROB - aerob remineralization rate (sev. sources) [mol NH4 m-3 s-1] - ext. N cycle only
+! REMIN_SULF - sulfate-based remin rate on det [mol P m-3 s-1] - ext. N cycle only
+! AGG_WS - M4AGO aggregate mean settling velocity [m/d]
+! DYNVIS - molecular dynamic viscosity of sea water [kg m-1 s-1]
+! AGG_STICK - mean stickiness of marine aggregates [-]
+! AGG_STICKF - stickiness of opal frustule [-]
+! AGG_DMAX - maximum aggregate diameter [m]
+! AGG_AVDP - mean primary particle diameter [m]
+! AGG_AVRHOP - mean primary particle density [kg/m3]
+! AGG_AVDC - concentration weighted mean diameter of aggregates [m]
+! AGG_DF - fractal dimension of aggregates [-]
+! AGG_B - slope of aggregate number distribution [-]
+! AGG_VRHOF - Volume-weighted mean aggregate density [kg m-3]
+! AGG_VPOR - Volume weighted mean aggregate porosity [-]
! OMEGAA - Aragonite saturation state (omegaa) [1]
! OMEGAC - Calcite saturation state (omegac) [1]
! NATDIC - Natural dissolved carbon (natdissic) [mol C m-3]
@@ -499,7 +533,13 @@
! CO2FXU - Upward CO2 flux (co2fxu) [kg C m-2 s-1]
! NIFLUX - Nitrogen flux (fgn2) [mol N2 m-2 s-1]
! OXFLUX - Oxygen flux (fgo2) [mol O2 m-2 s-1]
+! PN2OM - Surface pN2O under moist air [uatm]
! N2OFX - Nitrous oxide flux [mol N2O m-2 s-1]
+! PNH3 - Surface pNH3 under moist air [natm]
+! ANH3FX - Ammonia flux [mol NH3 m-2 s-1]
+! ATMNH3 - Atmospheric NH3 [ppt]
+! ATMN2O - Atmospheric N2O [ppt]
+! ATMBROMO - Atmospheric bromoform [ppt]
! DMSFLUX - DMS flux (dmsflux) [mol DMS m-2 s-1]
! DMS - surface DMS concentration (dms) [mol DMS m-3]
! DMSPROD - DMS production (dmsprod) [mol DMS m-2 s-1]
@@ -523,9 +563,11 @@
! NFIX - Vertically integrated nitrogen fixation
! DNIT - Vertically integrated denitrification
!
-! Particle fluxes (FLX, e.g CARFLX****, where ****=0100,0500,1000,2000,4000, or _BOT),
+!
+! Particle fluxes (FLX_, e.g FLX_CAR****, where ****=0100,0500,1000,2000,4000, or _BOT),
! diffusive fluxes at the sediment - water-column interface (SEDIFF*), and other fluxes
-! NDEP - Nitrogen deposition flux [mol N m-2 s-1]
+! NDEPNOY - Nitrogen deposition flux in form of nitrate [mol N m-2 s-1]
+! NDEPNHX - Nitrogen deposition flux in form of ammonium [mol N m-2 s-1]
! OALK - Flux of alkalinity due to ocean alkalinization [mol N m-2 s-1]
! CARFLX**** - POC flux at **** metres depth [mol C m-2 s-1]
! BSIFLX**** - Biogenic silica flux at **** metres depth [mol Si m-2 s-1]
@@ -536,7 +578,14 @@
! SEDIFFOX - sediment - water-column diffusive flux of oxygen [mol O2 m-2 s-1]
! SEDIFFN2 - sediment - water-column diffusive flux of N2 [mol N2 m-2 s-1]
! SEDIFFNO3 - sediment - water-column diffusive flux of nitrate [mol NO3 m-2 s-1]
+! SEDIFFNO2 - sediment - water-column diffusive flux of nitrite [mol NO2 m-2 s-1] - extended N cycle only
+! SEDIFFN2O - sediment - water-column diffusive flux of N2O [mol N2O m-2 s-1] - extended N cycle only
+! SEDIFFNH4 - sediment - water-column diffusive flux of ammonium [mol NH4 m-2 s-1] - extended N cycle only
! SEDIFFSI - sediment - water-column diffusive flux of silica [mol Si m-2 s-1]
+! BURSSO12 - burial fluxes organic carbon [mol P m-2 s-1]
+! BURSSSC12 - burial fluxes of calcium carbonate [mol Ca m-2 s-1]
+! BURSSSSIL - burial fluxes of silicate [mol Si m-2 s-1]
+! BURSSSTER - burial fluxes of clay [g m-2 s-1]
!
! Sediment fields (SDM)
! POWAIC - (powdic) [mol C m-3]
@@ -546,15 +595,33 @@
! POWN2 - (pown2) [mol N2 m-3]
! POWNO3 - (powno3)[mol N m-3]
! POWASI - (powsi) [mol Si m-3]
+! POWNH4 - (pownh4) [mol NH4 m-3] - extended N cycle only
+! POWN2O - (pown2o) [mol N2O m-3] - extended N cycle only
+! POWNO2 - (powno2) [mol NO2 m-3] - extended N cycle only
+! NITR_NH4 - nitrification rate on NH4 [mol NH4 m-3 s-1] - extended N cycle only
+! NITR_NO2 - nitrification rate on NO2 [mol NO2 m-3 s-1] - extended N cycle only
+! NITR_N2O_PROD - N2O production rate during nitrification on NH4 [mol N2O m-3 s-1] - ext. N cycle only
+! NITR_NH4_OM - detritus production during nitrification on NH4 [mol P m-3 s-1] - ext. N cycle only
+! NITR_NO2_OM - detritus production during nitrification on NO2 [mol P m-3 s-1] - ext. N cycle only
+! DENIT_NO3 - denitrification rate on NO3 [mol NO3 m-3 s-1] - ext. N cycle only
+! DENIT_NO2 - denitrification rate on NO2 [mol NO2 m-3 s-1] - ext. N cycle only
+! DENIT_N2O - denitrification rate on N20 [mol N20 m-3 s-1] - ext. N cycle only
+! DNRA_NO2 - DNRA on NO2 [mol NO2 m-3 s-1] - ext. N cycle only
+! ANMX_N2_PROD - anammox N2 production [mol N2 m-3 s-1] - ext. N cycle only
+! ANMX_OM_PROD - anammox detritus production [mol P m-3 s-1] - ext. N cycle only
+! PHOSY_NH4 - PP consumption of NH4 [mol NH4 m-3 s-1] - ext. N cycle only
+! PHOSY_NO3 - PP consumption of NH4 [mol NH4 m-3 s-1] - ext. N cycle only
+! REMIN_AEROB - aerob remineralization rate (sev. sources) [mol NH4 m-3 s-1] - ext. N cycle only
+! REMIN_SULF - sulfate-based remin rate on det [mol P m-3 s-1] - ext. N cycle only
! SSSO12 - (ssso12) [mol m-3]
! SSSSIL - (ssssil) [mol Si m-3]
! SSSC12 - (sssc12) [mol C m-3]
-! SSSTER - (ssster) [mol m-3]
+! SSSTER - (ssster) [kg m-3]
!
! Burial fields (BUR)
! SSSO12 - Solid sediment organic carbon [mol P m-2]
! SSSSIL - Solid sediment silica [mol Si m-2]
! SSSC12 - Solid sediment inorganic carbon [mol C m-2]
-! SSSTER -
+! SSSTER - Solid sediment mineral component [kg m-2]
!
!===========================================================================
diff --git a/drivers/mct/blom_cpl_indices.F90 b/drivers/mct/blom_cpl_indices.F90
index 1bd51032..d63d44f0 100644
--- a/drivers/mct/blom_cpl_indices.F90
+++ b/drivers/mct/blom_cpl_indices.F90
@@ -44,6 +44,8 @@ module blom_cpl_indices
integer :: index_o2x_Faoo_fco2_ocn
integer :: index_o2x_Faoo_fdms_ocn
integer :: index_o2x_Faoo_fbrf_ocn
+ integer :: index_o2x_Faoo_fn2o_ocn
+ integer :: index_o2x_Faoo_fnh3_ocn
! drv -> ocn
@@ -53,6 +55,8 @@ module blom_cpl_indices
integer :: index_x2o_Sa_co2prog ! bottom atm level prognostic CO2
integer :: index_x2o_Sa_co2diag ! bottom atm level diagnostic CO2
integer :: index_x2o_Sa_brfprog ! bottom atm level prognostic bromoform (ppt)
+ integer :: index_x2o_Sa_n2oprog ! bottom atm level prognostic nitrous oxide (ppt)
+ integer :: index_x2o_Sa_nh3prog ! bottom atm level prognostic ammonia (ppt)
integer :: index_x2o_Faxa_nhx ! nitrogen deposition (nhx) flux from atm (kgNm2/sec)
integer :: index_x2o_Faxa_noy ! nitrogen deposition (noy) flux from atm (kgNm2/sec)
@@ -129,6 +133,8 @@ subroutine blom_cpl_indices_set( )
index_o2x_Faoo_fco2_ocn = mct_avect_indexra(o2x,'Faoo_fco2_ocn',perrWith='quiet')
index_o2x_Faoo_fdms_ocn = mct_avect_indexra(o2x,'Faoo_fdms_ocn',perrWith='quiet')
index_o2x_Faoo_fbrf_ocn = mct_avect_indexra(o2x,'Faoo_fbrf_ocn',perrWith='quiet')
+ index_o2x_Faoo_fn2o_ocn = mct_avect_indexra(o2x,'Faoo_fn2o_ocn',perrWith='quiet')
+ index_o2x_Faoo_fnh3_ocn = mct_avect_indexra(o2x,'Faoo_fnh3_ocn',perrWith='quiet')
index_x2o_Si_ifrac = mct_avect_indexra(x2o,'Si_ifrac')
index_x2o_Sa_pslv = mct_avect_indexra(x2o,'Sa_pslv')
index_x2o_So_duu10n = mct_avect_indexra(x2o,'So_duu10n')
@@ -173,6 +179,8 @@ subroutine blom_cpl_indices_set( )
index_x2o_Sa_co2prog = mct_avect_indexra(x2o,'Sa_co2prog',perrWith='quiet')
index_x2o_Sa_co2diag = mct_avect_indexra(x2o,'Sa_co2diag',perrWith='quiet')
index_x2o_Sa_brfprog = mct_avect_indexra(x2o,'Sa_brfprog',perrWith='quiet')
+ index_x2o_Sa_n2oprog = mct_avect_indexra(x2o,'Sa_n2oprog',perrWith='quiet')
+ index_x2o_Sa_nh3prog = mct_avect_indexra(x2o,'Sa_nh3prog',perrWith='quiet')
index_x2o_Faxa_nhx = mct_avect_indexra(x2o,'Faxa_nhx',perrWith='quiet')
index_x2o_Faxa_noy = mct_avect_indexra(x2o,'Faxa_noy',perrWith='quiet')
diff --git a/drivers/mct/export_mct.F b/drivers/mct/export_mct.F
index cff6c4c2..fc807294 100644
--- a/drivers/mct/export_mct.F
+++ b/drivers/mct/export_mct.F
@@ -169,6 +169,43 @@ subroutine export_mct(o2x_o, lsize, perm, jjcpl, nsend, sbuff,
. write (lp,*) 'export_mct: bromoform flux not sent to coupler'
endif
+ ! ----------------------------------------------------------------
+ ! Pack nitrous oxide flux (kg N2O/m^2/s), if requested
+ ! ----------------------------------------------------------------
+
+ if (index_o2x_Faoo_fn2o_ocn > 0) then
+ n = 0
+ do j = 1, jjcpl
+ do i = 1, ii
+ n = n + 1
+ o2x_o%rAttr(index_o2x_Faoo_fn2o_ocn,n) =
+ . sbuff(i,j,index_o2x_Faoo_fn2o_ocn)*tfac
+ enddo
+ enddo
+ else
+ if (mnproc.eq.1)
+ . write (lp,*) 'export_mct: nitrous oxide flux not sent to coupler'
+ endif
+
+ ! ----------------------------------------------------------------
+ ! Pack ammonia flux (kg NH3/m^2/s), if requested
+ ! ----------------------------------------------------------------
+
+ if (index_o2x_Faoo_fnh3_ocn > 0) then
+ n = 0
+ do j = 1, jjcpl
+ do i = 1, ii
+ n = n + 1
+ o2x_o%rAttr(index_o2x_Faoo_fnh3_ocn,n) =
+ . sbuff(i,j,index_o2x_Faoo_fnh3_ocn)*tfac
+ enddo
+ enddo
+ else
+ if (mnproc.eq.1)
+ . write (lp,*) 'export_mct: ammonia flux not sent to coupler'
+ endif
+
+
tlast_coupled = 0._r8
!-----------------------------------------------------------------
diff --git a/drivers/mct/import_mct.F b/drivers/mct/import_mct.F
index e6b5c1b8..4f8a8635 100644
--- a/drivers/mct/import_mct.F
+++ b/drivers/mct/import_mct.F
@@ -30,7 +30,9 @@ subroutine import_mct(x2o_o, lsize, perm, jjcpl)
use mod_cesm, only: 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,
- . atmco2_da, atmbrf_da, ficem_da, l1ci, l2ci
+ . atmco2_da, atmbrf_da,atmn2o_da,atmnh3_da,
+ . atmnhxdep_da,atmnoydep_da,
+ . ficem_da, l1ci, l2ci
use mod_utility, only: util1, util2
use mod_checksum, only: csdiag, chksummsk
use blom_cpl_indices
@@ -341,6 +343,142 @@ subroutine import_mct(x2o_o, lsize, perm, jjcpl)
. write (lp,*) 'import_mct: prog. atmospheric bromoform not read'
endif
+
+ if (index_x2o_Sa_n2oprog > 0) then
+ n = 0
+ do j = 1, jjcpl
+ do i = 1, ii
+ n = n + 1
+ if (ip(i,j) == 0) then
+ atmn2o_da(i,j,l2ci) = mval
+ elseif (cplmsk(i,j) == 0) then
+ atmn2o_da(i,j,l2ci) = fval
+ else
+ ! Atmospheric nitrous oxide concentration [ppt]
+ atmn2o_da(i,j,l2ci) =
+ . x2o_o%rAttr(index_x2o_Sa_n2oprog,n)
+ endif
+ enddo
+ enddo
+ call fill_global(mval, fval, halo_ps,
+ . atmn2o_da(1-nbdy,1-nbdy,l2ci))
+ if (mnproc.eq.1)
+ . write (lp,*) 'import_mct: prog. atmospheric nitrous oxide read'
+ else
+ do j = 1, jj
+ do i = 1, ii
+ if (ip(i,j) == 0) then
+ atmn2o_da(i,j,l2ci) = mval
+ else
+ atmn2o_da(i,j,l2ci) = -1
+ endif
+ enddo
+ enddo
+ if (mnproc.eq.1)
+ . write (lp,*) 'import_mct: prog. atmospheric nitrous oxide not read'
+ endif
+
+ if (index_x2o_Sa_nh3prog > 0) then
+ n = 0
+ do j = 1, jjcpl
+ do i = 1, ii
+ n = n + 1
+ if (ip(i,j) == 0) then
+ atmnh3_da(i,j,l2ci) = mval
+ elseif (cplmsk(i,j) == 0) then
+ atmnh3_da(i,j,l2ci) = fval
+ else
+ ! Atmospheric nitrous oxide concentration [ppt]
+ atmnh3_da(i,j,l2ci) =
+ . x2o_o%rAttr(index_x2o_Sa_nh3prog,n)
+ endif
+ enddo
+ enddo
+ call fill_global(mval, fval, halo_ps,
+ . atmnh3_da(1-nbdy,1-nbdy,l2ci))
+ if (mnproc.eq.1)
+ . write (lp,*) 'import_mct: prog. atmospheric ammonia read'
+ else
+ do j = 1, jj
+ do i = 1, ii
+ if (ip(i,j) == 0) then
+ atmnh3_da(i,j,l2ci) = mval
+ else
+ atmnh3_da(i,j,l2ci) = -1
+ endif
+ enddo
+ enddo
+ if (mnproc.eq.1)
+ . write (lp,*) 'import_mct: prog. atmospheric ammonia not read'
+ endif
+ if (index_x2o_Faxa_nhx > 0) then
+ n = 0
+ do j = 1, jjcpl
+ do i = 1, ii
+ n = n + 1
+ if (ip(i,j) == 0) then
+ atmnhxdep_da(i,j,l2ci) = mval
+ elseif (cplmsk(i,j) == 0) then
+ atmnhxdep_da(i,j,l2ci) = fval
+ else
+ ! Atmospheric nhx deposition [kgN/m2/sec]
+ atmnhxdep_da(i,j,l2ci) =
+ . x2o_o%rAttr(index_x2o_Faxa_nhx,n)
+ endif
+ enddo
+ enddo
+ call fill_global(mval, fval, halo_ps,
+ . atmnhxdep_da(1-nbdy,1-nbdy,l2ci))
+ if (mnproc.eq.1)
+ . write (lp,*) 'import_mct: atmospheric nhx deposition read'
+ else
+ do j = 1, jj
+ do i = 1, ii
+ if (ip(i,j) == 0) then
+ atmnhxdep_da(i,j,l2ci) = mval
+ else
+ atmnhxdep_da(i,j,l2ci) = -1
+ endif
+ enddo
+ enddo
+ if (mnproc.eq.1)
+ . write (lp,*) 'import_mct: atmospheric nhx deposition not read'
+ endif
+ if (index_x2o_Faxa_noy > 0) then
+ n = 0
+ do j = 1, jjcpl
+ do i = 1, ii
+ n = n + 1
+ if (ip(i,j) == 0) then
+ atmnoydep_da(i,j,l2ci) = mval
+ elseif (cplmsk(i,j) == 0) then
+ atmnoydep_da(i,j,l2ci) = fval
+ else
+ ! Atmospheric noy deposition [kgN/m2/sec]
+ atmnoydep_da(i,j,l2ci) =
+ . x2o_o%rAttr(index_x2o_Faxa_noy,n)
+ endif
+ enddo
+ enddo
+ call fill_global(mval, fval, halo_ps,
+ . atmnoydep_da(1-nbdy,1-nbdy,l2ci))
+ if (mnproc.eq.1)
+ . write (lp,*) 'import_mct: atmospheric noy deposition read'
+ else
+ do j = 1, jj
+ do i = 1, ii
+ if (ip(i,j) == 0) then
+ atmnoydep_da(i,j,l2ci) = mval
+ else
+ atmnoydep_da(i,j,l2ci) = -1
+ endif
+ enddo
+ enddo
+ if (mnproc.eq.1)
+ . write (lp,*) 'import_mct: atmospheric noy deposition not read'
+ endif
+
+
if (csdiag) then
if (mnproc.eq.1) then
write (lp,*) 'import_mct:'
@@ -363,6 +501,10 @@ subroutine import_mct(x2o_o, lsize, perm, jjcpl)
call chksummsk(abswnd_da(1-nbdy,1-nbdy,l2ci),ip,1,'abswnd')
call chksummsk(atmco2_da(1-nbdy,1-nbdy,l2ci),ip,1,'atmco2')
call chksummsk(atmbrf_da(1-nbdy,1-nbdy,l2ci),ip,1,'atmbrf')
+ call chksummsk(atmn2o_da(1-nbdy,1-nbdy,l2ci),ip,1,'atmn2o')
+ call chksummsk(atmnh3_da(1-nbdy,1-nbdy,l2ci),ip,1,'atmnh3')
+ call chksummsk(atmnhxdep_da(1-nbdy,1-nbdy,l2ci),ip,1,'atmnhxdep')
+ call chksummsk(atmnoydep_da(1-nbdy,1-nbdy,l2ci),ip,1,'atmnoydep')
endif
end subroutine import_mct
diff --git a/drivers/mct/sumsbuff_mct.F b/drivers/mct/sumsbuff_mct.F
index 03cf099d..b7721f0f 100644
--- a/drivers/mct/sumsbuff_mct.F
+++ b/drivers/mct/sumsbuff_mct.F
@@ -27,7 +27,7 @@ subroutine sumsbuff_mct(nsend, sbuff, tlast_coupled)
use mod_grid, only: scuy, scvx, scuxi, scvyi
use mod_state, only: u, v, temp, saln, pbu, pbv, ubflxs, vbflxs,
. sealv
- use mod_forcing, only: flxco2, flxdms, flxbrf
+ use mod_forcing, only: flxco2, flxdms, flxbrf,flxn2o,flxnh3
use mod_cesm, only: frzpot
use blom_cpl_indices
@@ -153,6 +153,31 @@ subroutine sumsbuff_mct(nsend, sbuff, tlast_coupled)
enddo
endif
+ if (index_o2x_Faoo_fn2o_ocn > 0) then
+ do j = 1, jj
+ do l = 1, isp(j)
+ do i = max(1,ifp(j,l)), min(ii,ilp(j,l))
+ sbuff(i,j,index_o2x_Faoo_fn2o_ocn) =
+ . sbuff(i,j,index_o2x_Faoo_fn2o_ocn)
+ . + flxn2o(i,j)*baclin
+ enddo
+ enddo
+ enddo
+ endif
+
+ if (index_o2x_Faoo_fnh3_ocn > 0) then
+ do j = 1, jj
+ do l = 1, isp(j)
+ do i = max(1,ifp(j,l)), min(ii,ilp(j,l))
+ sbuff(i,j,index_o2x_Faoo_fnh3_ocn) =
+ . sbuff(i,j,index_o2x_Faoo_fnh3_ocn)
+ . + flxnh3(i,j)*baclin
+ enddo
+ enddo
+ enddo
+ endif
+
+
!-----------------------------------------------------------------
! Increment time since last coupling
diff --git a/hamocc/meson.build b/hamocc/meson.build
index 7011cbae..a9c240e5 100644
--- a/hamocc/meson.build
+++ b/hamocc/meson.build
@@ -43,4 +43,6 @@ sources += files(
'mo_profile_gd.F90',
'mo_restart_hamoccwt.F90',
'mo_sedshi.F90',
- 'mo_trc_limitc.F90')
+ 'mo_trc_limitc.F90',
+ 'mo_extNwatercol.F90',
+ 'mo_extNsediment.F90')
diff --git a/hamocc/mo_accfields.F90 b/hamocc/mo_accfields.F90
index 4fba06d9..d214ea92 100644
--- a/hamocc/mo_accfields.F90
+++ b/hamocc/mo_accfields.F90
@@ -35,24 +35,27 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
!
! Purpose
! -------
- ! Accumulate fields for time-avaraged output and write output
+ ! Accumulate fields for time-averaged output and write output
!
!***********************************************************************************************
use mod_xc, only: mnproc
use mod_dia, only: ddm
use mo_carbch, only: atm,atmflx,co2fxd,co2fxu,co3,hi,kwco2sol, &
- ndepflx,rivinflx,oalkflx,ocetra,omegaa,omegac,pco2d, &
- satoxy,sedfluxo,pco2m,kwco2d,co2sold,co2solm, &
+ ndepnoyflx,rivinflx,oalkflx,ocetra,omegaa,omegac,pco2d, &
+ satoxy,sedfluxo,sedfluxb,pco2m,kwco2d,co2sold,co2solm,pn2om, &
co213fxd,co213fxu,co214fxd,co214fxu, &
- natco3,nathi,natomegaa,natomegac,natpco2d
+ natco3,nathi,natomegaa,natomegac,natpco2d,pnh3,ndepnhxflx
use mo_biomod, only: bsiflx_bot,bsiflx0100,bsiflx0500,bsiflx1000, &
bsiflx2000,bsiflx4000,calflx_bot,calflx0100,calflx0500, &
calflx1000,calflx2000,calflx4000,carflx_bot,carflx0100, &
carflx0500,carflx1000,carflx2000,carflx4000, &
expoca,expoor,exposi,intdms_bac,intdms_uv,intdmsprod, &
intdnit,intnfix,intphosy,phosy3d, &
- int_chbr3_prod,int_chbr3_uv,asize3d,eps3d,wnumb,wmass
+ int_chbr3_prod,int_chbr3_uv,asize3d,eps3d,wnumb,wmass, &
+ nitr_NH4,nitr_NO2,nitr_N2O_prod,nitr_NH4_OM,nitr_NO2_OM,denit_NO3, &
+ denit_NO2,denit_N2O,DNRA_NO2,anmx_N2_prod,anmx_OM_prod,phosy_NH4, &
+ phosy_NO3,remin_aerob,remin_sulf
use mo_param_bgc, only: c14fac,re1312,re14to
use mo_bgcmean, only: domassfluxes,jalkali,jano3,jasize,jatmco2, &
jbsiflx0100,jbsiflx0500,jbsiflx1000,jbsiflx2000, &
@@ -61,6 +64,7 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
jcalflx_bot,jcarflx0100,jcarflx0500, &
jcarflx1000,jcarflx2000,jcarflx4000,jcarflx_bot, &
jsediffic,jsediffal,jsediffph,jsediffox, &
+ jburflxsso12,jburflxsssc12,jburflxssssil,jburflxssster, &
jsediffn2,jsediffno3,jsediffsi,jco2flux, &
jco2fxd,jco2fxu,jco3,jdic,jdicsat, &
jdms,jdms_bac,jdms_uv,jdmsflux, &
@@ -80,13 +84,13 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
jlvlprefo2,jlvlprefpo4,jlvlsf6,jlvlsilica, &
jlvlwnos,jlvlwphy,jn2flux,jn2o,jn2oflux,jn2ofx, &
jprorca,jprcaca,jsilpro,jpodiic,jpodial,jpodiph, &
- jpodiox,jpodin2,jpodino3,jpodisi,jndep,joalk, &
+ jpodiox,jpodin2,jpodino3,jpodisi,jndepnoy,jndepnhx,joalk, &
jniflux,jnos,jo2flux,jo2sat,jomegaa,jomegac,jopal, &
joxflux,joxygen,jpco2,jpco2m,jkwco2khm,jco2khm, &
jco2kh,jph,jphosph,jphosy,jphyto,jpoc,jprefalk, &
jprefdic,jprefo2,jprefpo4,jsilica,jsrfalkali, &
jsrfano3,jsrfdic,jsrfiron,jsrfoxygen,jsrfphosph, &
- jsrfphyto,jsrfsilica,jsrfph,jwnos,jwphy,jndepfx, &
+ jsrfphyto,jsrfsilica,jsrfph,jwnos,jwphy,jndepnoyfx, &
joalkfx,nbgc,nacc_bgc,bgcwrt,glb_inventory, &
bgct2d,acclvl,acclyr,accsrf,bgczlv, &
jatmbromo,jbromo,jbromo_prod,jbromo_uv,jbromofx,jsrfbromo, &
@@ -100,9 +104,31 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
jbursssc12,jburssso12,jburssssil,jburssster, &
jpowaal,jpowaic,jpowaox,jpowaph,jpowaph,jpowasi,jpown2, &
jpowno3,jsssc12,jssso12,jssssil,jssster,accbur,accsdm, &
- jatmco2,jatmn2,jatmo2
+ jatmco2,jatmn2,jatmo2, &
+ jlvlanh4,jlvlano2, &
+ jlvl_nitr_NH4, jsrfpn2om, &
+ jlvl_nitr_NO2,jlvl_nitr_N2O_prod,jlvl_nitr_NH4_OM,jlvl_nitr_NO2_OM,&
+ jlvl_denit_NO3,jlvl_denit_NO2,jlvl_denit_N2O,jlvl_DNRA_NO2, &
+ jlvl_anmx_N2_prod,jlvl_anmx_OM_prod,jlvl_phosy_NH4,jlvl_phosy_NO3, &
+ jlvl_remin_aerob,jlvl_remin_sulf, &
+ jagg_ws,jdynvis,jagg_stick,jagg_stickf,jagg_dmax,jagg_avdp, &
+ jagg_avrhop,jagg_avdC,jagg_df,jagg_b,jagg_Vrhof,jagg_Vpor, &
+ jlvl_agg_ws,jlvl_dynvis,jlvl_agg_stick,jlvl_agg_stickf, &
+ jlvl_agg_dmax,jlvl_agg_avdp,jlvl_agg_avrhop,jlvl_agg_avdC, &
+ jlvl_agg_df,jlvl_agg_b,jlvl_agg_Vrhof,jlvl_agg_Vpor, &
+ jprefsilica,jlvlprefsilica, &
+ jnh3flux,janh3fx,janh4,jano2,jsrfanh4,jsrfano2,jsrfpnh3, &
+ jnitr_NH4,jnitr_NO2,jnitr_N2O_prod,jnitr_NH4_OM,jnitr_NO2_OM, &
+ jdenit_NO3,jdenit_NO2,jdenit_N2O,jDNRA_NO2,janmx_N2_prod, &
+ janmx_OM_prod,jphosy_NH4,jphosy_NO3,jremin_aerob,jremin_sulf, &
+ jpownh4,jpown2o,jpowno2,jsdm_nitr_NH4,jsdm_nitr_NO2, &
+ jsdm_nitr_N2O_prod,jsdm_nitr_NH4_OM,jsdm_nitr_NO2_OM, &
+ jsdm_denit_NO3,jsdm_denit_NO2,jsdm_denit_N2O,jsdm_DNRA_NO2, &
+ jsdm_anmx_N2_prod,jsdm_anmx_OM_prod,jsdm_remin_aerob, &
+ jsdm_remin_sulf,jsediffnh4,jsediffn2o,jsediffno2,jatmn2o,jatmnh3, &
+ jndepnhxfx
use mo_control_bgc, only: io_stdo_bgc,dtb,use_BROMO,use_AGG,use_WLIN,use_natDIC, &
- use_CFC,use_sedbypass,use_cisonew,use_BOXATM
+ use_CFC,use_sedbypass,use_cisonew,use_BOXATM,use_M4AGO,use_extNcycle
use mo_param1_bgc, only: ialkali,ian2o,iano3,iatmco2,iatmdms,iatmn2,iatmn2o,iatmo2, &
icalc,idet,idms,idicsat,idoc,iiron,iopal, &
ioxygen,iphosph,iphy,iprefalk,iprefdic, &
@@ -113,11 +139,20 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
izoo13,safediv, &
iatmnco2,inatalkali,inatcalc,inatsco212, &
ipowaal,ipowaic,ipowaox,ipowaph,ipowasi, &
- ipown2,ipowno3,isssc12,issso12,issssil,issster
+ ipown2,ipowno3,isssc12,issso12,issssil,issster, &
+ issso12,isssc12,issssil,issster,iprefsilica,iatmnh3,ianh4,iano2, &
+ ipownh4,ipown2o,ipowno2
use mo_sedmnt, only: powtra,sedlay,burial
use mo_vgrid, only: dp_min
use mo_inventory_bgc, only: inventory_bgc
use mo_ncwrt_bgc , only: ncwrt_bgc
+ use mo_ihamocc4m4ago, only: aggregate_diagnostics,kav_dp,kav_rho_p,kav_d_C,kws_agg,kdf_agg, &
+ kstickiness_agg,kb_agg,kstickiness_frustule,kLmax_agg,kdynvis, &
+ kav_rhof_V,kav_por_V
+ use mo_extNsediment, only: extNsed_diagnostics,ised_nitr_NH4,ised_nitr_NO2,ised_nitr_N2O_prod,&
+ ised_nitr_NH4_OM,ised_nitr_NO2_OM,ised_denit_NO3,ised_denit_NO2, &
+ ised_denit_N2O,ised_DNRA_NO2,ised_anmx_N2_prod,ised_anmx_OM_prod, &
+ ised_remin_aerob,ised_remin_sulf
! Arguments
integer , intent(in) :: kpie ! 1st dimension of model grid.
@@ -171,6 +206,10 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
bgct2d(i,j,jo2flux) = bgct2d(i,j,jo2flux) + atmflx(i,j,iatmo2)/2.0
bgct2d(i,j,jn2flux) = bgct2d(i,j,jn2flux) + atmflx(i,j,iatmn2)/2.0
bgct2d(i,j,jn2oflux) = bgct2d(i,j,jn2oflux) + atmflx(i,j,iatmn2o)/2.0
+ if (use_extNcycle) then
+ bgct2d(i,j,jnh3flux) = bgct2d(i,j,jnh3flux) + atmflx(i,j,iatmnh3)/2.0
+ bgct2d(i,j,jndepnhx) = bgct2d(i,j,jndepnhx) + ndepnhxflx(i,j)/2.0
+ endif
! Particle fluxes between water-column and sediment
bgct2d(i,j,jprorca) = bgct2d(i,j,jprorca) + carflx_bot(i,j)/2.0
bgct2d(i,j,jprcaca) = bgct2d(i,j,jprcaca) + calflx_bot(i,j)/2.0
@@ -186,7 +225,7 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
bgct2d(i,j,jpodisi) = bgct2d(i,j,jpodisi) + sedfluxo(i,j,ipowasi)/2.0
endif
! N-deposition, ocean alkalinization, and riverine input fluxes
- bgct2d(i,j,jndep) = bgct2d(i,j,jndep) + ndepflx(i,j)/2.0
+ bgct2d(i,j,jndepnoy) = bgct2d(i,j,jndepnoy) + ndepnoyflx(i,j)/2.0
bgct2d(i,j,joalk) = bgct2d(i,j,joalk) + oalkflx(i,j)/2.0
bgct2d(i,j,jirdin) = bgct2d(i,j,jirdin) + rivinflx(i,j,irdin)/2.0
bgct2d(i,j,jirdip) = bgct2d(i,j,jirdip) + rivinflx(i,j,irdip)/2.0
@@ -226,7 +265,11 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
call accsrf(jatmc13,atm(1,1,iatmc13),omask,0)
call accsrf(jatmc14,atm(1,1,iatmc14),omask,0)
endif
-
+ if (use_extNcycle) then
+ call accsrf(janh3fx,atmflx(1,1,iatmnh3),omask,0)
+ call accsrf(jatmnh3,atm(1,1,iatmnh3),omask,0)
+ call accsrf(jatmn2o,atm(1,1,iatmn2o),omask,0)
+ endif
! Save up and downward fluxes for CO2 seperately
call accsrf(jco2fxd,co2fxd,omask,0)
call accsrf(jco2fxu,co2fxu,omask,0)
@@ -254,6 +297,7 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
call accsrf(jsrfphyto,ocetra(1,1,1,iphy),omask,0)
call accsrf(jsrfph,hi(1,1,1),omask,0)
call accsrf(jdms,ocetra(1,1,1,idms),omask,0)
+ call accsrf(jsrfpn2om,pn2om,omask,0)
call accsrf(jexport,expoor,omask,0)
call accsrf(jexpoca,expoca,omask,0)
call accsrf(jexposi,exposi,omask,0)
@@ -276,9 +320,16 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
endif
! Accumulate fluxes due to N-deposition, ocean alkalinization
- call accsrf(jndepfx,ndepflx,omask,0)
+ call accsrf(jndepnoyfx,ndepnoyflx,omask,0)
call accsrf(joalkfx,oalkflx,omask,0)
+ if (use_extNcycle) then
+ call accsrf(jsrfanh4,ocetra(1,1,1,ianh4),omask,0)
+ call accsrf(jsrfpnh3,pnh3,omask,0)
+ call accsrf(jsrfano2,ocetra(1,1,1,iano2),omask,0)
+ call accsrf(jndepnhxfx,ndepnhxflx,omask,0)
+ endif
+
! Accumulate the diagnostic mass sinking field
if( domassfluxes ) then
call accsrf(jcarflx0100,carflx0100,omask,0)
@@ -310,8 +361,16 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
call accsrf(jsediffn2,sedfluxo(1,1,ipown2),omask,0)
call accsrf(jsediffno3,sedfluxo(1,1,ipowno3),omask,0)
call accsrf(jsediffsi,sedfluxo(1,1,ipowasi),omask,0)
+ call accsrf(jburflxsso12,sedfluxb(1,1,issso12),omask,0)
+ call accsrf(jburflxsssc12,sedfluxb(1,1,isssc12),omask,0)
+ call accsrf(jburflxssssil,sedfluxb(1,1,issssil),omask,0)
+ call accsrf(jburflxssster,sedfluxb(1,1,issster),omask,0)
+ if (use_extNcycle) then
+ call accsrf(jsediffnh4,sedfluxo(1,1,ipownh4),omask,0)
+ call accsrf(jsediffn2o,sedfluxo(1,1,ipown2o),omask,0)
+ call accsrf(jsediffno2,sedfluxo(1,1,ipowno2),omask,0)
+ endif
endif
-
! Accumulate layer diagnostics
call acclyr(jdp,pddpo,pddpo,0)
call acclyr(jphyto,ocetra(1,1,1,iphy),pddpo,1)
@@ -336,6 +395,7 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
call acclyr(jo2sat,satoxy,pddpo,1)
call acclyr(jprefo2,ocetra(1,1,1,iprefo2),pddpo,1)
call acclyr(jprefpo4,ocetra(1,1,1,iprefpo4),pddpo,1)
+ call acclyr(jprefsilica,ocetra(1,1,1,iprefsilica),pddpo,1)
call acclyr(jprefalk,ocetra(1,1,1,iprefalk),pddpo,1)
call acclyr(jprefdic,ocetra(1,1,1,iprefdic),pddpo,1)
call acclyr(jdicsat,ocetra(1,1,1,idicsat),pddpo,1)
@@ -375,17 +435,59 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
if (use_BROMO) then
call acclyr(jbromo,ocetra(1,1,1,ibromo),pddpo,1)
endif
-
+ if (use_extNcycle) then
+ call acclyr(janh4,ocetra(1,1,1,ianh4),pddpo,1)
+ call acclyr(jano2,ocetra(1,1,1,iano2),pddpo,1)
+ call acclyr(jnitr_NH4,nitr_NH4,pddpo,1)
+ call acclyr(jnitr_NO2,nitr_NO2,pddpo,1)
+ call acclyr(jnitr_N2O_prod,nitr_N2O_prod,pddpo,1)
+ call acclyr(jnitr_NH4_OM,nitr_NH4_OM,pddpo,1)
+ call acclyr(jnitr_NO2_OM,nitr_NO2_OM,pddpo,1)
+ call acclyr(jdenit_NO3,denit_NO3,pddpo,1)
+ call acclyr(jdenit_NO2,denit_NO2,pddpo,1)
+ call acclyr(jdenit_N2O,denit_N2O,pddpo,1)
+ call acclyr(jDNRA_NO2,DNRA_NO2,pddpo,1)
+ call acclyr(janmx_N2_prod,anmx_N2_prod,pddpo,1)
+ call acclyr(janmx_OM_prod,anmx_OM_prod,pddpo,1)
+ call acclyr(jphosy_NH4,phosy_NH4,pddpo,1)
+ call acclyr(jphosy_NO3,phosy_NO3,pddpo,1)
+ call acclyr(jremin_aerob,remin_aerob,pddpo,1)
+ call acclyr(jremin_sulf,remin_sulf,pddpo,1)
+ endif
+ if (use_M4AGO) then
+ ! M4AGO
+ call acclyr(jagg_ws,aggregate_diagnostics(1,1,1,kws_agg),pddpo,1)
+ call acclyr(jdynvis,aggregate_diagnostics(1,1,1,kdynvis),pddpo,1)
+ call acclyr(jagg_stick,aggregate_diagnostics(1,1,1,kstickiness_agg),pddpo,1)
+ call acclyr(jagg_stickf,aggregate_diagnostics(1,1,1,kstickiness_frustule),pddpo,1)
+ call acclyr(jagg_dmax,aggregate_diagnostics(1,1,1,kLmax_agg),pddpo,1)
+ call acclyr(jagg_avdp,aggregate_diagnostics(1,1,1,kav_dp),pddpo,1)
+ call acclyr(jagg_avrhop,aggregate_diagnostics(1,1,1,kav_rho_p),pddpo,1)
+ call acclyr(jagg_avdC,aggregate_diagnostics(1,1,1,kav_d_C),pddpo,1)
+ call acclyr(jagg_df,aggregate_diagnostics(1,1,1,kdf_agg),pddpo,1)
+ call acclyr(jagg_b,aggregate_diagnostics(1,1,1,kb_agg),pddpo,1)
+ call acclyr(jagg_Vrhof,aggregate_diagnostics(1,1,1,kav_rhof_V),pddpo,1)
+ call acclyr(jagg_Vpor,aggregate_diagnostics(1,1,1,kav_por_V),pddpo,1)
+ endif
! Accumulate level diagnostics
if (SUM(jlvlphyto+jlvlgrazer+jlvlphosph+jlvloxygen+jlvliron+ &
& jlvlano3+jlvlalkali+jlvlsilica+jlvldic+jlvldoc+jlvlpoc+jlvlcalc+ &
& jlvlopal+jlvln2o+jlvlco3+jlvlph+jlvlomegaa+jlvlomegac+jlvlphosy+ &
& jlvlo2sat+jlvlprefo2+jlvlprefpo4+jlvlprefalk+jlvlprefdic+ &
+ & jlvlprefsilica+ &
& jlvldicsat+jlvlnatdic+jlvlnatalkali+jlvlnatcalc+jlvlnatco3+ &
& jlvlnatomegaa+jlvlnatomegac+jlvldic13+jlvldic14+jlvld13c+ &
& jlvld14c+jlvlbigd14c+jlvlpoc13+jlvldoc13+jlvlcalc13+jlvlphyto13+ &
& jlvlgrazer13+jlvlnos+jlvlwphy+jlvlwnos+jlvleps+jlvlasize+ &
- & jlvlcfc11+jlvlcfc12+jlvlsf6+jlvlbromo) /= 0) then
+ & jlvlcfc11+jlvlcfc12+jlvlsf6+jlvlbromo+jlvlanh4+jlvlano2+ &
+ & jlvl_nitr_NH4+jlvl_nitr_NO2+jlvl_nitr_N2O_prod+jlvl_nitr_NH4_OM+&
+ & jlvl_nitr_NO2_OM+jlvl_denit_NO3+jlvl_denit_NO2+jlvl_denit_N2O+ &
+ & jlvl_DNRA_NO2+jlvl_anmx_N2_prod+jlvl_anmx_OM_prod+ &
+ & jlvl_phosy_NH4+jlvl_phosy_NO3+jlvl_remin_aerob+jlvl_remin_sulf+ &
+ & jlvl_agg_ws+jlvl_dynvis+jlvl_agg_stick+jlvl_agg_stickf+ &
+ & jlvl_agg_dmax+jlvl_agg_avdp+jlvl_agg_avrhop+jlvl_agg_avdC+ &
+ & jlvl_agg_df+jlvl_agg_b+jlvl_agg_Vrhof+jlvl_agg_Vpor &
+ & ) /= 0) then
do k=1,kpke
call bgczlv(pddpo,k,ind1,ind2,wghts)
call acclvl(jlvlphyto,ocetra(1,1,1,iphy),k,ind1,ind2,wghts)
@@ -410,6 +512,7 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
call acclvl(jlvlo2sat,satoxy,k,ind1,ind2,wghts)
call acclvl(jlvlprefo2,ocetra(1,1,1,iprefo2),k,ind1,ind2,wghts)
call acclvl(jlvlprefpo4,ocetra(1,1,1,iprefpo4),k,ind1,ind2,wghts)
+ call acclvl(jlvlprefsilica,ocetra(1,1,1,iprefsilica),k,ind1,ind2,wghts)
call acclvl(jlvlprefalk,ocetra(1,1,1,iprefalk),k,ind1,ind2,wghts)
call acclvl(jlvlprefdic,ocetra(1,1,1,iprefdic),k,ind1,ind2,wghts)
call acclvl(jlvldicsat,ocetra(1,1,1,idicsat),k,ind1,ind2,wghts)
@@ -449,10 +552,43 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
if (use_BROMO) then
call acclvl(jlvlbromo,ocetra(1,1,1,ibromo),k,ind1,ind2,wghts)
endif
+ if (use_extNcycle) then
+ call acclvl(jlvlanh4,ocetra(1,1,1,ianh4),k,ind1,ind2,wghts)
+ call acclvl(jlvlano2,ocetra(1,1,1,iano2),k,ind1,ind2,wghts)
+ call acclvl(jlvl_nitr_NH4,nitr_NH4,k,ind1,ind2,wghts)
+ call acclvl(jlvl_nitr_NO2,nitr_NO2,k,ind1,ind2,wghts)
+ call acclvl(jlvl_nitr_N2O_prod,nitr_N2O_prod,k,ind1,ind2,wghts)
+ call acclvl(jlvl_nitr_NH4_OM,nitr_NH4_OM,k,ind1,ind2,wghts)
+ call acclvl(jlvl_nitr_NO2_OM,nitr_NO2_OM,k,ind1,ind2,wghts)
+ call acclvl(jlvl_denit_NO3,denit_NO3,k,ind1,ind2,wghts)
+ call acclvl(jlvl_denit_NO2,denit_NO2,k,ind1,ind2,wghts)
+ call acclvl(jlvl_denit_N2O,denit_N2O,k,ind1,ind2,wghts)
+ call acclvl(jlvl_DNRA_NO2,DNRA_NO2,k,ind1,ind2,wghts)
+ call acclvl(jlvl_anmx_N2_prod,anmx_N2_prod,k,ind1,ind2,wghts)
+ call acclvl(jlvl_anmx_OM_prod,anmx_OM_prod,k,ind1,ind2,wghts)
+ call acclvl(jlvl_phosy_NH4,phosy_NH4,k,ind1,ind2,wghts)
+ call acclvl(jlvl_phosy_NO3,phosy_NO3,k,ind1,ind2,wghts)
+ call acclvl(jlvl_remin_aerob,remin_aerob,k,ind1,ind2,wghts)
+ call acclvl(jlvl_remin_sulf,remin_sulf,k,ind1,ind2,wghts)
+ endif
+ if (use_M4AGO) then
+ !M4AGO
+ call acclvl(jlvl_agg_ws,aggregate_diagnostics(1,1,1,kws_agg),k,ind1,ind2,wghts)
+ call acclvl(jlvl_dynvis,aggregate_diagnostics(1,1,1,kdynvis),k,ind1,ind2,wghts)
+ call acclvl(jlvl_agg_stick,aggregate_diagnostics(1,1,1,kstickiness_agg),k,ind1,ind2,wghts)
+ call acclvl(jlvl_agg_stickf,aggregate_diagnostics(1,1,1,kstickiness_frustule),k,ind1,ind2,wghts)
+ call acclvl(jlvl_agg_dmax,aggregate_diagnostics(1,1,1,kLmax_agg),k,ind1,ind2,wghts)
+ call acclvl(jlvl_agg_avdp,aggregate_diagnostics(1,1,1,kav_dp),k,ind1,ind2,wghts)
+ call acclvl(jlvl_agg_avrhop,aggregate_diagnostics(1,1,1,kav_rho_p),k,ind1,ind2,wghts)
+ call acclvl(jlvl_agg_avdC,aggregate_diagnostics(1,1,1,kav_d_C),k,ind1,ind2,wghts)
+ call acclvl(jlvl_agg_df,aggregate_diagnostics(1,1,1,kdf_agg),k,ind1,ind2,wghts)
+ call acclvl(jlvl_agg_b,aggregate_diagnostics(1,1,1,kb_agg),k,ind1,ind2,wghts)
+ call acclvl(jlvl_agg_Vrhof,aggregate_diagnostics(1,1,1,kav_rhof_V),k,ind1,ind2,wghts)
+ call acclvl(jlvl_agg_Vpor,aggregate_diagnostics(1,1,1,kav_por_V),k,ind1,ind2,wghts)
+ endif
enddo
endif
-
if (.not. use_sedbypass) then
! Accumulate sediments
call accsdm(jpowaic,powtra(1,1,1,ipowaic))
@@ -472,6 +608,24 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
call accbur(jburssssil,burial(1,1,issssil))
call accbur(jbursssc12,burial(1,1,isssc12))
call accbur(jburssster,burial(1,1,issster))
+ if (use_extNcycle) then
+ call accsdm(jpownh4,powtra(1,1,1,ipownh4))
+ call accsdm(jpown2o,powtra(1,1,1,ipown2o))
+ call accsdm(jpowno2,powtra(1,1,1,ipowno2))
+ call accsdm(jsdm_nitr_NH4 ,extNsed_diagnostics(1,1,1,ised_nitr_NH4))
+ call accsdm(jsdm_nitr_NO2 ,extNsed_diagnostics(1,1,1,ised_nitr_NO2))
+ call accsdm(jsdm_nitr_N2O_prod ,extNsed_diagnostics(1,1,1,ised_nitr_N2O_prod))
+ call accsdm(jsdm_nitr_NH4_OM ,extNsed_diagnostics(1,1,1,ised_nitr_NH4_OM))
+ call accsdm(jsdm_nitr_NO2_OM ,extNsed_diagnostics(1,1,1,ised_nitr_NO2_OM))
+ call accsdm(jsdm_denit_NO3 ,extNsed_diagnostics(1,1,1,ised_denit_NO3))
+ call accsdm(jsdm_denit_NO2 ,extNsed_diagnostics(1,1,1,ised_denit_NO2))
+ call accsdm(jsdm_denit_N2O ,extNsed_diagnostics(1,1,1,ised_denit_N2O))
+ call accsdm(jsdm_DNRA_NO2 ,extNsed_diagnostics(1,1,1,ised_DNRA_NO2))
+ call accsdm(jsdm_anmx_N2_prod ,extNsed_diagnostics(1,1,1,ised_anmx_N2_prod))
+ call accsdm(jsdm_anmx_OM_prod ,extNsed_diagnostics(1,1,1,ised_anmx_OM_prod))
+ call accsdm(jsdm_remin_aerob ,extNsed_diagnostics(1,1,1,ised_remin_aerob))
+ call accsdm(jsdm_remin_sulf ,extNsed_diagnostics(1,1,1,ised_remin_sulf))
+ endif
endif
! Write output if requested
@@ -487,9 +641,12 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
enddo
atmflx=0. ! nullifying atm flux here to have zero fluxes for stepwise inventory fluxes
- ndepflx=0.
+ ndepnoyflx=0.
oalkflx=0.
rivinflx=0.
+ if (use_extNcycle) then
+ ndepnhxflx=0.
+ endif
end subroutine accfields
diff --git a/hamocc/mo_apply_ndep.F90 b/hamocc/mo_apply_ndep.F90
index 719671af..856d0729 100644
--- a/hamocc/mo_apply_ndep.F90
+++ b/hamocc/mo_apply_ndep.F90
@@ -19,11 +19,11 @@
module mo_apply_ndep
!*************************************************************************************************
- ! Routine for applying the nitrogen deposition flux.
+ ! Routine for applying the nitrogen deposition flux.
!
- ! N-deposition is activated through a logical switch 'do_ndep' read from HAMOCC's bgcnml
- ! namelist. When coupled to NorESM, this is achieved by setting BLOM_N_DEPOSITION to
- ! TRUE in env_run.xml.
+ ! N-deposition is activated through a logical switch 'do_ndep' read from HAMOCC's bgcnml
+ ! namelist. When coupled to NorESM, this is achieved by setting BLOM_N_DEPOSITION to
+ ! TRUE in env_run.xml.
!
! The routine n_deposition applies the nitrogen deposition flux to the top-most model layer.
!
@@ -54,9 +54,9 @@ subroutine apply_ndep(kpie,kpje,kpke,pddpo,omask,ndep)
! Tjiputra (18.09.2017): add 1 mol [H+], per mol [NO3] deposition, to alkalinity (minus 1 mol)
!***********************************************************************************************
- use mo_control_bgc, only: dtb,do_ndep
- use mo_carbch, only: ocetra,ndepflx
- use mo_param1_bgc, only: iano3,ialkali,inatalkali
+ use mo_control_bgc, only: dtb,do_ndep,use_extNcycle
+ use mo_carbch, only: ocetra,ndepnoyflx,ndepnhxflx
+ use mo_param1_bgc, only: iano3,ialkali,inatalkali,nndep,idepnoy,ianh4,idepnhx
use mo_control_bgc, only: use_natDIC
! Arguments
@@ -65,31 +65,38 @@ subroutine apply_ndep(kpie,kpje,kpke,pddpo,omask,ndep)
integer, intent(in) :: kpke ! 3rd (vertical) dimension of model grid.
real, intent(in) :: pddpo(kpie,kpje,kpke) ! size of grid cell (depth) [m].
real, intent(in) :: omask(kpie,kpje) ! land/ocean mask (1=ocean)
- real, intent(in) :: ndep(kpie,kpje) ! N-deposition field to apply
+ real, intent(in) :: ndep(kpie,kpje,nndep) ! N-deposition field to apply
! local variables
integer :: i,j
! ndepflx stores the applied n-deposition flux for inventory calculations and output
- ndepflx(:,:)=0.0
-
+ ndepnoyflx(:,:)=0.0
+ if (use_extNcycle) then
+ ndepnhxflx(:,:)=0.0
+ endif
if (.not. do_ndep) return
- ! deposite N in topmost layer
+ ! deposit N in topmost layer
do j=1,kpje
do i=1,kpie
if (omask(i,j).gt.0.5) then
- ndepflx(i,j) = ndep(i,j)*dtb/365.
- ocetra(i,j,1,iano3)=ocetra(i,j,1,iano3)+ndepflx(i,j)/pddpo(i,j,1)
- ocetra(i,j,1,ialkali)=ocetra(i,j,1,ialkali)-ndepflx(i,j)/pddpo(i,j,1)
+ ndepnoyflx(i,j) = ndep(i,j,idepnoy)*dtb/365.
+ ocetra(i,j,1,iano3)=ocetra(i,j,1,iano3)+ndepnoyflx(i,j)/pddpo(i,j,1)
+ ocetra(i,j,1,ialkali)=ocetra(i,j,1,ialkali)-ndepnoyflx(i,j)/pddpo(i,j,1)
if (use_natDIC) then
- ocetra(i,j,1,inatalkali)=ocetra(i,j,1,inatalkali)-ndepflx(i,j)/pddpo(i,j,1)
+ ocetra(i,j,1,inatalkali)=ocetra(i,j,1,inatalkali)-ndepnoyflx(i,j)/pddpo(i,j,1)
+ endif
+ if (use_extNcycle) then
+ ndepnhxflx(i,j) = ndep(i,j,idepnhx)*dtb/365.
+ ocetra(i,j,1,ianh4) = ocetra(i,j,1,ianh4) + ndepnhxflx(i,j)/pddpo(i,j,1)
+ ocetra(i,j,1,ialkali) = ocetra(i,j,1,ialkali) + ndepnhxflx(i,j)/pddpo(i,j,1)
endif
endif
enddo
enddo
end subroutine apply_ndep
-
+
!*************************************************************************************************
end module mo_apply_ndep
diff --git a/hamocc/mo_aufr_bgc.F90 b/hamocc/mo_aufr_bgc.F90
index 8707ea62..179d3d01 100644
--- a/hamocc/mo_aufr_bgc.F90
+++ b/hamocc/mo_aufr_bgc.F90
@@ -81,17 +81,20 @@ subroutine aufr_bgc(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc,kplyear,kplmon,kplday,o
use mod_dia, only: iotype
use mo_carbch, only: co2star,co3,hi,satoxy,ocetra,atm,nathi
use mo_control_bgc, only: io_stdo_bgc,ldtbgc,use_cisonew,use_AGG, &
- use_BOXATM,use_BROMO,use_CFC,use_natDIC,use_sedbypass
+ use_BOXATM,use_BROMO,use_CFC,use_natDIC,use_sedbypass, &
+ use_extNcycle
use mo_param1_bgc, only: ialkali,ian2o,iano3,icalc,idet,idicsat, &
idms,idoc,ifdust,igasnit,iiron,iopal,ioxygen,iphosph,iphy, &
- iprefalk,iprefdic,iprefo2,iprefpo4,isco212,isilica,izoo,nocetra, &
+ iprefalk,iprefdic,iprefo2,iprefpo4,iprefsilica, &
+ isco212,isilica,izoo,nocetra, &
iadust,inos,iatmco2,iatmn2,iatmo2,ibromo,icfc11,icfc12,isf6, &
icalc13,icalc14,idet13,idet14,idoc13,idoc14,iphy13,iphy14, &
isco213,isco214,izoo13,izoo14,safediv, &
issso13,issso14,isssc13,isssc14,ipowc13,ipowc14, &
iatmc13,iatmc14,iatmnco2,inatalkali,inatcalc,inatsco212, &
ipowaal,ipowaic,ipowaox,ipowaph,ipowasi,ipown2,ipowno3, &
- isssc12,issso12,issssil,issster,ks
+ isssc12,issso12,issssil,issster,ks,ianh4,iano2,ipownh4,ipown2o, &
+ ipowno2
use mo_vgrid, only: kbo
use mo_sedmnt, only: sedhpl
use mo_intfcblom, only: sedlay2,powtra2,burial2,atm2
@@ -120,7 +123,7 @@ subroutine aufr_bgc(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc,kplyear,kplmon,kplday,o
integer :: restday ! day of restart file
integer :: restdtoce ! time step number from bgc ocean file
integer :: idate(5),i,j,k
- logical :: lread_cfc,lread_nat,lread_iso,lread_atm,lread_bro
+ logical :: lread_cfc,lread_nat,lread_iso,lread_atm,lread_bro,lread_extn,lread_prefsi
real :: rco213,rco214,alpha14,beta13,beta14,d13C_atm,d14cat
integer :: ncid,ncstat,ncvarid
@@ -320,6 +323,26 @@ subroutine aufr_bgc(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc,kplyear,kplmon,kplday,o
endif
endif
+! Find out whether to restart extended nitrogen cycle
+ if (use_extNcycle) then
+ lread_extn=.true.
+ if(IOTYPE==0) then
+ if(mnproc==1) ncstat=nf90_inq_varid(ncid,'anh4',ncvarid)
+ call xcbcst(ncstat)
+ if(ncstat.ne.nf90_noerr) lread_extn=.false.
+ else if(IOTYPE==1) then
+#ifdef PNETCDF
+ ncstat=nfmpi_inq_varid(ncid,'anh4',ncvarid)
+ if(ncstat.ne.nf_noerr) lread_extn=.false.
+#endif
+ endif
+ if(mnproc==1 .and. .not. lread_extn) then
+ write(io_stdo_bgc,*) ' '
+ write(io_stdo_bgc,*) 'AUFR_BGC info: extended nitrogen cycle tracer not in restart file '
+ write(io_stdo_bgc,*) 'Initialising extended nitrogen cycle from scratch'
+ endif
+ endif
+
! Find out whether to restart atmosphere
if (use_BOXATM) then
lread_atm=.true.
@@ -339,6 +362,24 @@ subroutine aufr_bgc(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc,kplyear,kplmon,kplday,o
write(io_stdo_bgc,*) ' Initialising atmosphere from scratch '
endif
endif
+
+ lread_prefsi=.true.
+ if(IOTYPE==0) then
+ if(mnproc==1) ncstat=nf90_inq_varid(ncid,'prefsilica',ncvarid)
+ call xcbcst(ncstat)
+ if(ncstat.ne.nf90_noerr) lread_prefsi=.false.
+ else if(IOTYPE==1) then
+#ifdef PNETCDF
+ ncstat=nfmpi_inq_varid(ncid,'prefsilica',ncvarid)
+ if(ncstat.ne.nf_noerr) lread_prefsi=.false.
+#endif
+ endif
+ if(mnproc==1 .and. .not. lread_prefsi) then
+ write(io_stdo_bgc,*) ' '
+ write(io_stdo_bgc,*) 'AUFR_BGC info: preformed silica not in restart file '
+ write(io_stdo_bgc,*) 'Initialising preformed tracer from scratch'
+ endif
+
!
! Read restart data : ocean aquateous tracer
!
@@ -364,6 +405,9 @@ subroutine aufr_bgc(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc,kplyear,kplmon,kplday,o
call read_netcdf_var(ncid,'prefalk',locetra(1,1,1,iprefalk),2*kpke,0,iotype)
call read_netcdf_var(ncid,'prefdic',locetra(1,1,1,iprefdic),2*kpke,0,iotype)
call read_netcdf_var(ncid,'dicsat',locetra(1,1,1,idicsat),2*kpke,0,iotype)
+ if(lread_prefsi) then
+ call read_netcdf_var(ncid,'prefsilica',locetra(1,1,1,iprefsilica),2*kpke,0,iotype)
+ endif
if (use_cisonew .and. lread_iso) then
call read_netcdf_var(ncid,'sco213',locetra(1,1,1,isco213),2*kpke,0,iotype)
@@ -404,6 +448,13 @@ subroutine aufr_bgc(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc,kplyear,kplmon,kplday,o
if (use_BROMO .and. lread_bro) then
call read_netcdf_var(ncid,'bromo',locetra(1,1,1,ibromo),2*kpke,0,iotype)
endif
+ if (use_extNcycle) then
+ if(lread_extn) then
+ call read_netcdf_var(ncid,'anh4',locetra(1,1,1,ianh4),2*kpke,0,iotype)
+ call read_netcdf_var(ncid,'ano2',locetra(1,1,1,iano2),2*kpke,0,iotype)
+ endif
+ endif
+
!
! Read restart data : diagnostic ocean fields (needed for bit to bit reproducability)
!
@@ -443,6 +494,13 @@ subroutine aufr_bgc(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc,kplyear,kplmon,kplday,o
call read_netcdf_var(ncid,'powc13',powtra2(1,1,1,ipowc13),2*ks,0,iotype)
call read_netcdf_var(ncid,'powc14',powtra2(1,1,1,ipowc14),2*ks,0,iotype)
endif
+ if (use_extNcycle) then
+ if(lread_extn) then
+ call read_netcdf_var(ncid,'pownh4',powtra2(1,1,1,ipownh4),2*ks,0,iotype)
+ call read_netcdf_var(ncid,'pown2o',powtra2(1,1,1,ipown2o),2*ks,0,iotype)
+ call read_netcdf_var(ncid,'powno2',powtra2(1,1,1,ipowno2),2*ks,0,iotype)
+ endif
+ endif
endif
!
! Read restart data: atmosphere
diff --git a/hamocc/mo_aufw_bgc.F90 b/hamocc/mo_aufw_bgc.F90
index ab9b13c6..d92c67b4 100644
--- a/hamocc/mo_aufw_bgc.F90
+++ b/hamocc/mo_aufw_bgc.F90
@@ -75,7 +75,7 @@ subroutine aufw_bgc(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc,
use mod_dia, only: iotype
use mo_carbch, only: co2star,co3,hi,satoxy,nathi
use mo_control_bgc, only: io_stdo_bgc,ldtbgc,rmasks,rmasko,use_cisonew,use_AGG,use_BOXATM, &
- use_BROMO,use_CFC,use_natDIC,use_sedbypass
+ use_BROMO,use_CFC,use_natDIC,use_sedbypass,use_extNcycle
use mo_sedmnt, only: sedhpl
use mo_intfcblom, only: sedlay2,powtra2,burial2,atm2
use mo_param1_bgc, only: ialkali, ian2o,iano3,icalc,idet,idicsat,idms,idoc,ifdust,igasnit, &
@@ -85,7 +85,8 @@ subroutine aufw_bgc(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc,
idoc14,iphy13,iphy14,isco213,isco214,izoo13,izoo14,issso13,issso14, &
isssc13,isssc14,ipowc13,ipowc14,iatmnco2,iatmc13,iatmc14,inatalkali, &
inatcalc,inatsco212,ipowaal,ipowaic,ipowaox,ipowaph,ipowasi,ipown2, &
- ipowno3,isssc12,issso12,issssil,issster
+ ipowno3,isssc12,issso12,issssil,issster,iprefsilica,ianh4,iano2, &
+ ipownh4,ipown2o,ipowno2
use mo_netcdf_bgcrw,only: write_netcdf_var,netcdf_def_vardb
! Arguments
@@ -436,6 +437,9 @@ subroutine aufw_bgc(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc,
call NETCDF_DEF_VARDB(ncid,7,'prefpo4',3,ncdimst,ncvarid, &
& 6,'mol/kg',19,'Preformed phosphate',rmissing,28,io_stdo_bgc)
+ call NETCDF_DEF_VARDB(ncid,10,'prefsilica',3,ncdimst,ncvarid, &
+ & 6,'mol/kg',16,'Preformed silica',rmissing,28,io_stdo_bgc)
+
call NETCDF_DEF_VARDB(ncid,7,'prefalk',3,ncdimst,ncvarid, &
& 6,'mol/kg',20,'Preformed alkalinity',rmissing,29,io_stdo_bgc)
@@ -513,6 +517,13 @@ subroutine aufw_bgc(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc,
call NETCDF_DEF_VARDB(ncid,5,'bromo',3,ncdimst,ncvarid, &
& 6,'mol/kg',9,'Bromoform',rmissing,47,io_stdo_bgc)
endif
+ if (use_extNcycle) then
+ call NETCDF_DEF_VARDB(ncid,4,'anh4',3,ncdimst,ncvarid, &
+ & 6,'mol/kg',18,'Dissolved ammonium',rmissing,54,io_stdo_bgc)
+
+ call NETCDF_DEF_VARDB(ncid,4,'ano2',3,ncdimst,ncvarid, &
+ & 6,'mol/kg',17,'Dissolved nitrite',rmissing,55,io_stdo_bgc)
+ endif
!
! Define variables : diagnostic ocean fields
@@ -608,7 +619,17 @@ subroutine aufw_bgc(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc,
call NETCDF_DEF_VARDB(ncid,6,'powc14',3,ncdimst,ncvarid, &
& 9,'kmol/m**3',25,'Sediment pore water DIC14',rmissing,86,io_stdo_bgc)
+ endif
+ if (use_extNcycle) then
+ call NETCDF_DEF_VARDB(ncid,6,'pownh4',3,ncdimst,ncvarid, &
+ & 9,'kmol/m**3',34,'Sediment pore water ammonium (NH4)',rmissing,79,io_stdo_bgc)
+
+ call NETCDF_DEF_VARDB(ncid,6,'pown2o',3,ncdimst,ncvarid, &
+ & 9,'kmol/m**3',39,'Sediment pore water nitrous oxide (N2O)',rmissing,79,io_stdo_bgc)
+
+ call NETCDF_DEF_VARDB(ncid,6,'powno2',3,ncdimst,ncvarid, &
+ & 9,'kmol/m**3',33,'Sediment pore water nitrite (NO2)',rmissing,79,io_stdo_bgc)
endif
if((mnproc==1 .and. IOTYPE==0) .OR. IOTYPE==1) then
@@ -743,6 +764,7 @@ subroutine aufw_bgc(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc,
call write_netcdf_var(ncid,'iron',locetra(1,1,1,iiron),2*kpke,0)
call write_netcdf_var(ncid,'prefo2',locetra(1,1,1,iprefo2),2*kpke,0)
call write_netcdf_var(ncid,'prefpo4',locetra(1,1,1,iprefpo4),2*kpke,0)
+ call write_netcdf_var(ncid,'prefsilica',locetra(1,1,1,iprefsilica),2*kpke,0)
call write_netcdf_var(ncid,'prefalk',locetra(1,1,1,iprefalk),2*kpke,0)
call write_netcdf_var(ncid,'prefdic',locetra(1,1,1,iprefdic),2*kpke,0)
call write_netcdf_var(ncid,'dicsat',locetra(1,1,1,idicsat),2*kpke,0)
@@ -777,9 +799,13 @@ subroutine aufw_bgc(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc,
if (use_BROMO) then
call write_netcdf_var(ncid,'bromo',locetra(1,1,1,ibromo),2*kpke,0)
endif
+ if (use_extNcycle) then
+ call write_netcdf_var(ncid,'anh4',locetra(1,1,1,ianh4),2*kpke,0)
+ call write_netcdf_var(ncid,'ano2',locetra(1,1,1,iano2),2*kpke,0)
+ endif
!
- ! Write restart data : diagtnostic ocean fields
+ ! Write restart data : diagnostic ocean fields
!
call write_netcdf_var(ncid,'hi',hi(1,1,1),kpke,0)
call write_netcdf_var(ncid,'co3',co3(1,1,1),kpke,0)
@@ -820,6 +846,11 @@ subroutine aufw_bgc(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc,
call write_netcdf_var(ncid,'powc13',powtra2(1,1,1,ipowc13),2*ks,0)
call write_netcdf_var(ncid,'powc14',powtra2(1,1,1,ipowc14),2*ks,0)
endif
+ if (use_extNcycle) then
+ call write_netcdf_var(ncid,'pownh4',powtra2(1,1,1,ipownh4),2*ks,0)
+ call write_netcdf_var(ncid,'pown2o',powtra2(1,1,1,ipown2o),2*ks,0)
+ call write_netcdf_var(ncid,'powno2',powtra2(1,1,1,ipowno2),2*ks,0)
+ endif
endif
!
! Write restart data: atmosphere.
diff --git a/hamocc/mo_bgcmean.F90 b/hamocc/mo_bgcmean.F90
index 329369be..d4b0b74e 100644
--- a/hamocc/mo_bgcmean.F90
+++ b/hamocc/mo_bgcmean.F90
@@ -49,7 +49,7 @@ module mo_bgcmean
use netcdf, only: nf90_fill_double
use mo_param1_bgc, only: ks
use mo_control_bgc, only: use_sedbypass,use_cisonew,use_CFC,use_natDIC,use_BROMO,use_BOXATM, &
- use_AGG
+ use_AGG,use_M4AGO,use_extNcycle
implicit none
@@ -111,9 +111,12 @@ module mo_bgcmean
& SRF_NATDIC =0 ,SRF_NATALKALI =0 ,SRF_NATPCO2 =0 , &
& SRF_NATCO2FX =0 ,SRF_NATPH =0 , &
& SRF_ATMBROMO =0 ,SRF_BROMO =0 ,SRF_BROMOFX =0 , &
+ & SRF_ANH4 =0 ,SRF_ANO2 =0 ,SRF_ANH3FX =0 , &
+ & SRF_PN2OM =0 ,SRF_PNH3 =0 ,SRF_ATMNH3 =0 , &
+ & SRF_ATMN2O =0 , &
& INT_BROMOPRO =0 ,INT_BROMOUV =0 , &
& INT_PHOSY =0 ,INT_NFIX =0 ,INT_DNIT =0 , &
- & FLX_NDEP =0 ,FLX_OALK =0 , &
+ & FLX_NDEPNOY =0 ,FLX_NDEPNHX =0 ,FLX_OALK =0 , &
& FLX_CAR0100 =0 ,FLX_CAR0500 =0 ,FLX_CAR1000 =0 , &
& FLX_CAR2000 =0 ,FLX_CAR4000 =0 ,FLX_CAR_BOT =0 , &
& FLX_BSI0100 =0 ,FLX_BSI0500 =0 ,FLX_BSI1000 =0 , &
@@ -122,7 +125,10 @@ module mo_bgcmean
& FLX_CAL2000 =0 ,FLX_CAL4000 =0 ,FLX_CAL_BOT =0 , &
& FLX_SEDIFFIC =0 ,FLX_SEDIFFAL =0 ,FLX_SEDIFFPH =0 , &
& FLX_SEDIFFOX =0 ,FLX_SEDIFFN2 =0 ,FLX_SEDIFFNO3 =0 , &
- & FLX_SEDIFFSI =0 , &
+ & FLX_SEDIFFSI =0 ,FLX_SEDIFFNH4 =0 ,FLX_SEDIFFN2O =0 , &
+ & FLX_SEDIFFNO2 =0 , &
+ & FLX_BURSSO12 =0 ,FLX_BURSSSC12 =0 ,FLX_BURSSSSIL =0 , &
+ & FLX_BURSSSTER =0 , &
& LYR_PHYTO =0 ,LYR_GRAZER =0 ,LYR_DOC =0 , &
& LYR_PHOSY =0 ,LYR_PHOSPH =0 ,LYR_OXYGEN =0 , &
& LYR_IRON =0 ,LYR_ANO3 =0 ,LYR_ALKALI =0 , &
@@ -134,6 +140,7 @@ module mo_bgcmean
& LYR_EPS =0 ,LYR_ASIZE =0 ,LYR_N2O =0 , &
& LYR_PREFO2 =0 ,LYR_O2SAT =0 ,LYR_PREFPO4 =0 , &
& LYR_PREFALK =0 ,LYR_PREFDIC =0 ,LYR_DICSAT =0 , &
+ & LYR_PREFSILICA=0 , &
& LYR_CFC11 =0 ,LYR_CFC12 =0 ,LYR_SF6 =0 , &
& LYR_NATDIC =0 ,LYR_NATALKALI =0 ,LYR_NATCALC =0 , &
& LYR_NATPH =0 ,LYR_NATOMEGAA =0 ,LYR_NATOMEGAC =0 , &
@@ -142,6 +149,19 @@ module mo_bgcmean
& LYR_D13C =0 ,LYR_D14C =0 ,LYR_BIGD14C =0 , &
& LYR_POC13 =0 ,LYR_DOC13 =0 ,LYR_CALC13 =0 , &
& LYR_PHYTO13 =0 ,LYR_GRAZER13 =0 , &
+ ! extNcycle LYR
+ & LYR_ANH4 =0 ,LYR_ANO2 =0 , &
+ & LYR_nitr_NH4 =0 ,LYR_nitr_NO2 =0 ,LYR_nitr_N2O_prod =0, &
+ & LYR_nitr_NH4_OM =0 ,LYR_nitr_NO2_OM =0 ,LYR_denit_NO3 =0, &
+ & LYR_denit_NO2 = 0 ,LYR_denit_N2O = 0 ,LYR_DNRA_NO2 =0, &
+ & LYR_anmx_N2_prod=0 ,LYR_anmx_OM_prod=0 ,LYR_phosy_NH4 =0, &
+ & LYR_phosy_NO3 = 0 ,LYR_remin_aerob =0 ,LYR_remin_sulf =0, &
+ ! M4AGO LYR
+ & LYR_agg_ws =0 ,LYR_dynvis =0 ,LYR_agg_stick =0 , &
+ & LYR_agg_stickf=0 ,LYR_agg_dmax =0 ,LYR_agg_avdp =0 , &
+ & LYR_agg_avrhop=0 ,LYR_agg_avdC =0 ,LYR_agg_df =0 , &
+ & LYR_agg_b =0 ,LYR_agg_Vrhof =0 ,LYR_agg_Vpor =0 , &
+ !========== LVLs
& LVL_PHYTO =0 ,LVL_GRAZER =0 ,LVL_DOC =0 , &
& LVL_PHOSY =0 ,LVL_PHOSPH =0 ,LVL_OXYGEN =0 , &
& LVL_IRON =0 ,LVL_ANO3 =0 ,LVL_ALKALI =0 , &
@@ -153,6 +173,7 @@ module mo_bgcmean
& LVL_ASIZE =0 ,LVL_N2O =0 ,LVL_PREFO2 =0 , &
& LVL_O2SAT =0 ,LVL_PREFPO4 =0 ,LVL_PREFALK =0 , &
& LVL_PREFDIC =0 ,LVL_DICSAT =0 , &
+ & LVL_PREFSILICA=0 , &
& LVL_CFC11 =0 ,LVL_CFC12 =0 ,LVL_SF6 =0 , &
& LVL_NATDIC =0 ,LVL_NATALKALI =0 ,LVL_NATCALC =0 , &
& LVL_NATPH =0 ,LVL_NATOMEGAA =0 ,LVL_NATOMEGAC =0 , &
@@ -161,12 +182,31 @@ module mo_bgcmean
& LVL_D13C =0 ,LVL_D14C =0 ,LVL_BIGD14C =0 , &
& LVL_POC13 =0 ,LVL_DOC13 =0 ,LVL_CALC13 =0 , &
& LVL_PHYTO13 =0 ,LVL_GRAZER13 =0 , &
+ ! extNcycle LVL
+ & LVL_ANH4 =0 ,LVL_ANO2 =0 , &
+ & LVL_nitr_NH4 =0 ,LVL_nitr_NO2 =0 ,LVL_nitr_N2O_prod =0, &
+ & LVL_nitr_NH4_OM =0 ,LVL_nitr_NO2_OM =0 ,LVL_denit_NO3 =0, &
+ & LVL_denit_NO2 = 0 ,LVL_denit_N2O = 0 ,LVL_DNRA_NO2 =0, &
+ & LVL_anmx_N2_prod=0 ,LVL_anmx_OM_prod=0 ,LVL_phosy_NH4 =0, &
+ & LVL_phosy_NO3 = 0 ,LVL_remin_aerob =0 ,LVL_remin_sulf =0, &
+ ! M4AGO LVL
+ & LVL_agg_ws =0 ,LVL_dynvis =0 ,LVL_agg_stick =0 , &
+ & LVL_agg_stickf=0 ,LVL_agg_dmax =0 ,LVL_agg_avdp =0 , &
+ & LVL_agg_avrhop=0 ,LVL_agg_avdC =0 ,LVL_agg_df =0 , &
+ & LVL_agg_b =0 ,LVL_agg_Vrhof =0 ,LVL_agg_Vpor =0 , &
& SDM_POWAIC =0 ,SDM_POWAAL =0 ,SDM_POWAPH =0 , &
& SDM_POWAOX =0 ,SDM_POWN2 =0 ,SDM_POWNO3 =0 , &
& SDM_POWASI =0 ,SDM_SSSO12 =0 ,SDM_SSSSIL =0 , &
& SDM_SSSC12 =0 ,SDM_SSSTER =0 , &
& BUR_SSSO12 =0 ,BUR_SSSC12 =0 ,BUR_SSSSIL =0 , &
& BUR_SSSTER =0 , &
+ !extNcycle
+ & SDM_POWNH4 =0 ,SDM_POWN2O =0 ,SDM_POWNO2 =0 , &
+ & SDM_nitr_NH4 =0 ,SDM_nitr_NO2 =0 ,SDM_nitr_N2O_prod =0, &
+ & SDM_nitr_NH4_OM =0 ,SDM_nitr_NO2_OM =0 ,SDM_denit_NO3 =0, &
+ & SDM_denit_NO2 = 0 ,SDM_denit_N2O = 0 ,SDM_DNRA_NO2 =0, &
+ & SDM_anmx_N2_prod=0 ,SDM_anmx_OM_prod=0 ,SDM_remin_aerob =0 , &
+ & SDM_remin_sulf =0 , &
& GLB_AVEPERIO =0 ,GLB_FILEFREQ =0 ,GLB_COMPFLAG =0 , &
& GLB_NCFORMAT =0 ,GLB_INVENTORY =0
@@ -190,9 +230,12 @@ module mo_bgcmean
& SRF_NATDIC ,SRF_NATALKALI ,SRF_NATPCO2 , &
& SRF_NATCO2FX ,SRF_NATPH , &
& SRF_ATMBROMO ,SRF_BROMO ,SRF_BROMOFX , &
+ & SRF_ANH4 ,SRF_ANO2 ,SRF_ANH3FX , &
+ & SRF_PN2OM ,SRF_PNH3 ,SRF_ATMNH3 , &
+ & SRF_ATMN2O , &
& INT_BROMOPRO ,INT_BROMOUV , &
& INT_PHOSY ,INT_NFIX ,INT_DNIT , &
- & FLX_NDEP ,FLX_OALK , &
+ & FLX_NDEPNOY ,FLX_NDEPNHX ,FLX_OALK , &
& FLX_CAR0100 ,FLX_CAR0500 ,FLX_CAR1000 , &
& FLX_CAR2000 ,FLX_CAR4000 ,FLX_CAR_BOT , &
& FLX_BSI0100 ,FLX_BSI0500 ,FLX_BSI1000 , &
@@ -201,7 +244,10 @@ module mo_bgcmean
& FLX_CAL2000 ,FLX_CAL4000 ,FLX_CAL_BOT , &
& FLX_SEDIFFIC ,FLX_SEDIFFAL ,FLX_SEDIFFPH , &
& FLX_SEDIFFOX ,FLX_SEDIFFN2 ,FLX_SEDIFFNO3 , &
- & FLX_SEDIFFSI , &
+ & FLX_SEDIFFSI ,FLX_SEDIFFNH4 ,FLX_SEDIFFN2O , &
+ & FLX_SEDIFFNO2 , &
+ & FLX_BURSSO12 ,FLX_BURSSSC12 ,FLX_BURSSSSIL , &
+ & FLX_BURSSSTER , &
& LYR_PHYTO ,LYR_GRAZER ,LYR_DOC , &
& LYR_PHOSY ,LYR_PHOSPH ,LYR_OXYGEN , &
& LYR_IRON ,LYR_ANO3 ,LYR_ALKALI , &
@@ -213,6 +259,7 @@ module mo_bgcmean
& LYR_EPS ,LYR_ASIZE ,LYR_N2O , &
& LYR_PREFO2 ,LYR_O2SAT ,LYR_PREFPO4 , &
& LYR_PREFALK ,LYR_PREFDIC ,LYR_DICSAT , &
+ & LYR_PREFSILICA , &
& LYR_CFC11 ,LYR_CFC12 ,LYR_SF6 , &
& LYR_NATDIC ,LYR_NATALKALI ,LYR_NATCALC , &
& LYR_NATPH ,LYR_NATOMEGAA ,LYR_NATOMEGAC , &
@@ -221,6 +268,16 @@ module mo_bgcmean
& LYR_D13C ,LYR_D14C ,LYR_BIGD14C , &
& LYR_PHYTO13 ,LYR_GRAZER13 ,LYR_POC13 , &
& LYR_DOC13 ,LYR_CALC13 , &
+ & LYR_ANH4 ,LYR_ANO2 , &
+ & LYR_nitr_NH4 ,LYR_nitr_NO2 ,LYR_nitr_N2O_prod , &
+ & LYR_nitr_NH4_OM ,LYR_nitr_NO2_OM ,LYR_denit_NO3 , &
+ & LYR_denit_NO2 ,LYR_denit_N2O ,LYR_DNRA_NO2 , &
+ & LYR_anmx_N2_prod ,LYR_anmx_OM_prod ,LYR_phosy_NH4 , &
+ & LYR_phosy_NO3 ,LYR_remin_aerob ,LYR_remin_sulf , &
+ & LYR_agg_ws ,LYR_dynvis ,LYR_agg_stick , &
+ & LYR_agg_stickf ,LYR_agg_dmax ,LYR_agg_avdp , &
+ & LYR_agg_avrhop ,LYR_agg_avdC ,LYR_agg_df , &
+ & LYR_agg_b ,LYR_agg_Vrhof ,LYR_agg_Vpor , &
& LVL_PHYTO ,LVL_GRAZER ,LVL_DOC , &
& LVL_PHOSY ,LVL_PHOSPH ,LVL_OXYGEN , &
& LVL_IRON ,LVL_ANO3 ,LVL_ALKALI , &
@@ -232,6 +289,7 @@ module mo_bgcmean
& LVL_ASIZE ,LVL_N2O ,LVL_PREFO2 , &
& LVL_O2SAT ,LVL_PREFPO4 ,LVL_PREFALK , &
& LVL_PREFDIC ,LVL_DICSAT , &
+ & LVL_PREFSILICA , &
& LVL_CFC11 ,LVL_CFC12 ,LVL_SF6 , &
& LVL_NATDIC ,LVL_NATALKALI ,LVL_NATCALC , &
& LVL_NATPH ,LVL_NATOMEGAA ,LVL_NATOMEGAC , &
@@ -240,12 +298,28 @@ module mo_bgcmean
& LVL_D13C ,LVL_D14C ,LVL_BIGD14C , &
& LVL_PHYTO13 ,LVL_GRAZER13 ,LVL_POC13 , &
& LVL_DOC13 ,LVL_CALC13 , &
+ & LVL_ANH4 ,LVL_ANO2 , &
+ & LVL_nitr_NH4 ,LVL_nitr_NO2 ,LVL_nitr_N2O_prod , &
+ & LVL_nitr_NH4_OM ,LVL_nitr_NO2_OM ,LVL_denit_NO3 , &
+ & LVL_denit_NO2 ,LVL_denit_N2O ,LVL_DNRA_NO2 , &
+ & LVL_anmx_N2_prod ,LVL_anmx_OM_prod ,LVL_phosy_NH4 , &
+ & LVL_phosy_NO3 ,LVL_remin_aerob ,LVL_remin_sulf , &
+ & LVL_agg_ws ,LVL_dynvis ,LVL_agg_stick , &
+ & LVL_agg_stickf ,LVL_agg_dmax ,LVL_agg_avdp , &
+ & LVL_agg_avrhop ,LVL_agg_avdC ,LVL_agg_df , &
+ & LVL_agg_b ,LVL_agg_Vrhof ,LVL_agg_Vpor , &
& SDM_POWAIC ,SDM_POWAAL ,SDM_POWAPH , &
& SDM_POWAOX ,SDM_POWN2 ,SDM_POWNO3 , &
& SDM_POWASI ,SDM_SSSO12 ,SDM_SSSSIL , &
& SDM_SSSC12 ,SDM_SSSTER , &
& BUR_SSSO12 ,BUR_SSSC12 ,BUR_SSSSIL , &
& BUR_SSSTER , &
+ & SDM_POWNH4 ,SDM_POWN2O ,SDM_POWNO2 , &
+ & SDM_nitr_NH4 ,SDM_nitr_NO2 ,SDM_nitr_N2O_prod , &
+ & SDM_nitr_NH4_OM ,SDM_nitr_NO2_OM ,SDM_denit_NO3 , &
+ & SDM_denit_NO2 ,SDM_denit_N2O ,SDM_DNRA_NO2 , &
+ & SDM_anmx_N2_prod ,SDM_anmx_OM_prod ,SDM_remin_aerob , &
+ & SDM_remin_sulf , &
& GLB_AVEPERIO ,GLB_FILEFREQ ,GLB_COMPFLAG , &
& GLB_NCFORMAT ,GLB_FNAMETAG ,GLB_INVENTORY
@@ -268,7 +342,7 @@ module mo_bgcmean
& jpodin2 =12, &
& jpodino3 =13, &
& jpodisi =14, &
- & jndep =15, &
+ & jndepnoy =15, &
& joalk =16, &
& jirdin =17, &
& jirdip =18, &
@@ -277,7 +351,9 @@ module mo_bgcmean
& jiriron =21, &
& jirdoc =22, &
& jirdet =23, &
- & nbgct2d =23
+ & jnh3flux =24, &
+ & jndepnhx =25, &
+ & nbgct2d =25
!----------------------------------------------------------------
integer :: i_bsc_m2d
@@ -320,7 +396,8 @@ module mo_bgcmean
& jintphosy = 0 , &
& jintnfix = 0 , &
& jintdnit = 0 , &
- & jndepfx = 0 , &
+ & jndepnoyfx = 0 , &
+ & jndepnhxfx = 0 , &
& joalkfx = 0 , &
& jcarflx0100= 0 , &
& jcarflx0500= 0 , &
@@ -348,7 +425,14 @@ module mo_bgcmean
& jsediffox = 0 , &
& jsediffn2 = 0 , &
& jsediffno3 = 0 , &
- jsediffsi = 0
+ & jsediffsi = 0 , &
+ & jsediffnh4 = 0 , &
+ & jsediffn2o = 0 , &
+ & jsediffno2 = 0 , &
+ & jburflxsso12 = 0 , &
+ & jburflxsssc12 = 0 , &
+ & jburflxssssil = 0 , &
+ & jburflxssster = 0
integer, dimension(nbgcmax) :: &
& jsrfnatdic = 0 , &
@@ -363,6 +447,13 @@ module mo_bgcmean
& jbromo_prod= 0 , &
& jbromo_uv = 0
+ integer, dimension(nbgcmax) :: &
+ & janh3fx = 0 , &
+ & jsrfanh4 = 0 , &
+ & jsrfano2 = 0 , &
+ & jsrfpn2om = 0 , &
+ & jsrfpnh3 = 0
+
integer :: i_atm_m2d
integer, dimension(nbgcmax) :: &
& jatmco2 = 0 , &
@@ -370,7 +461,9 @@ module mo_bgcmean
& jatmn2 = 0 , &
& jatmc13 = 0 , &
& jatmc14 = 0 , &
- & jatmbromo= 0
+ & jatmbromo= 0 , &
+ & jatmnh3 = 0 , &
+ & jatmn2o = 0
integer :: nbgcm2d
@@ -402,6 +495,7 @@ module mo_bgcmean
& jprefo2 = 0 , &
& jo2sat = 0 , &
& jprefpo4 = 0 , &
+ & jprefsilica= 0 , &
& jprefalk = 0 , &
& jprefdic = 0 , &
& jdicsat = 0 , &
@@ -430,6 +524,7 @@ module mo_bgcmean
& jlvlprefo2 = 0 , &
& jlvlo2sat = 0 , &
& jlvlprefpo4= 0 , &
+ & jlvlprefsilica= 0 , &
& jlvlprefalk= 0 , &
& jlvlprefdic= 0 , &
& jlvldicsat = 0 , &
@@ -491,6 +586,66 @@ module mo_bgcmean
& jbromo = 0 , &
& jlvlbromo = 0
+ integer, dimension(nbgcmax) :: &
+ & janh4 = 0 , &
+ & jano2 = 0 , &
+ & jnitr_NH4 = 0 , &
+ & jnitr_NO2 = 0 , &
+ & jnitr_N2O_prod = 0 , &
+ & jnitr_NH4_OM = 0 , &
+ & jnitr_NO2_OM = 0 , &
+ & jdenit_NO3 = 0 , &
+ & jdenit_NO2 = 0 , &
+ & jdenit_N2O = 0 , &
+ & jDNRA_NO2 = 0 , &
+ & janmx_N2_prod = 0 , &
+ & janmx_OM_prod = 0 , &
+ & jphosy_NH4 = 0 , &
+ & jphosy_NO3 = 0 , &
+ & jremin_aerob = 0 , &
+ & jremin_sulf = 0 , &
+ & jagg_ws = 0 , &
+ & jdynvis = 0 , &
+ & jagg_stick = 0 , &
+ & jagg_stickf = 0 , &
+ & jagg_dmax = 0 , &
+ & jagg_avdp = 0 , &
+ & jagg_avrhop = 0 , &
+ & jagg_avdC = 0 , &
+ & jagg_df = 0 , &
+ & jagg_b = 0 , &
+ & jagg_Vrhof = 0 , &
+ & jagg_Vpor = 0 , &
+ & jlvlanh4 = 0 , &
+ & jlvlano2 = 0 , &
+ & jlvl_nitr_NH4 = 0 , &
+ & jlvl_nitr_NO2 = 0 , &
+ & jlvl_nitr_N2O_prod = 0 , &
+ & jlvl_nitr_NH4_OM = 0 , &
+ & jlvl_nitr_NO2_OM = 0 , &
+ & jlvl_denit_NO3 = 0 , &
+ & jlvl_denit_NO2 = 0 , &
+ & jlvl_denit_N2O = 0 , &
+ & jlvl_DNRA_NO2 = 0 , &
+ & jlvl_anmx_N2_prod = 0 , &
+ & jlvl_anmx_OM_prod = 0 , &
+ & jlvl_phosy_NH4 = 0 , &
+ & jlvl_phosy_NO3 = 0 , &
+ & jlvl_remin_aerob = 0 , &
+ & jlvl_remin_sulf = 0 , &
+ & jlvl_agg_ws = 0 , &
+ & jlvl_dynvis = 0 , &
+ & jlvl_agg_stick = 0 , &
+ & jlvl_agg_stickf = 0 , &
+ & jlvl_agg_dmax = 0 , &
+ & jlvl_agg_avdp = 0 , &
+ & jlvl_agg_avrhop = 0 , &
+ & jlvl_agg_avdC = 0 , &
+ & jlvl_agg_df = 0 , &
+ & jlvl_agg_b = 0 , &
+ & jlvl_agg_Vrhof = 0 , &
+ & jlvl_agg_Vpor = 0
+
integer :: nbgcm3d,nbgcm3dlvl
!----------------------------------------------------------------
@@ -507,7 +662,23 @@ module mo_bgcmean
& jssso12 = 0 , &
& jssssil = 0 , &
& jsssc12 = 0 , &
- & jssster = 0
+ & jssster = 0 , &
+ & jpownh4 = 0 , &
+ & jpown2o = 0 , &
+ & jpowno2 = 0 , &
+ & jsdm_nitr_NH4 = 0 , &
+ & jsdm_nitr_NO2 = 0 , &
+ & jsdm_nitr_N2O_prod = 0 , &
+ & jsdm_nitr_NH4_OM = 0 , &
+ & jsdm_nitr_NO2_OM = 0 , &
+ & jsdm_denit_NO3 = 0 , &
+ & jsdm_denit_NO2 = 0 , &
+ & jsdm_denit_N2O = 0 , &
+ & jsdm_DNRA_NO2 = 0 , &
+ & jsdm_anmx_N2_prod = 0 , &
+ & jsdm_anmx_OM_prod = 0 , &
+ & jsdm_remin_aerob = 0 , &
+ & jsdm_remin_sulf = 0
integer :: nbgct_sed
@@ -628,6 +799,8 @@ subroutine alloc_mem_bgcmean(kpie,kpje,kpke)
jexposi(n)=i_bsc_m2d*min(1,SRF_EXPOSI(n))
if (SRF_N2OFX(n) > 0) i_bsc_m2d=i_bsc_m2d+1
jn2ofx(n)=i_bsc_m2d*min(1,SRF_N2OFX(n))
+ if (SRF_PN2OM(n) > 0) i_bsc_m2d=i_bsc_m2d+1
+ jsrfpn2om(n)=i_bsc_m2d*min(1,SRF_PN2OM(n))
if (SRF_PHOSPH(n) > 0) i_bsc_m2d=i_bsc_m2d+1
jsrfphosph(n)=i_bsc_m2d*min(1,SRF_PHOSPH(n))
if (SRF_OXYGEN(n) > 0) i_bsc_m2d=i_bsc_m2d+1
@@ -652,8 +825,8 @@ subroutine alloc_mem_bgcmean(kpie,kpje,kpke)
jintnfix(n)=i_bsc_m2d*min(1,INT_NFIX(n))
if (INT_DNIT(n) > 0) i_bsc_m2d=i_bsc_m2d+1
jintdnit(n)=i_bsc_m2d*min(1,INT_DNIT(n))
- if (FLX_NDEP(n) > 0) i_bsc_m2d=i_bsc_m2d+1
- jndepfx(n)=i_bsc_m2d*min(1,FLX_NDEP(n))
+ if (FLX_NDEPNOY(n) > 0) i_bsc_m2d=i_bsc_m2d+1
+ jndepnoyfx(n)=i_bsc_m2d*min(1,FLX_NDEPNOY(n))
if (FLX_OALK(n) > 0) i_bsc_m2d=i_bsc_m2d+1
joalkfx(n)=i_bsc_m2d*min(1,FLX_OALK(n))
if (FLX_CAR0100(n) > 0) i_bsc_m2d=i_bsc_m2d+1
@@ -707,6 +880,22 @@ subroutine alloc_mem_bgcmean(kpie,kpje,kpke)
jsediffno3(n)=i_bsc_m2d*min(1,FLX_SEDIFFNO3(n))
if (FLX_SEDIFFSI(n) > 0) i_bsc_m2d=i_bsc_m2d+1
jsediffsi(n)=i_bsc_m2d*min(1,FLX_SEDIFFSI(n))
+ if (FLX_BURSSO12(n) > 0) i_bsc_m2d=i_bsc_m2d+1
+ jburflxsso12(n)=i_bsc_m2d*min(1,FLX_BURSSO12(n))
+ if (FLX_BURSSSC12(n) > 0) i_bsc_m2d=i_bsc_m2d+1
+ jburflxsssc12(n)=i_bsc_m2d*min(1,FLX_BURSSSC12(n))
+ if (FLX_BURSSSSIL(n) > 0) i_bsc_m2d=i_bsc_m2d+1
+ jburflxssssil(n)=i_bsc_m2d*min(1,FLX_BURSSSSIL(n))
+ if (FLX_BURSSSTER(n) > 0) i_bsc_m2d=i_bsc_m2d+1
+ jburflxssster(n)=i_bsc_m2d*min(1,FLX_BURSSSTER(n))
+ if (use_extNcycle) then
+ if (FLX_SEDIFFNH4(n) > 0) i_bsc_m2d=i_bsc_m2d+1
+ jsediffnh4(n)=i_bsc_m2d*min(1,FLX_SEDIFFNH4(n))
+ if (FLX_SEDIFFN2O(n) > 0) i_bsc_m2d=i_bsc_m2d+1
+ jsediffn2o(n)=i_bsc_m2d*min(1,FLX_SEDIFFN2O(n))
+ if (FLX_SEDIFFNO2(n) > 0) i_bsc_m2d=i_bsc_m2d+1
+ jsediffno2(n)=i_bsc_m2d*min(1,FLX_SEDIFFNO2(n))
+ endif
endif
if (use_cisonew) then
if (SRF_CO213FXD(n) > 0) i_bsc_m2d=i_bsc_m2d+1
@@ -748,6 +937,18 @@ subroutine alloc_mem_bgcmean(kpie,kpje,kpke)
if (INT_BROMOUV(n) > 0) i_bsc_m2d=i_bsc_m2d+1
jbromo_uv(n)=i_bsc_m2d*min(1,INT_BROMOUV(n))
endif
+ if (use_extNcycle) then
+ if (SRF_ANH3FX(n) > 0) i_bsc_m2d=i_bsc_m2d+1
+ janh3fx(n)=i_bsc_m2d*min(1,SRF_ANH3FX(n))
+ if (SRF_PNH3(n) > 0) i_bsc_m2d=i_bsc_m2d+1
+ jsrfpnh3(n)=i_bsc_m2d*min(1,SRF_PNH3(n))
+ if (SRF_ANH4(n) > 0) i_bsc_m2d=i_bsc_m2d+1
+ jsrfanh4(n)=i_bsc_m2d*min(1,SRF_ANH4(n))
+ if (SRF_ANO2(n) > 0) i_bsc_m2d=i_bsc_m2d+1
+ jsrfano2(n)=i_bsc_m2d*min(1,SRF_ANO2(n))
+ if (FLX_NDEPNHX(n) > 0) i_bsc_m2d=i_bsc_m2d+1
+ jndepnhxfx(n)=i_bsc_m2d*min(1,FLX_NDEPNHX(n))
+ endif
enddo
domassfluxes = any( &
@@ -778,6 +979,12 @@ subroutine alloc_mem_bgcmean(kpie,kpje,kpke)
if (SRF_ATMBROMO(n) > 0) i_atm_m2d=i_atm_m2d+1
jatmbromo(n)=i_atm_m2d*min(1,SRF_ATMBROMO(n))
endif
+ if (use_extNcycle) then
+ if (SRF_ATMNH3(n) > 0) i_atm_m2d=i_atm_m2d+1
+ jatmnh3(n)=i_atm_m2d*min(1,SRF_ATMNH3(n))
+ if (SRF_ATMN2O(n) > 0) i_atm_m2d=i_atm_m2d+1
+ jatmn2o(n)=i_atm_m2d*min(1,SRF_ATMN2O(n))
+ endif
enddo
i_atm_m2d=i_atm_m2d-i_bsc_m2d
@@ -830,6 +1037,8 @@ subroutine alloc_mem_bgcmean(kpie,kpje,kpke)
jo2sat(n)=i_bsc_m3d*min(1,LYR_O2SAT(n))
if (LYR_PREFPO4(n) > 0) i_bsc_m3d=i_bsc_m3d+1
jprefpo4(n)=i_bsc_m3d*min(1,LYR_PREFPO4(n))
+ if (LYR_PREFSILICA(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jprefsilica(n)=i_bsc_m3d*min(1,LYR_PREFSILICA(n))
if (LYR_PREFALK(n) > 0) i_bsc_m3d=i_bsc_m3d+1
jprefalk(n)=i_bsc_m3d*min(1,LYR_PREFALK(n))
if (LYR_PREFDIC(n) > 0) i_bsc_m3d=i_bsc_m3d+1
@@ -900,7 +1109,69 @@ subroutine alloc_mem_bgcmean(kpie,kpje,kpke)
if (LYR_BROMO(n) > 0) i_bsc_m3d=i_bsc_m3d+1
jbromo(n)=i_bsc_m3d*min(1,LYR_BROMO(n))
endif
-
+ if (use_extNcycle) then
+ if (LYR_ANH4(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ janh4(n)=i_bsc_m3d*min(1,LYR_ANH4(n))
+ if (LYR_ANO2(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jano2(n)=i_bsc_m3d*min(1,LYR_ANO2(n))
+ if (LYR_nitr_NH4(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jnitr_NH4(n)=i_bsc_m3d*min(1,LYR_nitr_NH4(n))
+ if (LYR_nitr_NO2(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jnitr_NO2(n)=i_bsc_m3d*min(1,LYR_nitr_NO2(n))
+ if (LYR_nitr_N2O_prod(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jnitr_N2O_prod(n)=i_bsc_m3d*min(1,LYR_nitr_N2O_prod(n))
+ if (LYR_nitr_NH4_OM(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jnitr_NH4_OM(n)=i_bsc_m3d*min(1,LYR_nitr_NH4_OM(n))
+ if (LYR_nitr_NO2_OM(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jnitr_NO2_OM(n)=i_bsc_m3d*min(1,LYR_nitr_NO2_OM(n))
+ if (LYR_denit_NO3(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jdenit_NO3(n)=i_bsc_m3d*min(1,LYR_denit_NO3(n))
+ if (LYR_denit_NO2(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jdenit_NO2(n)=i_bsc_m3d*min(1,LYR_denit_NO2(n))
+ if (LYR_denit_N2O(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jdenit_N2O(n)=i_bsc_m3d*min(1,LYR_denit_N2O(n))
+ if (LYR_DNRA_NO2(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jDNRA_NO2(n)=i_bsc_m3d*min(1,LYR_DNRA_NO2(n))
+ if (LYR_anmx_N2_prod(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ janmx_N2_prod(n)=i_bsc_m3d*min(1,LYR_anmx_N2_prod(n))
+ if (LYR_anmx_OM_prod(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ janmx_OM_prod(n)=i_bsc_m3d*min(1,LYR_anmx_OM_prod(n))
+ if (LYR_phosy_NH4(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jphosy_NH4(n)=i_bsc_m3d*min(1,LYR_phosy_NH4(n))
+ if (LYR_phosy_NO3(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jphosy_NO3(n)=i_bsc_m3d*min(1,LYR_phosy_NO3(n))
+ if (LYR_remin_aerob(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jremin_aerob(n)=i_bsc_m3d*min(1,LYR_remin_aerob(n))
+ if (LYR_remin_sulf(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jremin_sulf(n)=i_bsc_m3d*min(1,LYR_remin_sulf(n))
+ endif
+ if (use_M4AGO) then
+ ! M4AGO
+ if (LYR_agg_ws(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jagg_ws(n)=i_bsc_m3d*min(1,LYR_agg_ws(n))
+ if (LYR_dynvis(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jdynvis(n)=i_bsc_m3d*min(1,LYR_dynvis(n))
+ if (LYR_agg_stick(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jagg_stick(n)=i_bsc_m3d*min(1,LYR_agg_stick(n))
+ if (LYR_agg_stickf(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jagg_stickf(n)=i_bsc_m3d*min(1,LYR_agg_stickf(n))
+ if (LYR_agg_dmax(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jagg_dmax(n)=i_bsc_m3d*min(1,LYR_agg_dmax(n))
+ if (LYR_agg_avdp(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jagg_avdp(n)=i_bsc_m3d*min(1,LYR_agg_avdp(n))
+ if (LYR_agg_avrhop(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jagg_avrhop(n)=i_bsc_m3d*min(1,LYR_agg_avrhop(n))
+ if (LYR_agg_avdC(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jagg_avdC(n)=i_bsc_m3d*min(1,LYR_agg_avdC(n))
+ if (LYR_agg_df(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jagg_df(n)=i_bsc_m3d*min(1,LYR_agg_df(n))
+ if (LYR_agg_b(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jagg_b(n)=i_bsc_m3d*min(1,LYR_agg_b(n))
+ if (LYR_agg_Vrhof(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jagg_Vrhof(n)=i_bsc_m3d*min(1,LYR_agg_Vrhof(n))
+ if (LYR_agg_Vpor(n) > 0) i_bsc_m3d=i_bsc_m3d+1
+ jagg_Vpor(n)=i_bsc_m3d*min(1,LYR_agg_Vpor(n))
+ endif
if (LVL_PHYTO(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
jlvlphyto(n)=ilvl_bsc_m3d*min(1,LVL_PHYTO(n))
if (LVL_GRAZER(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
@@ -945,6 +1216,8 @@ subroutine alloc_mem_bgcmean(kpie,kpje,kpke)
jlvlo2sat(n)=ilvl_bsc_m3d*min(1,LVL_O2SAT(n))
if (LVL_PREFPO4(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
jlvlprefpo4(n)=ilvl_bsc_m3d*min(1,LVL_PREFPO4(n))
+ if (LVL_PREFSILICA(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvlprefsilica(n)=ilvl_bsc_m3d*min(1,LVL_PREFSILICA(n))
if (LVL_PREFALK(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
jlvlprefalk(n)=ilvl_bsc_m3d*min(1,LVL_PREFALK(n))
if (LVL_PREFDIC(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
@@ -1013,7 +1286,69 @@ subroutine alloc_mem_bgcmean(kpie,kpje,kpke)
if (LVL_BROMO(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
jlvlbromo(n)=ilvl_bsc_m3d*min(1,LVL_BROMO(n))
endif
-
+ if (use_extNcycle) then
+ if (LVL_ANH4(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvlanh4(n)=ilvl_bsc_m3d*min(1,LVL_ANH4(n))
+ if (LVL_ANO2(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvlano2(n)=ilvl_bsc_m3d*min(1,LVL_ANO2(n))
+ if (LVL_nitr_NH4(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_nitr_NH4(n)=ilvl_bsc_m3d*min(1,LVL_nitr_NH4(n))
+ if (LVL_nitr_NO2(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_nitr_NO2(n)=ilvl_bsc_m3d*min(1,LVL_nitr_NO2(n))
+ if (LVL_nitr_N2O_prod(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_nitr_N2O_prod(n)=ilvl_bsc_m3d*min(1,LVL_nitr_N2O_prod(n))
+ if (LVL_nitr_NH4_OM(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_nitr_NH4_OM(n)=ilvl_bsc_m3d*min(1,LVL_nitr_NH4_OM(n))
+ if (LVL_nitr_NO2_OM(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_nitr_NO2_OM(n)=ilvl_bsc_m3d*min(1,LVL_nitr_NO2_OM(n))
+ if (LVL_denit_NO3(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_denit_NO3(n)=ilvl_bsc_m3d*min(1,LVL_denit_NO3(n))
+ if (LVL_denit_NO2(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_denit_NO2(n)=ilvl_bsc_m3d*min(1,LVL_denit_NO2(n))
+ if (LVL_denit_N2O(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_denit_N2O(n)=ilvl_bsc_m3d*min(1,LVL_denit_N2O(n))
+ if (LVL_DNRA_NO2(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_DNRA_NO2(n)=ilvl_bsc_m3d*min(1,LVL_DNRA_NO2(n))
+ if (LVL_anmx_N2_prod(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_anmx_N2_prod(n)=ilvl_bsc_m3d*min(1,LVL_anmx_N2_prod(n))
+ if (LVL_anmx_OM_prod(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_anmx_OM_prod(n)=ilvl_bsc_m3d*min(1,LVL_anmx_OM_prod(n))
+ if (LVL_phosy_NH4(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_phosy_NH4(n)=ilvl_bsc_m3d*min(1,LVL_phosy_NH4(n))
+ if (LVL_phosy_NO3(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_phosy_NO3(n)=ilvl_bsc_m3d*min(1,LVL_phosy_NO3(n))
+ if (LVL_remin_aerob(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_remin_aerob(n)=ilvl_bsc_m3d*min(1,LVL_remin_aerob(n))
+ if (LVL_remin_sulf(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_remin_sulf(n)=ilvl_bsc_m3d*min(1,LVL_remin_sulf(n))
+ endif
+ if (use_M4AGO) then
+ ! M4AGO
+ if (LVL_agg_ws(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_agg_ws(n)=ilvl_bsc_m3d*min(1,LVL_agg_ws(n))
+ if (LVL_dynvis(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_dynvis(n)=ilvl_bsc_m3d*min(1,LVL_dynvis(n))
+ if (LVL_agg_stick(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_agg_stick(n)=ilvl_bsc_m3d*min(1,LVL_agg_stick(n))
+ if (LVL_agg_stickf(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_agg_stickf(n)=ilvl_bsc_m3d*min(1,LVL_agg_stickf(n))
+ if (LVL_agg_dmax(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_agg_dmax(n)=ilvl_bsc_m3d*min(1,LVL_agg_dmax(n))
+ if (LVL_agg_avdp(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_agg_avdp(n)=ilvl_bsc_m3d*min(1,LVL_agg_avdp(n))
+ if (LVL_agg_avrhop(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_agg_avrhop(n)=ilvl_bsc_m3d*min(1,LVL_agg_avrhop(n))
+ if (LVL_agg_avdC(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_agg_avdC(n)=ilvl_bsc_m3d*min(1,LVL_agg_avdC(n))
+ if (LVL_agg_df(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_agg_df(n)=ilvl_bsc_m3d*min(1,LVL_agg_df(n))
+ if (LVL_agg_b(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_agg_b(n)=ilvl_bsc_m3d*min(1,LVL_agg_b(n))
+ if (LVL_agg_Vrhof(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_agg_Vrhof(n)=ilvl_bsc_m3d*min(1,LVL_agg_Vrhof(n))
+ if (LVL_agg_Vpor(n) > 0) ilvl_bsc_m3d=ilvl_bsc_m3d+1
+ jlvl_agg_Vpor(n)=ilvl_bsc_m3d*min(1,LVL_agg_Vpor(n))
+ endif
if (i_bsc_m3d /= 0) checkdp(n)=1
enddo
@@ -1064,8 +1399,43 @@ subroutine alloc_mem_bgcmean(kpie,kpje,kpke)
if (BUR_SSSTER(n) > 0) i_bsc_bur=i_bsc_bur+1
jburssster(n)=i_bsc_bur*min(1,BUR_SSSTER(n))
enddo
+ if (use_extNcycle) then
+ do n=1,nbgc
+ if (SDM_POWNH4(n) > 0) i_bsc_sed=i_bsc_sed+1
+ jpownh4(n)=i_bsc_sed*min(1,SDM_POWNH4(n))
+ if (SDM_POWN2O(n) > 0) i_bsc_sed=i_bsc_sed+1
+ jpown2o(n)=i_bsc_sed*min(1,SDM_POWN2O(n))
+ if (SDM_POWNO2(n) > 0) i_bsc_sed=i_bsc_sed+1
+ jpowno2(n)=i_bsc_sed*min(1,SDM_POWNO2(n))
+ if (SDM_nitr_NH4(n) > 0) i_bsc_sed=i_bsc_sed+1
+ jsdm_nitr_NH4(n)=i_bsc_sed*min(1,SDM_nitr_NH4(n))
+ if (SDM_nitr_NO2(n) > 0) i_bsc_sed=i_bsc_sed+1
+ jsdm_nitr_NO2(n)=i_bsc_sed*min(1,SDM_nitr_NO2(n))
+ if (SDM_nitr_N2O_prod(n) > 0) i_bsc_sed=i_bsc_sed+1
+ jsdm_nitr_N2O_prod(n)=i_bsc_sed*min(1,SDM_nitr_N2O_prod(n))
+ if (SDM_nitr_NH4_OM(n) > 0) i_bsc_sed=i_bsc_sed+1
+ jsdm_nitr_NH4_OM(n)=i_bsc_sed*min(1,SDM_nitr_NH4_OM(n))
+ if (SDM_nitr_NO2_OM(n) > 0) i_bsc_sed=i_bsc_sed+1
+ jsdm_nitr_NO2_OM(n)=i_bsc_sed*min(1,SDM_nitr_NO2_OM(n))
+ if (SDM_denit_NO3(n) > 0) i_bsc_sed=i_bsc_sed+1
+ jsdm_denit_NO3(n)=i_bsc_sed*min(1,SDM_denit_NO3(n))
+ if (SDM_denit_NO2(n) > 0) i_bsc_sed=i_bsc_sed+1
+ jsdm_denit_NO2(n)=i_bsc_sed*min(1,SDM_denit_NO2(n))
+ if (SDM_denit_N2O(n) > 0) i_bsc_sed=i_bsc_sed+1
+ jsdm_denit_N2O(n)=i_bsc_sed*min(1,SDM_denit_N2O(n))
+ if (SDM_DNRA_NO2(n) > 0) i_bsc_sed=i_bsc_sed+1
+ jsdm_DNRA_NO2(n)=i_bsc_sed*min(1,SDM_DNRA_NO2(n))
+ if (SDM_anmx_N2_prod(n) > 0) i_bsc_sed=i_bsc_sed+1
+ jsdm_anmx_N2_prod(n)=i_bsc_sed*min(1,SDM_anmx_N2_prod(n))
+ if (SDM_anmx_OM_prod(n) > 0) i_bsc_sed=i_bsc_sed+1
+ jsdm_anmx_OM_prod(n)=i_bsc_sed*min(1,SDM_anmx_OM_prod(n))
+ if (SDM_remin_aerob(n) > 0) i_bsc_sed=i_bsc_sed+1
+ jsdm_remin_aerob(n)=i_bsc_sed*min(1,SDM_remin_aerob(n))
+ if (SDM_remin_sulf(n) > 0) i_bsc_sed=i_bsc_sed+1
+ jsdm_remin_sulf(n)=i_bsc_sed*min(1,SDM_remin_sulf(n))
+ enddo
+ endif
endif
-
nbgcm2d = i_bsc_m2d+i_atm_m2d
nbgcm3d = i_bsc_m3d
nbgcm3dlvl = ilvl_bsc_m3d
diff --git a/hamocc/mo_biomod.F90 b/hamocc/mo_biomod.F90
index 5ea92b33..56bea1c0 100644
--- a/hamocc/mo_biomod.F90
+++ b/hamocc/mo_biomod.F90
@@ -84,6 +84,22 @@ module mo_biomod
real, dimension (:,:), allocatable, public :: int_chbr3_prod
real, dimension (:,:), allocatable, public :: int_chbr3_uv
+ real, dimension (:,:,:), allocatable, public :: nitr_NH4
+ real, dimension (:,:,:), allocatable, public :: nitr_NO2
+ real, dimension (:,:,:), allocatable, public :: nitr_N2O_prod
+ real, dimension (:,:,:), allocatable, public :: nitr_NH4_OM
+ real, dimension (:,:,:), allocatable, public :: nitr_NO2_OM
+ real, dimension (:,:,:), allocatable, public :: denit_NO3
+ real, dimension (:,:,:), allocatable, public :: denit_NO2
+ real, dimension (:,:,:), allocatable, public :: denit_N2O
+ real, dimension (:,:,:), allocatable, public :: DNRA_NO2
+ real, dimension (:,:,:), allocatable, public :: anmx_N2_prod
+ real, dimension (:,:,:), allocatable, public :: anmx_OM_prod
+ real, dimension (:,:,:), allocatable, public :: phosy_NH4
+ real, dimension (:,:,:), allocatable, public :: phosy_NO3
+ real, dimension (:,:,:), allocatable, public :: remin_aerob
+ real, dimension (:,:,:), allocatable, public :: remin_sulf
+
CONTAINS
subroutine alloc_mem_biomod(kpie,kpje,kpke)
@@ -92,7 +108,7 @@ subroutine alloc_mem_biomod(kpie,kpje,kpke)
!******************************************************************************
use mod_xc, only: mnproc
use mo_control_bgc, only: io_stdo_bgc
- use mo_control_bgc, only: use_FB_BGC_OCE,use_AGG,use_BROMO
+ use mo_control_bgc, only: use_FB_BGC_OCE,use_AGG,use_BROMO,use_extNcycle
! Arguments
integer, intent(in) :: kpie
@@ -340,6 +356,48 @@ subroutine alloc_mem_biomod(kpie,kpje,kpke)
int_chbr3_uv(:,:) = 0.0
endif
+ if (use_extNcycle) then
+ if (mnproc.eq.1) then
+ write(io_stdo_bgc,*)'Memory allocation for variable of the extended nitrogen cycle ...'
+ write(io_stdo_bgc,*)'First dimension : ',kpie
+ write(io_stdo_bgc,*)'Second dimension : ',kpje
+ write(io_stdo_bgc,*)'Third dimension : ',kpke
+ endif
+
+ allocate (nitr_NH4(kpie,kpje,kpke),stat=errstat)
+ allocate (nitr_NO2(kpie,kpje,kpke),stat=errstat)
+ allocate (nitr_N2O_prod(kpie,kpje,kpke),stat=errstat)
+ allocate (nitr_NH4_OM(kpie,kpje,kpke),stat=errstat)
+ allocate (nitr_NO2_OM(kpie,kpje,kpke),stat=errstat)
+ allocate (denit_NO3(kpie,kpje,kpke),stat=errstat)
+ allocate (denit_NO2(kpie,kpje,kpke),stat=errstat)
+ allocate (denit_N2O(kpie,kpje,kpke),stat=errstat)
+ allocate (DNRA_NO2(kpie,kpje,kpke),stat=errstat)
+ allocate (anmx_N2_prod(kpie,kpje,kpke),stat=errstat)
+ allocate (anmx_OM_prod(kpie,kpje,kpke),stat=errstat)
+ allocate (phosy_NH4(kpie,kpje,kpke),stat=errstat)
+ allocate (phosy_NO3(kpie,kpje,kpke),stat=errstat)
+ allocate (remin_aerob(kpie,kpje,kpke),stat=errstat)
+ allocate (remin_sulf(kpie,kpje,kpke),stat=errstat)
+
+ if(errstat.ne.0) stop 'not enough memory extended nitrogen cycle'
+ nitr_NH4 = 0.
+ nitr_NO2 = 0.
+ nitr_N2O_prod = 0.
+ nitr_NH4_OM = 0.
+ nitr_NO2_OM = 0.
+ denit_NO3 = 0.
+ denit_NO2 = 0.
+ denit_N2O = 0.
+ DNRA_NO2 = 0.
+ anmx_N2_prod = 0.
+ anmx_OM_prod = 0.
+ phosy_NH4 = 0.
+ phosy_NO3 = 0.
+ remin_aerob = 0.
+ remin_sulf = 0.
+ endif
+
end subroutine alloc_mem_biomod
end module mo_biomod
diff --git a/hamocc/mo_carbch.F90 b/hamocc/mo_carbch.F90
index b10cc62b..a6ad8d0f 100644
--- a/hamocc/mo_carbch.F90
+++ b/hamocc/mo_carbch.F90
@@ -49,7 +49,8 @@ module mo_carbch
real, dimension (:,:,:,:), allocatable, public :: ocetra
real, dimension (:,:,:), allocatable, public :: atm
real, dimension (:,:,:), allocatable, public :: atmflx
- real, dimension (:,:), allocatable, public :: ndepflx
+ real, dimension (:,:), allocatable, public :: ndepnoyflx
+ real, dimension (:,:), allocatable, public :: ndepnhxflx
real, dimension (:,:), allocatable, public :: oalkflx
real, dimension (:,:,:), allocatable, public :: rivinflx
real, dimension (:,:,:), allocatable, public :: co3
@@ -61,9 +62,12 @@ module mo_carbch
real, dimension (:,:,:), allocatable, public :: satoxy
real, dimension (:,:), allocatable, public :: satn2o
+ real, dimension (:,:), allocatable, public :: pn2om
+ real, dimension (:,:), allocatable, public :: pnh3
real, dimension (:,:), allocatable, public :: atdifv
real, dimension (:,:), allocatable, public :: suppco2
real, dimension (:,:,:), allocatable, public :: sedfluxo
+ real, dimension (:,:,:), allocatable, public :: sedfluxb
real, dimension (:,:), allocatable, public :: pco2d
real, dimension (:,:), allocatable, public :: pco2m
@@ -98,8 +102,8 @@ subroutine alloc_mem_carbch(kpie,kpje,kpke)
use mod_xc, only: mnproc
use mo_control_bgc, only: io_stdo_bgc
- use mo_param1_bgc, only: nocetra,npowtra,natm,nriv
- use mo_control_bgc, only: use_natDIC,use_cisonew
+ use mo_param1_bgc, only: nocetra,npowtra,nsedtra,natm,nriv
+ use mo_control_bgc, only: use_natDIC,use_cisonew,use_extNcycle
integer, intent(in) :: kpie
integer, intent(in) :: kpje
@@ -221,6 +225,16 @@ subroutine alloc_mem_carbch(kpie,kpje,kpke)
if(errstat.ne.0) stop 'not enough memory sedfluxo'
sedfluxo(:,:,:) = 0.0
+ if (mnproc.eq.1) then
+ write(io_stdo_bgc,*)'Memory allocation for variable sedfluxb ..'
+ write(io_stdo_bgc,*)'First dimension : ',kpie
+ write(io_stdo_bgc,*)'Second dimension : ',kpje
+ write(io_stdo_bgc,*)'Third dimension : ',nsedtra
+ endif
+ allocate (sedfluxb(kpie,kpje,nsedtra),stat=errstat)
+ if(errstat.ne.0) stop 'not enough memory sedfluxb'
+ sedfluxo(:,:,:) = 0.0
+
if (mnproc.eq.1) then
write(io_stdo_bgc,*)'Memory allocation for variable satn2o ...'
write(io_stdo_bgc,*)'First dimension : ',kpie
@@ -230,6 +244,15 @@ subroutine alloc_mem_carbch(kpie,kpje,kpke)
if(errstat.ne.0) stop 'not enough memory satn2o'
satn2o(:,:) = 0.0
+ if (mnproc.eq.1) then
+ write(io_stdo_bgc,*)'Memory allocation for variable pn2om ...'
+ write(io_stdo_bgc,*)'First dimension : ',kpie
+ write(io_stdo_bgc,*)'Second dimension : ',kpje
+ endif
+ allocate (pn2om(kpie,kpje),stat=errstat)
+ if(errstat.ne.0) stop 'not enough memory pn2om'
+ pn2om(:,:) = 0.0
+
if (mnproc.eq.1) then
write(io_stdo_bgc,*)'Memory allocation for variable keqb ...'
write(io_stdo_bgc,*)'First dimension : ',11
@@ -274,13 +297,13 @@ subroutine alloc_mem_carbch(kpie,kpje,kpke)
! Allocate field to hold N-deposition fluxes per timestep for
! inventory calculations and output
if (mnproc.eq.1) then
- write(io_stdo_bgc,*)'Memory allocation for variable ndepflx ...'
+ write(io_stdo_bgc,*)'Memory allocation for variable ndepnoyflx ...'
write(io_stdo_bgc,*)'First dimension : ',kpie
write(io_stdo_bgc,*)'Second dimension : ',kpje
endif
- allocate (ndepflx(kpie,kpje),stat=errstat)
- if(errstat.ne.0) stop 'not enough memory ndepflx'
- ndepflx(:,:) = 0.0
+ allocate (ndepnoyflx(kpie,kpje),stat=errstat)
+ if(errstat.ne.0) stop 'not enough memory ndepfnoylx'
+ ndepnoyflx(:,:) = 0.0
! Allocate field to hold OA alkalinity fluxes per timestep for
! inventory calculations and output
@@ -386,6 +409,27 @@ subroutine alloc_mem_carbch(kpie,kpje,kpke)
co214fxu(:,:) = 0.0
endif
+ if (use_extNcycle) then
+ if (mnproc.eq.1) then
+ write(io_stdo_bgc,*)'Memory allocation for variable pnh3 ...'
+ write(io_stdo_bgc,*)'First dimension : ',kpie
+ write(io_stdo_bgc,*)'Second dimension : ',kpje
+ endif
+ allocate (pnh3(kpie,kpje),stat=errstat)
+ if(errstat.ne.0) stop 'not enough memory pnh3'
+ pnh3(:,:) = 0.0
+
+ ! Allocate field to hold N-deposition NHx fluxes per timestep for inventory caluclations
+ if (mnproc.eq.1) then
+ write(io_stdo_bgc,*)'Memory allocation for variable ndepnhxflx ...'
+ write(io_stdo_bgc,*)'First dimension : ',kpie
+ write(io_stdo_bgc,*)'Second dimension : ',kpje
+ endif
+ allocate (ndepnhxflx(kpie,kpje),stat=errstat)
+ if(errstat.ne.0) stop 'not enough memory ndepnhxflx'
+ ndepnhxflx(:,:) = 0.0
+ endif
+
end subroutine alloc_mem_carbch
!*************************************************************************************************
diff --git a/hamocc/mo_carchm.F90 b/hamocc/mo_carchm.F90
index c7fdb6f7..200979a5 100644
--- a/hamocc/mo_carchm.F90
+++ b/hamocc/mo_carchm.F90
@@ -68,12 +68,14 @@ subroutine carchm(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,prho,pglat,omask,psicomo
use mo_carbch, only: atm,atmflx,co2fxd,co2fxu,co2star,co3,hi,keqb,kwco2sol, &
ocetra,omegaa,omegac,pco2d,satn2o,satoxy, &
- pco2m,kwco2d,co2sold,co2solm
- use mo_chemcon, only: al1,al2,al3,al4,an0,an1,an2,an3,an4,an5,an6,atn2o, &
+ pco2m,kwco2d,co2sold,co2solm,pn2om
+ use mo_chemcon, only: al1,al2,al3,al4,an0,an1,an2,an3,an4,an5,an6, &
bl1,bl2,bl3,calcon,ox0,ox1,ox2,ox3,ox4,ox5,ox6, &
- oxyco,tzero
+ oxyco,tzero, &
+ SV0_air,SV1_air,SV2_air,SV3_air,SV4_air,SD0_air,SD1_air,SD2_air, &
+ SD3_air,Vb_nh3,M_nh3,kappa
use mo_control_bgc, only: dtbgc,use_cisonew,use_natDIC,use_CFC,use_BROMO, &
- use_cisonew,use_sedbypass
+ use_cisonew,use_sedbypass,use_extNcycle
use mo_param1_bgc, only: ialkali,iatmo2,iatmco2,iatmdms,iatmn2,iatmn2o,ian2o,icalc, &
idicsat,idms,igasnit,ioxygen,iphosph, &
isco212,isilica, &
@@ -82,13 +84,13 @@ subroutine carchm(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,prho,pglat,omask,psicomo
isco213,isco214,izoo14,safediv, &
iatmnco2,inatalkali,inatcalc,inatsco212, &
ks,issso14,isssc14,ipowc14, &
- iatmbromo,ibromo
- use mo_param_bgc, only: c14dec,atm_co2_nat
+ iatmbromo,ibromo,iatmnh3,ianh4
+ use mo_param_bgc, only: c14dec,atm_co2_nat,atm_n2o
use mo_vgrid, only: dp_min,kmle,kbo,ptiestu
use mo_carbch, only: atm_cfc11_nh,atm_cfc11_sh,atm_cfc12_nh,atm_cfc12_sh, &
atm_sf6_nh,atm_sf6_sh, &
co213fxd,co213fxu,co214fxd,co214fxu, &
- nathi,natco3,natpco2d,natomegaa,natomegac
+ nathi,natco3,natpco2d,natomegaa,natomegac,pnh3
use mo_sedmnt, only: sedlay,powtra,burial
! Arguments
@@ -117,7 +119,7 @@ subroutine carchm(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,prho,pglat,omask,psicomo
real :: scco2,sco2,scn2,scdms,scn2o
real :: xconvxa
real :: oxflux,niflux,dmsflux,n2oflux
- real :: ato2,atn2,atco2,pco2
+ real :: ato2,atn2,atco2,pco2,atn2o
real :: oxy,ani,anisa
real :: rrho,t,t2,t3,t4,tk,tk100,prb,s,rs
real :: Kh,Khd,K1,K2,Kb,K1p,K2p,K3p,Ksi,Kw,Ks1,Kf,Kspc,Kspa
@@ -135,6 +137,10 @@ subroutine carchm(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,prho,pglat,omask,psicomo
real :: atco213,atco214,pco213,pco214 ! cisonew
real :: frac_k,frac_aqg,frac_dicg ! cisonew
real :: flx_bromo,sch_bromo,kw_bromo,a_bromo,atbrf,Kb1,lsub ! BROMO
+ ! extNcycle
+ real :: flx_nh3,sch_nh3_a,sch_nh3_w,kw_nh3,ka_nh3,atnh3,diff_nh3_a,diff_nh3_w,mu_air,mu_w,p_dbar,rho_air
+ real :: h_nh3,hstar_nh3,pKa_nh3,eps_safe,Kh_nh3,cD_wind,u_star
+ eps_safe = epsilon(1.)
! set variables for diagnostic output to zero
atmflx (:,:,:)=0.
@@ -151,6 +157,7 @@ subroutine carchm(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,prho,pglat,omask,psicomo
satoxy (:,:,:)=0.
omegaA (:,:,:)=0.
omegaC (:,:,:)=0.
+ pn2om (:,:)=0.
if (use_cisonew) then
co213fxd (:,:)=0.
co213fxu (:,:)=0.
@@ -163,12 +170,15 @@ subroutine carchm(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,prho,pglat,omask,psicomo
natomegaA(:,:,:)=0.
natomegaC(:,:,:)=0.
endif
+ if (use_extNcycle) then
+ pnh3 (:,:)=0.
+ endif
!$OMP PARALLEL DO PRIVATE(t,t2,t3,t4,tk,tk100,s,rs,prb,Kh,Khd,K1,K2 &
!$OMP ,Kb,K1p,K2p,K3p,Ksi,Kw,Ks1,Kf,Kspc,Kspa,tc,ta,sit,pt,ah1,ac &
!$OMP ,cu,cb,cc,pco2,rpp0,scco2,scdms,sco2,oxy,ani,anisa,Xconvxa &
- !$OMP ,kwco2,kwdms,kwo2,atco2,ato2,atn2,fluxd,fluxu,oxflux,tc_sat &
- !$OMP ,niflux,n2oflux,dmsflux,omega,supsat,undsa,dissol &
+ !$OMP ,kwco2,kwdms,kwo2,atco2,ato2,atn2,atn2o,fluxd,fluxu,oxflux &
+ !$OMP ,tc_sat,niflux,n2oflux,dmsflux,omega,supsat,undsa,dissol &
!$OMP ,sch_11,sch_12,sch_sf,kw_11,kw_12,kw_sf,a_11,a_12,a_sf,flx11 &
!$OMP ,flx12,flxsf,atm_cfc11,atm_cfc12,atm_sf6,fact &
!$OMP ,natcu,natcb,natcc,natpco2,natfluxd,natfluxu,natomega &
@@ -176,6 +186,9 @@ subroutine carchm(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,prho,pglat,omask,psicomo
!$OMP ,atco213,atco214,rco213,rco214,pco213,pco214,frac_aqg &
!$OMP ,frac_dicg,flux13d,flux13u,flux14d,flux14u,dissol13,dissol14 &
!$OMP ,flx_bromo,sch_bromo,kw_bromo,a_bromo,atbrf,Kb1,lsub &
+ !$OMP ,flx_nh3,sch_nh3_a,sch_nh3_w,kw_nh3,ka_nh3,atnh3 &
+ !$OMP ,diff_nh3_a,diff_nh3_w,mu_air,mu_w,p_dbar,rho_air,h_nh3 &
+ !$OMP ,hstar_nh3,pKa_nh3,eps_safe,Kh_nh3,cD_wind,u_star &
!$OMP ,k,j,i,rrho,scn2,scn2o,kwn2,kwn2o)
do k=1,kpke
do j=1,kpje
@@ -266,7 +279,37 @@ subroutine carchm(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,prho,pglat,omask,psicomo
! (2003; GBC)
sch_bromo = 4662.8 - 319.45*t + 9.9012*t2 - 0.1159*t3
endif
-
+ if (use_extNcycle) then
+ ! Tsilingiris 2008 Eq.(45) for moist air (kg/m s)
+ mu_air = SV0_air + SV1_air*t + SV2_air*t2 + SV3_air*t3 + SV4_air*t4
+
+ ! Tsinlingiris(44) moist air density (kg/m3)
+ rho_air = SD0_air + SD1_air*t + SD2_air*t2 + SD3_air*t3
+
+ ! molecular viscosity of sea water
+ ! (Matthaeus 1972, Richards 1998,assuming salinity s in per mille = ~PSU)
+ p_dbar = ppao(i,j)*1e-4 ! sea level pressure (Pa *1e-5 -> bar *10-> dbar
+ mu_w = 1.79e-2 - 6.1299e-4 * t + 1.4467e-5 * t2 - 1.6826e-7 * t3 &
+ & - 1.8266e-7 * p_dbar + 9.8972e-12 * p_dbar*p_dbar + 2.4727e-5 * s &
+ & + s * (4.8429e-7 * t - 4.7172e-8 * t2 + 7.5986e-10 * t3) &
+ & + s * (1.3817e-8 * t - 2.6363e-10 * t2) &
+ & - p_dbar*p_dbar * (6.3255e-13 * t - 1.2116e-14 * t2)
+ mu_w = mu_w * 0.1 ! conversion from g/(cm s) to kg/(m s)
+
+ ! diffusion coeff in air (m2/s) Fuller 1966 / Johnson 2010
+ ! division by pressure: ppao [Pa]; in Fuller, p is a factor for denominator [atm]
+ diff_nh3_a = 1e-7 * (t+273.15)**1.75 * M_nh3 / (ppao(i,j)/101325.0)
+
+ ! Johnson 2010 - (34) cm2/s -> m2/s (1e-8*1e-4=1e-12)
+ ! closer to fit for Li & Gregory of: 9.874e-6*exp(2.644e-2*t)
+ ! mu_w*1000: kg/(m s) -> cPoise as in Eq.(34) of Johnson 2010
+ diff_nh3_w = 1.25e-12*(t+273.15)**1.52 *(mu_w*1000.)**(9.58/Vb_nh3 -1.12)*(Vb_nh3**(-0.19) - 0.292)
+
+ ! Schmidt number air phase
+ sch_nh3_a = mu_air /(diff_nh3_a * rho_air)
+ ! Schmidt number water phase
+ sch_nh3_w = mu_w /(diff_nh3_w * rrho * 1000.)
+ endif
! solubility of N2 (Weiss, R.F. 1970, Deep-Sea Res., 17, 721-735) for moist air
! at 1 atm; multiplication with oxyco converts to kmol/m^3/atm
ani=an0+an1/tk100+an2*alog(tk100)+an3*tk100+s*(an4+an5*tk100+an6*tk100**2)
@@ -298,7 +341,14 @@ subroutine carchm(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,prho,pglat,omask,psicomo
!Henry's law constant [dimensionless] for Bromoform from Quack and Wallace (2003; GBC)
a_bromo = exp(13.16 - 4973*(1/tk))
endif
-
+ if (use_extNcycle) then
+ !Henry number for NH3 (Paulot et al. 2015, )
+ h_nh3 = (17.93*(t+273.15)/273.15 * exp(4092./(t+273.15) - 9.7))**(-1)
+ ! Dissociation constant (Paulot et al. 2015, Bell 2007/2008)
+ pKa_nh3 = 10.0423 - 3.15536e-2*t + 3.071e-3*s
+ ! effective gas-over-liquid Henry constant (Paulot et al. 2015)
+ hstar_nh3 = h_nh3/(1. + 10.**(log10(hi(i,j,k))+pKa_nh3))
+ endif
! Transfer (piston) velocity kw according to Wanninkhof (2014), in units of ms-1
Xconvxa = 6.97e-07 ! Wanninkhof's a=0.251 converted from [cm hr-1]/[m s-1]^2 to [ms-1]/[m s-1]^2
kwco2 = (1.-psicomo(i,j)) * Xconvxa * pfu10(i,j)**2*(660./scco2)**0.5
@@ -317,10 +367,27 @@ subroutine carchm(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,prho,pglat,omask,psicomo
kw_bromo=(1.-psicomo(i,j)) * 1.e-2/3600. * &
& (0.222*pfu10(i,j)**2+0.33*pfu10(i,j))*(660./sch_bromo)**0.5
endif
+ if (use_extNcycle) then
+ ! Paulot et al. 2015 / Johnson 2010
+ ! friction velocity of wind (m/s)
+ u_star = pfu10(i,j)*sqrt(6.1e-4 + 6.3e-5*pfu10(i,j))
+ ! wind drag coeff (-)
+ cD_wind = (u_star / (pfu10(i,j) + eps_safe))**2.
+ ! gas transfer velocity on gas phase side (m/s)
+ ka_nh3 = 1e-3 + u_star/ (13.3*sch_nh3_a + (eps_safe + cD_wind)**(-0.5) - 5. + log(sch_nh3_a)/(2.*kappa))
+ ! gas transfer velocity on liquid phase side (m/s) Nightingale 2000b - 3600*100: cm/h -> m/s
+ kw_nh3 = (0.24*pfu10(i,j)**2 + 0.061*pfu10(i,j))*sqrt(600./sch_nh3_w)/360000.
+
+ ! total effective gas transfer velocity (m/s)
+ Kh_nh3 = (1./(ka_nh3 + eps_safe) + hstar_nh3/(kw_nh3 + eps_safe))**(-1.)
+ ! account for ice
+ Kh_nh3 = (1.-psicomo(i,j)) * Kh_nh3
+ endif
atco2 = atm(i,j,iatmco2)
ato2 = atm(i,j,iatmo2)
atn2 = atm(i,j,iatmn2)
+ atn2o = atm(i,j,iatmn2o)
if (use_cisonew) then
atco213 = atm(i,j,iatmc13)
atco214 = atm(i,j,iatmc14)
@@ -328,6 +395,9 @@ subroutine carchm(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,prho,pglat,omask,psicomo
if (use_BROMO) then
atbrf = atm(i,j,iatmbromo)
endif
+ if (use_extNcycle) then
+ atnh3 = atm(i,j,iatmnh3)
+ endif
! Ratio P/P_0, where P is the local SLP and P_0 is standard pressure (1 atm). This is
! used in all surface flux calculations where atmospheric concentration is given as a
@@ -385,7 +455,9 @@ subroutine carchm(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,prho,pglat,omask,psicomo
niflux=kwn2*dtbgc*(ocetra(i,j,1,igasnit)-anisa*(atn2/802000)*rpp0)
ocetra(i,j,1,igasnit)=ocetra(i,j,1,igasnit)-niflux/pddpo(i,j,1)
! Surface flux of laughing gas (same piston velocity as for O2 and N2)
- n2oflux=kwn2o*dtbgc*(ocetra(i,j,1,ian2o)-satn2o(i,j)*atn2o*rpp0)
+ n2oflux=kwn2o*dtbgc*(ocetra(i,j,1,ian2o)-satn2o(i,j)*atn2o*1e-12*rpp0)
+ ! pN2O under moist air assumption at normal pressure
+ pn2om(i,j) = 1e9 * ocetra(i,j,1,ian2o)/satn2o(i,j)
ocetra(i,j,1,ian2o)=ocetra(i,j,1,ian2o)-n2oflux/pddpo(i,j,1)
if (use_CFC) then
! Surface fluxes for CFC: eqn. (1a) in ocmip2 howto doc(hyc)
@@ -441,12 +513,20 @@ subroutine carchm(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,prho,pglat,omask,psicomo
ocetra(i,j,1,ibromo) = ocetra(i,j,1,ibromo) + flx_bromo/pddpo(i,j,1)
atmflx(i,j,iatmbromo) = -flx_bromo
endif
+ if (use_extNcycle) then
+ ! surface flux NH3 - currently assumed atNH3 in pptv
+ flx_nh3 = Kh_nh3*dtbgc*(atnh3*1e-12*ppao(i,j)*1e-5/(tk*0.08314510) - hstar_nh3*ocetra(i,j,1,ianh4))
+ ocetra(i,j,1,ianh4) = ocetra(i,j,1,ianh4) + flx_nh3/pddpo(i,j,1)
+
+ ! pNH3 in natm
+ pnh3(i,j) = hstar_nh3*ocetra(i,j,1,ianh4) * 8.20573660809596e-5 * (t+273.15) * 1e12
+ endif
! Save surface fluxes
atmflx(i,j,iatmco2)=fluxu-fluxd
atmflx(i,j,iatmo2)=oxflux
atmflx(i,j,iatmn2)=niflux
- atmflx(i,j,iatmn2o)=n2oflux
+ atmflx(i,j,iatmn2o)=n2oflux ! positive to atmosphere [kmol N2O m-2 timestep-1]
if (use_cisonew) then
atmflx(i,j,iatmc13)=flux13u-flux13d
atmflx(i,j,iatmc14)=flux14u-flux14d
@@ -459,7 +539,9 @@ subroutine carchm(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,prho,pglat,omask,psicomo
if (use_natDIC) then
atmflx(i,j,iatmnco2)=natfluxu-natfluxd
endif
-
+ if (use_extNcycle) then
+ atmflx(i,j,iatmnh3)=-flx_nh3 ! positive to atmosphere [kmol NH3 m-2 timestep-1]
+ endif
! Save up- and downward components of carbon fluxes for output
co2fxd(i,j) = fluxd
co2fxu(i,j) = fluxu
diff --git a/hamocc/mo_chemcon.F90 b/hamocc/mo_chemcon.F90
index 34325c6d..1ef3e168 100644
--- a/hamocc/mo_chemcon.F90
+++ b/hamocc/mo_chemcon.F90
@@ -138,9 +138,33 @@ module mo_chemcon
real, parameter :: bl3= -0.0048472
! -----------------------------------------------------------------
- ! Atmospheric mixing ratio of N2O around 1980 300 ppb
- !
- real, parameter :: atn2o=3.e-7
+ ! NH3/NH4
+ ! Tsilingiris 2008
+ ! moist air dynamic viscosity parameters
+ real, parameter :: SV0_air = 1.715747771e-5
+ real, parameter :: SV1_air = 4.722402075e-8
+ real, parameter :: SV2_air = -3.663027156e-10
+ real, parameter :: SV3_air = 1.873236686e-12
+ real, parameter :: SV4_air = -8.050218737e-14
+
+ ! moist air density parameters
+ real, parameter :: SD0_air = 1.293393662
+ real, parameter :: SD1_air = -5.538444326e-3
+ real, parameter :: SD2_air = 3.860201577e-5
+ real, parameter :: SD3_air = -5.2536065e-7
+
+ ! diffusion of NH3 in water and air
+ real, parameter :: Va_air = 20.1 ! Johnson 2010
+ real, parameter :: Ma_air = 28.97 ! Johnson 2010
+ real, parameter :: Mb_nh3 = 17.03 ! Johnson 2010, Tang 2014
+ real, parameter :: Vb_nh3 = 20.7 ! Johnson 2010
+ real, parameter :: M_nh3 = (1./Ma_air + 1./Mb_nh3)**0.5 / (Va_air**(1./3.)+Vb_nh3**(1./3.))**2.
+ real, parameter :: kappa = 0.4 ! von Karman constant
+
+ real, parameter :: mw_nitrogen = 14.00674 ! [g/mol N] nitrogen mol-weight as defined by CAM
+ real, parameter :: mw_nh3 = 17.028940 ! [g/mol NH3] ammonia mol-weight as defined by CAM
+ real, parameter :: mw_n2o = 44.012880 ! [g/mol N2O] nitrous oxide mol-weight as defined by CAM
+
! -----------------------------------------------------------------
! Constants needed for pressure correction of equilibrium constants
diff --git a/hamocc/mo_control_bgc.F90 b/hamocc/mo_control_bgc.F90
index 551dc836..0da1dcf0 100644
--- a/hamocc/mo_control_bgc.F90
+++ b/hamocc/mo_control_bgc.F90
@@ -54,15 +54,19 @@ module mo_control_bgc
! Variables set via namelist bgcnml
logical :: l_3Dvarsedpor = .false. ! apply spatially variable sediment porosity
logical :: do_ndep = .true. ! apply n-deposition
+ logical :: do_ndep_coupled = .false. ! for coupled simulations, use field provided by atmosphere
+ logical :: do_n2onh3_coupled = .false. ! for coupled simulations, use field provided by atmosphere
logical :: do_rivinpt = .true. ! apply riverine input
logical :: do_sedspinup = .false. ! apply sediment spin-up
logical :: do_oalk = .false. ! apply ocean alkalinization
logical :: with_dmsph = .false. ! apply DMS with pH dependence
+ logical :: use_M4AGO = .false. ! run with M4AGO settling scheme
+ logical :: leuphotic_cya = .true. ! allow cyanobacteria to grow only in euphotic zone
integer :: sedspin_yr_s = -1 ! start year for sediment spin-up
integer :: sedspin_yr_e = -1 ! end year for sediment spin-up
integer :: sedspin_ncyc = -1 ! sediment spin-up sub-cycles
character(len=64) :: ocn_co2_type ! indicates co2 coupling to an active atm
- ! model if set to 'diagnostic'
+ ! model if set to 'diagnostic'
! or 'prognostic'
! Logical switches set via namelist config_bgc
@@ -77,6 +81,7 @@ module mo_control_bgc
logical :: use_FB_BGC_OCE = .false.
logical :: use_BOXATM = .false.
logical :: use_sedbypass = .false.
+ logical :: use_extNcycle = .false.
contains
diff --git a/hamocc/mo_cyano.F90 b/hamocc/mo_cyano.F90
index 868ea204..93c72970 100644
--- a/hamocc/mo_cyano.F90
+++ b/hamocc/mo_cyano.F90
@@ -44,12 +44,12 @@ subroutine cyano(kpie,kpje,kpke,kbnd,pddpo,omask,ptho)
! - added reduction of alkalinity through N-fixation
!***********************************************************************************************
- use mo_vgrid, only: kmle
+ use mo_vgrid, only: kmle,kwrbioz
use mo_carbch, only: ocetra
use mo_param_bgc, only: bluefix,rnit,tf0,tf1,tf2,tff
- use mo_param1_bgc, only: ialkali,iano3,igasnit,iphosph,ioxygen,inatalkali
+ use mo_param1_bgc, only: ialkali,iano3,igasnit,iphosph,ioxygen,inatalkali,ianh4
use mo_biomod, only: intnfix
- use mo_control_bgc, only: use_natDIC
+ use mo_control_bgc, only: use_natDIC,leuphotic_cya,use_extNcycle
! Arguments
integer, intent(in) :: kpie ! 1st dimension of model grid.
@@ -62,46 +62,64 @@ subroutine cyano(kpie,kpje,kpke,kbnd,pddpo,omask,ptho)
! Local variables
integer :: i,j,k
- real :: oldocetra,dano3
+ real :: oldocetra,anavail,dansp,dox,dalk
real :: ttemp,nfixtfac
intnfix(:,:)=0.0
+
!
! N-fixation by cyano bacteria (followed by remineralisation and nitrification),
+ ! or, for the extended nitrogen cycle only by remin to NH4),
! it is assumed here that this process is limited to the mixed layer
!
do j=1,kpje
do i=1,kpie
- if (omask(i,j).gt.0.5) then
- do k=1,kmle(i,j)
+ if (omask(i,j) > 0.5) then
+ do k=1,merge(kwrbioz(i,j),kmle(i,j),leuphotic_cya) ! if leuphotic_cya=.true., do bluefix only in euphotic zone
if (ocetra(i,j,k,iano3) < (rnit*ocetra(i,j,k,iphosph))) then
-
- oldocetra = ocetra(i,j,k,iano3)
- ttemp = min(40.,max(-3.,ptho(i,j,k)))
-
- ! Temperature dependence of nitrogen fixation, Kriest and Oschlies 2015.
- nfixtfac = max(0.0,tf2*ttemp*ttemp + tf1*ttemp + tf0)/tff
-
- ocetra(i,j,k,iano3)=ocetra(i,j,k,iano3)*(1-bluefix*nfixtfac) &
- & + bluefix*nfixtfac*rnit*ocetra(i,j,k,iphosph)
-
- dano3=ocetra(i,j,k,iano3)-oldocetra
-
- ocetra(i,j,k,igasnit)=ocetra(i,j,k,igasnit)-dano3*(1./2.)
-
- ! Note: to fix one mole N2 requires: N2+H2O+y*O2 = 2* HNO3 <-> y=2.5 mole O2.
- ! I.e., to release one mole HNO3 = H+ + NO3- requires 1.25 mole O2
- ocetra(i,j,k,ioxygen)=ocetra(i,j,k,ioxygen)-dano3*1.25
-
- ! Nitrogen fixation followed by remineralisation and nitrification decreases
- ! alkalinity by 1 mole per mole nitrogen fixed (Wolf-Gladrow et al. 2007)
- ocetra(i,j,k,ialkali)=ocetra(i,j,k,ialkali)-dano3
- if (use_natDIC) then
- ocetra(i,j,k,inatalkali)=ocetra(i,j,k,inatalkali)-dano3
+ if (use_extNcycle) then
+ ! assuming nitrate and ammonium required for cyanobacteria growth (as bulk PP)
+ anavail = ocetra(i,j,k,iano3) + ocetra(i,j,k,ianh4)
+ else
+ anavail = ocetra(i,j,k,iano3)
+ endif
+ if(anavail < (rnit*ocetra(i,j,k,iphosph))) then
+
+ ttemp = min(40.,max(-3.,ptho(i,j,k)))
+
+ ! Temperature dependence of nitrogen fixation, Kriest and Oschlies 2015.
+ nfixtfac = max(0.0,tf2*ttemp*ttemp + tf1*ttemp + tf0)/tff
+
+ if (.not. use_extNcycle) then
+ oldocetra = ocetra(i,j,k,iano3)
+ ocetra(i,j,k,iano3) = ocetra(i,j,k,iano3)*(1. - bluefix*nfixtfac) &
+ + bluefix*nfixtfac*rnit*ocetra(i,j,k,iphosph)
+ dansp = ocetra(i,j,k,iano3) - oldocetra
+ ! Note: to fix one mole N2 requires: N2+H2O+y*O2 = 2* HNO3 <-> y=2.5 mole O2.
+ ! I.e., to release one mole HNO3 = H+ + NO3- requires 1.25 mole O2
+ dox = -dansp*1.25
+ ! Nitrogen fixation followed by remineralisation and nitrification decreases
+ ! alkalinity by 1 mole per mole nitrogen fixed (Wolf-Gladrow et al. 2007)
+ dalk = -dansp
+ else
+ oldocetra = ocetra(i,j,k,ianh4)
+ ocetra(i,j,k,ianh4) = ocetra(i,j,k,ianh4)*(1. - bluefix*nfixtfac) &
+ + bluefix*nfixtfac*rnit*ocetra(i,j,k,iphosph)
+ dansp = ocetra(i,j,k,ianh4) - oldocetra
+ dox = dansp*0.75
+ dalk = dansp
+ endif
+ ocetra(i,j,k,igasnit) = ocetra(i,j,k,igasnit) - dansp*0.5
+
+ ocetra(i,j,k,ioxygen) = ocetra(i,j,k,ioxygen) + dox
+
+ ocetra(i,j,k,ialkali) = ocetra(i,j,k,ialkali) + dalk
+ if (use_natDIC) then
+ ocetra(i,j,k,inatalkali) = ocetra(i,j,k,inatalkali) + dalk
+ endif
+
+ intnfix(i,j) = intnfix(i,j) + dansp*pddpo(i,j,k)
endif
-
- intnfix(i,j) = intnfix(i,j) + (ocetra(i,j,k,iano3)-oldocetra)*pddpo(i,j,k)
-
endif
enddo
endif
diff --git a/hamocc/mo_extNsediment.F90 b/hamocc/mo_extNsediment.F90
new file mode 100644
index 00000000..546ae10e
--- /dev/null
+++ b/hamocc/mo_extNsediment.F90
@@ -0,0 +1,434 @@
+! Copyright (C) 2022 j. maerz
+!
+! This file is part of BLOM/iHAMOCC.
+!
+! BLOM is free software: you can redistribute it and/or modify it under the
+! terms of the GNU Lesser General Public License as published by the Free
+! Software Foundation, either version 3 of the License, or (at your option)
+! any later version.
+!
+! BLOM is distributed in the hope that it will be useful, but WITHOUT ANY
+! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+! FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
+! more details.
+!
+! You should have received a copy of the GNU Lesser General Public License
+! along with BLOM. If not, see https://www.gnu.org/licenses/.
+
+module mo_extNsediment
+ !**********************************************************************
+ !
+ ! MODULE mo_extNsediment - extended nitrogen cycle processes
+ ! in the sediment
+ !
+ ! j.maerz 13.09.2022
+ !
+ ! Pupose:
+ ! -------
+ ! - representation of microbial processes
+ !
+ ! Description:
+ ! ------------
+ ! The module holds the sequentially operated processes of:
+ ! - nitrification
+ ! - denitrification/dissimilatory nitrate reduction from NO3 to NO2
+ ! - anammox
+ ! - denitrification processes from NO2 -> N2O -> N2 and DNRA
+ ! (dissimilatory nitrite reduction to ammonium)
+ !
+ ! The process of ammonification in the sediment for the extended
+ ! nitrogen cycle is handled inside powach.F90.
+ !
+ !**********************************************************************
+ use mo_param1_bgc, only: issso12,ipowaic,ipowaal,ipowaph,ipowaox,ipown2,ipowno3,ipownh4,ipown2o,&
+ & ipowno2,ks
+ use mo_vgrid, only: kbo
+ use mo_param_bgc, only: rnit,rcar,rnoi, &
+ & rc2n,ro2utammo,ro2nnit,rnoxp,rnoxpi,rno2anmx,rno2anmxi,rnh4anmx, &
+ & rnh4anmxi,rno2dnra,rno2dnrai,rnh4dnra,rnh4dnrai,rnm1, &
+ & q10ano3denit_sed,sc_ano3denit_sed,Trefano3denit_sed,rano3denit_sed, &
+ & bkano3denit_sed,rano2anmx_sed,q10anmx_sed,Trefanmx_sed,alphaanmx_sed, &
+ & bkoxanmx_sed,bkano2anmx_sed,bkanh4anmx_sed,rano2denit_sed, &
+ & q10ano2denit_sed,Trefano2denit_sed,bkoxano2denit_sed,bkano2denit_sed, &
+ & ran2odenit_sed,q10an2odenit_sed,Trefan2odenit_sed,bkoxan2odenit_sed, &
+ & bkan2odenit_sed,rdnra_sed,q10dnra_sed,Trefdnra_sed,bkoxdnra_sed, &
+ & bkdnra_sed,ranh4nitr_sed,q10anh4nitr_sed,Trefanh4nitr_sed,bkoxamox_sed,&
+ & bkanh4nitr_sed,bkamoxn2o_sed,bkyamox_sed,rano2nitr_sed,q10ano2nitr_sed,&
+ & Trefano2nitr_sed,bkoxnitr_sed,bkano2nitr_sed,n2omaxy_sed,n2oybeta_sed, &
+ & NOB2AOAy_sed,bn2o_sed,mufn2o_sed,POM_remin_q10_sed, POM_remin_Tref_sed,&
+ & bkox_drempoc_sed
+ use mo_control_bgc, only: io_stdo_bgc,dtb
+ use mo_sedmnt, only: powtra,sedlay,porsol,porwat
+
+ implicit none
+
+ private
+
+ ! public functions
+ public :: sed_nitrification,sed_denit_NO3_to_NO2,sed_anammox,sed_denit_DNRA, &
+ & alloc_mem_extNsediment_diag
+
+ ! public parameters and fields
+ public :: ised_nitr_NH4,ised_nitr_NO2,ised_nitr_N2O_prod,ised_nitr_NH4_OM,ised_nitr_NO2_OM, &
+ & ised_denit_NO3,ised_denit_NO2,ised_denit_N2O,ised_DNRA_NO2,ised_anmx_N2_prod, &
+ & ised_anmx_OM_prod,ised_remin_aerob,ised_remin_sulf,extNsed_diagnostics
+
+ ! output
+ real, dimension (:,:,:,:), allocatable :: extNsed_diagnostics
+ integer, parameter :: &
+ ised_nitr_NH4 = 1, &
+ ised_nitr_NO2 = 2, &
+ ised_nitr_N2O_prod = 3, &
+ ised_nitr_NH4_OM = 4, &
+ ised_nitr_NO2_OM = 5, &
+ ised_denit_NO3 = 6, &
+ ised_denit_NO2 = 7, &
+ ised_denit_N2O = 8, &
+ ised_DNRA_NO2 = 9, &
+ ised_anmx_N2_prod = 10, &
+ ised_anmx_OM_prod = 11, &
+ ised_remin_aerob = 12, &
+ ised_remin_sulf = 13, &
+ n_seddiag = 13
+
+ real :: eps = 1.e-25
+ real :: minlim = 1.e-9
+
+contains
+
+ ! ================================================================================================================================
+ subroutine alloc_mem_extNsediment_diag(kpie,kpje,ksed)
+ use mod_xc, only: mnproc
+ use mo_control_bgc, only: io_stdo_bgc
+
+ implicit none
+
+ integer, intent(in) :: kpie,kpje,ksed ! ksed = ks
+
+ integer :: errstat
+
+ if (mnproc.eq.1) then
+ write(io_stdo_bgc,*)'Memory allocation for sediment output of the extended nitrogen cycle ...'
+ write(io_stdo_bgc,*)'First dimension : ',kpie
+ write(io_stdo_bgc,*)'Second dimension : ',kpje
+ write(io_stdo_bgc,*)'Third dimension : ',ksed
+ write(io_stdo_bgc,*)'Fourth dimension : ',n_seddiag
+ endif
+
+ allocate (extNsed_diagnostics(kpie,kpje,ksed,n_seddiag),stat=errstat)
+
+ if(errstat.ne.0) stop 'not enough memory extended nitrogen cycle'
+ end subroutine alloc_mem_extNsediment_diag
+
+ ! ================================================================================================================================
+ subroutine sed_nitrification(j,kpie,kpje,kpke,kbnd,ptho,omask,ex_ddic,ex_dalk)
+ integer, intent(in) :: j,kpie,kpje,kpke,kbnd
+ real, intent(in) :: omask(kpie,kpje)
+ real, intent(in) :: ptho(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd,kpke)
+ ! for calculation of pore water DIC and alkalinity changes [P-units]!
+ real, intent(inout) :: ex_ddic(kpie,ks)
+ real, intent(inout) :: ex_dalk(kpie,ks)
+
+ ! local variables
+ integer :: i,k
+
+ real :: Tdepanh4,O2limanh4,nut1lim,anh4new,potdnh4amox,fdetamox,fno2,fn2o,ftotnh4
+ real :: Tdepano2,O2limano2,nut2lim,ano2new,potdno2nitr,fdetnitr,no2fn2o,no2fno2,no2fdetamox
+ real :: amoxfrac,nitrfrac,totd,amox,nitr,temp,w2s
+
+ do i = 1,kpie
+ do k = 1,ks
+ if (omask(i,j) > 0.5) then
+ potdnh4amox = 0.
+ fn2o = 0.
+ fno2 = 0.
+ fdetamox = 0.
+ potdno2nitr = 0.
+ fdetnitr = 0.
+ w2s = porwat(i,j,k) / porsol(i,j,k)
+
+ temp = merge(ptho(i,j,kbo(i,j)),10.,ptho(i,j,kbo(i,j))<40.)
+ ! Ammonium oxidation step of nitrification
+ Tdepanh4 = q10anh4nitr_sed**((temp-Trefanh4nitr_sed)/10.)
+ O2limanh4 = powtra(i,j,k,ipowaox)/(powtra(i,j,k,ipowaox) + bkoxamox_sed)
+ nut1lim = powtra(i,j,k,ipownh4)/(powtra(i,j,k,ipownh4) + bkanh4nitr_sed)
+ anh4new = powtra(i,j,k,ipownh4)/(1. + ranh4nitr_sed*Tdepanh4*O2limanh4*nut1lim)
+ potdnh4amox = max(0.,powtra(i,j,k,ipownh4) - anh4new)
+
+ ! pathway splitting functions similar to Santoros et al. 2021, Ji et al. 2018
+ fn2o = mufn2o_sed * (bn2o_sed + (1.-bn2o_sed)*bkoxamox_sed &
+ & /(powtra(i,j,k,ipowaox)+bkoxamox_sed)) &
+ & * powtra(i,j,k,ipownh4)/(powtra(i,j,k,ipownh4)+bkamoxn2o_sed)
+
+ fno2 = powtra(i,j,k,ipowaox)/(powtra(i,j,k,ipowaox) + bkoxamox_sed)
+ fdetamox = n2omaxy_sed*2.*(1. + n2oybeta_sed)*powtra(i,j,k,ipowaox)*bkyamox_sed &
+ & /(powtra(i,j,k,ipowaox)**2 + 2.*powtra(i,j,k,ipowaox)*bkyamox_sed + bkyamox_sed**2)
+
+ ! normalization of pathway splitting functions to sum=1
+ ftotnh4 = fn2o + fno2 + fdetamox + eps
+ fn2o = fn2o/ftotnh4
+ fno2 = fno2/ftotnh4
+ fdetamox = 1. - (fn2o + fno2)
+
+ ! NO2 oxidizing step of nitrification
+ Tdepano2 = q10ano2nitr_sed**((temp-Trefano2nitr_sed)/10.)
+ O2limano2 = powtra(i,j,k,ipowaox)/(powtra(i,j,k,ipowaox) + bkoxnitr_sed)
+ nut2lim = powtra(i,j,k,ipowno2)/(powtra(i,j,k,ipowno2) + bkano2nitr_sed)
+ ano2new = powtra(i,j,k,ipowno2)/(1. + rano2nitr_sed*Tdepano2*O2limano2*nut2lim)
+ potdno2nitr = max(0.,powtra(i,j,k,ipowno2) - ano2new)
+
+ ! pathway splitting functions for NO2 nitrification - assuming to be the same as for NH4
+ ! but with reduced OM gain per used NO2 as energy source (in amox: NH4)
+ no2fn2o = mufn2o_sed * (bn2o_sed + (1.-bn2o_sed)*bkoxamox_sed &
+ & /(powtra(i,j,k,ipowaox)+bkoxamox_sed)) &
+ & * powtra(i,j,k,ipownh4)/(powtra(i,j,k,ipownh4)+bkamoxn2o_sed)
+ no2fno2 = powtra(i,j,k,ipowaox)/(powtra(i,j,k,ipowaox) + bkoxamox_sed)
+ no2fdetamox = NOB2AOAy_sed*n2omaxy_sed*2.*(1. + n2oybeta_sed)*powtra(i,j,k,ipowaox)*bkyamox_sed &
+ & /(powtra(i,j,k,ipowaox)**2 + 2.*powtra(i,j,k,ipowaox)*bkyamox_sed + bkyamox_sed**2)
+
+ fdetnitr = no2fdetamox/(no2fno2 + no2fn2o) ! yield to energy usage ratio for NO2 -> ratio equals 16:x
+
+ ! limitation of the two processes through available nutrients, etc.
+ totd = potdnh4amox + potdno2nitr
+ amoxfrac = potdnh4amox/(totd + eps)
+ nitrfrac = 1. - amoxfrac
+
+ ! Account for potential earlier changes in DIC and alkalinity in finiding the minimum
+ totd = max(0., &
+ & min(totd, &
+ & powtra(i,j,k,ipownh4)/(amoxfrac + fdetnitr*nitrfrac + eps), & ! ammonium
+ & (powtra(i,j,k,ipowaic) + ex_ddic(i,k)) &
+ & /(rc2n*(fdetamox*amoxfrac + fdetnitr*nitrfrac) &
+ & + eps), & ! CO2
+ & powtra(i,j,k,ipowaph)/(rnoi*(fdetamox*amoxfrac+fdetnitr*nitrfrac) + eps), & ! PO4
+ & powtra(i,j,k,ipowaox) &
+ & /((1.5*fno2 + fn2o - ro2nnit*fdetamox)*amoxfrac &
+ & + (0.5 - ro2nnit*fdetnitr)*nitrfrac + eps), & ! O2
+ & (powtra(i,j,k,ipowaal) + ex_dalk(i,k)) &
+ & /((2.*fno2 + fn2o + rnm1*rnoi*fdetamox)*amoxfrac &
+ & + (rnm1*rnoi*fdetnitr)*nitrfrac + eps))) ! alkalinity
+ amox = amoxfrac*totd
+ nitr = nitrfrac*totd
+
+ powtra(i,j,k,ipownh4) = powtra(i,j,k,ipownh4) - amox - fdetnitr*nitr
+ powtra(i,j,k,ipown2o) = powtra(i,j,k,ipown2o) + 0.5*fn2o*amox
+ powtra(i,j,k,ipowno2) = powtra(i,j,k,ipowno2) + fno2*amox - nitr
+ powtra(i,j,k,ipowno3) = powtra(i,j,k,ipowno3) + nitr
+ sedlay(i,j,k,issso12) = sedlay(i,j,k,issso12) + rnoi*(fdetamox*amox + fdetnitr*nitr)*w2s
+ powtra(i,j,k,ipowaph) = powtra(i,j,k,ipowaph) - rnoi*(fdetamox*amox + fdetnitr*nitr)
+ powtra(i,j,k,ipowaox) = powtra(i,j,k,ipowaox) - (1.5*fno2 + fn2o - ro2nnit*fdetamox)*amox&
+ & - (0.5 - ro2nnit*fdetnitr)*nitr
+
+ ! update of DIC and alkalinity through ex_ddic and ex_dalk fields
+ ! at later stage, when undersaturation of CaCO3 has been calculted
+ ex_ddic(i,k) = ex_ddic(i,k) - rc2n*(fdetamox*amox + fdetnitr*nitr)
+ ex_dalk(i,k) = ex_dalk(i,k) - (2.*fno2 + fn2o + rnm1*rnoi*fdetamox)*amox &
+ - rnm1*rnoi*fdetnitr*nitr
+
+ ! output:
+ extNsed_diagnostics(i,j,k,ised_nitr_NH4) = amox
+ extNsed_diagnostics(i,j,k,ised_nitr_NO2) = nitr
+ extNsed_diagnostics(i,j,k,ised_nitr_N2O_prod) = 0.5*fn2o*amox
+ extNsed_diagnostics(i,j,k,ised_nitr_NH4_OM) = rnoi*fdetamox*amox * w2s
+ extNsed_diagnostics(i,j,k,ised_nitr_NO2_OM) = rnoi*fdetnitr*nitr * w2s
+ endif
+ enddo
+ enddo
+ end subroutine sed_nitrification
+
+ ! ================================================================================================================================
+ subroutine sed_denit_NO3_to_NO2(j,kpie,kpje,kpke,kbnd,ptho,omask,ex_ddic,ex_dalk)
+ integer, intent(in) :: j,kpie,kpje,kpke,kbnd
+ real, intent(in) :: omask(kpie,kpje)
+ real, intent(in) :: ptho(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd,kpke)
+ ! for calculation of pore water DIC and alkalinity changes [P-units]!
+ real, intent(inout) :: ex_ddic(kpie,ks)
+ real, intent(inout) :: ex_dalk(kpie,ks)
+
+ ! local variables
+ integer :: i,k
+ real :: Tdep,O2inhib,nutlim,ano3new,ano3denit,temp,s2w
+
+ do i = 1,kpie
+ do k = 1,ks
+ if (omask(i,j) > 0.5) then
+ s2w = porsol(i,j,k) / porwat(i,j,k)
+ temp = merge(ptho(i,j,kbo(i,j)),10.,ptho(i,j,kbo(i,j)) < 40.)
+ Tdep = q10ano3denit_sed**((temp-Trefano3denit_sed)/10.)
+ O2inhib = 1. - tanh(sc_ano3denit_sed*powtra(i,j,k,ipowaox))
+ nutlim = powtra(i,j,k,ipowno3)/(powtra(i,j,k,ipowno3) + bkano3denit_sed)
+
+ ano3new = powtra(i,j,k,ipowno3)/(1. + rano3denit_sed*Tdep*O2inhib*nutlim)
+
+ ano3denit = max(0.,min(powtra(i,j,k,ipowno3) - ano3new, sedlay(i,j,k,issso12)*rnoxp*s2w))
+
+ powtra(i,j,k,ipowno3) = powtra(i,j,k,ipowno3) - ano3denit
+ powtra(i,j,k,ipowno2) = powtra(i,j,k,ipowno2) + ano3denit
+ sedlay(i,j,k,issso12) = sedlay(i,j,k,issso12) - ano3denit*rnoxpi/s2w
+ powtra(i,j,k,ipownh4) = powtra(i,j,k,ipownh4) + ano3denit*rnit*rnoxpi
+ powtra(i,j,k,ipowaph) = powtra(i,j,k,ipowaph) + ano3denit*rnoxpi
+
+ ! update of DIC and alkalinity through ex_ddic and ex_dalk fields
+ ! at later stage, when undersaturation of CaCO3 has been calculted
+ ex_ddic(i,k) = ex_ddic(i,k) + ano3denit*rcar*rnoxpi
+ ex_dalk(i,k) = ex_dalk(i,k) + ano3denit*rnm1*rnoxpi
+
+ ! Output:
+ extNsed_diagnostics(i,j,k,ised_denit_NO3) = ano3denit
+ endif
+ enddo
+ enddo
+ end subroutine sed_denit_NO3_to_NO2
+
+ ! ================================================================================================================================
+ subroutine sed_anammox(j,kpie,kpje,kpke,kbnd,ptho,omask,ex_ddic,ex_dalk)
+ integer, intent(in) :: j,kpie,kpje,kpke,kbnd
+ real, intent(in) :: omask(kpie,kpje)
+ real, intent(in) :: ptho(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd,kpke)
+ ! for calculation of pore water DIC and alkalinity changes [P-units]!
+ real, intent(inout) :: ex_ddic(kpie,ks)
+ real, intent(inout) :: ex_dalk(kpie,ks)
+
+ ! local variables
+ integer :: i,k
+ real :: Tdep,O2inhib,nut1lim,nut2lim,ano2new,ano2anmx,temp,w2s
+
+ do i = 1,kpie
+ do k = 1,ks
+ if(omask(i,j)>0.5) then
+ w2s = porwat(i,j,k) / porsol(i,j,k)
+ temp = merge(ptho(i,j,kbo(i,j)),10.,ptho(i,j,kbo(i,j)) < 40.)
+ Tdep = q10anmx_sed**((temp-Trefanmx_sed)/10.)
+ O2inhib = 1. - exp(alphaanmx_sed*(powtra(i,j,k,ipowaox)-bkoxanmx_sed)) &
+ & /(1.+ exp(alphaanmx_sed*(powtra(i,j,k,ipowaox)-bkoxanmx_sed)))
+ nut1lim = powtra(i,j,k,ipowno2)/(powtra(i,j,k,ipowno2)+bkano2anmx_sed)
+ nut2lim = powtra(i,j,k,ipownh4)/(powtra(i,j,k,ipownh4)+bkanh4anmx_sed)
+
+ ano2new = powtra(i,j,k,ipowno2)/(1. + rano2anmx_sed*Tdep*O2inhib*nut1lim*nut2lim)
+
+ ! Account for former changes in DIC and alkalinity
+ ano2anmx = max(0.,min(powtra(i,j,k,ipowno2) - ano2new, &
+ powtra(i,j,k,ipownh4)*rno2anmx*rnh4anmxi, &
+ (powtra(i,j,k,ipowaic)+ex_ddic(i,k))*rno2anmx/rcar, &
+ powtra(i,j,k,ipowaph)*rno2anmx, &
+ (powtra(i,j,k,ipowaal)+ex_dalk(i,k))*rno2anmx/rnm1))
+
+ powtra(i,j,k,ipowno2) = powtra(i,j,k,ipowno2) - ano2anmx
+ powtra(i,j,k,ipownh4) = powtra(i,j,k,ipownh4) - ano2anmx*rnh4anmx*rno2anmxi
+ powtra(i,j,k,ipown2) = powtra(i,j,k,ipown2) + ano2anmx*(rnh4anmx-rnit)*rno2anmxi
+ powtra(i,j,k,ipowno3) = powtra(i,j,k,ipowno3) + ano2anmx*rnoxp*rno2anmxi
+ sedlay(i,j,k,issso12) = sedlay(i,j,k,issso12) + ano2anmx*rno2anmxi*w2s
+ powtra(i,j,k,ipowaph) = powtra(i,j,k,ipowaph) - ano2anmx*rno2anmxi
+
+ ! update of DIC and alkalinity through ex_ddic and ex_dalk fields
+ ! at later stage, when undersaturation of CaCO3 has been calculted
+ ex_ddic(i,k) = ex_ddic(i,k) - ano2anmx*rcar*rno2anmxi
+ ex_dalk(i,k) = ex_dalk(i,k) - ano2anmx*rnm1*rno2anmxi
+
+ ! Output:
+ extNsed_diagnostics(i,j,k,ised_anmx_N2_prod) = ano2anmx*(rnh4anmx-rnit)*rno2anmxi ! kmol N2/m3/dtb - N2 prod through anammox
+ extNsed_diagnostics(i,j,k,ised_anmx_OM_prod) = ano2anmx*rno2anmxi*w2s
+ endif
+ enddo
+ enddo
+ end subroutine sed_anammox
+
+ ! ================================================================================================================================
+ subroutine sed_denit_DNRA(j,kpie,kpje,kpke,kbnd,ptho,omask,ex_ddic,ex_dalk)
+ integer, intent(in) :: j,kpie,kpje,kpke,kbnd
+ real, intent(in) :: omask(kpie,kpje)
+ real, intent(in) :: ptho(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd,kpke)
+ ! for calculation of pore water DIC and alkalinity changes [P-units]!
+ real, intent(inout) :: ex_ddic(kpie,ks)
+ real, intent(inout) :: ex_dalk(kpie,ks)
+
+ ! local variables
+ integer :: i,k
+ real :: Tdepano2,O2inhibano2,nutlimano2,rpotano2denit,ano2denit
+ real :: Tdepdnra,O2inhibdnra,nutlimdnra,rpotano2dnra,ano2dnra
+ real :: fdenit,fdnra,potano2new,potdano2,potddet,fdetano2denit,fdetan2odenit,fdetdnra
+ real :: Tdepan2o,O2inhiban2o,nutliman2o,an2onew,an2odenit
+ real :: temp,s2w
+
+
+ do i = 1,kpie
+ do k = 1,ks
+ if (omask(i,j) > 0.5) then
+ potddet = 0.
+ an2odenit = 0.
+ ano2denit = 0.
+ ano2dnra = 0.
+ s2w = porsol(i,j,k) / porwat(i,j,k)
+ temp = merge(ptho(i,j,kbo(i,j)),10.,ptho(i,j,kbo(i,j)) < 40.)
+
+ ! === denitrification on N2O
+ Tdepan2o = q10an2odenit_sed**((temp-Trefan2odenit_sed)/10.)
+ O2inhiban2o = bkoxan2odenit_sed**2/(powtra(i,j,k,ipowaox)**2 + bkoxan2odenit_sed**2)
+ nutliman2o = powtra(i,j,k,ipown2o)/(powtra(i,j,k,ipown2o) + bkan2odenit_sed)
+ an2onew = powtra(i,j,k,ipown2o)/(1. + ran2odenit_sed*Tdepan2o*O2inhiban2o*nutliman2o)
+ an2odenit = max(0.,min(powtra(i,j,k,ipown2o),powtra(i,j,k,ipown2o) - an2onew))
+
+ ! denitrification on NO2
+ Tdepano2 = q10ano2denit_sed**((temp-Trefano2denit_sed)/10.)
+ O2inhibano2 = bkoxano2denit_sed**2/(powtra(i,j,k,ipowaox)**2 + bkoxano2denit_sed**2)
+ nutlimano2 = powtra(i,j,k,ipowno2)/(powtra(i,j,k,ipowno2) + bkano2denit_sed)
+ rpotano2denit = max(0.,rano2denit_sed*Tdepano2*O2inhibano2*nutlimano2) ! potential rate of denit
+
+ ! DNRA on NO2
+ Tdepdnra = q10dnra_sed**((temp-Trefdnra_sed)/10.)
+ O2inhibdnra = bkoxdnra_sed**2/(powtra(i,j,k,ipowaox)**2 + bkoxdnra_sed**2)
+ nutlimdnra = powtra(i,j,k,ipowno2)/(powtra(i,j,k,ipowno2) + bkdnra_sed)
+ rpotano2dnra = max(0.,rdnra_sed*Tdepdnra*O2inhibdnra*nutlimdnra) ! pot. rate of dnra
+
+ ! potential new conc of NO2 due to denitrification and DNRA
+ potano2new = powtra(i,j,k,ipowno2)/(1. + rpotano2denit + rpotano2dnra)
+ potdano2 = max(0.,min(powtra(i,j,k,ipowno2), powtra(i,j,k,ipowno2) - potano2new))
+
+ ! === limitation due to NO2:
+ ! fraction on potential change of NO2:
+ fdenit = rpotano2denit/(rpotano2denit + rpotano2dnra + eps)
+ fdnra = 1. - fdenit
+
+ ! potential fractional change
+ ano2denit = fdenit * potdano2
+ ano2dnra = fdnra * potdano2
+
+ ! limitation of processes due to detritus (based on pore water volume)
+ potddet = rnoxpi*(ano2denit + an2odenit) + rno2dnrai*ano2dnra ! P units
+ fdetano2denit = rnoxpi*ano2denit/(potddet + eps)
+ fdetan2odenit = rnoxpi*an2odenit/(potddet + eps)
+ fdetdnra = 1. - fdetano2denit - fdetan2odenit
+ potddet = max(0.,min(potddet,powtra(i,j,k,issso12)*s2w))
+
+ ! change of NO2 and N2O in N units
+ ano2denit = fdetano2denit*rnoxp*potddet
+ an2odenit = fdetan2odenit*rnoxp*potddet
+ ano2dnra = fdetdnra*rno2dnra*potddet
+
+ ! change in tracer concentrations due to denit (NO2->N2O->N2) and DNRA (NO2->NH4)
+ powtra(i,j,k,ipowno2) = powtra(i,j,k,ipowno2) - ano2denit - ano2dnra
+ powtra(i,j,k,ipown2o) = powtra(i,j,k,ipown2o) - an2odenit + 0.5*ano2denit
+ powtra(i,j,k,ipown2) = powtra(i,j,k,ipown2) + an2odenit
+ powtra(i,j,k,ipownh4) = powtra(i,j,k,ipownh4) + rnit*rnoxpi*(ano2denit+an2odenit) &
+ & + rnh4dnra*rno2dnrai*ano2dnra
+ sedlay(i,j,k,issso12) = sedlay(i,j,k,issso12) &
+ & - ((ano2denit + an2odenit)*rnoxpi + ano2dnra*rno2dnrai)/s2w
+ powtra(i,j,k,ipowaph) = powtra(i,j,k,ipowaph) + (ano2denit + an2odenit)*rnoxpi &
+ & + ano2dnra*rno2dnrai
+
+ ! update of DIC and alkalinity through ex_ddic and ex_dalk fields
+ ! at later stage, when undersaturation of CaCO3 has been calculted
+ ex_ddic(i,k) = ex_ddic(i,k) + rcar*rnoxpi*(ano2denit + an2odenit) &
+ & + rcar*rno2dnrai*ano2dnra
+ ex_dalk(i,k) = ex_dalk(i,k) + (295.*ano2denit + rnm1*an2odenit)*rnoxpi &
+ & + (rno2dnra + rnh4dnra - 1.)*rno2dnrai*ano2dnra
+
+ extNsed_diagnostics(i,j,k,ised_denit_NO2) = ano2denit
+ extNsed_diagnostics(i,j,k,ised_denit_N2O) = an2odenit
+ extNsed_diagnostics(i,j,k,ised_DNRA_NO2) = ano2dnra
+ endif
+ enddo
+ enddo
+ end subroutine sed_denit_DNRA
+
+end module mo_extNsediment
diff --git a/hamocc/mo_extNwatercol.F90 b/hamocc/mo_extNwatercol.F90
new file mode 100644
index 00000000..3995c98d
--- /dev/null
+++ b/hamocc/mo_extNwatercol.F90
@@ -0,0 +1,449 @@
+! Copyright (C) 2022 j. maerz
+!
+! This file is part of BLOM/iHAMOCC.
+!
+! BLOM is free software: you can redistribute it and/or modify it under the
+! terms of the GNU Lesser General Public License as published by the Free
+! Software Foundation, either version 3 of the License, or (at your option)
+! any later version.
+!
+! BLOM is distributed in the hope that it will be useful, but WITHOUT ANY
+! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+! FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
+! more details.
+!
+! You should have received a copy of the GNU Lesser General Public License
+! along with BLOM. If not, see https://www.gnu.org/licenses/.
+
+module mo_extNwatercol
+ !****************************************************************
+ !
+ ! MODULE mo_extNwatercol - (microbial) biological processes of the
+ ! extended nitrogen cycle
+ !
+ ! j.maerz 25.04.2022
+ !
+ ! Purpose:
+ ! --------
+ ! - representing major biological parts of the extended nitrogen cycle
+ !
+ ! Description:
+ ! ------------
+ ! The module holds the sequentially operated processes of
+ ! - nitrification
+ ! - denitrification/dissimilatory nitrate reduction from NO3 to NO2
+ ! - anammox
+ ! - denitrification processes from NO2 -> N2O -> N2 and DNRA
+ ! (dissimilatory nitrite reduction to ammonium)
+ !
+ ! The process of ammonium and nitrate uptake by phytoplankton
+ ! is handled in ocprod.
+ !
+ ! Ammonification (PON -> NH4) is also handled in ocprod.
+ !
+ ! The respective sediment processes are handled in:
+ ! - powach.F90 and
+ ! - mo_extNsediment.F90
+ !
+ !****************************************************************
+ use mo_vgrid, only: dp_min
+ use mod_xc, only: mnproc
+ use mo_control_bgc, only: dtb
+ use mo_param1_bgc, only: ialkali,ianh4,iano2,ian2o,iano3,idet,igasnit,iiron,ioxygen,iphosph, &
+ & isco212
+ use mo_carbch, only: ocetra
+ use mo_param_bgc, only: riron,rnit,rcar,rnoi, &
+ & q10ano3denit,sc_ano3denit,Trefano3denit,rano3denit,bkano3denit, &
+ & rano2anmx,q10anmx,Trefanmx,alphaanmx,bkoxanmx,bkano2anmx,bkanh4anmx, &
+ & rano2denit,q10ano2denit,Trefano2denit,bkoxano2denit,bkano2denit, &
+ & ran2odenit,q10an2odenit,Trefan2odenit,bkoxan2odenit,bkan2odenit, &
+ & rdnra,q10dnra,Trefdnra,bkoxdnra,bkdnra,ranh4nitr,q10anh4nitr, &
+ & Trefanh4nitr,bkoxamox,bkanh4nitr,bkamoxn2o,bkyamox, &
+ & rano2nitr,q10ano2nitr,Trefano2nitr,bkoxnitr,bkano2nitr,n2omaxy, &
+ & n2oybeta,NOB2AOAy,bn2o,mufn2o, &
+ & rc2n,ro2nnit,rnoxp,rnoxpi,rno2anmx,rno2anmxi,rnh4anmx, &
+ & rnh4anmxi,rno2dnra,rno2dnrai,rnh4dnra,rnh4dnrai,rnm1, &
+ & bkphyanh4,bkphyano3,bkphosph,bkiron,ro2utammo
+ use mo_biomod, only: nitr_NH4,nitr_NO2,nitr_N2O_prod,nitr_NH4_OM,nitr_NO2_OM,denit_NO3, &
+ & denit_NO2,denit_N2O,DNRA_NO2,anmx_N2_prod,anmx_OM_prod
+ implicit none
+
+ private
+
+ ! public functions
+ public :: nitrification,denit_NO3_to_NO2,anammox,denit_dnra,extN_inv_check
+
+ real :: eps = 1.e-25
+ real :: minlim = 1.e-9
+
+contains
+
+ subroutine nitrification(kpie,kpje,kpke,kbnd,pddpo,omask,ptho)
+ ! Nitrification processes (NH4 -> NO2, NO2 -> NO3) accompanied
+ ! by dark carbon fixation and O2-dependent N2O production
+
+ integer, intent(in) :: kpie,kpje,kpke,kbnd
+ real, intent(in) :: omask(kpie,kpje)
+ real, intent(in) :: pddpo(kpie,kpje,kpke)
+ real, intent(in) :: ptho(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd,kpke)
+
+ !local variables
+ integer :: i,j,k
+ real :: Tdepanh4,O2limanh4,nut1lim,anh4new,potdnh4amox,fdetamox,fno2,fn2o,ftotnh4
+ real :: Tdepano2,O2limano2,nut2lim,ano2new,potdno2nitr,fdetnitr,ftotno2,no2fn2o,no2fno2, &
+ no2fdetamox
+ real :: amoxfrac,nitrfrac,totd,amox,nitr,temp
+
+ ! Set output-related fields to zero
+ nitr_NH4 = 0.
+ nitr_NO2 = 0.
+ nitr_N2O_prod = 0.
+ nitr_NH4_OM = 0.
+ nitr_NO2_OM = 0.
+
+ !$OMP PARALLEL DO PRIVATE(i,k,Tdepanh4,O2limanh4,nut1lim,anh4new,potdnh4amox,fdetamox,fno2, &
+ !$OMP fn2o,ftotnh4,Tdepano2,O2limano2,nut2lim,ano2new,potdno2nitr,fdetnitr,&
+ !$OMP ftotno2,amoxfrac,nitrfrac,totd,amox,nitr,temp,no2fn2o,no2fno2, &
+ !$OMP no2fdetamox)
+ do j = 1,kpje
+ do i = 1,kpie
+ do k = 1,kpke
+ if(pddpo(i,j,k) > dp_min .and. omask(i,j) > 0.5) then
+ potdnh4amox = 0.
+ fn2o = 0.
+ fno2 = 0.
+ fdetamox = 0.
+ potdno2nitr = 0.
+ fdetnitr = 0.
+
+ temp = merge(ptho(i,j,k),10.,ptho(i,j,k) < 40.)
+ ! Ammonium oxidation step of nitrification
+ Tdepanh4 = q10anh4nitr**((temp-Trefanh4nitr)/10.)
+ O2limanh4 = ocetra(i,j,k,ioxygen)/(ocetra(i,j,k,ioxygen) + bkoxamox)
+ nut1lim = ocetra(i,j,k,ianh4)/(ocetra(i,j,k,ianh4) + bkanh4nitr)
+ anh4new = ocetra(i,j,k,ianh4)/(1. + ranh4nitr*Tdepanh4*O2limanh4*nut1lim)
+ potdnh4amox = max(0.,ocetra(i,j,k,ianh4) - anh4new)
+
+ ! pathway splitting function similar to Santoros et al. 2021, Ji et al. 2018
+ fn2o = mufn2o * (bn2o + (1.-bn2o)*bkoxamox/(ocetra(i,j,k,ioxygen)+bkoxamox)) &
+ & * ocetra(i,j,k,ianh4)/(ocetra(i,j,k,ianh4)+bkamoxn2o)
+
+ fno2 = ocetra(i,j,k,ioxygen)/(ocetra(i,j,k,ioxygen) + bkoxamox)
+ fdetamox = n2omaxy*2.*(1. + n2oybeta)*ocetra(i,j,k,ioxygen)*bkyamox &
+ & /(ocetra(i,j,k,ioxygen)**2 + 2.*ocetra(i,j,k,ioxygen)*bkyamox + bkyamox**2)
+
+ ! normalization of pathway splitting functions to sum=1
+ ftotnh4 = fn2o + fno2 + fdetamox + eps
+ fn2o = fn2o/ftotnh4
+ fno2 = fno2/ftotnh4
+ fdetamox = 1. - (fn2o + fno2)
+
+ ! NO2 oxidizing step of nitrification
+ Tdepano2 = q10ano2nitr**((temp-Trefano2nitr)/10.)
+ O2limano2 = ocetra(i,j,k,ioxygen)/(ocetra(i,j,k,ioxygen) + bkoxnitr)
+ nut2lim = ocetra(i,j,k,iano2)/(ocetra(i,j,k,iano2) + bkano2nitr)
+ ano2new = ocetra(i,j,k,iano2)/(1. + rano2nitr*Tdepano2*O2limano2*nut2lim)
+ potdno2nitr = max(0.,ocetra(i,j,k,iano2) - ano2new)
+
+ ! pathway splitting functions for NO2 nitrification - assuming to be the same as for NH4
+ ! but with reduced OM gain per used NO2 as energy source (in amox: NH4)
+ no2fn2o = mufn2o * (bn2o + (1.-bn2o)*bkoxamox/(ocetra(i,j,k,ioxygen)+bkoxamox)) &
+ & * ocetra(i,j,k,ianh4)/(ocetra(i,j,k,ianh4)+bkamoxn2o)
+
+ no2fno2 = ocetra(i,j,k,ioxygen)/(ocetra(i,j,k,ioxygen) + bkoxamox)
+ no2fdetamox = NOB2AOAy*n2omaxy*2.*(1. + n2oybeta)*ocetra(i,j,k,ioxygen)*bkyamox &
+ & /(ocetra(i,j,k,ioxygen)**2 + 2.*ocetra(i,j,k,ioxygen)*bkyamox + bkyamox**2)
+
+ fdetnitr = no2fdetamox/(no2fno2 + no2fn2o) ! yield to energy usage ratio for NO2 -> ratio equals 16:x
+
+
+ ! limitation of the two processes through available nutrients, etc.
+ totd = potdnh4amox + potdno2nitr
+ amoxfrac = potdnh4amox/(totd + eps)
+ nitrfrac = 1. - amoxfrac
+
+ totd = max(0., &
+ & min(totd, &
+ & ocetra(i,j,k,ianh4)/(amoxfrac + fdetnitr*nitrfrac + eps), & ! ammonium
+ & ocetra(i,j,k,isco212)/(rc2n*(fdetamox*amoxfrac + fdetnitr*nitrfrac) +eps),& ! CO2
+ & ocetra(i,j,k,iphosph)/(rnoi*(fdetamox*amoxfrac + fdetnitr*nitrfrac) +eps),& ! PO4
+ & ocetra(i,j,k,iiron)/(riron*rnoi*(fdetamox*amoxfrac + fdetnitr*nitrfrac) &
+ & + eps), & ! Fe
+ & ocetra(i,j,k,ioxygen) &
+ & /((1.5*fno2 + fn2o - ro2nnit*fdetamox)*amoxfrac &
+ + (0.5 - ro2nnit*fdetnitr)*nitrfrac + eps), & ! O2
+ & ocetra(i,j,k,ialkali) &
+ & /((2.*fno2 + fn2o + rnm1*rnoi*fdetamox)*amoxfrac &
+ & + (rnm1*rnoi*fdetnitr)*nitrfrac + eps))) ! alkalinity
+ amox = amoxfrac*totd
+ nitr = nitrfrac*totd
+
+ ocetra(i,j,k,ianh4) = ocetra(i,j,k,ianh4) - amox - fdetnitr*nitr
+ ocetra(i,j,k,ian2o) = ocetra(i,j,k,ian2o) + 0.5*fn2o*amox
+ ocetra(i,j,k,iano2) = ocetra(i,j,k,iano2) + fno2*amox - nitr
+ ocetra(i,j,k,iano3) = ocetra(i,j,k,iano3) + nitr
+ ocetra(i,j,k,idet) = ocetra(i,j,k,idet) + rnoi*(fdetamox*amox + fdetnitr*nitr)
+ ocetra(i,j,k,isco212) = ocetra(i,j,k,isco212) - rc2n*(fdetamox*amox + fdetnitr*nitr)
+ ocetra(i,j,k,iphosph) = ocetra(i,j,k,iphosph) - rnoi*(fdetamox*amox + fdetnitr*nitr)
+ ocetra(i,j,k,iiron) = ocetra(i,j,k,iiron) - riron*rnoi*(fdetamox*amox + fdetnitr*nitr)
+ ocetra(i,j,k,ioxygen) = ocetra(i,j,k,ioxygen) - (1.5*fno2 + fn2o - ro2nnit*fdetamox)*amox &
+ & - (0.5 - ro2nnit*fdetnitr)*nitr
+ ocetra(i,j,k,ialkali) = ocetra(i,j,k,ialkali) - (2.*fno2 + fn2o + rnm1*rnoi*fdetamox)*amox&
+ & - rnm1*rnoi*fdetnitr*nitr
+
+ ! Output
+ nitr_NH4(i,j,k) = amox ! kmol N/m3/dtb - NH4 consumption for nitrification on NH4-incl. usage for biomass
+ nitr_NO2(i,j,k) = nitr ! kmol N/m3/dtb - NO2 consumption for nitrification on NO2
+ nitr_N2O_prod(i,j,k) = 0.5*fn2o*amox ! kmol N2O/m3/dtb - N2O production during aerob ammonium oxidation
+ nitr_NH4_OM(i,j,k) = rnoi*fdetamox*amox ! kmol P/m3/dtb - organic matter production during aerob NH4 oxidation
+ nitr_NO2_OM(i,j,k) = rnoi*fdetnitr*nitr ! kmol P/m3/dtb - organic matter production during aerob NO2 oxidation
+ endif
+ enddo
+ enddo
+ enddo
+ !$OMP END PARALLEL DO
+ end subroutine nitrification
+
+!===================================================================================================================================
+ subroutine denit_NO3_to_NO2(kpie,kpje,kpke,kbnd,pddpo,omask,ptho)
+ ! Denitrification / dissimilatory nitrate reduction (NO3 -> NO2)
+
+ integer, intent(in) :: kpie,kpje,kpke,kbnd
+ real, intent(in) :: omask(kpie,kpje)
+ real, intent(in) :: pddpo(kpie,kpje,kpke)
+ real, intent(in) :: ptho(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd,kpke)
+
+ !local variables
+ integer :: i,j,k
+ real :: Tdep,O2inhib,nutlim,ano3new,ano3denit,temp
+
+ ! Sett output-related field to zero
+ denit_NO3 = 0.
+
+ !$OMP PARALLEL DO PRIVATE(i,k,Tdep,O2inhib,nutlim,ano3new,ano3denit,temp)
+ do j = 1,kpje
+ do i = 1,kpie
+ do k = 1,kpke
+ if(pddpo(i,j,k) > dp_min .and. omask(i,j) > 0.5) then
+ temp = merge(ptho(i,j,k),10.,ptho(i,j,k) < 40.)
+ Tdep = q10ano3denit**((temp-Trefano3denit)/10.)
+ O2inhib = 1. - tanh(sc_ano3denit*ocetra(i,j,k,ioxygen))
+ nutlim = ocetra(i,j,k,iano3)/(ocetra(i,j,k,iano3) + bkano3denit)
+
+ ano3new = ocetra(i,j,k,iano3)/(1. + rano3denit*Tdep*O2inhib*nutlim)
+
+ ano3denit = max(0.,min(ocetra(i,j,k,iano3) - ano3new, ocetra(i,j,k,idet)*rnoxp))
+
+ ocetra(i,j,k,iano3) = ocetra(i,j,k,iano3) - ano3denit
+ ocetra(i,j,k,iano2) = ocetra(i,j,k,iano2) + ano3denit
+ ocetra(i,j,k,idet) = ocetra(i,j,k,idet) - ano3denit*rnoxpi
+ ocetra(i,j,k,ianh4) = ocetra(i,j,k,ianh4) + ano3denit*rnit*rnoxpi
+ ocetra(i,j,k,isco212) = ocetra(i,j,k,isco212) + ano3denit*rcar*rnoxpi
+ ocetra(i,j,k,iphosph) = ocetra(i,j,k,iphosph) + ano3denit*rnoxpi
+ ocetra(i,j,k,iiron) = ocetra(i,j,k,iiron) + ano3denit*riron*rnoxpi
+ ocetra(i,j,k,ialkali) = ocetra(i,j,k,ialkali) + ano3denit*rnm1*rnoxpi
+
+ ! Output
+ denit_NO3(i,j,k) = ano3denit ! kmol NO3/m3/dtb - NO3 usage for denit on NO3
+ endif
+ enddo
+ enddo
+ enddo
+ !$OMP END PARALLEL DO
+ end subroutine denit_NO3_to_NO2
+
+!==================================================================================================================================
+ subroutine anammox(kpie,kpje,kpke,kbnd,pddpo,omask,ptho)
+ ! Aanammox
+
+ integer, intent(in) :: kpie,kpje,kpke,kbnd
+ real, intent(in) :: omask(kpie,kpje)
+ real, intent(in) :: pddpo(kpie,kpje,kpke)
+ real, intent(in) :: ptho(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd,kpke)
+
+ !local variables
+ integer :: i,j,k
+ real :: Tdep,O2inhib,nut1lim,nut2lim,ano2new,ano2anmx,temp
+
+ ! Set output-related field to zero
+ anmx_N2_prod = 0.
+ anmx_OM_prod = 0.
+
+ !$OMP PARALLEL DO PRIVATE(i,k,Tdep,O2inhib,nut1lim,nut2lim,ano2new,ano2anmx,temp)
+ do j = 1,kpje
+ do i = 1,kpie
+ do k = 1,kpke
+ if(pddpo(i,j,k) > dp_min .and. omask(i,j) > 0.5) then
+ temp = merge(ptho(i,j,k),10.,ptho(i,j,k) < 40.)
+ Tdep = q10anmx**((temp-Trefanmx)/10.)
+ O2inhib = 1. - exp(alphaanmx*(ocetra(i,j,k,ioxygen)-bkoxanmx)) &
+ & /(1.+ exp(alphaanmx*(ocetra(i,j,k,ioxygen)-bkoxanmx)))
+ nut1lim = ocetra(i,j,k,iano2)/(ocetra(i,j,k,iano2)+bkano2anmx)
+ nut2lim = ocetra(i,j,k,ianh4)/(ocetra(i,j,k,ianh4)+bkanh4anmx)
+
+ ano2new = ocetra(i,j,k,iano2)/(1. + rano2anmx*Tdep*O2inhib*nut1lim*nut2lim)
+
+ ano2anmx = max(0.,min(ocetra(i,j,k,iano2) - ano2new, &
+ ocetra(i,j,k,ianh4)*rno2anmx*rnh4anmxi, &
+ ocetra(i,j,k,isco212)*rno2anmx/rcar, &
+ ocetra(i,j,k,iphosph)*rno2anmx, &
+ ocetra(i,j,k,iiron)*rno2anmx/riron, &
+ ocetra(i,j,k,ialkali)*rno2anmx/rnm1))
+
+ ocetra(i,j,k,iano2) = ocetra(i,j,k,iano2) - ano2anmx
+ ocetra(i,j,k,ianh4) = ocetra(i,j,k,ianh4) - ano2anmx*rnh4anmx*rno2anmxi
+ ocetra(i,j,k,igasnit) = ocetra(i,j,k,igasnit) + ano2anmx*(rnh4anmx-rnit)*rno2anmxi
+ ocetra(i,j,k,iano3) = ocetra(i,j,k,iano3) + ano2anmx*rnoxp*rno2anmxi
+ ocetra(i,j,k,idet) = ocetra(i,j,k,idet) + ano2anmx*rno2anmxi
+ ocetra(i,j,k,isco212) = ocetra(i,j,k,isco212) - ano2anmx*rcar*rno2anmxi
+ ocetra(i,j,k,iphosph) = ocetra(i,j,k,iphosph) - ano2anmx*rno2anmxi
+ ocetra(i,j,k,iiron) = ocetra(i,j,k,iiron) - ano2anmx*riron*rno2anmxi
+ ocetra(i,j,k,ialkali) = ocetra(i,j,k,ialkali) - ano2anmx*rnm1*rno2anmxi
+
+ ! Output
+ anmx_N2_prod(i,j,k) = ano2anmx*(rnh4anmx-rnit)*rno2anmxi ! kmol N2/m3/dtb - N2 prod through anammox
+ anmx_OM_prod(i,j,k) = ano2anmx*rno2anmxi ! kmol P/m3/dtb - OM production by anammox
+ endif
+ enddo
+ enddo
+ enddo
+ !$OMP END PARALLEL DO
+ end subroutine anammox
+
+!==================================================================================================================================
+ subroutine denit_dnra(kpie,kpje,kpke,kbnd,pddpo,omask,ptho)
+ ! Denitrification processes (NO2 -> N2O -> N2) and dissmilatory nitrite reduction (NO2 -> NH4)
+
+ integer, intent(in) :: kpie,kpje,kpke,kbnd
+ real, intent(in) :: omask(kpie,kpje)
+ real, intent(in) :: pddpo(kpie,kpje,kpke)
+ real, intent(in) :: ptho(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd,kpke)
+
+ !local variables
+ integer :: i,j,k
+ real :: Tdepano2,O2inhibano2,nutlimano2,detlimano2,rpotano2denit,ano2denit
+ real :: Tdepdnra,O2inhibdnra,nutlimdnra,detlimdnra,rpotano2dnra,ano2dnra
+ real :: fdenit,fdnra,potano2new,potdano2,potddet,fdetano2denit,fdetan2odenit,fdetdnra
+ real :: Tdepan2o,O2inhiban2o,nutliman2o,detliman2o,an2onew,an2odenit
+
+ real :: temp
+
+ ! Set output-related field to zero
+ denit_NO2 = 0.
+ denit_N2O = 0.
+ DNRA_NO2 = 0.
+
+ !$OMP PARALLEL DO PRIVATE(i,k,Tdepano2,O2inhibano2,nutlimano2,detlimano2,ano2denit, &
+ !$OMP Tdepan2o,O2inhiban2o,nutliman2o,detliman2o,an2onew,an2odenit, &
+ !$OMP rpotano2denit,rpotano2dnra, &
+ !$OMP fdenit,fdnra,potano2new,potdano2,potddet,fdetano2denit, &
+ !$OMP fdetan2odenit,fdetdnra, &
+ !$OMP Tdepdnra,O2inhibdnra,nutlimdnra,detlimdnra,ano2dnra,temp)
+
+ do j = 1,kpje
+ do i = 1,kpie
+ do k = 1,kpke
+ if(pddpo(i,j,k) > dp_min .and. omask(i,j) > 0.5) then
+ potddet = 0.
+ an2odenit = 0.
+ ano2denit = 0.
+ ano2dnra = 0.
+
+ temp = merge(ptho(i,j,k),10.,ptho(i,j,k) < 40.)
+ ! === denitrification on N2O
+ Tdepan2o = q10an2odenit**((temp-Trefan2odenit)/10.)
+ O2inhiban2o = bkoxan2odenit**2/(ocetra(i,j,k,ioxygen)**2 + bkoxan2odenit**2)
+ nutliman2o = ocetra(i,j,k,ian2o)/(ocetra(i,j,k,ian2o) + bkan2odenit)
+ an2onew = ocetra(i,j,k,ian2o)/(1. + ran2odenit*Tdepan2o*O2inhiban2o*nutliman2o)
+ an2odenit = max(0.,min(ocetra(i,j,k,ian2o),ocetra(i,j,k,ian2o) - an2onew))
+
+ ! denitrification on NO2
+ Tdepano2 = q10ano2denit**((temp-Trefano2denit)/10.)
+ O2inhibano2 = bkoxano2denit**2/(ocetra(i,j,k,ioxygen)**2 + bkoxano2denit**2)
+ nutlimano2 = ocetra(i,j,k,iano2)/(ocetra(i,j,k,iano2) + bkano2denit)
+ rpotano2denit = max(0.,rano2denit*Tdepano2*O2inhibano2*nutlimano2) ! potential rate of denit
+
+ ! DNRA on NO2
+ Tdepdnra = q10dnra**((temp-Trefdnra)/10.)
+ O2inhibdnra = bkoxdnra**2/(ocetra(i,j,k,ioxygen)**2 + bkoxdnra**2)
+ nutlimdnra = ocetra(i,j,k,iano2)/(ocetra(i,j,k,iano2) + bkdnra)
+ rpotano2dnra = max(0.,rdnra*Tdepdnra*O2inhibdnra*nutlimdnra) ! pot. rate of dnra
+
+ ! potential new conc of NO2 due to denitrification and DNRA
+ potano2new = ocetra(i,j,k,iano2)/(1. + rpotano2denit + rpotano2dnra)
+ potdano2 = max(0.,min(ocetra(i,j,k,iano2), ocetra(i,j,k,iano2) - potano2new))
+
+ ! === limitation due to NO2:
+ ! fraction on potential change of NO2:
+ fdenit = rpotano2denit/(rpotano2denit + rpotano2dnra + eps)
+ fdnra = 1. - fdenit
+
+ ! potential fractional change
+ ano2denit = fdenit * potdano2
+ ano2dnra = fdnra * potdano2
+
+ ! limitation of processes due to detritus
+ potddet = rnoxpi*(ano2denit + an2odenit) + rno2dnrai*ano2dnra ! P units
+ fdetano2denit = rnoxpi*ano2denit/(potddet + eps)
+ fdetan2odenit = rnoxpi*an2odenit/(potddet + eps)
+ fdetdnra = 1. - fdetano2denit - fdetan2odenit
+ potddet = max(0.,min(potddet,ocetra(i,j,k,idet)))
+
+ ! change of NO2 and N2O in N units
+ ano2denit = fdetano2denit*rnoxp*potddet
+ an2odenit = fdetan2odenit*rnoxp*potddet
+ ano2dnra = fdetdnra*rno2dnra*potddet
+
+ ! change in tracer concentrations due to denit (NO2->N2O->N2) and DNRA (NO2->NH4)
+ ocetra(i,j,k,iano2) = ocetra(i,j,k,iano2) - ano2denit - ano2dnra
+ ocetra(i,j,k,ian2o) = ocetra(i,j,k,ian2o) - an2odenit + 0.5*ano2denit
+ ocetra(i,j,k,igasnit) = ocetra(i,j,k,igasnit) + an2odenit
+ ocetra(i,j,k,ianh4) = ocetra(i,j,k,ianh4) + rnit*rnoxpi*(ano2denit+an2odenit) &
+ & + rnh4dnra*rno2dnrai*ano2dnra
+ ocetra(i,j,k,idet) = ocetra(i,j,k,idet) - (ano2denit + an2odenit)*rnoxpi &
+ & - ano2dnra*rno2dnrai
+ ocetra(i,j,k,isco212) = ocetra(i,j,k,isco212) + rcar*rnoxpi*(ano2denit + an2odenit) &
+ & + rcar*rno2dnrai*ano2dnra
+ ocetra(i,j,k,iphosph) = ocetra(i,j,k,iphosph) + (ano2denit + an2odenit)*rnoxpi &
+ & + ano2dnra*rno2dnrai
+ ocetra(i,j,k,iiron) = ocetra(i,j,k,iiron) + riron*rnoxpi*(ano2denit + an2odenit) &
+ & + riron*rno2dnrai*ano2dnra
+ ocetra(i,j,k,ialkali) = ocetra(i,j,k,ialkali) + (295.*ano2denit + rnm1*an2odenit)*rnoxpi &
+ & + (rno2dnra + rnh4dnra - 1.)*rno2dnrai*ano2dnra
+ ! Output
+ denit_NO2(i,j,k) = ano2denit ! kmol NO2/m3/dtb - denitrification on NO2
+ denit_N2O(i,j,k) = an2odenit ! kmol N2O/m3/dtb - denitrification on N2O
+ DNRA_NO2(i,j,k) = ano2dnra ! kmol NO2/m3/dtb - DNRA on NO2
+ endif
+ enddo
+ enddo
+ enddo
+ !$OMP END PARALLEL DO
+ end subroutine denit_dnra
+
+
+
+!==================================================================================================================================
+ subroutine extN_inv_check(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask,inv_message)
+ use mo_inventory_bgc, only: inventory_bgc
+ use mo_control_bgc, only: io_stdo_bgc,dtb,use_PBGC_OCNP_TIMESTEP
+
+ implicit none
+ ! provide inventory calculation for extended nitrogen cycle
+
+ integer, intent(in) :: kpie,kpje,kpke
+ real, intent(in) :: omask(kpie,kpje)
+ real, intent(in) :: pdlxp(kpie,kpje),pdlyp(kpie,kpje),pddpo(kpie,kpje,kpke)
+ character (len=*),intent(in) :: inv_message
+
+ if (use_PBGC_OCNP_TIMESTEP) then
+ if (mnproc == 1) then
+ write(io_stdo_bgc,*)' '
+ write(io_stdo_bgc,*)inv_message
+ endif
+ call INVENTORY_BGC(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask,0)
+ endif
+ end subroutine extN_inv_check
+
+!==================================================================================================================================
+end module mo_extNwatercol
diff --git a/hamocc/mo_hamocc4bcm.F90 b/hamocc/mo_hamocc4bcm.F90
index b6ef50a1..ec5f6c3a 100644
--- a/hamocc/mo_hamocc4bcm.F90
+++ b/hamocc/mo_hamocc4bcm.F90
@@ -27,7 +27,8 @@ module mo_hamocc4bcm
subroutine hamocc4bcm(kpie,kpje,kpke,kbnd,kplyear,kplmon,kplday,kldtday,pdlxp,pdlyp,pddpo,prho, &
pglat,omask, dust,rivin,ndep,oafx,pi_ph,pfswr,psicomo,ppao,pfu10,ptho,psao,&
- patmco2,pflxco2,pflxdms,patmbromo,pflxbromo)
+ patmco2,pflxco2,pflxdms,patmbromo,pflxbromo, &
+ patmn2o,pflxn2o,patmnh3,pflxnh3)
!***********************************************************************************************
! Main routine of iHAMOCC.
@@ -53,8 +54,9 @@ subroutine hamocc4bcm(kpie,kpje,kpke,kbnd,kplyear,kplmon,kplday,kldtday,pdlxp,pd
use mo_control_bgc, only: ldtrunbgc,dtbgc,ldtbgc,io_stdo_bgc,dtbgc,ndtdaybgc, &
do_sedspinup,sedspin_yr_s,sedspin_yr_e,sedspin_ncyc, &
use_BROMO, use_CFC, use_PBGC_CK_TIMESTEP, &
- use_BOXATM, use_sedbypass,ocn_co2_type
- use mo_param1_bgc, only: iatmco2,iatmdms,nocetra,nriv,iatmbromo
+ use_BOXATM, use_sedbypass,ocn_co2_type, &
+ do_n2onh3_coupled,use_extNcycle
+ use mo_param1_bgc, only: iatmco2,iatmdms,nocetra,nriv,iatmbromo,nndep,iatmn2o,iatmnh3
use mo_vgrid, only: set_vgrid
use mo_apply_fedep, only: apply_fedep
use mo_apply_rivin, only: apply_rivin
@@ -69,6 +71,7 @@ subroutine hamocc4bcm(kpie,kpje,kpke,kbnd,kplyear,kplmon,kplday,kldtday,pdlxp,pd
use mo_cyano, only: cyano
use mo_ocprod, only: ocprod
use mo_carchm, only: carchm
+ use mo_chemcon, only: mw_nh3,mw_n2o
! Arguments
integer, intent(in) :: kpie ! 1st dimension of model grid.
@@ -87,7 +90,7 @@ subroutine hamocc4bcm(kpie,kpje,kpke,kbnd,kplyear,kplmon,kplday,kldtday,pdlxp,pd
real, intent(in) :: omask (kpie,kpje) ! land/ocean mask.
real, intent(in) :: dust (kpie,kpje) ! dust deposition flux [kg/m2/month].
real, intent(in) :: rivin (kpie,kpje,nriv) ! riverine input [kmol m-2 yr-1].
- real, intent(in) :: ndep (kpie,kpje) ! nitrogen deposition [kmol m-2 yr-1].
+ real, intent(in) :: ndep (kpie,kpje,nndep) ! nitrogen deposition [kmol m-2 yr-1].
real, intent(in) :: oafx (kpie,kpje) ! alkalinity flux from alkalinization [kmol m-2 yr-1]
real, intent(in) :: pi_ph (kpie,kpje) ! pre-ind. pH climatology used for pH-dependent DMS fluxes [log10([H+])]
real, intent(in) :: pfswr (1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd) ! solar radiation [W/m**2].
@@ -101,6 +104,10 @@ subroutine hamocc4bcm(kpie,kpje,kpke,kbnd,kplyear,kplmon,kplday,kldtday,pdlxp,pd
real, intent(out) :: pflxdms(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd) ! DMS flux [kg/m^2/s].
real, intent(in) :: patmbromo(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd) ! atmospheric bromoform concentration [ppt] used in fully coupled mode.
real, intent(out) :: pflxbromo(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd) ! Bromoform flux [kg/m^2/s].
+ real, intent(in) :: patmn2o(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd) ! atmospheric nitrous oxide concentration [ppt] used in fully coupled mode.
+ real, intent(out) :: pflxn2o(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd) ! Nitrous oxide flux [kg N2O m-2 s-1].
+ real, intent(in) :: patmnh3(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd) ! atmospheric ammonia concentration [ppt] used in fully coupled mode
+ real, intent(out) :: pflxnh3(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd) ! Ammonia flux [kg NH3 m-2 s-1].
! Local variables
integer :: i,j,k,l
@@ -164,6 +171,24 @@ subroutine hamocc4bcm(kpie,kpje,kpke,kbnd,kplyear,kplmon,kplday,kldtday,pdlxp,pd
if (mnproc.eq.1) write (io_stdo_bgc,*) 'iHAMOCC: getting bromoform from atm'
endif
+ if (use_extNcycle) then
+ if (do_n2onh3_coupled) then
+ !$OMP PARALLEL DO PRIVATE(i)
+ do j=1,kpje
+ do i=1,kpie
+ if (patmn2o(i,j) > 0.) then
+ atm(i,j,iatmn2o)=patmn2o(i,j)
+ endif
+ if (patmnh3(i,j) > 0.) then
+ atm(i,j,iatmnh3)=patmnh3(i,j)
+ endif
+ enddo
+ enddo
+ !$OMP END PARALLEL DO
+ if (mnproc.eq.1) write (io_stdo_bgc,*) 'iHAMOCC: getting N2O and NH3 conc. from atm'
+ endif
+ endif
+
!--------------------------------------------------------------------
! Read atmospheric cfc concentrations
!
@@ -190,7 +215,7 @@ subroutine hamocc4bcm(kpie,kpje,kpke,kbnd,kplyear,kplmon,kplday,kldtday,pdlxp,pd
! the model
call apply_fedep(kpie,kpje,kpke,pddpo,omask,dust)
- call ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
+ call ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph,psao,ppao,prho)
if (use_PBGC_CK_TIMESTEP ) then
if (mnproc.eq.1) then
@@ -317,7 +342,7 @@ subroutine hamocc4bcm(kpie,kpje,kpke,kbnd,kplyear,kplmon,kplday,kldtday,pdlxp,pd
lspin=.false.
endif
- call powach(kpie,kpje,kpke,kbnd,prho,omask,psao,lspin)
+ call powach(kpie,kpje,kpke,kbnd,prho,omask,psao,ptho,lspin)
enddo
@@ -386,7 +411,27 @@ subroutine hamocc4bcm(kpie,kpje,kpke,kbnd,kplyear,kplmon,kplday,kldtday,pdlxp,pd
enddo
!$OMP END PARALLEL DO
!--------------------------------------------------------------------
-
+ ! Pass nitrous oxide and ammonia fluxes. Convert unit from kmol N2O (NH3)/m2/Delta t to kg/m2/s
+ ! negative values to the atmosphere
+ !$OMP PARALLEL DO PRIVATE(i)
+ do j=1,kpje
+ do i=1,kpie
+ if (use_extNcycle) then
+ if (do_n2onh3_coupled) then
+ if(omask(i,j) > 0.5) pflxn2o(i,j)=-mw_n2o*atmflx(i,j,iatmn2o)/dtbgc ! conversion factor checked against CAM
+ if(omask(i,j) > 0.5) pflxnh3(i,j)=-mw_nh3*atmflx(i,j,iatmnh3)/dtbgc ! conversion factor checked against CAM
+ else
+ if(omask(i,j) > 0.5) pflxn2o(i,j)=0.0
+ if(omask(i,j) > 0.5) pflxnh3(i,j)=0.0
+ endif
+ else
+ if(omask(i,j) > 0.5) pflxn2o(i,j)=0.0
+ if(omask(i,j) > 0.5) pflxnh3(i,j)=0.0
+ endif
+ enddo
+ enddo
+ !$OMP END PARALLEL DO
+ !--------------------------------------------------------------------
end subroutine hamocc4bcm
end module mo_hamocc4bcm
diff --git a/hamocc/mo_hamocc_init.F90 b/hamocc/mo_hamocc_init.F90
index dbfbab4a..3df63a31 100644
--- a/hamocc/mo_hamocc_init.F90
+++ b/hamocc/mo_hamocc_init.F90
@@ -42,8 +42,9 @@ subroutine hamocc_init(read_rest,rstfnm_hamocc)
use mo_control_bgc, only: bgc_namelist,get_bgc_namelist,do_ndep,do_rivinpt,do_oalk, &
do_sedspinup,sedspin_yr_s,sedspin_yr_e,sedspin_ncyc, &
dtb,dtbgc,io_stdo_bgc,ldtbgc, &
- ldtrunbgc,ndtdaybgc,with_dmsph,l_3Dvarsedpor, &
- ocn_co2_type, use_sedbypass, use_BOXATM, use_BROMO
+ ldtrunbgc,ndtdaybgc,with_dmsph,l_3Dvarsedpor,use_M4AGO, &
+ do_ndep_coupled,leuphotic_cya,do_n2onh3_coupled, &
+ ocn_co2_type, use_sedbypass, use_BOXATM, use_BROMO,use_extNcycle
use mo_param1_bgc, only: ks,init_por2octra_mapping
use mo_param_bgc, only: ini_parambgc
use mo_carbch, only: alloc_mem_carbch,ocetra,atm,atm_co2
@@ -63,6 +64,9 @@ subroutine hamocc_init(read_rest,rstfnm_hamocc)
sedlay2,powtra2,burial2,blom2hamocc,atm2
use mo_ini_fields, only: ini_fields_ocean,ini_fields_atm
use mo_aufr_bgc, only: aufr_bgc
+ use mo_extNsediment,only: alloc_mem_extNsediment_diag
+ use mo_ihamocc4m4ago, only: alloc_mem_m4ago,init_m4ago_nml_params, init_m4ago_params
+
! Arguments
integer, intent(in) :: read_rest ! flag indicating whether to read restart files.
@@ -76,7 +80,8 @@ subroutine hamocc_init(read_rest,rstfnm_hamocc)
namelist /bgcnml/ atm_co2,fedepfile,do_rivinpt,rivinfile,do_ndep,ndepfile,do_oalk, &
& do_sedspinup,sedspin_yr_s,sedspin_yr_e,sedspin_ncyc, &
& inidic,inialk,inipo4,inioxy,inino3,inisil,inid13c,inid14c,swaclimfile, &
- & with_dmsph,pi_ph_file,l_3Dvarsedpor,sedporfile,ocn_co2_type
+ & with_dmsph,pi_ph_file,l_3Dvarsedpor,sedporfile,ocn_co2_type,use_M4AGO, &
+ & leuphotic_cya, do_ndep_coupled,do_n2onh3_coupled
!
! --- Set io units and some control parameters
!
@@ -134,6 +139,12 @@ subroutine hamocc_init(read_rest,rstfnm_hamocc)
call alloc_mem_biomod(idm,jdm,kdm)
call alloc_mem_sedmnt(idm,jdm)
call alloc_mem_carbch(idm,jdm,kdm)
+ if (use_M4AGO) then
+ call alloc_mem_M4AGO(idm,jdm,kdm)
+ endif
+ if (use_extNcycle .and. .not. use_sedbypass) then
+ call alloc_mem_extNsediment_diag(idm,jdm,ks)
+ endif
!
! --- initialise trc array (two time levels)
!
@@ -168,6 +179,10 @@ subroutine hamocc_init(read_rest,rstfnm_hamocc)
! --- Initialize parameters
!
call ini_parambgc(idm,jdm)
+ if (use_M4AGO) then
+ call init_m4ago_nml_params
+ call init_m4ago_params
+ endif
! --- Initialize atmospheric fields with (updated) parameter values
call ini_fields_atm(idm,jdm)
diff --git a/hamocc/mo_hamocc_step.F90 b/hamocc/mo_hamocc_step.F90
index 3b9d486f..39515374 100644
--- a/hamocc/mo_hamocc_step.F90
+++ b/hamocc/mo_hamocc_step.F90
@@ -28,12 +28,13 @@ subroutine hamocc_step(m,n,mm,nn,k1m,k1n)
! **********************************************************************************************
! Perform one HAMOCC step
! **********************************************************************************************
-
+
use mod_xc, only: idm,jdm,kdm,nbdy
use mod_time, only: date,nday_of_year,nstep,nstep_in_day
use mod_grid, only: plat
use mod_state, only: temp,saln
- use mod_forcing, only: swa,slp,abswnd,atmco2,flxco2,flxdms,atmbrf,flxbrf
+ use mod_forcing, only: swa,slp,abswnd,atmco2,flxco2,flxdms,atmbrf,flxbrf, &
+ atmn2o,flxn2o,atmnh3,flxnh3,atmnhxdep,atmnoydep
use mod_seaice, only: ficem
use mo_bgcmean, only: nbgc,bgcwrt, diagfq_bgc,diagmon_bgc,diagann_bgc
use mo_intfcblom, only: bgc_dx,bgc_dy,bgc_dp,bgc_rho,omask,blom2hamocc,hamocc2blom
@@ -46,13 +47,14 @@ subroutine hamocc_step(m,n,mm,nn,k1m,k1n)
use mo_accfields, only: accfields
use mo_hamocc4bcm, only: hamocc4bcm
use mo_trc_limitc, only: trc_limitc
+ use mo_param1_bgc, only: nndep
! Arguments
integer, intent(in) :: m,n,mm,nn,k1m,k1n
! Local variables
integer :: l,ldtday
- real :: ndep(idm,jdm)
+ real :: ndep(idm,jdm,nndep)
real :: dust(idm,jdm)
real :: oafx(idm,jdm)
@@ -73,14 +75,15 @@ subroutine hamocc_step(m,n,mm,nn,k1m,k1n)
enddo
call get_fedep(idm,jdm,date%month,dust)
- call get_ndep(idm,jdm,date%year,date%month,omask,ndep)
+ call get_ndep(idm,jdm,nbdy,date%year,date%month,omask,ndep,atmnhxdep,atmnoydep)
call get_oafx(idm,jdm,date%year,date%month,omask,oafx)
if(with_dmsph) call get_pi_ph(idm,jdm,date%month)
call hamocc4bcm(idm,jdm,kdm,nbdy,date%year,date%month,date%day,ldtday,bgc_dx,bgc_dy,bgc_dp, &
& bgc_rho,plat,omask,dust,rivflx,ndep,oafx,pi_ph,swa,ficem,slp,abswnd, &
& temp(1-nbdy,1-nbdy,1+nn),saln(1-nbdy,1-nbdy,1+nn), &
- & atmco2,flxco2,flxdms,atmbrf,flxbrf)
+ & atmco2,flxco2,flxdms,atmbrf,flxbrf, &
+ & atmn2o,flxn2o,atmnh3,flxnh3)
!
! --- accumulate fields and write output
diff --git a/hamocc/mo_ini_fields.F90 b/hamocc/mo_ini_fields.F90
index 5b7e48ce..26f4e131 100644
--- a/hamocc/mo_ini_fields.F90
+++ b/hamocc/mo_ini_fields.F90
@@ -38,9 +38,9 @@ subroutine ini_fields_atm(kpie,kpje)
! -split the original BELEG_BGC in two parts, BELEG_PARM (NOW MO_PARAM_BGC) and BELEG_VARS
!***********************************************************************************************
- use mo_control_bgc, only: use_natDIC,use_cisonew,use_BROMO
- use mo_param1_bgc, only: iatmco2,iatmo2,iatmn2,iatmnco2,iatmc13,iatmc14,iatmbromo
- use mo_param_bgc, only: atm_o2,atm_n2,atm_co2_nat,atm_c13,atm_c14,c14fac,atm_bromo
+ use mo_control_bgc, only: use_natDIC,use_cisonew,use_BROMO,use_extNcycle
+ use mo_param1_bgc, only: iatmco2,iatmo2,iatmn2,iatmn2o,iatmnh3,iatmnco2,iatmc13,iatmc14,iatmbromo
+ use mo_param_bgc, only: atm_o2,atm_n2,atm_co2_nat,atm_c13,atm_c14,c14fac,atm_bromo,atm_n2o,atm_nh3
use mo_carbch, only: atm,atm_co2
! Initialise atmosphere fields. We use a 2D representation of atmospheric
@@ -59,6 +59,7 @@ subroutine ini_fields_atm(kpie,kpje)
atm(i,j,iatmco2) = atm_co2
atm(i,j,iatmo2) = atm_o2
atm(i,j,iatmn2) = atm_n2
+ atm(i,j,iatmn2o) = atm_n2o
if (use_natDIC) then
atm(i,j,iatmnco2) = atm_co2_nat
endif
@@ -69,6 +70,9 @@ subroutine ini_fields_atm(kpie,kpje)
if (use_BROMO) then
atm(i,j,iatmbromo)= atm_bromo
endif
+ if (use_extNcycle) then
+ atm(i,j,iatmnh3) = atm_nh3
+ endif
enddo
enddo
end subroutine ini_fields_atm
@@ -90,7 +94,7 @@ subroutine ini_fields_ocean(kpaufr,kpie,kpje,kpke,kbnd,pddpo,prho,omask,pglon,pg
use mo_param_bgc, only: fesoly,cellmass,fractdim,bifr13_ini,bifr14_ini,c14fac,re1312,re14to
use mo_biomod, only: abs_oce
use mo_control_bgc, only: rmasks,use_FB_BGC_OCE,use_cisonew,use_AGG,use_CFC,use_natDIC, &
- use_BROMO, use_sedbypass
+ use_BROMO, use_sedbypass,use_extNcycle
use mo_param1_bgc, only: ialkali,ian2o,iano3,icalc,idet,idicsat,idms,idoc,ifdust,igasnit, &
iiron,iopal,ioxygen,iphosph,iphy,iprefalk,iprefdic,iprefo2,iprefpo4, &
isco212,isilica,izoo,iadust,inos,ibromo,icfc11,icfc12,isf6, &
@@ -98,7 +102,7 @@ subroutine ini_fields_ocean(kpaufr,kpie,kpje,kpke,kbnd,pddpo,prho,omask,pglon,pg
isco213,isco214,izoo13,izoo14,safediv,inatcalc, &
ipowaal,ipowaic,ipowaox,ipowaph,ipowasi,ipown2,ipowno3,isssc12, &
issso12,issssil,issster,ks,nsedtra,ipowc13,ipowc13,issso13,issso13, &
- isssc13,ipowc14,isssc14,issso14
+ isssc13,ipowc14,isssc14,issso14,iprefsilica,iano2,ianh4
use mo_vgrid, only: kmle,kbo
use mo_carbch, only: nathi,natco3
use mo_sedmnt, only: sedhpl,burial,powtra,sedlay
@@ -188,6 +192,7 @@ subroutine ini_fields_ocean(kpaufr,kpie,kpje,kpke,kbnd,pddpo,prho,omask,pglon,pg
ocetra(i,j,k,iiron) =fesoly
ocetra(i,j,k,iprefo2)=0.
ocetra(i,j,k,iprefpo4)=0.
+ ocetra(i,j,k,iprefsilica)=0.
ocetra(i,j,k,iprefalk)=0.
ocetra(i,j,k,iprefdic)=0.
ocetra(i,j,k,idicsat)=1.e-8
@@ -228,6 +233,11 @@ subroutine ini_fields_ocean(kpaufr,kpie,kpje,kpke,kbnd,pddpo,prho,omask,pglon,pg
! Initialise to 0,01 pmol L-1 (Stemmler et al., 2015) => mol/kg
ocetra(i,j,k,ibromo)= 1.e-14/prho(i,j,k)
endif
+ if (use_extNcycle) then
+ ocetra(i,j,k,iano2) =1.e-9 ! expecting fast cycling
+ ocetra(i,j,k,ianh4) =0.5e-9 ! expecting fast cycling
+ ocetra(i,j,k,ian2o) =6.e-9 ! 6 to 8 nmol/kg = ca. value in near surface regions Toyoda et al. 2019, prevent from too long outgassing
+ endif
endif ! omask > 0.5
enddo
enddo
@@ -240,6 +250,7 @@ subroutine ini_fields_ocean(kpaufr,kpie,kpje,kpke,kbnd,pddpo,prho,omask,pglon,pg
if (omask(i,j) > 0.5) then
ocetra(i,j,1:kmle(i,j),iprefo2) = ocetra(i,j,1:kmle(i,j),ioxygen)
ocetra(i,j,1:kmle(i,j),iprefpo4) = ocetra(i,j,1:kmle(i,j),iphosph)
+ ocetra(i,j,1:kmle(i,j),iprefsilica)= ocetra(i,j,1:kmle(i,j),isilica)
ocetra(i,j,1:kmle(i,j),iprefalk) = ocetra(i,j,1:kmle(i,j),ialkali)
ocetra(i,j,1:kmle(i,j),iprefdic) = ocetra(i,j,1:kmle(i,j),isco212)
endif
diff --git a/hamocc/mo_inventory_bgc.F90 b/hamocc/mo_inventory_bgc.F90
index 1f4d1895..263f0d8e 100644
--- a/hamocc/mo_inventory_bgc.F90
+++ b/hamocc/mo_inventory_bgc.F90
@@ -38,24 +38,26 @@ subroutine inventory_bgc(kpie,kpje,kpke,dlxp,dlyp,ddpo,omask,iogrp)
!***********************************************************************************************
use mod_xc, only: mnproc,ips,nbdy,xcsum
- use mo_carbch, only: atm,atmflx,co3,hi,ndepflx,rivinflx,ocetra,sedfluxo
+ use mo_carbch, only: atm,atmflx,co3,hi,ndepnoyflx,rivinflx,ocetra,sedfluxo,ndepnhxflx
use mo_sedmnt, only: prcaca,prorca,silpro
use mo_biomod, only: expoor,expoca,exposi
use mo_param_bgc, only: rcar,rnit
use mo_control_bgc, only: do_ndep,do_rivinpt,io_stdo_bgc
- use mo_bgcmean, only: bgct2d,jco2flux,jirdin,jn2flux,jn2oflux,jndep,jo2flux,jprcaca, &
+ use mo_bgcmean, only: bgct2d,jco2flux,jirdin,jn2flux,jn2oflux,jndepnoy,jndepnhx, &
+ jo2flux,jprcaca,jnh3flux, &
jprorca,jsilpro,nbgcmax,glb_inventory
use mo_param1_bgc, only: ialkali,ian2o,iano3,iatmco2,iatmn2,iatmn2o,iatmo2,icalc,idet,idoc, &
igasnit,iopal,ioxygen,iphosph,iphy,ipowaic,ipowaox,ipowaph,ipowasi, &
ipown2,ipowno3,isco212,isilica,isssc12,issso12,issssil,izoo, &
- irdin,irdip,irsi,iralk,irdoc,irdet,nocetra,npowtra,nsedtra,nriv
+ irdin,irdip,irsi,iralk,irdoc,irdet,nocetra,npowtra,nsedtra,nriv, &
+ ianh4,iano2,iatmnh3,ipownh4,ipown2o,ipowno2
use mo_vgrid, only: dp_min
! NOT sedbypass
use mo_param1_bgc, only: ks
use mo_sedmnt, only: porwat,seddw,sedlay,burial,sedhpl,powtra,porsol
use mo_control_bgc, only: use_PBGC_CK_TIMESTEP,use_BOXATM,use_sedbypass,use_cisonew,use_AGG, &
- use_CFC,use_natDIC,use_BROMO
+ use_CFC,use_natDIC,use_BROMO,use_extNcycle
! Arguments
integer, intent(in) :: kpie,kpje,kpke
@@ -96,9 +98,10 @@ subroutine inventory_bgc(kpie,kpje,kpke,dlxp,dlyp,ddpo,omask,iogrp)
!--- river fluxes
real :: srivflux(nriv) ! sum of riverfluxes
!--- atmosphere flux and atmospheric CO2
- real :: sndepflux ! sum of N dep fluxes
+ real :: sndepnoyflux ! sum of N dep fluxes
+ real :: sndepnhxflux ! sum of N dep fluxes
real :: zatmco2,zatmo2,zatmn2
- real :: co2flux,so2flux,sn2flux,sn2oflux
+ real :: co2flux,so2flux,sn2flux,sn2oflux,snh3flux
real :: zprorca,zprcaca,zsilpro
!--- total tracer budgets
real :: totalcarbon,totalphos,totalsil,totalnitr,totaloxy
@@ -271,7 +274,9 @@ subroutine inventory_bgc(kpie,kpje,kpke,dlxp,dlyp,ddpo,omask,iogrp)
so2flux =0.
sn2flux =0.
sn2oflux =0.
- sndepflux=0.
+ snh3flux =0.
+ sndepnoyflux=0.
+ sndepnhxflux=0.
srivflux =0.
zatmco2 =0.
zatmo2 =0.
@@ -291,10 +296,16 @@ subroutine inventory_bgc(kpie,kpje,kpke,dlxp,dlyp,ddpo,omask,iogrp)
so2flux = sum2d(atmflx(:,:,iatmo2))
sn2flux = sum2d(atmflx(:,:,iatmn2))
sn2oflux = sum2d(atmflx(:,:,iatmn2o))
+ if (use_extNcycle) then
+ snh3flux = sum2d(atmflx(:,:,iatmnh3))
+ endif
! nitrogen deposition
if(do_ndep) then
- sndepflux = sum2d(ndepflx)
+ sndepnoyflux = sum2d(ndepnoyflx)
+ if (use_extNcycle) then
+ sndepnhxflux = sum2d(ndepnhxflx)
+ endif
endif
! river fluxes
@@ -307,10 +318,16 @@ subroutine inventory_bgc(kpie,kpje,kpke,dlxp,dlyp,ddpo,omask,iogrp)
so2flux = sum2d(bgct2d(:,:,jo2flux))
sn2flux = sum2d(bgct2d(:,:,jn2flux))
sn2oflux = sum2d(bgct2d(:,:,jn2oflux))
+ if (use_extNcycle) then
+ snh3flux = sum2d(bgct2d(:,:,jnh3flux))
+ endif
! nitrogen deposition fluxes
if(do_ndep) then
- sndepflux = sum2d(bgct2d(:,:,jndep))
+ sndepnoyflux = sum2d(bgct2d(:,:,jndepnoy))
+ if (use_extNcycle) then
+ sndepnhxflux = sum2d(bgct2d(:,:,jndepnhx))
+ endif
endif
! River fluxes
@@ -358,7 +375,7 @@ subroutine inventory_bgc(kpie,kpje,kpke,dlxp,dlyp,ddpo,omask,iogrp)
+ zpowtratot(ipowno3)+zpowtratot(ipown2)*2 &
+ zsedlayto(issso12)*rnit+zburial(issso12)*rnit &
+ zocetratot(ian2o)*2 &
- - sndepflux &
+ - sndepnoyflux &
+ zprorca*rnit
if (use_BOXATM) then
@@ -366,6 +383,11 @@ subroutine inventory_bgc(kpie,kpje,kpke,dlxp,dlyp,ddpo,omask,iogrp)
else
totalnitr = totalnitr + sn2flux*2+sn2oflux*2
endif
+ if (use_extNcycle) then
+ totalnitr = totalnitr + zocetratot(ianh4)+zocetratot(iano2)+snh3flux&
+ & - sndepnhxflux &
+ & +zpowtratot(ipownh4)+zpowtratot(ipown2o)*2+zpowtratot(ipowno2)
+ endif
totalphos= &
zocetratot(idet)+zocetratot(idoc)+zocetratot(iphy) &
@@ -388,7 +410,7 @@ subroutine inventory_bgc(kpie,kpje,kpke,dlxp,dlyp,ddpo,omask,iogrp)
!+ zburial(issso12)*(-24.) + zburial(isssc12) &
+ zpowtratot(ipowno3)*1.5+zpowtratot(ipowaic) &
+ zpowtratot(ipowaox)+zpowtratot(ipowaph)*2 &
- - sndepflux*1.5 &
+ - sndepnoyflux*1.5 &
+ zprorca*(-24.)+zprcaca
if (use_BOXATM) then
@@ -396,6 +418,9 @@ subroutine inventory_bgc(kpie,kpje,kpke,dlxp,dlyp,ddpo,omask,iogrp)
else
totaloxy = totaloxy + so2flux+sn2oflux*0.5+co2flux
endif
+ if (use_extNcycle) then
+ totaloxy = totaloxy + zocetratot(iano2)+zpowtratot(ipown2o)*0.5+zpowtratot(ipowno2)
+ endif
if (do_rivinpt) then
totalcarbon = totalcarbon- (srivflux(irdoc)+srivflux(irdet))*rcar &
@@ -568,6 +593,9 @@ subroutine write_stdout
! write(io_stdo_bgc,*) 'O2 Flux :',so2flux
! write(io_stdo_bgc,*) 'N2 Flux :',sn2flux
! write(io_stdo_bgc,*) 'N2O Flux :',sn2oflux
+ if (use_extNcycle) then
+ ! write(io_stdo_bgc,*) 'NH3 Flux :',snh3flux
+ endif
! write(io_stdo_bgc,*) ' '
if (use_BOXATM) then
! write(io_stdo_bgc,*) 'global atm. CO2[ppm] / kmol: ', &
@@ -583,7 +611,12 @@ subroutine write_stdout
! & zprorca, zprcaca, zsilpro
! write(io_stdo_bgc,*) ' '
- if (do_ndep) write(io_stdo_bgc,*) 'NdepFlux :',sndepflux
+ if(do_ndep) then
+ write(io_stdo_bgc,*) 'NdepNOyFlux :',sndepnoyflux
+ if (use_extNcycle) then
+ write(io_stdo_bgc,*) 'NdepNHxFlux :',sndepnhxflux
+ endif
+ endif
! riverine fluxes
!------------------------------------------------------------------
@@ -647,7 +680,7 @@ subroutine write_netcdf(iogrp)
use mo_param1_bgc, only: idicsat,idms,ifdust,iiron,iprefalk,iprefdic,iprefo2,iprefpo4, &
iadust,inos,ibromo,icfc11,icfc12,isf6,icalc13,icalc14,idet13, &
idet14,idoc13,idoc14,iphy13,iphy14,isco213,isco214,izoo13,izoo14, &
- inatalkali,inatcalc,inatsco212
+ inatalkali,inatcalc,inatsco212,ianh4,iano2,iprefsilica
use mo_control_bgc,only: use_PBGC_CK_TIMESTEP,use_BOXATM,use_sedbypass,use_cisonew,use_AGG, &
use_CFC,use_natDIC,use_BROMO
@@ -716,6 +749,7 @@ subroutine write_netcdf(iogrp)
integer :: zt_iron_varid, zc_iron_varid ! Dissolved iron
integer :: zt_prefo2_varid, zc_prefo2_varid ! Preformed oxygen
integer :: zt_prefpo4_varid, zc_prefpo4_varid ! Preformed phosphate
+ integer :: zt_prefsilica_varid,zc_prefsilica_varid ! Preformed silicate
integer :: zt_prefalk_varid, zc_prefalk_varid ! Preformed alkalinity
integer :: zt_prefdic_varid, zc_prefdic_varid ! Preformed DIC
integer :: zt_dicsat_varid, zc_dicsat_varid ! Saturated DIC
@@ -751,6 +785,10 @@ subroutine write_netcdf(iogrp)
! BROMO
integer :: zt_bromo_varid, zc_bromo_varid ! Bromoform
+ ! extNcycle
+ integer :: zt_nh4_varid, zc_nh4_varid ! Ammonium (NH4+)
+ integer :: zt_ano2_varid, zc_ano2_varid ! Nitrite (NO2-)
+
!--- sum of inventory
integer :: totcarb_varid, totphos_varid, totsili_varid, totnitr_varid
integer :: totoxyg_varid
@@ -1084,6 +1122,18 @@ subroutine write_netcdf(iogrp)
& 'Mean preformed phosphate concentration') )
call nccheck( NF90_PUT_ATT(ncid, zc_prefpo4_varid, 'units', 'kmol/m^3') )
+ call nccheck( NF90_DEF_VAR(ncid, 'zt_prefsilica', NF90_DOUBLE, &
+ & time_dimid, zt_prefsilica_varid) )
+ call nccheck( NF90_PUT_ATT(ncid, zt_prefsilica_varid, 'long_name', &
+ & 'Total preformed silica tracer') )
+ call nccheck( NF90_PUT_ATT(ncid, zt_prefsilica_varid, 'units', 'kmol') )
+
+ call nccheck( NF90_DEF_VAR(ncid, 'zc_prefsilica', NF90_DOUBLE, &
+ & time_dimid, zc_prefsilica_varid) )
+ call nccheck( NF90_PUT_ATT(ncid, zc_prefsilica_varid, 'long_name', &
+ & 'Mean preformed silica concentration') )
+ call nccheck( NF90_PUT_ATT(ncid, zc_prefsilica_varid, 'units', 'kmol/m^3') )
+
call nccheck( NF90_DEF_VAR(ncid, 'zt_prefalk', NF90_DOUBLE, &
& time_dimid, zt_prefalk_varid) )
call nccheck( NF90_PUT_ATT(ncid, zt_prefalk_varid, 'long_name', &
@@ -1386,7 +1436,31 @@ subroutine write_netcdf(iogrp)
& 'Mean bromoform concentration') )
call nccheck( NF90_PUT_ATT(ncid, zc_bromo_varid, 'units', 'kmol/m^3') )
endif
-
+ if (use_extNcycle) then
+ call nccheck( NF90_DEF_VAR(ncid, 'zt_nh4', NF90_DOUBLE, &
+ & time_dimid, zt_nh4_varid) )
+ call nccheck( NF90_PUT_ATT(ncid, zt_nh4_varid, 'long_name', &
+ & 'Total ammonium tracer') )
+ call nccheck( NF90_PUT_ATT(ncid, zt_nh4_varid, 'units', 'kmol') )
+
+ call nccheck( NF90_DEF_VAR(ncid, 'zc_nh4', NF90_DOUBLE, &
+ & time_dimid, zc_nh4_varid) )
+ call nccheck( NF90_PUT_ATT(ncid, zc_nh4_varid, 'long_name', &
+ & 'Mean ammonium concentration') )
+ call nccheck( NF90_PUT_ATT(ncid, zc_nh4_varid, 'units', 'kmol/m^3') )
+
+ call nccheck( NF90_DEF_VAR(ncid, 'zt_ano2', NF90_DOUBLE, &
+ & time_dimid, zt_ano2_varid) )
+ call nccheck( NF90_PUT_ATT(ncid, zt_ano2_varid, 'long_name', &
+ & 'Total nitrite tracer') )
+ call nccheck( NF90_PUT_ATT(ncid, zt_ano2_varid, 'units', 'kmol') )
+
+ call nccheck( NF90_DEF_VAR(ncid, 'zc_ano2', NF90_DOUBLE, &
+ & time_dimid, zc_ano2_varid) )
+ call nccheck( NF90_PUT_ATT(ncid, zc_ano2_varid, 'long_name', &
+ & 'Mean nitrite concentration') )
+ call nccheck( NF90_PUT_ATT(ncid, zc_ano2_varid, 'units', 'kmol/m^3') )
+ endif
!--- Define variables : sum of inventory
call nccheck( NF90_DEF_VAR(ncid, 'totcarb', NF90_DOUBLE, time_dimid, &
& totcarb_varid) )
@@ -1523,6 +1597,8 @@ subroutine write_netcdf(iogrp)
call nccheck( NF90_INQ_VARID(ncid, "zc_prefo2", zc_prefo2_varid) )
call nccheck( NF90_INQ_VARID(ncid, "zt_prefpo4", zt_prefpo4_varid) )
call nccheck( NF90_INQ_VARID(ncid, "zc_prefpo4", zc_prefpo4_varid) )
+ call nccheck( NF90_INQ_VARID(ncid, "zt_prefsilica", zt_prefsilica_varid) )
+ call nccheck( NF90_INQ_VARID(ncid, "zc_prefsilica", zc_prefsilica_varid) )
call nccheck( NF90_INQ_VARID(ncid, "zt_prefalk", zt_prefalk_varid) )
call nccheck( NF90_INQ_VARID(ncid, "zc_prefalk", zc_prefalk_varid) )
call nccheck( NF90_INQ_VARID(ncid, "zt_prefdic", zt_prefdic_varid) )
@@ -1581,6 +1657,12 @@ subroutine write_netcdf(iogrp)
call nccheck( NF90_INQ_VARID(ncid, "zt_bromo", zt_bromo_varid) )
call nccheck( NF90_INQ_VARID(ncid, "zc_bromo", zc_bromo_varid) )
endif
+ if (use_extNcycle) then
+ call nccheck( NF90_INQ_VARID(ncid, "zt_nh4", zt_nh4_varid) )
+ call nccheck( NF90_INQ_VARID(ncid, "zc_nh4", zc_nh4_varid) )
+ call nccheck( NF90_INQ_VARID(ncid, "zt_ano2", zt_ano2_varid) )
+ call nccheck( NF90_INQ_VARID(ncid, "zc_ano2", zc_ano2_varid) )
+ endif
!--- Inquire varid : sum of inventory
call nccheck( NF90_INQ_VARID(ncid, "totcarb", totcarb_varid) )
call nccheck( NF90_INQ_VARID(ncid, "totphos", totphos_varid) )
@@ -1704,6 +1786,10 @@ subroutine write_netcdf(iogrp)
& zocetratot(iprefpo4), start = wrstart) )
call nccheck( NF90_PUT_VAR(ncid, zc_prefpo4_varid, &
& zocetratoc(iprefpo4), start = wrstart) )
+ call nccheck( NF90_PUT_VAR(ncid, zt_prefsilica_varid, &
+ & zocetratot(iprefsilica), start = wrstart) )
+ call nccheck( NF90_PUT_VAR(ncid, zc_prefsilica_varid, &
+ & zocetratoc(iprefsilica), start = wrstart) )
call nccheck( NF90_PUT_VAR(ncid, zt_prefalk_varid, &
& zocetratot(iprefalk), start = wrstart) )
call nccheck( NF90_PUT_VAR(ncid, zc_prefalk_varid, &
@@ -1810,6 +1896,16 @@ subroutine write_netcdf(iogrp)
call nccheck( NF90_PUT_VAR(ncid, zc_bromo_varid, &
& zocetratoc(ibromo), start = wrstart) )
endif
+ if (use_extNcycle) then
+ call nccheck( NF90_PUT_VAR(ncid, zt_nh4_varid, &
+ & zocetratot(ianh4), start = wrstart) )
+ call nccheck( NF90_PUT_VAR(ncid, zc_nh4_varid, &
+ & zocetratoc(ianh4), start = wrstart) )
+ call nccheck( NF90_PUT_VAR(ncid, zt_ano2_varid, &
+ & zocetratot(iano2), start = wrstart) )
+ call nccheck( NF90_PUT_VAR(ncid, zc_ano2_varid, &
+ & zocetratoc(iano2), start = wrstart) )
+ endif
!--- Write data : sum of inventory
call nccheck( NF90_PUT_VAR(ncid, totcarb_varid, totalcarbon, &
& start = wrstart) )
diff --git a/hamocc/mo_ncout_hamocc.F90 b/hamocc/mo_ncout_hamocc.F90
index bd31ef68..98073b3c 100644
--- a/hamocc/mo_ncout_hamocc.F90
+++ b/hamocc/mo_ncout_hamocc.F90
@@ -35,11 +35,11 @@ subroutine ncwrt_bgc(iogrp)
use mod_grid, only: depths
use mod_dia, only: diafnm,sigmar1,iotype,ddm,depthslev,depthslev_bnds
use mo_control_bgc, only: dtbgc,use_cisonew,use_AGG,use_CFC,use_natDIC,use_BROMO, &
- use_sedbypass,use_BOXATM
+ use_sedbypass,use_BOXATM,use_M4AGO,use_extNcycle
use mo_vgrid, only: k0100,k0500,k1000,k2000,k4000
use mo_param1_bgc, only: ks
use mod_nctools, only: ncwrt1,ncdims,nctime,ncfcls,ncfopn,ncdimc,ncputr,ncputi
- use mo_bgcmean, only: domassfluxes,flx_ndep,flx_oalk, &
+ use mo_bgcmean, only: domassfluxes,flx_ndepnoy,flx_oalk, &
flx_cal0100,flx_cal0500,flx_cal1000, &
flx_cal2000,flx_cal4000,flx_cal_bot, &
flx_car0100,flx_car0500,flx_car1000, &
@@ -48,8 +48,12 @@ subroutine ncwrt_bgc(iogrp)
flx_bsi2000,flx_bsi4000,flx_bsi_bot, &
flx_sediffic,flx_sediffal,flx_sediffph, &
flx_sediffox,flx_sediffn2,flx_sediffno3,flx_sediffsi, &
+ flx_bursso12,flx_bursssc12,flx_burssssil, &
+ flx_burssster, &
jsediffic,jsediffal,jsediffph,jsediffox, &
jsediffn2,jsediffno3,jsediffsi, &
+ jburflxsso12,jburflxsssc12,jburflxssssil, &
+ jburflxssster, &
jalkali,jano3,jasize,jatmco2, &
jbsiflx0100,jbsiflx0500,jbsiflx1000, &
jbsiflx2000,jbsiflx4000,jbsiflx_bot, &
@@ -74,12 +78,12 @@ subroutine ncwrt_bgc(iogrp)
jlvlphosy,jlvlphyto,jlvlphyto13,jlvlpoc, &
jlvlpoc13,jlvlprefalk,jlvlprefdic, &
jlvlprefo2,jlvlprefpo4,jlvlsf6,jlvlsilica, &
- jlvlwnos,jlvlwphy,jn2o, &
- jn2ofx,jndepfx,jniflux,jnos,joalkfx, &
+ jlvlwnos,jlvlwphy,jn2o,jsrfpn2om, &
+ jn2ofx,jndepnoyfx,jniflux,jnos,joalkfx, &
jo2sat,jomegaa,jomegac,jopal,joxflux,joxygen,jpco2, &
jpco2m,jkwco2khm,jco2kh,jco2khm, &
jph,jphosph,jphosy,jphyto,jpoc,jprefalk, &
- jprefdic,jprefo2,jprefpo4,jsilica, &
+ jprefdic,jprefo2,jprefpo4,jsilica,jprefsilica, &
jsrfalkali,jsrfano3,jsrfdic,jsrfiron, &
jsrfoxygen,jsrfphosph,jsrfphyto,jsrfsilica,jsrfph, &
jwnos,jwphy, &
@@ -88,16 +92,16 @@ subroutine ncwrt_bgc(iogrp)
lyr_phyto,lyr_grazer,lyr_poc,lyr_calc, &
lyr_opal,lyr_iron,lyr_phosy,lyr_co3,lyr_ph, &
lyr_omegaa,lyr_omegac,lyr_n2o,lyr_prefo2, &
- lyr_o2sat,lyr_prefpo4,lyr_prefalk, &
+ lyr_o2sat,lyr_prefpo4,lyr_prefalk,lyr_prefsilica, &
lyr_prefdic,lyr_dicsat, &
lvl_dic,lvl_alkali, &
lvl_phosph,lvl_oxygen,lvl_ano3,lvl_silica, &
lvl_doc,lvl_phyto,lvl_grazer,lvl_poc, &
lvl_calc,lvl_opal,lvl_iron,lvl_phosy, &
lvl_co3,lvl_ph,lvl_omegaa,lvl_omegac, &
- lvl_n2o,lvl_prefo2,lvl_o2sat,lvl_prefpo4, &
+ lvl_n2o,lvl_prefo2,lvl_o2sat,lvl_prefpo4,lvl_prefsilica, &
lvl_prefalk,lvl_prefdic,lvl_dicsat, &
- lvl_o2sat,srf_n2ofx,srf_atmco2,srf_kwco2, &
+ lvl_o2sat,srf_n2ofx,srf_pn2om,srf_atmco2,srf_kwco2, &
srf_kwco2khm,srf_co2kh,srf_co2khm,srf_pco2m, &
srf_pco2,srf_dmsflux,srf_co2fxd, &
srf_co2fxu,srf_oxflux,srf_niflux,srf_dms, &
@@ -133,7 +137,7 @@ subroutine ncwrt_bgc(iogrp)
lvl_d14c,lvl_bigd14c,lvl_poc13,lvl_doc13, &
lvl_calc13,lvl_phyto13,lvl_grazer13, &
jnatalkali,jnatdic,jnatcalc,jnatco3,jnatph, &
- jnatomegaa,jnatomegac,jlvlnatph, &
+ jnatomegaa,jnatomegac,jlvlnatph,jlvlprefsilica, &
jsrfnatdic,jsrfnatalk,jsrfnatph, &
jnatpco2,jnatco2fx,lyr_natco3, &
lyr_natalkali,lyr_natdic,lyr_natph,lyr_natcalc, &
@@ -149,7 +153,63 @@ subroutine ncwrt_bgc(iogrp)
sdm_ssssil,sdm_sssc12,sdm_ssster,jburssso12, &
bur_sssc12,bur_ssssil,bur_ssster,bur_ssso12, &
inisdm,inibur,wrtsdm,accbur,accsdm,wrtbur, &
- jatmco2,jatmn2,jatmo2,srf_atmo2,srf_atmn2
+ jatmco2,jatmn2,jatmo2,srf_atmo2,srf_atmn2, &
+ lyr_agg_ws,lyr_dynvis,lyr_agg_stick, &
+ lyr_agg_stickf,lyr_agg_dmax,lyr_agg_avdp, &
+ lyr_agg_avrhop,lyr_agg_avdC,lyr_agg_df, &
+ lyr_agg_b,lyr_agg_Vrhof,lyr_agg_Vpor, &
+ lvl_agg_ws,lvl_dynvis,lvl_agg_stick, &
+ lvl_agg_stickf,lvl_agg_dmax,lvl_agg_avdp, &
+ lvl_agg_avrhop,lvl_agg_avdC,lvl_agg_df, &
+ lvl_agg_b,lvl_agg_Vrhof,lvl_agg_Vpor, &
+ jagg_ws,jdynvis,jagg_stick, &
+ jagg_stickf,jagg_dmax,jagg_avdp, &
+ jagg_avrhop,jagg_avdC,jagg_df, &
+ jagg_b,jagg_Vrhof,jagg_Vpor, &
+ jlvl_agg_ws,jlvl_dynvis,jlvl_agg_stick, &
+ jlvl_agg_stickf,jlvl_agg_dmax,jlvl_agg_avdp, &
+ jlvl_agg_avrhop,jlvl_agg_avdC,jlvl_agg_df, &
+ jlvl_agg_b,jlvl_agg_Vrhof,jlvl_agg_Vpor, &
+ janh4,jano2,jlvlanh4,jlvlano2,jsrfanh4,jsrfpnh3, &
+ jsrfano2,janh3fx,srf_pnh3,srf_anh4,srf_ano2, &
+ srf_anh3fx,lyr_anh4,lyr_ano2,lvl_anh4, &
+ lvl_ano2, &
+ LYR_nitr_NH4,LYR_nitr_NO2,LYR_nitr_N2O_prod, &
+ LYR_nitr_NH4_OM,LYR_nitr_NO2_OM, &
+ LYR_denit_NO3,LYR_denit_NO2,LYR_denit_N2O, &
+ LYR_DNRA_NO2,LYR_anmx_N2_prod, &
+ LYR_anmx_OM_prod,LYR_phosy_NH4, &
+ LYR_phosy_NO3,LYR_remin_aerob,LYR_remin_sulf, &
+ LVL_nitr_NH4,LVL_nitr_NO2,LVL_nitr_N2O_prod, &
+ LVL_nitr_NH4_OM,LVL_nitr_NO2_OM, &
+ LVL_denit_NO3,LVL_denit_NO2,LVL_denit_N2O, &
+ LVL_DNRA_NO2,LVL_anmx_N2_prod, &
+ LVL_anmx_OM_prod,LVL_phosy_NH4, &
+ LVL_phosy_NO3,LVL_remin_aerob,LVL_remin_sulf, &
+ jnitr_NH4,jnitr_NO2,jnitr_N2O_prod, &
+ jnitr_NH4_OM,jnitr_NO2_OM,jdenit_NO3, &
+ jdenit_NO2,jdenit_N2O,jDNRA_NO2, &
+ janmx_N2_prod,janmx_OM_prod,jphosy_NH4, &
+ jphosy_NO3,jremin_aerob,jremin_sulf, &
+ jlvl_nitr_NH4,jlvl_nitr_NO2, &
+ jlvl_nitr_N2O_prod,jlvl_nitr_NH4_OM, &
+ jlvl_nitr_NO2_OM,jlvl_denit_NO3, &
+ jlvl_denit_NO2,jlvl_denit_N2O,jlvl_DNRA_NO2, &
+ jlvl_anmx_N2_prod,jlvl_anmx_OM_prod, &
+ jlvl_phosy_NH4,jlvl_phosy_NO3, &
+ jlvl_remin_aerob,jlvl_remin_sulf,jatmnh3,jatmn2o, &
+ srf_atmnh3,srf_atmn2o,flx_ndepnhx,jndepnhxfx, &
+ jpownh4,jpown2o,jpowno2,jsdm_nitr_NH4,jsdm_nitr_NO2, &
+ jsdm_nitr_N2O_prod,jsdm_nitr_NH4_OM,jsdm_nitr_NO2_OM, &
+ jsdm_denit_NO3,jsdm_denit_NO2,jsdm_denit_N2O, &
+ jsdm_DNRA_NO2,jsdm_anmx_N2_prod,jsdm_anmx_OM_prod, &
+ jsdm_remin_aerob,jsdm_remin_sulf, SDM_POWNH4,SDM_POWN2O, &
+ SDM_POWNO2,SDM_nitr_NH4,SDM_nitr_NO2,SDM_nitr_N2O_prod, &
+ SDM_nitr_NH4_OM,SDM_nitr_NO2_OM,SDM_denit_NO3, &
+ SDM_denit_NO2,SDM_denit_N2O,SDM_DNRA_NO2, &
+ SDM_anmx_N2_prod,SDM_anmx_OM_prod,SDM_remin_aerob, &
+ SDM_remin_sulf,jsediffnh4,jsediffn2o,jsediffno2, &
+ FLX_SEDIFFNH4,FLX_SEDIFFN2O,FLX_SEDIFFNO2
use mo_param_bgc, only: c14fac,param4nc,nentries,controls4nc,centries
! Arguments
@@ -258,6 +318,7 @@ subroutine ncwrt_bgc(iogrp)
call finlyr(jprefo2(iogrp),jdp(iogrp))
call finlyr(jo2sat(iogrp),jdp(iogrp))
call finlyr(jprefpo4(iogrp),jdp(iogrp))
+ call finlyr(jprefsilica(iogrp),jdp(iogrp))
call finlyr(jprefalk(iogrp),jdp(iogrp))
call finlyr(jprefdic(iogrp),jdp(iogrp))
call finlyr(jdicsat(iogrp),jdp(iogrp))
@@ -297,6 +358,40 @@ subroutine ncwrt_bgc(iogrp)
if (use_BROMO) then
call finlyr(jbromo(iogrp),jdp(iogrp))
endif
+ if (use_extNcycle) then
+ call finlyr(janh4(iogrp),jdp(iogrp))
+ call finlyr(jano2(iogrp),jdp(iogrp))
+ call finlyr(jnitr_NH4(iogrp),jdp(iogrp))
+ call finlyr(jnitr_NO2(iogrp),jdp(iogrp))
+ call finlyr(jnitr_N2O_prod(iogrp),jdp(iogrp))
+ call finlyr(jnitr_NH4_OM(iogrp),jdp(iogrp))
+ call finlyr(jnitr_NO2_OM(iogrp),jdp(iogrp))
+ call finlyr(jdenit_NO3(iogrp),jdp(iogrp))
+ call finlyr(jdenit_NO2(iogrp),jdp(iogrp))
+ call finlyr(jdenit_N2O(iogrp),jdp(iogrp))
+ call finlyr(jDNRA_NO2(iogrp),jdp(iogrp))
+ call finlyr(janmx_N2_prod(iogrp),jdp(iogrp))
+ call finlyr(janmx_OM_prod(iogrp),jdp(iogrp))
+ call finlyr(jphosy_NH4(iogrp),jdp(iogrp))
+ call finlyr(jphosy_NO3(iogrp),jdp(iogrp))
+ call finlyr(jremin_aerob(iogrp),jdp(iogrp))
+ call finlyr(jremin_sulf(iogrp),jdp(iogrp))
+ endif
+ if (use_M4AGO) then
+ ! M4AGO
+ call finlyr(jagg_ws(iogrp),jdp(iogrp))
+ call finlyr(jdynvis(iogrp),jdp(iogrp))
+ call finlyr(jagg_stick(iogrp),jdp(iogrp))
+ call finlyr(jagg_stickf(iogrp),jdp(iogrp))
+ call finlyr(jagg_dmax(iogrp),jdp(iogrp))
+ call finlyr(jagg_avdp(iogrp),jdp(iogrp))
+ call finlyr(jagg_avrhop(iogrp),jdp(iogrp))
+ call finlyr(jagg_avdC(iogrp),jdp(iogrp))
+ call finlyr(jagg_df(iogrp),jdp(iogrp))
+ call finlyr(jagg_b(iogrp),jdp(iogrp))
+ call finlyr(jagg_Vrhof(iogrp),jdp(iogrp))
+ call finlyr(jagg_Vpor(iogrp),jdp(iogrp))
+ endif
! --- Mask sea floor in mass fluxes
call msksrf(jcarflx0100(iogrp),k0100)
@@ -338,6 +433,7 @@ subroutine ncwrt_bgc(iogrp)
call msklvl(jlvlprefo2(iogrp),depths)
call msklvl(jlvlo2sat(iogrp),depths)
call msklvl(jlvlprefpo4(iogrp),depths)
+ call msklvl(jlvlprefsilica(iogrp),depths)
call msklvl(jlvlprefalk(iogrp),depths)
call msklvl(jlvlprefdic(iogrp),depths)
call msklvl(jlvldicsat(iogrp),depths)
@@ -377,6 +473,40 @@ subroutine ncwrt_bgc(iogrp)
if (use_BROMO) then
call msklvl(jlvlbromo(iogrp),depths)
endif
+ if (use_extNcycle) then
+ call msklvl(jlvlanh4(iogrp),depths)
+ call msklvl(jlvlano2(iogrp),depths)
+ call msklvl(jlvl_nitr_NH4(iogrp),depths)
+ call msklvl(jlvl_nitr_NO2(iogrp),depths)
+ call msklvl(jlvl_nitr_N2O_prod(iogrp),depths)
+ call msklvl(jlvl_nitr_NH4_OM(iogrp),depths)
+ call msklvl(jlvl_nitr_NO2_OM(iogrp),depths)
+ call msklvl(jlvl_denit_NO3(iogrp),depths)
+ call msklvl(jlvl_denit_NO2(iogrp),depths)
+ call msklvl(jlvl_denit_N2O(iogrp),depths)
+ call msklvl(jlvl_DNRA_NO2(iogrp),depths)
+ call msklvl(jlvl_anmx_N2_prod(iogrp),depths)
+ call msklvl(jlvl_anmx_OM_prod(iogrp),depths)
+ call msklvl(jlvl_phosy_NH4(iogrp),depths)
+ call msklvl(jlvl_phosy_NO3(iogrp),depths)
+ call msklvl(jlvl_remin_aerob(iogrp),depths)
+ call msklvl(jlvl_remin_sulf(iogrp),depths)
+ endif
+ if (use_M4AGO) then
+ ! M4AGO
+ call msklvl(jlvl_agg_ws(iogrp),depths)
+ call msklvl(jlvl_dynvis(iogrp),depths)
+ call msklvl(jlvl_agg_stick(iogrp),depths)
+ call msklvl(jlvl_agg_stickf(iogrp),depths)
+ call msklvl(jlvl_agg_dmax(iogrp),depths)
+ call msklvl(jlvl_agg_avdp(iogrp),depths)
+ call msklvl(jlvl_agg_avrhop(iogrp),depths)
+ call msklvl(jlvl_agg_avdC(iogrp),depths)
+ call msklvl(jlvl_agg_df(iogrp),depths)
+ call msklvl(jlvl_agg_b(iogrp),depths)
+ call msklvl(jlvl_agg_Vrhof(iogrp),depths)
+ call msklvl(jlvl_agg_Vpor(iogrp),depths)
+ endif
! --- Compute log10 of pH
if (SRF_PH(iogrp).ne.0) call logsrf(jsrfph(iogrp),rnacc,0.)
@@ -401,6 +531,7 @@ subroutine ncwrt_bgc(iogrp)
call wrtsrf(joxflux(iogrp), SRF_OXFLUX(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'fgo2')
call wrtsrf(jniflux(iogrp), SRF_NIFLUX(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'fgn2')
call wrtsrf(jn2ofx(iogrp), SRF_N2OFX(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'n2oflux')
+ call wrtsrf(jsrfpn2om(iogrp), SRF_PN2OM(iogrp), rnacc, 0.,cmpflg,'pn2om')
call wrtsrf(jdms(iogrp), SRF_DMS(iogrp), rnacc, 0.,cmpflg,'dms')
call wrtsrf(jdmsprod(iogrp), SRF_DMSPROD(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'dmsprod')
call wrtsrf(jdms_bac(iogrp), SRF_DMS_BAC(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'dms_bac')
@@ -420,7 +551,7 @@ subroutine ncwrt_bgc(iogrp)
call wrtsrf(jintphosy(iogrp), INT_PHOSY(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'ppint')
call wrtsrf(jintnfix(iogrp), INT_NFIX(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'nfixint')
call wrtsrf(jintdnit(iogrp), INT_DNIT(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'dnitint')
- call wrtsrf(jndepfx(iogrp), FLX_NDEP(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'ndep')
+ call wrtsrf(jndepnoyfx(iogrp), FLX_NDEPNOY(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'ndepnoy')
call wrtsrf(joalkfx(iogrp), FLX_OALK(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'oalkfx')
call wrtsrf(jcarflx0100(iogrp), FLX_CAR0100(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'carflx0100')
call wrtsrf(jcarflx0500(iogrp), FLX_CAR0500(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'carflx0500')
@@ -448,6 +579,15 @@ subroutine ncwrt_bgc(iogrp)
call wrtsrf(jsediffn2(iogrp), FLX_SEDIFFN2(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'sedfn2')
call wrtsrf(jsediffno3(iogrp), FLX_SEDIFFNO3(iogrp),rnacc*1e3/dtbgc,0.,cmpflg,'sedfno3')
call wrtsrf(jsediffsi(iogrp), FLX_SEDIFFSI(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'sedfsi')
+ call wrtsrf(jburflxsso12(iogrp), FLX_BURSSO12(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'burfsso12')
+ call wrtsrf(jburflxsssc12(iogrp),FLX_BURSSSC12(iogrp),rnacc*1e3/dtbgc,0.,cmpflg,'burfsssc12')
+ call wrtsrf(jburflxssssil(iogrp),FLX_BURSSSSIL(iogrp),rnacc*1e3/dtbgc,0.,cmpflg,'burfssssil')
+ call wrtsrf(jburflxssster(iogrp),FLX_BURSSSTER(iogrp),rnacc*1e3/dtbgc,0.,cmpflg,'burfssster')
+ if (use_extNcycle) then
+ call wrtsrf(jsediffnh4(iogrp), FLX_SEDIFFNH4(iogrp),rnacc*1e3/dtbgc,0.,cmpflg,'sedfnh4')
+ call wrtsrf(jsediffn2o(iogrp), FLX_SEDIFFN2O(iogrp),rnacc*1e3/dtbgc,0.,cmpflg,'sedfn2o')
+ call wrtsrf(jsediffno2(iogrp), FLX_SEDIFFNO2(iogrp),rnacc*1e3/dtbgc,0.,cmpflg,'sedfno2')
+ endif
endif
if (use_cisonew) then
call wrtsrf(jco213fxd(iogrp), SRF_CO213FXD(iogrp), rnacc*12./dtbgc,0.,cmpflg,'co213fxd')
@@ -483,6 +623,15 @@ subroutine ncwrt_bgc(iogrp)
call wrtsrf(jatmc13(iogrp), SRF_ATMC13(iogrp), rnacc, 0.,cmpflg,'atmc13')
call wrtsrf(jatmc14(iogrp), SRF_ATMC14(iogrp), rnacc, 0.,cmpflg,'atmc14')
endif
+ if (use_extNcycle) then
+ call wrtsrf(jsrfanh4(iogrp), SRF_ANH4(iogrp), rnacc*1e3, 0.,cmpflg,'srfnh4')
+ call wrtsrf(jsrfpnh3(iogrp), SRF_PNH3(iogrp), rnacc, 0.,cmpflg,'pnh3')
+ call wrtsrf(jsrfano2(iogrp), SRF_ANO2(iogrp), rnacc*1e3, 0.,cmpflg,'srfno2')
+ call wrtsrf(janh3fx(iogrp), SRF_ANH3FX(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'nh3flux')
+ call wrtsrf(jatmnh3(iogrp), SRF_ATMNH3(iogrp), rnacc, 0.,cmpflg,'atmnh3')
+ call wrtsrf(jatmn2o(iogrp), SRF_ATMN2O(iogrp), rnacc, 0.,cmpflg,'atmn2o')
+ call wrtsrf(jndepnhxfx(iogrp), FLX_NDEPNHX(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'ndepnhx')
+ endif
! --- Store 3d layer fields
call wrtlyr(jdp(iogrp), LYR_DP(iogrp), rnacc, 0.,cmpflg,'pddpo')
@@ -508,6 +657,7 @@ subroutine ncwrt_bgc(iogrp)
call wrtlyr(jprefo2(iogrp), LYR_PREFO2(iogrp), 1e3, 0.,cmpflg,'p_o2')
call wrtlyr(jo2sat(iogrp), LYR_O2SAT(iogrp), 1e3, 0.,cmpflg,'satoxy')
call wrtlyr(jprefpo4(iogrp), LYR_PREFPO4(iogrp), 1e3, 0.,cmpflg,'p_po4')
+ call wrtlyr(jprefsilica(iogrp), LYR_PREFSILICA(iogrp), 1e3, 0.,cmpflg,'p_silica')
call wrtlyr(jprefalk(iogrp), LYR_PREFALK(iogrp), 1e3, 0.,cmpflg,'p_talk')
call wrtlyr(jprefdic(iogrp), LYR_PREFDIC(iogrp), 1e3, 0.,cmpflg,'p_dic')
call wrtlyr(jdicsat(iogrp), LYR_DICSAT(iogrp), 1e3, 0.,cmpflg,'sat_dic')
@@ -547,6 +697,40 @@ subroutine ncwrt_bgc(iogrp)
if (use_BROMO) then
call wrtlyr(jbromo(iogrp), LYR_BROMO(iogrp), 1e3, 0.,cmpflg,'bromo')
endif
+ if (use_extNcycle) then
+ call wrtlyr(janh4(iogrp), LYR_ANH4(iogrp), 1e3, 0.,cmpflg,'nh4')
+ call wrtlyr(jano2(iogrp), LYR_ANO2(iogrp), 1e3, 0.,cmpflg,'no2')
+ call wrtlyr(jnitr_NH4(iogrp), LYR_nitr_NH4(iogrp), 1e3/dtbgc, 0.,cmpflg,'nh4nitr')
+ call wrtlyr(jnitr_NO2(iogrp), LYR_nitr_NO2(iogrp), 1e3/dtbgc, 0.,cmpflg,'no2nitr')
+ call wrtlyr(jnitr_N2O_prod(iogrp),LYR_nitr_N2O_prod(iogrp),1e3/dtbgc, 0.,cmpflg,'nitr_n2o')
+ call wrtlyr(jnitr_NH4_OM(iogrp), LYR_nitr_NH4_OM(iogrp),1e3/dtbgc, 0.,cmpflg,'nh4nitr_om')
+ call wrtlyr(jnitr_NO2_OM(iogrp), LYR_nitr_NO2_OM(iogrp),1e3/dtbgc, 0.,cmpflg,'no2nitr_om')
+ call wrtlyr(jdenit_NO3(iogrp), LYR_denit_NO3(iogrp),1e3/dtbgc, 0.,cmpflg,'no3denit')
+ call wrtlyr(jdenit_NO2(iogrp), LYR_denit_NO2(iogrp),1e3/dtbgc, 0.,cmpflg,'no2denit')
+ call wrtlyr(jdenit_N2O(iogrp), LYR_denit_N2O(iogrp),1e3/dtbgc, 0.,cmpflg,'n2odenit')
+ call wrtlyr(jDNRA_NO2(iogrp), LYR_DNRA_NO2(iogrp), 1e3/dtbgc, 0.,cmpflg,'no2dnra')
+ call wrtlyr(janmx_N2_prod(iogrp),LYR_anmx_N2_prod(iogrp),1e3/dtbgc, 0.,cmpflg,'anmx_n2')
+ call wrtlyr(janmx_OM_prod(iogrp),LYR_anmx_OM_prod(iogrp),1e3/dtbgc, 0.,cmpflg,'anmx_om')
+ call wrtlyr(jphosy_NH4(iogrp), LYR_phosy_NH4(iogrp),1e3/dtbgc, 0.,cmpflg,'phosy_nh4')
+ call wrtlyr(jphosy_NO3(iogrp), LYR_phosy_NO3(iogrp),1e3/dtbgc, 0.,cmpflg,'phosy_no3')
+ call wrtlyr(jremin_aerob(iogrp), LYR_remin_aerob(iogrp),1e3/dtbgc, 0.,cmpflg,'remina')
+ call wrtlyr(jremin_sulf(iogrp), LYR_remin_sulf(iogrp),1e3/dtbgc, 0.,cmpflg,'remins')
+ endif
+ if (use_M4AGO) then
+ ! M4AGO
+ call wrtlyr(jagg_ws(iogrp), LYR_agg_ws(iogrp), 1., 0.,cmpflg,'agg_ws')
+ call wrtlyr(jdynvis(iogrp), LYR_dynvis(iogrp), 1., 0.,cmpflg,'dynvis')
+ call wrtlyr(jagg_stick(iogrp), LYR_agg_stick(iogrp),1., 0.,cmpflg,'agg_stick')
+ call wrtlyr(jagg_stickf(iogrp), LYR_agg_stickf(iogrp),1., 0.,cmpflg,'agg_stickf')
+ call wrtlyr(jagg_dmax(iogrp), LYR_agg_dmax(iogrp), 1., 0.,cmpflg,'agg_dmax')
+ call wrtlyr(jagg_avdp(iogrp), LYR_agg_avdp(iogrp), 1., 0.,cmpflg,'agg_avdp')
+ call wrtlyr(jagg_avrhop(iogrp), LYR_agg_avrhop(iogrp),1., 0.,cmpflg,'agg_avrhop')
+ call wrtlyr(jagg_avdC(iogrp), LYR_agg_avdC(iogrp), 1., 0.,cmpflg,'agg_avdC')
+ call wrtlyr(jagg_df(iogrp), LYR_agg_df(iogrp), 1., 0.,cmpflg,'agg_df')
+ call wrtlyr(jagg_b(iogrp), LYR_agg_b(iogrp), 1., 0.,cmpflg,'agg_b')
+ call wrtlyr(jagg_Vrhof(iogrp), LYR_agg_Vrhof(iogrp),1., 0.,cmpflg,'agg_Vrhof')
+ call wrtlyr(jagg_Vpor(iogrp), LYR_agg_Vpor(iogrp), 1., 0.,cmpflg,'agg_Vpor')
+ endif
! --- Store 3d level fields
call wrtlvl(jlvldic(iogrp), LVL_DIC(iogrp), rnacc*1e3, 0.,cmpflg,'dissiclvl')
@@ -571,6 +755,7 @@ subroutine ncwrt_bgc(iogrp)
call wrtlvl(jlvlprefo2(iogrp), LVL_PREFO2(iogrp), rnacc*1e3, 0.,cmpflg,'p_o2lvl')
call wrtlvl(jlvlo2sat(iogrp), LVL_O2SAT(iogrp), rnacc*1e3, 0.,cmpflg,'satoxylvl')
call wrtlvl(jlvlprefpo4(iogrp), LVL_PREFPO4(iogrp), rnacc*1e3, 0.,cmpflg,'p_po4lvl')
+ call wrtlvl(jlvlprefsilica(iogrp),LVL_PREFSILICA(iogrp), rnacc*1e3, 0.,cmpflg,'p_silicalvl')
call wrtlvl(jlvlprefalk(iogrp), LVL_PREFALK(iogrp), rnacc*1e3, 0.,cmpflg,'p_talklvl')
call wrtlvl(jlvlprefdic(iogrp), LVL_PREFDIC(iogrp), rnacc*1e3, 0.,cmpflg,'p_diclvl')
call wrtlvl(jlvldicsat(iogrp), LVL_DICSAT(iogrp), rnacc*1e3, 0.,cmpflg,'sat_diclvl')
@@ -610,6 +795,40 @@ subroutine ncwrt_bgc(iogrp)
if (use_BROMO) then
call wrtlvl(jlvlbromo(iogrp), LVL_BROMO(iogrp), rnacc*1e3, 0.,cmpflg,'bromolvl')
endif
+ if (use_extNcycle) then
+ call wrtlvl(jlvlanh4(iogrp), LVL_ANH4(iogrp), rnacc*1e3, 0.,cmpflg,'nh4lvl')
+ call wrtlvl(jlvlano2(iogrp), LVL_ANO2(iogrp), rnacc*1e3, 0.,cmpflg,'no2lvl')
+ call wrtlvl(jlvl_nitr_NH4(iogrp), LVL_nitr_NH4(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'nh4nitrlvl')
+ call wrtlvl(jlvl_nitr_NO2(iogrp), LVL_nitr_NO2(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'no2nitrlvl')
+ call wrtlvl(jlvl_nitr_N2O_prod(iogrp),LVL_nitr_N2O_prod(iogrp),rnacc*1e3/dtbgc,0.,cmpflg,'nitr_n2olvl')
+ call wrtlvl(jlvl_nitr_NH4_OM(iogrp), LVL_nitr_NH4_OM(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'nh4nitr_omlvl')
+ call wrtlvl(jlvl_nitr_NO2_OM(iogrp), LVL_nitr_NO2_OM(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'no2nitr_omlvl')
+ call wrtlvl(jlvl_denit_NO3(iogrp), LVL_denit_NO3(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'no3denitlvl')
+ call wrtlvl(jlvl_denit_NO2(iogrp), LVL_denit_NO2(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'no2denitlvl')
+ call wrtlvl(jlvl_denit_N2O(iogrp), LVL_denit_N2O(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'n2odenitlvl')
+ call wrtlvl(jlvl_DNRA_NO2(iogrp), LVL_DNRA_NO2(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'no2dnralvl')
+ call wrtlvl(jlvl_anmx_N2_prod(iogrp), LVL_anmx_N2_prod(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'anmx_n2lvl')
+ call wrtlvl(jlvl_anmx_OM_prod(iogrp), LVL_anmx_OM_prod(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'anmx_omlvl')
+ call wrtlvl(jlvl_phosy_NH4(iogrp), LVL_phosy_NH4(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'phosy_nh4lvl')
+ call wrtlvl(jlvl_phosy_NO3(iogrp), LVL_phosy_NO3(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'phosy_no3lvl')
+ call wrtlvl(jlvl_remin_aerob(iogrp), LVL_remin_aerob(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'reminalvl')
+ call wrtlvl(jlvl_remin_sulf(iogrp), LVL_remin_sulf(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'reminslvl')
+ endif
+ if (use_M4AGO) then
+ ! M4AGO
+ call wrtlvl(jlvl_agg_ws(iogrp), LVL_agg_ws(iogrp), rnacc, 0.,cmpflg,'agg_wslvl')
+ call wrtlvl(jlvl_dynvis(iogrp), LVL_dynvis(iogrp), rnacc, 0.,cmpflg,'dynvislvl')
+ call wrtlvl(jlvl_agg_stick(iogrp), LVL_agg_stick(iogrp), rnacc, 0.,cmpflg,'agg_sticklvl')
+ call wrtlvl(jlvl_agg_stickf(iogrp), LVL_agg_stickf(iogrp), rnacc, 0.,cmpflg,'agg_stickflvl')
+ call wrtlvl(jlvl_agg_dmax(iogrp), LVL_agg_dmax(iogrp), rnacc, 0.,cmpflg,'agg_dmaxlvl')
+ call wrtlvl(jlvl_agg_avdp(iogrp), LVL_agg_avdp(iogrp), rnacc, 0.,cmpflg,'agg_avdplvl')
+ call wrtlvl(jlvl_agg_avrhop(iogrp), LVL_agg_avrhop(iogrp), rnacc, 0.,cmpflg,'agg_avrhoplvl')
+ call wrtlvl(jlvl_agg_avdC(iogrp), LVL_agg_avdC(iogrp), rnacc, 0.,cmpflg,'agg_avdClvl')
+ call wrtlvl(jlvl_agg_df(iogrp), LVL_agg_df(iogrp), rnacc, 0.,cmpflg,'agg_dflvl')
+ call wrtlvl(jlvl_agg_b(iogrp), LVL_agg_b(iogrp), rnacc, 0.,cmpflg,'agg_blvl')
+ call wrtlvl(jlvl_agg_Vrhof(iogrp), LVL_agg_Vrhof(iogrp), rnacc, 0.,cmpflg,'agg_Vrhoflvl')
+ call wrtlvl(jlvl_agg_Vpor(iogrp), LVL_agg_Vpor(iogrp), rnacc, 0.,cmpflg,'agg_Vporlvl')
+ endif
! --- Store sediment fields
if (.not. use_sedbypass) then
@@ -630,6 +849,24 @@ subroutine ncwrt_bgc(iogrp)
call wrtbur(jbursssc12(iogrp), BUR_SSSC12(iogrp), rnacc*1e3, 0.,cmpflg,'burc12')
call wrtbur(jburssssil(iogrp), BUR_SSSSIL(iogrp), rnacc*1e3, 0.,cmpflg,'bursil')
call wrtbur(jburssster(iogrp), BUR_SSSTER(iogrp), rnacc, 0.,cmpflg,'burter')
+ if (use_extNcycle) then
+ call wrtsdm(jpownh4(iogrp), SDM_POWNH4(iogrp), rnacc*1e3, 0.,cmpflg,'pownh4')
+ call wrtsdm(jpown2o(iogrp), SDM_POWN2O(iogrp), rnacc*1e3, 0.,cmpflg,'pown2o')
+ call wrtsdm(jpowno2(iogrp), SDM_POWNO2(iogrp), rnacc*1e3, 0.,cmpflg,'powno2')
+ call wrtsdm(jsdm_nitr_NH4(iogrp), sdm_nitr_NH4(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'nh4nitrsdm')
+ call wrtsdm(jsdm_nitr_NO2(iogrp), sdm_nitr_NO2(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'no2nitrsdm')
+ call wrtsdm(jsdm_nitr_N2O_prod(iogrp),sdm_nitr_N2O_prod(iogrp),rnacc*1e3/dtbgc,0.,cmpflg,'nitr_n2osdm')
+ call wrtsdm(jsdm_nitr_NH4_OM(iogrp), sdm_nitr_NH4_OM(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'nh4nitr_omsdm')
+ call wrtsdm(jsdm_nitr_NO2_OM(iogrp), sdm_nitr_NO2_OM(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'no2nitr_omsdm')
+ call wrtsdm(jsdm_denit_NO3(iogrp), sdm_denit_NO3(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'no3denitsdm')
+ call wrtsdm(jsdm_denit_NO2(iogrp), sdm_denit_NO2(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'no2denitsdm')
+ call wrtsdm(jsdm_denit_N2O(iogrp), sdm_denit_N2O(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'n2odenitsdm')
+ call wrtsdm(jsdm_DNRA_NO2(iogrp), sdm_DNRA_NO2(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'no2dnrasdm')
+ call wrtsdm(jsdm_anmx_N2_prod(iogrp), sdm_anmx_N2_prod(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'anmx_n2sdm')
+ call wrtsdm(jsdm_anmx_OM_prod(iogrp), sdm_anmx_OM_prod(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'anmx_omsdm')
+ call wrtsdm(jsdm_remin_aerob(iogrp), sdm_remin_aerob(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'reminasdm')
+ call wrtsdm(jsdm_remin_sulf(iogrp), sdm_remin_sulf(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'reminssdm')
+ endif
endif
! --- close netcdf file
@@ -648,6 +885,7 @@ subroutine ncwrt_bgc(iogrp)
call inisrf(joxflux(iogrp),0.)
call inisrf(jniflux(iogrp),0.)
call inisrf(jn2ofx(iogrp),0.)
+ call inisrf(jsrfpn2om(iogrp),0.)
call inisrf(jdms(iogrp),0.)
call inisrf(jdmsprod(iogrp),0.)
call inisrf(jdms_bac(iogrp),0.)
@@ -667,7 +905,7 @@ subroutine ncwrt_bgc(iogrp)
call inisrf(jintphosy(iogrp),0.)
call inisrf(jintnfix(iogrp),0.)
call inisrf(jintdnit(iogrp),0.)
- call inisrf(jndepfx(iogrp),0.)
+ call inisrf(jndepnoyfx(iogrp),0.)
call inisrf(joalkfx(iogrp),0.)
call inisrf(jcarflx0100(iogrp),0.)
call inisrf(jcarflx0500(iogrp),0.)
@@ -695,6 +933,10 @@ subroutine ncwrt_bgc(iogrp)
call inisrf(jsediffn2(iogrp),0.)
call inisrf(jsediffno3(iogrp),0.)
call inisrf(jsediffsi(iogrp),0.)
+ call inisrf(jburflxsso12(iogrp),0.)
+ call inisrf(jburflxsssc12(iogrp),0.)
+ call inisrf(jburflxssssil(iogrp),0.)
+ call inisrf(jburflxssster(iogrp),0.)
endif
if (use_cisonew) then
call inisrf(jco213fxd(iogrp),0.)
@@ -732,7 +974,20 @@ subroutine ncwrt_bgc(iogrp)
call inisrf(jatmc13(iogrp),0.)
call inisrf(jatmc14(iogrp),0.)
endif
-
+ if (use_extNcycle) then
+ call inisrf(jsrfanh4(iogrp),0.)
+ call inisrf(jsrfpnh3(iogrp),0.)
+ call inisrf(jsrfano2(iogrp),0.)
+ call inisrf(janh3fx(iogrp),0.)
+ call inisrf(jatmnh3(iogrp),0.)
+ call inisrf(jatmn2o(iogrp),0.)
+ call inisrf(jndepnhxfx(iogrp),0.)
+ if (.not. use_sedbypass) then
+ call inisrf(jsediffnh4(iogrp),0.)
+ call inisrf(jsediffn2o(iogrp),0.)
+ call inisrf(jsediffno2(iogrp),0.)
+ endif
+ endif
call inilyr(jdp(iogrp),0.)
call inilyr(jdic(iogrp),0.)
call inilyr(jalkali(iogrp),0.)
@@ -756,6 +1011,7 @@ subroutine ncwrt_bgc(iogrp)
call inilyr(jprefo2(iogrp),0.)
call inilyr(jo2sat(iogrp),0.)
call inilyr(jprefpo4(iogrp),0.)
+ call inilyr(jprefsilica(iogrp),0.)
call inilyr(jprefalk(iogrp),0.)
call inilyr(jprefdic(iogrp),0.)
call inilyr(jdicsat(iogrp),0.)
@@ -795,7 +1051,40 @@ subroutine ncwrt_bgc(iogrp)
if (use_BROMO) then
call inilyr(jbromo(iogrp),0.)
endif
-
+ if (use_extNcycle) then
+ call inilyr(janh4(iogrp),0.)
+ call inilyr(jano2(iogrp),0.)
+ call inilyr(jnitr_NH4(iogrp),0.)
+ call inilyr(jnitr_NO2(iogrp),0.)
+ call inilyr(jnitr_N2O_prod(iogrp),0.)
+ call inilyr(jnitr_NH4_OM(iogrp),0.)
+ call inilyr(jnitr_NO2_OM(iogrp),0.)
+ call inilyr(jdenit_NO3(iogrp),0.)
+ call inilyr(jdenit_NO2(iogrp),0.)
+ call inilyr(jdenit_N2O(iogrp),0.)
+ call inilyr(jDNRA_NO2(iogrp),0.)
+ call inilyr(janmx_N2_prod(iogrp),0.)
+ call inilyr(janmx_OM_prod(iogrp),0.)
+ call inilyr(jphosy_NH4(iogrp),0.)
+ call inilyr(jphosy_NO3(iogrp),0.)
+ call inilyr(jremin_aerob(iogrp),0.)
+ call inilyr(jremin_sulf(iogrp),0.)
+ endif
+ if (use_M4AGO) then
+ ! M4AGO
+ call inilyr(jagg_ws(iogrp),0.)
+ call inilyr(jdynvis(iogrp),0.)
+ call inilyr(jagg_stick(iogrp),0.)
+ call inilyr(jagg_stickf(iogrp),0.)
+ call inilyr(jagg_dmax(iogrp),0.)
+ call inilyr(jagg_avdp(iogrp),0.)
+ call inilyr(jagg_avrhop(iogrp),0.)
+ call inilyr(jagg_avdC(iogrp),0.)
+ call inilyr(jagg_df(iogrp),0.)
+ call inilyr(jagg_b(iogrp),0.)
+ call inilyr(jagg_Vrhof(iogrp),0.)
+ call inilyr(jagg_Vpor(iogrp),0.)
+ endif
call inilvl(jlvldic(iogrp),0.)
call inilvl(jlvlalkali(iogrp),0.)
call inilvl(jlvlphosy(iogrp),0.)
@@ -818,6 +1107,7 @@ subroutine ncwrt_bgc(iogrp)
call inilvl(jlvlprefo2(iogrp),0.)
call inilvl(jlvlo2sat(iogrp),0.)
call inilvl(jlvlprefpo4(iogrp),0.)
+ call inilvl(jlvlprefsilica(iogrp),0.)
call inilvl(jlvlprefalk(iogrp),0.)
call inilvl(jlvlprefdic(iogrp),0.)
call inilvl(jlvldicsat(iogrp),0.)
@@ -857,6 +1147,40 @@ subroutine ncwrt_bgc(iogrp)
if (use_BROMO) then
call inilvl(jlvlbromo(iogrp),0.)
endif
+ if (use_extNcycle) then
+ call inilvl(jlvlanh4(iogrp),0.)
+ call inilvl(jlvlano2(iogrp),0.)
+ call inilvl(jlvl_nitr_NH4(iogrp),0.)
+ call inilvl(jlvl_nitr_NO2(iogrp),0.)
+ call inilvl(jlvl_nitr_N2O_prod(iogrp),0.)
+ call inilvl(jlvl_nitr_NH4_OM(iogrp),0.)
+ call inilvl(jlvl_nitr_NO2_OM(iogrp),0.)
+ call inilvl(jlvl_denit_NO3(iogrp),0.)
+ call inilvl(jlvl_denit_NO2(iogrp),0.)
+ call inilvl(jlvl_denit_N2O(iogrp),0.)
+ call inilvl(jlvl_DNRA_NO2(iogrp),0.)
+ call inilvl(jlvl_anmx_N2_prod(iogrp),0.)
+ call inilvl(jlvl_anmx_OM_prod(iogrp),0.)
+ call inilvl(jlvl_phosy_NH4(iogrp),0.)
+ call inilvl(jlvl_phosy_NO3(iogrp),0.)
+ call inilvl(jlvl_remin_aerob(iogrp),0.)
+ call inilvl(jlvl_remin_sulf(iogrp),0.)
+ endif
+ if (use_M4AGO) then
+ ! M4AGO
+ call inilvl(jlvl_agg_ws(iogrp),0.)
+ call inilvl(jlvl_dynvis(iogrp),0.)
+ call inilvl(jlvl_agg_stick(iogrp),0.)
+ call inilvl(jlvl_agg_stickf(iogrp),0.)
+ call inilvl(jlvl_agg_dmax(iogrp),0.)
+ call inilvl(jlvl_agg_avdp(iogrp),0.)
+ call inilvl(jlvl_agg_avrhop(iogrp),0.)
+ call inilvl(jlvl_agg_avdC(iogrp),0.)
+ call inilvl(jlvl_agg_df(iogrp),0.)
+ call inilvl(jlvl_agg_b(iogrp),0.)
+ call inilvl(jlvl_agg_Vrhof(iogrp),0.)
+ call inilvl(jlvl_agg_Vpor(iogrp),0.)
+ endif
if (.not. use_sedbypass) then
call inisdm(jpowaic(iogrp),0.)
@@ -875,8 +1199,25 @@ subroutine ncwrt_bgc(iogrp)
call inibur(jbursssc12(iogrp),0.)
call inibur(jburssssil(iogrp),0.)
call inibur(jburssster(iogrp),0.)
+ if (use_extNcycle) then
+ call inisdm(jpownh4(iogrp),0.)
+ call inisdm(jpown2o(iogrp),0.)
+ call inisdm(jpowno2(iogrp),0.)
+ call inisdm(jsdm_nitr_NH4(iogrp),0.)
+ call inisdm(jsdm_nitr_NO2(iogrp),0.)
+ call inisdm(jsdm_nitr_N2O_prod(iogrp),0.)
+ call inisdm(jsdm_nitr_NH4_OM(iogrp),0.)
+ call inisdm(jsdm_nitr_NO2_OM(iogrp),0.)
+ call inisdm(jsdm_denit_NO3(iogrp),0.)
+ call inisdm(jsdm_denit_NO2(iogrp),0.)
+ call inisdm(jsdm_denit_N2O(iogrp),0.)
+ call inisdm(jsdm_DNRA_NO2(iogrp),0.)
+ call inisdm(jsdm_anmx_N2_prod(iogrp),0.)
+ call inisdm(jsdm_anmx_OM_prod(iogrp),0.)
+ call inisdm(jsdm_remin_aerob(iogrp),0.)
+ call inisdm(jsdm_remin_sulf(iogrp),0.)
+ endif
endif
-
nacc_bgc(iogrp)=0
end subroutine ncwrt_bgc
@@ -889,23 +1230,26 @@ subroutine hamoccvardef(iogrp,timeunits,calendar,cmpflg)
use mod_nctools, only: ncdefvar,ncattr,ncfopn,ncdimc,ncdims, &
nctime,ncfcls,ncedef,ncdefvar3d,ndouble
+ use mo_control_bgc, only: use_M4AGO
use mo_bgcmean, only: srf_kwco2,srf_pco2,srf_dmsflux,srf_co2fxd, &
srf_kwco2khm,srf_co2kh,srf_co2khm,srf_pco2m, &
- srf_co2fxu,srf_oxflux,srf_niflux,srf_dms,srf_dmsprod, &
+ srf_co2fxu,srf_oxflux,srf_niflux,srf_pn2om,srf_dms,srf_dmsprod, &
srf_dms_bac,srf_dms_uv,srf_export,srf_exposi,srf_expoca, &
srf_dic,srf_alkali,srf_phosph,srf_oxygen,srf_ano3,srf_silica, &
srf_iron,srf_phyto,srf_ph,int_phosy,int_nfix,int_dnit, &
- flx_ndep,flx_oalk,flx_car0100,flx_car0500, &
+ flx_ndepnoy,flx_oalk,flx_car0100,flx_car0500, &
flx_car1000,flx_car2000,flx_car4000,flx_car_bot, &
flx_bsi0100,flx_bsi0500,flx_bsi1000,flx_bsi2000,flx_bsi4000, &
flx_bsi_bot,flx_cal0100,flx_cal0500,flx_cal1000,flx_cal2000, &
flx_cal4000,flx_cal_bot,flx_sediffic,flx_sediffal, &
flx_sediffph,flx_sediffox,flx_sediffn2,flx_sediffno3, &
- flx_sediffsi,srf_n2ofx,srf_atmco2,lyr_dp,lyr_dic, &
+ flx_sediffsi,flx_bursso12,flx_bursssc12,flx_burssssil,flx_burssster, &
+ srf_n2ofx,srf_atmco2,lyr_dp,lyr_dic, &
lyr_alkali,lyr_phosph,lyr_oxygen,lyr_ano3,lyr_silica,lyr_doc, &
lyr_phyto,lyr_grazer,lyr_poc,lyr_calc,lyr_opal,lyr_iron, &
lyr_phosy,lyr_co3,lyr_ph,lyr_omegaa,lyr_omegac,lyr_n2o, &
lyr_prefo2,lyr_o2sat,lyr_prefpo4,lyr_prefalk,lyr_prefdic, &
+ lyr_prefsilica, &
lyr_dicsat,lvl_dic,lvl_alkali,lvl_phosph,lvl_oxygen,lvl_ano3, &
lvl_silica,lvl_doc,lvl_phyto,lvl_grazer,lvl_poc,lvl_calc, &
lvl_opal,lvl_iron,lvl_phosy,lvl_co3,lvl_ph,lvl_omegaa, &
@@ -930,9 +1274,58 @@ subroutine hamoccvardef(iogrp,timeunits,calendar,cmpflg)
lvl_natomegaa,lvl_natomegac,lvl_natco3, &
sdm_powaic,sdm_powaal,sdm_powaph,sdm_powaox, &
sdm_pown2,sdm_powno3,sdm_powasi,sdm_ssso12,sdm_ssssil, &
- sdm_sssc12,sdm_ssster,bur_ssso12,bur_sssc12,bur_ssssil,bur_ssster
+ sdm_sssc12,sdm_ssster,bur_ssso12,bur_sssc12,bur_ssssil,bur_ssster, &
+ lvl_prefsilica, &
+ lyr_agg_ws,lyr_dynvis,lyr_agg_stick, &
+ lyr_agg_stickf,lyr_agg_dmax,lyr_agg_avdp, &
+ lyr_agg_avrhop,lyr_agg_avdC,lyr_agg_df, &
+ lyr_agg_b,lyr_agg_Vrhof,lyr_agg_Vpor, &
+ lvl_agg_ws,lvl_dynvis,lvl_agg_stick, &
+ lvl_agg_stickf,lvl_agg_dmax,lvl_agg_avdp, &
+ lvl_agg_avrhop,lvl_agg_avdC,lvl_agg_df, &
+ lvl_agg_b,lvl_agg_Vrhof,lvl_agg_Vpor, &
+ janh4,jano2,jlvlanh4,jlvlano2,jsrfanh4, &
+ jsrfano2,janh3fx,srf_pnh3,srf_anh4,srf_ano2, &
+ srf_anh3fx,lyr_anh4,lyr_ano2,lvl_anh4, &
+ lvl_ano2, &
+ LYR_nitr_NH4,LYR_nitr_NO2,LYR_nitr_N2O_prod, &
+ LYR_nitr_NH4_OM,LYR_nitr_NO2_OM, &
+ LYR_denit_NO3,LYR_denit_NO2,LYR_denit_N2O, &
+ LYR_DNRA_NO2,LYR_anmx_N2_prod, &
+ LYR_anmx_OM_prod,LYR_phosy_NH4, &
+ LYR_phosy_NO3,LYR_remin_aerob,LYR_remin_sulf, &
+ LVL_nitr_NH4,LVL_nitr_NO2,LVL_nitr_N2O_prod, &
+ LVL_nitr_NH4_OM,LVL_nitr_NO2_OM, &
+ LVL_denit_NO3,LVL_denit_NO2,LVL_denit_N2O, &
+ LVL_DNRA_NO2,LVL_anmx_N2_prod, &
+ LVL_anmx_OM_prod,LVL_phosy_NH4, &
+ LVL_phosy_NO3,LVL_remin_aerob,LVL_remin_sulf, &
+ jnitr_NH4,jnitr_NO2,jnitr_N2O_prod, &
+ jnitr_NH4_OM,jnitr_NO2_OM,jdenit_NO3, &
+ jdenit_NO2,jdenit_N2O,jDNRA_NO2, &
+ janmx_N2_prod,janmx_OM_prod,jphosy_NH4, &
+ jphosy_NO3,jremin_aerob,jremin_sulf, &
+ jlvl_nitr_NH4,jlvl_nitr_NO2, &
+ jlvl_nitr_N2O_prod,jlvl_nitr_NH4_OM, &
+ jlvl_nitr_NO2_OM,jlvl_denit_NO3, &
+ jlvl_denit_NO2,jlvl_denit_N2O,jlvl_DNRA_NO2, &
+ jlvl_anmx_N2_prod,jlvl_anmx_OM_prod, &
+ jlvl_phosy_NH4,jlvl_phosy_NO3, &
+ jlvl_remin_aerob,jlvl_remin_sulf,srf_atmnh3, &
+ srf_atmn2o,flx_ndepnhx, &
+ jpownh4,jpown2o,jpowno2,jsdm_nitr_NH4,jsdm_nitr_NO2, &
+ jsdm_nitr_N2O_prod,jsdm_nitr_NH4_OM,jsdm_nitr_NO2_OM, &
+ jsdm_denit_NO3,jsdm_denit_NO2,jsdm_denit_N2O, &
+ jsdm_DNRA_NO2,jsdm_anmx_N2_prod,jsdm_anmx_OM_prod, &
+ jsdm_remin_aerob,jsdm_remin_sulf, SDM_POWNH4,SDM_POWN2O, &
+ SDM_POWNO2,SDM_nitr_NH4,SDM_nitr_NO2,SDM_nitr_N2O_prod, &
+ SDM_nitr_NH4_OM,SDM_nitr_NO2_OM,SDM_denit_NO3, &
+ SDM_denit_NO2,SDM_denit_N2O,SDM_DNRA_NO2, &
+ SDM_anmx_N2_prod,SDM_anmx_OM_prod,SDM_remin_aerob, &
+ SDM_remin_sulf,jsediffnh4,jsediffn2o,jsediffno2, &
+ FLX_SEDIFFNH4,FLX_SEDIFFN2O,FLX_SEDIFFNO2
use mo_control_bgc, only: use_cisonew,use_AGG,use_CFC,use_natDIC,use_BROMO, &
- use_sedbypass,use_BOXATM
+ use_sedbypass,use_BOXATM,use_extNcycle
! Arguments
integer :: iogrp,cmpflg
@@ -974,6 +1367,8 @@ subroutine hamoccvardef(iogrp,timeunits,calendar,cmpflg)
& cmpflg,'p','co2fxu','Upward CO2 flux',' ','kg C m-2 s-1',0)
call ncdefvar3d(SRF_OXFLUX(iogrp), &
& cmpflg,'p','fgo2','Oxygen flux',' ','mol O2 m-2 s-1',0)
+ call ncdefvar3d(SRF_PN2OM(iogrp),cmpflg,'p', &
+ & 'pn2om','Surface pN2O moist air',' ','natm',0)
call ncdefvar3d(SRF_NIFLUX(iogrp), &
& cmpflg,'p','fgn2','Nitrogen flux',' ','mol N2 m-2 s-1',0)
call ncdefvar3d(SRF_DMS(iogrp),cmpflg,'p', &
@@ -1015,8 +1410,8 @@ subroutine hamoccvardef(iogrp,timeunits,calendar,cmpflg)
& 'Integrated nitrogen fixation',' ','mol N m-2 s-1',0)
call ncdefvar3d(INT_DNIT(iogrp),cmpflg,'p','dnitint', &
& 'Integrated denitrification',' ','mol N m-2 s-1',0)
- call ncdefvar3d(FLX_NDEP(iogrp),cmpflg,'p','ndep', &
- & 'Nitrogen deposition flux',' ','mol N m-2 s-1',0)
+ call ncdefvar3d(FLX_NDEPNOY(iogrp),cmpflg,'p','ndepnoy', &
+ & 'Nitrogen NOy deposition flux',' ','mol N m-2 s-1',0)
call ncdefvar3d(FLX_OALK(iogrp),cmpflg,'p','oalkfx', &
& 'Alkalinity flux due to OA',' ','mol TA m-2 s-1',0)
call ncdefvar3d(FLX_CAR0100(iogrp),cmpflg,'p','carflx0100', &
@@ -1079,6 +1474,29 @@ subroutine hamoccvardef(iogrp,timeunits,calendar,cmpflg)
call ncdefvar3d(FLX_SEDIFFSI(iogrp),cmpflg,'p','sedfsi', &
& 'diffusive silica flux to sediment (positive downwards)', &
& ' ','mol Si m-2 s-1',0)
+ call ncdefvar3d(FLX_BURSSO12(iogrp),cmpflg,'p','burfsso12', &
+ & 'Organic matter burial flux to burial layer (positive downwards)',&
+ & ' ','mol P m-2 s-1',0)
+ call ncdefvar3d(FLX_BURSSSC12(iogrp),cmpflg,'p','burfsssc12', &
+ & 'CaCO3 burial flux to burial layer (positive downwards)', &
+ & ' ','mol Ca m-2 s-1',0)
+ call ncdefvar3d(FLX_BURSSSSIL(iogrp),cmpflg,'p','burfssssil', &
+ & 'Opal burial flux to burial layer (positive downwards)', &
+ & ' ','mol Si m-2 s-1',0)
+ call ncdefvar3d(FLX_BURSSSTER(iogrp),cmpflg,'p','burfssster', &
+ & 'Clay burial flux to burial layer (positive downwards)', &
+ & ' ','g m-2 s-1',0)
+ if (use_extNcycle) then
+ call ncdefvar3d(FLX_SEDIFFNH4(iogrp),cmpflg,'p','sedfnh4', &
+ & 'diffusive ammonium flux to sediment (positive downwards)', &
+ & ' ','mol NH4 m-2 s-1',0)
+ call ncdefvar3d(FLX_SEDIFFN2O(iogrp),cmpflg,'p','sedfn2o', &
+ & 'diffusive nitrous oxide flux to sediment (positive downwards)',&
+ & ' ','mol N2O m-2 s-1',0)
+ call ncdefvar3d(FLX_SEDIFFNO2(iogrp),cmpflg,'p','sedfno2', &
+ & 'diffusive nitrite flux to sediment (positive downwards)', &
+ & ' ','mol NO2 m-2 s-1',0)
+ endif
endif
if (use_cisonew) then
call ncdefvar3d(SRF_CO213FXD(iogrp),cmpflg,'p','co213fxd', &
@@ -1138,6 +1556,22 @@ subroutine hamoccvardef(iogrp,timeunits,calendar,cmpflg)
call ncdefvar3d(SRF_ATMC14(iogrp),cmpflg,'p', &
& 'atmc14','Atmospheric 14CO2',' ','ppm',0)
endif
+ if (use_extNcycle) then
+ call ncdefvar3d(SRF_PNH3(iogrp),cmpflg,'p', &
+ & 'pnh3','Surface pNH3',' ','natm',0)
+ call ncdefvar3d(SRF_ANH4(iogrp),cmpflg,'p','srfnh4', &
+ & 'Surface ammonium',' ','mol N m-3',0)
+ call ncdefvar3d(SRF_ANO2(iogrp),cmpflg,'p','srfno2', &
+ & 'Surface nitrite',' ','mol N m-3',0)
+ call ncdefvar3d(SRF_ANH3FX(iogrp),cmpflg,'p','nh3flux', &
+ & 'NH3 flux',' ','mol NH3 m-2 s-1',0)
+ call ncdefvar3d(SRF_ATMNH3(iogrp),cmpflg,'p', &
+ & 'atmnh3','Atmospheric ammonia',' ','ppt',0)
+ call ncdefvar3d(SRF_ATMN2O(iogrp),cmpflg,'p', &
+ & 'atmn2o','Atmospheric nitrous oxide',' ','ppt',0)
+ call ncdefvar3d(FLX_NDEPNHX(iogrp),cmpflg,'p','ndepnhx', &
+ & 'Nitrogen NHx deposition flux',' ','mol N m-2 s-1',0)
+ endif
! --- define 3d layer fields
call ncdefvar3d(LYR_DP(iogrp),cmpflg,'p', &
@@ -1186,6 +1620,8 @@ subroutine hamoccvardef(iogrp,timeunits,calendar,cmpflg)
& 'satoxy','Saturated oxygen',' ','mol O2 m-3',1)
call ncdefvar3d(LYR_PREFPO4(iogrp),cmpflg,'p', &
& 'p_po4','Preformed phosphorus',' ','mol P m-3',1)
+ call ncdefvar3d(LYR_PREFSILICA(iogrp),cmpflg,'p', &
+ & 'p_silica','Preformed silica',' ','mol N m-3',1)
call ncdefvar3d(LYR_PREFALK(iogrp),cmpflg,'p', &
& 'p_talk','Preformed alkalinity',' ','eq m-3',1)
call ncdefvar3d(LYR_PREFDIC(iogrp),cmpflg,'p', &
@@ -1254,7 +1690,72 @@ subroutine hamoccvardef(iogrp,timeunits,calendar,cmpflg)
call ncdefvar3d(LYR_BROMO(iogrp),cmpflg,'p', &
& 'bromo','Bromoform',' ','mol CHBr3 m-3',1)
endif
-
+ if (use_extNcycle) then
+ call ncdefvar3d(LYR_ANH4(iogrp),cmpflg,'p', &
+ & 'nh4','Ammonium',' ','mol N m-3',1)
+ call ncdefvar3d(LYR_ANO2(iogrp),cmpflg,'p', &
+ & 'no2','Nitrite',' ','mol N m-3',1)
+ call ncdefvar3d(LYR_nitr_NH4(iogrp),cmpflg,'p', &
+ & 'nh4nitr','NH4 nitrification rate',' ','mol N m-3 s-1',1)
+ call ncdefvar3d(LYR_nitr_NO2(iogrp),cmpflg,'p', &
+ & 'no2nitr','NO2 nitrification rate',' ','mol N m-3 s-1',1)
+ call ncdefvar3d(LYR_nitr_N2O_prod(iogrp),cmpflg,'p', &
+ & 'nitr_n2o','N2O prod during NH4 nitrification',' ', &
+ & 'mol N2O m-3 s-1',1)
+ call ncdefvar3d(LYR_nitr_NH4_OM(iogrp),cmpflg,'p', &
+ & 'nh4nitr_om','OM production during NH4 nitrification',' ', &
+ & 'mol P m-3 s-1',1)
+ call ncdefvar3d(LYR_nitr_NO2_OM(iogrp),cmpflg,'p', &
+ & 'no2nitr_om','OM production during NO2 nitrification',' ', &
+ & 'mol P m-3 s-1',1)
+ call ncdefvar3d(LYR_denit_NO3(iogrp),cmpflg,'p', &
+ & 'no3denit','NO3 denitrification rate',' ','mol N m-3 s-1',1)
+ call ncdefvar3d(LYR_denit_NO2(iogrp),cmpflg,'p', &
+ & 'no2denit','NO2 denitrification rate',' ','mol N m-3 s-1',1)
+ call ncdefvar3d(LYR_denit_N2O(iogrp),cmpflg,'p', &
+ & 'n2odenit','N2O denitrification rate',' ','mol N2O m-3 s-1',1)
+ call ncdefvar3d(LYR_DNRA_NO2(iogrp),cmpflg,'p', &
+ & 'no2dnra','NO2 DNRA rate',' ','mol N m-3 s-1',1)
+ call ncdefvar3d(LYR_anmx_N2_prod(iogrp),cmpflg,'p', &
+ & 'anmx_n2','Anammox N2 production rate',' ','mol N2 m-3 s-1',1)
+ call ncdefvar3d(LYR_anmx_OM_prod(iogrp),cmpflg,'p', &
+ & 'anmx_om','Anammox OM production rate',' ','mol P m-3 s-1',1)
+ call ncdefvar3d(LYR_phosy_NH4(iogrp),cmpflg,'p', &
+ & 'phosy_nh4','PP consumption rate of NH4',' ','mol N m-3 s-1',1)
+ call ncdefvar3d(LYR_phosy_NO3(iogrp),cmpflg,'p', &
+ & 'phosy_no3','PP consumption rate of NO3',' ','mol N m-3 s-1',1)
+ call ncdefvar3d(LYR_remin_aerob(iogrp),cmpflg,'p', &
+ & 'remina','Aerob remineralization rate',' ','mol N m-3 s-1',1)
+ call ncdefvar3d(LYR_remin_sulf(iogrp),cmpflg,'p', &
+ & 'remins','Sulfate remineralization rate',' ','mol P m-3 s-1',1)
+ endif
+ if (use_M4AGO) then
+ ! M4AGO
+ call ncdefvar3d(LYR_agg_ws(iogrp),cmpflg,'p', &
+ & 'agg_ws','aggregate mean settling velocity',' ','m d-1',1)
+ call ncdefvar3d(LYR_dynvis(iogrp),cmpflg,'p', &
+ & 'dynvis','dynamic viscosity of sea water',' ','kg m-1 s-1',1)
+ call ncdefvar3d(LYR_agg_stick(iogrp),cmpflg,'p', &
+ & 'agg_stick','aggregate mean stickiness',' ','-',1)
+ call ncdefvar3d(LYR_agg_stickf(iogrp),cmpflg,'p', &
+ & 'agg_stickf','opal frustule stickiness',' ','-',1)
+ call ncdefvar3d(LYR_agg_dmax(iogrp),cmpflg,'p', &
+ & 'agg_dmax','aggregate maximum diameter',' ','m',1)
+ call ncdefvar3d(LYR_agg_avdp(iogrp),cmpflg,'p', &
+ & 'agg_avdp','mean primary particle diameter',' ','m',1)
+ call ncdefvar3d(LYR_agg_avrhop(iogrp),cmpflg,'p', &
+ & 'agg_avrhop','mean primary particle density',' ','kg m-3',1)
+ call ncdefvar3d(LYR_agg_avdC(iogrp),cmpflg,'p', &
+ & 'agg_avdC','Conc.-weighted mean aggregate diameter',' ','m',1)
+ call ncdefvar3d(LYR_agg_df(iogrp),cmpflg,'p', &
+ & 'agg_df','aggregate fractal dimension',' ','-',1)
+ call ncdefvar3d(LYR_agg_b(iogrp),cmpflg,'p', &
+ & 'agg_b','aggregate number distribution slope',' ','-',1)
+ call ncdefvar3d(LYR_agg_Vrhof(iogrp),cmpflg,'p', &
+ & 'agg_Vrhof','V-weighted aggregate mean density',' ','kg m-3',1)
+ call ncdefvar3d(LYR_agg_Vpor(iogrp),cmpflg,'p', &
+ & 'agg_Vpor','V-weighted aggregate mean porosity',' ','-',1)
+ endif
! --- define 3d level fields
call ncdefvar3d(LVL_DIC(iogrp),cmpflg,'p', &
& 'dissiclvl','Dissolved inorganic carbon',' ','mol C m-3',2)
@@ -1300,6 +1801,8 @@ subroutine hamoccvardef(iogrp,timeunits,calendar,cmpflg)
& 'satoxylvl','Saturated oxygen',' ','mol O2 m-3',2)
call ncdefvar3d(LVL_PREFPO4(iogrp),cmpflg,'p', &
& 'p_po4lvl','Preformed phosphorus',' ','mol P m-3',2)
+ call ncdefvar3d(LVL_PREFSILICA(iogrp),cmpflg,'p', &
+ & 'p_silicalvl','Preformed silica',' ','mol N m-3',2)
call ncdefvar3d(LVL_PREFALK(iogrp),cmpflg,'p', &
& 'p_talklvl','Preformed alkalinity',' ','eq m-3',2)
call ncdefvar3d(LVL_PREFDIC(iogrp),cmpflg,'p', &
@@ -1368,7 +1871,78 @@ subroutine hamoccvardef(iogrp,timeunits,calendar,cmpflg)
call ncdefvar3d(LVL_BROMO(iogrp),cmpflg,'p', &
& 'bromolvl','Bromoform',' ','mol CHBr3 m-3',2)
endif
-
+ if (use_extNcycle) then
+ call ncdefvar3d(LVL_ANH4(iogrp),cmpflg,'p', &
+ & 'nh4lvl','Ammonium',' ','mol N m-3',2)
+ call ncdefvar3d(LVL_ANO2(iogrp),cmpflg,'p', &
+ & 'no2lvl','Nitrite',' ','mol N m-3',2)
+ call ncdefvar3d(LVL_nitr_NH4(iogrp),cmpflg,'p', &
+ & 'nh4nitrlvl','NH4 nitrification rate',' ','mol N m-3 s-1',2)
+ call ncdefvar3d(LVL_nitr_NO2(iogrp),cmpflg,'p', &
+ & 'no2nitrlvl','NO2 nitrification rate',' ','mol N m-3 s-1',2)
+ call ncdefvar3d(LVL_nitr_N2O_prod(iogrp),cmpflg,'p', &
+ & 'nitr_n2olvl','N2O prod during NH4 nitrification',' ', &
+ & 'mol N2O m-3 s-1',2)
+ call ncdefvar3d(LVL_nitr_NH4_OM(iogrp),cmpflg,'p', &
+ & 'nh4nitr_omlvl','OM production during NH4 nitrification',' ', &
+ & 'mol P m-3 s-1',2)
+ call ncdefvar3d(LVL_nitr_NO2_OM(iogrp),cmpflg,'p', &
+ & 'no2nitr_omlvl','OM production during NO2 nitrification',' ', &
+ & 'mol P m-3 s-1',2)
+ call ncdefvar3d(LVL_denit_NO3(iogrp),cmpflg,'p', &
+ & 'no3denitlvl','NO3 denitrification rate',' ','mol N m-3 s-1',2)
+ call ncdefvar3d(LVL_denit_NO2(iogrp),cmpflg,'p', &
+ & 'no2denitlvl','NO2 denitrification rate',' ','mol N m-3 s-1',2)
+ call ncdefvar3d(LVL_denit_N2O(iogrp),cmpflg,'p', &
+ & 'n2odenitlvl','N2O denitrification rate',' ', &
+ & 'mol N2O m-3 s-1',2)
+ call ncdefvar3d(LVL_DNRA_NO2(iogrp),cmpflg,'p', &
+ & 'no2dnralvl','NO2 DNRA rate',' ','mol N m-3 s-1',2)
+ call ncdefvar3d(LVL_anmx_N2_prod(iogrp),cmpflg,'p', &
+ & 'anmx_n2lvl','Anammox N2 production rate',' ', &
+ & 'mol N2 m-3 s-1',2)
+ call ncdefvar3d(LVL_anmx_OM_prod(iogrp),cmpflg,'p', &
+ & 'anmx_omlvl','Anammox OM production rate',' ','mol P m-3 s-1',2)
+ call ncdefvar3d(LVL_phosy_NH4(iogrp),cmpflg,'p', &
+ & 'phosy_nh4lvl','PP consumption rate of NH4',' ', &
+ & 'mol N m-3 s-1',2)
+ call ncdefvar3d(LVL_phosy_NO3(iogrp),cmpflg,'p', &
+ & 'phosy_no3lvl','PP consumption rate of NO3',' ', &
+ & 'mol N m-3 s-1',2)
+ call ncdefvar3d(LVL_remin_aerob(iogrp),cmpflg,'p', &
+ & 'reminalvl','Aerob remineralization rate',' ', &
+ & 'mol N m-3 s-1',2)
+ call ncdefvar3d(LVL_remin_sulf(iogrp),cmpflg,'p', &
+ & 'reminslvl','Sulfate remineralization rate',' ', &
+ & 'mol P m-3 s-1',2)
+ endif
+ if (use_M4AGO) then
+ ! M4AGO
+ call ncdefvar3d(LVL_agg_ws(iogrp),cmpflg,'p', &
+ & 'agg_wslvl','aggregate mean settling velocity',' ','m d-1',2)
+ call ncdefvar3d(LVL_dynvis(iogrp),cmpflg,'p', &
+ & 'dynvislvl','dynamic viscosity of sea water',' ','kg m-1 s-1',2)
+ call ncdefvar3d(LVL_agg_stick(iogrp),cmpflg,'p', &
+ & 'agg_sticklvl','aggregate mean stickiness',' ','-',2)
+ call ncdefvar3d(LVL_agg_stickf(iogrp),cmpflg,'p', &
+ & 'agg_stickflvl','opal frustule stickiness',' ','-',2)
+ call ncdefvar3d(LVL_agg_dmax(iogrp),cmpflg,'p', &
+ & 'agg_dmaxlvl','aggregate maximum diameter',' ','m',2)
+ call ncdefvar3d(LVL_agg_avdp(iogrp),cmpflg,'p', &
+ & 'agg_avdplvl','mean primary particle diameter',' ','m',2)
+ call ncdefvar3d(LVL_agg_avrhop(iogrp),cmpflg,'p', &
+ & 'agg_avrhoplvl','mean primary particle density',' ','kg m-3',2)
+ call ncdefvar3d(LVL_agg_avdC(iogrp),cmpflg,'p', &
+ & 'agg_avdClvl','Conc.-weighted mean aggregate diameter',' ','m',2)
+ call ncdefvar3d(LVL_agg_df(iogrp),cmpflg,'p', &
+ & 'agg_dflvl','aggregate fractal dimension',' ','-',2)
+ call ncdefvar3d(LVL_agg_b(iogrp),cmpflg,'p', &
+ & 'agg_blvl','aggregate number distribution slope',' ','-',2)
+ call ncdefvar3d(LVL_agg_Vrhof(iogrp),cmpflg,'p', &
+ & 'agg_Vrhoflvl','V-weighted aggregate mean density',' ','kg m-3',2)
+ call ncdefvar3d(LVL_agg_Vpor(iogrp),cmpflg,'p', &
+ & 'agg_Vporlvl','V-weighted aggregate mean porosity',' ','-',2)
+ endif
! --- define sediment fields
if (.not. use_sedbypass) then
call ncdefvar3d(SDM_POWAIC(iogrp),cmpflg,'p', &
@@ -1403,6 +1977,52 @@ subroutine hamoccvardef(iogrp,timeunits,calendar,cmpflg)
& cmpflg,'p','bursil','Burial silicate',' ','mol Si m-2',4)
call ncdefvar3d(BUR_SSSTER(iogrp), &
& cmpflg,'p','burter','Burial clay',' ','kg m-2',4)
+ if (use_extNcycle) then
+ call ncdefvar3d(SDM_POWNH4(iogrp),cmpflg,'p', &
+ & 'pownh4','PoWa ammonium',' ','mol N m-3',3)
+ call ncdefvar3d(SDM_POWN2O(iogrp),cmpflg,'p', &
+ & 'pown2o','PoWa nitrous oxide',' ','mol N m-3',3)
+ call ncdefvar3d(SDM_POWNO2(iogrp),cmpflg,'p', &
+ & 'powno2','PoWa nitrite',' ','mol N m-3',3)
+ call ncdefvar3d(sdm_nitr_NH4(iogrp),cmpflg,'p', &
+ & 'nh4nitrsdm','NH4 nitrification rate sediment',' ', &
+ & 'mol N m-3 s-1',3)
+ call ncdefvar3d(sdm_nitr_NO2(iogrp),cmpflg,'p', &
+ & 'no2nitrsdm','NO2 nitrification rate sediment',' ', &
+ & 'mol N m-3 s-1',3)
+ call ncdefvar3d(sdm_nitr_N2O_prod(iogrp),cmpflg,'p', &
+ & 'nitr_n2osdm','N2O prod during NH4 nitrification sediment',' ', &
+ & 'mol N2O m-3 s-1',3)
+ call ncdefvar3d(sdm_nitr_NH4_OM(iogrp),cmpflg,'p', &
+ & 'nh4nitr_omsdm','OM production during NH4 nitrification sediment',&
+ & ' ','mol P m-3 s-1',3)
+ call ncdefvar3d(sdm_nitr_NO2_OM(iogrp),cmpflg,'p', &
+ & 'no2nitr_omsdm','OM production during NO2 nitrification sediment',&
+ & ' ','mol P m-3 s-1',3)
+ call ncdefvar3d(sdm_denit_NO3(iogrp),cmpflg,'p', &
+ & 'no3denitsdm','NO3 denitrification rate sediment',' ', &
+ & 'mol N m-3 s-1',3)
+ call ncdefvar3d(sdm_denit_NO2(iogrp),cmpflg,'p', &
+ & 'no2denitsdm','NO2 denitrification rate sediment',' ', &
+ & 'mol N m-3 s-1',3)
+ call ncdefvar3d(sdm_denit_N2O(iogrp),cmpflg,'p', &
+ & 'n2odenitsdm','N2O denitrification rate sediment',' ', &
+ & 'mol N2O m-3 s-1',3)
+ call ncdefvar3d(sdm_DNRA_NO2(iogrp),cmpflg,'p', &
+ & 'no2dnrasdm','NO2 DNRA rate sediment',' ','mol N m-3 s-1',3)
+ call ncdefvar3d(sdm_anmx_N2_prod(iogrp),cmpflg,'p', &
+ & 'anmx_n2sdm','Anammox N2 production rate sediment',' ', &
+ & 'mol N2 m-3 s-1',3)
+ call ncdefvar3d(sdm_anmx_OM_prod(iogrp),cmpflg,'p', &
+ & 'anmx_omsdm','Anammox OM production rate sediment',' ', &
+ & 'mol P m-3 s-1',3)
+ call ncdefvar3d(sdm_remin_aerob(iogrp),cmpflg,'p', &
+ & 'reminasdm','Aerob remineralization rate sediment',' ', &
+ & 'mol N m-3 s-1',3)
+ call ncdefvar3d(sdm_remin_sulf(iogrp),cmpflg,'p', &
+ & 'reminssdm','Sulfate remineralization rate sediment',' ', &
+ & 'mol P m-3 s-1',3)
+ endif
endif
! --- enddef netcdf file
diff --git a/hamocc/mo_ocprod.F90 b/hamocc/mo_ocprod.F90
index c3fcd2aa..657f75a4 100644
--- a/hamocc/mo_ocprod.F90
+++ b/hamocc/mo_ocprod.F90
@@ -26,7 +26,7 @@ module mo_ocprod
contains
- subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
+ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph,psao,ppao,prho)
!***********************************************************************************************
! Biological production, remineralization and particle sinking.
@@ -63,7 +63,8 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
use mod_xc, only: mnproc
use mo_carbch, only: ocetra,satoxy,hi,co2star
use mo_sedmnt, only: prcaca,produs,prorca,silpro,pror13,pror14,prca13,prca14
- use mo_param_bgc, only: drempoc,dremn2o,dremopal,dremsul,dyphy,ecan,epsher,fesoly, &
+ use mo_param_bgc, only: drempoc,drempoc_anaerob,bkox_drempoc,dremn2o,dremopal,dremsul, &
+ dyphy,ecan,epsher,fesoly, &
gammap,gammaz,grami,grazra,pi_alpha,phytomi, &
rcalc,rcar,rdn2o1,rdn2o2,rdnit0,rdnit1,rdnit2, &
relaxfe,remido,riron,rnit,rnoi,ro2ut,ropal, &
@@ -74,26 +75,33 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
fse,fsh,nmldmin,plower,pupper,sinkexp,stick,tmfac, &
tsfac,vsmall,zdis,wmin,wmax,wlin,rbro, &
dmsp1,dmsp2,dmsp3,dmsp4,dmsp5,dmsp6,dms_gamma, &
- fbro1,fbro2,atten_f,atten_c,atten_uv,atten_w,bkopal,bkphy,bkzoo
+ fbro1,fbro2,atten_f,atten_c,atten_uv,atten_w,bkopal,bkphy,bkzoo, &
+ POM_remin_q10,POM_remin_Tref,opal_remin_q10,opal_remin_Tref, &
+ bkphyanh4,bkphyano3,bkphosph,bkiron,ro2utammo
use mo_biomod, only: bsiflx0100,bsiflx0500,bsiflx1000,bsiflx2000,bsiflx4000,bsiflx_bot, &
calflx0100,calflx0500,calflx1000,calflx2000,calflx4000,calflx_bot, &
carflx0100,carflx0500,carflx1000,carflx2000,carflx4000,carflx_bot, &
expoor,exposi,expoca,intdnit,intdms_bac,intdmsprod,intdms_uv, &
intphosy,int_chbr3_prod,int_chbr3_uv, &
- phosy3d,abs_oce,strahl,asize3d,wmass,wnumb,eps3d
+ phosy3d,abs_oce,strahl,asize3d,wmass,wnumb,eps3d,phosy_NH4, &
+ phosy_NO3, remin_aerob,remin_sulf
use mo_param1_bgc, only: ialkali,ian2o,iano3,icalc,idet,idms,idoc,ifdust, &
igasnit,iiron,iopal,ioxygen,iphosph,iphy,isco212, &
isilica,izoo,iadust,inos,ibromo, &
icalc13,icalc14,idet13,idet14,idoc13,idoc14, &
iphy13,iphy14,isco213,isco214,izoo13,izoo14,safediv, &
- inatalkali,inatcalc,inatsco212
+ inatalkali,inatcalc,inatsco212,ianh4
use mo_control_bgc, only: dtb,io_stdo_bgc,with_dmsph, &
use_BROMO,use_AGG,use_PBGC_OCNP_TIMESTEP,use_FB_BGC_OCE, &
- use_AGG,use_cisonew,use_natDIC, use_WLIN,use_sedbypass
+ use_AGG,use_cisonew,use_natDIC, use_WLIN,use_sedbypass,use_M4AGO, &
+ use_extNcycle
use mo_vgrid, only: dp_min,dp_min_sink,k0100,k0500,k1000,k2000,k4000,kwrbioz,ptiestu
use mo_vgrid, only: kmle
use mo_clim_swa, only: swa_clim
use mo_inventory_bgc, only: inventory_bgc
+ use mo_ihamocc4m4ago, only: ihamocc_mean_aggregate_sinking_speed,ws_agg
+ use mo_extNwatercol, only: nitrification,denit_NO3_to_NO2,anammox,denit_dnra,extN_inv_check
+
! Arguments
integer, intent(in) :: kpie ! 1st dimension of model grid.
@@ -106,6 +114,9 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
real, intent(in) :: omask(kpie,kpje) ! land/ocean mask (1=ocean)
real, intent(in) :: ptho(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd,kpke) ! potential temperature [deg C].
real, intent(in) :: pi_ph(kpie,kpje)
+ real, intent(in) :: psao(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd,kpke) ! salinity [psu].
+ real, intent(in) :: ppao(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd) ! sea level pressure [Pascal].
+ real, intent(in) :: prho(kpie,kpje,kpke) ! density [g/cm^3].
! Local variables
integer, parameter :: nsinkmax = 12
@@ -125,6 +136,7 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
real :: dtr,dz
real :: wpocd,wcald,wopald,wdustd,dagg
real :: wcal,wdust,wopal,wpoc
+ real :: o2lim ! O2 limitation of ammonification (POC remin)
! sedbypass
real :: florca,flcaca,flsil
! cisonew
@@ -165,6 +177,9 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
! BROMO
real :: bro_beta,bro_uv
real :: abs_uv(kpie,kpje,kpke)
+ ! extNcycle
+ character(len=:), allocatable :: inv_message
+ real :: ano3up_inh,nutlim,anh4lim,nlim,grlim,nh4uptfrac
! set variables for diagnostic output to zero
expoor (:,:) = 0.
@@ -200,7 +215,12 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
eps3d(:,:,:) = 0.
asize3d(:,:,:) = 0.
endif
-
+ if (use_extNcycle) then
+ phosy_NH4(:,:,:) = 0.
+ phosy_NO3(:,:,:) = 0.
+ remin_aerob(:,:,:) = 0.
+ remin_sulf(:,:,:) = 0.
+ endif
if (use_PBGC_OCNP_TIMESTEP) then
if (mnproc == 1) then
@@ -262,11 +282,16 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
enddo
!$OMP END PARALLEL DO
+ if (use_M4AGO) then
+ ! even though we loose detritus, etc. we call the calculation for settling velocity by M4AGO here
+ ! to enable further future development... - assuming that the operator splitting decently functions
+ call ihamocc_mean_aggregate_sinking_speed(kpie, kpje, kpke, kbnd, pddpo, omask, ptho, psao, ppao, prho)
+ endif
!$OMP PARALLEL DO PRIVATE(avphy,avgra,avsil,avanut,avanfe,pho,xa,xn &
!$OMP ,phosy,ya,yn,grazing,graton,gratpoc,grawa,bacfra,phymor &
!$OMP ,zoomor,excdoc,exud,export,delsil,delcar,dmsprod &
- !$OMP ,dms_bac,dms_uv,dtr,phofa,temfa,zoothresh,dms_ph,dz &
+ !$OMP ,dms_bac,dms_uv,dtr,phofa,temfa,zoothresh,dms_ph,dz,opalrem &
!$OMP ,avmass,avnos,zmornos &
!$OMP ,rco213,rco214,rphy13,rphy14,rzoo13,rzoo14,grazing13,grazing14 &
!$OMP ,graton13,graton14,gratpoc13,gratpoc14,grawa13,grawa14 &
@@ -275,6 +300,7 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
!$OMP ,delcar13,delcar14,dtr13,dtr14,bifr13,bifr14,bifr13_perm &
!$OMP ,growth_co2,phygrowth &
!$OMP ,bro_beta,bro_uv &
+ !$OMP ,ano3up_inh,nutlim,anh4lim,nlim,grlim,nh4uptfrac &
!$OMP ,i,k)
loop1: do j = 1,kpje
@@ -299,11 +325,29 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
avgra = max(grami,ocetra(i,j,k,izoo)) ! 'available' zooplankton
avsil = max(0.,ocetra(i,j,k,isilica))
avdic = max(0.,ocetra(i,j,k,isco212))
- avanut = max(0.,min(ocetra(i,j,k,iphosph),rnoi*ocetra(i,j,k,iano3)))
- avanfe = max(0.,min(avanut,ocetra(i,j,k,iiron)/riron))
- xa = avanfe
- xn = xa/(1.+pho*avphy/(xa+bkphy))
- phosy = max(0.,xa-xn)
+ if (use_extNcycle)then
+ ano3up_inh = bkphyanh4/(bkphyanh4 + ocetra(i,j,k,ianh4)) ! inhibition of NO3 uptake
+ nutlim = min(ocetra(i,j,k,iphosph)/(ocetra(i,j,k,iphosph)+bkphosph), &
+ ocetra(i,j,k,iiron)/(ocetra(i,j,k,iiron)+bkiron))
+ anh4lim = ocetra(i,j,k,ianh4)/(ocetra(i,j,k,ianh4) + bkphyanh4)
+ nlim = ano3up_inh*ocetra(i,j,k,iano3)/(ocetra(i,j,k,iano3) + bkphyano3) + anh4lim
+ grlim = min(nutlim,nlim) ! growth limitation
+
+ nh4uptfrac = 1.
+ if(nlim .gt. 1.e-18) nh4uptfrac = anh4lim/nlim
+ ! re-check avnut - can sum N avail exceed indiv. contrib?
+ avanut = max(0.,min(ocetra(i,j,k,iphosph), ocetra(i,j,k,iiron)/riron, &
+ & rnoi*((1.-nh4uptfrac)*ocetra(i,j,k,iano3) + nh4uptfrac*ocetra(i,j,k,ianh4))))
+
+ xn = avphy/(1. - pho*grlim) ! phytoplankton growth
+ phosy = max(0.,min(xn-avphy,avanut)) ! limit PP growth to available nutr.
+ else
+ avanut = max(0.,min(ocetra(i,j,k,iphosph),rnoi*ocetra(i,j,k,iano3)))
+ avanfe = max(0.,min(avanut,ocetra(i,j,k,iiron)/riron))
+ xa = avanfe
+ xn = xa/(1.+pho*avphy/(xa+bkphy))
+ phosy = max(0.,xa-xn)
+ endif
phosy = MERGE(avdic/rcar, phosy, avdic <= rcar*phosy) ! limit phosy by available DIC
ya = avphy+phosy
yn = (ya+grazra*avgra*phytomi/(avphy+bkzoo))/(1.+grazra*avgra/(avphy+bkzoo))
@@ -403,12 +447,27 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
dtr = bacfra-phosy+graton+ecan*zoomor
ocetra(i,j,k,iphosph) = ocetra(i,j,k,iphosph)+dtr
- ocetra(i,j,k,iano3) = ocetra(i,j,k,iano3)+dtr*rnit
+ if (.not. use_extNcycle) then
+ ocetra(i,j,k,iano3) = ocetra(i,j,k,iano3)+dtr*rnit
+ ocetra(i,j,k,ialkali) = ocetra(i,j,k,ialkali)-2.*delcar-(rnit+1)*dtr
+ ocetra(i,j,k,ioxygen) = ocetra(i,j,k,ioxygen)-dtr*ro2ut
+ else
+ ocetra(i,j,k,iano3) = ocetra(i,j,k,iano3) - (1.-nh4uptfrac)*phosy*rnit
+ ocetra(i,j,k,ianh4) = ocetra(i,j,k,ianh4) - nh4uptfrac*phosy*rnit + (dtr+phosy)*rnit
+ ocetra(i,j,k,ialkali) = ocetra(i,j,k,ialkali) - nh4uptfrac*phosy*(rnit-1.) & ! NH4 + PO4 Uptake
+ & + (1.-nh4uptfrac)*phosy*(rnit+1.) & ! NO3 + PO4 Uptake
+ & + (dtr+phosy)*(rnit-1.) - 2.*delcar ! Remin to (NH4 + PO4) and CaCO3 formation
+ ocetra(i,j,k,ioxygen) = ocetra(i,j,k,ioxygen) + nh4uptfrac*phosy*ro2utammo & ! NH4 uptake
+ & + (1.-nh4uptfrac)*phosy*ro2ut & ! NO3 uptake
+ & - (dtr+phosy)*ro2utammo ! Remin to NH4
+ ! Output
+ phosy_NH4(i,j,k) = nh4uptfrac*phosy*rnit ! kmol N/m3/dtb - NH4 uptake during PP growth
+ phosy_NO3(i,j,k) = (1.-nh4uptfrac)*phosy*rnit ! kmol N/m3/dtb - NO3 uptake during PP growth
+ remin_aerob(i,j,k) = (dtr+phosy)*rnit ! kmol N/m3/dtb - Aerob remin to ammonium (var. sources)
+ endif
ocetra(i,j,k,idet) = ocetra(i,j,k,idet)+export
ocetra(i,j,k,idms) = ocetra(i,j,k,idms)+dmsprod-dms_bac-dms_uv
ocetra(i,j,k,isco212) = ocetra(i,j,k,isco212)-delcar+rcar*dtr
- ocetra(i,j,k,ialkali) = ocetra(i,j,k,ialkali)-2.*delcar-(rnit+1)*dtr
- ocetra(i,j,k,ioxygen) = ocetra(i,j,k,ioxygen)-dtr*ro2ut
ocetra(i,j,k,iphy) = ocetra(i,j,k,iphy)+phosy-grazing-phymor-exud
ocetra(i,j,k,izoo) = ocetra(i,j,k,izoo)+grawa-excdoc-zoomor
ocetra(i,j,k,idoc) = ocetra(i,j,k,idoc)-bacfra+excdoc+exud
@@ -435,8 +494,13 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
ocetra(i,j,k,inatalkali) = ocetra(i,j,k,inatalkali)-2.*delcar-(rnit+1)*dtr
ocetra(i,j,k,inatcalc) = ocetra(i,j,k,inatcalc)+delcar
endif
- ocetra(i,j,k,isilica) = ocetra(i,j,k,isilica)-delsil+dremopal*ocetra(i,j,k,iopal)
- ocetra(i,j,k,iopal) = ocetra(i,j,k,iopal)+delsil-dremopal*ocetra(i,j,k,iopal)
+ if (use_M4AGO) then
+ opalrem = dremopal*opal_remin_q10**((ptho(i,j,k)-opal_remin_Tref)/10.)*ocetra(i,j,k,iopal)
+ else
+ opalrem = dremopal*ocetra(i,j,k,iopal)
+ endif
+ ocetra(i,j,k,isilica) = ocetra(i,j,k,isilica)-delsil+opalrem
+ ocetra(i,j,k,iopal) = ocetra(i,j,k,iopal)+delsil-opalrem
ocetra(i,j,k,iiron) = ocetra(i,j,k,iiron)+dtr*riron &
& - relaxfe*max(ocetra(i,j,k,iiron)-fesoly,0.)
@@ -522,7 +586,7 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
endif
!$OMP PARALLEL DO PRIVATE(phythresh,zoothresh,sterph,sterzo,remin &
- !$OMP ,opalrem,aou,refra,dms_bac,pocrem,docrem,phyrem,dz &
+ !$OMP ,opalrem,aou,refra,dms_bac,pocrem,docrem,phyrem,dz,o2lim &
!$OMP ,avmass,avnos,zmornos &
!$OMP ,rphy13,rphy14,rzoo13,rzoo14,rdet13,rdet14,rdoc13,rdoc14 &
!$OMP ,sterph13,sterph14,sterzo13,sterzo14,pocrem13,pocrem14 &
@@ -567,9 +631,29 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
endif
if(ocetra(i,j,k,ioxygen) > 5.e-8) then
- pocrem = min(drempoc*ocetra(i,j,k,idet),0.33*ocetra(i,j,k,ioxygen)/ro2ut)
- docrem = min( remido*ocetra(i,j,k,idoc),0.33*ocetra(i,j,k,ioxygen)/ro2ut)
- phyrem = min(0.5*dyphy*phythresh, 0.33*ocetra(i,j,k,ioxygen)/ro2ut)
+ if (use_M4AGO) then
+ if (.not. use_extNcycle) then
+ ! M4AGO comes with O2-lim
+ o2lim = ocetra(i,j,k,ioxygen)/(ocetra(i,j,k,ioxygen) + bkox_drempoc)
+ pocrem = o2lim*drempoc*POM_remin_q10**((ptho(i,j,k)-POM_remin_Tref)/10.)*ocetra(i,j,k,idet)
+ else
+ ! nitrogen always accounts for O2-lim - see below
+ pocrem = drempoc*POM_remin_q10**((ptho(i,j,k)-POM_remin_Tref)/10.)*ocetra(i,j,k,idet)
+ endif
+ else
+ pocrem = drempoc*ocetra(i,j,k,idet)
+ endif
+ if (.not. use_extNcycle) then
+ pocrem = min(pocrem,0.33*ocetra(i,j,k,ioxygen)/ro2ut)
+ docrem = min( remido*ocetra(i,j,k,idoc),0.33*ocetra(i,j,k,ioxygen)/ro2ut)
+ phyrem = min(0.5*dyphy*phythresh, 0.33*ocetra(i,j,k,ioxygen)/ro2ut)
+ else
+ o2lim = ocetra(i,j,k,ioxygen)/(ocetra(i,j,k,ioxygen) + bkox_drempoc)
+ pocrem = min(o2lim*pocrem, 0.33*ocetra(i,j,k,ioxygen)/ro2utammo)
+ docrem = min(remido*ocetra(i,j,k,idoc), 0.33*ocetra(i,j,k,ioxygen)/ro2utammo)
+ phyrem = min(0.5*dyphy*phythresh, 0.33*ocetra(i,j,k,ioxygen)/ro2utammo)
+ endif
+
if (use_cisonew) then
pocrem13 = pocrem*rdet13
pocrem14 = pocrem*rdet14
@@ -599,10 +683,17 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
remin = pocrem + docrem + phyrem
ocetra(i,j,k,iphosph) = ocetra(i,j,k,iphosph)+remin
- ocetra(i,j,k,iano3) = ocetra(i,j,k,iano3)+remin*rnit
+ if (.not. use_extNcycle) then
+ ocetra(i,j,k,iano3) = ocetra(i,j,k,iano3)+remin*rnit
+ ocetra(i,j,k,ialkali) = ocetra(i,j,k,ialkali)-(rnit+1)*remin
+ ocetra(i,j,k,ioxygen) = ocetra(i,j,k,ioxygen)-ro2ut*remin
+ else
+ ocetra(i,j,k,ianh4) = ocetra(i,j,k,ianh4) + remin*rnit
+ ocetra(i,j,k,ialkali) = ocetra(i,j,k,ialkali) + (rnit-1.)*remin
+ ocetra(i,j,k,ioxygen) = ocetra(i,j,k,ioxygen) - ro2utammo*remin
+ remin_aerob(i,j,k) = remin*rnit ! kmol/NH4/dtb - remin to NH4 from various sources
+ endif
ocetra(i,j,k,isco212) = ocetra(i,j,k,isco212)+rcar*remin
- ocetra(i,j,k,ialkali) = ocetra(i,j,k,ialkali)-(rnit+1)*remin
- ocetra(i,j,k,ioxygen) = ocetra(i,j,k,ioxygen)-ro2ut*remin
ocetra(i,j,k,iiron) = ocetra(i,j,k,iiron)+remin*riron &
& -relaxfe*max(ocetra(i,j,k,iiron)-fesoly,0.)
if (use_natDIC) then
@@ -626,21 +717,28 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
! so the expression dremopal*(Si(OH)4sat-Si(OH)4) would change the
! rate only from 0 to 100%
!***********************************************************************
- opalrem = dremopal*0.1*(temp+3.)*ocetra(i,j,k,iopal)
+ if (use_M4AGO) then
+ opalrem = dremopal*opal_remin_q10**((ptho(i,j,k)-opal_remin_Tref)/10.)*ocetra(i,j,k,iopal)
+ else
+ opalrem = dremopal*0.1*(temp+3.)*ocetra(i,j,k,iopal)
+ endif
ocetra(i,j,k,iopal) = ocetra(i,j,k,iopal)-opalrem
ocetra(i,j,k,isilica) = ocetra(i,j,k,isilica)+opalrem
- !***********************************************************************
- ! There is about 1.e4 O2 on 1 N2O molecule (Broeker&Peng)
- ! refra : Tim Rixton, private communication
- !***********************************************************************
- aou = satoxy(i,j,k)-ocetra(i,j,k,ioxygen)
- refra = 1.+3.*(0.5+sign(0.5,aou-1.97e-4))
- dms_bac = dmsp3 * abs(temp+3.) * ocetra(i,j,k,idms) &
- & * (ocetra(i,j,k,idms) / (dmsp6+ocetra(i,j,k,idms)))
- ocetra(i,j,k,ian2o) = ocetra(i,j,k,ian2o)+remin*1.e-4*ro2ut*refra
- ocetra(i,j,k,igasnit) = ocetra(i,j,k,igasnit)-remin*1.e-4*ro2ut*refra
- ocetra(i,j,k,ioxygen) = ocetra(i,j,k,ioxygen)-remin*1.e-4*ro2ut*refra*0.5
+ if (.not. use_extNcycle) then
+ !***********************************************************************
+ ! There is about 1.e4 O2 on 1 N2O molecule (Broeker&Peng)
+ ! refra : Tim Rixton, private communication
+ !***********************************************************************
+ aou = satoxy(i,j,k)-ocetra(i,j,k,ioxygen)
+ refra = 1.+3.*(0.5+sign(0.5,aou-1.97e-4))
+ ocetra(i,j,k,ian2o) = ocetra(i,j,k,ian2o)+remin*1.e-4*ro2ut*refra
+ ocetra(i,j,k,igasnit) = ocetra(i,j,k,igasnit)-remin*1.e-4*ro2ut*refra
+ ocetra(i,j,k,ioxygen) = ocetra(i,j,k,ioxygen)-remin*1.e-4*ro2ut*refra*0.5
+ endif
+
+ dms_bac = dmsp3 * abs(temp+3.) * ocetra(i,j,k,idms) &
+ & * (ocetra(i,j,k,idms) / (dmsp6+ocetra(i,j,k,idms)))
ocetra(i,j,k,idms) = ocetra(i,j,k,idms)-dms_bac
dz = pddpo(i,j,k)
@@ -679,74 +777,93 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
call inventory_bgc(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask,0)
endif
- !$OMP PARALLEL DO PRIVATE(remin,remin2o,dz,avmass,avnos,rem13,rem14,i,k)
- loop3: do j = 1,kpje
- do i = 1,kpie
- do k = kwrbioz(i,j)+1,kpke
- if(omask(i,j) > 0.5) then
- if(ocetra(i,j,k,ioxygen) < 5.e-7 .and. pddpo(i,j,k) > dp_min) then
- if (use_AGG) then
- avmass = ocetra(i,j,k,iphy) + ocetra(i,j,k,idet)
- endif
+ if (.not. use_extNcycle) then
+ ! =====>>>> Regular CMIP6 iHAMOCC version for denitrification wo extended nitrogen cycle =====>>>>
+ !$OMP PARALLEL DO PRIVATE(remin,remin2o,dz,avmass,avnos,rem13,rem14,i,k)
+ loop3: do j = 1,kpje
+ do i = 1,kpie
+ do k = kwrbioz(i,j)+1,kpke
+ if(omask(i,j) > 0.5) then
+ if(ocetra(i,j,k,ioxygen) < 5.e-7 .and. pddpo(i,j,k) > dp_min) then
+ if (use_AGG) then
+ avmass = ocetra(i,j,k,iphy) + ocetra(i,j,k,idet)
+ endif
- remin = 0.05*drempoc*min(ocetra(i,j,k,idet),0.5 *ocetra(i,j,k,iano3)/rdnit1)
- remin2o = dremn2o*min(ocetra(i,j,k,idet),0.003 *ocetra(i,j,k,ian2o)/rdn2o1)
+ remin = drempoc_anaerob*min(ocetra(i,j,k,idet),0.5 *ocetra(i,j,k,iano3)/rdnit1)
+ remin2o = dremn2o*min(ocetra(i,j,k,idet),0.003 *ocetra(i,j,k,ian2o)/rdn2o1)
- if (use_cisonew) then
- rem13 = (remin+remin2o)*ocetra(i,j,k,idet13)/(ocetra(i,j,k,idet)+safediv)
- rem14 = (remin+remin2o)*ocetra(i,j,k,idet14)/(ocetra(i,j,k,idet)+safediv)
- endif
- ocetra(i,j,k,ialkali) = ocetra(i,j,k,ialkali)+(rdnit1-1)*remin-remin2o
- ocetra(i,j,k,isco212) = ocetra(i,j,k,isco212)+rcar*(remin+remin2o)
- ocetra(i,j,k,idet) = ocetra(i,j,k,idet)-(remin+remin2o)
- ocetra(i,j,k,iphosph) = ocetra(i,j,k,iphosph)+(remin+remin2o)
- ocetra(i,j,k,iano3) = ocetra(i,j,k,iano3)-rdnit1*remin
- ocetra(i,j,k,igasnit) = ocetra(i,j,k,igasnit)+rdnit2*remin+rdn2o2*remin2o
- ocetra(i,j,k,iiron) = ocetra(i,j,k,iiron)+riron*(remin+remin2o)
- ocetra(i,j,k,ian2o) = ocetra(i,j,k,ian2o)-rdn2o1*remin2o
- if (use_natDIC) then
- ocetra(i,j,k,inatalkali) = ocetra(i,j,k,inatalkali)+(rdnit1-1)*remin-remin2o
- ocetra(i,j,k,inatsco212) = ocetra(i,j,k,inatsco212)+rcar*(remin+remin2o)
- endif
- if (use_cisonew) then
- ocetra(i,j,k,isco213) = ocetra(i,j,k,isco213)+rcar*rem13
- ocetra(i,j,k,isco214) = ocetra(i,j,k,isco214)+rcar*rem14
- ocetra(i,j,k,idet13) = ocetra(i,j,k,idet13)-rem13
- ocetra(i,j,k,idet14) = ocetra(i,j,k,idet14)-rem14
- endif
+ if (use_cisonew) then
+ rem13 = (remin+remin2o)*ocetra(i,j,k,idet13)/(ocetra(i,j,k,idet)+safediv)
+ rem14 = (remin+remin2o)*ocetra(i,j,k,idet14)/(ocetra(i,j,k,idet)+safediv)
+ endif
+ ocetra(i,j,k,ialkali) = ocetra(i,j,k,ialkali)+(rdnit1-1)*remin-remin2o
+ ocetra(i,j,k,isco212) = ocetra(i,j,k,isco212)+rcar*(remin+remin2o)
+ ocetra(i,j,k,idet) = ocetra(i,j,k,idet)-(remin+remin2o)
+ ocetra(i,j,k,iphosph) = ocetra(i,j,k,iphosph)+(remin+remin2o)
+ ocetra(i,j,k,iano3) = ocetra(i,j,k,iano3)-rdnit1*remin
+ ocetra(i,j,k,igasnit) = ocetra(i,j,k,igasnit)+rdnit2*remin+rdn2o2*remin2o
+ ocetra(i,j,k,iiron) = ocetra(i,j,k,iiron)+riron*(remin+remin2o)
+ ocetra(i,j,k,ian2o) = ocetra(i,j,k,ian2o)-rdn2o1*remin2o
+ if (use_natDIC) then
+ ocetra(i,j,k,inatalkali) = ocetra(i,j,k,inatalkali)+(rdnit1-1)*remin-remin2o
+ ocetra(i,j,k,inatsco212) = ocetra(i,j,k,inatsco212)+rcar*(remin+remin2o)
+ endif
+ if (use_cisonew) then
+ ocetra(i,j,k,isco213) = ocetra(i,j,k,isco213)+rcar*rem13
+ ocetra(i,j,k,isco214) = ocetra(i,j,k,isco214)+rcar*rem14
+ ocetra(i,j,k,idet13) = ocetra(i,j,k,idet13)-rem13
+ ocetra(i,j,k,idet14) = ocetra(i,j,k,idet14)-rem14
+ endif
- ! nitrate loss through denitrification in kmol N m-2
- dz = pddpo(i,j,k)
- intdnit(i,j) = intdnit(i,j) + rdnit0*remin*dz
+ ! nitrate loss through denitrification in kmol N m-2
+ dz = pddpo(i,j,k)
+ intdnit(i,j) = intdnit(i,j) + rdnit0*remin*dz
- if (use_AGG) then
- !***********************************************************************
- ! loss of snow numbers due to remineralization of poc
- ! NOTE that remin is in kmol/m3. Thus divide by avmass (kmol/m3)
- !***********************************************************************
- if(avmass > 0.) then
- avnos = ocetra(i,j,k,inos)
- ocetra(i,j,k,inos) = ocetra(i,j,k,inos)-(remin+remin2o)*avnos/avmass
- endif
- endif/*AGG*/
+ if (use_AGG) then
+ !***********************************************************************
+ ! loss of snow numbers due to remineralization of poc
+ ! NOTE that remin is in kmol/m3. Thus divide by avmass (kmol/m3)
+ !***********************************************************************
+ if(avmass > 0.) then
+ avnos = ocetra(i,j,k,inos)
+ ocetra(i,j,k,inos) = ocetra(i,j,k,inos)-(remin+remin2o)*avnos/avmass
+ endif
+ endif/*AGG*/
+ endif
endif
- endif
+ enddo
enddo
- enddo
- enddo loop3
- !$OMP END PARALLEL DO
-
+ enddo loop3
+ !$OMP END PARALLEL DO
- if (use_PBGC_OCNP_TIMESTEP) then
- if (mnproc == 1) then
- write(io_stdo_bgc,*)' '
- write(io_stdo_bgc,*)'in OCRPOD after remin n2o'
+ if (use_PBGC_OCNP_TIMESTEP) then
+ if (mnproc == 1) then
+ write(io_stdo_bgc,*)' '
+ write(io_stdo_bgc,*)'in OCRPOD after remin n2o'
+ endif
+ call inventory_bgc(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask,0)
endif
- call inventory_bgc(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask,0)
+ ! <<<<===== end of CMIP6 version denitrification processes without extended nitrogen cycle <<<<=====
+ else
+ !======>>>> extended nitrogen cycle processes (aerobic and anaerobic) that follow ammonification
+ inv_message = 'in OCPROD after extNcycle nitrification'
+ call nitrification(kpie,kpje,kpke,kbnd,pddpo,omask,ptho)
+ call extN_inv_check(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask,inv_message)
+
+ inv_message = 'in OCPROD after extNcycle denitrification NO3 -> NO2'
+ call denit_NO3_to_NO2(kpie,kpje,kpke,kbnd,pddpo,omask,ptho)
+ call extN_inv_check(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask,inv_message)
+
+ inv_message = 'in OCPROD after extNcycle anammox'
+ call anammox(kpie,kpje,kpke,kbnd,pddpo,omask,ptho)
+ call extN_inv_check(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask,inv_message)
+
+ inv_message = 'in OCPROD after extNcycle denitrification / DNRA'
+ call denit_dnra(kpie,kpje,kpke,kbnd,pddpo,omask,ptho)
+ call extN_inv_check(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask,inv_message)
endif
-
!sulphate reduction ! introduced 11.5.2007 to improve poc-remineralisation in the
! oxygen minimum zone in the subsurface equatorial Pacific
! assumption of endless pool of SO4 (typical concentration are on the order of mmol/l)
@@ -786,7 +903,10 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
ocetra(i,j,k,isco213) = ocetra(i,j,k,isco213)+rcar*rem13
ocetra(i,j,k,isco214) = ocetra(i,j,k,isco214)+rcar*rem14
endif
-
+ if (use_extNcycle) then
+ ! Output
+ remin_sulf(i,j,k) = remin ! kmol P/m3/dtb
+ endif
if (use_AGG) then
!***********************************************************************
! loss of snow numbers due to remineralization of poc
@@ -1050,6 +1170,17 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
wdustd = wdust_const
dagg = 0.0
endif
+ if (use_M4AGO) then ! superseding every other method
+ wpoc = ws_agg(i,j,k)
+ wpocd = ws_agg(i,j,kdonor)
+ wcal = ws_agg(i,j,k)
+ wcald = ws_agg(i,j,kdonor)
+ wopal = ws_agg(i,j,k)
+ wopald = ws_agg(i,j,kdonor)
+ wdust = ws_agg(i,j,k)
+ wdustd = ws_agg(i,j,kdonor)
+ dagg = 0.0
+ endif
if( k == 1 ) then
wpocd = 0.0
@@ -1059,7 +1190,11 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
if (use_AGG) then
wnosd = 0.0
else if (use_WLIN) then
- wpoc = wmin
+ if (use_M4AGO) then
+ wpoc = ws_agg(i,j,k)
+ else
+ wpoc = wmin
+ endif
endif
endif
@@ -1249,6 +1384,11 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
else if (use_WLIN) then
wpoc = min(wmin+wlin*ptiestu(i,j,k), wmax)
endif
+ if (use_M4AGO) then
+ wpoc = ws_agg(i,j,k)
+ wcal = ws_agg(i,j,k)
+ wopal = ws_agg(i,j,k)
+ endif
if (use_AGG) then
carflx0100(i,j) = (ocetra(i,j,k,idet)+ocetra(i,j,k,iphy))*rcar*wpoc
@@ -1269,6 +1409,11 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
else if (use_WLIN) then
wpoc = min(wmin+wlin*ptiestu(i,j,k), wmax)
endif
+ if (use_M4AGO) then
+ wpoc = ws_agg(i,j,k)
+ wcal = ws_agg(i,j,k)
+ wopal = ws_agg(i,j,k)
+ endif
if (use_AGG) then
carflx0500(i,j) = (ocetra(i,j,k,idet)+ocetra(i,j,k,iphy))*rcar*wpoc
@@ -1289,6 +1434,11 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
else if (use_WLIN) then
wpoc = min(wmin+wlin*ptiestu(i,j,k), wmax)
endif
+ if (use_M4AGO) then
+ wpoc = ws_agg(i,j,k)
+ wcal = ws_agg(i,j,k)
+ wopal = ws_agg(i,j,k)
+ endif
if (use_AGG) then
carflx1000(i,j) = (ocetra(i,j,k,idet)+ocetra(i,j,k,iphy))*rcar*wpoc
@@ -1309,6 +1459,11 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
else if (use_WLIN) then
wpoc = min(wmin+wlin*ptiestu(i,j,k), wmax)
endif
+ if (use_M4AGO) then
+ wpoc = ws_agg(i,j,k)
+ wcal = ws_agg(i,j,k)
+ wopal = ws_agg(i,j,k)
+ endif
if (use_AGG) then
carflx2000(i,j) = (ocetra(i,j,k,idet)+ocetra(i,j,k,iphy))*rcar*wpoc
@@ -1329,6 +1484,11 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph)
else if (use_WLIN) then
wpoc = min(wmin+wlin*ptiestu(i,j,k), wmax)
endif
+ if (use_M4AGO) then
+ wpoc = ws_agg(i,j,k)
+ wcal = ws_agg(i,j,k)
+ wopal = ws_agg(i,j,k)
+ endif
if (use_AGG) then
carflx4000(i,j) = (ocetra(i,j,k,idet)+ocetra(i,j,k,iphy))*rcar*wpoc
diff --git a/hamocc/mo_param1_bgc.F90 b/hamocc/mo_param1_bgc.F90
index f4ddaea9..7fec00db 100644
--- a/hamocc/mo_param1_bgc.F90
+++ b/hamocc/mo_param1_bgc.F90
@@ -29,7 +29,7 @@ module mo_param1_bgc
use mo_control_bgc, only: use_BROMO, use_AGG, use_WLIN, use_natDIC, use_CFC, &
use_cisonew, use_PBGC_OCNP_TIMESTEP, use_PBGC_CK_TIMESTEP, &
- use_FB_BGC_OCE, use_BOXATM, use_sedbypass
+ use_FB_BGC_OCE, use_BOXATM, use_sedbypass, use_extNcycle
implicit none
public
@@ -63,6 +63,7 @@ module mo_param1_bgc
integer, protected :: iprefalk
integer, protected :: iprefdic
integer, protected :: idicsat
+ integer, protected :: iprefsilica
! Indices for C-isotope tracers
integer, protected :: i_iso
@@ -100,6 +101,11 @@ module mo_param1_bgc
integer, protected :: i_bromo
integer, protected :: ibromo
+ ! Indices for extended nitrogen cycle
+ integer, protected :: i_extn
+ integer, protected :: ianh4
+ integer, protected :: iano2
+
! total number of advected tracers (set by allocate_tracers in mod_tracers.F90)
integer :: nocetra
@@ -133,8 +139,19 @@ module mo_param1_bgc
integer, protected :: i_bromo_atm
integer, protected :: iatmbromo
+ ! Indices for extended nitrogen tracer in atm
+ integer, protected :: i_nh3_atm
+ integer, protected :: iatmnh3
+
integer, protected :: natm ! total number of atmosphere tracers
+ ! --------------------
+ ! Nitrogen deposition
+ ! --------------------
+ integer, protected :: nndep ! size of N-deposition input field
+ integer, protected :: idepnoy ! index for NOy deposition
+ integer, protected :: idepnhx ! index for NHx deposition
+
! ------------------
! rivers
! ------------------
@@ -182,6 +199,12 @@ module mo_param1_bgc
integer, protected :: ipowc14
integer, protected :: npowtra ! computed in init_indices
+ ! Indices for extended nitrogen cycle
+ integer, protected :: i_pow_extNcycle
+ integer, protected :: ipownh4
+ integer, protected :: ipown2o
+ integer, protected :: ipowno2
+
! Mapping between pore water and ocean tracers needed for pore
! water diffusion
integer, protected, allocatable :: map_por2octra(:)
@@ -201,6 +224,11 @@ subroutine init_por2octra_mapping()
map_por2octra(ipowc13) = isco213
map_por2octra(ipowc14) = isco214
endif
+ if (use_extNcycle) then
+ map_por2octra(ipownh4) = ianh4
+ map_por2octra(ipown2o) = ian2o
+ map_por2octra(ipowno2) = iano2
+ endif
end subroutine init_por2octra_mapping
! ===========================================================================
@@ -210,12 +238,12 @@ subroutine init_indices()
use mo_control_bgc, only: bgc_namelist,get_bgc_namelist, io_stdo_bgc
use mo_control_bgc, only: use_BROMO,use_AGG,use_WLIN,use_natDIC,use_CFC,use_cisonew, &
use_sedbypass,use_PBGC_OCNP_TIMESTEP,use_PBGC_CK_TIMESTEP, &
- use_FB_BGC_OCE, use_BOXATM
+ use_FB_BGC_OCE, use_BOXATM,use_extNcycle
integer :: iounit
namelist / config_bgc / use_BROMO,use_AGG,use_WLIN,use_natDIC,use_CFC,use_cisonew, &
use_sedbypass,use_PBGC_OCNP_TIMESTEP,use_PBGC_CK_TIMESTEP, &
- use_FB_BGC_OCE,use_BOXATM
+ use_FB_BGC_OCE,use_BOXATM,use_extNcycle
io_stdo_bgc = lp ! standard out.
@@ -231,7 +259,7 @@ subroutine init_indices()
endif
! Tracer indices
- i_base = 22
+ i_base = 23
isco212 = 1
ialkali = 2
iphosph = 3
@@ -254,6 +282,7 @@ subroutine init_indices()
iprefalk = 20
iprefdic = 21
idicsat = 22
+ iprefsilica = 23
if (use_cisonew) then
i_iso = 12
isco213 = i_base+1
@@ -321,9 +350,18 @@ subroutine init_indices()
i_bromo=0
ibromo=-1
endif
+ if (use_extNcycle) then
+ i_extn = 2
+ iano2 = i_base+i_iso+i_cfc+i_agg+i_nat_dic+i_bromo+1
+ ianh4 = i_base+i_iso+i_cfc+i_agg+i_nat_dic+i_bromo+2
+ else
+ i_extn = 0
+ iano2 = -1
+ ianh4 = -1
+ endif
! total number of advected tracers
- nocetra=i_base+i_iso+i_cfc+i_agg+i_nat_dic +i_bromo
+ nocetra=i_base+i_iso+i_cfc+i_agg+i_nat_dic +i_bromo+i_extn
! ATMOSPHERE
i_base_atm=5
@@ -366,9 +404,27 @@ subroutine init_indices()
i_bromo_atm=0
iatmbromo=-1
endif
+ if (use_extNcycle) then
+ i_nh3_atm = 1
+ iatmnh3 = i_base_atm+i_iso_atm+i_cfc_atm+ i_ndic_atm+i_bromo_atm+1
+ else
+ i_nh3_atm = 0
+ iatmnh3 = -1
+ endif
! total number of atmosphere tracers
- natm=i_base_atm+i_iso_atm+i_cfc_atm+i_ndic_atm+i_bromo_atm
+ natm=i_base_atm+i_iso_atm+i_cfc_atm+i_ndic_atm+i_bromo_atm+i_nh3_atm
+
+ ! N-deposition
+ if (use_extNcycle) then
+ nndep = 2
+ idepnoy = 1
+ idepnhx = 2
+ else
+ nndep = 1
+ idepnoy = 1
+ idepnhx = -1
+ endif
! rivers
nriv =7
@@ -420,7 +476,19 @@ subroutine init_indices()
ipowc13 = -1
ipowc14 = -1
endif
- npowtra = i_pow_base + i_pow_cisonew
+ if (use_extNcycle) then
+ i_pow_extNcycle = 3
+ ipownh4 = i_pow_base + i_pow_cisonew+1
+ ipown2o = i_pow_base + i_pow_cisonew+2
+ ipowno2 = i_pow_base + i_pow_cisonew+3
+ else
+ i_pow_extNcycle = 0
+ ipownh4 = -1
+ ipown2o = -1
+ ipowno2 = -1
+ endif
+
+ npowtra = i_pow_base + i_pow_cisonew+i_pow_extNcycle
allocate(map_por2octra(-1:npowtra))
diff --git a/hamocc/mo_param_bgc.F90 b/hamocc/mo_param_bgc.F90
index fb3c44a8..7c6b05a6 100644
--- a/hamocc/mo_param_bgc.F90
+++ b/hamocc/mo_param_bgc.F90
@@ -36,7 +36,8 @@ module mo_param_bgc
use_BROMO,use_cisonew,use_WLIN,use_FB_BGC_OCE, &
do_ndep,do_oalk,do_rivinpt,do_sedspinup,l_3Dvarsedpor, &
use_BOXATM,use_CFC,use_PBGC_CK_TIMESTEP, &
- use_sedbypass,with_dmsph,use_PBGC_OCNP_TIMESTEP,ocn_co2_type
+ use_sedbypass,with_dmsph,use_PBGC_OCNP_TIMESTEP,ocn_co2_type,use_M4AGO,&
+ leuphotic_cya,do_ndep_coupled,do_n2onh3_coupled,use_extNcycle
use mod_xc, only: mnproc
implicit none
@@ -70,6 +71,7 @@ module mo_param_bgc
public :: wpoc_const,wcal_const,wopal_const,wdust_const
public :: bkopal,bkphy,bluefix,bkzoo
public :: drempoc,dremopal,dremn2o,dremsul
+ public :: drempoc_anaerob,bkox_drempoc
public :: grazra,gammap,gammaz,spemor
public :: ecan,epsher,fetune
public :: relaxfe,rcalc,ropal
@@ -77,7 +79,7 @@ module mo_param_bgc
! Other module variables
public :: ro2ut,rcar,rnit,rnoi,riron,rdnit0,rdnit1,rdnit2,rdn2o1,rdn2o2
- public :: atm_n2,atm_o2,atm_co2_nat,atm_bromo,re1312
+ public :: atm_n2,atm_o2,atm_co2_nat,atm_bromo,re1312,atm_n2o,atm_nh3
public :: re14to,prei13,prei14,ctochl
public :: atten_w,atten_c,atten_uv,atten_f
public :: perc_diron,fesoly,phytomi,pi_alpha
@@ -94,6 +96,32 @@ module mo_param_bgc
public :: sed_denit,calcwei,opalwei,orgwei
public :: calcdens,opaldens,orgdens,claydens
public :: dmsp1,dmsp2,dmsp3,dmsp4,dmsp5,dmsp6,dms_gamma
+ public :: POM_remin_q10,opal_remin_q10,POM_remin_Tref,opal_remin_Tref
+
+ ! extended nitrogen cycle
+ public :: q10ano3denit,sc_ano3denit,Trefano3denit,rano3denit,bkano3denit, &
+ & rano2anmx,q10anmx,Trefanmx,alphaanmx,bkoxanmx,bkano2anmx,bkanh4anmx, &
+ & rano2denit,q10ano2denit,Trefano2denit,bkoxano2denit,bkano2denit, &
+ & ran2odenit,q10an2odenit,Trefan2odenit,bkoxan2odenit,bkan2odenit, &
+ & rdnra,q10dnra,Trefdnra,bkoxdnra,bkdnra,ranh4nitr,q10anh4nitr, &
+ & Trefanh4nitr,bkoxamox,bkanh4nitr,bkamoxn2o,bkyamox, &
+ & rano2nitr,q10ano2nitr,Trefano2nitr,bkoxnitr,bkano2nitr,n2omaxy, &
+ & n2oybeta,NOB2AOAy,bn2o,mufn2o, &
+ & rc2n,ro2nnit,rnoxp,rnoxpi,rno2anmx,rno2anmxi,rnh4anmx, &
+ & rnh4anmxi,rno2dnra,rno2dnrai,rnh4dnra,rnh4dnrai,rnm1, &
+ & bkphyanh4,bkphyano3,bkphosph,bkiron,ro2utammo, &
+ & q10ano3denit_sed,sc_ano3denit_sed,Trefano3denit_sed,rano3denit_sed, &
+ & bkano3denit_sed,rano2anmx_sed,q10anmx_sed,Trefanmx_sed,alphaanmx_sed,&
+ & bkoxanmx_sed,bkano2anmx_sed,bkanh4anmx_sed,rano2denit_sed, &
+ & q10ano2denit_sed,Trefano2denit_sed,bkoxano2denit_sed,bkano2denit_sed,&
+ & ran2odenit_sed,q10an2odenit_sed,Trefan2odenit_sed,bkoxan2odenit_sed, &
+ & bkan2odenit_sed,rdnra_sed,q10dnra_sed,Trefdnra_sed,bkoxdnra_sed, &
+ & bkdnra_sed,ranh4nitr_sed,q10anh4nitr_sed,Trefanh4nitr_sed, &
+ & bkoxamox_sed,bkanh4nitr_sed,bkamoxn2o_sed,bkyamox_sed, &
+ & rano2nitr_sed,q10ano2nitr_sed,Trefano2nitr_sed,bkoxnitr_sed, &
+ & bkano2nitr_sed,n2omaxy_sed,n2oybeta_sed,NOB2AOAy_sed,bn2o_sed, &
+ & mufn2o_sed,POM_remin_q10_sed, POM_remin_Tref_sed,bkox_drempoc_sed
+
!********************************************************************
! Stoichiometry and fixed parameters
@@ -122,11 +150,29 @@ module mo_param_bgc
! Decay parameter for C14, HalfLive = 5700 years
real, parameter :: c14_t_half = 5700.*365. ! Half life of 14C [days]
+ ! Extended nitrogen cycle
+ real, parameter :: rc2n = rcar/rnit ! iHAMOCC C:N ratio
+ real, parameter :: ro2utammo = 140. ! Oxygen utilization per mol detritus during ammonification
+ real, parameter :: ro2nnit = ro2utammo/rnit !
+ real, parameter :: rnoxp = 280. ! consumption of NOx per mol detritus during denitrification
+ real, parameter :: rnoxpi = 1./rnoxp ! inverse
+ real, parameter :: rno2anmx = 1144. ! consumption of NO2 per mol organic production by anammox
+ real, parameter :: rno2anmxi = 1./rno2anmx ! inverse
+ real, parameter :: rnh4anmx = 880. ! consumption of NH4 per mol organic production by anammox
+ real, parameter :: rnh4anmxi = 1./rnh4anmx ! inverse
+ real, parameter :: rno2dnra = 93. + 1./3. ! consumption of NO2 per mol OM degradation during DNRA
+ real, parameter :: rno2dnrai = 1./rno2dnra ! inverse
+ real, parameter :: rnh4dnra = rno2dnra + rnit ! production of NH4 per mol OM during DNRA
+ real, parameter :: rnh4dnrai = 1./rnh4dnra ! inverse
+ real, parameter :: rnm1 = rnit - 1.
+
!********************************************************************
! Atmosphere:
!********************************************************************
real, protected :: atm_n2 = 802000. ! atmosphere dinitrogen concentration
+ real, protected :: atm_n2o = 300e3 ! atmosphere laughing gas mixing ratio around 1980: 300 ppb,provided in ppt,300ppb = 300e3ppt = 3e-7 mol/mol
+ real, protected :: atm_nh3 = 0. ! Six & Mikolajewicz 2022: less than 1nmol m-3
real, protected :: atm_o2 = 196800. ! atmosphere oxygen concentration
real, protected :: atm_co2_nat = 284.32 ! atmosphere CO2 concentration CMIP6 pre-industrial reference
real, protected :: atm_bromo = 3.4 ! atmosphere bromophorme concentration
@@ -230,9 +276,147 @@ module mo_param_bgc
real, protected :: remido = 0.004 ! 1/d - remineralization rate (of DOM)
! deep sea remineralisation constants
real, protected :: drempoc = 0.025 ! 1/d Aerob remineralization rate detritus
+ real, protected :: drempoc_anaerob = 1.25e-3 ! =0.05*drempoc - remin in sub-/anoxic environm. - not be overwritten by M4AGO
+ real, protected :: bkox_drempoc = 1e-7 ! half-saturation constant for oxygen for ammonification (aerobic remin via drempoc)
real, protected :: dremopal = 0.003 ! 1/d Dissolution rate for opal
real, protected :: dremn2o = 0.01 ! 1/d Remineralization rate of detritus on N2O
real, protected :: dremsul = 0.005 ! 1/d Remineralization rate for sulphate reduction
+ real, protected :: POM_remin_q10 = 2.1 ! Bidle et al. 2002: Regulation of Oceanic Silicon...
+ real, protected :: opal_remin_q10 = 2.6 ! Bidle et al. 2002: Regulation of Oceanic Silicon...
+ real, protected :: POM_remin_Tref = 10. ! [deg C] reference temperatue for Q10-dep. POC remin
+ real, protected :: opal_remin_Tref = 10. ! [deg C] reference temperature for Q10-dep. opal dissolution
+
+ !********************************************************************
+ ! Extended nitrogen cycle
+ !********************************************************************
+ ! WATER COLUMN
+ ! Phytoplankton growth
+ real, protected :: bkphyanh4 = 0.25e-6 ! Half-saturation constant for NH4 uptake by bulk phytoplankton (kmol/m3)
+ real, protected :: bkphyano3 = 0.16e-6 ! Half-saturation constant for NO3 uptake by bulk phytoplankton (kmol/m3)
+ real, protected :: bkphosph = 0.01e-6 ! Half-saturation constant for PO4 uptake by bulk phytoplankton (kmol/m3)
+ real, protected :: bkiron ! = bkphosph*riron - Half-saturation constant for Fe uptake by bulk phytoplankton (kmol/m3)
+
+ ! === Denitrification step NO3 -> NO2:
+ real, protected :: rano3denit = 0.00005 ! Maximum growth rate denitrification on NO3 at reference T (1/d -> 1/dt)
+ real, protected :: q10ano3denit = 2. ! Q10 factor for denitrification on NO3 (-)
+ real, protected :: Trefano3denit = 10. ! Reference temperature for denitrification on NO3 (degr C)
+ real, protected :: sc_ano3denit = 0.12e6 ! Shape factor for NO3 denitrification oxygen inhibition function (m3/kmol)
+ real, protected :: bkano3denit = 5.e-6 ! Half-saturation constant for NO3 denitrification (kmol/m3)
+
+ ! === Anammox
+ real, protected :: rano2anmx = 0.001 ! Maximum growth rate for anammox at reference T (1/d -> 1/dt)
+ real, protected :: q10anmx = 1.6 ! Q10 factor for anammox (-)
+ real, protected :: Trefanmx = 10. ! Reference temperature for anammox (degr C)
+ real, protected :: alphaanmx = 0.45e6 ! Shape factor for anammox oxygen inhibition function (m3/kmol)
+ real, protected :: bkoxanmx = 11.3e-6 ! Half-saturation constant for oxygen inhibition function (kmol/m3)
+ real, protected :: bkano2anmx = 5.e-6 ! Half-saturation constant for NO2 limitation (kmol/m3)
+ real, protected :: bkanh4anmx ! = bkano2anmx * rnh4anmx/rno2anmx !Half-saturation constant for NH4 limitation of anammox (kmol/m3)
+
+ ! === Denitrification step NO2 -> N2O
+ real, protected :: rano2denit = 0.002 ! Maximum growth rate denitrification on NO2 at reference T (1/d -> 1/dt)
+ real, protected :: q10ano2denit = 2.0 ! Q10 factor for denitrification on NO2 (-)
+ real, protected :: Trefano2denit = 10. ! Reference temperature for denitrification on NO2 (degr C)
+ real, protected :: bkoxano2denit = 2.e-6 ! Half-saturation constant for (quadratic) oxygen inhibition function of denitrification on NO2 (kmol/m3)
+ real, protected :: bkano2denit = 5.6e-6 ! Half-saturation constant for denitrification on NO2 (kmol/m3)
+
+ ! === Denitrification step N2O -> N2
+ real, protected :: ran2odenit = 0.0005 ! Maximum growth rate denitrification on N2O at reference T (1/d -> 1/dt)
+ real, protected :: q10an2odenit = 3. ! Q10 factor for denitrificationj on N2O (-)
+ real, protected :: Trefan2odenit = 10. ! Reference temperature for denitrification on N2O (degr C)
+ real, protected :: bkoxan2odenit = 10e-6 ! Half-saturation constant for (quadratic) oxygen inhibition function of denitrification on N2O (kmol/m3)
+ real, protected :: bkan2odenit = 0.1e-6 ! Half-saturation constant for denitrification on N2O (kmol/m3)
+
+ ! === DNRA NO2 -> NH4
+ real, protected :: rdnra = 0.0003 ! Maximum growth rate DNRA on NO2 at reference T (1/d -> 1/dt)
+ real, protected :: q10dnra = 2. ! Q10 factor for DNRA on NO2 (-)
+ real, protected :: Trefdnra = 10. ! Reference temperature for DNRA (degr C)
+ real, protected :: bkoxdnra = 2.5e-6 ! Half saturation constant for (quadratic) oxygen inhibition function of DNRA on NO2 (kmol/m3)
+ real, protected :: bkdnra = 0.05e-6 ! Half-saturation constant for DNRA on NO2 (kmol/m3)
+
+ ! === Nitrification on NH4
+ real, protected :: ranh4nitr = 1. ! Maximum growth rate nitrification on NH4 at reference T (1/d -> 1/dt)
+ real, protected :: q10anh4nitr = 3.3 ! Q10 factor for nitrification on NH4 (-)
+ real, protected :: Trefanh4nitr = 20. ! Reference temperature for nitrification on NH4 (degr C)
+ real, protected :: bkoxamox = 0.333e-6 ! Half-saturation constant for oxygen limitation of nitrification on NH4 (kmol/m3)
+ real, protected :: bkanh4nitr = 0.133e-6 ! Half-saturation constant for nitrification on NH4 (kmol/m3)
+ real, protected :: bkamoxn2o = 0.5e-6 ! Half saturation constant for NH4 in pathway splitting function N2O for nitrification on NH4 (kmol/m3)
+ real, protected :: mufn2o ! = 0.11/(50.*1e6*bkoxamox) !=6.61e-3 0.11/(50*1e6)=2.2e-9 - ~Santoro et al. 2011 with simple MM,
+ real, protected :: bn2o ! = 0.077/(50.*mufn2o) !=0.2331 - before set to 0.3 - base fraction entering N2O
+ real, protected :: n2omaxy = 0.003 ! Maximum yield of OM on NH4 nitrification (-)
+ real, protected :: n2oybeta = 18. ! Decay factor for inhibition function for yield during nitrification on NH4 (kmol/m3)
+ real, protected :: bkyamox = 0.333e-6 ! Half saturation constant for pathway splitting function OM-yield for nitrification on NH4 (kmol/m3)
+
+ ! === Nitrification on NO2
+ real, protected :: rano2nitr = 0.75 ! Maximum growth rate nitrification on NO2 at reference T (1/d -> 1/dt)
+ real, protected :: q10ano2nitr = 2.7 ! Q10 factor for nitrification on NO2 (-)
+ real, protected :: Trefano2nitr = 20. ! Reference temperature for nitrification on NO2 (degr C)
+ real, protected :: bkoxnitr = 0.788e-6 ! Half-saturation constant for oxygen limitation of nitrification on NO2 (kmol/m3)
+ real, protected :: bkano2nitr = 0.287e-6 ! Half-saturation constant for NO2 for nitrification on NO2 (kmol/m3)
+ real, protected :: NOB2AOAy = 0.44 ! Ratio of NOB versus AOA yield per energy source ~0.043/0.098 according to Zakem et al. 2022
+
+ !SEDIMENT
+ ! === Ammonification in the sediment
+ real, protected :: POM_remin_q10_sed = 2.1 ! ammonification Q10 in sediment
+ real, protected :: POM_remin_Tref_sed = 10. ! ammonification Tref in sediment
+ real, protected :: bkox_drempoc_sed = 1e-7 ! half saturation constant for O2 limitatio of ammonification in sediment (kmol/m3)
+
+ ! === Denitrification step NO3 -> NO2:
+ real, protected :: rano3denit_sed = 0.05 ! Maximum growth rate denitrification on NO3 at reference T (1/d -> 1/dt)
+ real, protected :: q10ano3denit_sed = 2. ! Q10 factor for denitrification on NO3 (-)
+ real, protected :: Trefano3denit_sed = 10. ! Reference temperature for denitrification on NO3 (degr C)
+ real, protected :: sc_ano3denit_sed = 0.12e6 ! Shape factor for NO3 denitrification oxygen inhibition function (m3/kmol)
+ real, protected :: bkano3denit_sed = 5.e-6 ! Half-saturation constant for NO3 denitrification (kmol/m3)
+
+ ! === Anammox
+ real, protected :: rano2anmx_sed = 0.05 ! Maximum growth rate for anammox at reference T (1/d -> 1/dt)
+ real, protected :: q10anmx_sed = 1.6 ! Q10 factor for anammox (-)
+ real, protected :: Trefanmx_sed = 10. ! Reference temperature for anammox (degr C)
+ real, protected :: alphaanmx_sed = 0.45e6 ! Shape factor for anammox oxygen inhibition function (m3/kmol)
+ real, protected :: bkoxanmx_sed = 11.3e-6 ! Half-saturation constant for oxygen inhibition function (kmol/m3)
+ real, protected :: bkano2anmx_sed = 5.e-6 ! Half-saturation constant for NO2 limitation (kmol/m3)
+ real, protected :: bkanh4anmx_sed ! = bkano2anmx_sed * rnh4anmx/rno2anmx !Half-saturation constant for NH4 limitation of anammox (kmol/m3)
+
+ ! === Denitrification step NO2 -> N2O
+ real, protected :: rano2denit_sed = 0.12 ! Maximum growth rate denitrification on NO2 at reference T (1/d -> 1/dt)
+ real, protected :: q10ano2denit_sed = 2. ! Q10 factor for denitrification on NO2 (-)
+ real, protected :: Trefano2denit_sed = 10. ! Reference temperature for denitrification on NO2 (degr C)
+ real, protected :: bkoxano2denit_sed = 2.e-6 ! Half-saturation constant for (quadratic) oxygen inhibition function of denitrification on NO2 (kmol/m3)
+ real, protected :: bkano2denit_sed = 5.6e-6 ! Half-saturation constant for denitrification on NO2 (kmol/m3)
+
+ ! === Denitrification step N2O -> N2
+ real, protected :: ran2odenit_sed = 0.16 ! Maximum growth rate denitrification on N2O at reference T (1/d -> 1/dt)
+ real, protected :: q10an2odenit_sed = 3. ! Q10 factor for denitrificationj on N2O (-)
+ real, protected :: Trefan2odenit_sed = 10. ! Reference temperature for denitrification on N2O (degr C)
+ real, protected :: bkoxan2odenit_sed = 5.e-6 ! Half-saturation constant for (quadratic) oxygen inhibition function of denitrification on N2O (kmol/m3)
+ real, protected :: bkan2odenit_sed = 1.e-6 ! Half-saturation constant for denitrification on N2O (kmol/m3)
+
+ ! === DNRA NO2 -> NH4
+ real, protected :: rdnra_sed = 0.1 ! Maximum growth rate DNRA on NO2 at reference T (1/d -> 1/dt)
+ real, protected :: q10dnra_sed = 2. ! Q10 factor for DNRA on NO2 (-)
+ real, protected :: Trefdnra_sed = 10. ! Reference temperature for DNRA (degr C)
+ real, protected :: bkoxdnra_sed = 2.5e-6 ! Half saturation constant for (quadratic) oxygen inhibition function of DNRA on NO2 (kmol/m3)
+ real, protected :: bkdnra_sed = 0.05e-6 ! Half-saturation constant for DNRA on NO2 (kmol/m3)
+
+ ! === Nitrification on NH4
+ real, protected :: ranh4nitr_sed = 1. ! Maximum growth rate nitrification on NH4 at reference T (1/d -> 1/dt)
+ real, protected :: q10anh4nitr_sed = 3.3 ! Q10 factor for nitrification on NH4 (-)
+ real, protected :: Trefanh4nitr_sed = 20. ! Reference temperature for nitrification on NH4 (degr C)
+ real, protected :: bkoxamox_sed = 0.333e-6 ! Half-saturation constant for oxygen limitation of nitrification on NH4 (kmol/m3)
+ real, protected :: bkanh4nitr_sed = 0.133e-6 ! Half-saturation constant for nitrification on NH4 (kmol/m3)
+ real, protected :: bkamoxn2o_sed = 0.5e-6 ! Half saturation constant for NH4 in pathway splitting function N2O for nitrification on NH4 (kmol/m3)
+ real, protected :: mufn2o_sed ! = 0.11/(50.*1e6*bkoxamox_sed) !=6.61e-3 0.11/(50*1e6)=2.2e-9 - ~Santoro et al. 2011 with simple MM
+ real, protected :: bn2o_sed ! = 0.077/(50.*mufn2o_sed) !=0.2331 - before set to 0.3 - base fraction entering N2O
+ real, protected :: n2omaxy_sed = 0.003 ! Maximum yield of OM on NH4 nitrification (-)
+ real, protected :: n2oybeta_sed = 18. ! Decay factor for inhibition function for yield during nitrification on NH4 (kmol/m3)
+ real, protected :: bkyamox_sed = 0.333e-6 ! Half saturation constant for pathway splitting function OM-yield for nitrification on NH4 (kmol/m3)
+
+ ! === Nitrification on NO2
+ real, protected :: rano2nitr_sed = 1.54 ! Maximum growth rate nitrification on NO2 at reference T (1/d -> 1/dt)
+ real, protected :: q10ano2nitr_sed = 2.7 ! Q10 factor for nitrification on NO2 (-)
+ real, protected :: Trefano2nitr_sed = 20. ! Reference temperature for nitrification on NO2 (degr C)
+ real, protected :: bkoxnitr_sed = 0.788e-6 ! Half-saturation constant for oxygen limitation of nitrification on NO2 (kmol/m3)
+ real, protected :: bkano2nitr_sed = 0.287e-6 ! Half-saturation constant for NO2 for nitrification on NO2 (kmol/m3)
+ real, protected :: NOB2AOAy_sed = 0.44 ! Ratio of NOB versus AOA yield per energy source ~0.043/0.098 according to Zakem et al. 2022
!********************************************************************
! Parameters for DMS and BrO schemes
@@ -392,6 +576,12 @@ subroutine ini_param_biol()
rcalc = 40. ! iris 40 !calcium carbonate to organic phosphorous production ratio
ropal = 30. ! iris 25 !opal to organic phosphorous production ratio
endif
+
+ if (use_M4AGO) then
+ ! reset drempoc and dremopal for Q10 T-dep remin/dissolution
+ drempoc = 0.12
+ dremopal = 0.023
+ endif
end subroutine ini_param_biol
!********************************************************************
@@ -406,16 +596,38 @@ subroutine read_bgcnamelist()
namelist /bgcparams/ bkphy,dyphy,bluefix,bkzoo,grazra,spemor,gammap,gammaz, &
ecan,zinges,epsher,bkopal,rcalc,ropal, &
remido,drempoc,dremopal,dremn2o,dremsul,fetune,relaxfe, &
- wmin,wmax,wlin,wpoc_const,wcal_const,wopal_const
+ wmin,wmax,wlin,wpoc_const,wcal_const,wopal_const, &
+ disso_poc,disso_sil,disso_caco3, &
+ rano3denit,rano2anmx,rano2denit,ran2odenit,rdnra, &
+ ranh4nitr,rano2nitr,rano3denit_sed,rano2anmx_sed, &
+ rano2denit_sed,ran2odenit_sed,rdnra_sed,ranh4nitr_sed, &
+ rano2nitr_sed,atm_nh3,atm_n2o,bkphyanh4,bkphyano3, &
+ bkphosph, &
+ q10ano3denit,sc_ano3denit,bkano3denit,q10anmx,alphaanmx,&
+ bkoxanmx,bkano2anmx,q10ano2denit, &
+ bkoxano2denit,bkano2denit,q10an2odenit,bkoxan2odenit, &
+ bkan2odenit,q10dnra,bkoxdnra,bkdnra,q10anh4nitr, &
+ bkoxamox,bkanh4nitr,q10ano2nitr,bkoxnitr,bkano2nitr, &
+ q10ano3denit_sed,sc_ano3denit_sed,bkano3denit_sed, &
+ q10anmx_sed,alphaanmx_sed,bkox_drempoc_sed, &
+ bkoxanmx_sed,bkano2anmx_sed,q10ano2denit_sed, &
+ bkoxano2denit_sed,bkano2denit_sed,q10an2odenit_sed, &
+ bkoxan2odenit_sed,bkan2odenit_sed,q10dnra_sed, &
+ bkoxdnra_sed,bkdnra_sed,q10anh4nitr_sed, &
+ bkoxamox_sed,bkanh4nitr_sed,q10ano2nitr_sed, &
+ bkoxnitr_sed,bkano2nitr_sed
+
+ if (mnproc.eq.1) then
+ write(io_stdo_bgc,*)
+ write(io_stdo_bgc,*)'********************************************'
+ write(io_stdo_bgc,*) 'iHAMOCC: read namelist bgcparams'
+ endif
open (newunit=iounit, file=bgc_namelist, status='old',action='read')
read (unit=iounit, nml=BGCPARAMS)
close(unit=iounit)
if (mnproc.eq.1) then
- write(io_stdo_bgc,*)
- write(io_stdo_bgc,*)'********************************************'
- write(io_stdo_bgc,*) 'iHAMOCC: read namelist bgcparams'
write(io_stdo_bgc,nml=BGCPARAMS)
endif
@@ -436,6 +648,15 @@ subroutine calc_param_biol()
* (claydens - 1025.) / 1.567 * 1000. & ! excess density / dyn. visc.
* dustd2 * 1.e-4) ! m/d
+ if (use_extNcycle) then
+ bkiron = bkphosph*riron ! Half-saturation constant for Fe uptake by bulk phytoplankton (kmol/m3)
+ bkanh4anmx = bkano2anmx * rnh4anmx/rno2anmx ! Half-saturation constant for NH4 limitation of anammox (kmol/m3)
+ mufn2o = 0.11/(50.*1e6*bkoxamox) ! =6.61e-3 0.11/(50*1e6)=2.2e-9 - ~Santoro et al. 2011 with simple MM,
+ bn2o = 0.077/(50.*mufn2o) ! =0.2331 - before set to 0.3 - base fraction entering N2O
+ bkanh4anmx_sed = bkano2anmx_sed * rnh4anmx/rno2anmx !Half-saturation constant for NH4 limitation of anammox (kmol/m3)
+ mufn2o_sed = 0.11/(50.*1e6*bkoxamox_sed) !=6.61e-3 0.11/(50*1e6)=2.2e-9 - ~Santoro et al. 2011 with simple MM
+ bn2o_sed = 0.077/(50.*mufn2o_sed) !=0.2331 - before set to 0.3 - base fraction entering N2O
+ endif
end subroutine calc_param_biol
!********************************************************************
@@ -471,6 +692,7 @@ subroutine rates_2_timestep()
remido = remido*dtb ! 1/d to 1/time step - remineralization rate (of DOM)
! deep sea remineralisation constants
drempoc = drempoc*dtb ! 1/d to 1/time step Aerob remineralization rate of detritus
+ drempoc_anaerob = drempoc_anaerob*dtb ! 1/d Anaerob remin rate of detritus
dremopal = dremopal*dtb ! 1/d to 1/time step Dissolution rate of opal
dremn2o = dremn2o*dtb ! 1/d to 1/time step Remineralization rate of detritus on N2O
dremsul = dremsul*dtb ! 1/d to 1/time step Remineralization rate for sulphate reduction
@@ -515,6 +737,23 @@ subroutine rates_2_timestep()
disso_caco3 = disso_caco3 * dtbgc ! 1/(kmol CO3--/m3 time step) Dissolution rate constant of CaCO3
sed_denit = sed_denit * dtbgc ! 1/time step Denitrification rate constant of POP
+ if (use_extNcycle) then
+ rano3denit = rano3denit *dtb ! Maximum growth rate denitrification on NO3 at reference T (1/d -> 1/dt)
+ rano2anmx = rano2anmx *dtb ! Maximum growth rate for anammox at reference T (1/d -> 1/dt)
+ rano2denit = rano2denit *dtb ! Maximum growth rate denitrification on NO2 at reference T (1/d -> 1/dt)
+ ran2odenit = ran2odenit *dtb ! Maximum growth rate denitrification on N2O at reference T (1/d -> 1/dt)
+ rdnra = rdnra *dtb ! Maximum growth rate DNRA on NO2 at reference T (1/d -> 1/dt)
+ ranh4nitr = ranh4nitr *dtb ! Maximum growth rate nitrification on NH4 at reference T (1/d -> 1/dt)
+ rano2nitr = rano2nitr *dtb ! Maximum growth rate nitrification on NO2 at reference T (1/d -> 1/dt)
+
+ rano3denit_sed = rano3denit_sed *dtb ! Maximum growth rate denitrification on NO3 at reference T (1/d -> 1/dt)
+ rano2anmx_sed = rano2anmx_sed *dtb ! Maximum growth rate for anammox at reference T (1/d -> 1/dt)
+ rano2denit_sed = rano2denit_sed *dtb ! Maximum growth rate denitrification on NO2 at reference T (1/d -> 1/dt)
+ ran2odenit_sed = ran2odenit_sed *dtb ! Maximum growth rate denitrification on N2O at reference T (1/d -> 1/dt)
+ rdnra_sed = rdnra_sed *dtb ! Maximum growth rate DNRA on NO2 at reference T (1/d -> 1/dt)
+ ranh4nitr_sed = ranh4nitr_sed *dtb ! Maximum growth rate nitrification on NH4 at reference T (1/d -> 1/dt)
+ rano2nitr_sed = rano2nitr_sed *dtb ! Maximum growth rate nitrification on NO2 at reference T (1/d -> 1/dt)
+ endif
end subroutine rates_2_timestep
!********************************************************************
@@ -584,18 +823,25 @@ subroutine write_parambgc()
call cinfo_add_entry('use_natDIC', use_natDIC)
call cinfo_add_entry('use_CFC', use_CFC)
call cinfo_add_entry('use_cisonew', use_cisonew)
+ call cinfo_add_entry('use_extNcycle', use_extNcycle)
call cinfo_add_entry('use_PBGC_OCNP_TIMESTEP', use_PBGC_OCNP_TIMESTEP)
call cinfo_add_entry('use_PBGC_CK_TIMESTEP', use_PBGC_CK_TIMESTEP)
call cinfo_add_entry('use_FB_BGC_OCE BROMO', use_FB_BGC_OCE)
call cinfo_add_entry('use_BOXATM', use_BOXATM)
call cinfo_add_entry('use_sedbypass', use_sedbypass)
- write(io_stdo_bgc,*) '* ocn_co2_type = ',ocn_co2_type
+ write(io_stdo_bgc,*) '* ocn_co2_type = ',ocn_co2_type
call cinfo_add_entry('do_ndep', do_ndep)
call cinfo_add_entry('do_rivinpt', do_rivinpt)
call cinfo_add_entry('do_oalk', do_oalk)
call cinfo_add_entry('with_dmsph', with_dmsph)
call cinfo_add_entry('do_sedspinup', do_sedspinup)
call cinfo_add_entry('l_3Dvarsedpor', l_3Dvarsedpor)
+ call cinfo_add_entry('leuphotic_cya', leuphotic_cya)
+ call cinfo_add_entry('use_M4AGO', use_M4AGO)
+ if (use_extNcycle) then
+ call cinfo_add_entry('do_ndep_coupled', do_ndep_coupled)
+ call cinfo_add_entry('do_n2onh3_coupled', do_n2onh3_coupled)
+ endif
write(io_stdo_bgc,*) '* '
write(io_stdo_bgc,*) '* Values of MO_PARAM_BGC variables : '
call pinfo_add_entry('atm_co2', atm_co2)
@@ -619,6 +865,10 @@ subroutine write_parambgc()
endif
call pinfo_add_entry('atm_o2', atm_o2)
call pinfo_add_entry('atm_n2', atm_n2)
+ call pinfo_add_entry('atm_n2o', atm_n2o)
+ if (use_extNcycle) then
+ call pinfo_add_entry('atm_nh3',atm_nh3)
+ endif
call pinfo_add_entry('phytomi', phytomi)
call pinfo_add_entry('grami', grami)
call pinfo_add_entry('remido', remido*dtbinv)
@@ -741,7 +991,122 @@ subroutine write_parambgc()
call pinfo_add_entry('calcdens', calcdens)
call pinfo_add_entry('claydens', claydens)
endif
-
+ if (use_extNcycle) then
+ write(io_stdo_bgc,*) '*********************************************************'
+ write(io_stdo_bgc,*) '* HAMOCC extended nitrogen cycle parameters water column:'
+ call pinfo_add_entry('rc2n', rc2n)
+ call pinfo_add_entry('ro2utammo', ro2utammo)
+ call pinfo_add_entry('ro2nnit', ro2nnit)
+ call pinfo_add_entry('rnoxp', rnoxp)
+ call pinfo_add_entry('rnoxpi', rnoxpi)
+ call pinfo_add_entry('rno2anmx', rno2anmx)
+ call pinfo_add_entry('rno2anmxi', rno2anmxi)
+ call pinfo_add_entry('rnh4anmx', rnh4anmx)
+ call pinfo_add_entry('rnh4anmxi', rnh4anmxi)
+ call pinfo_add_entry('rno2dnra', rno2dnra)
+ call pinfo_add_entry('rno2dnrai', rno2dnrai)
+ call pinfo_add_entry('rnh4dnra', rnh4dnra)
+ call pinfo_add_entry('rnh4dnrai', rnh4dnrai)
+ call pinfo_add_entry('rnm1', rnm1)
+ call pinfo_add_entry('bkphyanh4', bkphyanh4)
+ call pinfo_add_entry('bkphyano3', bkphyano3)
+ call pinfo_add_entry('bkphosph', bkphosph)
+ call pinfo_add_entry('bkiron', bkiron)
+ call pinfo_add_entry('rano3denit', rano3denit *dtbinv)
+ call pinfo_add_entry('q10ano3denit', q10ano3denit)
+ call pinfo_add_entry('Trefano3denit', Trefano3denit)
+ call pinfo_add_entry('sc_ano3denit', sc_ano3denit)
+ call pinfo_add_entry('bkano3denit', bkano3denit)
+ call pinfo_add_entry('rano2anmx', rano2anmx *dtbinv)
+ call pinfo_add_entry('q10anmx', q10anmx)
+ call pinfo_add_entry('Trefanmx', Trefanmx)
+ call pinfo_add_entry('alphaanmx', alphaanmx)
+ call pinfo_add_entry('bkoxanmx', bkoxanmx)
+ call pinfo_add_entry('bkano2anmx', bkano2anmx)
+ call pinfo_add_entry('bkanh4anmx', bkanh4anmx)
+ call pinfo_add_entry('rano2denit', rano2denit *dtbinv)
+ call pinfo_add_entry('q10ano2denit', q10ano2denit)
+ call pinfo_add_entry('Trefano2denit', Trefano2denit)
+ call pinfo_add_entry('bkoxano2denit', bkoxano2denit)
+ call pinfo_add_entry('bkano2denit', bkano2denit)
+ call pinfo_add_entry('ran2odenit', ran2odenit *dtbinv)
+ call pinfo_add_entry('q10an2odenit', q10an2odenit)
+ call pinfo_add_entry('Trefan2odenit', Trefan2odenit)
+ call pinfo_add_entry('bkoxan2odenit', bkoxan2odenit)
+ call pinfo_add_entry('bkan2odenit', bkan2odenit)
+ call pinfo_add_entry('rdnra', rdnra *dtbinv)
+ call pinfo_add_entry('q10dnra', q10dnra)
+ call pinfo_add_entry('Trefdnra', Trefdnra)
+ call pinfo_add_entry('bkoxdnra', bkoxdnra)
+ call pinfo_add_entry('bkdnra', bkdnra)
+ call pinfo_add_entry('ranh4nitr', ranh4nitr *dtbinv)
+ call pinfo_add_entry('q10anh4nitr', q10anh4nitr)
+ call pinfo_add_entry('Trefanh4nitr', Trefanh4nitr)
+ call pinfo_add_entry('bkoxamox', bkoxamox)
+ call pinfo_add_entry('bkanh4nitr', bkanh4nitr)
+ call pinfo_add_entry('bkamoxn2o', bkamoxn2o)
+ call pinfo_add_entry('mufn2o', mufn2o)
+ call pinfo_add_entry('bn2o', bn2o)
+ call pinfo_add_entry('n2omaxy', n2omaxy)
+ call pinfo_add_entry('n2oybeta', n2oybeta)
+ call pinfo_add_entry('bkyamox', bkyamox)
+ call pinfo_add_entry('rano2nitr', rano2nitr *dtbinv)
+ call pinfo_add_entry('q10ano2nitr', q10ano2nitr)
+ call pinfo_add_entry('Trefano2nitr', Trefano2nitr)
+ call pinfo_add_entry('bkoxnitr', bkoxnitr)
+ call pinfo_add_entry('bkano2nitr', bkano2nitr)
+ call pinfo_add_entry('NOB2AOAy', NOB2AOAy)
+
+ write(io_stdo_bgc,*) '****************************************************************'
+ write(io_stdo_bgc,*) '* HAMOCC extended nitrogen cycle parameters sediment:'
+ call pinfo_add_entry('POM_remin_q10_sed', POM_remin_q10_sed)
+ call pinfo_add_entry('POM_remin_Tref_sed',POM_remin_Tref_sed)
+ call pinfo_add_entry('bkox_drempoc_sed', bkox_drempoc_sed)
+ call pinfo_add_entry('rano3denit_sed', rano3denit_sed *dtbinv)
+ call pinfo_add_entry('q10ano3denit_sed', q10ano3denit_sed)
+ call pinfo_add_entry('Trefano3denit_sed', Trefano3denit_sed)
+ call pinfo_add_entry('sc_ano3denit_sed', sc_ano3denit_sed)
+ call pinfo_add_entry('bkano3denit_sed', bkano3denit_sed)
+ call pinfo_add_entry('rano2anmx_sed', rano2anmx_sed *dtbinv)
+ call pinfo_add_entry('q10anmx_sed', q10anmx_sed)
+ call pinfo_add_entry('Trefanmx_sed', Trefanmx_sed)
+ call pinfo_add_entry('alphaanmx_sed', alphaanmx_sed)
+ call pinfo_add_entry('bkoxanmx_sed', bkoxanmx_sed)
+ call pinfo_add_entry('bkano2anmx_sed', bkano2anmx_sed)
+ call pinfo_add_entry('bkanh4anmx_sed', bkanh4anmx_sed)
+ call pinfo_add_entry('rano2denit_sed', rano2denit_sed *dtbinv)
+ call pinfo_add_entry('q10ano2denit_sed', q10ano2denit_sed)
+ call pinfo_add_entry('Trefano2denit_sed', Trefano2denit_sed)
+ call pinfo_add_entry('bkoxano2denit_sed', bkoxano2denit_sed)
+ call pinfo_add_entry('bkano2denit_sed', bkano2denit_sed)
+ call pinfo_add_entry('ran2odenit_sed', ran2odenit_sed *dtbinv)
+ call pinfo_add_entry('q10an2odenit_sed', q10an2odenit_sed)
+ call pinfo_add_entry('Trefan2odenit_sed', Trefan2odenit_sed)
+ call pinfo_add_entry('bkoxan2odenit_sed', bkoxan2odenit_sed)
+ call pinfo_add_entry('bkan2odenit_sed', bkan2odenit_sed)
+ call pinfo_add_entry('rdnra_sed', rdnra_sed *dtbinv)
+ call pinfo_add_entry('q10dnra_sed', q10dnra_sed)
+ call pinfo_add_entry('Trefdnra_sed', Trefdnra_sed)
+ call pinfo_add_entry('bkoxdnra_sed', bkoxdnra_sed)
+ call pinfo_add_entry('bkdnra_sed', bkdnra_sed)
+ call pinfo_add_entry('ranh4nitr_sed', ranh4nitr_sed *dtbinv)
+ call pinfo_add_entry('q10anh4nitr_sed', q10anh4nitr_sed)
+ call pinfo_add_entry('Trefanh4nitr_sed', Trefanh4nitr_sed)
+ call pinfo_add_entry('bkoxamox_sed', bkoxamox_sed)
+ call pinfo_add_entry('bkanh4nitr_sed', bkanh4nitr_sed)
+ call pinfo_add_entry('bkamoxn2o_sed', bkamoxn2o_sed)
+ call pinfo_add_entry('mufn2o_sed', mufn2o_sed)
+ call pinfo_add_entry('bn2o_sed', bn2o_sed)
+ call pinfo_add_entry('n2omaxy_sed', n2omaxy_sed)
+ call pinfo_add_entry('n2oybeta_sed', n2oybeta_sed)
+ call pinfo_add_entry('bkyamox_sed', bkyamox_sed)
+ call pinfo_add_entry('rano2nitr_sed', rano2nitr_sed *dtbinv)
+ call pinfo_add_entry('q10ano2nitr_sed', q10ano2nitr_sed)
+ call pinfo_add_entry('Trefano2nitr_sed', Trefano2nitr_sed)
+ call pinfo_add_entry('bkoxnitr_sed', bkoxnitr_sed)
+ call pinfo_add_entry('bkano2nitr_sed', bkano2nitr_sed)
+ call pinfo_add_entry('NOB2AOAy_sed', NOB2AOAy_sed)
+ endif
end subroutine write_parambgc
subroutine cinfo_add_entry(controlname,controlval)
diff --git a/hamocc/mo_powach.F90 b/hamocc/mo_powach.F90
index f77be13a..d4d041b2 100644
--- a/hamocc/mo_powach.F90
+++ b/hamocc/mo_powach.F90
@@ -25,27 +25,30 @@ module mo_powach
contains
- subroutine powach(kpie,kpje,kpke,kbnd,prho,omask,psao,lspin)
+ subroutine powach(kpie,kpje,kpke,kbnd,prho,omask,psao,ptho,lspin)
!***********************************************************************************************
! Ernst Maier-Reimer, *MPI-Met, HH* 10.04.01
! Modified: S.Legutke, *MPI-MaD, HH* 10.04.01
!***********************************************************************************************
- use mo_control_bgc, only: dtbgc,use_cisonew
+ use mo_control_bgc, only: dtbgc,use_cisonew,use_extNcycle
use mo_param1_bgc, only: ioxygen,ipowaal,ipowaic,ipowaox,ipowaph,ipowasi,ipown2,ipowno3, &
isilica,isssc12,issso12,issssil,issster,ks,ipowc13,ipowc14,isssc13, &
- isssc14,issso13,issso14,safediv
+ isssc14,issso13,issso14,safediv,ipownh4
use mo_carbch, only: co3,keqb,ocetra,sedfluxo
use mo_chemcon, only: calcon
use mo_param_bgc, only: rnit,rcar,rdnit1,rdnit2,ro2ut,disso_sil,silsat,disso_poc,sed_denit, &
- disso_caco3
+ & disso_caco3,ro2utammo, &
+ & POM_remin_q10_sed,POM_remin_Tref_sed,bkox_drempoc_sed
use mo_sedmnt, only: porwat,porsol,powtra,produs,prcaca,prorca,seddw,sedhpl,sedlay, &
silpro,pror13,pror14,prca13,prca14
use mo_vgrid, only: kbo,bolay
use mo_powadi, only: powadi
use mo_carchm, only: carchm_solve
use mo_dipowa, only: dipowa
+ use mo_extNsediment,only: sed_nitrification,sed_denit_NO3_to_NO2,sed_anammox,sed_denit_DNRA, &
+ & extNsed_diagnostics,ised_remin_aerob,ised_remin_sulf
! Arguments
integer, intent(in) :: kpie ! 1st dimension of model grid.
@@ -55,6 +58,7 @@ subroutine powach(kpie,kpje,kpke,kbnd,prho,omask,psao,lspin)
real, intent(in) :: prho(kpie,kpje,kpke) ! seawater density [g/cm^3].
real, intent(in) :: omask(kpie,kpje) ! land/ocean mask.
real, intent(in) :: psao(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd,kpke) ! salinity [psu].
+ real, intent(in) :: ptho(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd,kpke) ! Pot. temperature [deg C].
logical, intent(in) :: lspin
! Local variables
@@ -62,6 +66,8 @@ subroutine powach(kpie,kpje,kpke,kbnd,prho,omask,psao,lspin)
real :: sedb1(kpie,0:ks),sediso(kpie,0:ks)
real :: solrat(kpie,ks),powcar(kpie,ks)
real :: aerob(kpie,ks),anaerob(kpie,ks),sulf(kpie,ks)
+ real :: ex_ddic(kpie,ks),ex_dalk(kpie,ks) !sum of DIC and alk changes related to extended nitrogen cycle
+ real :: ex_disso_poc
real :: aerob13(kpie,ks),anaerob13(kpie,ks),sulf13(kpie,ks) ! cisonew
real :: aerob14(kpie,ks),anaerob14(kpie,ks),sulf14(kpie,ks) ! cisonew
real :: dissot, undsa, posol
@@ -80,14 +86,15 @@ subroutine powach(kpie,kpje,kpke,kbnd,prho,omask,psao,lspin)
! RJ: This loop must go from 1 to kpje in the parallel version,
! otherways we had to do a boundary exchange
- !$OMP PARALLEL DO &
- !$OMP&PRIVATE(sedb1,sediso,solrat,powcar,aerob,anaerob, &
- !$OMP& dissot,undsa,posol, &
- !$OMP& umfa,denit,saln,rrho,alk,c,sit,pt, &
- !$OMP& K1,K2,Kb,Kw,Ks1,Kf,Ksi,K1p,K2p,K3p, &
- !$OMP& ah1,ac,cu,cb,cc,satlev, &
- !$OMP& ratc13,ratc14,rato13,rato14,poso13,poso14, &
- !$OMP& k,i)
+ !$OMP PARALLEL DO &
+ !$OMP& PRIVATE(sedb1,sediso,solrat,powcar,aerob,anaerob, &
+ !$OMP& ex_dalk,ex_ddic,ex_disso_poc, &
+ !$OMP& dissot,undsa,posol, &
+ !$OMP& umfa,denit,saln,rrho,alk,c,sit,pt, &
+ !$OMP& K1,K2,Kb,Kw,Ks1,Kf,Ksi,K1p,K2p,K3p, &
+ !$OMP& ah1,ac,cu,cb,cc,satlev, &
+ !$OMP& ratc13,ratc14,rato13,rato14,poso13,poso14, &
+ !$OMP& k,i)
j_loop: do j = 1, kpje
@@ -95,7 +102,12 @@ subroutine powach(kpie,kpje,kpke,kbnd,prho,omask,psao,lspin)
do i = 1, kpie
solrat(i,k) = 0.
powcar(i,k) = 0.
- anaerob(i,k)= 0.
+ if (use_extNcycle) then
+ ex_ddic(i,k) = 0.
+ ex_dalk(i,k) = 0.
+ else
+ anaerob(i,k) = 0.
+ endif
aerob(i,k) = 0.
sulf(i,k) = 0.
if (use_cisonew) then
@@ -205,10 +217,21 @@ subroutine powach(kpie,kpje,kpke,kbnd,prho,omask,psao,lspin)
if(omask(i,j) > 0.5) then
undsa = powtra(i,j,1,ipowaox)
sedb1(i,0) = bolay(i,j) * ocetra(i,j,kbo(i,j),ioxygen)
- solrat(i,1) = ( sedlay(i,j,1,issso12) + prorca(i,j) &
- & / (porsol(i,j,1) * seddw(1)) ) &
- & * ro2ut * dissot / (1. + dissot * undsa) &
- & * porsol(i,j,1) / porwat(i,j,1)
+ if ( .not. use_extNcycle) then
+ solrat(i,1) = ( sedlay(i,j,1,issso12) + prorca(i,j) &
+ & / (porsol(i,j,1) * seddw(1)) ) &
+ & * ro2ut * dissot / (1. + dissot * undsa) &
+ & * porsol(i,j,1) / porwat(i,j,1)
+ else
+ ! extended nitrogen cycle - 140mol O2/mol POP O2-consumption
+ ! O2 and T-dep
+ ex_disso_poc = dissot*powtra(i,j,1,ipowaox)/(powtra(i,j,1,ipowaox) + bkox_drempoc_sed) & ! oxygen limitation
+ & *POM_remin_q10_sed**((ptho(i,j,kbo(i,j))-POM_remin_Tref_sed)/10.) ! T-dep
+ solrat(i,1) = ( sedlay(i,j,1,issso12) + prorca(i,j) &
+ & / (porsol(i,j,1) * seddw(1)) ) &
+ & * ro2utammo * ex_disso_poc / (1. + ex_disso_poc * undsa) &
+ & * porsol(i,j,1) / porwat(i,j,1)
+ endif
endif
enddo
@@ -221,8 +244,16 @@ subroutine powach(kpie,kpje,kpke,kbnd,prho,omask,psao,lspin)
if(omask(i,j) > 0.5) then
undsa = powtra(i,j,k,ipowaox)
sedb1(i,k) = seddw(k) * porwat(i,j,k) * powtra(i,j,k,ipowaox)
- if (k > 1) solrat(i,k) = sedlay(i,j,k,issso12) * ro2ut * dissot &
- & / (1. + dissot*undsa) * porsol(i,j,k) / porwat(i,j,k)
+ if ( .not. use_extNcycle) then
+ if (k > 1) solrat(i,k) = sedlay(i,j,k,issso12) * ro2ut * dissot &
+ & / (1. + dissot*undsa) * porsol(i,j,k) / porwat(i,j,k)
+ else
+ ! extended nitrogen cycle - 140mol O2/mol POP O2-consumption
+ ex_disso_poc = dissot*powtra(i,j,k,ipowaox)/(powtra(i,j,k,ipowaox)+bkox_drempoc_sed) & ! oxygen limitation
+ & *POM_remin_q10_sed**((ptho(i,j,kbo(i,j))-POM_remin_Tref_sed)/10.) ! T-dep
+ if (k > 1) solrat(i,k) = sedlay(i,j,k,issso12) * ro2utammo * ex_disso_poc &
+ & /(1. + ex_disso_poc*undsa) * porsol(i,j,k) / porwat(i,j,k)
+ endif
endif
enddo
enddo
@@ -258,9 +289,14 @@ subroutine powach(kpie,kpje,kpke,kbnd,prho,omask,psao,lspin)
do i = 1, kpie
if(omask(i,j) > 0.5) then
umfa = porsol(i,j,k) / porwat(i,j,k)
- solrat(i,k) = sedlay(i,j,k,issso12) * dissot/(1. + dissot*sediso(i,k))
+ if (.not. use_extNcycle) then
+ solrat(i,k) = sedlay(i,j,k,issso12) * dissot/(1. + dissot*sediso(i,k))
+ else
+ ex_disso_poc = dissot * powtra(i,j,k,ipowaox)/(powtra(i,j,k,ipowaox) + bkox_drempoc_sed) & ! oxygen limitation
+ & * POM_remin_q10_sed**((ptho(i,j,kbo(i,j))-POM_remin_Tref_sed)/10.) ! T-dep
+ solrat(i,k) = sedlay(i,j,k,issso12) * ex_disso_poc/(1. + ex_disso_poc*sediso(i,k))
+ endif
posol = sediso(i,k)*solrat(i,k)
- aerob(i,k) = posol*umfa !this has P units: kmol P/m3 of pore water
if (use_cisonew) then
rato13 = sedlay(i,j,k,issso13) / (sedlay(i,j,k,issso12) + safediv)
rato14 = sedlay(i,j,k,issso14) / (sedlay(i,j,k,issso12) + safediv)
@@ -271,7 +307,15 @@ subroutine powach(kpie,kpje,kpke,kbnd,prho,omask,psao,lspin)
endif
sedlay(i,j,k,issso12) = sedlay(i,j,k,issso12) - posol
powtra(i,j,k,ipowaph) = powtra(i,j,k,ipowaph) + posol*umfa
- powtra(i,j,k,ipowno3) = powtra(i,j,k,ipowno3) + posol*rnit*umfa
+ if (.not. use_extNcycle) then
+ powtra(i,j,k,ipowno3) = powtra(i,j,k,ipowno3) + posol*rnit*umfa
+ aerob(i,k) = posol*umfa !this has P units: kmol P/m3 of pore water
+ else
+ powtra(i,j,k,ipownh4) = powtra(i,j,k,ipownh4) + posol*rnit*umfa
+ ex_ddic(i,k) = rcar*posol*umfa ! C-units kmol C/m3 of pore water
+ ex_dalk(i,k) = (rnit-1.)*posol*umfa ! alkalinity units
+ extNsed_diagnostics(i,j,k,ised_remin_aerob) = posol*rnit*umfa ! Output
+ endif
powtra(i,j,k,ipowaox) = sediso(i,k)
if (use_cisonew) then
sedlay(i,j,k,issso13) = sedlay(i,j,k,issso13) - poso13
@@ -283,36 +327,45 @@ subroutine powach(kpie,kpje,kpke,kbnd,prho,omask,psao,lspin)
! Calculate nitrate reduction under anaerobic conditions explicitely
!*******************************************************************
-
- ! Denitrification rate constant of POP (disso) [1/sec]*dtbgc
- denit = sed_denit
- do k = 1, ks
- do i = 1, kpie
- if(omask(i,j) > 0.5) then
- if(powtra(i,j,k,ipowaox) < 1.e-6) then
- posol = denit * min(0.25*powtra(i,j,k,ipowno3)/rdnit2, sedlay(i,j,k,issso12))
- umfa = porsol(i,j,k)/porwat(i,j,k)
- anaerob(i,k) = posol*umfa !this has P units: kmol P/m3 of pore water
- if (use_cisonew) then
- rato13 = sedlay(i,j,k,issso13) / (sedlay(i,j,k,issso12) + safediv)
- rato14 = sedlay(i,j,k,issso14) / (sedlay(i,j,k,issso12) + safediv)
- poso13 = posol * rato13
- poso14 = posol * rato14
- anaerob13(i,k) = poso13*umfa !this has P units: kmol P/m3 of pore water
- anaerob14(i,k) = poso14*umfa !this has P units: kmol P/m3 of pore water
- endif
- sedlay(i,j,k,issso12) = sedlay(i,j,k,issso12) - posol
- powtra(i,j,k,ipowaph) = powtra(i,j,k,ipowaph) + posol*umfa
- powtra(i,j,k,ipowno3) = powtra(i,j,k,ipowno3) - rdnit1*posol*umfa
- powtra(i,j,k,ipown2) = powtra(i,j,k,ipown2) + rdnit2*posol*umfa
- if (use_cisonew) then
- sedlay(i,j,k,issso13) = sedlay(i,j,k,issso13) - poso13
- sedlay(i,j,k,issso14) = sedlay(i,j,k,issso14) - poso14
+ if (.not. use_extNcycle) then
+ ! Denitrification rate constant of POP (disso) [1/sec]*dtbgc
+ denit = sed_denit
+
+ ! Store flux in array anaerob, for later computation of DIC and alkalinity.
+ do k = 1, ks
+ do i = 1, kpie
+ if(omask(i,j) > 0.5) then
+ if(powtra(i,j,k,ipowaox) < 1.e-6) then
+ posol = denit * min(0.25*powtra(i,j,k,ipowno3)/rdnit2, sedlay(i,j,k,issso12))
+ umfa = porsol(i,j,k)/porwat(i,j,k)
+ anaerob(i,k) = posol*umfa !this has P units: kmol P/m3 of pore water
+ if (use_cisonew) then
+ rato13 = sedlay(i,j,k,issso13) / (sedlay(i,j,k,issso12) + safediv)
+ rato14 = sedlay(i,j,k,issso14) / (sedlay(i,j,k,issso12) + safediv)
+ poso13 = posol * rato13
+ poso14 = posol * rato14
+ anaerob13(i,k) = poso13*umfa !this has P units: kmol P/m3 of pore water
+ anaerob14(i,k) = poso14*umfa !this has P units: kmol P/m3 of pore water
+ endif
+ sedlay(i,j,k,issso12) = sedlay(i,j,k,issso12) - posol
+ powtra(i,j,k,ipowaph) = powtra(i,j,k,ipowaph) + posol*umfa
+ powtra(i,j,k,ipowno3) = powtra(i,j,k,ipowno3) - rdnit1*posol*umfa
+ powtra(i,j,k,ipown2) = powtra(i,j,k,ipown2) + rdnit2*posol*umfa
+ if (use_cisonew) then
+ sedlay(i,j,k,issso13) = sedlay(i,j,k,issso13) - poso13
+ sedlay(i,j,k,issso14) = sedlay(i,j,k,issso14) - poso14
+ endif
endif
endif
- endif
+ enddo
enddo
- enddo
+ else
+ !======>>>> extended nitrogen cycle processes (aerobic and anaerobic) that follow ammonification
+ call sed_nitrification(j,kpie,kpje,kpke,kbnd,ptho,omask,ex_ddic,ex_dalk)
+ call sed_denit_NO3_to_NO2(j,kpie,kpje,kpke,kbnd,ptho,omask,ex_ddic,ex_dalk)
+ call sed_anammox(j,kpie,kpje,kpke,kbnd,ptho,omask,ex_ddic,ex_dalk)
+ call sed_denit_dnra(j,kpie,kpje,kpke,kbnd,ptho,omask,ex_ddic,ex_dalk)
+ endif
! sulphate reduction in sediments
do k = 1, ks
@@ -337,6 +390,9 @@ subroutine powach(kpie,kpje,kpke,kbnd,prho,omask,psao,lspin)
sedlay(i,j,k,issso13) = sedlay(i,j,k,issso13) - poso13
sedlay(i,j,k,issso14) = sedlay(i,j,k,issso14) - poso14
endif
+ if (use_extNcycle) then
+ extNsed_diagnostics(i,j,k,ised_remin_sulf) = posol*umfa ! Output
+ endif
endif
endif
enddo
@@ -355,8 +411,13 @@ subroutine powach(kpie,kpje,kpke,kbnd,prho,omask,psao,lspin)
if(omask(i,j) > 0.5) then
saln= min( 40., max( 0., psao(i,j,kbo(i,j))))
rrho= prho(i,j,kbo(i,j))
- alk = (powtra(i,j,k,ipowaal) - (sulf(i,k)+aerob(i,k))*(rnit+1.) + anaerob(i,k)*(rdnit1-1.)) / rrho
- c = (powtra(i,j,k,ipowaic) + (anaerob(i,k)+aerob(i,k)+sulf(i,k))*rcar) / rrho
+ if (use_extNcycle) then
+ alk = (powtra(i,j,k,ipowaal) - (sulf(i,k)+aerob(i,k))*(rnit+1.) + ex_dalk(i,k)) / rrho
+ c = (powtra(i,j,k,ipowaic) + (aerob(i,k)+sulf(i,k))*rcar + ex_ddic(i,k)) / rrho
+ else
+ alk = (powtra(i,j,k,ipowaal) - (sulf(i,k)+aerob(i,k))*(rnit+1.) + anaerob(i,k)*(rdnit1-1.)) / rrho
+ c = (powtra(i,j,k,ipowaic) + (anaerob(i,k)+aerob(i,k)+sulf(i,k))*rcar) / rrho
+ endif
sit = powtra(i,j,k,ipowasi) / rrho
pt = powtra(i,j,k,ipowaph) / rrho
ah1 = sedhpl(i,j,k)
@@ -461,10 +522,17 @@ subroutine powach(kpie,kpje,kpke,kbnd,prho,omask,psao,lspin)
poso14 = posol * ratc14
endif
sedlay(i,j,k,isssc12) = sedlay(i,j,k,isssc12) - posol
- powtra(i,j,k,ipowaic) = powtra(i,j,k,ipowaic) &
- & + posol * umfa + (aerob(i,k) + anaerob(i,k) + sulf(i,k)) * rcar
- powtra(i,j,k,ipowaal) = powtra(i,j,k,ipowaal) &
- & + 2. * posol * umfa - (rnit+1.)*(aerob(i,k) + sulf(i,k)) + (rdnit1-1.)*anaerob(i,k)
+ if (use_extNcycle) then
+ powtra(i,j,k,ipowaic) = powtra(i,j,k,ipowaic) &
+ & + posol * umfa + (aerob(i,k) + sulf(i,k)) * rcar + ex_ddic(i,k)
+ powtra(i,j,k,ipowaal) = powtra(i,j,k,ipowaal) &
+ & + 2. * posol * umfa - (rnit+1.)*(aerob(i,k) + sulf(i,k)) + ex_dalk(i,k)
+ else
+ powtra(i,j,k,ipowaic) = powtra(i,j,k,ipowaic) &
+ & + posol * umfa + (aerob(i,k) + anaerob(i,k) + sulf(i,k)) * rcar
+ powtra(i,j,k,ipowaal) = powtra(i,j,k,ipowaal) &
+ & + 2. * posol * umfa - (rnit+1.)*(aerob(i,k) + sulf(i,k)) + (rdnit1-1.)*anaerob(i,k)
+ endif
if (use_cisonew) then
sedlay(i,j,k,isssc13) = sedlay(i,j,k,isssc13) - poso13
sedlay(i,j,k,isssc14) = sedlay(i,j,k,isssc14) - poso14
diff --git a/hamocc/mo_preftrc.F90 b/hamocc/mo_preftrc.F90
index 007c4ee5..9a80be36 100644
--- a/hamocc/mo_preftrc.F90
+++ b/hamocc/mo_preftrc.F90
@@ -39,7 +39,7 @@ subroutine preftrc(kpie,kpje,omask)
!***********************************************************************************************
use mo_carbch, only: ocetra
- use mo_param1_bgc, only: ialkali,ioxygen,iphosph,iprefalk,iprefdic,iprefo2,iprefpo4,isco212
+ use mo_param1_bgc, only: ialkali,ioxygen,iphosph,isilica,iprefalk,iprefdic,iprefo2,iprefpo4,isco212,iprefsilica
use mo_vgrid, only: kmle
! Arguments
@@ -55,6 +55,7 @@ subroutine preftrc(kpie,kpje,omask)
if (omask(i,j) .gt. 0.5 ) then
ocetra(i,j,1:kmle(i,j),iprefo2) = ocetra(i,j,1:kmle(i,j),ioxygen)
ocetra(i,j,1:kmle(i,j),iprefpo4) = ocetra(i,j,1:kmle(i,j),iphosph)
+ ocetra(i,j,1:kmle(i,j),iprefsilica)= ocetra(i,j,1:kmle(i,j),isilica)
ocetra(i,j,1:kmle(i,j),iprefalk) = ocetra(i,j,1:kmle(i,j),ialkali)
ocetra(i,j,1:kmle(i,j),iprefdic) = ocetra(i,j,1:kmle(i,j),isco212)
endif
diff --git a/hamocc/mo_read_ndep.F90 b/hamocc/mo_read_ndep.F90
index bda9509d..723e2c24 100644
--- a/hamocc/mo_read_ndep.F90
+++ b/hamocc/mo_read_ndep.F90
@@ -21,14 +21,14 @@ module mo_read_ndep
!*************************************************************************************************
! Routines for reading nitrogen deposition fluxes from netcdf files
!
- ! N-deposition is activated through a logical switch 'do_ndep' read from HAMOCC's bgcnml
- ! namelist. When coupled to NorESM, this is achieved by setting BLOM_N_DEPOSITION to
+ ! N-deposition is activated through a logical switch 'do_ndep' read from HAMOCC's bgcnml
+ ! namelist. When coupled to NorESM, this is achieved by setting BLOM_N_DEPOSITION to
! TRUE in env_run.xml.
!
! The routine get_ndep reads nitrogen deposition from file. The n-deposition
! field is then passed to hamocc4bcm where it is applied to the top-most model
- ! layer by a call to apply_ndep (mo_apply_ndep). If N deposition is acitvated, a
- ! valid filename (including the full path) needs to be provided via HAMOCC's bgcnml
+ ! layer by a call to apply_ndep (mo_apply_ndep). If N deposition is acitvated, a
+ ! valid filename (including the full path) needs to be provided via HAMOCC's bgcnml
! namelist (variable ndepfile). If the input file is not found, an error will be issued.
! The input data must be already pre-interpolated to the ocean grid.
!
@@ -55,9 +55,11 @@ module mo_read_ndep
public :: ini_read_ndep ! Initialise the module
public :: get_ndep ! Read and return n-deposition data for a given month.
public :: ndepfile
-
+
character(len=512) :: ndepfile=''
real, allocatable :: ndepread(:,:)
+ real, allocatable :: noydepread(:,:)
+ real, allocatable :: nhxdepread(:,:)
integer :: startyear,endyear
logical :: lini = .false.
integer :: oldmonth=0
@@ -73,7 +75,7 @@ subroutine ini_read_ndep(kpie,kpje)
!***********************************************************************************************
use mod_xc, only: mnproc,xchalt
- use mo_control_bgc, only: io_stdo_bgc,do_ndep
+ use mo_control_bgc, only: io_stdo_bgc,do_ndep,do_ndep_coupled,use_extNcycle
use mod_dia, only: iotype
use mod_nctools, only: ncfopn,ncgeti,ncfcls
use mo_netcdf_bgcrw, only: read_netcdf_var
@@ -94,6 +96,13 @@ subroutine ini_read_ndep(kpie,kpje)
endif
return
endif
+ if (do_ndep_coupled) then
+ if (mnproc.eq.1) then
+ write(io_stdo_bgc,*) ''
+ write(io_stdo_bgc,*) 'ini_read_ndep: N deposition in interactive mode.'
+ endif
+ return
+ end if
! Initialise the module
if (.not. lini) then
@@ -114,17 +123,37 @@ subroutine ini_read_ndep(kpie,kpje)
stop '(ini_read_ndep)'
endif
- ! Allocate field to hold N-deposition fluxes
- if (mnproc.eq.1) then
- write(io_stdo_bgc,*)'Memory allocation for variable ndepread ...'
- write(io_stdo_bgc,*)'First dimension : ',kpie
- write(io_stdo_bgc,*)'Second dimension : ',kpje
+ if (use_extNcycle) then
+ ! Allocate field to hold N-deposition fluxes
+ if (mnproc.eq.1) then
+ write(io_stdo_bgc,*)'Memory allocation for variable nhxdepread ...'
+ write(io_stdo_bgc,*)'First dimension : ',kpie
+ write(io_stdo_bgc,*)'Second dimension : ',kpje
+ endif
+ allocate (nhxdepread(kpie,kpje),stat=errstat)
+ if(errstat.ne.0) stop 'not enough memory nhxdepread'
+ nhxdepread(:,:) = 0.0
+
+ if (mnproc.eq.1) then
+ write(io_stdo_bgc,*)'Memory allocation for variable noydepread ...'
+ write(io_stdo_bgc,*)'First dimension : ',kpie
+ write(io_stdo_bgc,*)'Second dimension : ',kpje
+ endif
+ allocate (noydepread(kpie,kpje),stat=errstat)
+ if(errstat.ne.0) stop 'not enough memory noydepread'
+ noydepread(:,:) = 0.0
+ else
+ ! Allocate field to hold N-deposition fluxes
+ if (mnproc.eq.1) then
+ write(io_stdo_bgc,*)'Memory allocation for variable ndepread ...'
+ write(io_stdo_bgc,*)'First dimension : ',kpie
+ write(io_stdo_bgc,*)'Second dimension : ',kpje
+ endif
+ allocate (ndepread(kpie,kpje),stat=errstat)
+ if(errstat.ne.0) stop 'not enough memory ndep'
+ ndepread(:,:) = 0.0
endif
- allocate (ndepread(kpie,kpje),stat=errstat)
- if(errstat.ne.0) stop 'not enough memory ndep'
- ndepread(:,:) = 0.0
-
! read start and end year of n-deposition file
call ncfopn(trim(ndepfile),'r',' ',1,iotype)
call ncgeti('startyear',startyear)
@@ -143,50 +172,99 @@ subroutine ini_read_ndep(kpie,kpje)
end subroutine ini_read_ndep
- subroutine get_ndep(kpie,kpje,kplyear,kplmon,omask,ndep)
+ subroutine get_ndep(kpie,kpje,kbnd,kplyear,kplmon,omask,ndep,patmnhxdep,patmnoydep)
!***********************************************************************************************
- ! Read and return CMIP6 n-deposition data for a given month.
+ ! Read and return CMIP6 n-deposition data for a given month or use atmosphere input
!
! S. Gao *Gfi, Bergen* 19.08.2017
!***********************************************************************************************
use mod_xc, only: mnproc
use netcdf, only: nf90_open,nf90_close,nf90_nowrite
- use mo_control_bgc, only: io_stdo_bgc,do_ndep
+ use mo_control_bgc, only: io_stdo_bgc,do_ndep,use_extNcycle, do_ndep_coupled
use mo_netcdf_bgcrw, only: read_netcdf_var
+ use mo_param1_bgc, only: nndep,idepnoy,idepnhx
+ use mo_chemcon, only: mw_nitrogen
! Arguments
integer, intent(in) :: kpie ! 1st dimension of model grid.
integer, intent(in) :: kpje ! 2nd dimension of model grid.
+ integer, intent(in) :: kbnd !
integer, intent(in) :: kplyear ! current year.
integer, intent(in) :: kplmon ! current month.
real, intent(in) :: omask(kpie,kpje) ! land/ocean mask (1=ocean)
- real, intent(out) :: ndep(kpie,kpje) ! N-deposition field for current year and month
+ real, intent(out) :: ndep(kpie,kpje,nndep) ! N-deposition field for current year and month
+ real, intent(in) :: patmnhxdep(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd) ! Atmospheric NHx deposition [kgN m-2 s-1]
+ real, intent(in) :: patmnoydep(1-kbnd:kpie+kbnd,1-kbnd:kpje+kbnd) ! Atmospheric NOy deposition [kgN m-2 s-1]
+
! local variables
- integer :: month_in_file, ncstat, ncid
+ integer :: month_in_file, ncstat, ncid, i, j
+ real :: fatmndep
! if N-deposition is switched off set ndep to zero and return
if (.not. do_ndep) then
- ndep(:,:) = 0.0
+ ndep(:,:,:) = 0.0
return
endif
- ! read ndep data from file
- if (kplmon.ne.oldmonth) then
- month_in_file=(max(startyear,min(endyear,kplyear))-startyear)*12+kplmon
- if (mnproc.eq.1) then
- write(io_stdo_bgc,*) 'Read N deposition month ',month_in_file,' from file ',trim(ndepfile)
+ if (use_extNcycle .and. do_ndep_coupled) then
+
+ ! get N-deposition from atmosphere
+ fatmndep = 365.*86400./mw_nitrogen
+ ndep(:,:,:) = 0.
+ !$OMP PARALLEL DO PRIVATE(i)
+ do j=1,kpje
+ do i=1,kpie
+ ! convert from kgN/m2/s to climatological input file units: kmolN/m2/yr
+ if (patmnoydep(i,j) > 0.) then
+ ndep(i,j,idepnoy) = patmnoydep(i,j)*fatmndep
+ endif
+ if (patmnhxdep(i,j) > 0.) then
+ ndep(i,j,idepnhx) = patmnhxdep(i,j)*fatmndep
+ endif
+ enddo
+ enddo
+ !$OMP END PARALLEL DO
+ if (mnproc .eq. 1) then
+ write (io_stdo_bgc,*) 'iHAMOCC: getting NOy and NHx deposition from atm'
+ endif
+
+ else
+
+ ! read ndep data from file
+ if (kplmon.ne.oldmonth) then
+ month_in_file=(max(startyear,min(endyear,kplyear))-startyear)*12+kplmon
+ if (mnproc.eq.1) then
+ write(io_stdo_bgc,*) 'Read N deposition month ',month_in_file,' from file ',trim(ndepfile)
+ endif
+ ncstat=nf90_open(trim(ndepfile),nf90_nowrite,ncid)
+ if (use_extNcycle) then
+ call read_netcdf_var(ncid,'nhxdep',nhxdepread,1,month_in_file,0)
+ call read_netcdf_var(ncid,'noydep',noydepread,1,month_in_file,0)
+ else
+ call read_netcdf_var(ncid,'ndep',ndepread,1,month_in_file,0)
+ endif
+ ncstat=nf90_close(ncid)
+ oldmonth=kplmon
endif
- ncstat=nf90_open(trim(ndepfile),nf90_nowrite,ncid)
- call read_netcdf_var(ncid,'ndep',ndepread,1,month_in_file,0)
- ncstat=nf90_close(ncid)
- oldmonth=kplmon
- endif
- ndep(:,:) = ndepread
+ !$OMP PARALLEL DO PRIVATE(i)
+ ! 1 = NO3; 2 = NH4
+ do j=1,kpje
+ do i=1,kpie
+ if (use_extNcycle) then
+ ndep(i,j,idepnoy) = noydepread(i,j)
+ ndep(i,j,idepnhx) = nhxdepread(i,j)
+ else
+ ndep(i,j,idepnoy) = ndepread(i,j)
+ endif
+ enddo
+ enddo
+ !$OMP END PARALLEL DO
+ endif
end subroutine get_ndep
end module mo_read_ndep
diff --git a/hamocc/mo_sedshi.F90 b/hamocc/mo_sedshi.F90
index 9015fe0f..82034f50 100644
--- a/hamocc/mo_sedshi.F90
+++ b/hamocc/mo_sedshi.F90
@@ -44,6 +44,7 @@ subroutine sedshi(kpie,kpje,omask)
use mo_param_bgc, only: rcar
use mo_param1_bgc, only: isssc12,issssil,issso12,issster,ks,nsedtra,isssc13,isssc14, &
issso13,issso14
+ use mo_carbch, only: sedfluxb
use mo_control_bgc, only: use_cisonew
! Arguments
@@ -58,6 +59,7 @@ subroutine sedshi(kpie,kpje,omask)
real :: sedlo,uebers,seddef,spresent,buried
real :: refill,frac
+ sedfluxb(:,:,:) = 0.
! DOWNWARD SHIFTING
! shift solid sediment sediment downwards, if layer is full, i.e., if
! the volume filled by the four constituents poc, opal, caco3, clay
@@ -77,7 +79,7 @@ subroutine sedshi(kpie,kpje,omask)
& + oplfa*sedlay(i,j,k,issssil) &
& + clafa*sedlay(i,j,k,issster)
! "full sediment has sedlo=1
- wsed(i,j)=max(0.,(sedlo-1.)/(sedlo+1.e-10))
+ wsed(i,j)=max(0.,(sedlo-1.)/(abs(sedlo)+1.e-10))
endif
enddo !end i-loop
enddo !end j-loop
@@ -118,7 +120,7 @@ subroutine sedshi(kpie,kpje,omask)
& + calfa*sedlay(i,j,ks,isssc12) &
& + oplfa*sedlay(i,j,ks,issssil) &
& + clafa*sedlay(i,j,ks,issster)
- wsed(i,j)=max(0.,(sedlo-1.)/(sedlo+1.e-10))
+ wsed(i,j)=max(0.,(sedlo-1.)/(abs(sedlo)+1.e-10))
endif
enddo !end i-loop
enddo !end j-loop
@@ -130,9 +132,10 @@ subroutine sedshi(kpie,kpje,omask)
do i=1,kpie
if(omask(i,j).gt.0.5) then
!ka if(bolay(i,j).gt.0.) then
- uebers=wsed(i,j)*sedlay(i,j,k,iv)
+ uebers=wsed(i,j)*sedlay(i,j,ks,iv)
sedlay(i,j,ks ,iv)=sedlay(i,j,ks ,iv)-uebers
- burial(i,j,iv)=burial(i,j,iv)+uebers*seddw(k)*porsol(i,j,k)
+ burial(i,j,iv)=burial(i,j,iv)+uebers*seddw(ks)*porsol(i,j,ks)
+ sedfluxb(i,j,iv) = uebers*seddw(ks)*porsol(i,j,ks)
endif
enddo !end i-loop
enddo !end j-loop
@@ -180,8 +183,7 @@ subroutine sedshi(kpie,kpje,omask)
! shift the sediment deficiency from the deepest (burial)
! layer into layer ks
- !$OMP PARALLEL DO &
- !$OMP&PRIVATE(i,seddef,spresent,buried,refill,frac)
+ !$OMP PARALLEL DO PRIVATE(i,seddef,spresent,buried,refill,frac)
do j=1,kpje
do i=1,kpie
if(omask(i,j).gt.0.5) then
@@ -225,6 +227,12 @@ subroutine sedshi(kpie,kpje,omask)
sedlay(i,j,ks,isssc14)=sedlay(i,j,ks,isssc14)+refill*burial(i,j,isssc14)/frac
endif
+ ! account for refluxes to get net-burial fluxes for output:
+ sedfluxb(i,j,issso12) = sedfluxb(i,j,issso12) - refill*burial(i,j,issso12)
+ sedfluxb(i,j,isssc12) = sedfluxb(i,j,isssc12) - refill*burial(i,j,isssc12)
+ sedfluxb(i,j,issssil) = sedfluxb(i,j,issssil) - refill*burial(i,j,issssil)
+ sedfluxb(i,j,issster) = sedfluxb(i,j,issster) - refill*burial(i,j,issster)
+
! account for losses in buried sediment
burial(i,j,issso12) = burial(i,j,issso12)-refill*burial(i,j,issso12)
burial(i,j,isssc12) = burial(i,j,isssc12)-refill*burial(i,j,isssc12)
@@ -252,7 +260,7 @@ subroutine sedshi(kpie,kpje,omask)
& + calfa*sedlay(i,j,k,isssc12) &
& + oplfa*sedlay(i,j,k,issssil) &
& + clafa*sedlay(i,j,k,issster)
- wsed(i,j)=max(0.,(sedlo-1.)/(sedlo+1.e-10))
+ wsed(i,j)=max(0.,(sedlo-1.)/(abs(sedlo)+1.e-10))
endif
enddo !end i-loop
enddo !end j-loop
diff --git a/meson_options.txt b/meson_options.txt
index dbcd94f8..e44ad9d4 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -42,6 +42,8 @@ option('hamocc_ciso', type: 'boolean',
description: 'Enable carbon isotopes in HAMOCC', value: false)
option('hamocc_fb_bgc_oce', type: 'boolean',
description: 'Enable feedback of HAMOCC on ocean', value: false)
+option('hamocc_extNcycle', type: 'boolean',
+ description: 'Enable extended nitrogen cycle in HAMOCC', value: false)
#HAMOCC debugging options:
option('hamocc_debug_timestep', type: 'boolean',
description: 'Debug HAMOCC on timestep basis', value: false)
diff --git a/phy/mod_forcing.F90 b/phy/mod_forcing.F90
index f11f4b83..ef413053 100644
--- a/phy/mod_forcing.F90
+++ b/phy/mod_forcing.F90
@@ -134,7 +134,13 @@ module mod_forcing
flxco2, & ! Air-sea CO2 flux [kg m-2 s-1].
flxdms, & ! Sea-air DMS flux [kg m-2 s-1].
flxbrf, & ! sea-air bromoform flux
- atmbrf ! atmospheric bromoform concentration
+ atmbrf, & ! atmospheric bromoform concentration
+ flxn2o, & ! sea-air nitrous oxide flux [kg N2O m-2 s-1]
+ atmn2o, & ! atmospheric nitrous oxide concentration [pptv]
+ flxnh3, & ! sea-air ammonia flux [kg NH3 m-2 s-1]
+ atmnh3, & ! atmospheric ammonia concentration [pptv]
+ atmnhxdep,& ! atmospheric nhx deposition [kgN/m2/s]
+ atmnoydep ! atmospheric noy deposition [kgN/m2/s]
real(r8), dimension(1 - nbdy:idm + nbdy,1 - nbdy:jdm + nbdy) :: &
surflx, & ! Surface thermal energy flux [W cm-2].
@@ -170,6 +176,7 @@ module mod_forcing
swa, nsf, hmltfz, lip, sop, eva, rnf, rfi, fmltfz, sfl, ztx, mty, &
ustarw, slp, abswnd, lamult, lasl, ustokes, vstokes, &
atmco2, flxco2, flxdms, flxbrf, atmbrf, &
+ atmn2o,flxn2o,atmnh3,flxnh3, atmnhxdep,atmnoydep, &
surflx, surrlx, sswflx, salflx, brnflx, salrlx, taux, tauy, &
ustar, ustarb, ustar3, buoyfl, t_sw_nonloc, t_rs_nonloc, &
s_br_nonloc, s_rs_nonloc, inivar_forcing, fwbbal, &
@@ -213,6 +220,12 @@ subroutine inivar_forcing
flxdms(i, j) = spval
atmbrf(i, j) = spval
flxbrf(i, j) = spval
+ atmn2o(i, j) = -spval
+ flxn2o(i, j) = spval
+ atmnh3(i, j) = -spval
+ flxnh3(i, j) = spval
+ atmnhxdep(i, j) = spval
+ atmnoydep(i, j) = spval
surflx(i, j) = spval
surrlx(i, j) = spval
sswflx(i, j) = spval
@@ -267,6 +280,10 @@ subroutine inivar_forcing
flxco2(i, j) = 0._r8
flxdms(i, j) = 0._r8
flxbrf(i, j) = 0._r8
+ flxn2o(i, j) = 0._r8
+ flxnh3(i, j) = 0._r8
+ atmnhxdep(i, j) = 0._r8
+ atmnoydep(i, j) = 0._r8
ustar (i, j) = 0._r8
ustarb(i, j) = 0._r8
enddo
diff --git a/phy/mod_restart.F90 b/phy/mod_restart.F90
index c520d225..2d484426 100644
--- a/phy/mod_restart.F90
+++ b/phy/mod_restart.F90
@@ -40,6 +40,7 @@ module mod_restart
use mod_dia
use mod_forcing, only: ditflx, disflx, sprfac, tflxdi, sflxdi, nflxdi, &
prfac, eiacc, pracc, flxco2, flxdms, flxbrf, &
+ flxn2o,flxnh3, &
ustarb, buoyfl
use mod_niw, only: uml, vml, umlres, vmlres
use mod_difest, only: OBLdepth
@@ -48,7 +49,8 @@ module mod_restart
use mod_cesm, only: 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, &
- atmco2_da, atmbrf_da, ficem_da, l1ci, l2ci
+ atmco2_da, atmbrf_da, atmn2o_da, atmnh3_da, &
+ ficem_da, l1ci, l2ci
use mod_ben02, only: cd_d, ch_d, ce_d, wg2_d, cd_m, ch_m, ce_m, wg2_m, &
rhoa, tsi_tda, tml_tda, sml_tda, alb_tda, fice_tda, &
ntda, rnfres
@@ -61,7 +63,7 @@ module mod_restart
# endif
#endif
#ifdef HAMOCC
- use mo_control_bgc, only : use_BROMO
+ use mo_control_bgc, only : use_BROMO,use_extNcycle
#endif
implicit none
@@ -418,7 +420,11 @@ subroutine defwrtflds(defmode)
call defwrtfld('atmco2_da', trim(c5p)//' k2 time', &
atmco2_da, ip, defmode)
call defwrtfld('atmbrf_da', trim(c5p)//' k2 time', &
- atmbrf_da, ip, defmode) ! not read in restart_read, necesarry?
+ atmbrf_da, ip, defmode) ! not read in restart_read, necessary?
+ call defwrtfld('atmn2o_da', trim(c5p)//' k2 time', &
+ atmn2o_da, ip, defmode) ! not read in restart_read, necessary?
+ call defwrtfld('atmnh3_da', trim(c5p)//' k2 time', &
+ atmnh3_da, ip, defmode) ! not read in restart_read, necessary?
call defwrtfld('frzpot', trim(c5p)//' time', &
frzpot, ip, defmode)
call defwrtfld('mltpot', trim(c5p)//' time', &
@@ -432,6 +438,12 @@ subroutine defwrtflds(defmode)
call defwrtfld('flxbrf', trim(c5p)//' time', &
flxbrf, ip, defmode)
endif
+ if (use_extNcycle) then
+ call defwrtfld('flxn2o', trim(c5p)//' time', &
+ flxn2o, ip, defmode)
+ call defwrtfld('flxnh3', trim(c5p)//' time', &
+ flxnh3, ip, defmode)
+ endif
#endif
endif
@@ -1595,6 +1607,16 @@ subroutine restart_read
if (.not.fld_read .and. mnproc == 1) &
write(lp,*) 'restart_read: warning: bromoform flux is not read '// &
'from restart file and will be initialized to zero.'
+ call readfld('flxn2o', no_unitconv, flxn2o, ip, &
+ required = .false., fld_read = fld_read)
+ if (.not.fld_read .and. mnproc == 1) &
+ write(lp,*) 'restart_read: warning: N2O flux is not read '// &
+ 'from restart file and will be initialized to zero.'
+ call readfld('flxnh3', no_unitconv, flxnh3, ip, &
+ required = .false., fld_read = fld_read)
+ if (.not.fld_read .and. mnproc == 1) &
+ write(lp,*) 'restart_read: warning: NH3 flux is not read '// &
+ 'from restart file and will be initialized to zero.'
endif
#ifdef TRC
diff --git a/pkgs/M4AGO-sinking-scheme b/pkgs/M4AGO-sinking-scheme
new file mode 160000
index 00000000..99db47ff
--- /dev/null
+++ b/pkgs/M4AGO-sinking-scheme
@@ -0,0 +1 @@
+Subproject commit 99db47ff6328eb7e006257ae0bc9ed5cc588f711
diff --git a/pkgs/meson.build b/pkgs/meson.build
index 3b8fd0fa..ba95bea5 100644
--- a/pkgs/meson.build
+++ b/pkgs/meson.build
@@ -8,3 +8,9 @@ sources += files('CVMix-src/src/shared/cvmix_background.F90',
'CVMix-src/src/shared/cvmix_shear.F90',
'CVMix-src/src/shared/cvmix_tidal.F90',
'CVMix-src/src/shared/cvmix_utils.F90')
+
+if get_option('ecosys')
+ sources += files('M4AGO-sinking-scheme/src/mo_m4ago_core.f90',
+ 'M4AGO-sinking-scheme/src/mo_m4ago_physics.f90',
+ 'M4AGO-sinking-scheme/src/mo_ihamocc4m4ago.f90')
+endif