Learn R Programming

seacarb (version 2.3.1)

carb: Parameters of the seawater carbonate system

Description

Returns parameters of the seawater carbonate system.

Usage

carb(flag, var1, var2, S=35, T=25, P=0, Pt=0, Sit=0,
        k1k2="l", kf="pf", pHscale="T")

Arguments

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 f
var1
Value of the first variable in mol/kg, except for pH and for pCO2 in $\mu$atm
var2
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
k1k2
"l" for using K1 and K2 from Lueker et al. and "r" for using K1 and K2 from Roy et al. , default is "l"
kf
"pf" for using Kf from Perez and Fraga (1987) and "dg" for using Kf from Dickson and Riley (1979), default is "pf"
pHscale
"T" for the total scale, "F" for the free scale and "SWS" for using the seawater scale, default is "T" (total scale)

Value

  • The function returns a data frame containing the following columns:
  • SSalinity
  • TTemperature in degrees Celsius
  • PPressure in bar
  • pHpH
  • CO2CO2 concentration (mol/kg)
  • pCO2pCO2, CO2 partial pressure ($\mu$atm)
  • fCO2fCO2, CO2 fugacity ($\mu$atm)
  • HCO3HCO3 concentration (mol/kg)
  • CO3CO3 concentration (mol/kg)
  • DICDIC concentration (mol/kg)
  • ALKALK, total alkalinity (mol/kg)
  • OmegaAragoniteOmega aragonite, aragonite saturation state
  • OmegaCalciteOmega calcite, calcite saturation state

encoding

latin1

Details

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 is recommended to use either vectors with the same dimension or one vector for one argument and numbers for the other arguments. Pressure corrections and pH scale: For K1, K2, pK1, pK2, pK3, Kw, Kb, Khs and Ksi, the pressure correction was applied on the seawater scale. Hence, values were first transformed from the total scale to the seawater scale, the pressure correction applied as described by Millero (1995), and the value was transformed back to the required scale (T, F or SWS). For Kf, the pressure correction was applied on the free scale. The formulation of Dickson and Riley (1979) provides Kf on the free scale but that of Perez and Fraga (1987) provides it on the total scale. Hence, in that case, Kf was first transformed from the total scale to the free scale. With both formulations, the pressure correction was applied as described by Millero (1995), and the value was transformed back to the required scale (T, F or SWS). For Ks, the pressure correction was applied on the free scale. The pressure correction was applied as described by Millero (1995), and the value was transformed back to the required scale (T, F or SWS). For Kn, The pressure correction was applied on the seawater scale. The pressure correction was applied as described by Millero (1995), and the value was transformed back to the required scale (T, F or SWS).

References

Dickson, A. G. and Riley, J. P. 1979 The estimation of acid dissociation constants in seawater media from potentiometric titrations with strong base. I. The ionic product of water. Marine Chemistry 7, 89-99. 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. Lueker, T. J. Dickson, A. G. and Keeling, C. D. 2000 Ocean pCO2 calculated from dissolved inorganic carbon, alkalinity, and equations for K1 and K2: validation based on laboratory measurements of CO2 in gas and seawater at equilibrium. Marine Chemistry 70 105-119. Millero F. J., 1995. Thermodynamics of the carbon dioxide system in the oceans. Geochimica Cosmochimica Acta 59: 661-677. Perez, F. F. and Fraga, F. 1987 Association constant of fluoride and hydrogen ions in seawater. Marine Chemistry 21, 161-168. Roy, R. N. Roy, L. N. Vogel, K. M. Porter-Moore, C. Pearson, T. Good C. E., Millero F. J. and Campbell D. M., 1993. The dissociation constants of carbonic acid in seawater at salinities 5 to 45 and temperatures 0 to 45�C. Marine Chemistry 44, 249-267. Zeebe, R. E. and Wolf-Gladrow, D. A., 2001 CO2 in seawater: equilibrium, kinetics, isotopes. Amsterdam: Elsevier, 346 pp.

Examples

Run this code
## With a couple of variables
carb(flag=8, var1=8.2, var2=0.00234, S=35, T=25, P=0, Pt=0, Sit=0,
	pHscale="T", kf="pf", k1k2="l")

## 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)
kf <- c("pf", "pf", "pf")
k1k2 <- c("l", "l", "l")
pHscale <- c("T", "T", "T")
carb(flag=flag, var1=var1, var2=var2, S=S, T=T, P=P,
	Pt=Pt, Sit=Sit, kf=kf, k1k2=k1k2, pHscale=pHscale)

## Test with all flags 
flag <- c(1: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_P0)	#test data set for P=0 (surface)
tab <- seacarb_test_P0

## 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)

Run the code above in your browser using DataLab