Find in Library
Search millions of books, articles, and more
Indexed Open Access Databases
PyCO2SYS v1.8: marine carbonate system calculations in Python
oleh: M. P. Humphreys, E. R. Lewis, J. D. Sharp, J. D. Sharp, D. Pierrot
| Format: | Article |
|---|---|
| Diterbitkan: | Copernicus Publications 2022-01-01 |
Deskripsi
<p>Oceanic dissolved inorganic carbon (<span class="inline-formula"><i>T</i><sub>C</sub></span>) is the largest pool of carbon that substantially interacts with the atmosphere on human timescales. Oceanic <span class="inline-formula"><i>T</i><sub>C</sub></span> is increasing through uptake of anthropogenic carbon dioxide (<span class="inline-formula">CO<sub>2</sub></span>), and seawater pH is decreasing as a consequence. Both the exchange of <span class="inline-formula">CO<sub>2</sub></span> between the ocean and atmosphere and the pH response are governed by a set of parameters that interact through chemical equilibria, collectively known as the marine carbonate system. To investigate these processes, at least two of the marine carbonate system's parameters are typically measured – most commonly, two from <span class="inline-formula"><i>T</i><sub>C</sub></span>, total alkalinity (<span class="inline-formula"><i>A</i><sub>T</sub></span>), pH, and seawater <span class="inline-formula">CO<sub>2</sub></span> fugacity (<span class="inline-formula"><math xmlns="http://www.w3.org/1998/Math/MathML" id="M8" display="inline" overflow="scroll" dspmath="mathml"><mrow><msub><mi>f</mi><mrow class="chem"><msub><mi mathvariant="normal">CO</mi><mn mathvariant="normal">2</mn></msub></mrow></msub></mrow></math><span><svg:svg xmlns:svg="http://www.w3.org/2000/svg" width="21pt" height="14pt" class="svg-formula" dspmath="mathimg" md5hash="4eaf8ab807a9716553d53e63adf8d4e5"><svg:image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="gmd-15-15-2022-ie00001.svg" width="21pt" height="14pt" src="gmd-15-15-2022-ie00001.png"/></svg:svg></span></span>; or its partial pressure, <span class="inline-formula"><math xmlns="http://www.w3.org/1998/Math/MathML" id="M9" display="inline" overflow="scroll" dspmath="mathml"><mrow><msub><mi>p</mi><mrow class="chem"><msub><mi mathvariant="normal">CO</mi><mn mathvariant="normal">2</mn></msub></mrow></msub></mrow></math><span><svg:svg xmlns:svg="http://www.w3.org/2000/svg" width="24pt" height="12pt" class="svg-formula" dspmath="mathimg" md5hash="474eb56ca8112f5c4e52e721acbb7c17"><svg:image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="gmd-15-15-2022-ie00002.svg" width="24pt" height="12pt" src="gmd-15-15-2022-ie00002.png"/></svg:svg></span></span>, or its dry-air mole fraction, <span class="inline-formula"><math xmlns="http://www.w3.org/1998/Math/MathML" id="M10" display="inline" overflow="scroll" dspmath="mathml"><mrow><msub><mi>x</mi><mrow class="chem"><msub><mi mathvariant="normal">CO</mi><mn mathvariant="normal">2</mn></msub></mrow></msub></mrow></math><span><svg:svg xmlns:svg="http://www.w3.org/2000/svg" width="24pt" height="12pt" class="svg-formula" dspmath="mathimg" md5hash="1e04cb1358c68a868b39c2f0a9785c91"><svg:image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="gmd-15-15-2022-ie00003.svg" width="24pt" height="12pt" src="gmd-15-15-2022-ie00003.png"/></svg:svg></span></span>) – from which the remaining parameters can be calculated and the equilibrium state of seawater solved. Several software tools exist to carry out these calculations, but no fully functional and rigorously validated tool written in Python, a popular scientific programming language, was previously available. Here, we present PyCO2SYS, a Python package intended to fill this capability gap. We describe the elements of PyCO2SYS that have been inherited from the existing CO2SYS family of software and explain subsequent adjustments and improvements. For example, PyCO2SYS uses automatic differentiation to solve the marine carbonate system and calculate chemical buffer factors, ensuring that the effect of every modelled solute and reaction is accurately included in all its results. We validate PyCO2SYS with internal consistency tests and comparisons against other software, showing that PyCO2SYS produces results that are either virtually identical or different for known reasons, with the differences negligible for all practical purposes. We discuss insights that guided the development of PyCO2SYS: for example, the fact that the marine carbonate system cannot be unambiguously solved from certain pairs of parameters. Finally, we consider potential future developments to PyCO2SYS and discuss the outlook for this and other software for solving the marine carbonate system. The code for PyCO2SYS is distributed via GitHub (<span class="uri">https://github.com/mvdh7/PyCO2SYS</span>, last access: 23 December 2021) under the GNU General Public License v3, archived on Zenodo <span class="cit" id="xref_paren.1">(<a href="#bib1.bibx36">Humphreys et al.</a>, <a href="#bib1.bibx36">2021</a>)</span>, and documented online (<span class="uri">https://pyco2sys.readthedocs.io/en/latest/</span>, last access: 23 December 2021).</p>