From 94759ff9f11dc1b0bdcb4663991a8d6ccbf77bf5 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Wed, 28 Feb 2024 19:35:40 +0000 Subject: [PATCH] build based on 97b27eb --- dev/.documenter-siteinfo.json | 2 +- dev/PALEOaqchem Reactions/index.html | 2 +- dev/PALEOaqchem functions/index.html | 2 +- dev/PALEOcarbchem/index.html | 12 ++++++------ dev/References/index.html | 2 +- dev/index.html | 2 +- dev/indexpage/index.html | 2 +- dev/paleoaqchem_references.bib | 9 +++++++++ dev/search_index.js | 2 +- 9 files changed, 22 insertions(+), 13 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 10706d9..483b471 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.6.7","generation_timestamp":"2024-02-18T15:15:50","documenter_version":"1.2.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.6.7","generation_timestamp":"2024-02-28T19:35:34","documenter_version":"1.2.1"}} \ No newline at end of file diff --git a/dev/PALEOaqchem Reactions/index.html b/dev/PALEOaqchem Reactions/index.html index 4cdaeb0..ef436b4 100644 --- a/dev/PALEOaqchem Reactions/index.html +++ b/dev/PALEOaqchem Reactions/index.html @@ -1,2 +1,2 @@ -PALEOaqchem Reactions · PALEOaqchem Documentation

PALEOaqchem Reactions

Particulate fluxes

PALEOaqchem.Particle.ReactionParticleDecayType
ReactionParticleDecay

Decay (eg organic matter to remineralization) at rate 1.0/decay_timescale of eg an organic matter dissolved/particulate phase in Reservoir Particle, to decayflux. Particle may have isotope_type. The Reservoir Particle may have the :vsink attribute set to represent a marine sinking particulate phase.

