From b4e8b5d641e4d9485bfbbe08bd1c623b8aeed8a6 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Sun, 18 Feb 2024 15:15:55 +0000 Subject: [PATCH] build based on f695383 --- dev/.documenter-siteinfo.json | 2 +- dev/PALEOaqchem Reactions/index.html | 2 +- dev/PALEOaqchem functions/index.html | 2 +- dev/PALEOcarbchem/index.html | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 29fd4fc..10706d9 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:24","documenter_version":"1.2.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.6.7","generation_timestamp":"2024-02-18T15:15:50","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 11a8c92..4cdaeb0 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 5ed98c1..d093b32 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 diff --git a/dev/PALEOcarbchem/index.html b/dev/PALEOcarbchem/index.html index 7326339..7e7e672 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