Learn R Programming

seacarb (version 1.2.1)

carb: Parameters of the seawater carbonate system

Description

Returns parameters of the seawater carbonate system.

Usage

carb(df)

Arguments

df
a data frame containing the input parameters (see below)

Value

  • The function returns a dataframe containing the following columns:
  • SSalinity
  • TTemperature in degrees Celsius
  • PPressure in bar
  • PHpH
  • CO2CO2 concentration ($mol\ kg^{-1}$)
  • pCO2pCO2, CO2 partial pressure ($\mu$atm)
  • fCO2fCO2, CO2 fugacity ($\mu atm$)
  • HCO3HCO3 concentration ($mol\ kg^{-1}$)
  • CO3CO3 concentration ($mol\ kg^{-1}$)
  • DICDIC concentration ($mol\ kg^{-1}$)
  • ALKALK, total alkalinity ($mol\ kg^{-1}$)
  • OaOmega aragonite, aragonite saturation state
  • OcOmega calcite, calcite saturation state
  • PhiDPhiD, chemical buffer factor (dpH/d[DIC]); input/output of dissolved CO2 (unit pH per mol/kg)
  • BetaDBetaD, homogeneous buffer factor (dln(pCO2)/dln[DIC]); input/output of dissolved CO2
  • PiDPiD, chemical buffer factor (dpCO2/d[DIC]); input/output of dissolved CO2 ($\mu atm$ per $mol\ kg^{-1}$)
  • PhiBPhiB, chemical buffer factor (dpH/d[DIC]); from input/output of bicarbonate (unit pH per $mol\ kg^{-1}$)
  • BetaBBetaB, homogeneous buffer factor (dln(pCO2)/dln[DIC]); input/output of bicarbonate
  • PiBPiB, chemical buffer factor (dpCO2/d[DIC]); input/output of dissolved CO2 ($\mu atm$ per $mol\ kg^{-1}$)
  • PhiCPhiC, chemical buffer factor (dpH/d[DIC]); input/output of carbonate (unit pH per $mol\ kg^{-1}$)
  • BetaCBetaC, homogeneous buffer factor (dln(pCO2)/dln[DIC]); input/output of carbonate
  • PiCPiC, chemical buffer factor (dpCO2/d[DIC]); input/output of carbonate ($\mu atm$ per $mol\ kg^{-1}$)
  • PhiHPhiH, chemical buffer factor (dpH/d[DIC]); input/output of strong acid (unit pH per $mol\ kg^{-1}$)
  • PiHPiH, chemical buffer factor (dpCO2/d[DIC]); input/output of strong acid ($\mu atm$ per $mol\ kg^{-1}$)

Details

The input data frame should contain the following variables in the right order:

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 pH and pCO2 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^{-1}$) except for pH} var2{enter value of the second variable in $mol\ kg^{-1}$) except for pH} S{Salinity} T{Temperature in degrees Celsius} P{Hydrostatic pressure in bar (surface = 0)} k1k2{"r" for using K1 and K2 from Roy et al. and "m" for using K1 and K2 from Mehrbach,} phflag{The pH scale is either the total scale (0) or the free scale (1), default is 0}

Note that the results output is NO LONGER stored in a file.

References

DOE 1994 Handbook of methods for the analysis of the various parameters of the carbon dioxide system in sea water. ORNL/CDIAC-74. Oak Ridge,Tenn.: Carbon Dioxide Information Analysis Center, Oak Ridge National Laboratory.

Frankignoulle, M. 1994 A complete set of buffer factors for acid/base CO2 system in seawater. Journal of Marine Systems 5, 111-118.

Zeebe, R. E. and Wolf-Gladrow D. A., 2001 CO2 in seawater: equilibrium, kinetics, isotopes. Amsterdam: Elsevier, 346 pp.

Examples

Run this code
## Using a data set provided with the package:
data(seacarb_test)
carb(seacarb_test)

## Using another data set
x1 <- data.frame(flag=8,var1=8.2,var2=2400e-6,S=35,T=25,P=0,k1k2='r',phflag=0)
x2 <- data.frame(flag=8,var1=8.2,var2=2400e-6,S=30,T=30,P=0,k1k2='r',phflag=0)
x <- rbind(x1,x2)
carb(x)

Run the code above in your browser using DataLab