Parameters

  • decay_timescale[Float64]=0.5 (yr), default_value=0.5, description="particle decay timescale"
  • decay_threshold[Float64]=-Inf (mol m-3), default_value=-Inf, description="particle decay concentration below which decay stops"
  • field_data[DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable isotopes and specify isotope type"

Methods and Variables

  • do_particle_decay
    • Particle (mol), VT_ReactDependency, description="Particle amount"
    • Particle_sms (mol yr-1), VT_ReactContributor, description="Particle source-sink"
    • decayflux (mol yr-1), VT_ReactContributor, description="Particle decay flux"
source
PALEOaqchem.Particle.ReactionFluxToComponentsType
ReactionFluxToComponents

Distribute a single input_flux (eg an organic matter flux) to output_fluxnames components with stoichiometry output_fluxstoich. input_flux may have an isotope type (set by field_data) in which case the isotopic composition will be sent to (usually one) output_fluxname with ::Isotope suffix.

Parameters

  • outputflux_prefix[String]="", default_value="", description="Prefix for output flux names"
  • outputflux_names[Vector{String}]=["Corg", "N", "P"], default_value=["Corg", "N", "P"], description="Suffixes for output flux names. Use ::Isotope suffix to identify a flux with 'isotope_type'"
  • outputflux_stoich[Vector{Float64}]=[106.0, 16.0, 1.0], default_value=[106.0, 16.0, 1.0], description="Stoichiometry for output fluxes relative to input flux"
  • field_data[DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable isotopes and specify isotope type"

Methods and Variables for default Parameters

  • do_flux_to_components
    • inputflux (mol m-3), VT_ReactTarget, description="input flux"
    • [Corg] (mol yr-1), VT_ReactContributor, description="flux Corg"
    • [N] (mol yr-1), VT_ReactContributor, description="flux N"
    • [P] (mol yr-1), VT_ReactContributor, description="flux P"
source

Remin

PALEOaqchem.Remin.ReactionReminPonlyType
ReactionReminPonly

Organic particulate matter remineralization (no oxidant use)

Parameters

  • CIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable carbon isotopes and specify isotope type"

Methods and Variables for default Parameters

  • do_remin_Ponly
    • remin_P (mol yr-1), VT_ReactTarget, description="flux P"
    • remin_N (mol yr-1), VT_ReactTarget, description="flux N"
    • remin_Corg (mol yr-1), VT_ReactTarget, description="flux Corg"
    • remin_Ccarb (mol yr-1), VT_ReactTarget, description="flux Ccarb"
    • soluteflux_P (mol yr-1), VT_ReactContributor, description="flux P"
    • [soluteflux_TNH3] (mol yr-1), VT_ReactContributor, description="flux TNH3"
    • [soluteflux_DIC] (mol yr-1), VT_ReactContributor, description="flux DIC"
    • [soluteflux_TAlk] (mol yr-1), VT_ReactContributor, description="flux TAlk"
source
PALEOaqchem.Remin.ReactionReminO2Type
ReactionReminO2

Organic particulate matter remineralization (O2 oxidant only)

Parameters

  • CIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable carbon isotopes and specify isotope type"

Methods and Variables for default Parameters

  • do_remin_O2
    • remin_P (mol yr-1), VT_ReactTarget, description="flux P"
    • remin_N (mol yr-1), VT_ReactTarget, description="flux N"
    • remin_Corg (mol yr-1), VT_ReactTarget, description="flux Corg"
    • remin_Ccarb (mol yr-1), VT_ReactTarget, description="flux Ccarb"
    • soluteflux_P (mol yr-1), VT_ReactContributor, description="flux P"
    • [soluteflux_TNH3] (mol yr-1), VT_ReactContributor, description="flux TNH3"
    • [soluteflux_DIC] (mol yr-1), VT_ReactContributor, description="flux DIC"
    • [soluteflux_TAlk] (mol yr-1), VT_ReactContributor, description="flux TAlk"
    • reminOrgOxO2 (mol O2 yr-1), VT_ReactProperty, description="oxygen consumption (-ve) by remineralization"
  • RateStoich_reminOrgOxO2
    • reminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (-ve) by remineralization"
    • [soluteflux_O2] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxO2"
  • totals
    • reminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (-ve) by remineralization"
    • reminOrgOxO2_total (mol O2 yr-1), VT_ReactProperty, description="total oxygen consumption (-ve) by remineralization"
source
PALEOaqchem.Remin.ReactionReminO2_SO4Type
ReactionReminO2_SO4

Organic particulate matter remineralization (O2, SO4 oxidants)

Parameters

  • oxreminlimit[Float64]=0.008 (mol m-3), default_value=0.008, description="oxygen concentration below which use of O2 for remineralisation is inhibited"
  • CIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable carbon isotopes and specify isotope type"
  • SIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable sulphur isotopes and specify isotope type"

Methods and Variables for default Parameters

  • do_remin_O2_SO4
    • remin_P (mol yr-1), VT_ReactTarget, description="flux P"
    • remin_N (mol yr-1), VT_ReactTarget, description="flux N"
    • remin_Corg (mol yr-1), VT_ReactTarget, description="flux Corg"
    • remin_Ccarb (mol yr-1), VT_ReactTarget, description="flux Ccarb"
    • soluteflux_P (mol yr-1), VT_ReactContributor, description="flux P"
    • [soluteflux_TNH3] (mol yr-1), VT_ReactContributor, description="flux TNH3"
    • [soluteflux_DIC] (mol yr-1), VT_ReactContributor, description="flux DIC"
    • [soluteflux_TAlk] (mol yr-1), VT_ReactContributor, description="flux TAlk"
    • O2_conc (mol m-3), VT_ReactDependency, description="O2 concentration"
    • reminOrgOxO2 (mol O2 yr-1), VT_ReactProperty, description="oxygen consumption (-ve) by remineralization"
    • reminOrgOxSO4 (mol O2eq yr-1), VT_ReactProperty, description="2 * sulphate consumption (-ve) by remineralization"
  • RateStoich_reminOrgOxO2
    • reminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (-ve) by remineralization"
    • [soluteflux_O2] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxO2"
  • RateStoich_reminOrgOxSO4
    • reminOrgOxSO4 (mol O2eq yr-1), VT_ReactDependency, description="2 * sulphate consumption (-ve) by remineralization"
    • [soluteflux_SO4] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxSO4"
    • [soluteflux_H2S] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxSO4"
    • [soluteflux_TAlk] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxSO4"
  • totals
    • reminOrgOxSO4 (mol O2eq yr-1), VT_ReactDependency, description="2 * sulphate consumption (-ve) by remineralization"
    • reminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (-ve) by remineralization"
    • reminOrgOxSO4_total (mol O2eq yr-1), VT_ReactProperty, description="total 2 * sulphate consumption (-ve) by remineralization"
    • reminOrgOxO2_total (mol O2 yr-1), VT_ReactProperty, description="total oxygen consumption (-ve) by remineralization"
source
PALEOaqchem.Remin.ReactionReminO2_SO4_CH4Type
ReactionReminO2_SO4_CH4

Organic particulate matter remineralization (O2, SO4 oxidants, remaining Corg to CH4)

Parameters

  • oxreminlimit[Float64]=0.008 (mol m-3), default_value=0.008, description="oxygen concentration below which use of O2 for remineralisation is inhibited"
  • SO4reminlimit[Float64]=1.0 (mol m-3), default_value=1.0, description="sulphate concentration below which use of SO4 for remineralisation is inhibited"
  • CIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable carbon isotopes and specify isotope type"
  • SIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable sulphur isotopes and specify isotope type"

Methods and Variables for default Parameters

  • do_remin_O2_SO4_CH4
    • remin_P (mol yr-1), VT_ReactTarget, description="flux P"
    • remin_N (mol yr-1), VT_ReactTarget, description="flux N"
    • remin_Corg (mol yr-1), VT_ReactTarget, description="flux Corg"
    • remin_Ccarb (mol yr-1), VT_ReactTarget, description="flux Ccarb"
    • soluteflux_P (mol yr-1), VT_ReactContributor, description="flux P"
    • [soluteflux_TNH3] (mol yr-1), VT_ReactContributor, description="flux TNH3"
    • [soluteflux_DIC] (mol yr-1), VT_ReactContributor, description="flux DIC"
    • [soluteflux_TAlk] (mol yr-1), VT_ReactContributor, description="flux TAlk"
    • O2_conc (mol m-3), VT_ReactDependency, description="O2 concentration"
    • SO4_conc (mol m-3), VT_ReactDependency, description="SO4 concentration"
    • reminOrgOxO2 (mol O2 yr-1), VT_ReactProperty, description="oxygen consumption (-ve) by remineralization"
    • reminOrgOxSO4 (mol O2eq yr-1), VT_ReactProperty, description="2 * sulphate consumption (-ve) by remineralization"
    • reminOrgOxCH4 (mol O2eq yr-1), VT_ReactProperty, description="2 * DIC -> methane (-ve) by remineralization"
  • RateStoich_reminOrgOxO2
    • reminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (-ve) by remineralization"
    • [soluteflux_O2] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxO2"
  • RateStoich_reminOrgOxSO4
    • reminOrgOxSO4 (mol O2eq yr-1), VT_ReactDependency, description="2 * sulphate consumption (-ve) by remineralization"
    • [soluteflux_SO4] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxSO4"
    • [soluteflux_H2S] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxSO4"
    • [soluteflux_TAlk] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxSO4"
  • RateStoich_reminOrgOxCH4
    • reminOrgOxCH4 (mol O2eq yr-1), VT_ReactDependency, description="2 * DIC -> methane (-ve) by remineralization"
    • [soluteflux_DIC] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxCH4"
    • [soluteflux_CH4] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxCH4"
  • totals
    • reminOrgOxSO4 (mol O2eq yr-1), VT_ReactDependency, description="2 * sulphate consumption (-ve) by remineralization"
    • reminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (-ve) by remineralization"
    • reminOrgOxCH4 (mol O2eq yr-1), VT_ReactDependency, description="2 * DIC -> methane (-ve) by remineralization"
    • reminOrgOxSO4_total (mol O2eq yr-1), VT_ReactProperty, description="total 2 * sulphate consumption (-ve) by remineralization"
    • reminOrgOxO2_total (mol O2 yr-1), VT_ReactProperty, description="total oxygen consumption (-ve) by remineralization"
    • reminOrgOxCH4_total (mol O2eq yr-1), VT_ReactProperty, description="total 2 * DIC -> methane (-ve) by remineralization"
source

Secondary redox

PALEOaqchem.SecondaryRedox.ReactionRedoxH2S_O2Type
ReactionRedoxH2S_O2

Sulphide oxidation by oxygen.

Rate R_H2S_O2UnitsRefNotes
1.6e5(mol l-1)-1 yr-1(Van Cappellen and Wang, 1996)
3.65e6(mol l-1)-1 yr-1(Ozaki et al., 2011)
54e6(mol l-1)-1 yr-1(Romaniello and Derry, 2010)

Parameters

  • R_H2S_O2[Float64]=3650.0 ((mol m-3)-1 yr-1), default_value=3650.0, description="rate constant"
  • SIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable sulphur isotopes and specify isotope type"

Methods and Variables for default Parameters

  • do_redox_H2S_O2
    • redox_H2S_O2 (mol O2 yr-1), VT_ReactProperty, description="oxygen consumption (+ve) by H2S oxidation"
    • O2_conc (mol m-3), VT_ReactDependency, description="O2 concentration"
    • H2S_conc (mol m-3), VT_ReactDependency, description="H2S concentration"
    • volume (m3), VT_ReactDependency, description="box fluid volume"
  • RateStoich_redox_H2S_O2
    • redox_H2S_O2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (+ve) by H2S oxidation"
    • [O2_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_H2S_O2"
    • [H2S_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_H2S_O2"
    • [SO4_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_H2S_O2"
    • [TAlk_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_H2S_O2"
  • totals
    • redox_H2S_O2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (+ve) by H2S oxidation"
    • redox_H2S_O2_total (mol O2 yr-1), VT_ReactProperty, description="total oxygen consumption (+ve) by H2S oxidation"
source
PALEOaqchem.SecondaryRedox.ReactionRedoxCH4_O2Type
ReactionRedoxCH4_O2

Methane oxidation by oxygen.

Rate R_CH4_O2UnitsRefNotes
1e10(mol l-1)-1 yr-1(Van Cappellen and Wang, 1996)
10e6(mol l-1)-1 yr-1TODO

Parameters

  • R_CH4_O2[Float64]=10000.0 ((mol m-3)-1 yr-1), default_value=10000.0, description="rate constant"
  • CIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable carbon isotopes and specify isotope type"

Methods and Variables for default Parameters

  • do_redox_CH4_O2
    • redox_CH4_O2 (mol O2 yr-1), VT_ReactProperty, description="oxygen consumption (+ve) by CH4 oxidation"
    • O2_conc (mol m-3), VT_ReactDependency, description="O2 concentration"
    • CH4_conc (mol m-3), VT_ReactDependency, description="CH4 concentration"
    • volume (m3), VT_ReactDependency, description="box fluid volume"
  • RateStoich_redox_CH4_O2
    • redox_CH4_O2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (+ve) by CH4 oxidation"
    • [O2_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_CH4_O2"
    • [CH4_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_CH4_O2"
    • [DIC_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_CH4_O2"
  • totals
    • redox_CH4_O2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (+ve) by CH4 oxidation"
    • redox_CH4_O2_total (mol O2 yr-1), VT_ReactProperty, description="total oxygen consumption (+ve) by CH4 oxidation"
source
PALEOaqchem.SecondaryRedox.ReactionRedoxCH4_SO4Type
ReactionRedoxCH4_SO4

Methane oxidation by sulphate (anaerobic methane oxidation).

Rate R_CH4_SO4UnitsRefNotes
1e4(mol l-1)-1 yr-1(Van Cappellen and Wang, 1996)k17

Parameters

  • R_CH4_SO4[Float64]=10.0 ((mol m-3)-1 yr-1), default_value=10.0, description="rate constant"
  • CIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable carbon isotopes and specify isotope type"

Methods and Variables for default Parameters

  • do_redox_CH4_SO4
    • redox_CH4_SO4 (mol CH4/SO4 yr-1), VT_ReactProperty, description="sulphate consumption (+ve) by CH4 oxidation"
    • SO4_conc (mol m-3), VT_ReactDependency, description="SO4 concentration"
    • CH4_conc (mol m-3), VT_ReactDependency, description="CH4 concentration"
    • volume (m3), VT_ReactDependency, description="box fluid volume"
  • RateStoich_redox_CH4_SO4
    • redox_CH4_SO4 (mol CH4/SO4 yr-1), VT_ReactDependency, description="sulphate consumption (+ve) by CH4 oxidation"
    • [SO4_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_CH4_SO4"
    • [CH4_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_CH4_SO4"
    • [DIC_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_CH4_SO4"
    • [H2S_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_CH4_SO4"
    • [TAlk_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_CH4_SO4"
  • totals
    • redox_CH4_SO4 (mol CH4/SO4 yr-1), VT_ReactDependency, description="sulphate consumption (+ve) by CH4 oxidation"
    • redox_CH4_SO4_total (mol CH4/SO4 yr-1), VT_ReactProperty, description="total sulphate consumption (+ve) by CH4 oxidation"
source

Carbonate chemistry

PALEOaqchem.CarbChem.ReactionCO2SYSType
ReactionCO2SYS

Carbonate chemistry using PALEOcarbchem.

Three different pH solver approaches are supported, set by Parameter solve_pH:

  • solve: iterative solution for pH, TAlk is a StateExplicit Variable (eg using explicit ODE solver)
  • constraint: additional State Variable for pH and algebraic Constraint for TAlk (requires DAE solver).
  • implicit: TAlk is a Total Variable, a function of a State Variable for pH (requires DAE solver)

Parameters

  • WhichKs[Int64]=10, default_value=10, description="PALEOcarbchem WhichKs choice of eqb constant data"
  • WhoseKSO4[Int64]=1, default_value=1, description="PALEOcarbchem WhoseKSO4 choice of eqb constant data"
  • components[Vector{String}]=["Ci", "S", "F", "B", "Omega"], default_value=["Ci", "S", "F", "B", "Omega"], allowed_values=["Ci", "S", "F", "P", "B", "Si", "H2S", "NH3", "Omega"], description="PALEOcarbchem optional contributions to TAlk"
  • defaultconcs[Vector{String}]=["TS", "TF", "TB", "Ca"], default_value=["TS", "TF", "TB", "Ca"], allowed_values=["TS", "TF", "TB", "Ca"], description="PALEOcarbchem default concentrations (modern values calculated from salinity)"
  • outputs[Vector{String}]=["pCO2", "xCO2dryinp"], default_value=["pCO2", "xCO2dryinp"], description="PALEOcarbchem output concentrations etc to include as output variables"
  • output_pHtot[Bool]=true, default_value=true, description="true to output pHtot (requires TS_conc and TF_conc)"
  • solve_pH[String]="solve", default_value="solve", allowed_values=["solve", "constraint", "implicit"], description="'solve' to solve iteratively for pH, 'constraint' to include [pHfree] as a state variable and TAlk as a constraint, 'implicit' to include [pHfree] as a state variable and TAlk an implicit variable"
  • pHtol[Float64]=2.220446049250313e-14, default_value=2.220446049250313e-14, description="pH tolerance for iterative solution"
  • simd_width[String]="1", default_value="1", allowed_values=["1", "FP64P2", "FP64P4", "FP32P4", "FP32P8"], description="use SIMD ("1" - no SIMD, "FP64P4" - 4 x Float64, etc)"

Methods and Variables for default Parameters

  • do_modern_default_concs
    • volume (m^3), VT_ReactDependency, description="Cell volume"
    • rho_ref (kg m^-3), VT_ReactDependency, description="density conversion factor"
    • temp (Kelvin), VT_ReactDependency, description="temperature"
    • pressure (dbar), VT_ReactDependency, description="pressure"
    • sal (psu), VT_ReactDependency, description="salinity"
    • TS_conc (mol m^-3), VT_ReactProperty, description="TS_conc modern default scaled from salinity"
    • TF_conc (mol m^-3), VT_ReactProperty, description="TF_conc modern default scaled from salinity"
    • TB_conc (mol m^-3), VT_ReactProperty, description="TB_conc modern default scaled from salinity"
    • Ca_conc (mol m^-3), VT_ReactProperty, description="Ca_conc modern default scaled from salinity"
  • do_carbchem
    • volume (m^3), VT_ReactDependency, description="Cell volume"
    • rho_ref (kg m^-3), VT_ReactDependency, description="density conversion factor"
    • temp (Kelvin), VT_ReactDependency, description="temperature"
    • pressure (dbar), VT_ReactDependency, description="pressure"
    • sal (psu), VT_ReactDependency, description="salinity"
    • pHfree (), VT_ReactProperty, description="-log10(hydrogen ion concentration)"
    • TAlk_conc (mol m^-3), VT_ReactDependency, description="total TAlk concentration"
    • pHtot (), VT_ReactProperty, description="-log10([H] + [HS]), pH on total scale"
    • TCi_conc (mol m^-3), VT_ReactDependency, description="TCi_concinput concentration"
    • TS_conc (mol m^-3), VT_ReactDependency, description="TS_concinput concentration"
    • TF_conc (mol m^-3), VT_ReactDependency, description="TF_concinput concentration"
    • TB_conc (mol m^-3), VT_ReactDependency, description="TB_concinput concentration"
    • Ca_conc (mol m^-3), VT_ReactDependency, description="Ca_concinput concentration"
    • pCO2 –> %reaction%pCO2 (atm), VT_ReactProperty, description="CO2 partial pressure"
    • xCO2dryinp –> %reaction%xCO2dryinp (), VT_ReactProperty, description="mixing ratio of CO2 in dry air at 1 atm (always > pCO2 due to H2O vapour pressure)"
source

Isotope systems

Boron

PALEOaqchem.Boron.ReactionBoronIsotopeType
ReactionBoronIsotope

Calculate d11B for aqueous B(OH)4- and B(OH)3 species from mass balance, given d11B for total B, total B concentration B_conc and B(OH)4- concentration BOH4_conc.

See eg (Zeebe and Wolf-Gladrow, 2001), p220.

Parameters

  • alphaB[Float64]=1.0272, default_value=1.0272, description="isotopic fractionation factor B(OH)4m <-> B(OH)3"
  • BIsotope[external, UnionAll]=PALEOboxes.IsotopeLinear, default_value=PALEOboxes.IsotopeLinear, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable boron isotopes and specify isotope type"

Methods and Variables

  • do_boron_isotope
    • B_conc (mol m-3), VT_ReactDependency, description="B concentration"
    • BOH4_conc (mol m-3), VT_ReactDependency, description="B(OH)4m concentration"
    • B_delta (per mil), VT_ReactDependency, description="d11B delta for total B"
    • BOH4_delta (per mil), VT_ReactProperty, description="d11B delta for B(OH)4- species"
source
+PALEOaqchem Reactions · PALEOaqchem Documentation

PALEOaqchem Reactions

Particulate fluxes

PALEOaqchem.Particle.ReactionParticleDecayType
ReactionParticleDecay

Decay (eg organic matter to remineralization) at rate 1.0/decay_timescale of eg an organic matter dissolved/particulate phase in Reservoir Particle, to decayflux. Particle may have isotope_type. The Reservoir Particle may have the :vsink attribute set to represent a marine sinking particulate phase.

Parameters

  • decay_timescale[Float64]=0.5 (yr), default_value=0.5, description="particle decay timescale"
  • decay_threshold[Float64]=-Inf (mol m-3), default_value=-Inf, description="particle decay concentration below which decay stops"
  • field_data[DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable isotopes and specify isotope type"

Methods and Variables

  • do_particle_decay
    • Particle (mol), VT_ReactDependency, description="Particle amount"
    • Particle_sms (mol yr-1), VT_ReactContributor, description="Particle source-sink"
    • decayflux (mol yr-1), VT_ReactContributor, description="Particle decay flux"
source
PALEOaqchem.Particle.ReactionFluxToComponentsType
ReactionFluxToComponents

Distribute a single input_flux (eg an organic matter flux) to output_fluxnames components with stoichiometry output_fluxstoich. input_flux may have an isotope type (set by field_data) in which case the isotopic composition will be sent to (usually one) output_fluxname with ::Isotope suffix.

Parameters

  • outputflux_prefix[String]="", default_value="", description="Prefix for output flux names"
  • outputflux_names[Vector{String}]=["Corg", "N", "P"], default_value=["Corg", "N", "P"], description="Suffixes for output flux names. Use ::Isotope suffix to identify a flux with 'isotope_type'"
  • outputflux_stoich[Vector{Float64}]=[106.0, 16.0, 1.0], default_value=[106.0, 16.0, 1.0], description="Stoichiometry for output fluxes relative to input flux"
  • field_data[DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable isotopes and specify isotope type"

Methods and Variables for default Parameters

  • do_flux_to_components
    • inputflux (mol m-3), VT_ReactTarget, description="input flux"
    • [Corg] (mol yr-1), VT_ReactContributor, description="flux Corg"
    • [N] (mol yr-1), VT_ReactContributor, description="flux N"
    • [P] (mol yr-1), VT_ReactContributor, description="flux P"
source

Remin

PALEOaqchem.Remin.ReactionReminPonlyType
ReactionReminPonly

Organic particulate matter remineralization (no oxidant use)

Parameters

  • CIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable carbon isotopes and specify isotope type"

Methods and Variables for default Parameters

  • do_remin_Ponly
    • remin_P (mol yr-1), VT_ReactTarget, description="flux P"
    • remin_N (mol yr-1), VT_ReactTarget, description="flux N"
    • remin_Corg (mol yr-1), VT_ReactTarget, description="flux Corg"
    • remin_Ccarb (mol yr-1), VT_ReactTarget, description="flux Ccarb"
    • soluteflux_P (mol yr-1), VT_ReactContributor, description="flux P"
    • [soluteflux_TNH3] (mol yr-1), VT_ReactContributor, description="flux TNH3"
    • [soluteflux_DIC] (mol yr-1), VT_ReactContributor, description="flux DIC"
    • [soluteflux_TAlk] (mol yr-1), VT_ReactContributor, description="flux TAlk"
source
PALEOaqchem.Remin.ReactionReminO2Type
ReactionReminO2

Organic particulate matter remineralization (O2 oxidant only)

Parameters

  • CIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable carbon isotopes and specify isotope type"

Methods and Variables for default Parameters

  • do_remin_O2
    • remin_P (mol yr-1), VT_ReactTarget, description="flux P"
    • remin_N (mol yr-1), VT_ReactTarget, description="flux N"
    • remin_Corg (mol yr-1), VT_ReactTarget, description="flux Corg"
    • remin_Ccarb (mol yr-1), VT_ReactTarget, description="flux Ccarb"
    • soluteflux_P (mol yr-1), VT_ReactContributor, description="flux P"
    • [soluteflux_TNH3] (mol yr-1), VT_ReactContributor, description="flux TNH3"
    • [soluteflux_DIC] (mol yr-1), VT_ReactContributor, description="flux DIC"
    • [soluteflux_TAlk] (mol yr-1), VT_ReactContributor, description="flux TAlk"
    • reminOrgOxO2 (mol O2 yr-1), VT_ReactProperty, description="oxygen consumption (-ve) by remineralization"
  • RateStoich_reminOrgOxO2
    • reminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (-ve) by remineralization"
    • [soluteflux_O2] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxO2"
  • totals
    • reminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (-ve) by remineralization"
    • reminOrgOxO2_total (mol O2 yr-1), VT_ReactProperty, description="total oxygen consumption (-ve) by remineralization"
source
PALEOaqchem.Remin.ReactionReminO2_SO4Type
ReactionReminO2_SO4

Organic particulate matter remineralization (O2, SO4 oxidants)

Parameters

  • oxreminlimit[Float64]=0.008 (mol m-3), default_value=0.008, description="oxygen concentration below which use of O2 for remineralisation is inhibited"
  • CIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable carbon isotopes and specify isotope type"
  • SIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable sulphur isotopes and specify isotope type"

Methods and Variables for default Parameters

  • do_remin_O2_SO4
    • remin_P (mol yr-1), VT_ReactTarget, description="flux P"
    • remin_N (mol yr-1), VT_ReactTarget, description="flux N"
    • remin_Corg (mol yr-1), VT_ReactTarget, description="flux Corg"
    • remin_Ccarb (mol yr-1), VT_ReactTarget, description="flux Ccarb"
    • soluteflux_P (mol yr-1), VT_ReactContributor, description="flux P"
    • [soluteflux_TNH3] (mol yr-1), VT_ReactContributor, description="flux TNH3"
    • [soluteflux_DIC] (mol yr-1), VT_ReactContributor, description="flux DIC"
    • [soluteflux_TAlk] (mol yr-1), VT_ReactContributor, description="flux TAlk"
    • O2_conc (mol m-3), VT_ReactDependency, description="O2 concentration"
    • reminOrgOxO2 (mol O2 yr-1), VT_ReactProperty, description="oxygen consumption (-ve) by remineralization"
    • reminOrgOxSO4 (mol O2eq yr-1), VT_ReactProperty, description="2 * sulphate consumption (-ve) by remineralization"
  • RateStoich_reminOrgOxO2
    • reminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (-ve) by remineralization"
    • [soluteflux_O2] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxO2"
  • RateStoich_reminOrgOxSO4
    • reminOrgOxSO4 (mol O2eq yr-1), VT_ReactDependency, description="2 * sulphate consumption (-ve) by remineralization"
    • [soluteflux_SO4] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxSO4"
    • [soluteflux_H2S] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxSO4"
    • [soluteflux_TAlk] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxSO4"
  • totals
    • reminOrgOxSO4 (mol O2eq yr-1), VT_ReactDependency, description="2 * sulphate consumption (-ve) by remineralization"
    • reminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (-ve) by remineralization"
    • reminOrgOxSO4_total (mol O2eq yr-1), VT_ReactProperty, description="total 2 * sulphate consumption (-ve) by remineralization"
    • reminOrgOxO2_total (mol O2 yr-1), VT_ReactProperty, description="total oxygen consumption (-ve) by remineralization"
source
PALEOaqchem.Remin.ReactionReminO2_SO4_CH4Type
ReactionReminO2_SO4_CH4

Organic particulate matter remineralization (O2, SO4 oxidants, remaining Corg to CH4)

Parameters

  • oxreminlimit[Float64]=0.008 (mol m-3), default_value=0.008, description="oxygen concentration below which use of O2 for remineralisation is inhibited"
  • SO4reminlimit[Float64]=1.0 (mol m-3), default_value=1.0, description="sulphate concentration below which use of SO4 for remineralisation is inhibited"
  • CIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable carbon isotopes and specify isotope type"
  • SIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable sulphur isotopes and specify isotope type"

Methods and Variables for default Parameters

  • do_remin_O2_SO4_CH4
    • remin_P (mol yr-1), VT_ReactTarget, description="flux P"
    • remin_N (mol yr-1), VT_ReactTarget, description="flux N"
    • remin_Corg (mol yr-1), VT_ReactTarget, description="flux Corg"
    • remin_Ccarb (mol yr-1), VT_ReactTarget, description="flux Ccarb"
    • soluteflux_P (mol yr-1), VT_ReactContributor, description="flux P"
    • [soluteflux_TNH3] (mol yr-1), VT_ReactContributor, description="flux TNH3"
    • [soluteflux_DIC] (mol yr-1), VT_ReactContributor, description="flux DIC"
    • [soluteflux_TAlk] (mol yr-1), VT_ReactContributor, description="flux TAlk"
    • O2_conc (mol m-3), VT_ReactDependency, description="O2 concentration"
    • SO4_conc (mol m-3), VT_ReactDependency, description="SO4 concentration"
    • reminOrgOxO2 (mol O2 yr-1), VT_ReactProperty, description="oxygen consumption (-ve) by remineralization"
    • reminOrgOxSO4 (mol O2eq yr-1), VT_ReactProperty, description="2 * sulphate consumption (-ve) by remineralization"
    • reminOrgOxCH4 (mol O2eq yr-1), VT_ReactProperty, description="2 * DIC -> methane (-ve) by remineralization"
  • RateStoich_reminOrgOxO2
    • reminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (-ve) by remineralization"
    • [soluteflux_O2] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxO2"
  • RateStoich_reminOrgOxSO4
    • reminOrgOxSO4 (mol O2eq yr-1), VT_ReactDependency, description="2 * sulphate consumption (-ve) by remineralization"
    • [soluteflux_SO4] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxSO4"
    • [soluteflux_H2S] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxSO4"
    • [soluteflux_TAlk] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxSO4"
  • RateStoich_reminOrgOxCH4
    • reminOrgOxCH4 (mol O2eq yr-1), VT_ReactDependency, description="2 * DIC -> methane (-ve) by remineralization"
    • [soluteflux_DIC] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxCH4"
    • [soluteflux_CH4] (), VT_ReactContributor, description="generated by RateStoich rate=reminOrgOxCH4"
  • totals
    • reminOrgOxSO4 (mol O2eq yr-1), VT_ReactDependency, description="2 * sulphate consumption (-ve) by remineralization"
    • reminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (-ve) by remineralization"
    • reminOrgOxCH4 (mol O2eq yr-1), VT_ReactDependency, description="2 * DIC -> methane (-ve) by remineralization"
    • reminOrgOxSO4_total (mol O2eq yr-1), VT_ReactProperty, description="total 2 * sulphate consumption (-ve) by remineralization"
    • reminOrgOxO2_total (mol O2 yr-1), VT_ReactProperty, description="total oxygen consumption (-ve) by remineralization"
    • reminOrgOxCH4_total (mol O2eq yr-1), VT_ReactProperty, description="total 2 * DIC -> methane (-ve) by remineralization"
source

Secondary redox

PALEOaqchem.SecondaryRedox.ReactionRedoxH2S_O2Type
ReactionRedoxH2S_O2

Sulphide oxidation by oxygen.

Rate R_H2S_O2UnitsRefNotes
1.6e5(mol l-1)-1 yr-1(Van Cappellen and Wang, 1996)
3.65e6(mol l-1)-1 yr-1(Ozaki et al., 2011)
54e6(mol l-1)-1 yr-1(Romaniello and Derry, 2010)

Parameters

  • R_H2S_O2[Float64]=3650.0 ((mol m-3)-1 yr-1), default_value=3650.0, description="rate constant"
  • SIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable sulphur isotopes and specify isotope type"

Methods and Variables for default Parameters

  • do_redox_H2S_O2
    • redox_H2S_O2 (mol O2 yr-1), VT_ReactProperty, description="oxygen consumption (+ve) by H2S oxidation"
    • O2_conc (mol m-3), VT_ReactDependency, description="O2 concentration"
    • H2S_conc (mol m-3), VT_ReactDependency, description="H2S concentration"
    • volume (m3), VT_ReactDependency, description="box fluid volume"
  • RateStoich_redox_H2S_O2
    • redox_H2S_O2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (+ve) by H2S oxidation"
    • [O2_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_H2S_O2"
    • [H2S_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_H2S_O2"
    • [SO4_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_H2S_O2"
    • [TAlk_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_H2S_O2"
  • totals
    • redox_H2S_O2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (+ve) by H2S oxidation"
    • redox_H2S_O2_total (mol O2 yr-1), VT_ReactProperty, description="total oxygen consumption (+ve) by H2S oxidation"
source
PALEOaqchem.SecondaryRedox.ReactionRedoxCH4_O2Type
ReactionRedoxCH4_O2

Methane oxidation by oxygen.

Rate R_CH4_O2UnitsRefNotes
1e10(mol l-1)-1 yr-1(Van Cappellen and Wang, 1996)
10e6(mol l-1)-1 yr-1TODO

Parameters

  • R_CH4_O2[Float64]=10000.0 ((mol m-3)-1 yr-1), default_value=10000.0, description="rate constant"
  • CIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable carbon isotopes and specify isotope type"

Methods and Variables for default Parameters

  • do_redox_CH4_O2
    • redox_CH4_O2 (mol O2 yr-1), VT_ReactProperty, description="oxygen consumption (+ve) by CH4 oxidation"
    • O2_conc (mol m-3), VT_ReactDependency, description="O2 concentration"
    • CH4_conc (mol m-3), VT_ReactDependency, description="CH4 concentration"
    • volume (m3), VT_ReactDependency, description="box fluid volume"
  • RateStoich_redox_CH4_O2
    • redox_CH4_O2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (+ve) by CH4 oxidation"
    • [O2_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_CH4_O2"
    • [CH4_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_CH4_O2"
    • [DIC_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_CH4_O2"
  • totals
    • redox_CH4_O2 (mol O2 yr-1), VT_ReactDependency, description="oxygen consumption (+ve) by CH4 oxidation"
    • redox_CH4_O2_total (mol O2 yr-1), VT_ReactProperty, description="total oxygen consumption (+ve) by CH4 oxidation"
source
PALEOaqchem.SecondaryRedox.ReactionRedoxCH4_SO4Type
ReactionRedoxCH4_SO4

Methane oxidation by sulphate (anaerobic methane oxidation).

Rate R_CH4_SO4UnitsRefNotes
1e4(mol l-1)-1 yr-1(Van Cappellen and Wang, 1996)k17

Parameters

  • R_CH4_SO4[Float64]=10.0 ((mol m-3)-1 yr-1), default_value=10.0, description="rate constant"
  • CIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable carbon isotopes and specify isotope type"

Methods and Variables for default Parameters

  • do_redox_CH4_SO4
    • redox_CH4_SO4 (mol CH4/SO4 yr-1), VT_ReactProperty, description="sulphate consumption (+ve) by CH4 oxidation"
    • SO4_conc (mol m-3), VT_ReactDependency, description="SO4 concentration"
    • CH4_conc (mol m-3), VT_ReactDependency, description="CH4 concentration"
    • volume (m3), VT_ReactDependency, description="box fluid volume"
  • RateStoich_redox_CH4_SO4
    • redox_CH4_SO4 (mol CH4/SO4 yr-1), VT_ReactDependency, description="sulphate consumption (+ve) by CH4 oxidation"
    • [SO4_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_CH4_SO4"
    • [CH4_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_CH4_SO4"
    • [DIC_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_CH4_SO4"
    • [H2S_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_CH4_SO4"
    • [TAlk_sms] (), VT_ReactContributor, description="generated by RateStoich rate=redox_CH4_SO4"
  • totals
    • redox_CH4_SO4 (mol CH4/SO4 yr-1), VT_ReactDependency, description="sulphate consumption (+ve) by CH4 oxidation"
    • redox_CH4_SO4_total (mol CH4/SO4 yr-1), VT_ReactProperty, description="total sulphate consumption (+ve) by CH4 oxidation"
source

Carbonate chemistry

PALEOaqchem.CarbChem.ReactionCO2SYSType
ReactionCO2SYS

Carbonate chemistry using PALEOcarbchem.

Three different pH solver approaches are supported, set by Parameter solve_pH:

  • solve: iterative solution for pH, TAlk is a StateExplicit Variable (eg using explicit ODE solver)
  • constraint: additional State Variable for pH and algebraic Constraint for TAlk (requires DAE solver).
  • implicit: TAlk is a Total Variable, a function of a State Variable for pH (requires DAE solver)

Parameters

  • WhichKs[Int64]=10, default_value=10, description="PALEOcarbchem WhichKs choice of eqb constant data"
  • WhoseKSO4[Int64]=1, default_value=1, description="PALEOcarbchem WhoseKSO4 choice of eqb constant data"
  • components[Vector{String}]=["Ci", "S", "F", "B", "Omega"], default_value=["Ci", "S", "F", "B", "Omega"], allowed_values=["Ci", "S", "F", "P", "B", "Si", "H2S", "NH3", "Omega"], description="PALEOcarbchem optional contributions to TAlk"
  • defaultconcs[Vector{String}]=["TS", "TF", "TB", "Ca"], default_value=["TS", "TF", "TB", "Ca"], allowed_values=["TS", "TF", "TB", "Ca"], description="PALEOcarbchem default concentrations (modern values calculated from salinity)"
  • outputs[Vector{String}]=["pCO2", "xCO2dryinp"], default_value=["pCO2", "xCO2dryinp"], description="PALEOcarbchem output concentrations etc to include as output variables"
  • output_pHtot[Bool]=true, default_value=true, description="true to output pHtot (requires TS_conc and TF_conc)"
  • solve_pH[String]="solve", default_value="solve", allowed_values=["solve", "constraint", "implicit"], description="'solve' to solve iteratively for pH, 'constraint' to include [pHfree] as a state variable and TAlk as a constraint, 'implicit' to include [pHfree] as a state variable and TAlk an implicit variable"
  • pHtol[Float64]=2.220446049250313e-14, default_value=2.220446049250313e-14, description="pH tolerance for iterative solution"
  • simd_width[String]="1", default_value="1", allowed_values=["1", "FP64P2", "FP64P4", "FP32P4", "FP32P8"], description="use SIMD ("1" - no SIMD, "FP64P4" - 4 x Float64, etc)"

Methods and Variables for default Parameters

  • do_modern_default_concs
    • volume (m^3), VT_ReactDependency, description="Cell volume"
    • rho_ref (kg m^-3), VT_ReactDependency, description="density conversion factor"
    • temp (Kelvin), VT_ReactDependency, description="temperature"
    • pressure (dbar), VT_ReactDependency, description="pressure"
    • sal (psu), VT_ReactDependency, description="salinity"
    • TS_conc (mol m^-3), VT_ReactProperty, description="TS_conc modern default scaled from salinity"
    • TF_conc (mol m^-3), VT_ReactProperty, description="TF_conc modern default scaled from salinity"
    • TB_conc (mol m^-3), VT_ReactProperty, description="TB_conc modern default scaled from salinity"
    • Ca_conc (mol m^-3), VT_ReactProperty, description="Ca_conc modern default scaled from salinity"
  • do_carbchem
    • volume (m^3), VT_ReactDependency, description="Cell volume"
    • rho_ref (kg m^-3), VT_ReactDependency, description="density conversion factor"
    • temp (Kelvin), VT_ReactDependency, description="temperature"
    • pressure (dbar), VT_ReactDependency, description="pressure"
    • sal (psu), VT_ReactDependency, description="salinity"
    • pHfree (), VT_ReactProperty, description="-log10(hydrogen ion concentration)"
    • TAlk_conc (mol m^-3), VT_ReactDependency, description="total TAlk concentration"
    • pHtot (), VT_ReactProperty, description="-log10([H] + [HS]), pH on total scale"
    • TCi_conc (mol m^-3), VT_ReactDependency, description="TCi_concinput concentration"
    • TS_conc (mol m^-3), VT_ReactDependency, description="TS_concinput concentration"
    • TF_conc (mol m^-3), VT_ReactDependency, description="TF_concinput concentration"
    • TB_conc (mol m^-3), VT_ReactDependency, description="TB_concinput concentration"
    • Ca_conc (mol m^-3), VT_ReactDependency, description="Ca_concinput concentration"
    • pCO2 –> %reaction%pCO2 (atm), VT_ReactProperty, description="CO2 partial pressure"
    • xCO2dryinp –> %reaction%xCO2dryinp (), VT_ReactProperty, description="mixing ratio of CO2 in dry air at 1 atm (always > pCO2 due to H2O vapour pressure)"
source

Isotope systems

Boron

PALEOaqchem.Boron.ReactionBoronIsotopeType
ReactionBoronIsotope

Calculate d11B for aqueous B(OH)4- and B(OH)3 species from mass balance, given d11B for total B, total B concentration B_conc and B(OH)4- concentration BOH4_conc.

See eg (Zeebe and Wolf-Gladrow, 2001), p220.

Parameters

  • alphaB[Float64]=1.0272, default_value=1.0272, description="isotopic fractionation factor B(OH)4m <-> B(OH)3"
  • BIsotope[external, UnionAll]=PALEOboxes.IsotopeLinear, default_value=PALEOboxes.IsotopeLinear, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description="disable / enable boron isotopes and specify isotope type"

Methods and Variables

  • do_boron_isotope
    • B_conc (mol m-3), VT_ReactDependency, description="B concentration"
    • BOH4_conc (mol m-3), VT_ReactDependency, description="B(OH)4m concentration"
    • B_delta (per mil), VT_ReactDependency, description="d11B delta for total B"
    • BOH4_delta (per mil), VT_ReactProperty, description="d11B delta for B(OH)4- species"
source
diff --git a/dev/PALEOaqchem functions/index.html b/dev/PALEOaqchem functions/index.html index d093b32..ddb6e93 100644 --- a/dev/PALEOaqchem functions/index.html +++ b/dev/PALEOaqchem functions/index.html @@ -6,4 +6,4 @@ (-138.0, -16.0) julia> PALEOaqchem.O2AlkUptakeRemin(106.0, (0.0, 16.0, 0.0), 1.0, 0.0) # Corg:TNH3:P = 106:16:1 -(-106.0, 16.0)source +(-106.0, 16.0)source
PALEOaqchem.MolecularDiffusion.create_solute_diffusivity_funcFunction
create_solute_diffusivity_func(species_or_constant::AbstractString) -> f_diffcoeff

Molecular diffusivity for species_or_constant in water

Based on data compiled by (Boudreau, 1997) Ch. 4

If species_or_constant is a species name, returns a function f_diffcoeff, which calculates:

f_diffcoeff(TdegK, Pbar, S) -> Dmol (cm^2/s)

If species_or_constant can be parsed into a Float64, returns a function which provides this constant value (units cm^2/s).

The effect of pressure and salinity is approximated by assuming viscosity (calculated by MolecularDiffusion.sw_dynamic_viscosity) is the primary consideration, (Boudreau, 1997) eqn. 4.107 and Table 4.10.

source
PALEOaqchem.MolecularDiffusion.sw_dynamic_viscosityFunction
sw_dynamic_viscosity(TdegC, Pbar, S) -> mu

Seawater dynamic viscosity ((Boudreau, 1997) p94) 'claimed to accurate to within 7% over T (0 - 30C), P (1 - 1000 bar), S (0 36)'

Returns mu (10^-2 g/cm/s) (centipoise)

Arguments:

  • T: deg C (0 - 30C) temperature
  • P: bar (1 1000) pressure
  • S: salinity (0 - 36)

See check values for salinity effect Table 4.10 p.125

source
diff --git a/dev/PALEOcarbchem/index.html b/dev/PALEOcarbchem/index.html index 7e7e672..91e5fc5 100644 --- a/dev/PALEOcarbchem/index.html +++ b/dev/PALEOcarbchem/index.html @@ -45,12 +45,12 @@ julia> pHtot = PALEOcarbchem.mappHscale(C, pHfree, Val(3), Val(1), res_NT.TS, res_NT.TF); julia> @printf("%.14f", pHtot) -7.94544626702045source

Inputs and equilibrium constants

PALEOaqchem.PALEOcarbchem.ComponentsAllConstant
ComponentsAll::NamedTuple
+7.94544626702045
source

Inputs and equilibrium constants

PALEOaqchem.PALEOcarbchem.ComponentsAllConstant
ComponentsAll::NamedTuple
 ComponentsAllStrings::Vector{String}

All available components

julia> PALEOcarbchem.ComponentsAll
 (Ci = Val{true}(), S = Val{true}(), F = Val{true}(), B = Val{true}(), P = Val{true}(), Si = Val{true}(), H2S = Val{true}(), NH3 = Val{true}(), Omega = Val{true}())
 
 julia> PALEOcarbchem.ComponentsAllStrings  # all available components
-("Ci", "S", "F", "B", "P", "Si", "H2S", "NH3", "Omega")
source
PALEOaqchem.PALEOcarbchem.get_components_inputsFunction
get_components_inputs(compstoenable) -> (components::NamedTuple, concinputs::Vector{String})

Returns components and concinputs required for specified compstoenable

compstoenable is a list (Vector or Tuple) with component names as Strings, eg ["Ci", "B", "Si"]

Returns:

  • a NamedTuple components with those components present in compstoenable as Val{true} and others as Val{false}
  • a Vector concinputs of input concentrations required (P requires TP etc).

Examples

All components:

julia> compsall, concinputsall = PALEOcarbchem.get_components_inputs(["Ci", "S", "F", "B", "P", "Si", "H2S", "NH3", "Omega"])
+("Ci", "S", "F", "B", "P", "Si", "H2S", "NH3", "Omega")
source
PALEOaqchem.PALEOcarbchem.get_components_inputsFunction
get_components_inputs(compstoenable) -> (components::NamedTuple, concinputs::Vector{String})

Returns components and concinputs required for specified compstoenable

compstoenable is a list (Vector or Tuple) with component names as Strings, eg ["Ci", "B", "Si"]

Returns:

  • a NamedTuple components with those components present in compstoenable as Val{true} and others as Val{false}
  • a Vector concinputs of input concentrations required (P requires TP etc).

Examples

All components:

julia> compsall, concinputsall = PALEOcarbchem.get_components_inputs(["Ci", "S", "F", "B", "P", "Si", "H2S", "NH3", "Omega"])
 ((Ci = Val{true}(), S = Val{true}(), F = Val{true}(), B = Val{true}(), P = Val{true}(), Si = Val{true}(), H2S = Val{true}(), NH3 = Val{true}(), Omega = Val{true}()), ["TCi", "TS", "TF", "TB", "TP", "TSi", "TH2S", "TNH3", "Ca"])
 
 julia> compsall
@@ -61,7 +61,7 @@
 ((Ci = Val{false}(), S = Val{false}(), F = Val{false}(), B = Val{false}(), P = Val{false}(), Si = Val{false}(), H2S = Val{false}(), NH3 = Val{false}(), Omega = Val{false}()), String[])
 
 julia> println(concinputsminimal)
-String[]
source
PALEOaqchem.PALEOcarbchem.ConstNamesConstant
ConstNames::Tuple

All available CO2SYS effective equilibrium constant names

source
PALEOaqchem.PALEOcarbchem.CNameIdxConstant
CNameIdx::NamedTuple

Indices of constants in a Vector of length(ConstNames)

source
PALEOaqchem.PALEOcarbchem.getConstDescriptionFunction
getConstDescription(constName::AbstractString) -> (constName, units, description)

Get human-readable description of constName

source
PALEOaqchem.PALEOcarbchem.calc_constants!Function
calc_constants!(
+String[]
source
PALEOaqchem.PALEOcarbchem.ConstNamesConstant
ConstNames::Tuple

All available CO2SYS effective equilibrium constant names

source
PALEOaqchem.PALEOcarbchem.CNameIdxConstant
CNameIdx::NamedTuple

Indices of constants in a Vector of length(ConstNames)

source
PALEOaqchem.PALEOcarbchem.getConstDescriptionFunction
getConstDescription(constName::AbstractString) -> (constName, units, description)

Get human-readable description of constName

source
PALEOaqchem.PALEOcarbchem.calc_constants!Function
calc_constants!(
     Cout, TempC_input, Pdbar, Sal_input; 
     Options=(; WhichKs=Val(10), WhoseKSO4=Val(1), pHScale=Val(3), Components=ComponentsAll))

Calculate carbonate chemistry constants, results are returned in Cout.

Arguments:

  • Cout::Vector: (output) Vector of length length(ConstNames) with calculated equilibrium constants
  • TempC_input: temperature deg C. Will be limited to valid range for constants in use (from calc_limits)
  • Pdbar: pressure, dbar.
  • Sal_input: salinity. Will be limited to valid range for constants in use (from calc_limits)
  • Options: NamedTuple with fields:

WhichKs:

K1 K2 dissociation constants that are to be used. Val(Int) where Int is:

  • 1 = Roy, 1993 T: 0-45 S: 5-45. Total scale. Artificial seawater.
  • 2 = Goyet & Poisson T: -1-40 S: 10-50. Seaw. scale. Artificial seawater.
  • 3 = HANSSON refit BY DICKSON AND MILLERO T: 2-35 S: 20-40. Seaw. scale. Artificial seawater.
  • 4 = MEHRBACH refit BY DICKSON AND MILLERO T: 2-35 S: 20-40. Seaw. scale. Artificial seawater.
  • 5 = HANSSON and MEHRBACH refit BY DICKSON AND MILLERO T: 2-35 S: 20-40. Seaw. scale. Artificial seawater.
  • 6 = GEOSECS (i.e., original Mehrbach) T: 2-35 S: 19-43. NBS scale. Real seawater.
  • 7 = Peng (i.e., originam Mehrbach but without XXX) T: 2-35 S: 19-43. NBS scale. Real seawater.
  • 8 = Millero, 1979, FOR PURE WATER ONLY (i.e., Sal=0) T: 0-50 S: 0.
  • 9 = Cai and Wang, 1998 T: 2-35 S: 0-49. NBS scale. Real and artificial seawater.
  • 10 = Lueker et al, 2000 T: 2-35 S: 19-43. Total scale. Real seawater.
  • 11 = Mojica Prieto and Millero, 2002. T: 0-45 S: 5-42. Seaw. scale. Real seawater
  • 12 = Millero et al, 2002 T: -1.6-35 S: 34-37. Seaw. scale. Field measurements.
  • 13 = Millero et al, 2006 T: 0-50 S: 1-50. Seaw. scale. Real seawater.
  • 14 = Millero et al, 2010 T: 0-50 S: 1-50. Seaw. scale. Real seawater.

WhichKs=Val(10) (Lueker etal (2000) parameters.)

Recommended as 'best practice' by Dickson (2007) (as cited in Orr, J. C., Epitalon, J-M., & Gattuso, J-P. (2014). Comparison of seven packages that compute ocean carbonate chemistry. Biogeosciences Discussions, 11(4), 5327�5397. doi:10.5194/bgd-11-5327-2014 )

WhoseKSO4:

KSO4 dissociation constants that are to be used, in combination with the formulation of the borate-to-salinity ratio to be used. Having both these choices in a single argument is somewhat awkward, but it maintains syntax compatibility with the previous version. Val(Int) where Int is:

  • 1 = KSO4 of Dickson & TB of Uppstrom 1979 (PREFERRED)
  • 2 = KSO4 of Khoo & TB of Uppstrom 1979
  • 3 = KSO4 of Dickson & TB of Lee 2010
  • 4 = KSO4 of Khoo & TB of Lee 2010

pHScale: Set pH scale.

Val(Int) where Int is:

  • 1 = Total scale
  • 2 = Seawater scale
  • 3 = Free scale [required for PALEOcarbchem solvers]
  • 4 = NBS scale

Implementation

Modified CO2SYS Constants, split into functions for maintainability

Comments from the original code:

% SUB Constants, version 04.01, 10-13-97, written by Ernie Lewis.
 % Inputs: pHScale%, WhichKs%, WhoseKSO4%, Sali, TempCi, Pdbar
@@ -80,7 +80,7 @@
 %       PROGRAMMER'S NOTE: all Constants are converted to the pH scale
 %               pHScale% (the chosen one) in units of mol/kg-SW
 %               except KS and KF are on the free scale
-%               and KW is in units of (mol/kg-SW)^2

Julia-specific details:

WhichKs, WhoseKSO4, pHScale are passed as Types (using Val(Int)), not integer values, so that Julia can work out which constants and functions to call at compile time. Similarly, Comps is a Type which encodes the selection of components, so the appropriate code is generated (components included or excluded) at compile time.

source
PALEOaqchem.PALEOcarbchem.calc_limitsFunction
calc_limits( Val{WhichKs::Int}) -> (TminC, TmaxC, salmin, salmax)

Return range limits for constant set WhichKs:

  • 1 = Roy, 1993 T: 0-45 S: 5-45. Total scale. Artificial seawater.
  • 2 = Goyet & Poisson T: -1-40 S: 10-50. Seaw. scale. Artificial seawater.
  • 3 = HANSSON refit BY DICKSON AND MILLERO T: 2-35 S: 20-40. Seaw. scale. Artificial seawater.
  • 4 = MEHRBACH refit BY DICKSON AND MILLERO T: 2-35 S: 20-40. Seaw. scale. Artificial seawater.
  • 5 = HANSSON and MEHRBACH refit BY DICKSON AND MILLERO T: 2-35 S: 20-40. Seaw. scale. Artificial seawater.
  • 6 = GEOSECS (i.e., original Mehrbach) T: 2-35 S: 19-43. NBS scale. Real seawater.
  • 7 = Peng (i.e., originam Mehrbach but without XXX) T: 2-35 S: 19-43. NBS scale. Real seawater.
  • 8 = Millero, 1979, FOR PURE WATER ONLY (i.e., Sal=0) T: 0-50 S: 0.
  • 9 = Cai and Wang, 1998 T: 2-35 S: 0-49. NBS scale. Real and artificial seawater.
  • 10 = Lueker et al, 2000 T: 2-35 S: 19-43. Total scale. Real seawater.
  • 11 = Mojica Prieto and Millero, 2002. T: 0-45 S: 5-42. Seaw. scale. Real seawater
  • 12 = Millero et al, 2002 T: -1.6-35 S: 34-37. Seaw. scale. Field measurements.
  • 13 = Millero et al, 2006 T: 0-50 S: 1-50. Seaw. scale. Real seawater.
  • 14 = Millero et al, 2010 T: 0-50 S: 1-50. Seaw. scale. Real seawater.
source
PALEOaqchem.PALEOcarbchem.calc_modern_default_concsFunction
calc_modern_default_concs(Sal_input, Options=(; WhichKs=Val(10), WhoseKSO4=Val(1)) -> (; TF, TS, TB, Ca)

Calculate modern seawater default concentrations as a function of salinity Sal_input

See calc_constants! for documentation for Options.

Returns

- TF: (mol kg-1) Total Fluorine modern value from salinity
+%               and KW is in units of (mol/kg-SW)^2

Julia-specific details:

WhichKs, WhoseKSO4, pHScale are passed as Types (using Val(Int)), not integer values, so that Julia can work out which constants and functions to call at compile time. Similarly, Comps is a Type which encodes the selection of components, so the appropriate code is generated (components included or excluded) at compile time.

source
PALEOaqchem.PALEOcarbchem.calc_limitsFunction
calc_limits( Val{WhichKs::Int}) -> (TminC, TmaxC, salmin, salmax)

Return range limits for constant set WhichKs:

  • 1 = Roy, 1993 T: 0-45 S: 5-45. Total scale. Artificial seawater.
  • 2 = Goyet & Poisson T: -1-40 S: 10-50. Seaw. scale. Artificial seawater.
  • 3 = HANSSON refit BY DICKSON AND MILLERO T: 2-35 S: 20-40. Seaw. scale. Artificial seawater.
  • 4 = MEHRBACH refit BY DICKSON AND MILLERO T: 2-35 S: 20-40. Seaw. scale. Artificial seawater.
  • 5 = HANSSON and MEHRBACH refit BY DICKSON AND MILLERO T: 2-35 S: 20-40. Seaw. scale. Artificial seawater.
  • 6 = GEOSECS (i.e., original Mehrbach) T: 2-35 S: 19-43. NBS scale. Real seawater.
  • 7 = Peng (i.e., originam Mehrbach but without XXX) T: 2-35 S: 19-43. NBS scale. Real seawater.
  • 8 = Millero, 1979, FOR PURE WATER ONLY (i.e., Sal=0) T: 0-50 S: 0.
  • 9 = Cai and Wang, 1998 T: 2-35 S: 0-49. NBS scale. Real and artificial seawater.
  • 10 = Lueker et al, 2000 T: 2-35 S: 19-43. Total scale. Real seawater.
  • 11 = Mojica Prieto and Millero, 2002. T: 0-45 S: 5-42. Seaw. scale. Real seawater
  • 12 = Millero et al, 2002 T: -1.6-35 S: 34-37. Seaw. scale. Field measurements.
  • 13 = Millero et al, 2006 T: 0-50 S: 1-50. Seaw. scale. Real seawater.
  • 14 = Millero et al, 2010 T: 0-50 S: 1-50. Seaw. scale. Real seawater.
source
PALEOaqchem.PALEOcarbchem.calc_modern_default_concsFunction
calc_modern_default_concs(Sal_input, Options=(; WhichKs=Val(10), WhoseKSO4=Val(1)) -> (; TF, TS, TB, Ca)

Calculate modern seawater default concentrations as a function of salinity Sal_input

See calc_constants! for documentation for Options.

Returns

- TF: (mol kg-1) Total Fluorine modern value from salinity
 - TS: (mol kg-1) Total Sulphate modern value from salinity
 - TB: (mol kg-1) Total Boron modern value from salinity
 - Ca: (mol kg-1) Ca modern value from salinity

Example

julia> options = (; WhichKs=Val(10), WhoseKSO4=Val(1));
@@ -88,7 +88,7 @@
 julia> modern_concs = PALEOcarbchem.calc_modern_default_concs(35.0, Options=options);
 
 julia> map(x -> @sprintf("%.14e", x), modern_concs)
-(TF = "6.83258396883673e-05", TS = "2.82354341328601e-02", TB = "4.15700000000000e-04", Ca = "1.02845697008497e-02")
source

Solvers and outputs

PALEOaqchem.PALEOcarbchem.ResultNamesConstant
ResultNames::Tuple

All available CO2SYS result names

source
PALEOaqchem.PALEOcarbchem.RNameIdxConstant
RNameIdx::NamedTuple

Indices of results in a Vector of length(ResultNames)

source
PALEOaqchem.PALEOcarbchem.getResultDescriptionFunction
getResultDescription(resultName::AbstractString) -> (resultName, units, description)

Get human-readable description of resultName

source
PALEOaqchem.PALEOcarbchem.calculateTAfromTCpHfree!Function
calculateTAfromTCpHfree!(res, C, Options, concs, pHfree; do_dTAdpH=Val(false)) -> (TA, dTAdpH)

Calculate TAlk, and speciation, given pH and conserved concentrations (total DIC, Si, P, SO4, B, F, ...)

Returns:

  • TA: Total Alk, mol/kg-sw
  • dTAdpH: derivative, or NaN if do_dTAdpH=Val(false)

Arguments:

  • res: (output) Vector res of length length(ResultNames) with details of TA contributions etc
  • C: constants from calc_constants!. NB: must be on Free pH scale.
  • concs::NamedTuple: (mol kg-sw, NB: each element should be a Ref or length 1 Vector) total concentrations for sulphate, fluoride, and each optional component of alkalinity enabled in C
  • pHfree: pH on free scale

Implementation

modified from Matlab CO2SYS CalculateTAfromTCpH(TCi, pHi) to use Free pH scale

source
PALEOaqchem.PALEOcarbchem.calculatepHfromTATC!Function
calculatepHfromTATC!(
+(TF = "6.83258396883673e-05", TS = "2.82354341328601e-02", TB = "4.15700000000000e-04", Ca = "1.02845697008497e-02")
source

Solvers and outputs

PALEOaqchem.PALEOcarbchem.ResultNamesConstant
ResultNames::Tuple

All available CO2SYS result names

source
PALEOaqchem.PALEOcarbchem.RNameIdxConstant
RNameIdx::NamedTuple

Indices of results in a Vector of length(ResultNames)

source
PALEOaqchem.PALEOcarbchem.getResultDescriptionFunction
getResultDescription(resultName::AbstractString) -> (resultName, units, description)

Get human-readable description of resultName

source
PALEOaqchem.PALEOcarbchem.calculateTAfromTCpHfree!Function
calculateTAfromTCpHfree!(res, C, Options, concs, pHfree; do_dTAdpH=Val(false)) -> (TA, dTAdpH)

Calculate TAlk, and speciation, given pH and conserved concentrations (total DIC, Si, P, SO4, B, F, ...)

Returns:

  • TA: Total Alk, mol/kg-sw
  • dTAdpH: derivative, or NaN if do_dTAdpH=Val(false)

Arguments:

  • res: (output) Vector res of length length(ResultNames) with details of TA contributions etc
  • C: constants from calc_constants!. NB: must be on Free pH scale.
  • concs::NamedTuple: (mol kg-sw, NB: each element should be a Ref or length 1 Vector) total concentrations for sulphate, fluoride, and each optional component of alkalinity enabled in C
  • pHfree: pH on free scale

Implementation

modified from Matlab CO2SYS CalculateTAfromTCpH(TCi, pHi) to use Free pH scale

source
PALEOaqchem.PALEOcarbchem.calculatepHfromTATC!Function
calculatepHfromTATC!(
     res, C, Options, conc_TAx, concs; 
     pHstart=8.0, pHTol=100*eps()
-) -> (pHfree, steps)

Call calculateTAfromTCpHfree! to iteratively solve for pH given (i) a starting value and pH tolerance, and (ii) Alk and conserved concentrations (total DIC, Si, P, SO4, B, F, ...)

Intended for use eg in an ocean model to enable a single Newton-Raphson step each model timestep (ie pHstart from previous value in that grid cell, pHtol set to some large number)

Returns:

  • pHfree: pH on free scale
  • steps: number of Newton iterations

Arguments:

  • res: (output) Vector res of length length(ResultNames) with details of TA contributions etc
  • C: constants from calc_constants!. NB: must be on Free pH scale.
  • conc_TAx: total Alk, mol kg-sw
  • concs: other input total concentrations, see calculateTAfromTCpHfree!
  • pHstart: starting value (free pH scale)
  • pHtol: tolerance (accuracy required)

Implementation

Modified from CO2SYS SUB CalculatepHfromTATC, version 04.01, 10-13-96, written by Ernie Lewis. NB: recoded here to use calculateTAfromTCpHfree!, hence works on free pH scale.

Units: mol / kg-sw

source
PALEOaqchem.PALEOcarbchem.calculateOmegaFunction
calculateOmega(C, CO3,Ca) -> (OmegaCA, OmegaAR)

Calculate carbonate saturation.

Returns omega, the solubility ratio, for calcite and aragonite. This is defined by: Omega = [CO3–]*[Ca++]./Ksp, where Ksp is the solubility product (either KCa or KAr).

Arguments:

  • C - constants from calc_constants!
  • CO3 - carbonate ion concentration, mol/kg-sw
  • Ca - calcium concentration, mol/kg-sw
source
PALEOaqchem.PALEOcarbchem.mappHscaleFunction
mappHscale(C, pHin, scalein, scaleout, TS, TF) -> pHout

Map pH scale at pressure, temperature, salinity defined by constants C

NB: Total, SW scale are not well defined unless using default contemporary values for TS (sulphate) and TF (fluorine)

Arguments:

  • C: constants Vector from calc_constants!
  • pHin: input pH on scale scalein
  • scalein, scaleout :
    • Val(1) = Total scale
    • Val(2) = Seawater scale
    • Val(3) = Free scale
    • not implemented: Val(4) = NBS scale
  • TS: total sulphate (mol kg-1)
  • TF: total fluoride (mol kg-1)
source
+) -> (pHfree, steps)

Call calculateTAfromTCpHfree! to iteratively solve for pH given (i) a starting value and pH tolerance, and (ii) Alk and conserved concentrations (total DIC, Si, P, SO4, B, F, ...)

Intended for use eg in an ocean model to enable a single Newton-Raphson step each model timestep (ie pHstart from previous value in that grid cell, pHtol set to some large number)

Returns:

Arguments:

Implementation

Modified from CO2SYS SUB CalculatepHfromTATC, version 04.01, 10-13-96, written by Ernie Lewis. NB: recoded here to use calculateTAfromTCpHfree!, hence works on free pH scale.

Units: mol / kg-sw

source
PALEOaqchem.PALEOcarbchem.calculateOmegaFunction
calculateOmega(C, CO3,Ca) -> (OmegaCA, OmegaAR)

Calculate carbonate saturation.

Returns omega, the solubility ratio, for calcite and aragonite. This is defined by: Omega = [CO3–]*[Ca++]./Ksp, where Ksp is the solubility product (either KCa or KAr).

Arguments:

  • C - constants from calc_constants!
  • CO3 - carbonate ion concentration, mol/kg-sw
  • Ca - calcium concentration, mol/kg-sw
source
PALEOaqchem.PALEOcarbchem.mappHscaleFunction
mappHscale(C, pHin, scalein, scaleout, TS, TF) -> pHout

Map pH scale at pressure, temperature, salinity defined by constants C

NB: Total, SW scale are not well defined unless using default contemporary values for TS (sulphate) and TF (fluorine)

Arguments:

  • C: constants Vector from calc_constants!
  • pHin: input pH on scale scalein
  • scalein, scaleout :
    • Val(1) = Total scale
    • Val(2) = Seawater scale
    • Val(3) = Free scale
    • not implemented: Val(4) = NBS scale
  • TS: total sulphate (mol kg-1)
  • TF: total fluoride (mol kg-1)
source
diff --git a/dev/References/index.html b/dev/References/index.html index 9cba0cc..15305b5 100644 --- a/dev/References/index.html +++ b/dev/References/index.html @@ -1,2 +1,2 @@ -References · PALEOaqchem Documentation
+References · PALEOaqchem Documentation

References

diff --git a/dev/index.html b/dev/index.html index 7d48556..1e8dda1 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -PALEOaqchem.jl · PALEOaqchem Documentation
+PALEOaqchem.jl · PALEOaqchem Documentation
diff --git a/dev/indexpage/index.html b/dev/indexpage/index.html index c1bde1e..6c220a1 100644 --- a/dev/indexpage/index.html +++ b/dev/indexpage/index.html @@ -1,2 +1,2 @@ -Index · PALEOaqchem Documentation
+Index · PALEOaqchem Documentation
diff --git a/dev/paleoaqchem_references.bib b/dev/paleoaqchem_references.bib index 8ae3597..7b1b85c 100644 --- a/dev/paleoaqchem_references.bib +++ b/dev/paleoaqchem_references.bib @@ -1,3 +1,12 @@ +@book{Boudreau1997, +author = {Boudreau, Bernard P}, +isbn = {978-3642643996}, +pages = {414}, +publisher = {Springer}, +title = {{Diagenetic models and their implementation; modelling transport and reactions in aquatic sediments}}, +year = {1997} +} + @techreport{Lewis1998, author = {Lewis, E. and Wallace, D. W. R}, institution = {Carbon Dioxide Inf. Anal. Cent., Oak Ridge Natl. Lab., Oak Ridge, Tenn.}, diff --git a/dev/search_index.js b/dev/search_index.js index dd8e9dd..5280e08 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"PALEOaqchem functions/#PALEOaqchem-functions","page":"PALEOaqchem functions","title":"PALEOaqchem functions","text":"","category":"section"},{"location":"PALEOaqchem functions/","page":"PALEOaqchem functions","title":"PALEOaqchem functions","text":"CurrentModule = PALEOaqchem","category":"page"},{"location":"PALEOaqchem functions/","page":"PALEOaqchem functions","title":"PALEOaqchem functions","text":"O2AlkUptakeRemin","category":"page"},{"location":"PALEOaqchem functions/#PALEOaqchem.O2AlkUptakeRemin","page":"PALEOaqchem functions","title":"PALEOaqchem.O2AlkUptakeRemin","text":"O2AlkUptakeRemin(Corg, (NO3, TNH3, Ngas), TPO4, Ccarb; rO2Corg=1) -> (O2, Alk)\n\nOxygen and alkalinity assimilated for production (or released by remineralisation) of particulate matter with specified Corg, Ccarb from specified nitrate NO3, total ammonia TNH3, gaseous N, total phosphate TPO4\n\nNB sign: for Corg +ve, O2 is -ve (ie quantity to subtract from tracer sms for production, or add for remineralisation)\n\nExamples\n\njulia> PALEOaqchem.O2AlkUptakeRemin(106.0, (0.0, 0.0, 0.0), 1.0, 0.0) # Corg:P = 106:1, no N\n(-106.0, 0.0)\n\njulia> PALEOaqchem.O2AlkUptakeRemin(106.0, (16.0, 0.0, 0.0), 1.0, 0.0) # Corg:NO3:P = 106:16:1\n(-138.0, -16.0)\n\njulia> PALEOaqchem.O2AlkUptakeRemin(106.0, (0.0, 16.0, 0.0), 1.0, 0.0) # Corg:TNH3:P = 106:16:1\n(-106.0, 16.0)\n\n\n\n\n\n","category":"function"},{"location":"References/#References","page":"References","title":"References","text":"","category":"section"},{"location":"References/","page":"References","title":"References","text":"van Heuven, S.; Pierrot, D.; Rae, J.; Lewis, E. and Wallace, D. (2011). MATLAB Program Developed for CO2 System Calculations. ORNL/CDIAC-105b (Carbon Dioxide Information Analysis Center, Oak Ridge National Laboratory, U.S. Department of Energy, Oak Ridge, Tennessee.).\n\n\n\nLewis, E. and Wallace, D. W. (1998). Program Developed for CO2 System Calculations. ORNL/CDIAC-105 (Carbon Dioxide Inf. Anal. Cent., Oak Ridge Natl. Lab., Oak Ridge, Tenn.).\n\n\n\nOzaki, K.; Tajima, S. and Tajika, E. (2011). Conditions required for oceanic anoxia/euxinia: Constraints from a one-dimensional ocean biogeochemical cycle model. Earth and Planetary Science Letters 304, 270–279.\n\n\n\nRomaniello, S. J. and Derry, L. A. (2010). Validation of an intermediate-complexity model for simulating marine biogeochemistry under anoxic conditions in the modern Black Sea. Geochemistry Geophysics Geosystems 11, 1–18.\n\n\n\nZeebe, R. E. and Wolf-Gladrow, D. a. (2001). CO2 in Seawater: Equilibrium, Kinetics, Isotopes (Elsevier); p. 360.\n\n\n\nVan Cappellen, P. and Wang, Y. (1996). Cycling of iron and manganese in surface sediments; a general theory for the coupled transport and reaction of carbon, oxygen, nitrogen, sulfur, iron, and manganese. American Journal of Science 296, 197–243.\n\n\n\n","category":"page"},{"location":"PALEOcarbchem/#PALEOcarbchem","page":"PALEOcarbchem","title":"PALEOcarbchem","text":"","category":"section"},{"location":"PALEOcarbchem/","page":"PALEOcarbchem","title":"PALEOcarbchem","text":"CurrentModule = PALEOaqchem","category":"page"},{"location":"PALEOcarbchem/","page":"PALEOcarbchem","title":"PALEOcarbchem","text":"PALEOcarbchem","category":"page"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem","text":"PALEOcarbchem\n\nCarbonate chemistry equilibrium translated from Matlab CO2SYS v1.1 (van Heuven et al., 2011), (Lewis and Wallace, 1998) and refactored for speed.\n\nImplementation based on CO2SYS constants, with reimplemented equilibrium calculation.\n\nNB: \n\nAlthough effective equilibrium constants can be calculated for different pH scales, TAlk or pH calculations using PALEOcarbchem.calculateTAfromTCpHfree!\n\nrequire constants to be on the free pH scale.\n\nEffective equilibrium constants are empirical measurements hence are only accurate for modern seawater composition.\n\nExample usage with default choice of constants, all components enabled:\n\njulia> PALEOcarbchem.ComponentsAllStrings # all available components\n(\"Ci\", \"S\", \"F\", \"B\", \"P\", \"Si\", \"H2S\", \"NH3\", \"Omega\")\n\njulia> comps, concinputs = PALEOcarbchem.get_components_inputs([\"Ci\", \"S\", \"F\", \"B\", \"P\", \"Si\", \"H2S\", \"NH3\", \"Omega\"])\n((Ci = Val{true}(), S = Val{true}(), F = Val{true}(), B = Val{true}(), P = Val{true}(), Si = Val{true}(), H2S = Val{true}(), NH3 = Val{true}(), Omega = Val{true}()), [\"TCi\", \"TS\", \"TF\", \"TB\", \"TP\", \"TSi\", \"TH2S\", \"TNH3\", \"Ca\"])\n\njulia> println(concinputs) # concentrations required (in addition to TAlk)\n[\"TCi\", \"TS\", \"TF\", \"TB\", \"TP\", \"TSi\", \"TH2S\", \"TNH3\", \"Ca\"] \n\njulia> options = (; WhichKs=Val(10), WhoseKSO4=Val(1), pHScale=Val(3), Components=comps)\n(WhichKs = Val{10}(), WhoseKSO4 = Val{1}(), pHScale = Val{3}(), Components = (Ci = Val{true}(), S = Val{true}(), F = Val{true}(), B = Val{true}(), P = Val{true}(), Si = Val{true}(), H2S = Val{true}(), NH3 = Val{true}(), Omega = Val{true}()))\n\njulia> C = zeros(length(PALEOcarbchem.ConstNames));\n\njulia> PALEOcarbchem.calc_constants!(C, 25.0, 1000.0, 35.0, Options=options) # Temp(C), P(dbar), Sal(psu)\n\njulia> C_NT = NamedTuple{PALEOcarbchem.ConstNames}(C); # convert to NamedTuple for convenience\n\njulia> map(x -> @sprintf(\"%.14e\", x), C_NT)\n(TF = \"6.83258396883673e-05\", TS = \"2.82354341328601e-02\", fH = \"7.13404318750000e-01\", VPFac = \"9.69344700036820e-01\", KW = \"5.12594224560177e-14\", KF = \"2.46750587115740e-03\", KS = \"1.07228495518292e-01\", K0 = \"2.83918818040155e-02\", K1 = \"1.23204547404511e-06\", K2 = \"9.14637929020938e-10\", FugFac = \"9.96810458692103e-01\", KB = \"2.23064975910959e-09\", KP1 = \"2.01400858730558e-02\", KP2 = \"9.31686820250764e-07\", KP3 = \"1.40307711726248e-09\", KSi = \"3.62200612635021e-10\", KH2S = \"2.60000514374855e-07\", KNH3 = \"4.74226503827862e-10\", KCa = \"4.92763187414538e-07\", KAr = \"7.39194729649679e-07\")\n\njulia> modern_concs = PALEOcarbchem.calc_modern_default_concs(35.0, Options=options);\n\njulia> map(x -> @sprintf(\"%.14e\", x), modern_concs)\n(TF = \"6.83258396883673e-05\", TS = \"2.82354341328601e-02\", TB = \"4.15700000000000e-04\", Ca = \"1.02845697008497e-02\")\n\njulia> input_concs = (TCi=[2000e-6], TS=[modern_concs.TS], TF=[modern_concs.TF], TSi=[1e-3], TP=[1e-6], TB=[modern_concs.TB], TH2S=[1e-6], TNH3=[1e-6], Ca=[modern_concs.Ca]); # all in mol kg-1\n\njulia> res = zeros(length(PALEOcarbchem.ResultNames));\n\njulia> (pHfree, steps) = PALEOcarbchem.calculatepHfromTATC!(res, C, options, 2300e-6, input_concs);\n\njulia> @printf(\"%.14f\", pHfree)\n8.04695972423890\n\njulia> steps\n5\n\njulia> res_NT = NamedTuple{PALEOcarbchem.ResultNames}(res); # convert to NamedTuple for convenience\n\njulia> map(x -> @sprintf(\"%.14e\", x), res_NT)\n(pHfree = \"8.04695972423890e+00\", H = \"8.97512024441008e-09\", OH = \"5.71127974446284e-06\", TA = \"2.30000000000000e-03\", dTAdpH = \"6.71952166583155e-04\", TS = \"2.82354341328601e-02\", HSO4 = \"2.36333069917159e-09\", TF = \"6.83258396883673e-05\", HF = \"2.48522365702671e-10\", TCi = \"2.00000000000000e-03\", CO2 = \"1.31351930129921e-05\", HCO3 = \"1.80311290118315e-03\", CO3 = \"1.83751905803853e-04\", CAlk = \"2.17061671279086e-03\", fCO2 = \"4.62639042514413e-04\", pCO2 = \"4.64119370418157e-04\", xCO2dryinp = \"4.78797037215479e-04\", TB = \"4.15700000000000e-04\", BAlk = \"8.27503245712347e-05\", TP = \"1.00000000000000e-06\", H3PO4 = \"3.68183719676091e-15\", H2PO4 = \"8.26200822875433e-09\", HPO4 = \"8.57660283752523e-07\", PO4 = \"1.34077704336885e-07\", PengCorrection = \"0.00000000000000e+00\", PAlk = \"1.12581568874446e-06\", TSi = \"1.00000000000000e-03\", SiAlk = \"3.87906357916080e-05\", TH2S = \"1.00000000000000e-06\", HSAlk = \"9.66632218352735e-07\", TNH3 = \"1.00000000000000e-06\", NH3Alk = \"5.01861680455629e-08\", Ca = \"1.02845697008497e-02\", OmegaCA = \"3.83512675291204e+00\", OmegaAR = \"2.55657840498853e+00\")\n\njulia> pHtot = PALEOcarbchem.mappHscale(C, pHfree, Val(3), Val(1), res_NT.TS, res_NT.TF);\n\njulia> @printf(\"%.14f\", pHtot)\n7.94544626702045\n\n\n\n\n\n","category":"module"},{"location":"PALEOcarbchem/","page":"PALEOcarbchem","title":"PALEOcarbchem","text":"CurrentModule = PALEOaqchem.PALEOcarbchem","category":"page"},{"location":"PALEOcarbchem/#Inputs-and-equilibrium-constants","page":"PALEOcarbchem","title":"Inputs and equilibrium constants","text":"","category":"section"},{"location":"PALEOcarbchem/","page":"PALEOcarbchem","title":"PALEOcarbchem","text":"ComponentsAll\nget_components_inputs\nConstNames\nCNameIdx\ngetConstDescription\ncalc_constants!\ncalc_limits\ncalc_modern_default_concs","category":"page"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.ComponentsAll","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.ComponentsAll","text":"ComponentsAll::NamedTuple\nComponentsAllStrings::Vector{String}\n\nAll available components\n\njulia> PALEOcarbchem.ComponentsAll\n(Ci = Val{true}(), S = Val{true}(), F = Val{true}(), B = Val{true}(), P = Val{true}(), Si = Val{true}(), H2S = Val{true}(), NH3 = Val{true}(), Omega = Val{true}())\n\njulia> PALEOcarbchem.ComponentsAllStrings # all available components\n(\"Ci\", \"S\", \"F\", \"B\", \"P\", \"Si\", \"H2S\", \"NH3\", \"Omega\")\n\n\n\n\n\n","category":"constant"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.get_components_inputs","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.get_components_inputs","text":"get_components_inputs(compstoenable) -> (components::NamedTuple, concinputs::Vector{String})\n\nReturns components and concinputs required for specified compstoenable\n\ncompstoenable is a list (Vector or Tuple) with component names as Strings, eg [\"Ci\", \"B\", \"Si\"] \n\nReturns:\n\na NamedTuple components with those components present in compstoenable as Val{true} and others as Val{false}\na Vector concinputs of input concentrations required (P requires TP etc).\n\nExamples\n\nAll components:\n\njulia> compsall, concinputsall = PALEOcarbchem.get_components_inputs([\"Ci\", \"S\", \"F\", \"B\", \"P\", \"Si\", \"H2S\", \"NH3\", \"Omega\"])\n((Ci = Val{true}(), S = Val{true}(), F = Val{true}(), B = Val{true}(), P = Val{true}(), Si = Val{true}(), H2S = Val{true}(), NH3 = Val{true}(), Omega = Val{true}()), [\"TCi\", \"TS\", \"TF\", \"TB\", \"TP\", \"TSi\", \"TH2S\", \"TNH3\", \"Ca\"])\n\njulia> compsall\n(Ci = Val{true}(), S = Val{true}(), F = Val{true}(), B = Val{true}(), P = Val{true}(), Si = Val{true}(), H2S = Val{true}(), NH3 = Val{true}(), Omega = Val{true}())\n\njulia> println(concinputsall) # concentrations required (in addition to TAlk)\n[\"TCi\", \"TS\", \"TF\", \"TB\", \"TP\", \"TSi\", \"TH2S\", \"TNH3\", \"Ca\"]\n\nAll optional components disabled (just H2O)\n\njulia> compsminimal, concinputsminimal = PALEOcarbchem.get_components_inputs([])\n((Ci = Val{false}(), S = Val{false}(), F = Val{false}(), B = Val{false}(), P = Val{false}(), Si = Val{false}(), H2S = Val{false}(), NH3 = Val{false}(), Omega = Val{false}()), String[])\n\njulia> println(concinputsminimal)\nString[]\n\n\n\n\n\n","category":"function"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.ConstNames","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.ConstNames","text":"ConstNames::Tuple\n\nAll available CO2SYS effective equilibrium constant names\n\n\n\n\n\n","category":"constant"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.CNameIdx","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.CNameIdx","text":"CNameIdx::NamedTuple\n\nIndices of constants in a Vector of length(ConstNames)\n\n\n\n\n\n","category":"constant"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.getConstDescription","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.getConstDescription","text":"getConstDescription(constName::AbstractString) -> (constName, units, description)\n\nGet human-readable description of constName\n\n\n\n\n\n","category":"function"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.calc_constants!","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.calc_constants!","text":"calc_constants!(\n Cout, TempC_input, Pdbar, Sal_input; \n Options=(; WhichKs=Val(10), WhoseKSO4=Val(1), pHScale=Val(3), Components=ComponentsAll))\n\nCalculate carbonate chemistry constants, results are returned in Cout.\n\nArguments:\n\nCout::Vector: (output) Vector of length length(ConstNames) with calculated equilibrium constants\nTempC_input: temperature deg C. Will be limited to valid range for constants in use (from calc_limits)\nPdbar: pressure, dbar. \nSal_input: salinity. Will be limited to valid range for constants in use (from calc_limits)\nOptions: NamedTuple with fields:\nWhichKs: Val(Int), default Val(10) \nWhoseKSO4: Val(Int), default Val(1) \npHScale: Val(Int), default Val(3) (free - required for calculateTAfromTCpHfree!)\nComponents: components to enable as generated by get_components_inputs \n\nWhichKs:\n\nK1 K2 dissociation constants that are to be used. Val(Int) where Int is:\n\n1 = Roy, 1993\t\t\t\t\t\t\t\t\t\t\tT: 0-45 S: 5-45. Total scale. Artificial seawater.\n2 = Goyet & Poisson\t\t\t\t\t\t\t\t\t\tT: -1-40 S: 10-50. Seaw. scale. Artificial seawater.\n3 = HANSSON refit BY DICKSON AND MILLERO\tT: 2-35 S: 20-40. Seaw. scale. Artificial seawater.\n4 = MEHRBACH refit BY DICKSON AND MILLERO\tT: 2-35 S: 20-40. Seaw. scale. Artificial seawater.\n5 = HANSSON and MEHRBACH refit BY DICKSON AND MILLERO\tT: 2-35 S: 20-40. Seaw. scale. Artificial seawater.\n6 = GEOSECS (i.e., original Mehrbach)\t\t\t\t\tT: 2-35 S: 19-43. NBS scale. Real seawater.\n7 = Peng\t(i.e., originam Mehrbach but without XXX)\tT: 2-35 S: 19-43. NBS scale. Real seawater.\n8 = Millero, 1979, FOR PURE WATER ONLY (i.e., Sal=0)\tT: 0-50 S: 0.\n9 = Cai and Wang, 1998\t\t\t\t\t\t\t\t\tT: 2-35 S: 0-49. NBS scale. Real and artificial seawater.\n10 = Lueker et al, 2000\t\t\t\t\t\t\t\t\tT: 2-35 S: 19-43. Total scale. Real seawater.\n11 = Mojica Prieto and Millero, 2002.\t\t\t\t\tT: 0-45 S: 5-42. Seaw. scale. Real seawater\n12 = Millero et al, 2002\t\t\t\t\t\t\t\t\tT: -1.6-35 S: 34-37. Seaw. scale. Field measurements.\n13 = Millero et al, 2006\t\t\t\t\t\t\t\t\tT: 0-50 S: 1-50. Seaw. scale. Real seawater.\n14 = Millero et al, 2010\t\t\t\t\t\t\t\t\tT: 0-50 S: 1-50. Seaw. scale. Real seawater.\n\nWhichKs=Val(10) (Lueker etal (2000) parameters.)\n\nRecommended as 'best practice' by Dickson (2007) (as cited in Orr, J. C., Epitalon, J-M., & Gattuso, J-P. (2014). Comparison of seven packages that compute ocean carbonate chemistry. Biogeosciences Discussions, 11(4), 5327�5397. doi:10.5194/bgd-11-5327-2014 )\n\nWhoseKSO4:\n\nKSO4 dissociation constants that are to be used, in combination with the formulation of the borate-to-salinity ratio to be used. Having both these choices in a single argument is somewhat awkward, but it maintains syntax compatibility with the previous version. Val(Int) where Int is:\n\n1 = KSO4 of Dickson & TB of Uppstrom 1979 (PREFERRED)\n2 = KSO4 of Khoo & TB of Uppstrom 1979\n3 = KSO4 of Dickson & TB of Lee 2010\n4 = KSO4 of Khoo & TB of Lee 2010\n\npHScale: Set pH scale.\n\nVal(Int) where Int is:\n\n1 = Total scale\n2 = Seawater scale\n3 = Free scale [required for PALEOcarbchem solvers]\n4 = NBS scale\n\nImplementation\n\nModified CO2SYS Constants, split into functions for maintainability\n\nComments from the original code:\n\n% SUB Constants, version 04.01, 10-13-97, written by Ernie Lewis.\n% Inputs: pHScale%, WhichKs%, WhoseKSO4%, Sali, TempCi, Pdbar\n% Outputs: K0, K(), T(), fH, FugFac, VPFac\n% This finds the Constants of the CO2 system in seawater or freshwater,\n% corrects them for pressure, and reports them on the chosen pH scale.\n% The process is as follows: the Constants (except KS, KF which stay on the\n% free scale - these are only corrected for pressure) are\n% 1) evaluated as they are given in the literature\n% 2) converted to the SWS scale in mol/kg-SW or to the NBS scale\n% 3) corrected for pressure\n% 4) converted to the SWS pH scale in mol/kg-SW\n% 5) converted to the chosen pH scale\n%\n% PROGRAMMER'S NOTE: all logs are log base e\n% PROGRAMMER'S NOTE: all Constants are converted to the pH scale\n% pHScale% (the chosen one) in units of mol/kg-SW\n% except KS and KF are on the free scale\n% and KW is in units of (mol/kg-SW)^2\n\nJulia-specific details:\n\nWhichKs, WhoseKSO4, pHScale are passed as Types (using Val(Int)), not integer values, so that Julia can work out which constants and functions to call at compile time. Similarly, Comps is a Type which encodes the selection of components, so the appropriate code is generated (components included or excluded) at compile time.\n\n\n\n\n\n","category":"function"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.calc_limits","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.calc_limits","text":"calc_limits( Val{WhichKs::Int}) -> (TminC, TmaxC, salmin, salmax)\n\nReturn range limits for constant set WhichKs:\n\n1 = Roy, 1993\t\t\t\t\t\t\t\t\t\t\tT: 0-45 S: 5-45. Total scale. Artificial seawater.\n2 = Goyet & Poisson\t\t\t\t\t\t\t\t\t\tT: -1-40 S: 10-50. Seaw. scale. Artificial seawater.\n3 = HANSSON refit BY DICKSON AND MILLERO\tT: 2-35 S: 20-40. Seaw. scale. Artificial seawater.\n4 = MEHRBACH refit BY DICKSON AND MILLERO\tT: 2-35 S: 20-40. Seaw. scale. Artificial seawater.\n5 = HANSSON and MEHRBACH refit BY DICKSON AND MILLERO\tT: 2-35 S: 20-40. Seaw. scale. Artificial seawater.\n6 = GEOSECS (i.e., original Mehrbach)\t\t\t\t\tT: 2-35 S: 19-43. NBS scale. Real seawater.\n7 = Peng\t(i.e., originam Mehrbach but without XXX)\tT: 2-35 S: 19-43. NBS scale. Real seawater.\n8 = Millero, 1979, FOR PURE WATER ONLY (i.e., Sal=0)\tT: 0-50 S: 0.\n9 = Cai and Wang, 1998\t\t\t\t\t\t\t\t\tT: 2-35 S: 0-49. NBS scale. Real and artificial seawater.\n10 = Lueker et al, 2000\t\t\t\t\t\t\t\t\tT: 2-35 S: 19-43. Total scale. Real seawater.\n11 = Mojica Prieto and Millero, 2002.\t\t\t\t\tT: 0-45 S: 5-42. Seaw. scale. Real seawater\n12 = Millero et al, 2002\t\t\t\t\t\t\t\t\tT: -1.6-35 S: 34-37. Seaw. scale. Field measurements.\n13 = Millero et al, 2006\t\t\t\t\t\t\t\t\tT: 0-50 S: 1-50. Seaw. scale. Real seawater.\n14 = Millero et al, 2010\t\t\t\t\t\t\t\t\tT: 0-50 S: 1-50. Seaw. scale. Real seawater.\n\n\n\n\n\n","category":"function"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.calc_modern_default_concs","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.calc_modern_default_concs","text":"calc_modern_default_concs(Sal_input, Options=(; WhichKs=Val(10), WhoseKSO4=Val(1)) -> (; TF, TS, TB, Ca)\n\nCalculate modern seawater default concentrations as a function of salinity Sal_input\n\nSee calc_constants! for documentation for Options.\n\nReturns\n\n- TF: (mol kg-1) Total Fluorine modern value from salinity\n- TS: (mol kg-1) Total Sulphate modern value from salinity\n- TB: (mol kg-1) Total Boron modern value from salinity\n- Ca: (mol kg-1) Ca modern value from salinity\n\nExample\n\njulia> options = (; WhichKs=Val(10), WhoseKSO4=Val(1));\n\njulia> modern_concs = PALEOcarbchem.calc_modern_default_concs(35.0, Options=options);\n\njulia> map(x -> @sprintf(\"%.14e\", x), modern_concs)\n(TF = \"6.83258396883673e-05\", TS = \"2.82354341328601e-02\", TB = \"4.15700000000000e-04\", Ca = \"1.02845697008497e-02\")\n\n\n\n\n\n","category":"function"},{"location":"PALEOcarbchem/#Solvers-and-outputs","page":"PALEOcarbchem","title":"Solvers and outputs","text":"","category":"section"},{"location":"PALEOcarbchem/","page":"PALEOcarbchem","title":"PALEOcarbchem","text":"ResultNames\nRNameIdx\ngetResultDescription\ncalculateTAfromTCpHfree!\ncalculatepHfromTATC!\ncalculateOmega\nmappHscale","category":"page"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.ResultNames","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.ResultNames","text":"ResultNames::Tuple\n\nAll available CO2SYS result names\n\n\n\n\n\n","category":"constant"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.RNameIdx","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.RNameIdx","text":"RNameIdx::NamedTuple\n\nIndices of results in a Vector of length(ResultNames)\n\n\n\n\n\n","category":"constant"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.getResultDescription","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.getResultDescription","text":"getResultDescription(resultName::AbstractString) -> (resultName, units, description)\n\nGet human-readable description of resultName\n\n\n\n\n\n","category":"function"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.calculateTAfromTCpHfree!","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.calculateTAfromTCpHfree!","text":"calculateTAfromTCpHfree!(res, C, Options, concs, pHfree; do_dTAdpH=Val(false)) -> (TA, dTAdpH)\n\nCalculate TAlk, and speciation, given pH and conserved concentrations (total DIC, Si, P, SO4, B, F, ...)\n\nReturns:\n\nTA: Total Alk, mol/kg-sw \ndTAdpH: derivative, or NaN if do_dTAdpH=Val(false)\n\nArguments:\n\nres: (output) Vector res of length length(ResultNames) with details of TA contributions etc\nC: constants from calc_constants!. NB: must be on Free pH scale.\nconcs::NamedTuple: (mol kg-sw, NB: each element should be a Ref or length 1 Vector) total concentrations for sulphate, fluoride, and each optional component of alkalinity enabled in C\npHfree: pH on free scale\n\nImplementation\n\nmodified from Matlab CO2SYS CalculateTAfromTCpH(TCi, pHi) to use Free pH scale\n\n\n\n\n\n","category":"function"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.calculatepHfromTATC!","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.calculatepHfromTATC!","text":"calculatepHfromTATC!(\n res, C, Options, conc_TAx, concs; \n pHstart=8.0, pHTol=100*eps()\n) -> (pHfree, steps)\n\nCall calculateTAfromTCpHfree! to iteratively solve for pH given (i) a starting value and pH tolerance, and (ii) Alk and conserved concentrations (total DIC, Si, P, SO4, B, F, ...)\n\nIntended for use eg in an ocean model to enable a single Newton-Raphson step each model timestep (ie pHstart from previous value in that grid cell, pHtol set to some large number)\n\nReturns:\n\npHfree: pH on free scale\nsteps: number of Newton iterations\n\nArguments:\n\nres: (output) Vector res of length length(ResultNames) with details of TA contributions etc\nC: constants from calc_constants!. NB: must be on Free pH scale.\nconc_TAx: total Alk, mol kg-sw\nconcs: other input total concentrations, see calculateTAfromTCpHfree!\npHstart: starting value (free pH scale)\npHtol: tolerance (accuracy required)\n\nImplementation\n\nModified from CO2SYS SUB CalculatepHfromTATC, version 04.01, 10-13-96, written by Ernie Lewis. NB: recoded here to use calculateTAfromTCpHfree!, hence works on free pH scale.\n\nUnits: mol / kg-sw \n\n\n\n\n\n","category":"function"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.calculateOmega","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.calculateOmega","text":"calculateOmega(C, CO3,Ca) -> (OmegaCA, OmegaAR)\n\nCalculate carbonate saturation.\n\nReturns omega, the solubility ratio, for calcite and aragonite. This is defined by: Omega = [CO3–]*[Ca++]./Ksp, where Ksp is the solubility product (either KCa or KAr).\n\nArguments:\n\nC - constants from calc_constants!\nCO3 - carbonate ion concentration, mol/kg-sw\nCa - calcium concentration, mol/kg-sw\n\n\n\n\n\n","category":"function"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.mappHscale","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.mappHscale","text":"mappHscale(C, pHin, scalein, scaleout, TS, TF) -> pHout\n\nMap pH scale at pressure, temperature, salinity defined by constants C\n\nNB: Total, SW scale are not well defined unless using default contemporary values for TS (sulphate) and TF (fluorine)\n\nArguments:\n\nC: constants Vector from calc_constants!\npHin: input pH on scale scalein\nscalein, scaleout :\nVal(1) = Total scale\nVal(2) = Seawater scale\nVal(3) = Free scale\nnot implemented: Val(4) = NBS scale\nTS: total sulphate (mol kg-1)\nTF: total fluoride (mol kg-1)\n\n\n\n\n\n","category":"function"},{"location":"indexpage/#Index","page":"Index","title":"Index","text":"","category":"section"},{"location":"indexpage/","page":"Index","title":"Index","text":"","category":"page"},{"location":"PALEOaqchem Reactions/#PALEOaqchem-Reactions","page":"PALEOaqchem Reactions","title":"PALEOaqchem Reactions","text":"","category":"section"},{"location":"PALEOaqchem Reactions/","page":"PALEOaqchem Reactions","title":"PALEOaqchem Reactions","text":"CurrentModule = PALEOaqchem","category":"page"},{"location":"PALEOaqchem Reactions/#Particulate-fluxes","page":"PALEOaqchem Reactions","title":"Particulate fluxes","text":"","category":"section"},{"location":"PALEOaqchem Reactions/","page":"PALEOaqchem Reactions","title":"PALEOaqchem Reactions","text":"Particle.ReactionParticleDecay\nParticle.ReactionFluxToComponents","category":"page"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.Particle.ReactionParticleDecay","page":"PALEOaqchem Reactions","title":"PALEOaqchem.Particle.ReactionParticleDecay","text":"ReactionParticleDecay\n\nDecay (eg organic matter to remineralization) at rate 1.0/decay_timescale of eg an organic matter dissolved/particulate phase in Reservoir Particle, to decayflux. Particle may have isotope_type. The Reservoir Particle may have the :vsink attribute set to represent a marine sinking particulate phase.\n\nParameters\n\ndecay_timescale[Float64]=0.5 (yr), default_value=0.5, description=\"particle decay timescale\"\ndecay_threshold[Float64]=-Inf (mol m-3), default_value=-Inf, description=\"particle decay concentration below which decay stops\"\nfield_data[DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable isotopes and specify isotope type\"\n\nMethods and Variables\n\ndo_particle_decay\nParticle (mol), VT_ReactDependency, description=\"Particle amount\"\nParticle_sms (mol yr-1), VT_ReactContributor, description=\"Particle source-sink\"\ndecayflux (mol yr-1), VT_ReactContributor, description=\"Particle decay flux\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.Particle.ReactionFluxToComponents","page":"PALEOaqchem Reactions","title":"PALEOaqchem.Particle.ReactionFluxToComponents","text":"ReactionFluxToComponents\n\nDistribute a single input_flux (eg an organic matter flux) to output_fluxnames components with stoichiometry output_fluxstoich. input_flux may have an isotope type (set by field_data) in which case the isotopic composition will be sent to (usually one) output_fluxname with ::Isotope suffix.\n\nParameters\n\noutputflux_prefix[String]=\"\", default_value=\"\", description=\"Prefix for output flux names\"\noutputflux_names[Vector{String}]=[\"Corg\", \"N\", \"P\"], default_value=[\"Corg\", \"N\", \"P\"], description=\"Suffixes for output flux names. Use ::Isotope suffix to identify a flux with 'isotope_type'\"\noutputflux_stoich[Vector{Float64}]=[106.0, 16.0, 1.0], default_value=[106.0, 16.0, 1.0], description=\"Stoichiometry for output fluxes relative to input flux\"\nfield_data[DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable isotopes and specify isotope type\"\n\nMethods and Variables for default Parameters\n\ndo_flux_to_components\ninputflux (mol m-3), VT_ReactTarget, description=\"input flux\"\n[Corg] (mol yr-1), VT_ReactContributor, description=\"flux Corg\"\n[N] (mol yr-1), VT_ReactContributor, description=\"flux N\"\n[P] (mol yr-1), VT_ReactContributor, description=\"flux P\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#Remin","page":"PALEOaqchem Reactions","title":"Remin","text":"","category":"section"},{"location":"PALEOaqchem Reactions/","page":"PALEOaqchem Reactions","title":"PALEOaqchem Reactions","text":"Remin.ReactionReminPonly\nRemin.ReactionReminO2\nRemin.ReactionReminO2_SO4\nRemin.ReactionReminO2_SO4_CH4","category":"page"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.Remin.ReactionReminPonly","page":"PALEOaqchem Reactions","title":"PALEOaqchem.Remin.ReactionReminPonly","text":"ReactionReminPonly\n\nOrganic particulate matter remineralization (no oxidant use)\n\nParameters\n\nCIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable carbon isotopes and specify isotope type\"\n\nMethods and Variables for default Parameters\n\ndo_remin_Ponly\nremin_P (mol yr-1), VT_ReactTarget, description=\"flux P\"\nremin_N (mol yr-1), VT_ReactTarget, description=\"flux N\"\nremin_Corg (mol yr-1), VT_ReactTarget, description=\"flux Corg\"\nremin_Ccarb (mol yr-1), VT_ReactTarget, description=\"flux Ccarb\"\nsoluteflux_P (mol yr-1), VT_ReactContributor, description=\"flux P\"\n[soluteflux_TNH3] (mol yr-1), VT_ReactContributor, description=\"flux TNH3\"\n[soluteflux_DIC] (mol yr-1), VT_ReactContributor, description=\"flux DIC\"\n[soluteflux_TAlk] (mol yr-1), VT_ReactContributor, description=\"flux TAlk\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.Remin.ReactionReminO2","page":"PALEOaqchem Reactions","title":"PALEOaqchem.Remin.ReactionReminO2","text":"ReactionReminO2\n\nOrganic particulate matter remineralization (O2 oxidant only)\n\nParameters\n\nCIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable carbon isotopes and specify isotope type\"\n\nMethods and Variables for default Parameters\n\ndo_remin_O2\nremin_P (mol yr-1), VT_ReactTarget, description=\"flux P\"\nremin_N (mol yr-1), VT_ReactTarget, description=\"flux N\"\nremin_Corg (mol yr-1), VT_ReactTarget, description=\"flux Corg\"\nremin_Ccarb (mol yr-1), VT_ReactTarget, description=\"flux Ccarb\"\nsoluteflux_P (mol yr-1), VT_ReactContributor, description=\"flux P\"\n[soluteflux_TNH3] (mol yr-1), VT_ReactContributor, description=\"flux TNH3\"\n[soluteflux_DIC] (mol yr-1), VT_ReactContributor, description=\"flux DIC\"\n[soluteflux_TAlk] (mol yr-1), VT_ReactContributor, description=\"flux TAlk\"\nreminOrgOxO2 (mol O2 yr-1), VT_ReactProperty, description=\"oxygen consumption (-ve) by remineralization\"\nRateStoich_reminOrgOxO2\nreminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (-ve) by remineralization\"\n[soluteflux_O2] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxO2\"\ntotals\nreminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (-ve) by remineralization\"\nreminOrgOxO2_total (mol O2 yr-1), VT_ReactProperty, description=\"total oxygen consumption (-ve) by remineralization\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.Remin.ReactionReminO2_SO4","page":"PALEOaqchem Reactions","title":"PALEOaqchem.Remin.ReactionReminO2_SO4","text":"ReactionReminO2_SO4\n\nOrganic particulate matter remineralization (O2, SO4 oxidants)\n\nParameters\n\noxreminlimit[Float64]=0.008 (mol m-3), default_value=0.008, description=\"oxygen concentration below which use of O2 for remineralisation is inhibited\"\nCIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable carbon isotopes and specify isotope type\"\nSIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable sulphur isotopes and specify isotope type\"\n\nMethods and Variables for default Parameters\n\ndo_remin_O2_SO4\nremin_P (mol yr-1), VT_ReactTarget, description=\"flux P\"\nremin_N (mol yr-1), VT_ReactTarget, description=\"flux N\"\nremin_Corg (mol yr-1), VT_ReactTarget, description=\"flux Corg\"\nremin_Ccarb (mol yr-1), VT_ReactTarget, description=\"flux Ccarb\"\nsoluteflux_P (mol yr-1), VT_ReactContributor, description=\"flux P\"\n[soluteflux_TNH3] (mol yr-1), VT_ReactContributor, description=\"flux TNH3\"\n[soluteflux_DIC] (mol yr-1), VT_ReactContributor, description=\"flux DIC\"\n[soluteflux_TAlk] (mol yr-1), VT_ReactContributor, description=\"flux TAlk\"\nO2_conc (mol m-3), VT_ReactDependency, description=\"O2 concentration\"\nreminOrgOxO2 (mol O2 yr-1), VT_ReactProperty, description=\"oxygen consumption (-ve) by remineralization\"\nreminOrgOxSO4 (mol O2eq yr-1), VT_ReactProperty, description=\"2 * sulphate consumption (-ve) by remineralization\"\nRateStoich_reminOrgOxO2\nreminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (-ve) by remineralization\"\n[soluteflux_O2] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxO2\"\nRateStoich_reminOrgOxSO4\nreminOrgOxSO4 (mol O2eq yr-1), VT_ReactDependency, description=\"2 * sulphate consumption (-ve) by remineralization\"\n[soluteflux_SO4] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxSO4\"\n[soluteflux_H2S] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxSO4\"\n[soluteflux_TAlk] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxSO4\"\ntotals\nreminOrgOxSO4 (mol O2eq yr-1), VT_ReactDependency, description=\"2 * sulphate consumption (-ve) by remineralization\"\nreminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (-ve) by remineralization\"\nreminOrgOxSO4_total (mol O2eq yr-1), VT_ReactProperty, description=\"total 2 * sulphate consumption (-ve) by remineralization\"\nreminOrgOxO2_total (mol O2 yr-1), VT_ReactProperty, description=\"total oxygen consumption (-ve) by remineralization\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.Remin.ReactionReminO2_SO4_CH4","page":"PALEOaqchem Reactions","title":"PALEOaqchem.Remin.ReactionReminO2_SO4_CH4","text":"ReactionReminO2_SO4_CH4\n\nOrganic particulate matter remineralization (O2, SO4 oxidants, remaining Corg to CH4)\n\nParameters\n\noxreminlimit[Float64]=0.008 (mol m-3), default_value=0.008, description=\"oxygen concentration below which use of O2 for remineralisation is inhibited\"\nSO4reminlimit[Float64]=1.0 (mol m-3), default_value=1.0, description=\"sulphate concentration below which use of SO4 for remineralisation is inhibited\"\nCIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable carbon isotopes and specify isotope type\"\nSIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable sulphur isotopes and specify isotope type\"\n\nMethods and Variables for default Parameters\n\ndo_remin_O2_SO4_CH4\nremin_P (mol yr-1), VT_ReactTarget, description=\"flux P\"\nremin_N (mol yr-1), VT_ReactTarget, description=\"flux N\"\nremin_Corg (mol yr-1), VT_ReactTarget, description=\"flux Corg\"\nremin_Ccarb (mol yr-1), VT_ReactTarget, description=\"flux Ccarb\"\nsoluteflux_P (mol yr-1), VT_ReactContributor, description=\"flux P\"\n[soluteflux_TNH3] (mol yr-1), VT_ReactContributor, description=\"flux TNH3\"\n[soluteflux_DIC] (mol yr-1), VT_ReactContributor, description=\"flux DIC\"\n[soluteflux_TAlk] (mol yr-1), VT_ReactContributor, description=\"flux TAlk\"\nO2_conc (mol m-3), VT_ReactDependency, description=\"O2 concentration\"\nSO4_conc (mol m-3), VT_ReactDependency, description=\"SO4 concentration\"\nreminOrgOxO2 (mol O2 yr-1), VT_ReactProperty, description=\"oxygen consumption (-ve) by remineralization\"\nreminOrgOxSO4 (mol O2eq yr-1), VT_ReactProperty, description=\"2 * sulphate consumption (-ve) by remineralization\"\nreminOrgOxCH4 (mol O2eq yr-1), VT_ReactProperty, description=\"2 * DIC -> methane (-ve) by remineralization\"\nRateStoich_reminOrgOxO2\nreminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (-ve) by remineralization\"\n[soluteflux_O2] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxO2\"\nRateStoich_reminOrgOxSO4\nreminOrgOxSO4 (mol O2eq yr-1), VT_ReactDependency, description=\"2 * sulphate consumption (-ve) by remineralization\"\n[soluteflux_SO4] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxSO4\"\n[soluteflux_H2S] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxSO4\"\n[soluteflux_TAlk] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxSO4\"\nRateStoich_reminOrgOxCH4\nreminOrgOxCH4 (mol O2eq yr-1), VT_ReactDependency, description=\"2 * DIC -> methane (-ve) by remineralization\"\n[soluteflux_DIC] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxCH4\"\n[soluteflux_CH4] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxCH4\"\ntotals\nreminOrgOxSO4 (mol O2eq yr-1), VT_ReactDependency, description=\"2 * sulphate consumption (-ve) by remineralization\"\nreminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (-ve) by remineralization\"\nreminOrgOxCH4 (mol O2eq yr-1), VT_ReactDependency, description=\"2 * DIC -> methane (-ve) by remineralization\"\nreminOrgOxSO4_total (mol O2eq yr-1), VT_ReactProperty, description=\"total 2 * sulphate consumption (-ve) by remineralization\"\nreminOrgOxO2_total (mol O2 yr-1), VT_ReactProperty, description=\"total oxygen consumption (-ve) by remineralization\"\nreminOrgOxCH4_total (mol O2eq yr-1), VT_ReactProperty, description=\"total 2 * DIC -> methane (-ve) by remineralization\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#Secondary-redox","page":"PALEOaqchem Reactions","title":"Secondary redox","text":"","category":"section"},{"location":"PALEOaqchem Reactions/","page":"PALEOaqchem Reactions","title":"PALEOaqchem Reactions","text":"SecondaryRedox.ReactionRedoxH2S_O2\nSecondaryRedox.ReactionRedoxCH4_O2\nSecondaryRedox.ReactionRedoxCH4_SO4","category":"page"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.SecondaryRedox.ReactionRedoxH2S_O2","page":"PALEOaqchem Reactions","title":"PALEOaqchem.SecondaryRedox.ReactionRedoxH2S_O2","text":"ReactionRedoxH2S_O2\n\nSulphide oxidation by oxygen.\n\nRate R_H2S_O2 Units Ref Notes\n1.6e5 (mol l-1)-1 yr-1 (Van Cappellen and Wang, 1996) \n3.65e6 (mol l-1)-1 yr-1 (Ozaki et al., 2011) \n54e6 (mol l-1)-1 yr-1 (Romaniello and Derry, 2010) \n\nParameters\n\nR_H2S_O2[Float64]=3650.0 ((mol m-3)-1 yr-1), default_value=3650.0, description=\"rate constant\"\nSIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable sulphur isotopes and specify isotope type\"\n\nMethods and Variables for default Parameters\n\ndo_redox_H2S_O2\nredox_H2S_O2 (mol O2 yr-1), VT_ReactProperty, description=\"oxygen consumption (+ve) by H2S oxidation\"\nO2_conc (mol m-3), VT_ReactDependency, description=\"O2 concentration\"\nH2S_conc (mol m-3), VT_ReactDependency, description=\"H2S concentration\"\nvolume (m3), VT_ReactDependency, description=\"box fluid volume\"\nRateStoich_redox_H2S_O2\nredox_H2S_O2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (+ve) by H2S oxidation\"\n[O2_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_H2S_O2\"\n[H2S_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_H2S_O2\"\n[SO4_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_H2S_O2\"\n[TAlk_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_H2S_O2\"\ntotals\nredox_H2S_O2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (+ve) by H2S oxidation\"\nredox_H2S_O2_total (mol O2 yr-1), VT_ReactProperty, description=\"total oxygen consumption (+ve) by H2S oxidation\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.SecondaryRedox.ReactionRedoxCH4_O2","page":"PALEOaqchem Reactions","title":"PALEOaqchem.SecondaryRedox.ReactionRedoxCH4_O2","text":"ReactionRedoxCH4_O2\n\nMethane oxidation by oxygen.\n\nRate R_CH4_O2 Units Ref Notes\n1e10 (mol l-1)-1 yr-1 (Van Cappellen and Wang, 1996) \n10e6 (mol l-1)-1 yr-1 TODO \n\nParameters\n\nR_CH4_O2[Float64]=10000.0 ((mol m-3)-1 yr-1), default_value=10000.0, description=\"rate constant\"\nCIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable carbon isotopes and specify isotope type\"\n\nMethods and Variables for default Parameters\n\ndo_redox_CH4_O2\nredox_CH4_O2 (mol O2 yr-1), VT_ReactProperty, description=\"oxygen consumption (+ve) by CH4 oxidation\"\nO2_conc (mol m-3), VT_ReactDependency, description=\"O2 concentration\"\nCH4_conc (mol m-3), VT_ReactDependency, description=\"CH4 concentration\"\nvolume (m3), VT_ReactDependency, description=\"box fluid volume\"\nRateStoich_redox_CH4_O2\nredox_CH4_O2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (+ve) by CH4 oxidation\"\n[O2_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_CH4_O2\"\n[CH4_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_CH4_O2\"\n[DIC_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_CH4_O2\"\ntotals\nredox_CH4_O2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (+ve) by CH4 oxidation\"\nredox_CH4_O2_total (mol O2 yr-1), VT_ReactProperty, description=\"total oxygen consumption (+ve) by CH4 oxidation\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.SecondaryRedox.ReactionRedoxCH4_SO4","page":"PALEOaqchem Reactions","title":"PALEOaqchem.SecondaryRedox.ReactionRedoxCH4_SO4","text":"ReactionRedoxCH4_SO4\n\nMethane oxidation by sulphate (anaerobic methane oxidation).\n\nRate R_CH4_SO4 Units Ref Notes\n1e4 (mol l-1)-1 yr-1 (Van Cappellen and Wang, 1996) k17\n\nParameters\n\nR_CH4_SO4[Float64]=10.0 ((mol m-3)-1 yr-1), default_value=10.0, description=\"rate constant\"\nCIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable carbon isotopes and specify isotope type\"\n\nMethods and Variables for default Parameters\n\ndo_redox_CH4_SO4\nredox_CH4_SO4 (mol CH4/SO4 yr-1), VT_ReactProperty, description=\"sulphate consumption (+ve) by CH4 oxidation\"\nSO4_conc (mol m-3), VT_ReactDependency, description=\"SO4 concentration\"\nCH4_conc (mol m-3), VT_ReactDependency, description=\"CH4 concentration\"\nvolume (m3), VT_ReactDependency, description=\"box fluid volume\"\nRateStoich_redox_CH4_SO4\nredox_CH4_SO4 (mol CH4/SO4 yr-1), VT_ReactDependency, description=\"sulphate consumption (+ve) by CH4 oxidation\"\n[SO4_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_CH4_SO4\"\n[CH4_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_CH4_SO4\"\n[DIC_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_CH4_SO4\"\n[H2S_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_CH4_SO4\"\n[TAlk_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_CH4_SO4\"\ntotals\nredox_CH4_SO4 (mol CH4/SO4 yr-1), VT_ReactDependency, description=\"sulphate consumption (+ve) by CH4 oxidation\"\nredox_CH4_SO4_total (mol CH4/SO4 yr-1), VT_ReactProperty, description=\"total sulphate consumption (+ve) by CH4 oxidation\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#Carbonate-chemistry","page":"PALEOaqchem Reactions","title":"Carbonate chemistry","text":"","category":"section"},{"location":"PALEOaqchem Reactions/","page":"PALEOaqchem Reactions","title":"PALEOaqchem Reactions","text":"CarbChem.ReactionCO2SYS","category":"page"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.CarbChem.ReactionCO2SYS","page":"PALEOaqchem Reactions","title":"PALEOaqchem.CarbChem.ReactionCO2SYS","text":"ReactionCO2SYS\n\nCarbonate chemistry using PALEOcarbchem.\n\nThree different pH solver approaches are supported, set by Parameter solve_pH:\n\nsolve: iterative solution for pH, TAlk is a StateExplicit Variable (eg using explicit ODE solver)\nconstraint: additional State Variable for pH and algebraic Constraint for TAlk (requires DAE solver).\nimplicit: TAlk is a Total Variable, a function of a State Variable for pH (requires DAE solver)\n\nParameters\n\nWhichKs[Int64]=10, default_value=10, description=\"PALEOcarbchem WhichKs choice of eqb constant data\"\nWhoseKSO4[Int64]=1, default_value=1, description=\"PALEOcarbchem WhoseKSO4 choice of eqb constant data\"\ncomponents[Vector{String}]=[\"Ci\", \"S\", \"F\", \"B\", \"Omega\"], default_value=[\"Ci\", \"S\", \"F\", \"B\", \"Omega\"], allowed_values=[\"Ci\", \"S\", \"F\", \"P\", \"B\", \"Si\", \"H2S\", \"NH3\", \"Omega\"], description=\"PALEOcarbchem optional contributions to TAlk\"\ndefaultconcs[Vector{String}]=[\"TS\", \"TF\", \"TB\", \"Ca\"], default_value=[\"TS\", \"TF\", \"TB\", \"Ca\"], allowed_values=[\"TS\", \"TF\", \"TB\", \"Ca\"], description=\"PALEOcarbchem default concentrations (modern values calculated from salinity)\"\noutputs[Vector{String}]=[\"pCO2\", \"xCO2dryinp\"], default_value=[\"pCO2\", \"xCO2dryinp\"], description=\"PALEOcarbchem output concentrations etc to include as output variables\"\noutput_pHtot[Bool]=true, default_value=true, description=\"true to output pHtot (requires TS_conc and TF_conc)\"\nsolve_pH[String]=\"solve\", default_value=\"solve\", allowed_values=[\"solve\", \"constraint\", \"implicit\"], description=\"'solve' to solve iteratively for pH, 'constraint' to include [pHfree] as a state variable and TAlk as a constraint, 'implicit' to include [pHfree] as a state variable and TAlk an implicit variable\"\npHtol[Float64]=2.220446049250313e-14, default_value=2.220446049250313e-14, description=\"pH tolerance for iterative solution\"\nsimd_width[String]=\"1\", default_value=\"1\", allowed_values=[\"1\", \"FP64P2\", \"FP64P4\", \"FP32P4\", \"FP32P8\"], description=\"use SIMD (\"1\" - no SIMD, \"FP64P4\" - 4 x Float64, etc)\"\n\nMethods and Variables for default Parameters\n\ndo_modern_default_concs\nvolume (m^3), VT_ReactDependency, description=\"Cell volume\"\nrho_ref (kg m^-3), VT_ReactDependency, description=\"density conversion factor\"\ntemp (Kelvin), VT_ReactDependency, description=\"temperature\"\npressure (dbar), VT_ReactDependency, description=\"pressure\"\nsal (psu), VT_ReactDependency, description=\"salinity\"\nTS_conc (mol m^-3), VT_ReactProperty, description=\"TS_conc modern default scaled from salinity\"\nTF_conc (mol m^-3), VT_ReactProperty, description=\"TF_conc modern default scaled from salinity\"\nTB_conc (mol m^-3), VT_ReactProperty, description=\"TB_conc modern default scaled from salinity\"\nCa_conc (mol m^-3), VT_ReactProperty, description=\"Ca_conc modern default scaled from salinity\"\ndo_carbchem\nvolume (m^3), VT_ReactDependency, description=\"Cell volume\"\nrho_ref (kg m^-3), VT_ReactDependency, description=\"density conversion factor\"\ntemp (Kelvin), VT_ReactDependency, description=\"temperature\"\npressure (dbar), VT_ReactDependency, description=\"pressure\"\nsal (psu), VT_ReactDependency, description=\"salinity\"\npHfree (), VT_ReactProperty, description=\"-log10(hydrogen ion concentration)\"\nTAlk_conc (mol m^-3), VT_ReactDependency, description=\"total TAlk concentration\"\npHtot (), VT_ReactProperty, description=\"-log10([H] + [HS]), pH on total scale\"\nTCi_conc (mol m^-3), VT_ReactDependency, description=\"TCi_concinput concentration\"\nTS_conc (mol m^-3), VT_ReactDependency, description=\"TS_concinput concentration\"\nTF_conc (mol m^-3), VT_ReactDependency, description=\"TF_concinput concentration\"\nTB_conc (mol m^-3), VT_ReactDependency, description=\"TB_concinput concentration\"\nCa_conc (mol m^-3), VT_ReactDependency, description=\"Ca_concinput concentration\"\npCO2 –> %reaction%pCO2 (atm), VT_ReactProperty, description=\"CO2 partial pressure\"\nxCO2dryinp –> %reaction%xCO2dryinp (), VT_ReactProperty, description=\"mixing ratio of CO2 in dry air at 1 atm (always > pCO2 due to H2O vapour pressure)\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#Isotope-systems","page":"PALEOaqchem Reactions","title":"Isotope systems","text":"","category":"section"},{"location":"PALEOaqchem Reactions/#Boron","page":"PALEOaqchem Reactions","title":"Boron","text":"","category":"section"},{"location":"PALEOaqchem Reactions/","page":"PALEOaqchem Reactions","title":"PALEOaqchem Reactions","text":"Boron.ReactionBoronIsotope","category":"page"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.Boron.ReactionBoronIsotope","page":"PALEOaqchem Reactions","title":"PALEOaqchem.Boron.ReactionBoronIsotope","text":"ReactionBoronIsotope\n\nCalculate d11B for aqueous B(OH)4- and B(OH)3 species from mass balance, given d11B for total B, total B concentration B_conc and B(OH)4- concentration BOH4_conc.\n\nSee eg (Zeebe and Wolf-Gladrow, 2001), p220.\n\nParameters\n\nalphaB[Float64]=1.0272, default_value=1.0272, description=\"isotopic fractionation factor B(OH)4m <-> B(OH)3\"\nBIsotope[external, UnionAll]=PALEOboxes.IsotopeLinear, default_value=PALEOboxes.IsotopeLinear, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable boron isotopes and specify isotope type\"\n\nMethods and Variables\n\ndo_boron_isotope\nB_conc (mol m-3), VT_ReactDependency, description=\"B concentration\"\nBOH4_conc (mol m-3), VT_ReactDependency, description=\"B(OH)4m concentration\"\nB_delta (per mil), VT_ReactDependency, description=\"d11B delta for total B\"\nBOH4_delta (per mil), VT_ReactProperty, description=\"d11B delta for B(OH)4- species\"\n\n\n\n\n\n","category":"type"},{"location":"#PALEOaqchem.jl","page":"PALEOaqchem.jl","title":"PALEOaqchem.jl","text":"","category":"section"},{"location":"","page":"PALEOaqchem.jl","title":"PALEOaqchem.jl","text":"Aquatic biogeochemistry for PALEO framework","category":"page"}] +[{"location":"PALEOaqchem functions/#PALEOaqchem-functions","page":"PALEOaqchem functions","title":"PALEOaqchem functions","text":"","category":"section"},{"location":"PALEOaqchem functions/","page":"PALEOaqchem functions","title":"PALEOaqchem functions","text":"CurrentModule = PALEOaqchem","category":"page"},{"location":"PALEOaqchem functions/","page":"PALEOaqchem functions","title":"PALEOaqchem functions","text":"O2AlkUptakeRemin","category":"page"},{"location":"PALEOaqchem functions/#PALEOaqchem.O2AlkUptakeRemin","page":"PALEOaqchem functions","title":"PALEOaqchem.O2AlkUptakeRemin","text":"O2AlkUptakeRemin(Corg, (NO3, TNH3, Ngas), TPO4, Ccarb; rO2Corg=1) -> (O2, Alk)\n\nOxygen and alkalinity assimilated for production (or released by remineralisation) of particulate matter with specified Corg, Ccarb from specified nitrate NO3, total ammonia TNH3, gaseous N, total phosphate TPO4\n\nNB sign: for Corg +ve, O2 is -ve (ie quantity to subtract from tracer sms for production, or add for remineralisation)\n\nExamples\n\njulia> PALEOaqchem.O2AlkUptakeRemin(106.0, (0.0, 0.0, 0.0), 1.0, 0.0) # Corg:P = 106:1, no N\n(-106.0, 0.0)\n\njulia> PALEOaqchem.O2AlkUptakeRemin(106.0, (16.0, 0.0, 0.0), 1.0, 0.0) # Corg:NO3:P = 106:16:1\n(-138.0, -16.0)\n\njulia> PALEOaqchem.O2AlkUptakeRemin(106.0, (0.0, 16.0, 0.0), 1.0, 0.0) # Corg:TNH3:P = 106:16:1\n(-106.0, 16.0)\n\n\n\n\n\n","category":"function"},{"location":"PALEOaqchem functions/","page":"PALEOaqchem functions","title":"PALEOaqchem functions","text":"CurrentModule = PALEOaqchem.MolecularDiffusion","category":"page"},{"location":"PALEOaqchem functions/","page":"PALEOaqchem functions","title":"PALEOaqchem functions","text":"create_solute_diffusivity_func\nsw_dynamic_viscosity","category":"page"},{"location":"PALEOaqchem functions/#PALEOaqchem.MolecularDiffusion.create_solute_diffusivity_func","page":"PALEOaqchem functions","title":"PALEOaqchem.MolecularDiffusion.create_solute_diffusivity_func","text":"create_solute_diffusivity_func(species_or_constant::AbstractString) -> f_diffcoeff\n\nMolecular diffusivity for species_or_constant in water\n\nBased on data compiled by (Boudreau, 1997) Ch. 4\n\nIf species_or_constant is a species name, returns a function f_diffcoeff, which calculates:\n\nf_diffcoeff(TdegK, Pbar, S) -> Dmol (cm^2/s)\n\nIf species_or_constant can be parsed into a Float64, returns a function which provides this constant value (units cm^2/s).\n\nThe effect of pressure and salinity is approximated by assuming viscosity (calculated by MolecularDiffusion.sw_dynamic_viscosity) is the primary consideration, (Boudreau, 1997) eqn. 4.107 and Table 4.10.\n\n\n\n\n\n","category":"function"},{"location":"PALEOaqchem functions/#PALEOaqchem.MolecularDiffusion.sw_dynamic_viscosity","page":"PALEOaqchem functions","title":"PALEOaqchem.MolecularDiffusion.sw_dynamic_viscosity","text":"sw_dynamic_viscosity(TdegC, Pbar, S) -> mu\n\nSeawater dynamic viscosity ((Boudreau, 1997) p94) 'claimed to accurate to within 7% over T (0 - 30C), P (1 - 1000 bar), S (0 36)'\n\nReturns mu (10^-2 g/cm/s) (centipoise)\n\nArguments:\n\nT: deg C (0 - 30C) temperature \nP: bar (1 1000) pressure\nS: salinity (0 - 36)\n\nSee check values for salinity effect Table 4.10 p.125\n\n\n\n\n\n","category":"function"},{"location":"References/#References","page":"References","title":"References","text":"","category":"section"},{"location":"References/","page":"References","title":"References","text":"Boudreau, B. P. (1997). Diagenetic models and their implementation; modelling transport and reactions in aquatic sediments (Springer); p. 414.\n\n\n\nvan Heuven, S.; Pierrot, D.; Rae, J.; Lewis, E. and Wallace, D. (2011). MATLAB Program Developed for CO2 System Calculations. ORNL/CDIAC-105b (Carbon Dioxide Information Analysis Center, Oak Ridge National Laboratory, U.S. Department of Energy, Oak Ridge, Tennessee.).\n\n\n\nLewis, E. and Wallace, D. W. (1998). Program Developed for CO2 System Calculations. ORNL/CDIAC-105 (Carbon Dioxide Inf. Anal. Cent., Oak Ridge Natl. Lab., Oak Ridge, Tenn.).\n\n\n\nOzaki, K.; Tajima, S. and Tajika, E. (2011). Conditions required for oceanic anoxia/euxinia: Constraints from a one-dimensional ocean biogeochemical cycle model. Earth and Planetary Science Letters 304, 270–279.\n\n\n\nRomaniello, S. J. and Derry, L. A. (2010). Validation of an intermediate-complexity model for simulating marine biogeochemistry under anoxic conditions in the modern Black Sea. Geochemistry Geophysics Geosystems 11, 1–18.\n\n\n\nZeebe, R. E. and Wolf-Gladrow, D. a. (2001). CO2 in Seawater: Equilibrium, Kinetics, Isotopes (Elsevier); p. 360.\n\n\n\nVan Cappellen, P. and Wang, Y. (1996). Cycling of iron and manganese in surface sediments; a general theory for the coupled transport and reaction of carbon, oxygen, nitrogen, sulfur, iron, and manganese. American Journal of Science 296, 197–243.\n\n\n\n","category":"page"},{"location":"PALEOcarbchem/#PALEOcarbchem","page":"PALEOcarbchem","title":"PALEOcarbchem","text":"","category":"section"},{"location":"PALEOcarbchem/","page":"PALEOcarbchem","title":"PALEOcarbchem","text":"CurrentModule = PALEOaqchem","category":"page"},{"location":"PALEOcarbchem/","page":"PALEOcarbchem","title":"PALEOcarbchem","text":"PALEOcarbchem","category":"page"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem","text":"PALEOcarbchem\n\nCarbonate chemistry equilibrium translated from Matlab CO2SYS v1.1 (van Heuven et al., 2011), (Lewis and Wallace, 1998) and refactored for speed.\n\nImplementation based on CO2SYS constants, with reimplemented equilibrium calculation.\n\nNB: \n\nAlthough effective equilibrium constants can be calculated for different pH scales, TAlk or pH calculations using PALEOcarbchem.calculateTAfromTCpHfree!\n\nrequire constants to be on the free pH scale.\n\nEffective equilibrium constants are empirical measurements hence are only accurate for modern seawater composition.\n\nExample usage with default choice of constants, all components enabled:\n\njulia> PALEOcarbchem.ComponentsAllStrings # all available components\n(\"Ci\", \"S\", \"F\", \"B\", \"P\", \"Si\", \"H2S\", \"NH3\", \"Omega\")\n\njulia> comps, concinputs = PALEOcarbchem.get_components_inputs([\"Ci\", \"S\", \"F\", \"B\", \"P\", \"Si\", \"H2S\", \"NH3\", \"Omega\"])\n((Ci = Val{true}(), S = Val{true}(), F = Val{true}(), B = Val{true}(), P = Val{true}(), Si = Val{true}(), H2S = Val{true}(), NH3 = Val{true}(), Omega = Val{true}()), [\"TCi\", \"TS\", \"TF\", \"TB\", \"TP\", \"TSi\", \"TH2S\", \"TNH3\", \"Ca\"])\n\njulia> println(concinputs) # concentrations required (in addition to TAlk)\n[\"TCi\", \"TS\", \"TF\", \"TB\", \"TP\", \"TSi\", \"TH2S\", \"TNH3\", \"Ca\"] \n\njulia> options = (; WhichKs=Val(10), WhoseKSO4=Val(1), pHScale=Val(3), Components=comps)\n(WhichKs = Val{10}(), WhoseKSO4 = Val{1}(), pHScale = Val{3}(), Components = (Ci = Val{true}(), S = Val{true}(), F = Val{true}(), B = Val{true}(), P = Val{true}(), Si = Val{true}(), H2S = Val{true}(), NH3 = Val{true}(), Omega = Val{true}()))\n\njulia> C = zeros(length(PALEOcarbchem.ConstNames));\n\njulia> PALEOcarbchem.calc_constants!(C, 25.0, 1000.0, 35.0, Options=options) # Temp(C), P(dbar), Sal(psu)\n\njulia> C_NT = NamedTuple{PALEOcarbchem.ConstNames}(C); # convert to NamedTuple for convenience\n\njulia> map(x -> @sprintf(\"%.14e\", x), C_NT)\n(TF = \"6.83258396883673e-05\", TS = \"2.82354341328601e-02\", fH = \"7.13404318750000e-01\", VPFac = \"9.69344700036820e-01\", KW = \"5.12594224560177e-14\", KF = \"2.46750587115740e-03\", KS = \"1.07228495518292e-01\", K0 = \"2.83918818040155e-02\", K1 = \"1.23204547404511e-06\", K2 = \"9.14637929020938e-10\", FugFac = \"9.96810458692103e-01\", KB = \"2.23064975910959e-09\", KP1 = \"2.01400858730558e-02\", KP2 = \"9.31686820250764e-07\", KP3 = \"1.40307711726248e-09\", KSi = \"3.62200612635021e-10\", KH2S = \"2.60000514374855e-07\", KNH3 = \"4.74226503827862e-10\", KCa = \"4.92763187414538e-07\", KAr = \"7.39194729649679e-07\")\n\njulia> modern_concs = PALEOcarbchem.calc_modern_default_concs(35.0, Options=options);\n\njulia> map(x -> @sprintf(\"%.14e\", x), modern_concs)\n(TF = \"6.83258396883673e-05\", TS = \"2.82354341328601e-02\", TB = \"4.15700000000000e-04\", Ca = \"1.02845697008497e-02\")\n\njulia> input_concs = (TCi=[2000e-6], TS=[modern_concs.TS], TF=[modern_concs.TF], TSi=[1e-3], TP=[1e-6], TB=[modern_concs.TB], TH2S=[1e-6], TNH3=[1e-6], Ca=[modern_concs.Ca]); # all in mol kg-1\n\njulia> res = zeros(length(PALEOcarbchem.ResultNames));\n\njulia> (pHfree, steps) = PALEOcarbchem.calculatepHfromTATC!(res, C, options, 2300e-6, input_concs);\n\njulia> @printf(\"%.14f\", pHfree)\n8.04695972423890\n\njulia> steps\n5\n\njulia> res_NT = NamedTuple{PALEOcarbchem.ResultNames}(res); # convert to NamedTuple for convenience\n\njulia> map(x -> @sprintf(\"%.14e\", x), res_NT)\n(pHfree = \"8.04695972423890e+00\", H = \"8.97512024441008e-09\", OH = \"5.71127974446284e-06\", TA = \"2.30000000000000e-03\", dTAdpH = \"6.71952166583155e-04\", TS = \"2.82354341328601e-02\", HSO4 = \"2.36333069917159e-09\", TF = \"6.83258396883673e-05\", HF = \"2.48522365702671e-10\", TCi = \"2.00000000000000e-03\", CO2 = \"1.31351930129921e-05\", HCO3 = \"1.80311290118315e-03\", CO3 = \"1.83751905803853e-04\", CAlk = \"2.17061671279086e-03\", fCO2 = \"4.62639042514413e-04\", pCO2 = \"4.64119370418157e-04\", xCO2dryinp = \"4.78797037215479e-04\", TB = \"4.15700000000000e-04\", BAlk = \"8.27503245712347e-05\", TP = \"1.00000000000000e-06\", H3PO4 = \"3.68183719676091e-15\", H2PO4 = \"8.26200822875433e-09\", HPO4 = \"8.57660283752523e-07\", PO4 = \"1.34077704336885e-07\", PengCorrection = \"0.00000000000000e+00\", PAlk = \"1.12581568874446e-06\", TSi = \"1.00000000000000e-03\", SiAlk = \"3.87906357916080e-05\", TH2S = \"1.00000000000000e-06\", HSAlk = \"9.66632218352735e-07\", TNH3 = \"1.00000000000000e-06\", NH3Alk = \"5.01861680455629e-08\", Ca = \"1.02845697008497e-02\", OmegaCA = \"3.83512675291204e+00\", OmegaAR = \"2.55657840498853e+00\")\n\njulia> pHtot = PALEOcarbchem.mappHscale(C, pHfree, Val(3), Val(1), res_NT.TS, res_NT.TF);\n\njulia> @printf(\"%.14f\", pHtot)\n7.94544626702045\n\n\n\n\n\n","category":"module"},{"location":"PALEOcarbchem/","page":"PALEOcarbchem","title":"PALEOcarbchem","text":"CurrentModule = PALEOaqchem.PALEOcarbchem","category":"page"},{"location":"PALEOcarbchem/#Inputs-and-equilibrium-constants","page":"PALEOcarbchem","title":"Inputs and equilibrium constants","text":"","category":"section"},{"location":"PALEOcarbchem/","page":"PALEOcarbchem","title":"PALEOcarbchem","text":"ComponentsAll\nget_components_inputs\nConstNames\nCNameIdx\ngetConstDescription\ncalc_constants!\ncalc_limits\ncalc_modern_default_concs","category":"page"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.ComponentsAll","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.ComponentsAll","text":"ComponentsAll::NamedTuple\nComponentsAllStrings::Vector{String}\n\nAll available components\n\njulia> PALEOcarbchem.ComponentsAll\n(Ci = Val{true}(), S = Val{true}(), F = Val{true}(), B = Val{true}(), P = Val{true}(), Si = Val{true}(), H2S = Val{true}(), NH3 = Val{true}(), Omega = Val{true}())\n\njulia> PALEOcarbchem.ComponentsAllStrings # all available components\n(\"Ci\", \"S\", \"F\", \"B\", \"P\", \"Si\", \"H2S\", \"NH3\", \"Omega\")\n\n\n\n\n\n","category":"constant"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.get_components_inputs","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.get_components_inputs","text":"get_components_inputs(compstoenable) -> (components::NamedTuple, concinputs::Vector{String})\n\nReturns components and concinputs required for specified compstoenable\n\ncompstoenable is a list (Vector or Tuple) with component names as Strings, eg [\"Ci\", \"B\", \"Si\"] \n\nReturns:\n\na NamedTuple components with those components present in compstoenable as Val{true} and others as Val{false}\na Vector concinputs of input concentrations required (P requires TP etc).\n\nExamples\n\nAll components:\n\njulia> compsall, concinputsall = PALEOcarbchem.get_components_inputs([\"Ci\", \"S\", \"F\", \"B\", \"P\", \"Si\", \"H2S\", \"NH3\", \"Omega\"])\n((Ci = Val{true}(), S = Val{true}(), F = Val{true}(), B = Val{true}(), P = Val{true}(), Si = Val{true}(), H2S = Val{true}(), NH3 = Val{true}(), Omega = Val{true}()), [\"TCi\", \"TS\", \"TF\", \"TB\", \"TP\", \"TSi\", \"TH2S\", \"TNH3\", \"Ca\"])\n\njulia> compsall\n(Ci = Val{true}(), S = Val{true}(), F = Val{true}(), B = Val{true}(), P = Val{true}(), Si = Val{true}(), H2S = Val{true}(), NH3 = Val{true}(), Omega = Val{true}())\n\njulia> println(concinputsall) # concentrations required (in addition to TAlk)\n[\"TCi\", \"TS\", \"TF\", \"TB\", \"TP\", \"TSi\", \"TH2S\", \"TNH3\", \"Ca\"]\n\nAll optional components disabled (just H2O)\n\njulia> compsminimal, concinputsminimal = PALEOcarbchem.get_components_inputs([])\n((Ci = Val{false}(), S = Val{false}(), F = Val{false}(), B = Val{false}(), P = Val{false}(), Si = Val{false}(), H2S = Val{false}(), NH3 = Val{false}(), Omega = Val{false}()), String[])\n\njulia> println(concinputsminimal)\nString[]\n\n\n\n\n\n","category":"function"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.ConstNames","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.ConstNames","text":"ConstNames::Tuple\n\nAll available CO2SYS effective equilibrium constant names\n\n\n\n\n\n","category":"constant"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.CNameIdx","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.CNameIdx","text":"CNameIdx::NamedTuple\n\nIndices of constants in a Vector of length(ConstNames)\n\n\n\n\n\n","category":"constant"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.getConstDescription","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.getConstDescription","text":"getConstDescription(constName::AbstractString) -> (constName, units, description)\n\nGet human-readable description of constName\n\n\n\n\n\n","category":"function"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.calc_constants!","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.calc_constants!","text":"calc_constants!(\n Cout, TempC_input, Pdbar, Sal_input; \n Options=(; WhichKs=Val(10), WhoseKSO4=Val(1), pHScale=Val(3), Components=ComponentsAll))\n\nCalculate carbonate chemistry constants, results are returned in Cout.\n\nArguments:\n\nCout::Vector: (output) Vector of length length(ConstNames) with calculated equilibrium constants\nTempC_input: temperature deg C. Will be limited to valid range for constants in use (from calc_limits)\nPdbar: pressure, dbar. \nSal_input: salinity. Will be limited to valid range for constants in use (from calc_limits)\nOptions: NamedTuple with fields:\nWhichKs: Val(Int), default Val(10) \nWhoseKSO4: Val(Int), default Val(1) \npHScale: Val(Int), default Val(3) (free - required for calculateTAfromTCpHfree!)\nComponents: components to enable as generated by get_components_inputs \n\nWhichKs:\n\nK1 K2 dissociation constants that are to be used. Val(Int) where Int is:\n\n1 = Roy, 1993\t\t\t\t\t\t\t\t\t\t\tT: 0-45 S: 5-45. Total scale. Artificial seawater.\n2 = Goyet & Poisson\t\t\t\t\t\t\t\t\t\tT: -1-40 S: 10-50. Seaw. scale. Artificial seawater.\n3 = HANSSON refit BY DICKSON AND MILLERO\tT: 2-35 S: 20-40. Seaw. scale. Artificial seawater.\n4 = MEHRBACH refit BY DICKSON AND MILLERO\tT: 2-35 S: 20-40. Seaw. scale. Artificial seawater.\n5 = HANSSON and MEHRBACH refit BY DICKSON AND MILLERO\tT: 2-35 S: 20-40. Seaw. scale. Artificial seawater.\n6 = GEOSECS (i.e., original Mehrbach)\t\t\t\t\tT: 2-35 S: 19-43. NBS scale. Real seawater.\n7 = Peng\t(i.e., originam Mehrbach but without XXX)\tT: 2-35 S: 19-43. NBS scale. Real seawater.\n8 = Millero, 1979, FOR PURE WATER ONLY (i.e., Sal=0)\tT: 0-50 S: 0.\n9 = Cai and Wang, 1998\t\t\t\t\t\t\t\t\tT: 2-35 S: 0-49. NBS scale. Real and artificial seawater.\n10 = Lueker et al, 2000\t\t\t\t\t\t\t\t\tT: 2-35 S: 19-43. Total scale. Real seawater.\n11 = Mojica Prieto and Millero, 2002.\t\t\t\t\tT: 0-45 S: 5-42. Seaw. scale. Real seawater\n12 = Millero et al, 2002\t\t\t\t\t\t\t\t\tT: -1.6-35 S: 34-37. Seaw. scale. Field measurements.\n13 = Millero et al, 2006\t\t\t\t\t\t\t\t\tT: 0-50 S: 1-50. Seaw. scale. Real seawater.\n14 = Millero et al, 2010\t\t\t\t\t\t\t\t\tT: 0-50 S: 1-50. Seaw. scale. Real seawater.\n\nWhichKs=Val(10) (Lueker etal (2000) parameters.)\n\nRecommended as 'best practice' by Dickson (2007) (as cited in Orr, J. C., Epitalon, J-M., & Gattuso, J-P. (2014). Comparison of seven packages that compute ocean carbonate chemistry. Biogeosciences Discussions, 11(4), 5327�5397. doi:10.5194/bgd-11-5327-2014 )\n\nWhoseKSO4:\n\nKSO4 dissociation constants that are to be used, in combination with the formulation of the borate-to-salinity ratio to be used. Having both these choices in a single argument is somewhat awkward, but it maintains syntax compatibility with the previous version. Val(Int) where Int is:\n\n1 = KSO4 of Dickson & TB of Uppstrom 1979 (PREFERRED)\n2 = KSO4 of Khoo & TB of Uppstrom 1979\n3 = KSO4 of Dickson & TB of Lee 2010\n4 = KSO4 of Khoo & TB of Lee 2010\n\npHScale: Set pH scale.\n\nVal(Int) where Int is:\n\n1 = Total scale\n2 = Seawater scale\n3 = Free scale [required for PALEOcarbchem solvers]\n4 = NBS scale\n\nImplementation\n\nModified CO2SYS Constants, split into functions for maintainability\n\nComments from the original code:\n\n% SUB Constants, version 04.01, 10-13-97, written by Ernie Lewis.\n% Inputs: pHScale%, WhichKs%, WhoseKSO4%, Sali, TempCi, Pdbar\n% Outputs: K0, K(), T(), fH, FugFac, VPFac\n% This finds the Constants of the CO2 system in seawater or freshwater,\n% corrects them for pressure, and reports them on the chosen pH scale.\n% The process is as follows: the Constants (except KS, KF which stay on the\n% free scale - these are only corrected for pressure) are\n% 1) evaluated as they are given in the literature\n% 2) converted to the SWS scale in mol/kg-SW or to the NBS scale\n% 3) corrected for pressure\n% 4) converted to the SWS pH scale in mol/kg-SW\n% 5) converted to the chosen pH scale\n%\n% PROGRAMMER'S NOTE: all logs are log base e\n% PROGRAMMER'S NOTE: all Constants are converted to the pH scale\n% pHScale% (the chosen one) in units of mol/kg-SW\n% except KS and KF are on the free scale\n% and KW is in units of (mol/kg-SW)^2\n\nJulia-specific details:\n\nWhichKs, WhoseKSO4, pHScale are passed as Types (using Val(Int)), not integer values, so that Julia can work out which constants and functions to call at compile time. Similarly, Comps is a Type which encodes the selection of components, so the appropriate code is generated (components included or excluded) at compile time.\n\n\n\n\n\n","category":"function"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.calc_limits","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.calc_limits","text":"calc_limits( Val{WhichKs::Int}) -> (TminC, TmaxC, salmin, salmax)\n\nReturn range limits for constant set WhichKs:\n\n1 = Roy, 1993\t\t\t\t\t\t\t\t\t\t\tT: 0-45 S: 5-45. Total scale. Artificial seawater.\n2 = Goyet & Poisson\t\t\t\t\t\t\t\t\t\tT: -1-40 S: 10-50. Seaw. scale. Artificial seawater.\n3 = HANSSON refit BY DICKSON AND MILLERO\tT: 2-35 S: 20-40. Seaw. scale. Artificial seawater.\n4 = MEHRBACH refit BY DICKSON AND MILLERO\tT: 2-35 S: 20-40. Seaw. scale. Artificial seawater.\n5 = HANSSON and MEHRBACH refit BY DICKSON AND MILLERO\tT: 2-35 S: 20-40. Seaw. scale. Artificial seawater.\n6 = GEOSECS (i.e., original Mehrbach)\t\t\t\t\tT: 2-35 S: 19-43. NBS scale. Real seawater.\n7 = Peng\t(i.e., originam Mehrbach but without XXX)\tT: 2-35 S: 19-43. NBS scale. Real seawater.\n8 = Millero, 1979, FOR PURE WATER ONLY (i.e., Sal=0)\tT: 0-50 S: 0.\n9 = Cai and Wang, 1998\t\t\t\t\t\t\t\t\tT: 2-35 S: 0-49. NBS scale. Real and artificial seawater.\n10 = Lueker et al, 2000\t\t\t\t\t\t\t\t\tT: 2-35 S: 19-43. Total scale. Real seawater.\n11 = Mojica Prieto and Millero, 2002.\t\t\t\t\tT: 0-45 S: 5-42. Seaw. scale. Real seawater\n12 = Millero et al, 2002\t\t\t\t\t\t\t\t\tT: -1.6-35 S: 34-37. Seaw. scale. Field measurements.\n13 = Millero et al, 2006\t\t\t\t\t\t\t\t\tT: 0-50 S: 1-50. Seaw. scale. Real seawater.\n14 = Millero et al, 2010\t\t\t\t\t\t\t\t\tT: 0-50 S: 1-50. Seaw. scale. Real seawater.\n\n\n\n\n\n","category":"function"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.calc_modern_default_concs","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.calc_modern_default_concs","text":"calc_modern_default_concs(Sal_input, Options=(; WhichKs=Val(10), WhoseKSO4=Val(1)) -> (; TF, TS, TB, Ca)\n\nCalculate modern seawater default concentrations as a function of salinity Sal_input\n\nSee calc_constants! for documentation for Options.\n\nReturns\n\n- TF: (mol kg-1) Total Fluorine modern value from salinity\n- TS: (mol kg-1) Total Sulphate modern value from salinity\n- TB: (mol kg-1) Total Boron modern value from salinity\n- Ca: (mol kg-1) Ca modern value from salinity\n\nExample\n\njulia> options = (; WhichKs=Val(10), WhoseKSO4=Val(1));\n\njulia> modern_concs = PALEOcarbchem.calc_modern_default_concs(35.0, Options=options);\n\njulia> map(x -> @sprintf(\"%.14e\", x), modern_concs)\n(TF = \"6.83258396883673e-05\", TS = \"2.82354341328601e-02\", TB = \"4.15700000000000e-04\", Ca = \"1.02845697008497e-02\")\n\n\n\n\n\n","category":"function"},{"location":"PALEOcarbchem/#Solvers-and-outputs","page":"PALEOcarbchem","title":"Solvers and outputs","text":"","category":"section"},{"location":"PALEOcarbchem/","page":"PALEOcarbchem","title":"PALEOcarbchem","text":"ResultNames\nRNameIdx\ngetResultDescription\ncalculateTAfromTCpHfree!\ncalculatepHfromTATC!\ncalculateOmega\nmappHscale","category":"page"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.ResultNames","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.ResultNames","text":"ResultNames::Tuple\n\nAll available CO2SYS result names\n\n\n\n\n\n","category":"constant"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.RNameIdx","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.RNameIdx","text":"RNameIdx::NamedTuple\n\nIndices of results in a Vector of length(ResultNames)\n\n\n\n\n\n","category":"constant"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.getResultDescription","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.getResultDescription","text":"getResultDescription(resultName::AbstractString) -> (resultName, units, description)\n\nGet human-readable description of resultName\n\n\n\n\n\n","category":"function"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.calculateTAfromTCpHfree!","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.calculateTAfromTCpHfree!","text":"calculateTAfromTCpHfree!(res, C, Options, concs, pHfree; do_dTAdpH=Val(false)) -> (TA, dTAdpH)\n\nCalculate TAlk, and speciation, given pH and conserved concentrations (total DIC, Si, P, SO4, B, F, ...)\n\nReturns:\n\nTA: Total Alk, mol/kg-sw \ndTAdpH: derivative, or NaN if do_dTAdpH=Val(false)\n\nArguments:\n\nres: (output) Vector res of length length(ResultNames) with details of TA contributions etc\nC: constants from calc_constants!. NB: must be on Free pH scale.\nconcs::NamedTuple: (mol kg-sw, NB: each element should be a Ref or length 1 Vector) total concentrations for sulphate, fluoride, and each optional component of alkalinity enabled in C\npHfree: pH on free scale\n\nImplementation\n\nmodified from Matlab CO2SYS CalculateTAfromTCpH(TCi, pHi) to use Free pH scale\n\n\n\n\n\n","category":"function"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.calculatepHfromTATC!","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.calculatepHfromTATC!","text":"calculatepHfromTATC!(\n res, C, Options, conc_TAx, concs; \n pHstart=8.0, pHTol=100*eps()\n) -> (pHfree, steps)\n\nCall calculateTAfromTCpHfree! to iteratively solve for pH given (i) a starting value and pH tolerance, and (ii) Alk and conserved concentrations (total DIC, Si, P, SO4, B, F, ...)\n\nIntended for use eg in an ocean model to enable a single Newton-Raphson step each model timestep (ie pHstart from previous value in that grid cell, pHtol set to some large number)\n\nReturns:\n\npHfree: pH on free scale\nsteps: number of Newton iterations\n\nArguments:\n\nres: (output) Vector res of length length(ResultNames) with details of TA contributions etc\nC: constants from calc_constants!. NB: must be on Free pH scale.\nconc_TAx: total Alk, mol kg-sw\nconcs: other input total concentrations, see calculateTAfromTCpHfree!\npHstart: starting value (free pH scale)\npHtol: tolerance (accuracy required)\n\nImplementation\n\nModified from CO2SYS SUB CalculatepHfromTATC, version 04.01, 10-13-96, written by Ernie Lewis. NB: recoded here to use calculateTAfromTCpHfree!, hence works on free pH scale.\n\nUnits: mol / kg-sw \n\n\n\n\n\n","category":"function"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.calculateOmega","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.calculateOmega","text":"calculateOmega(C, CO3,Ca) -> (OmegaCA, OmegaAR)\n\nCalculate carbonate saturation.\n\nReturns omega, the solubility ratio, for calcite and aragonite. This is defined by: Omega = [CO3–]*[Ca++]./Ksp, where Ksp is the solubility product (either KCa or KAr).\n\nArguments:\n\nC - constants from calc_constants!\nCO3 - carbonate ion concentration, mol/kg-sw\nCa - calcium concentration, mol/kg-sw\n\n\n\n\n\n","category":"function"},{"location":"PALEOcarbchem/#PALEOaqchem.PALEOcarbchem.mappHscale","page":"PALEOcarbchem","title":"PALEOaqchem.PALEOcarbchem.mappHscale","text":"mappHscale(C, pHin, scalein, scaleout, TS, TF) -> pHout\n\nMap pH scale at pressure, temperature, salinity defined by constants C\n\nNB: Total, SW scale are not well defined unless using default contemporary values for TS (sulphate) and TF (fluorine)\n\nArguments:\n\nC: constants Vector from calc_constants!\npHin: input pH on scale scalein\nscalein, scaleout :\nVal(1) = Total scale\nVal(2) = Seawater scale\nVal(3) = Free scale\nnot implemented: Val(4) = NBS scale\nTS: total sulphate (mol kg-1)\nTF: total fluoride (mol kg-1)\n\n\n\n\n\n","category":"function"},{"location":"indexpage/#Index","page":"Index","title":"Index","text":"","category":"section"},{"location":"indexpage/","page":"Index","title":"Index","text":"","category":"page"},{"location":"PALEOaqchem Reactions/#PALEOaqchem-Reactions","page":"PALEOaqchem Reactions","title":"PALEOaqchem Reactions","text":"","category":"section"},{"location":"PALEOaqchem Reactions/","page":"PALEOaqchem Reactions","title":"PALEOaqchem Reactions","text":"CurrentModule = PALEOaqchem","category":"page"},{"location":"PALEOaqchem Reactions/#Particulate-fluxes","page":"PALEOaqchem Reactions","title":"Particulate fluxes","text":"","category":"section"},{"location":"PALEOaqchem Reactions/","page":"PALEOaqchem Reactions","title":"PALEOaqchem Reactions","text":"Particle.ReactionParticleDecay\nParticle.ReactionFluxToComponents","category":"page"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.Particle.ReactionParticleDecay","page":"PALEOaqchem Reactions","title":"PALEOaqchem.Particle.ReactionParticleDecay","text":"ReactionParticleDecay\n\nDecay (eg organic matter to remineralization) at rate 1.0/decay_timescale of eg an organic matter dissolved/particulate phase in Reservoir Particle, to decayflux. Particle may have isotope_type. The Reservoir Particle may have the :vsink attribute set to represent a marine sinking particulate phase.\n\nParameters\n\ndecay_timescale[Float64]=0.5 (yr), default_value=0.5, description=\"particle decay timescale\"\ndecay_threshold[Float64]=-Inf (mol m-3), default_value=-Inf, description=\"particle decay concentration below which decay stops\"\nfield_data[DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable isotopes and specify isotope type\"\n\nMethods and Variables\n\ndo_particle_decay\nParticle (mol), VT_ReactDependency, description=\"Particle amount\"\nParticle_sms (mol yr-1), VT_ReactContributor, description=\"Particle source-sink\"\ndecayflux (mol yr-1), VT_ReactContributor, description=\"Particle decay flux\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.Particle.ReactionFluxToComponents","page":"PALEOaqchem Reactions","title":"PALEOaqchem.Particle.ReactionFluxToComponents","text":"ReactionFluxToComponents\n\nDistribute a single input_flux (eg an organic matter flux) to output_fluxnames components with stoichiometry output_fluxstoich. input_flux may have an isotope type (set by field_data) in which case the isotopic composition will be sent to (usually one) output_fluxname with ::Isotope suffix.\n\nParameters\n\noutputflux_prefix[String]=\"\", default_value=\"\", description=\"Prefix for output flux names\"\noutputflux_names[Vector{String}]=[\"Corg\", \"N\", \"P\"], default_value=[\"Corg\", \"N\", \"P\"], description=\"Suffixes for output flux names. Use ::Isotope suffix to identify a flux with 'isotope_type'\"\noutputflux_stoich[Vector{Float64}]=[106.0, 16.0, 1.0], default_value=[106.0, 16.0, 1.0], description=\"Stoichiometry for output fluxes relative to input flux\"\nfield_data[DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable isotopes and specify isotope type\"\n\nMethods and Variables for default Parameters\n\ndo_flux_to_components\ninputflux (mol m-3), VT_ReactTarget, description=\"input flux\"\n[Corg] (mol yr-1), VT_ReactContributor, description=\"flux Corg\"\n[N] (mol yr-1), VT_ReactContributor, description=\"flux N\"\n[P] (mol yr-1), VT_ReactContributor, description=\"flux P\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#Remin","page":"PALEOaqchem Reactions","title":"Remin","text":"","category":"section"},{"location":"PALEOaqchem Reactions/","page":"PALEOaqchem Reactions","title":"PALEOaqchem Reactions","text":"Remin.ReactionReminPonly\nRemin.ReactionReminO2\nRemin.ReactionReminO2_SO4\nRemin.ReactionReminO2_SO4_CH4","category":"page"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.Remin.ReactionReminPonly","page":"PALEOaqchem Reactions","title":"PALEOaqchem.Remin.ReactionReminPonly","text":"ReactionReminPonly\n\nOrganic particulate matter remineralization (no oxidant use)\n\nParameters\n\nCIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable carbon isotopes and specify isotope type\"\n\nMethods and Variables for default Parameters\n\ndo_remin_Ponly\nremin_P (mol yr-1), VT_ReactTarget, description=\"flux P\"\nremin_N (mol yr-1), VT_ReactTarget, description=\"flux N\"\nremin_Corg (mol yr-1), VT_ReactTarget, description=\"flux Corg\"\nremin_Ccarb (mol yr-1), VT_ReactTarget, description=\"flux Ccarb\"\nsoluteflux_P (mol yr-1), VT_ReactContributor, description=\"flux P\"\n[soluteflux_TNH3] (mol yr-1), VT_ReactContributor, description=\"flux TNH3\"\n[soluteflux_DIC] (mol yr-1), VT_ReactContributor, description=\"flux DIC\"\n[soluteflux_TAlk] (mol yr-1), VT_ReactContributor, description=\"flux TAlk\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.Remin.ReactionReminO2","page":"PALEOaqchem Reactions","title":"PALEOaqchem.Remin.ReactionReminO2","text":"ReactionReminO2\n\nOrganic particulate matter remineralization (O2 oxidant only)\n\nParameters\n\nCIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable carbon isotopes and specify isotope type\"\n\nMethods and Variables for default Parameters\n\ndo_remin_O2\nremin_P (mol yr-1), VT_ReactTarget, description=\"flux P\"\nremin_N (mol yr-1), VT_ReactTarget, description=\"flux N\"\nremin_Corg (mol yr-1), VT_ReactTarget, description=\"flux Corg\"\nremin_Ccarb (mol yr-1), VT_ReactTarget, description=\"flux Ccarb\"\nsoluteflux_P (mol yr-1), VT_ReactContributor, description=\"flux P\"\n[soluteflux_TNH3] (mol yr-1), VT_ReactContributor, description=\"flux TNH3\"\n[soluteflux_DIC] (mol yr-1), VT_ReactContributor, description=\"flux DIC\"\n[soluteflux_TAlk] (mol yr-1), VT_ReactContributor, description=\"flux TAlk\"\nreminOrgOxO2 (mol O2 yr-1), VT_ReactProperty, description=\"oxygen consumption (-ve) by remineralization\"\nRateStoich_reminOrgOxO2\nreminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (-ve) by remineralization\"\n[soluteflux_O2] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxO2\"\ntotals\nreminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (-ve) by remineralization\"\nreminOrgOxO2_total (mol O2 yr-1), VT_ReactProperty, description=\"total oxygen consumption (-ve) by remineralization\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.Remin.ReactionReminO2_SO4","page":"PALEOaqchem Reactions","title":"PALEOaqchem.Remin.ReactionReminO2_SO4","text":"ReactionReminO2_SO4\n\nOrganic particulate matter remineralization (O2, SO4 oxidants)\n\nParameters\n\noxreminlimit[Float64]=0.008 (mol m-3), default_value=0.008, description=\"oxygen concentration below which use of O2 for remineralisation is inhibited\"\nCIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable carbon isotopes and specify isotope type\"\nSIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable sulphur isotopes and specify isotope type\"\n\nMethods and Variables for default Parameters\n\ndo_remin_O2_SO4\nremin_P (mol yr-1), VT_ReactTarget, description=\"flux P\"\nremin_N (mol yr-1), VT_ReactTarget, description=\"flux N\"\nremin_Corg (mol yr-1), VT_ReactTarget, description=\"flux Corg\"\nremin_Ccarb (mol yr-1), VT_ReactTarget, description=\"flux Ccarb\"\nsoluteflux_P (mol yr-1), VT_ReactContributor, description=\"flux P\"\n[soluteflux_TNH3] (mol yr-1), VT_ReactContributor, description=\"flux TNH3\"\n[soluteflux_DIC] (mol yr-1), VT_ReactContributor, description=\"flux DIC\"\n[soluteflux_TAlk] (mol yr-1), VT_ReactContributor, description=\"flux TAlk\"\nO2_conc (mol m-3), VT_ReactDependency, description=\"O2 concentration\"\nreminOrgOxO2 (mol O2 yr-1), VT_ReactProperty, description=\"oxygen consumption (-ve) by remineralization\"\nreminOrgOxSO4 (mol O2eq yr-1), VT_ReactProperty, description=\"2 * sulphate consumption (-ve) by remineralization\"\nRateStoich_reminOrgOxO2\nreminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (-ve) by remineralization\"\n[soluteflux_O2] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxO2\"\nRateStoich_reminOrgOxSO4\nreminOrgOxSO4 (mol O2eq yr-1), VT_ReactDependency, description=\"2 * sulphate consumption (-ve) by remineralization\"\n[soluteflux_SO4] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxSO4\"\n[soluteflux_H2S] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxSO4\"\n[soluteflux_TAlk] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxSO4\"\ntotals\nreminOrgOxSO4 (mol O2eq yr-1), VT_ReactDependency, description=\"2 * sulphate consumption (-ve) by remineralization\"\nreminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (-ve) by remineralization\"\nreminOrgOxSO4_total (mol O2eq yr-1), VT_ReactProperty, description=\"total 2 * sulphate consumption (-ve) by remineralization\"\nreminOrgOxO2_total (mol O2 yr-1), VT_ReactProperty, description=\"total oxygen consumption (-ve) by remineralization\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.Remin.ReactionReminO2_SO4_CH4","page":"PALEOaqchem Reactions","title":"PALEOaqchem.Remin.ReactionReminO2_SO4_CH4","text":"ReactionReminO2_SO4_CH4\n\nOrganic particulate matter remineralization (O2, SO4 oxidants, remaining Corg to CH4)\n\nParameters\n\noxreminlimit[Float64]=0.008 (mol m-3), default_value=0.008, description=\"oxygen concentration below which use of O2 for remineralisation is inhibited\"\nSO4reminlimit[Float64]=1.0 (mol m-3), default_value=1.0, description=\"sulphate concentration below which use of SO4 for remineralisation is inhibited\"\nCIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable carbon isotopes and specify isotope type\"\nSIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable sulphur isotopes and specify isotope type\"\n\nMethods and Variables for default Parameters\n\ndo_remin_O2_SO4_CH4\nremin_P (mol yr-1), VT_ReactTarget, description=\"flux P\"\nremin_N (mol yr-1), VT_ReactTarget, description=\"flux N\"\nremin_Corg (mol yr-1), VT_ReactTarget, description=\"flux Corg\"\nremin_Ccarb (mol yr-1), VT_ReactTarget, description=\"flux Ccarb\"\nsoluteflux_P (mol yr-1), VT_ReactContributor, description=\"flux P\"\n[soluteflux_TNH3] (mol yr-1), VT_ReactContributor, description=\"flux TNH3\"\n[soluteflux_DIC] (mol yr-1), VT_ReactContributor, description=\"flux DIC\"\n[soluteflux_TAlk] (mol yr-1), VT_ReactContributor, description=\"flux TAlk\"\nO2_conc (mol m-3), VT_ReactDependency, description=\"O2 concentration\"\nSO4_conc (mol m-3), VT_ReactDependency, description=\"SO4 concentration\"\nreminOrgOxO2 (mol O2 yr-1), VT_ReactProperty, description=\"oxygen consumption (-ve) by remineralization\"\nreminOrgOxSO4 (mol O2eq yr-1), VT_ReactProperty, description=\"2 * sulphate consumption (-ve) by remineralization\"\nreminOrgOxCH4 (mol O2eq yr-1), VT_ReactProperty, description=\"2 * DIC -> methane (-ve) by remineralization\"\nRateStoich_reminOrgOxO2\nreminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (-ve) by remineralization\"\n[soluteflux_O2] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxO2\"\nRateStoich_reminOrgOxSO4\nreminOrgOxSO4 (mol O2eq yr-1), VT_ReactDependency, description=\"2 * sulphate consumption (-ve) by remineralization\"\n[soluteflux_SO4] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxSO4\"\n[soluteflux_H2S] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxSO4\"\n[soluteflux_TAlk] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxSO4\"\nRateStoich_reminOrgOxCH4\nreminOrgOxCH4 (mol O2eq yr-1), VT_ReactDependency, description=\"2 * DIC -> methane (-ve) by remineralization\"\n[soluteflux_DIC] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxCH4\"\n[soluteflux_CH4] (), VT_ReactContributor, description=\"generated by RateStoich rate=reminOrgOxCH4\"\ntotals\nreminOrgOxSO4 (mol O2eq yr-1), VT_ReactDependency, description=\"2 * sulphate consumption (-ve) by remineralization\"\nreminOrgOxO2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (-ve) by remineralization\"\nreminOrgOxCH4 (mol O2eq yr-1), VT_ReactDependency, description=\"2 * DIC -> methane (-ve) by remineralization\"\nreminOrgOxSO4_total (mol O2eq yr-1), VT_ReactProperty, description=\"total 2 * sulphate consumption (-ve) by remineralization\"\nreminOrgOxO2_total (mol O2 yr-1), VT_ReactProperty, description=\"total oxygen consumption (-ve) by remineralization\"\nreminOrgOxCH4_total (mol O2eq yr-1), VT_ReactProperty, description=\"total 2 * DIC -> methane (-ve) by remineralization\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#Secondary-redox","page":"PALEOaqchem Reactions","title":"Secondary redox","text":"","category":"section"},{"location":"PALEOaqchem Reactions/","page":"PALEOaqchem Reactions","title":"PALEOaqchem Reactions","text":"SecondaryRedox.ReactionRedoxH2S_O2\nSecondaryRedox.ReactionRedoxCH4_O2\nSecondaryRedox.ReactionRedoxCH4_SO4","category":"page"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.SecondaryRedox.ReactionRedoxH2S_O2","page":"PALEOaqchem Reactions","title":"PALEOaqchem.SecondaryRedox.ReactionRedoxH2S_O2","text":"ReactionRedoxH2S_O2\n\nSulphide oxidation by oxygen.\n\nRate R_H2S_O2 Units Ref Notes\n1.6e5 (mol l-1)-1 yr-1 (Van Cappellen and Wang, 1996) \n3.65e6 (mol l-1)-1 yr-1 (Ozaki et al., 2011) \n54e6 (mol l-1)-1 yr-1 (Romaniello and Derry, 2010) \n\nParameters\n\nR_H2S_O2[Float64]=3650.0 ((mol m-3)-1 yr-1), default_value=3650.0, description=\"rate constant\"\nSIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable sulphur isotopes and specify isotope type\"\n\nMethods and Variables for default Parameters\n\ndo_redox_H2S_O2\nredox_H2S_O2 (mol O2 yr-1), VT_ReactProperty, description=\"oxygen consumption (+ve) by H2S oxidation\"\nO2_conc (mol m-3), VT_ReactDependency, description=\"O2 concentration\"\nH2S_conc (mol m-3), VT_ReactDependency, description=\"H2S concentration\"\nvolume (m3), VT_ReactDependency, description=\"box fluid volume\"\nRateStoich_redox_H2S_O2\nredox_H2S_O2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (+ve) by H2S oxidation\"\n[O2_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_H2S_O2\"\n[H2S_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_H2S_O2\"\n[SO4_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_H2S_O2\"\n[TAlk_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_H2S_O2\"\ntotals\nredox_H2S_O2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (+ve) by H2S oxidation\"\nredox_H2S_O2_total (mol O2 yr-1), VT_ReactProperty, description=\"total oxygen consumption (+ve) by H2S oxidation\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.SecondaryRedox.ReactionRedoxCH4_O2","page":"PALEOaqchem Reactions","title":"PALEOaqchem.SecondaryRedox.ReactionRedoxCH4_O2","text":"ReactionRedoxCH4_O2\n\nMethane oxidation by oxygen.\n\nRate R_CH4_O2 Units Ref Notes\n1e10 (mol l-1)-1 yr-1 (Van Cappellen and Wang, 1996) \n10e6 (mol l-1)-1 yr-1 TODO \n\nParameters\n\nR_CH4_O2[Float64]=10000.0 ((mol m-3)-1 yr-1), default_value=10000.0, description=\"rate constant\"\nCIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable carbon isotopes and specify isotope type\"\n\nMethods and Variables for default Parameters\n\ndo_redox_CH4_O2\nredox_CH4_O2 (mol O2 yr-1), VT_ReactProperty, description=\"oxygen consumption (+ve) by CH4 oxidation\"\nO2_conc (mol m-3), VT_ReactDependency, description=\"O2 concentration\"\nCH4_conc (mol m-3), VT_ReactDependency, description=\"CH4 concentration\"\nvolume (m3), VT_ReactDependency, description=\"box fluid volume\"\nRateStoich_redox_CH4_O2\nredox_CH4_O2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (+ve) by CH4 oxidation\"\n[O2_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_CH4_O2\"\n[CH4_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_CH4_O2\"\n[DIC_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_CH4_O2\"\ntotals\nredox_CH4_O2 (mol O2 yr-1), VT_ReactDependency, description=\"oxygen consumption (+ve) by CH4 oxidation\"\nredox_CH4_O2_total (mol O2 yr-1), VT_ReactProperty, description=\"total oxygen consumption (+ve) by CH4 oxidation\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.SecondaryRedox.ReactionRedoxCH4_SO4","page":"PALEOaqchem Reactions","title":"PALEOaqchem.SecondaryRedox.ReactionRedoxCH4_SO4","text":"ReactionRedoxCH4_SO4\n\nMethane oxidation by sulphate (anaerobic methane oxidation).\n\nRate R_CH4_SO4 Units Ref Notes\n1e4 (mol l-1)-1 yr-1 (Van Cappellen and Wang, 1996) k17\n\nParameters\n\nR_CH4_SO4[Float64]=10.0 ((mol m-3)-1 yr-1), default_value=10.0, description=\"rate constant\"\nCIsotope[external, DataType]=PALEOboxes.ScalarData, default_value=PALEOboxes.ScalarData, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable carbon isotopes and specify isotope type\"\n\nMethods and Variables for default Parameters\n\ndo_redox_CH4_SO4\nredox_CH4_SO4 (mol CH4/SO4 yr-1), VT_ReactProperty, description=\"sulphate consumption (+ve) by CH4 oxidation\"\nSO4_conc (mol m-3), VT_ReactDependency, description=\"SO4 concentration\"\nCH4_conc (mol m-3), VT_ReactDependency, description=\"CH4 concentration\"\nvolume (m3), VT_ReactDependency, description=\"box fluid volume\"\nRateStoich_redox_CH4_SO4\nredox_CH4_SO4 (mol CH4/SO4 yr-1), VT_ReactDependency, description=\"sulphate consumption (+ve) by CH4 oxidation\"\n[SO4_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_CH4_SO4\"\n[CH4_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_CH4_SO4\"\n[DIC_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_CH4_SO4\"\n[H2S_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_CH4_SO4\"\n[TAlk_sms] (), VT_ReactContributor, description=\"generated by RateStoich rate=redox_CH4_SO4\"\ntotals\nredox_CH4_SO4 (mol CH4/SO4 yr-1), VT_ReactDependency, description=\"sulphate consumption (+ve) by CH4 oxidation\"\nredox_CH4_SO4_total (mol CH4/SO4 yr-1), VT_ReactProperty, description=\"total sulphate consumption (+ve) by CH4 oxidation\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#Carbonate-chemistry","page":"PALEOaqchem Reactions","title":"Carbonate chemistry","text":"","category":"section"},{"location":"PALEOaqchem Reactions/","page":"PALEOaqchem Reactions","title":"PALEOaqchem Reactions","text":"CarbChem.ReactionCO2SYS","category":"page"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.CarbChem.ReactionCO2SYS","page":"PALEOaqchem Reactions","title":"PALEOaqchem.CarbChem.ReactionCO2SYS","text":"ReactionCO2SYS\n\nCarbonate chemistry using PALEOcarbchem.\n\nThree different pH solver approaches are supported, set by Parameter solve_pH:\n\nsolve: iterative solution for pH, TAlk is a StateExplicit Variable (eg using explicit ODE solver)\nconstraint: additional State Variable for pH and algebraic Constraint for TAlk (requires DAE solver).\nimplicit: TAlk is a Total Variable, a function of a State Variable for pH (requires DAE solver)\n\nParameters\n\nWhichKs[Int64]=10, default_value=10, description=\"PALEOcarbchem WhichKs choice of eqb constant data\"\nWhoseKSO4[Int64]=1, default_value=1, description=\"PALEOcarbchem WhoseKSO4 choice of eqb constant data\"\ncomponents[Vector{String}]=[\"Ci\", \"S\", \"F\", \"B\", \"Omega\"], default_value=[\"Ci\", \"S\", \"F\", \"B\", \"Omega\"], allowed_values=[\"Ci\", \"S\", \"F\", \"P\", \"B\", \"Si\", \"H2S\", \"NH3\", \"Omega\"], description=\"PALEOcarbchem optional contributions to TAlk\"\ndefaultconcs[Vector{String}]=[\"TS\", \"TF\", \"TB\", \"Ca\"], default_value=[\"TS\", \"TF\", \"TB\", \"Ca\"], allowed_values=[\"TS\", \"TF\", \"TB\", \"Ca\"], description=\"PALEOcarbchem default concentrations (modern values calculated from salinity)\"\noutputs[Vector{String}]=[\"pCO2\", \"xCO2dryinp\"], default_value=[\"pCO2\", \"xCO2dryinp\"], description=\"PALEOcarbchem output concentrations etc to include as output variables\"\noutput_pHtot[Bool]=true, default_value=true, description=\"true to output pHtot (requires TS_conc and TF_conc)\"\nsolve_pH[String]=\"solve\", default_value=\"solve\", allowed_values=[\"solve\", \"constraint\", \"implicit\"], description=\"'solve' to solve iteratively for pH, 'constraint' to include [pHfree] as a state variable and TAlk as a constraint, 'implicit' to include [pHfree] as a state variable and TAlk an implicit variable\"\npHtol[Float64]=2.220446049250313e-14, default_value=2.220446049250313e-14, description=\"pH tolerance for iterative solution\"\nsimd_width[String]=\"1\", default_value=\"1\", allowed_values=[\"1\", \"FP64P2\", \"FP64P4\", \"FP32P4\", \"FP32P8\"], description=\"use SIMD (\"1\" - no SIMD, \"FP64P4\" - 4 x Float64, etc)\"\n\nMethods and Variables for default Parameters\n\ndo_modern_default_concs\nvolume (m^3), VT_ReactDependency, description=\"Cell volume\"\nrho_ref (kg m^-3), VT_ReactDependency, description=\"density conversion factor\"\ntemp (Kelvin), VT_ReactDependency, description=\"temperature\"\npressure (dbar), VT_ReactDependency, description=\"pressure\"\nsal (psu), VT_ReactDependency, description=\"salinity\"\nTS_conc (mol m^-3), VT_ReactProperty, description=\"TS_conc modern default scaled from salinity\"\nTF_conc (mol m^-3), VT_ReactProperty, description=\"TF_conc modern default scaled from salinity\"\nTB_conc (mol m^-3), VT_ReactProperty, description=\"TB_conc modern default scaled from salinity\"\nCa_conc (mol m^-3), VT_ReactProperty, description=\"Ca_conc modern default scaled from salinity\"\ndo_carbchem\nvolume (m^3), VT_ReactDependency, description=\"Cell volume\"\nrho_ref (kg m^-3), VT_ReactDependency, description=\"density conversion factor\"\ntemp (Kelvin), VT_ReactDependency, description=\"temperature\"\npressure (dbar), VT_ReactDependency, description=\"pressure\"\nsal (psu), VT_ReactDependency, description=\"salinity\"\npHfree (), VT_ReactProperty, description=\"-log10(hydrogen ion concentration)\"\nTAlk_conc (mol m^-3), VT_ReactDependency, description=\"total TAlk concentration\"\npHtot (), VT_ReactProperty, description=\"-log10([H] + [HS]), pH on total scale\"\nTCi_conc (mol m^-3), VT_ReactDependency, description=\"TCi_concinput concentration\"\nTS_conc (mol m^-3), VT_ReactDependency, description=\"TS_concinput concentration\"\nTF_conc (mol m^-3), VT_ReactDependency, description=\"TF_concinput concentration\"\nTB_conc (mol m^-3), VT_ReactDependency, description=\"TB_concinput concentration\"\nCa_conc (mol m^-3), VT_ReactDependency, description=\"Ca_concinput concentration\"\npCO2 –> %reaction%pCO2 (atm), VT_ReactProperty, description=\"CO2 partial pressure\"\nxCO2dryinp –> %reaction%xCO2dryinp (), VT_ReactProperty, description=\"mixing ratio of CO2 in dry air at 1 atm (always > pCO2 due to H2O vapour pressure)\"\n\n\n\n\n\n","category":"type"},{"location":"PALEOaqchem Reactions/#Isotope-systems","page":"PALEOaqchem Reactions","title":"Isotope systems","text":"","category":"section"},{"location":"PALEOaqchem Reactions/#Boron","page":"PALEOaqchem Reactions","title":"Boron","text":"","category":"section"},{"location":"PALEOaqchem Reactions/","page":"PALEOaqchem Reactions","title":"PALEOaqchem Reactions","text":"Boron.ReactionBoronIsotope","category":"page"},{"location":"PALEOaqchem Reactions/#PALEOaqchem.Boron.ReactionBoronIsotope","page":"PALEOaqchem Reactions","title":"PALEOaqchem.Boron.ReactionBoronIsotope","text":"ReactionBoronIsotope\n\nCalculate d11B for aqueous B(OH)4- and B(OH)3 species from mass balance, given d11B for total B, total B concentration B_conc and B(OH)4- concentration BOH4_conc.\n\nSee eg (Zeebe and Wolf-Gladrow, 2001), p220.\n\nParameters\n\nalphaB[Float64]=1.0272, default_value=1.0272, description=\"isotopic fractionation factor B(OH)4m <-> B(OH)3\"\nBIsotope[external, UnionAll]=PALEOboxes.IsotopeLinear, default_value=PALEOboxes.IsotopeLinear, allowed_values=Type[PALEOboxes.ScalarData, PALEOboxes.IsotopeLinear], description=\"disable / enable boron isotopes and specify isotope type\"\n\nMethods and Variables\n\ndo_boron_isotope\nB_conc (mol m-3), VT_ReactDependency, description=\"B concentration\"\nBOH4_conc (mol m-3), VT_ReactDependency, description=\"B(OH)4m concentration\"\nB_delta (per mil), VT_ReactDependency, description=\"d11B delta for total B\"\nBOH4_delta (per mil), VT_ReactProperty, description=\"d11B delta for B(OH)4- species\"\n\n\n\n\n\n","category":"type"},{"location":"#PALEOaqchem.jl","page":"PALEOaqchem.jl","title":"PALEOaqchem.jl","text":"","category":"section"},{"location":"","page":"PALEOaqchem.jl","title":"PALEOaqchem.jl","text":"Aquatic biogeochemistry for PALEO framework","category":"page"}] }