SolveSAPHE-r2: revisiting and extending the Solver Suite for Alkalinity-PH Equations for usage with CO2, HCO

please find below my point to point listing of the changes made to the manuscript in response to the referees’ comments and suggestions. For the sake of brevity, I do not repeat here the justifications that were given in the Author’s Comments in reply to the Referees Comments. A latexdiff version of the manuscript highlighting the insertions and deletions in the text has also been uploaded alongside the revised manuscript.

the results presented here (more complex Alk T composition, more extended pH range. In the manuscript I wrote that the existence of two roots for the Alk T & CO − 3 pair system was a little known fact.As AR#1 illustrates "little known" does not mean "unknown". . .Zeebe and Wolf-Gladrow (2001, pp. 276-277) did mention it: "Roots: two positive (use the larger one), three negative."I have added a mentioning of this in the manuscript (line [XXX] in the latexdiff report) Added extra discussion regarding the choice of the root

Specific/technical comments
Units of alkalinity: I suggest replacing meq (outdated) by mmol (compare, for example, Dickson et al., 2007, Chapter 5, Table 2) OK, corrected as recommended.
L51 's is a factor to convert from that scale to the free scale': it might be useful to mention that the value of s is close to 1 The sentence at lines 51-52 has been rewritten as follows: "s depends on temperature, pressure and salinity of the sample and its value is close to 1 (typically between 1.0 and 1.3)."Fig. 1: axes labels (quantities & units) missing, same for color bars; remove titles (numbers); y-axes from 1 to 0 to 3 or from −1 to 3 (???); a bit more explanation/discussion might be in order.
The annotations of Fig. 1 in the manuscript were partly lost during the processing of the submitted manuscript file (where the figure was complete) to produce the preprint posted on the GMDD forum.

L193 [H + ]
: something missing here I prefer to leave it as is-nothing changed.
"determination" has been deleted so that the sentence now reads "[. . .] for which the exact knowledge of H tan is not indispensable." L271 API = ???
API is a standard acronym in computer science and stands for "Application Programming Interface" -the definition has been added (line 393 in the latexdiff L275 'In the course of the development s related to . . .' ??? something missing here?
There was a spurious blank between "development" and the "s" that follows.Corrected to read "In the course of the developments related to [. . .]" L291 'equation function' ???
Discarded "function" This was about the caption of Fig. 7 (now Fig. 8), and has been corrected.

Sup. Mathematical and Technical Details
Revisions in response to comments by Anonymous Referee #2

General comments
Understandably, the manuscript is not written for the broader scientific community working on the carbonate system because of its technical focus, and overall it is well written.However, I do think that some efforts can be made in making the paper more appealing to a wider audience.
For example, more context can be given as to why it is important to include solutions for the CO 2 -Alk T , HCO − 3 -Alk T and especially CO 2− 3 -Alk T pairs.While pCO 2 has already been a commonly measured parameter for decades, CO 2− 3 can currently be regarded as the fifth parameter that can be measured to describe the carbonate system.Recent adoption of direct CO 2− 3 measurements by experimentalists (e.g.Easley et al., 2013;doi:10.1021doi:10. /es303631g or Patsavas et al., 2015;;doi:10.1016/j.marchem.2014.10.015)actually provide scientific ground for this manuscript and this is even strengthened given that CO 2− 3 was found to be best paired with Alk T (or C T ; Sharp and Byrne, 2018; doi:10.1016/j.marchem.2018.12.001).
The introduction was reorganised, partly rewritten and extended along the lines proposed by Anonymous Referee #2 (hereafter AR#2).
Another comment I have along the same line is that I felt that a discussion was lacking on which pH value to take in the case that there are two solutions for the CO 2− 3 -Alk T pair.Later I noticed that Reviewer 1 has this exact comment and worked this out very nicely in their comment.I would therefore suggest Guy Munhoven to take this point into account and perhaps even create a figure similar to that by Reviewer 1 in the manuscript.Such a figure would also aid the less technical reader (as well as the reader who has difficulties in interpreting Deffeyes diagrams) in understanding the importance of this work.However, I also agree with Reviewer 1 that a justification of this choice is probably beyond the scope of this manuscript.• Discussion about which one of the roots to chose when there are two has been added in a new section 2.4.2 (two pages).
Finally, it might be interesting to include some other case studies.Specifically, I was thinking about pore waters where the concentrations of various acid-base systems may be higher, especially the relative contributions of non-carbonate bases to Alk T .
I had difficulties to secure sufficiently complete data sets for porewater chemistry to design a realistic representative test case as requested by AR#2.As the purpose was to cover samples where "[. . .] the concentrations of various acid-base systems may be higher, especially the relative contributions of non-carbonate bases to Alk" I finally resorted to using the data of Yao and Millero (1995) for the anoxic waters of the Framvaren Fjord, Norway, as a starting point.The water column in this fjord is anoxic below 20 m depth, and at depths greater than 100 m, it is characterised by H 2 S concentrations between about 4.5 and 5.8 mM, as well as NH + 4 concentrations between about 1.3 and 1.6 mM.Yao and Millero (1995) provide data for all the acid-systems currently considered in the Fortran 90 implementation of SOLVESAPHE-r2.
For the new test case ABW5, where "ABW" stands for anoxic brackish water, I then use average concentrations between 100 and 170 m depth for all components except Alk T and C T , for which roughly rounded ranges over that depth interval are adopted: All reported concentrations are assumed to represent total concentrations of their respective acid systems.
In order not to lengthen the manuscript unnecessarily, the results for SW1, which covers a subset of SW2) have been removed from Figs. 5 and 6 (now Figs. 6 and 7) and those for ABW5 included instead.In terms of the required number of iterations.This has been reformulated more precisely as "It outperforms the Newton-Raphson based one by up to a factor of four in terms of average numbers of iterations and execution time and yet reaches equation residuals that are up to seven orders of magnitude lower." L.15: "For Alk T & CO 2− 3 data pairs" would read better here OK -changed as suggested.

Specific comments
L.27-29: Depending on the purpose, some modellers will use pH in combination with C T ; I suggest to write "most modellers" instead.
OK -changed as suggested.
L.38-39: Not sure what is meant with "this best had to be one pair of input data only".
This means that users should only have to provide the absolutely necessary information (i.e., the pair of data), but no further auxiliary information, such as a bracketing interval or starting values for an iterative process.As in SOLVESAPHE v1, the algorithm should be able to derive that kind of information autonomously without having to rely on user input.
Lines 36-39 (see lines 60-67 in the latexdiff report) have been rewritten: "Here, we do not focus on these aspects, but on the design of algorithms that can solve the underlying mathematical problem with as little user input as possible.The aim is to reduce user input to the bare essentials: besides the fundamental information about temperature, salinity, pressure and the thermodynamic data, this ideally had to be any physically meaningful data pair only; the algorithm should be able to derive any other auxiliary information, such as root brackets or starting values for iterations, on its own." L.40-44: I would suggest to finish the introduction and start a new manuscript section after presenting the aim.
The section heading "2 Theoretical Considerations" has been moved before the earlier line 44, followed by a new subsection title "2.1 Revisiting the mathematics of the alkalinity-pH equation" The first sentence of the new subsection has been reformulated.
• Added panel for the new test case ABW5.
• Amended the maximum numbers of iterations to the slightly changed results as a result of the modified intercomparison setup • Added an insert with a histogram to the figure to make better usage of the free blank space and to make the information quantitatively more expressive.
• Amended the caption to explain the insert.
• Corrected a few English errors • Added details of the medians and most probable numbers of iterations in section 3.2.2(see lines 503-505 in the latexdiff report).

Tables
The table captions have been moved above the tables.
Figure 4 (now Figure 5) The figure caption has been slightly reformulated.

Fig.
Fig. legend: 'two roots The' dot missing after roots

•
A two-panel figure was added (new Fig. 2 in the revised manuscript).The top panel is similar to the figure presented by AR#1, but has been completed to make it compatible with the alkalinity composition used to produce Fig. 1 (i.e., including borate alkalinity).The target [CO 2− 3 ] line intersecting the CO 2− 3 distribution function is not shown in order to avoid overloading the graph.The second panel shows a selection of carbonate ion distribution functions obtained for different Alk T values.• The graphs of the new figure are discussed in the text, and the possibilities of zero, one or two roots explored.
Throughout "on Fig. n" changed to "in Fig. n" as suggested repeatedly.L.10-11: "longer"/"more time"−− > than what exactly?There was actually an error on line 11: "while Alk T & CO 2 requires about four times as much time."should actually have read "while Alk T & CO 2− 3 requires about four times as much time."Lines 10-11 have been rewritten to read (see lines 10-12 in the latexdiff report): "The Alk T & CO 2 pair is numerically the most challenging.With the Newton-Raphson based solver, it takes about five times as long to solve as the companion Alk T & C T pair; the Alk T & CO 2− 3 pair requires on average about four times as much time as the Alk T & C T pair."L.12-13: "It outperforms the Newton-Raphson based one by a factor of four'−− > In terms of what, calculation time?