Learn R Programming

solveSAPHE

SOLVEr Suite for Alkalinity-PH Equations

In 2013, Guy Munhoven at Université de Liège, in Belgium, developped this solver in FORTRAN 90, as is presented in his paper:

  • Munhoven, G.: Mathematics of the total alkalinity–pH equation — pathway to

robust and universal solution algorithms: the SolveSAPHE package v1.0.1, Geosci. Model Dev., 2013.

In 2020, J.M. Epitalon, on order from J.P Gattuso, translated into a R package in order to be used by J.P. Gattuso's package 'seacarb'.

This program is provided free under the GNU General Public License (GNU GPL). It will be improved using the comments that I will receive. If you are new to R, please check the manuals and FAQs available on the R-project web site to get information on how to install R and the solveSAPHE package on your system. Please only report and comment on solveSAPHE, not on general problems related to R.

Briefly, after installing R and if you have an Internet connection, here is the simplest way to install solveSAPHE:

  • Launch R
  • To install solveSAPHE (to be done only once), type the following command: install.packages("solveSAPHE")
  • To load the solveSAPHE package into memory in order to use it (to be done each time R is launched), type the following command: library(solveSAPHE)

The solveSAPHE package can be downloaded from the Comprehensive R Archive Network (CRAN; see link below). The documentation is included in the package and is accessible using standard R commands. Please give due credit to the publications mentioned above and cite solveSAPHE as follows:

Munhoven G., Epitalon J.-M. solveSAPHE: SOLVEr Suite for Alkalinity-PH Equations. R package version 2.1.0. http://CRAN.R-project.org/package=solveSAPHE

Copy Link

Version

Install

install.packages('SolveSAPHE')

Monthly Downloads

905

Version

2.1.0

License

GPL (>= 2)

Maintainer

Jean-Marie Epitalon

Last Published

May 1st, 2021

Functions in SolveSAPHE (2.1.0)

ACVT_HTOT_O_HFREE

Conversion ratio H_Tot/H_free from free pH-scale to Total scale
AK_CARB_1_ROYE93

First dissociation constant of carbonic acid in mol/kg-SW, from Roy et al.
AK_CARB_1_MILL95

First dissociation constant of carbonic acid in mol/kg-SW from Millero et al. (1995)
ACVT_HSWS_O_HFREE

Conversion ratio H_SWS/H_free from free pH-scale to SWS scale
AK_AMMO_1_YAMI95

Dissociation constant of ammonium in sea-water [mol/kg-SW]
AK_PHOS_2_MILL95

Second dissociation constant of phosphoric acid (H3PO4) in seawater
AK_PHOS_1_MILL95

First dissociation constant of phosphoric acid (H3PO4) in seawater
AK_BORA_DICK90

Boric acid dissociation constant KB in mol/kg-SW
AK_HSO4_DICK90

Dissociation constant of hydrogen sulfate (bisulfate) in sea-water
AK_HF_PEFR87

Dissociation constant of hydrogen fluoride in sea-water [mol/kg-SW]
AK_W_MILL95

Water dissociation constant Kw in (mol/kg-SW)^2
solve_pH_from_AT

Solver for the total alkalinity-pH equations
AK_CARB_2_LUEK00

Second dissociation constant of carbonic acid in mol/kg-SW from Luecker et al.
AK_PHOS_3_MILL95

Third dissociation constant of phosphoric acid (H3PO4) in seawater
AK_CARB_2_MILL95

Second dissociation constant of carbonic acid in mol/kg-SW from Millero et al. (1995)
AK_CARB_1_LUEK00

First dissociation constant of carbonic acid in mol/kg-SW from Luecker et al.
AK_CARB_0_WEIS74

Henry's constant K0 in (mol/kg-SW)/atmosphere
AK_SILI_1_MILL95

First dissociation constant of sillicic acid (H4SiO4) in seawater
AK_H2S_1_MILL95

Dissociation constant of hydrogen sulfide in sea-water
AK_CARB_2_ROYE93

Second dissociation constant of carbonic acid in mol/kg-SW from Roy et al.