SolveSAPHE-r2 (v2.0.1): revisiting and extending the Solver Suite for Alkalinity-PH Equations for usage with CO<sub>2</sub>, HCO<sub>3</sub><sup>−</sup> or CO<sub>3</sub><sup>2−</sup> input data

<p>The successful and efficient approach at the basis of the Solver Suite for Alkalinity-PH Equations (SolveSAPHE) <span class="cit" id="xref_paren.1">(<a href="#bib1.bibx7">Munhoven</a>, <a href="#bib1.bibx7">2013</a>)</...

Full description

Bibliographic Details
Main Author: G. Munhoven
Format: Article
Language:English
Published: Copernicus Publications 2021-07-01
Series:Geoscientific Model Development
Online Access:https://gmd.copernicus.org/articles/14/4225/2021/gmd-14-4225-2021.pdf
Description
Summary:<p>The successful and efficient approach at the basis of the Solver Suite for Alkalinity-PH Equations (SolveSAPHE) <span class="cit" id="xref_paren.1">(<a href="#bib1.bibx7">Munhoven</a>, <a href="#bib1.bibx7">2013</a>)</span>, which determines the carbonate system speciation by calculating pH from total alkalinity (Alk<span class="inline-formula"><sub>T</sub></span>) and dissolved inorganic carbon (<span class="inline-formula"><i>C</i><sub>T</sub></span>), and which converges for any physically sensible pair of such data, has been adapted and further developed to work with Alk<span class="inline-formula"><sub>T</sub></span>–<span class="inline-formula">CO<sub>2</sub></span>, Alk<span class="inline-formula"><sub>T</sub></span>–<span class="inline-formula"><math xmlns="http://www.w3.org/1998/Math/MathML" id="M9" display="inline" overflow="scroll" dspmath="mathml"><mrow class="chem"><msubsup><mi mathvariant="normal">HCO</mi><mn mathvariant="normal">3</mn><mo>-</mo></msubsup></mrow></math><span><svg:svg xmlns:svg="http://www.w3.org/2000/svg" width="33pt" height="16pt" class="svg-formula" dspmath="mathimg" md5hash="3216b9c2ebf1d12b648cb6f115e72c78"><svg:image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="gmd-14-4225-2021-ie00005.svg" width="33pt" height="16pt" src="gmd-14-4225-2021-ie00005.png"/></svg:svg></span></span>, and Alk<span class="inline-formula"><sub>T</sub></span>–<span class="inline-formula"><math xmlns="http://www.w3.org/1998/Math/MathML" id="M11" display="inline" overflow="scroll" dspmath="mathml"><mrow class="chem"><msubsup><mi mathvariant="normal">CO</mi><mn mathvariant="normal">3</mn><mrow><mn mathvariant="normal">2</mn><mo>-</mo></mrow></msubsup></mrow></math><span><svg:svg xmlns:svg="http://www.w3.org/2000/svg" width="30pt" height="17pt" class="svg-formula" dspmath="mathimg" md5hash="9a390868a7d58f0c278081d38453b25f"><svg:image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="gmd-14-4225-2021-ie00006.svg" width="30pt" height="17pt" src="gmd-14-4225-2021-ie00006.png"/></svg:svg></span></span>. The mathematical properties of the three modified alkalinity–pH equations are explored. It is shown that the Alk<span class="inline-formula"><sub>T</sub></span>–<span class="inline-formula">CO<sub>2</sub></span>, and Alk<span class="inline-formula"><sub>T</sub></span>–<span class="inline-formula"><math xmlns="http://www.w3.org/1998/Math/MathML" id="M15" display="inline" overflow="scroll" dspmath="mathml"><mrow class="chem"><msubsup><mi mathvariant="normal">HCO</mi><mn mathvariant="normal">3</mn><mo>-</mo></msubsup></mrow></math><span><svg:svg xmlns:svg="http://www.w3.org/2000/svg" width="33pt" height="16pt" class="svg-formula" dspmath="mathimg" md5hash="d8ea902b50352a2265157e83d4b1e234"><svg:image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="gmd-14-4225-2021-ie00007.svg" width="33pt" height="16pt" src="gmd-14-4225-2021-ie00007.png"/></svg:svg></span></span> problems have one and only one positive root for any physically sensible pair of data (i.e. such that <span class="inline-formula">[CO<sub>2</sub>]&gt;0</span> and <span class="inline-formula"><math xmlns="http://www.w3.org/1998/Math/MathML" id="M17" display="inline" overflow="scroll" dspmath="mathml"><mrow><mo>[</mo><mrow class="chem"><msubsup><mi mathvariant="normal">HCO</mi><mn mathvariant="normal">3</mn><mo>-</mo></msubsup></mrow><mo>]</mo><mo>&gt;</mo><mn mathvariant="normal">0</mn></mrow></math><span><svg:svg xmlns:svg="http://www.w3.org/2000/svg" width="57pt" height="16pt" class="svg-formula" dspmath="mathimg" md5hash="b03fde74fb6e17427fd3f8c883c44acf"><svg:image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="gmd-14-4225-2021-ie00008.svg" width="57pt" height="16pt" src="gmd-14-4225-2021-ie00008.png"/></svg:svg></span></span>). The space of Alk<span class="inline-formula"><sub>T</sub></span>–<span class="inline-formula"><math xmlns="http://www.w3.org/1998/Math/MathML" id="M19" display="inline" overflow="scroll" dspmath="mathml"><mrow class="chem"><msubsup><mi mathvariant="normal">CO</mi><mn mathvariant="normal">3</mn><mrow><mn mathvariant="normal">2</mn><mo>-</mo></mrow></msubsup></mrow></math><span><svg:svg xmlns:svg="http://www.w3.org/2000/svg" width="30pt" height="17pt" class="svg-formula" dspmath="mathimg" md5hash="a5fcc26f53c3f83623c25af9f05ea371"><svg:image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="gmd-14-4225-2021-ie00009.svg" width="30pt" height="17pt" src="gmd-14-4225-2021-ie00009.png"/></svg:svg></span></span> pairs is partitioned into regions where there is either no solution, one solution or where there are two. The numerical solution of the modified alkalinity–pH equations is far more demanding than that for the original Alk<span class="inline-formula"><sub>T</sub></span>–<span class="inline-formula"><i>C</i><sub>T</sub></span> pair as they exhibit strong gradients and are not always monotonous. The two main algorithms used in SolveSAPHE v1 have been revised in depth to reliably process the three additional data input pairs. The Alk<span class="inline-formula"><sub>T</sub></span>–<span class="inline-formula">CO<sub>2</sub></span> pair is numerically the most challenging. With the Newton–Raphson-based solver, it takes about 5 times as long to solve as the companion Alk<span class="inline-formula"><sub>T</sub></span>–<span class="inline-formula"><i>C</i><sub>T</sub></span> pair; the Alk<span class="inline-formula"><sub>T</sub></span>–<span class="inline-formula"><math xmlns="http://www.w3.org/1998/Math/MathML" id="M27" display="inline" overflow="scroll" dspmath="mathml"><mrow class="chem"><msubsup><mi mathvariant="normal">CO</mi><mn mathvariant="normal">3</mn><mrow><mn mathvariant="normal">2</mn><mo>-</mo></mrow></msubsup></mrow></math><span><svg:svg xmlns:svg="http://www.w3.org/2000/svg" width="30pt" height="17pt" class="svg-formula" dspmath="mathimg" md5hash="8abd9ee4408d0643a8dcfcfb8e61d43f"><svg:image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="gmd-14-4225-2021-ie00010.svg" width="30pt" height="17pt" src="gmd-14-4225-2021-ie00010.png"/></svg:svg></span></span> pair requires on average about 4 times as much time as the Alk<span class="inline-formula"><sub>T</sub></span>–<span class="inline-formula"><i>C</i><sub>T</sub></span> pair. All in all, the secant-based solver offers the best performance. It outperforms the Newton–Raphson-based one by up to a factor of 4 in terms of average numbers of iterations and execution time and yet reaches equation residuals that are up to 7 orders of magnitude lower. Just like the pH solvers from the v1 series, SolveSAPHE-r2 includes automatic root bracketing and efficient initialisation schemes for the iterative solvers. For Alk<span class="inline-formula"><sub>T</sub></span>–<span class="inline-formula"><math xmlns="http://www.w3.org/1998/Math/MathML" id="M31" display="inline" overflow="scroll" dspmath="mathml"><mrow class="chem"><msubsup><mi mathvariant="normal">CO</mi><mn mathvariant="normal">3</mn><mrow><mn mathvariant="normal">2</mn><mo>-</mo></mrow></msubsup></mrow></math><span><svg:svg xmlns:svg="http://www.w3.org/2000/svg" width="30pt" height="17pt" class="svg-formula" dspmath="mathimg" md5hash="570ee23de137fef6c769752a104b85c8"><svg:image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="gmd-14-4225-2021-ie00011.svg" width="30pt" height="17pt" src="gmd-14-4225-2021-ie00011.png"/></svg:svg></span></span> data pairs, it also determines the number of roots and calculates non-overlapping bracketing intervals. An open-source reference implementation of the new algorithms in Fortran 90 is made publicly available for usage under the GNU Lesser General Public Licence version 3 (LGPLv3) or later.</p>
ISSN:1991-959X
1991-9603