The successful and efficient approach at the basis of the Solver Suite for Alkalinity-PH Equations (SolveSAPHE)

Among all the aspects of the ongoing global environmental changes (climate change, ocean acidification, etc.), the solution chemistry of carbon dioxide (

There are 10 different data pairs that can be composed from the set of five independent measurable variables of the carbonate system;
there are 15 if we further include

Overall, 11 out of these 15 possible pairs of independent parameters of the carbonate system can be directly solved or require at most the resolution of a quadratic equation.
The remaining four pairs require iterative procedures.
Besides the Alk

In the companion paper

In the following, it is assumed that the temperature

Cornerstone to the speciation calculation is the resolution of the following equation, which I call the “alkalinity–pH equation”, as it derives from the definition of total alkalinity:

In order to get a first idea about the complications that we might encounter for the solution of the three new data pairs, we start with an exploratory analysis using the Solver Suite for Alkalinity-PH Equations (SolveSAPHE) version 1.0.3

The V- or U-shaped isolines for

As will be shown below, the SolveSAPHE approach of

We will now in turn analyse the mathematical properties of the alkalinity–pH equation that results from the substitution of

The Alk

Intrinsic brackets for the solution of Eq. (

Similarly, the upper bound

The positive roots of these cubic equations can be found by adopting a strategy similar to that used for the cubic initialisation of the iterative solution in SolveSAPHE

locate the local minimum of the cubic, in

develop the cubic as a quadratic Taylor expansion,

solve

Any bracketing root-finding algorithm can then be used to solve the modified alkalinity pH equation (Eq.

For the Alk

The lower bound

Whereas any physically meaningful

The solution of the

If

If

If

Schematic representation of the general characteristics of the

To alleviate notation let us define the two parametric functions:

The first case can be handled similarly to the Alk

The second case might be considered to be only mathematically of importance as it only applies for one exact (and thus improbable)

As mentioned above, if

The third case is the most commonly encountered and the most challenging.
With

If

If

Determination of the

The limiting

Once

Since every physical aqueous sample has a pH, the case without roots is essentially a theoretical one:
it can actually arise only if the adopted alkalinity composition is not appropriate or if measurement errors are large.
The case where an Alk

However, at the end of the calculations, one of the two has to be chosen.
Additional information, qualitative or quantitative, is required to make that decision.
This could be a third measurable, but often even qualitative information about, say, the expected pH or the

In the analysis of the Alk

As can be seen in Fig.

Since we have bracketing intervals for each diagnosed root, we may always use the fall-back initial value

The developments for each of the three input pairs are presented in full detail in the “Mathematical and Technical Details” report in the Supplement.

The SolveSAPHE Fortran 90 library from

In the course of the developments related to the Alk

Both corrections have been backported to the version 1 branch of SolveSAPHE and are included in v1.1 in the SolveSAPHE archive on Zenodo

Ranges of variation for the input variables for the five test cases.
Experiments always considered Alk

Finally, as explained above, some Alk

Results from the three test cases (SW1, SW2 and SW3) from

For the comparison of the computational requirements for the processing of each set of samples, the adopted [

pH distributions for the SW2-sc test case (SW2 under cold surface conditions, where

While all the test cases have their specific relevance, we are going to focus on SW2 for most of our discussion here.
SW2 covers currently observed seawater samples, thus encompassing SW1, and conditions expected to occur over the next 50 000 years as derived from simulation experiments carried out with MBM-MEDUSA

The difficulties posed by Alk

Finally, Figs.

Number of iterations to convergence required by the various data pairs (separately for the lower and the greater [

Number of iterations to convergence required by the various data pairs (separately for the lower and the greater [

All these observations are also reflected in the execution times of the two solvers.
The Newton–Raphson-based solver takes more than 5 times as much time for the SW2 test case with Alk

Another key factor that influences the execution times is the initialisation scheme, although the comparisons are not as clear cut as in

In the analysis in Sect.

Number of iterations required by Brent's algorithm in the SW2 test case to solve the auxiliary minimisation problem whose solution determines the number of roots of the Alk

The approach adopted in SolveSAPHE

The two safeguarded numerical solvers from SolveSAPHE v1 have been adapted to allow for the solution of problems that may have up to two roots.
The Newton–Raphson–bisection-based solver required extensive modifications for the reliable solution of the numerically far more challenging Alk

For carbonate speciation problems posed by Alk

For the sake of completeness, I provide here succinct “recipes” to calculate all the different carbonate system related variables, knowing two of them.
Many of these were already known in the 1960s (see, e.g.

The conditions for the existence of a solution are generally that the concentrations of

:
(1) With these two pairs, the

:
With this pair, the

:
(1) [

:
(1) [

:
(1) calculate [

:
(1) calculate [

:
(1) calculate [

:
(1) calculate [

:
(1)

:
individual species concentrations from the species fractions;

All the Fortran 90 codes of SolveSAPHE version 1 series (of which v1.0.3 was used to derive the results presented in Fig.

The supplement related to this article is available online at:

The author declares that there is no conflict of interest.

Publisher’s note: Copernicus Publications remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

James Orr provided the kick-off momentum for me to reconsider SolveSAPHE and to complete it in order to combine Alk

Financial support for this work was provided by the Belgian Fund for Scientific Research – F.R.S.-FNRS (project SERENATA, grant CDR J.0123.19). Guy Munhoven is a research associate with the Belgian Fund for Scientific Research – F.R.S.-FNRS.

This paper was edited by Sandra Arndt and reviewed by two anonymous referees.