carb {seacarb} | R Documentation |
Returns parameters of the seawater carbonate system.
carb(flag, var1, var2, S=35, T=25, P=0, Pt=0, Sit=0)
flag |
select the couple of variables available. The flags which can be used are:
flag = 1 pH and CO2 given flag = 2 CO2 and HCO3 given flag = 3 CO2 and CO3 given flag = 4 CO2 and ALK given flag = 5 CO2 and DIC given flag = 6 pH and HCO3 given flag = 7 pH and CO3 given flag = 8 pH and ALK given flag = 9 pH and DIC given flag = 10 HCO3 and CO3 given flag = 11 HCO3 and ALK given flag = 12 HCO3 and DIC given flag = 13 CO3 and ALK given flag = 14 CO3 and DIC given flag = 15 ALK and DIC given flag = 21 pCO2 and pH given flag = 22 pCO2 and HCO3 given flag = 23 pCO2 and CO3 given flag = 24 pCO2 and ALK given flag = 25 pCO2 and DIC given |
var1 |
enter value of the first variable in mol/kg, except for pH and for pCO2 in μatm |
var2 |
enter value of the second variable in mol/kg, except for pH |
S |
Salinity |
T |
Temperature in degrees Celsius |
P |
Hydrostatic pressure in bar (surface = 0) |
Pt |
Concentration of total phosphate in mol/kg |
Sit |
Concentration of total silicate in mol/kg |
Note that the arguments can be given as a unique number or as vectors. If the lengths of the vectors are different, the longer vector is retained and only the first value of the other vectors is used. It can therefore be critical to use vectors of the same length. For instance, to compute parameters from one couple of variable for a range of temperatures, a vector with temperatures required can be given in enter and other arguments can be completed be one variable this variable will be used for each temperatures.
The function returns a data frame containing the following columns:
S |
Salinity |
T |
Temperature in degrees Celsius |
P |
Pressure in bar |
pH |
pH |
CO2 |
CO2 concentration (mol/kg) |
pCO2 |
pCO2, CO2 partial pressure (μatm) |
fCO2 |
fCO2, CO2 fugacity (μatm) |
HCO3 |
HCO3 concentration (mol/kg) |
CO3 |
CO3 concentration (mol/kg) |
DIC |
DIC concentration (mol/kg) |
ALK |
ALK, total alkalinity (mol/kg) |
OmegaAragonite |
Omega aragonite, aragonite saturation state |
OmegaCalcite |
Omega calcite, calcite saturation state |
Héloïse Lavigne, Aurélien Proye and Jean-Pierre Gattuso gattuso@obs-vlfr.fr
Dickson A. G., Sabine C. L. and Christian J. R., 2007 Guide to best practices for ocean CO2 measurements. PICES Special Publication 3, 1-191.
Zeebe, R. E. and Wolf-Gladrow, D. A., 2001 CO2 in seawater: equilibrium, kinetics, isotopes. Amsterdam: Elsevier, 346 pp.
## With a couple of variables carb(flag=8, var1=8.2, var2=0.00234, S=35, T=25, P=0, Pt=0, Sit=0) ## Using vectors as arguments flag <- c(8, 2, 8) var1 <- c(8.2, 7.477544e-06, 8.2) var2 <- c(0.002343955, 0.001649802, 2400e-6) S <- c(35, 35, 30) T <- c(25, 25, 30) P <- c(0, 0, 0) Pt <- c(0, 0, 0) Sit <- c(0, 0, 0) carb(flag=flag, var1=var1, var2=var2, S=S, T=T, P=P, Pt=Pt, Sit=Sit) ## Test with all flags flag <- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 21, 22, 23, 24, 25) var1 <- c(8.200000, 7.477544e-06, 7.477544e-06, 7.477544e-06, 7.477544e-06, 8.2, 8.2, 8.2, 8.2, 0.001685024, 0.001685024, 0.001685024, 0.0002888382, 0.0002888382, 0.002391252, 264.2008, 264.2008, 264.2008, 264.2008, 264.2008) var2 <- c(7.477544e-06, 0.001685024, 0.0002888382, 0.002391252, 0.001981340, 0.001685024, 0.0002888382, 0.002391252, 0.001981340, 0.0002888382, 0.002391252, 0.001981340, 0.002391252, 0.001981340, 0.001981340, 8.2, 0.001685024, 0.0002888382, 0.002391252, 0.001981340) carb(flag=flag, var1=var1, var2=var2) ## Test using a data frame data(seacarb_test) tab <- seacarb_test ## method 1 using the column numbers carb(flag=tab[[1]], var1=tab[[2]], var2=tab[[3]], S=tab[[4]], T=tab[[5]], P=tab[[6]], Sit=tab[[7]], Pt=tab[[8]]) ## method 2 using the column names carb(flag=tab$flag, var1=tab$var1, var2=tab$var2, S=tab$S, T=tab$T, P=tab$P, Sit=tab$Sit, Pt=tab$Pt)