Title: | Tools for Aquatic Sciences |
---|---|
Description: | Datasets, constants, conversion factors, and utilities for 'MArine', 'Riverine', 'Estuarine', 'LAcustrine' and 'Coastal' science. The package contains among others: (1) chemical and physical constants and datasets, e.g. atomic weights, gas constants, the earths bathymetry; (2) conversion factors (e.g. gram to mol to liter, barometric units, temperature, salinity); (3) physical functions, e.g. to estimate concentrations of conservative substances, gas transfer and diffusion coefficients, the Coriolis force and gravity; (4) thermophysical properties of the seawater, as from the UNESCO polynomial or from the more recent derivation based on a Gibbs function. |
Authors: | Karline Soetaert [aut, cre], Thomas Petzoldt [aut], Filip Meysman [cph], Lorenz Meire [cph] |
Maintainer: | Karline Soetaert <[email protected]> |
License: | GPL (>= 2) |
Version: | 2.1.11 |
Built: | 2024-10-31 03:49:05 UTC |
Source: | https://github.com/cran/marelac |
R-package marelac has been designed as a tool for use by scientists working in the MArine, Riverine, Estuarine, LAcustrine and Coastal sciences.
It contains:
chemical and physical constants, e.g. atomic weights, gas constants.
conversion factors, e.g. from salinity to chlorinity, from mol to gram, etc.,
utility functions, e.g. to estimate concentrations of conservative substances as a function of salinity, ...
About the symbols used.
Here we adopt the symbolism as in McDougall et al., 2009:
S for practical (-) or absolute salinity, (g/kg)
P for absolute (total) pressure (bar)
p for sea pressure (also called gauge or applied pressure (bar), the pressure relative to P0, one standard atmosphere (=1.01325 bar)
t for temperature in C
T for absolute temperature, in K; T = t + 273.15
Many of the functions are from the UNESCO 1983 paper, or from Feistel, 2008. Note that in these papers, pressure is expressed in dbar.
Karline Soetaert (Maintainer)
Thomas Petzoldt
with contributions from Lorenz Meire and Filip Meysman
For solubilities, atmospheric composition, gas exchange coefficients:
Sarmiento JL and Gruber N, 2006. Ocean Biogeochemical Dynamics. Princeton University Press, Princeton. p 85.
For diffusion coefficients, viscosity
Boudreau BP, 1996. A method-of-lines code for carbon and nutrient diagenesis in aquatic sediments. Computers & Geosciences 22 (5), 479-496.
For many other fundamental properties of seawater, either the UNESCO report (1983):
Fofonoff NP and Millard RC Jr, 1983. Algorithms for computation of fundamental properties of seawater. UNESCO technical papers in marine science, 44, 53 pp. http://unesdoc.unesco.org/images/0005/000598/059832EB.pdf
or the more recent report and papers:
Feistel R, 2008. A Gibbs function for seawater thermodynamics for -6 to 80 dgC and salinity up to 120 g/kg. Deep-Sea Research I, 55, 1639-1671.
McDougall TJ, Feistel R, Millero FJ, Jackett DR, Wright DG, King BA, Marion GM, Chen C-T A and Spitzer P, 2009. Calculation of the Thermophysical Properties of Seawater, Global Ship-based Repeat Hydrography Manual, IOCCP Report No. 14, ICPO Publication Series no. 134.
Millero FJ, Feistel R, Wright DG, and McDougall TJ, 2008. The composition of Standard Seawater and the definition of the Reference-Composition Salinity Scale, Deep-Sea Res. I, 55, 50-72.
for seawater properties:
sw_adtgrad
, sw_alpha
, sw_beta
,
sw_comp
, sw_conserv
, sw_cp
,
sw_dens
,
sw_depth
, sw_enthalpy
, sw_entropy
,
sw_gibbs
, sw_kappa
,
sw_kappa_t
, sw_sfac
,
sw_svel
, sw_tfreeze
, sw_tpot
for atmospheric gasses:
gas_satconc
, gas_O2sat
,
gas_schmidt
, gas_solubility
, gas_transfer
,
atmComp
, vapor
, air_spechum
,
air_density
conversions:
convert_AStoPS
, convert_PStoAS
,
convert_RtoS
,
convert_StoCl
, convert_StoR
,
convert_p
, convert_T
datasets:
AtomicWeight
, Bathymetry
,
Constants
, Oceans
physical properties:
earth_surf
, coriolis
, viscosity
,
diffcoeff
, ssd2rad
, vertmean
,
gravity
molecular properties:
AtomicWeight
, molvol
, molweight
,
redfield
## Not run: ## show examples (see respective help pages for details) example(Constants) example(molvol) ## open the directory with documents browseURL(paste(system.file(package="marelac"), "/doc", sep="")) ## End(Not run)
## Not run: ## show examples (see respective help pages for details) example(Constants) example(molvol) ## open the directory with documents browseURL(paste(system.file(package="marelac"), "/doc", sep="")) ## End(Not run)
The density of the air, in kg/m3
air_density(t = 25, P = 1.013253)
air_density(t = 25, P = 1.013253)
t |
Temperature, |
P |
True pressure, bar |
The air density, in kg/m3
Karline Soetaert <[email protected]>, Lorenz Meire <[email protected]>
http://www.cactus2000.de/uk/unit/masshum.shtml
vapor
, air_spechum
,
gas_O2sat
, gas_satconc
,
gas_schmidt
, gas_solubility
,
gas_transfer
, atmComp
air_density(t = 25) # 1.183894 plot(0:30, air_density(t = 0:30), xlab = "Temperature, dgC", ylab = "kg/m3") plot(x= seq(0.8,1.2, 0.01), y = air_density(P = seq(0.8,1.2, 0.01)), xlab = "pressure, bar", ylab = "kg/m3")
air_density(t = 25) # 1.183894 plot(0:30, air_density(t = 0:30), xlab = "Temperature, dgC", ylab = "kg/m3") plot(x= seq(0.8,1.2, 0.01), y = air_density(P = seq(0.8,1.2, 0.01)), xlab = "pressure, bar", ylab = "kg/m3")
The specific humidity of air (mass mixing ratio in wet air), in kg/kg
air_spechum(t = 25, rh = 50, P = 1.013253)
air_spechum(t = 25, rh = 50, P = 1.013253)
t |
Temperature, |
rh |
Relative humidity, % |
P |
True pressure, bar |
The specific humidity, in kg/kg.
Karline Soetaert <[email protected]>, Lorenz Meire <[email protected]>
Lowe, P.R. and J.M. Ficke, 1974: The computation of saturation vapor pressure. Tech. Paper No. 4-74, Environmental Prediction Research Facility, Naval Postgraduate School, Monterey, CA, 27 pp.
http://www.cactus2000.de/uk/unit/masshum.shtml
vapor
, air_density
,
gas_O2sat
, gas_satconc
,
gas_schmidt
, gas_solubility
,
gas_transfer
, atmComp
air_spechum(t = 25, rh = 50)*1000 # 9.7778 plot(0:30, air_spechum(t = 0:30), xlab = "Temperature, dgC", ylab = "kg/kg") plot(0:100, air_spechum(rh = 0:100), xlab = "percent humidity", ylab = "kg/kg")
air_spechum(t = 25, rh = 50)*1000 # 9.7778 plot(0:30, air_spechum(t = 0:30), xlab = "Temperature, dgC", ylab = "kg/kg") plot(0:100, air_spechum(rh = 0:100), xlab = "percent humidity", ylab = "kg/kg")
Provides the global average atmospheric composition at present day conditions (year 1998). The mixing ratio is generally defined as the ratio of the mass of an atmospheric constituent to the total mass of dry air. If not otherwise indicated, the term mixing ratio normally refers to water vapor. Here however the mixing ratio is provided for all constituents other than water. The mixing ratio is given as a mole fraction, i.e. the mass of each constituent gas (expressed in moles) divided by the total mass of dry air (also expressed in moles).
atmComp(species = c("He", "Ne", "N2", "O2", "Ar", "Kr", "CH4", "CO2", "N2O", "H2", "Xe", "CO", "O3"))
atmComp(species = c("He", "Ne", "N2", "O2", "Ar", "Kr", "CH4", "CO2", "N2O", "H2", "Xe", "CO", "O3"))
species |
character vector selecting the gases whose composition should be provided. |
A vector providing the mixing ratio of the selected gases.
Karline Soetaert <[email protected]>, Filip Meysman <[email protected]>
Sarmiento JL and Gruber N, 2006. Ocean Biogeochemical Dynamics. Princeton University Press, Princeton. p 85.
They cite Weast and Astle (1982) for all gasses except CO2, CH4 and N2O. For the latter three greenhouse gases, the 1998 concentrations are taken from Ramaswamy et al., 2001. Note that the sum of all mixing ratios is slightly larger than one, presumably due to the use of increased greenhouse gases values as compared to Weast and Astle (1982). In fact, the mixing ratio are changing slightly each year due to increases in greenhouse gas concentrations.
gas_O2sat
, gas_satconc
,
gas_schmidt
, gas_solubility
,
gas_transfer
, vapor
atmComp("O2") atmComp(c("O2", "CH4", "CO2", "N2O")) atmComp() sum(atmComp()) # note this is not =1!
atmComp("O2") atmComp(c("O2", "CH4", "CO2", "N2O")) atmComp() sum(atmComp()) # note this is not =1!
Atomic weights of chemical elements according to the IUPAC table.
AtomicWeight atomicweight
AtomicWeight atomicweight
The capitalized version AtomicWeight
is a data frame containing
the IUPAC table of atomic weights.
This data frame has following colums: Number, Name,
Symbol, Weight, Footnotes.
Note that as in the IUPAC table, the Weight is given as a text rather than as numeric objects. It comprises the standard values and the uncertainties (in parentheses, following the last significant figure to which they are attributed). See IUPAC report for explanation of the Footnotes.
The lower case version atomicweight
is a simplified list that only
contains the weights (as numeric values) and allows symbolic
computations with elements to arrive at molecular weights.
Molecular weights of chemical elements may vary due to different isotope
compositions, depending on geology, industrial processes or biological activity.
Please consult the IUPAC Technical report about the details.
The data set contains NA
for elements that have no stable isotopes
(except U, Th, Pa).
Thomas Petzoldt
Wieser ME, 2006. Atomic weights of the elements 2005 (IUPAC Technical Report). Pure Appl. Chem. 78 (11), 2051–2066., 2006. DOI: 10.1351/pac200678112051
other datasets: Bathymetry
,
Constants
, Oceans
,
molweight
for molecular weight calculations with
molecular formulae.
## assess the data in the IUPAC table (with all footnotes) AtomicWeight[1:20,] AtomicWeight[AtomicWeight$Symbol == "C",] ## use the lower case version for simple calculations: atomicweight$C with(atomicweight, C) ## it can also be used to calculate molecular weights ## via symbolic computation with(atomicweight, H * 2 + O)
## assess the data in the IUPAC table (with all footnotes) AtomicWeight[1:20,] AtomicWeight[AtomicWeight$Symbol == "C",] ## use the lower case version for simple calculations: atomicweight$C with(atomicweight, C) ## it can also be used to calculate molecular weights ## via symbolic computation with(atomicweight, H * 2 + O)
This dataset contains the elevation of sea (bathymetry) and land (hypsometry) across the globe at 1 degree intervals. Dataset as used by Andersson et al. (2004).
Bathymetry
Bathymetry
A list with the bathymetry (depth) and hypsometry (altitude) of the world. It contains:
the latitude,
the longitude,
the height (m).
Karline Soetaert <[email protected]>
Andersson H, Wijsman J, Herman PMJ, Middelburg J, Soetaert K and Heip C, 2004. Respiration patterns in the deep ocean. Geophysical Research Letters 31, LO3304.
par(mar = c(2,2,2,2)) image(Bathymetry$x, Bathymetry$y, Bathymetry$z, col = femmecol(100), asp = TRUE, xlab = "dg", ylab = "dg") contour(Bathymetry$x, Bathymetry$y, Bathymetry$z, asp = TRUE, add = TRUE) # remove land zz <- Bathymetry$z zz[zz>0] <- 0 image(Bathymetry$x, Bathymetry$y, zz, col = c(femmecol(100), "black"), asp = TRUE) contour(Bathymetry$x, Bathymetry$y, zz, asp = TRUE, add = TRUE)
par(mar = c(2,2,2,2)) image(Bathymetry$x, Bathymetry$y, Bathymetry$z, col = femmecol(100), asp = TRUE, xlab = "dg", ylab = "dg") contour(Bathymetry$x, Bathymetry$y, Bathymetry$z, asp = TRUE, add = TRUE) # remove land zz <- Bathymetry$z zz[zz>0] <- 0 image(Bathymetry$x, Bathymetry$y, zz, col = c(femmecol(100), "black"), asp = TRUE) contour(Bathymetry$x, Bathymetry$y, zz, asp = TRUE, add = TRUE)
Physical and chemical constants useful for aquatic sciences.
Constants
Constants
A list specifying the value, the units, and a description for each physical constant.
Karline Soetaert <[email protected]>
Mohr PJ and Taylor BN, 2005. CODATA recommended values of the fundamental physical constants: 2002, Review of Modern Physics 77, 1 - 107.
AtomicWeight
, Bathymetry
,
Oceans
data.frame(cbind(acronym = names(Constants), matrix(ncol = 3, byrow = TRUE, data = unlist(Constants), dimnames = list(NULL, c("value", "units", "description")))))
data.frame(cbind(acronym = names(Constants), matrix(ncol = 3, byrow = TRUE, data = unlist(Constants), dimnames = list(NULL, c("value", "units", "description")))))
The function converts between different units of pressure.
convert_p(x, unit = c("Pa", "bar", "at", "atm", "torr"))
convert_p(x, unit = c("Pa", "bar", "at", "atm", "torr"))
x |
vector of given pressure values, |
unit |
measurement unit of the given value(s). |
A data frame with converted values.
https://en.wikipedia.org/wiki/Bar_(unit)
convert_AStoPS
, convert_PStoAS
,
convert_RtoS
,
convert_StoCl
, convert_StoR
,
convert_T
,
convert_p(1, "atm") convert_p(c(2, 3, 4.5), "bar") convert_p(1, "atm")$Pa
convert_p(1, "atm") convert_p(c(2, 3, 4.5), "bar") convert_p(1, "atm")$Pa
Estimates the salinity of seawater from conductivity, temperature and
pressure. The equation is valid over ranges: temperature from -2 to 35
C, pressure from 0 to 1000 bar, and salinity
from 2 to 42.
convert_RtoS(R = 1, t = 25, p = max(0, P-1.013253), P = 1.013253)
convert_RtoS(R = 1, t = 25, p = max(0, P-1.013253), P = 1.013253)
R |
Conductivity ratio, the conductivity at (S, t, P) divided by the conductivity at S = 35, t = 15, p = 0 [-] |
t |
Temperature, |
p |
Gauge (or applied) pressure, the pressure referenced against the local atmospheric pressure, bar |
P |
True pressure, bar |
The salinity.
The conductivity ratio for Salinity = 40.0000, t = 40, p = 1000 is 1.888091.
Karline Soetaert <[email protected]>
Fofonoff NP and Millard RC Jr, 1983. Algorithms for computation of
fundamental properties of seawater. UNESCO technical papers in marine
science, 44, 53 pp.
http://unesdoc.unesco.org/images/0005/000598/059832EB.pdf
convert_AStoPS
, convert_PStoAS
,
convert_StoR
,
convert_StoCl
,
convert_p
, convert_T
,
convert_RtoS(R = 1.888091, t = 40, p = 1000) ## Salinity = 40.0000, t = 40, p = 1000, cond = 1.888091 convert_RtoS(R = 1, t = 15, p = 0) ## Check values convert_RtoS(R = 0.6990725, t = 10, p = 0) # 26.8609 convert_RtoS(R = 0.6990725, t = 10, p = 100) # 26.5072 convert_RtoS(R = 1.1651206, t = 20, p = 100) # 36.3576
convert_RtoS(R = 1.888091, t = 40, p = 1000) ## Salinity = 40.0000, t = 40, p = 1000, cond = 1.888091 convert_RtoS(R = 1, t = 15, p = 0) ## Check values convert_RtoS(R = 0.6990725, t = 10, p = 0) # 26.8609 convert_RtoS(R = 0.6990725, t = 10, p = 100) # 26.5072 convert_RtoS(R = 1.1651206, t = 20, p = 100) # 36.3576
Conversion from practical to absolute salinity and vice versa.
convert_PStoAS(S = 35, p = max(0, P - 1.013253), P = 1.013253, lat = NULL, lon = NULL, DSi = NULL, Ocean = c("Global", "Atlantic", "Pacific", "Indian", "Southern")) convert_AStoPS(S = 35, p = max(0, P - 1.013253), P = 1.013253, lat = NULL, lon = NULL, DSi = NULL, Ocean = c("Global","Atlantic","Pacific","Indian","Southern"))
convert_PStoAS(S = 35, p = max(0, P - 1.013253), P = 1.013253, lat = NULL, lon = NULL, DSi = NULL, Ocean = c("Global", "Atlantic", "Pacific", "Indian", "Southern")) convert_AStoPS(S = 35, p = max(0, P - 1.013253), P = 1.013253, lat = NULL, lon = NULL, DSi = NULL, Ocean = c("Global","Atlantic","Pacific","Indian","Southern"))
S |
Salinity, either practical salinity ( |
p |
gauge or applied pressure, pressure referenced against the local atmospheric pressure, bar |
P |
true pressure, bar |
lat |
latitude (-90 to +90) |
lon |
longitude (0 to 360) |
DSi |
the silicate concentration, in micromol/kg |
Ocean |
the ocean in which the measurement was taken; only
used if |
Absolute salinity (g kg-1) is estimated from Practical salinity as:
AS= 35.16504 /35 * PS + delt()
where delt is the absolute salinity anomaly. There are two ways in which to estimate the salinity anomaly
1. If DSi is not given a value, then the anomaly is estimated as a function of
longitude lon
, latitude lat
and pressure p
, using the
lookup table as in sw_sfac
.
2. If DSi
is given a value, then a regression on it is used, based on the
values of Ocean
and -except for the "global" ocean- the latitute
lat
:
a global estimate is used,
delt= 9.824e-5 *DSi,
the Southern Ocean (lat
< -30),
delt= 7.4884e-5 *DSi,
the Pacific Ocean ,
delt= 7.4884e-5 *(1 + 0.3622[lat
/30 + 1])*DSi,
the Indian Ocean ,
delt= 7.4884e-5 *(1 + 0.3861[lat
/30 + 1])*DSi,
the Atlantic Ocean ,
delt= 7.4884e-5 *(1 + 1.0028[lat
/30 + 1])*DSi,
Note that for the Pacific, Indian and Atlantic Ocean regression,
the latitude is needed. If lat
is NULL
then the Global
regression will be used.
The absolute salinity (convert_PStoAS
) or practical salinity
(convert_AStoPS
).
Karline Soetaert <[email protected]>
Millero FJ, Feistel R, Wright DG and McDougall TJ, 2008. The composition of Standard Seawater and the definition of the Reference-Composition Salinity Scale, Deep-Sea Res. I, 55, 50-72.
McDougall TJ, Jackett DR and Millero FJ, 2009. An algorithm for estimating Absolute Salinity in the global ocean. Ocean Science Discussions 6, 215-242. http://www.ocean-sci-discuss.net/6/215/2009/
Uses the Fortran code written by David Jackett. http://www.teos-10.org/
convert_RtoS
, convert_StoR
,
convert_StoCl
,
convert_p
, convert_T
,
# check values: should be 35.7 convert_PStoAS(S = 35.52764437773386, p = 102.3, lon = 201, lat = -21) # check values: should be 35.52764437773386 convert_AStoPS(S = 35.7, p = 102.3, lon = 201, lat = -21) # convert_PStoAS(S = 35) convert_AStoPS(S = 35) convert_PStoAS(S = 35, lat = 10, lon = 10, p = 0) # Based on Si concentration DSi <- seq(from = 0, to = 200, by = 10) Global <- convert_PStoAS(30, DSi = DSi, Ocean = "Global") Atlantic <- convert_PStoAS(30, DSi = DSi, Ocean = "Atlantic", lat = 0) Pacific <- convert_PStoAS(30, DSi = DSi, Ocean = "Pacific", lat = 0) Indian <- convert_PStoAS(30, DSi = DSi, Ocean = "Indian", lat = 0) Southern <- convert_PStoAS(30, DSi = DSi, Ocean = "Southern") matplot(x = DSi, y = cbind(Global, Atlantic, Pacific, Indian, Southern), pch = 1, xlab = "DSi, micromol/kg", ylab = "Absolute salinity (PS=30)") legend("topleft",c("Global", "Atlantic", "Pacific", "Indian", "Southern"), col = 1:5, pch = 1)
# check values: should be 35.7 convert_PStoAS(S = 35.52764437773386, p = 102.3, lon = 201, lat = -21) # check values: should be 35.52764437773386 convert_AStoPS(S = 35.7, p = 102.3, lon = 201, lat = -21) # convert_PStoAS(S = 35) convert_AStoPS(S = 35) convert_PStoAS(S = 35, lat = 10, lon = 10, p = 0) # Based on Si concentration DSi <- seq(from = 0, to = 200, by = 10) Global <- convert_PStoAS(30, DSi = DSi, Ocean = "Global") Atlantic <- convert_PStoAS(30, DSi = DSi, Ocean = "Atlantic", lat = 0) Pacific <- convert_PStoAS(30, DSi = DSi, Ocean = "Pacific", lat = 0) Indian <- convert_PStoAS(30, DSi = DSi, Ocean = "Indian", lat = 0) Southern <- convert_PStoAS(30, DSi = DSi, Ocean = "Southern") matplot(x = DSi, y = cbind(Global, Atlantic, Pacific, Indian, Southern), pch = 1, xlab = "DSi, micromol/kg", ylab = "Absolute salinity (PS=30)") legend("topleft",c("Global", "Atlantic", "Pacific", "Indian", "Southern"), col = 1:5, pch = 1)
Estimates the chlorinity concentration based on salinity
convert_StoCl(S = 35)
convert_StoCl(S = 35)
S |
salinity |
The chlorinity concentration, g/kg
Karline Soetaert <[email protected]>
Cox RA, Culkin F, Riley JP, 1967. The electrical conductivity – chlorinity relationship in natural seawater. Deep–Sea Research 14, 203–220.
convert_AStoPS
, convert_PStoAS
,
convert_RtoS
, convert_StoR
,
convert_p
, convert_T
,
convert_StoCl(20)
convert_StoCl(20)
Estimates the conductivity ratio from salinity, temperature and pressure.
The equation is valid over ranges of temperature from -2 to 35
C, pressure of 0 - 1000 bar and salinity 2-42
in the world ocean.
convert_StoR(S = 35, t = 25, p = max(0, P-1.013253), P = 1.013253)
convert_StoR(S = 35, t = 25, p = max(0, P-1.013253), P = 1.013253)
S |
(practical) Salinity, -, |
t |
Temperature, |
P |
True Pressure, bar, |
p |
Gauge (or applied) pressure, the pressure referenced against the local atmospheric pressure, bar. |
The conductivity ratio (-), this is the conductivity at (S, t, p), divided by the conductivity at S = 35, t = 15, p = 0.
Pressure here is true pressure, 1 bar (at sea surface), in contrast to hydrostatic pressure in dbar of original formula.
The conductivity ratio for Salinity = 40, t = 40, p
=
1000 is 1.888091.
Karline Soetaert <[email protected]>
Fofonoff NP and Millard RC Jr, 1983. Algorithms for computation of
fundamental properties of seawater. UNESCO technical papers in marine
science, 44, 53 pp.
http://unesdoc.unesco.org/images/0005/000598/059832EB.pdf
convert_AStoPS
, convert_PStoAS
,
convert_RtoS
,
convert_StoCl
,
convert_p
, convert_T
,
convert_StoR(S = 40, t = 40, p = 1000) convert_StoR(S = 35, t = 15, p = 0) # Check values: convert_StoR(S = 25, t = 10, p = 0) # 0.654990 convert_StoR(S = 25, t = 10, p = 100) # 0.662975 convert_StoR(S = 25, t = 10, p = 1000) # 0.712912 convert_StoR(S = 35, t = 10, p = 100) # 0.897778 convert_StoR(S = 40, t = 10, p = 100) # 1.011334
convert_StoR(S = 40, t = 40, p = 1000) convert_StoR(S = 35, t = 15, p = 0) # Check values: convert_StoR(S = 25, t = 10, p = 0) # 0.654990 convert_StoR(S = 25, t = 10, p = 100) # 0.662975 convert_StoR(S = 25, t = 10, p = 1000) # 0.712912 convert_StoR(S = 35, t = 10, p = 100) # 0.897778 convert_StoR(S = 40, t = 10, p = 100) # 1.011334
The function converts between different units of temperature.
convert_T(x, unit = c("K", "C", "F"))
convert_T(x, unit = c("K", "C", "F"))
x |
Vector of given temperature values, |
unit |
Measurement unit of the given value(s). |
A data frame with converted values.
Mangum BW and Furukawa GT, 1990. Guidelines for Realizing the International Temperature Scale of 1990 (ITS-90). NIST Technical Note 1265. and the url
http://www.cstl.nist.gov/div836/836.05/papers/magnum90ITS90guide.pdf
convert_AStoPS
, convert_PStoAS
,
convert_RtoS
, convert_StoR
,
convert_StoCl
,
convert_p
convert_T(0, "K") convert_T(0, "C") convert_T(0, "F") convert_T(273.15, "K") convert_T(-273.15, "C") convert_T(c(-459.67, 0, 32), "F") convert_T(32, "F")$C # 0 degrees C
convert_T(0, "K") convert_T(0, "C") convert_T(0, "F") convert_T(273.15, "K") convert_T(-273.15, "C") convert_T(c(-459.67, 0, 32), "F") convert_T(32, "F")$C # 0 degrees C
Estimates the coriolis factor, f (in ), where
, where
radians/sec, the
rotation of the earth.
coriolis(lat)
coriolis(lat)
lat |
latitude in degrees north (-90 to +90). |
The coriolis factor ().
Karline Soetaert < [email protected] >
Pond S and Pickard G, 1986. Introductory Dynamical Oceanography, Pergamon Press, Sydney, 2nd Ed.
Griffies SM, 2004. Fundamentals of Ocean Climate Models. Princeton, NJ, Princeton University Press, 518 pp.
viscosity
,
diffcoeff
, ssd2rad
, vertmean
,
gravity
plot(-90:90, coriolis(-90:90), xlab = "latitude, dg North", ylab = "/s", main = "coriolis factor", type = "l", lwd = 2)
plot(-90:90, coriolis(-90:90), xlab = "latitude, dg North", ylab = "/s", main = "coriolis factor", type = "l", lwd = 2)
Calculates the molecular and ionic diffusion coefficients in
, for several inorganic species in seawater
at a given salinity, temperature, and pressure.
Based on Chapter 4 in Boudreau (1997)
diffcoeff(S = 35, t = 25, P = 1.013253, species = c("H2O", "O2", "CO2", "H2", "CH4", "DMS", "He", "Ne", "Ar", "Kr", "Xe", "Rn", "N2", "H2S", "NH3", "NO", "N2O", "CO", "SO2", "OH", "F", "Cl", "Br", "I", "HCO3", "CO3", "H2PO4", "HPO4", "PO4", "HS", "HSO3", "SO3", "HSO4", "SO4", "IO3", "NO2", "NO3", "H", "Li", "Na", "K", "Cs","Ag","NH4", "Ca", "Mg", "Fe", "Mn", "Ba", "Be", "Cd", "Co", "Cu", "Hg", "Ni", "Sr", "Pb", "Ra", "Zn", "Al", "Ce", "La", "Pu", "H3PO4", "BOH3", "BOH4", "H4SiO4"))
diffcoeff(S = 35, t = 25, P = 1.013253, species = c("H2O", "O2", "CO2", "H2", "CH4", "DMS", "He", "Ne", "Ar", "Kr", "Xe", "Rn", "N2", "H2S", "NH3", "NO", "N2O", "CO", "SO2", "OH", "F", "Cl", "Br", "I", "HCO3", "CO3", "H2PO4", "HPO4", "PO4", "HS", "HSO3", "SO3", "HSO4", "SO4", "IO3", "NO2", "NO3", "H", "Li", "Na", "K", "Cs","Ag","NH4", "Ca", "Mg", "Fe", "Mn", "Ba", "Be", "Cd", "Co", "Cu", "Hg", "Ni", "Sr", "Pb", "Ra", "Zn", "Al", "Ce", "La", "Pu", "H3PO4", "BOH3", "BOH4", "H4SiO4"))
S |
Salinity, -, |
t |
Temperature, |
P |
True pressure, bar, |
species |
character vector with the names of the chemical species whose diffusion coefficient should be calculated. |
To correct for salinity, the Stokes-Einstein relationship is used. This is not quite accurate, but is at least consistent.
: Least (1984) determined D(H3PO4) at 25 deg C and 0 S.
Assume that this value can be scaled by the Stokes-Einstein
relationship to any other temperature.
: Mackin (1986) determined D(B(OH)3) at 25 deg C and
about 29.2 S. Assume that this value can be scaled by the
Stokes-Einstein relationship to any other temperature.
: No information on this species. Boudreau and Canfield
(1988) assume it is 12.5% smaller than B(OH)3.
: Wollast and Garrels (1971) found D(H4SiO4) at 25 deg
C and 36.1 ppt S. Assume that this value can be scaled by the
Stokes-Einstein relationship to any other temperature.
Arguments salinity, temperature or pressure can be vectors. In order to avoid
confusion, S, t and P must have either same length or length 1. More flexible
combinations are of course possible with expand.grid
A data.frame
with the diffusion coefficients
of the selected chemical species.
Filip Meysman <[email protected]>, Karline Soetaert <[email protected]>
Based on Chapter 4 in Boudreau (1997) :
Boudreau BP, 1997. Diagenetic Models and their Implementation. Modelling Transport and Reactions in Aquatic Sediments. Springer. Berlin.
who cites:
for self-diffusion coefficient H2O:
Cohen MH and Turnbull D. 1959. Molecular transport in liquids and glasses. Journal of chemical physics 31 (5): 1164-1169
Krynicki K, Green CD and Sawyer DW, 1978. Pressure and temperature-dependence of self-diffusion in water. Faraday discussions 66: 199-208
for gases O2 and CO2:
Novel relation by Boudreau (1997) based on new compilation of data
for gases He, Ne, Kr, Xe, Rn, H2, CH4:
Jahne B, Heinz G, and Dietrich W, 1987. Measurements of the diffusion coefficients of sparingly soluble gases in water. J. Geophys. Res., 92:10,767-10,776.
for Ar:
Ohsumi T and Horibe Y, 1984. Diffusivity of He and Ar in deep-sea sediments, Earth and Planetary Science Letters 70, 61-68.
for DMS:
Saltzman ES, King DB, Holmen K, and Leck C, 1993. Experimental Determination of the Diffusion Coefficient of Dimethylsulfide in Water, J. Geophys. Res., 98(C9), 16, 481-486.
for other gases (N2, H2S, NH3, NO, N2O, CO, SO2):
Wilke CR and Chang P, 1955. Correlation of diffusion coefficients in dilute solutions. Aiche journal 1 (2): 264-270
with the correction proposed by
Hayduk W and Laudie H, 1974. Prediction of diffusion-coefficients for nonelectrolytes in dilute aqueous-solutions. Aiche journal 20 (3): 611-615
for ions:
Hayduk W and Laudie H, 1974. Prediction of diffusion-coefficients for nonelectrolytes in dilute aqueous-solutions. Aiche journal 20 (3): 611-615
for H3PO4, B(OH)3, B(OH)4, H4SiO4 : see details
coriolis
, viscosity
,
ssd2rad
, vertmean
,
gravity
diffcoeff(S = 15, t = 15)*1e4*3600*24 # cm2/day diffcoeff(t = 10, species = "O2") # m2/s difftemp <- diffcoeff(t = 0:30)[,1:13] matplot(0:30, difftemp, xlab = "temperature", ylab = "m2/s", main = "Molecular/ionic diffusion", type = "l", col = 1:13, lty = 1:13) legend("topleft", ncol = 2, cex = 0.8, title = "mean", col = 1:13, lty = 1:13, legend = cbind(names(difftemp), format(colMeans(difftemp), digits = 4))) ## vector-valued salinity select <- c("O2", "CO2", "NH3", "NH4", "NO3") diffsal <- diffcoeff(S = 0:35, species = select) matplot(0:35, diffsal, xlab = "salinity", ylab = "m2/s", main = "Molecular/ionic diffusion", type = "l", col = 1:length(select), lty = 1:length(select)) legend("topleft", ncol = 2, cex = 0.8, title = "mean", col = 1:length(select), lty = 1:length(select), legend = cbind(select, format(colMeans(diffsal), digits = 4))) ## vector-valued temperature difftemp <- diffcoeff(S = 1, t=1:20, species = select) matplot(1:20, difftemp, xlab = "temperature", ylab = "m2/s", main = "Molecular/ionic diffusion", type = "l", col = 1:length(select), lty = 1:length(select)) legend("topleft", ncol = 2, cex = 0.8, title = "mean", col = 1:length(select), lty = 1:length(select), legend = cbind(select, format(colMeans(difftemp), digits = 4))) ## combination of S and t diffsaltemp <- diffcoeff(S = rep(c(1, 35), each = 20), t = rep(1:20, 2), species = select)
diffcoeff(S = 15, t = 15)*1e4*3600*24 # cm2/day diffcoeff(t = 10, species = "O2") # m2/s difftemp <- diffcoeff(t = 0:30)[,1:13] matplot(0:30, difftemp, xlab = "temperature", ylab = "m2/s", main = "Molecular/ionic diffusion", type = "l", col = 1:13, lty = 1:13) legend("topleft", ncol = 2, cex = 0.8, title = "mean", col = 1:13, lty = 1:13, legend = cbind(names(difftemp), format(colMeans(difftemp), digits = 4))) ## vector-valued salinity select <- c("O2", "CO2", "NH3", "NH4", "NO3") diffsal <- diffcoeff(S = 0:35, species = select) matplot(0:35, diffsal, xlab = "salinity", ylab = "m2/s", main = "Molecular/ionic diffusion", type = "l", col = 1:length(select), lty = 1:length(select)) legend("topleft", ncol = 2, cex = 0.8, title = "mean", col = 1:length(select), lty = 1:length(select), legend = cbind(select, format(colMeans(diffsal), digits = 4))) ## vector-valued temperature difftemp <- diffcoeff(S = 1, t=1:20, species = select) matplot(1:20, difftemp, xlab = "temperature", ylab = "m2/s", main = "Molecular/ionic diffusion", type = "l", col = 1:length(select), lty = 1:length(select)) legend("topleft", ncol = 2, cex = 0.8, title = "mean", col = 1:length(select), lty = 1:length(select), legend = cbind(select, format(colMeans(difftemp), digits = 4))) ## combination of S and t diffsaltemp <- diffcoeff(S = rep(c(1, 35), each = 20), t = rep(1:20, 2), species = select)
earth_surf
computes the surface of 1d by 1dg grid cells as a function of latitude.
Based on data that give the surface distance per 1 dg change in lat/lon from https://en.wikipedia.org/wiki/Latitude
earth_dist
calculates the distance between two (lat, lon) points
earth_surf(lat = 0, lon = 0) earth_dist(alat, alon, blat, blon, method = 1)
earth_surf(lat = 0, lon = 0) earth_dist(alat, alon, blat, blon, method = 1)
lat |
latitude (-90 - +90). |
lon |
longitude - not used. |
alat |
first latitude (-90 - +90). |
alon |
first longitude (-180, 180). |
blat |
second latitude (-90 - +90). |
blon |
second longitude (-180, 180). |
method |
an integer indicating the formula to use, either the
spherical law of cosines ( |
Surface of the grid cell, in .
Distance between the points (alat, alon), (blat, blon), m.
Karline Soetaert <[email protected]>
earth_surf(seq(0, 90, by = 15)) SURF <- outer(X = Bathymetry$x, Y = Bathymetry$y, FUN <- function(X, Y) earth_surf(Y, X)) earth_dist(10, 80, 10, 81) earth_dist(20, 80, 20, 81) SURF <- outer(X = Bathymetry$x, Y = Bathymetry$y, FUN <- function(X, Y) earth_surf(Y, X)) sum(SURF) #is: 510,072,000 km2 # the surface of the Oceans, m2 sum(SURF*(Bathymetry$z < 0)) # is: 3.58e14 # the volume of the Oceans, m3 - sum(SURF*Bathymetry$z*(Bathymetry$z < 0)) # is: 1.34e+18 # the surface area at several depths SurfDepth <- vector() dseq <- seq(-7500, -250, by = 250) for (i in 2:length(dseq)) { ii <- which (Bathymetry$z > dseq[i-1] & Bathymetry$z <= dseq[i]) SurfDepth[i-1]<-sum(SURF[ii]) } plot(dseq[-1], SurfDepth, xlab = "depth, m", log = "y", ylab = "m2", main = "Surface at ocean depths")
earth_surf(seq(0, 90, by = 15)) SURF <- outer(X = Bathymetry$x, Y = Bathymetry$y, FUN <- function(X, Y) earth_surf(Y, X)) earth_dist(10, 80, 10, 81) earth_dist(20, 80, 20, 81) SURF <- outer(X = Bathymetry$x, Y = Bathymetry$y, FUN <- function(X, Y) earth_surf(Y, X)) sum(SURF) #is: 510,072,000 km2 # the surface of the Oceans, m2 sum(SURF*(Bathymetry$z < 0)) # is: 3.58e14 # the volume of the Oceans, m3 - sum(SURF*Bathymetry$z*(Bathymetry$z < 0)) # is: 1.34e+18 # the surface area at several depths SurfDepth <- vector() dseq <- seq(-7500, -250, by = 250) for (i in 2:length(dseq)) { ii <- which (Bathymetry$z > dseq[i-1] & Bathymetry$z <= dseq[i]) SurfDepth[i-1]<-sum(SURF[ii]) } plot(dseq[-1], SurfDepth, xlab = "depth, m", log = "y", ylab = "m2", main = "Surface at ocean depths")
Empirical formulae that can be used to compute saturation
concentration of oxygen in water in
gas_O2sat(S = 35, t = 25, masl = 0, method = c("Weiss", "APHA", "Paul"))
gas_O2sat(S = 35, t = 25, masl = 0, method = c("Weiss", "APHA", "Paul"))
S |
salinity (dimensionless, for method "Weiss" only), |
t |
Temperature in |
masl |
height above sea level (in m, for method "Paul" only), |
method |
formula to be used, see references for correct application. |
Method APHA is the standard formula in Limnology, method Weiss the
standard formula in marine sciences. The method after Paul is a simple
formula fitted on available tables. To avoid confusion between the
arguments (S, t, masl) it is advisable to use named arguments in
general, e.g. O2sat(t = 4)
.
Vector with oxygen saturation concentration in .
American Public Health Association, Inc. (1985): Standard Methods for the Examination of Water and Wastewater. 18th edition, 1992.
Benson BB and Krause D, 1980. The concentration and isotopic fractionation of gases dissolved in freshwater in equilibrium with the atmosphere. I. Oxygen. Limnology and Oceanography 25, 662-671.
Brown LC and Barnwell TO Jr, 1987. The Enhanced Stream Water Quality Models QUAL2E and QUAL2E-UNCAS: Documentation and User Manual. U.S. Environmental Protection Agency, Athens, Georgia. EPA/600/3-87/007, p. 41. http://www.epa.gov)
DIN 38408-23, Ausgabe:1987-11: Deutsche Einheitsverfahren zur Wasser-, Abwasser- und Schlammuntersuchung; Gasf?rmige Bestandteile (Gruppe G); Bestimmung des Sauerstoffs?ttigungsindex (G 23).
Paul L, 1985. Das thermische Regime der Talsperre Saidenbach und einige Beziehungen zwischen abiotischen und biotischen Komponenten. Dissertation, TU Dresden, Fakult?t Bau-, Wasser- und Forstwesen. 84 pp.
Weiss R, 1970. The solubility of nitrogen, oxygen, and argon in water and seawater. Deep-Sea Research 17, 721-35.
Wagner R, 1979. Die Praxis der Bestimmung des biochemischen Sauerstoffbedarfs - Ergebnisse einer Umfrage (Berichtigung und Erg?nzung zur Ver?ffentlichung). Vom Wasser 53, S. 283-285.
gas_satconc
for other gas species and explicit
consideration of pressure.
gas_O2sat(S = 0, t = 20) # fresh water, Weiss formula gas_O2sat(S = 0, t = 20, method = "APHA") # fresh water, APHA formula ## compare this with gas_satconc(S = 0, t = 20, species = "O2") * molweight("O2") / 1000 T <- seq(0, 30, 0.1) plot(T, gas_O2sat(S = 0, t = T, method = "APHA"), ylab="O2 sat (mg/L)", type = "l", ylim = c(0, 15)) lines(T, gas_O2sat(S = 0, t = T, method = "Weiss"), col = "blue", lwd = 2, lty = "dashed") lines(T, gas_O2sat(S = 5, t = T, method = "Weiss"), col = "green") lines(T, gas_O2sat(S = 10, t = T, method = "Weiss"), col = "yellow") lines(T, gas_O2sat(S = 20, t = T, method = "Weiss"), col = "orange") lines(T, gas_O2sat(S = 35, t = T, method = "Weiss"), col = "red") legend("bottomleft", col = c("black", "white", "blue", "green", "yellow", "orange", "red"), lty = c(1, 0, 2, 1, 1, 1, 1), lwd = c(1,0 ,2, 1, 1, 1, 1), legend=c("freshwater formula", "marine formula:", "S = 0", "S = 5", "S = 10", "S = 20", "S = 35"))
gas_O2sat(S = 0, t = 20) # fresh water, Weiss formula gas_O2sat(S = 0, t = 20, method = "APHA") # fresh water, APHA formula ## compare this with gas_satconc(S = 0, t = 20, species = "O2") * molweight("O2") / 1000 T <- seq(0, 30, 0.1) plot(T, gas_O2sat(S = 0, t = T, method = "APHA"), ylab="O2 sat (mg/L)", type = "l", ylim = c(0, 15)) lines(T, gas_O2sat(S = 0, t = T, method = "Weiss"), col = "blue", lwd = 2, lty = "dashed") lines(T, gas_O2sat(S = 5, t = T, method = "Weiss"), col = "green") lines(T, gas_O2sat(S = 10, t = T, method = "Weiss"), col = "yellow") lines(T, gas_O2sat(S = 20, t = T, method = "Weiss"), col = "orange") lines(T, gas_O2sat(S = 35, t = T, method = "Weiss"), col = "red") legend("bottomleft", col = c("black", "white", "blue", "green", "yellow", "orange", "red"), lty = c(1, 0, 2, 1, 1, 1, 1), lwd = c(1,0 ,2, 1, 1, 1, 1), legend=c("freshwater formula", "marine formula:", "S = 0", "S = 5", "S = 10", "S = 20", "S = 35"))
Calculates the saturated concentration of several gases in water for a given temperature, salinity and pressure.
gas_satconc(S = 35, t = 25, P = 1.013253, species =c("He","Ne","N2","O2","Ar","Kr","CH4","CO2","N2O"), atm = atmComp(species))
gas_satconc(S = 35, t = 25, P = 1.013253, species =c("He","Ne","N2","O2","Ar","Kr","CH4","CO2","N2O"), atm = atmComp(species))
S |
Salinity (dimensionless), |
t |
Temperature, |
P |
True pressure, bar |
species |
character vector with gasses whose saturated concentration should be estimated. |
atm |
The number of moles of the gas per unit mole of air in the
atmosphere, the "mixing ratio". When present, this overrules the
|
The saturated concentration of the gas in .
Compared to the table in Sarmiento and Gruber, there is a slight deviation for N2O, and He.
CO2 is OK for temperature 0 only.
Karline Soetaert <[email protected]>
Sarmiento JL and Gruber N, 2006. Ocean Biogeochemical Dynamics. Princeton University Press, Princeton. p 85.
who cite:
for He and Ne: Weiss R, 1971. Solubility of helium and neon in water and seawater. Journ. Chem. Eng. Data 16, 235-241.
N2, O2 and Ar: Weiss R, 1970. The solubility of nitrogen, oxygen, and argon in water and seawater. Deep-Sea Res. 17, 721-35.
Kr: Weiss R and Kyser TK, 1978. Solubility of Krypton in water and seawater. Journ. Chem. Eng. Data 23, 69-72.
Rn: Hackbusch 1979. Eine Methode zur Bestimmung der Diffusions-, L?slichkeits un Permeabilitats Konstanten von Radon-222 in Wasser und Meereswasser. Dissertation, University of Heidelberg, Germany.
CH4: Wiesenburg DA and Guinasso JNL, 1979. Equilibrium solubilities of methane, carbon monoxide and hydrogen in water and sea water. Journ. Chem. Eng. Data 24, 256-360.
CO2 and N2O: Weiss R and Price BA, 1980. Nitrous oxide solubility in wate and sewater. Mar. Chem. 8, 347-359.
CFC-11 and CFC-12: Warner MJ and Weiss R, 1985. Solubilities of chlorofluorocarbons 11 and 12 in water and sewater. Deep-Sea Res. 32, 1485-1497.
SF6: Bullister et al., 2002. The solubility of sulfur hexafluroide in water and sewater. Deep-Sea Res. I, 49, 175-188.
CCl4: Bullister JL and Wisegarver DP, 1998. The solubility of carbon tetrachloride in water and seawater. Deep-Sea Res. I, 1285-1302.
gas_O2sat
,
gas_schmidt
,gas_solubility
,gas_transfer
,
atmComp
, vapor
gas_satconc(species = "O2") Temp <- seq(from = 0, to = 30, by = 0.1) Sal <- seq(from = 0, to = 35, by = 0.1) mf <- par(mfrow = c(1,2)) species <- c("N2", "CO2", "O2", "CH4", "N2O") gsat <- gas_satconc(t = Temp, species = species) matplot(Temp, gsat, type = "l", xlab = "temperature", log = "y", lty = 1, ylab = "mmol/m3", main = "Saturated conc (S=35)", lwd = 2) legend("right", col = 1:5, lwd = 2, legend = species) gsat <- gas_satconc(S = Sal, species = species) matplot(Sal, gsat, type = "l", xlab = "salinity", log = "y", lty = 1, ylab = "mmol/m3", main = "Saturated conc (T=20)", lwd = 2) legend("right", col = 1:5, lwd = 2, legend = species) par(mfrow = mf) ## generate table 3.2.4 from Sarmiento and Gruber Temp <- seq (0, 30, by = 5) ## saturated concentrations in mmol/m3, at 1 atm. A <- data.frame(cbind( t = Temp, N2 = gas_satconc(t = Temp, species = "N2"), O2 = gas_satconc(t = Temp, species = "O2"), CO2 = gas_satconc(t = Temp, species = "CO2"), Ar = gas_satconc(t = Temp, species = "Ar"))) format(A, digits = 4) ## table values ## at 0 dg C: 635.6 359.1 23.37 17.44 ## at 20 dg C: 425.7 230.5 11.61 11.29 ## note the deviations for CO2 (20dg)! ## saturated concentrations in micromol/m3, at 1 atm. AA <- data.frame(cbind(t = Temp, N2O = gas_satconc(t = Temp, species = "N2O")*1000, Ne = gas_satconc(t = Temp, species = "Ne" )*1000, Kr = gas_satconc(t = Temp, species = "Kr" )*1000, CH4 = gas_satconc(t = Temp, species = "CH4")*1000, He = gas_satconc(t = Temp, species = "He" )*1000)) format(AA, digits = 4) ## table values ## at 0 dgC: 14.84 8.11 4.33 3.44 1.81 ## at 20 dgC: 7.16 6.94 2.50 2.12 1.70 ## Note: different for N2O
gas_satconc(species = "O2") Temp <- seq(from = 0, to = 30, by = 0.1) Sal <- seq(from = 0, to = 35, by = 0.1) mf <- par(mfrow = c(1,2)) species <- c("N2", "CO2", "O2", "CH4", "N2O") gsat <- gas_satconc(t = Temp, species = species) matplot(Temp, gsat, type = "l", xlab = "temperature", log = "y", lty = 1, ylab = "mmol/m3", main = "Saturated conc (S=35)", lwd = 2) legend("right", col = 1:5, lwd = 2, legend = species) gsat <- gas_satconc(S = Sal, species = species) matplot(Sal, gsat, type = "l", xlab = "salinity", log = "y", lty = 1, ylab = "mmol/m3", main = "Saturated conc (T=20)", lwd = 2) legend("right", col = 1:5, lwd = 2, legend = species) par(mfrow = mf) ## generate table 3.2.4 from Sarmiento and Gruber Temp <- seq (0, 30, by = 5) ## saturated concentrations in mmol/m3, at 1 atm. A <- data.frame(cbind( t = Temp, N2 = gas_satconc(t = Temp, species = "N2"), O2 = gas_satconc(t = Temp, species = "O2"), CO2 = gas_satconc(t = Temp, species = "CO2"), Ar = gas_satconc(t = Temp, species = "Ar"))) format(A, digits = 4) ## table values ## at 0 dg C: 635.6 359.1 23.37 17.44 ## at 20 dg C: 425.7 230.5 11.61 11.29 ## note the deviations for CO2 (20dg)! ## saturated concentrations in micromol/m3, at 1 atm. AA <- data.frame(cbind(t = Temp, N2O = gas_satconc(t = Temp, species = "N2O")*1000, Ne = gas_satconc(t = Temp, species = "Ne" )*1000, Kr = gas_satconc(t = Temp, species = "Kr" )*1000, CH4 = gas_satconc(t = Temp, species = "CH4")*1000, He = gas_satconc(t = Temp, species = "He" )*1000)) format(AA, digits = 4) ## table values ## at 0 dgC: 14.84 8.11 4.33 3.44 1.81 ## at 20 dgC: 7.16 6.94 2.50 2.12 1.70 ## Note: different for N2O
The Schmidt number as a function of temperature (0-30dgC) and for a salinity of 35.
where v is the kinematic viscosity of the water and D is the mass diffusivity, rho is density and mu is the viscosity.
Schmidt numbers are used to estimate the gas transfer velocity.
gas_schmidt(t = 25, species = c("He", "Ne", "N2", "O2", "Ar", "Kr", "Rn", "CH4","CO2", "N2O", "CCl2F2", "CCL3F", "SF6", "CCl4"))
gas_schmidt(t = 25, species = c("He", "Ne", "N2", "O2", "Ar", "Kr", "Rn", "CH4","CO2", "N2O", "CCl2F2", "CCL3F", "SF6", "CCl4"))
t |
Temperature in |
species |
character vector with gasses whose schmidt number should be estimated. |
The Schmidt number, a dimensionless quantity.
Karline Soetaert <[email protected]>
Sarmiento JL and Gruber N, 2006. Ocean Biogeochemical Dynamics. Princeton University Press, Princeton. p 85.
who cite:
Wanninkhof R, 1992. Relationship between wind speed and gas exchange over the ocean. Journ. Geophys. Res. 97, 7373-7383.
except for :
Keeling et al., 1998. Seasonal variation in the atmospheric O2/N2 ratio in relation to the kinetics of air-sea gas exchange. Global Biogeochemical Cycles 12, 141-164.
CFC-11 (), and CFC-12 (
):
Zheng et al., 1998. Measurements of the diffusion coefficients of CF-11 and CF-12 in pure water and seawater. Journ. Geophys. Res. 103, 1375-1379.
and (Wanninkhof, pers.comm).
gas_O2sat
, gas_satconc
,
gas_solubility
, gas_transfer
,
atmComp
, vapor
gas_schmidt(species = "CO2", t = 20) # about660
gas_schmidt(species = "CO2", t = 20) # about660
Solubility parameters SA, ,
calculated from the Bunsen solubility coefficients and the volumetric
solubility coefficients.
gas_solubility(S = 35, t = 25, species = c("He", "Ne", "N2", "O2", "Ar", "Kr", "Rn", "CH4", "CO2", "N2O", "CCl2F2", "CCl3F", "SF6", "CCl4"))
gas_solubility(S = 35, t = 25, species = c("He", "Ne", "N2", "O2", "Ar", "Kr", "Rn", "CH4", "CO2", "N2O", "CCl2F2", "CCl3F", "SF6", "CCl4"))
S |
salinity, - |
t |
temperature, |
species |
The gas |
The solubility, mmol/m3/bar.
The molar volume used for the Bensen coefficient conversion is the ideal gas value of 22.4136 l/mol.
These coefficients are to be used with pAmoist, the partial pressure of the gas in moist air.
To convert them for use with partial pressure in dry air, divide by (1-vapor(S,t)).
Karline Soetaert <[email protected]>
Sarmiento JL and Gruber N, 2006. Ocean Biogeochemical Dynamics. Princeton University Press, Princeton. p 85.
who cite:
for He and Ne: Weiss R, 1971. Solubility of helium and neon in water and seawater. Journ. Chem. Eng. Data 16, 235-241.
N2, O2 and Ar: Weiss R, 1970. The solubility of nitrogen, oxygen, and argon in water and seawater. Deep-Sea Res. 17, 721-35.
Kr: Weiss R and Kyser TK, 1978. Silubility of Krypton in water and seawater. Journ. Chem. Eng. Data 23, 69-72.
Rn: Hackbusch 1979. Eine Methode zur Bestimmung der Diffusions, Loeslichkeits un Permeabilitats Konstanten von Radon-222 in Wasser und Meereswasser. Dissertation, University of Heidelberg, Germany.
CH4: Wiesenburg DA and Guinasso JNL, 1979. Equilibrium solubilities of methane, carbon monoxide and hydrogen in water and sea water. Journ. Chem. Eng. Data 24, 256-360.
CO2 and N2O: Weiss R and Price BA, 1980. Nitrous oxide solubility in wate and sewater. Mar. Chem. 8, 347-359.
CFC-11 and CFC-12: Warner MJ and Weiss R, 1985. Solubilities of chlorofluorocarbons 11 and 12 in water and sewater. Deep-Sea Res. 32, 1485-1497.
SF6: Bullister et al., 2002. The solubility of sulfur hexafluroide in water and sewater. Deep-Sea Res. I, 49, 175-188.
CCl4: Bullister JL and Wisegarver DP, 1998. The solubility of carbon tetrachloride in water and seawater. Deep-Sea Res. I, 1285-1302.
gas_O2sat
, gas_satconc
,
gas_schmidt
, gas_transfer
,
atmComp
, vapor
gas_solubility(t = 1:20,S = 35, species = "CO2") gas_solubility(t = 0:5,S = 35,species = "O2") Temp <- seq(from = 0, to = 30, by = 0.1) mf <- par(mfrow = c(1, 2)) gs <- gas_solubility(t = Temp) species <- c("CCl4", "CO2", "N2O", "Rn", "CCl2F2") matplot(Temp, gs[, species], type = "l", lty = 1, lwd = 2, xlab = "temperature", ylab = "mmol/m3", main = "solubility (S=35)") legend("topright", col = 1:5, lwd = 2, legend = species) species2 <- c("Kr", "CH4", "Ar", "O2", "N2", "Ne") matplot(Temp, gs[, species2], type = "l", lty = 1, lwd = 2, xlab = "temperature", ylab = "mmol/m3", main = "solubility (S=35)") legend("topright", col = 1:6, lwd = 2, legend = species2) plot(Temp,gas_solubility(t = Temp, species = "CCl4"), xlab = "temperature", ylab = "mmol/m3/atm", main = "solubility (S=35)", type = "l", lwd = 2, ylim = c(0, 100000)) lines(Temp,gas_solubility(t = Temp, species = "CO2"), col = "red", lwd = 2) lines(Temp,gas_solubility(t = Temp, species = "N2O"), col = "blue", lwd = 2) lines(Temp,gas_solubility(t = Temp, species = "Rn"), col = "green", lwd = 2) lines(Temp,gas_solubility(t = Temp, species = "CCl2F2"), col = "yellow", lwd = 2) legend("topright", col = c("black", "red", "blue", "green", "yellow"), lwd = 2, legend = c("CCl4", "CO2", "N2O", "Rn", "CCl2F2")) plot(Temp, gas_solubility(t = Temp, species = "Kr"), xlab = "temperature", ylab = "mmol/m3/atm", main = "solubility (S=35)", type = "l", lwd = 2, ylim = c(0, 4000)) lines(Temp, gas_solubility(t = Temp, species = "CH4"), col = "red", lwd = 2) lines(Temp, gas_solubility(t = Temp, species = "Ar"), col = "blue", lwd = 2) lines(Temp, gas_solubility(t = Temp, species = "O2"), col = "green", lwd = 2) lines(Temp, gas_solubility(t = Temp, species = "N2"), col = "yellow", lwd = 2) lines(Temp, gas_solubility(t = Temp, species = "Ne"), col = "grey", lwd = 2) legend("topright",col = c("black", "red", "blue", "green", "yellow", "grey"), lwd = 2, legend = c("Kr", "CH4", "Ar", "O2", "N2", "Ne")) par(mfrow = mf) ## generate table 3.2.3 from Sarmiento and Gruber Temp <- seq (0,30,by = 5) ## saturated concentrations in mmol/m3 at at 1 atm; # convert from /bar to /atm using 1.013253 A <- data.frame(cbind( t = Temp, He = gas_solubility(t = Temp,species = "He")*1.013253, Ne = gas_solubility(t = Temp,species = "Ne")*1.013253, N2 = gas_solubility(t = Temp,species = "N2")*1.013253, O2 = gas_solubility(t = Temp,species = "O2")*1.013253, Ar = gas_solubility(t = Temp,species = "Ar")*1.013253, Kr = gas_solubility(t = Temp,species = "Kr")*1.013253, Rn = gas_solubility(t = Temp,species = "Rn")*1.013253) ) format(A,digits = 4) ## table values at ## 0 dgC: 349.4 448.6 818.8 1725 1879 3820 31150 ## 20 dg C: 332.9 390.7 557.9 1126 1236 2241 14130 ## note the (very) slight deviations for Rn ## saturated concentrations in micromol/m3 at 1 atm AA <- data.frame(cbind( t = Temp, CH4 = gas_solubility(t = Temp,species = "CH4") *1.013253, CO2 = gas_solubility(t = Temp,species = "CO2") *1.013253, N2O = gas_solubility(t = Temp,species = "N2O") *1.013253, CCL2F2 = gas_solubility(t = Temp,species = "CCl2F2")*1.013253, CCL3F = gas_solubility(t = Temp,species = "CCl3F") *1.013253, SF6 = gas_solubility(t = Temp,species = "SF6") *1.013253, CCl4 = gas_solubility(t = Temp,species = "CCl4") *1.013253)) format(AA,digits = 4) ## Table values at ## 0 dgC: 1984 64400 47840 6686 27380 425.2 97114 ## 20 dgC: 1241 33110 23870 2566 9242 195.8 30307 ## Note: there are slight deviations for CO2, and N2O!
gas_solubility(t = 1:20,S = 35, species = "CO2") gas_solubility(t = 0:5,S = 35,species = "O2") Temp <- seq(from = 0, to = 30, by = 0.1) mf <- par(mfrow = c(1, 2)) gs <- gas_solubility(t = Temp) species <- c("CCl4", "CO2", "N2O", "Rn", "CCl2F2") matplot(Temp, gs[, species], type = "l", lty = 1, lwd = 2, xlab = "temperature", ylab = "mmol/m3", main = "solubility (S=35)") legend("topright", col = 1:5, lwd = 2, legend = species) species2 <- c("Kr", "CH4", "Ar", "O2", "N2", "Ne") matplot(Temp, gs[, species2], type = "l", lty = 1, lwd = 2, xlab = "temperature", ylab = "mmol/m3", main = "solubility (S=35)") legend("topright", col = 1:6, lwd = 2, legend = species2) plot(Temp,gas_solubility(t = Temp, species = "CCl4"), xlab = "temperature", ylab = "mmol/m3/atm", main = "solubility (S=35)", type = "l", lwd = 2, ylim = c(0, 100000)) lines(Temp,gas_solubility(t = Temp, species = "CO2"), col = "red", lwd = 2) lines(Temp,gas_solubility(t = Temp, species = "N2O"), col = "blue", lwd = 2) lines(Temp,gas_solubility(t = Temp, species = "Rn"), col = "green", lwd = 2) lines(Temp,gas_solubility(t = Temp, species = "CCl2F2"), col = "yellow", lwd = 2) legend("topright", col = c("black", "red", "blue", "green", "yellow"), lwd = 2, legend = c("CCl4", "CO2", "N2O", "Rn", "CCl2F2")) plot(Temp, gas_solubility(t = Temp, species = "Kr"), xlab = "temperature", ylab = "mmol/m3/atm", main = "solubility (S=35)", type = "l", lwd = 2, ylim = c(0, 4000)) lines(Temp, gas_solubility(t = Temp, species = "CH4"), col = "red", lwd = 2) lines(Temp, gas_solubility(t = Temp, species = "Ar"), col = "blue", lwd = 2) lines(Temp, gas_solubility(t = Temp, species = "O2"), col = "green", lwd = 2) lines(Temp, gas_solubility(t = Temp, species = "N2"), col = "yellow", lwd = 2) lines(Temp, gas_solubility(t = Temp, species = "Ne"), col = "grey", lwd = 2) legend("topright",col = c("black", "red", "blue", "green", "yellow", "grey"), lwd = 2, legend = c("Kr", "CH4", "Ar", "O2", "N2", "Ne")) par(mfrow = mf) ## generate table 3.2.3 from Sarmiento and Gruber Temp <- seq (0,30,by = 5) ## saturated concentrations in mmol/m3 at at 1 atm; # convert from /bar to /atm using 1.013253 A <- data.frame(cbind( t = Temp, He = gas_solubility(t = Temp,species = "He")*1.013253, Ne = gas_solubility(t = Temp,species = "Ne")*1.013253, N2 = gas_solubility(t = Temp,species = "N2")*1.013253, O2 = gas_solubility(t = Temp,species = "O2")*1.013253, Ar = gas_solubility(t = Temp,species = "Ar")*1.013253, Kr = gas_solubility(t = Temp,species = "Kr")*1.013253, Rn = gas_solubility(t = Temp,species = "Rn")*1.013253) ) format(A,digits = 4) ## table values at ## 0 dgC: 349.4 448.6 818.8 1725 1879 3820 31150 ## 20 dg C: 332.9 390.7 557.9 1126 1236 2241 14130 ## note the (very) slight deviations for Rn ## saturated concentrations in micromol/m3 at 1 atm AA <- data.frame(cbind( t = Temp, CH4 = gas_solubility(t = Temp,species = "CH4") *1.013253, CO2 = gas_solubility(t = Temp,species = "CO2") *1.013253, N2O = gas_solubility(t = Temp,species = "N2O") *1.013253, CCL2F2 = gas_solubility(t = Temp,species = "CCl2F2")*1.013253, CCL3F = gas_solubility(t = Temp,species = "CCl3F") *1.013253, SF6 = gas_solubility(t = Temp,species = "SF6") *1.013253, CCl4 = gas_solubility(t = Temp,species = "CCl4") *1.013253)) format(AA,digits = 4) ## Table values at ## 0 dgC: 1984 64400 47840 6686 27380 425.2 97114 ## 20 dgC: 1241 33110 23870 2566 9242 195.8 30307 ## Note: there are slight deviations for CO2, and N2O!
The gas transfer coefficient, in , for certain
gases in seawater (S = 35).
gas_transfer(t = 25, u10 = 1, species = c("He", "Ne", "N2", "O2", "Ar", "Kr", "Rn", "CH4","CO2", "N2O", "CCl2F2", "CCL3F", "SF6", "CCl4"), method = c("Liss", "Nightingale", "Wanninkhof1", "Wanninkhof2"), Schmidt = gas_schmidt(t = t, species = species))
gas_transfer(t = 25, u10 = 1, species = c("He", "Ne", "N2", "O2", "Ar", "Kr", "Rn", "CH4","CO2", "N2O", "CCl2F2", "CCL3F", "SF6", "CCl4"), method = c("Liss", "Nightingale", "Wanninkhof1", "Wanninkhof2"), Schmidt = gas_schmidt(t = t, species = species))
t |
Temperature in |
u10 |
wind speed, in m/sec at a nominal height of 10 m above sea level, |
species |
character vector with gasses whose gas transfer coefficient should be estimated. |
method |
one of "Liss", for Liss and Merlivat, 1986; "Nightingale", for Nightingale et al., 2000; "Wanninkhof1", for Wanninkhof 1992, or "Wanninkhof2" for Wanninkhof and McGills 1999. |
Schmidt |
the Schmidt number, when given this overrules the
arguments |
The gas transfer velocity, for seawater, in .
Karline Soetaert <[email protected]>
Sarmiento JL and Gruber N, 2006. Ocean Biogeochemical Dynamics. Princeton University Press, Princeton. p 85.
Liss PS and Merlivat L, 1986. Air-sea gas exchange rates: introduction and synthesis. In: the role of air-sea exchange in Geochemical cycling, edited by P. Buat-Menard, pp 113-127. D. Reidel, Dordrecht, the Netherlands.
Nightingale et al., 2000. In situ evaluation of air-sea gas exchange prameterizations using novel conservative and volatile tracers. Global biogeochemical cycles 14, 373-387.
Wanninkhof R, 1992. Relationship between wind speed and gas exchange over the ocean. Journ. Geophys. Res. 97, 7373-7383.
Wanninkhof R and McGillis W, 1999. A cubic relationshp between air-sea CO2 exchange and wind speed. Geophys. Res. Lett. 26, 1889-1892.
gas_O2sat
,gas_satconc
,
gas_schmidt
,gas_solubility
,
atmComp
, vapor
useq <- 0:15 plot(useq, gas_transfer(u10 = useq, species = "O2"), type = "l", lwd = 2, xlab = "u10, m/s", ylab = "m/s", main = "O2 gas transfer velocity", , ylim = c(0, 0.0003)) lines(useq, gas_transfer(u10 = useq, species = "O2", method = "Nightingale"), lwd = 2, lty = 2) lines(useq, gas_transfer(u10 = useq, species = "O2", method = "Wanninkhof1"), lwd = 2, lty = 3) lines(useq, gas_transfer(u10 = useq, species = "O2", method = "Wanninkhof2"), lwd = 2, lty = 4) legend("topleft", lty = 1:4, lwd = 2, legend = c("Liss and Merlivat 1986", "Nightingale et al. 2000", "Wanninkhof 1992", "Wanninkhof and McGills 1999"))
useq <- 0:15 plot(useq, gas_transfer(u10 = useq, species = "O2"), type = "l", lwd = 2, xlab = "u10, m/s", ylab = "m/s", main = "O2 gas transfer velocity", , ylim = c(0, 0.0003)) lines(useq, gas_transfer(u10 = useq, species = "O2", method = "Nightingale"), lwd = 2, lty = 2) lines(useq, gas_transfer(u10 = useq, species = "O2", method = "Wanninkhof1"), lwd = 2, lty = 3) lines(useq, gas_transfer(u10 = useq, species = "O2", method = "Wanninkhof2"), lwd = 2, lty = 4) legend("topleft", lty = 1:4, lwd = 2, legend = c("Liss and Merlivat 1986", "Nightingale et al. 2000", "Wanninkhof 1992", "Wanninkhof and McGills 1999"))
Computes the gravity, based on latitude.
gravity(lat = 0, method = c("Moritz", "UNESCO"))
gravity(lat = 0, method = c("Moritz", "UNESCO"))
lat |
latitude (-90 - +90). |
method |
When "UNESCO", uses the UNESCO (1983) polynomial, else according to Moritz, 2000 |
Gravity, in .
Karline Soetaert <[email protected]>
The UNESCO polynomial:
Fofonoff NP and Millard RC Jr, 1983. Algorithms for computation of
fundamental properties of seawater. UNESCO technical papers in marine
science, 44, 53 pp.
http://unesdoc.unesco.org/images/0005/000598/059832EB.pdf
Moritz H, 2000. Geodetic reference system 1980. Journal of Geodesy 74, 128-133.
coriolis
, viscosity
,
diffcoeff
, ssd2rad
, vertmean
gravity(lat = 30)
gravity(lat = 30)
Converts from liter to moles for a gas.
molvol(t = 25, P = 1.013253, species = c("ideal", "Ar", "CO2", "CS2", "CO", "CCl4", "Cl2", "C2H6S", "C2H5OH", "C6H5F", "CH3F", "CH4", "CH3OH", "C5H12", "C3H8", "H2O", "He", "H2", "HBr", "HCl", "H2S", "Hg", "Kr", "NH3", "Ne", "NO", "N2", "NO2", "N2O", "O2", "PH3", "SiH4", "SiF4", "SO2", "Xe"), quantity = 1, a = 0, b = 0)
molvol(t = 25, P = 1.013253, species = c("ideal", "Ar", "CO2", "CS2", "CO", "CCl4", "Cl2", "C2H6S", "C2H5OH", "C6H5F", "CH3F", "CH4", "CH3OH", "C5H12", "C3H8", "H2O", "He", "H2", "HBr", "HCl", "H2S", "Hg", "Kr", "NH3", "Ne", "NO", "N2", "NO2", "N2O", "O2", "PH3", "SiH4", "SiF4", "SO2", "Xe"), quantity = 1, a = 0, b = 0)
t |
temperature, |
P |
True pressure, bar. |
species |
character vector with gasses whose molecular volume
should be estimated. if |
quantity |
mol of the gas. |
a |
Van der Waals constant a, a species-specific coefficient,
|
b |
Van der Waals constant b, a species-specific coefficient,
|
volume of the gas, liter
The coefficients a and b are species-specific; values of 0 assume an ideal gas and in general give good estimates.
Use 1/molvol
to convert from liter to moles.
The default calculates the molar volume of an ideal gas
Karline Soetaert <[email protected]>
The values of the van der Waals constants are from:
Weast RC (Ed.) 1972. Handbook of Chemistry and Physics (53rd Edn.), Cleveland:Chemical Rubber Co.
as found in: https://en.wikipedia.org/wiki/Van_der_Waals_constants_(data_page)
AtomicWeight
, molweight
,
redfield
#molecular volume of an ideal gas. molvol(species = "ideal", P = 1, t = 0) # 22.710 980 molvol(species = "ideal", P = 1, t = 25) # 24.789 598 plot(0:30, molvol(t = 0:30, species = NULL), xlab = "Temperature, dgC", ylab = "Molar volume") # molvol(a = 1.382, b = 0.03186, species = NULL, t = 0) molvol(t = 0, species = "O2") # the same but for all gasses molvol(t = 0) # table for different pressures molvol(P = 1:5, species = "O2") # the inverse function 1/molvol(species = "O2") # contour plot P <- seq(1, 100, by = 1) Temp <- seq(-5, 40, by = 1) Val <- outer(X = P, Y = Temp, FUN = function(X, Y) molvol(P = X, t = Y, species = "O2")) contour(P, Temp, Val, xlab = "pressure", ylab = "temperature", main = "molvol", nlevel = 20, log = "x", axes = FALSE) axis(1); axis(2); box()
#molecular volume of an ideal gas. molvol(species = "ideal", P = 1, t = 0) # 22.710 980 molvol(species = "ideal", P = 1, t = 25) # 24.789 598 plot(0:30, molvol(t = 0:30, species = NULL), xlab = "Temperature, dgC", ylab = "Molar volume") # molvol(a = 1.382, b = 0.03186, species = NULL, t = 0) molvol(t = 0, species = "O2") # the same but for all gasses molvol(t = 0) # table for different pressures molvol(P = 1:5, species = "O2") # the inverse function 1/molvol(species = "O2") # contour plot P <- seq(1, 100, by = 1) Temp <- seq(-5, 40, by = 1) Val <- outer(X = P, Y = Temp, FUN = function(X, Y) molvol(P = X, t = Y, species = "O2")) contour(P, Temp, Val, xlab = "pressure", ylab = "temperature", main = "molvol", nlevel = 20, log = "x", axes = FALSE) axis(1); axis(2); box()
Calculates the molecular weight of chemical species.
molweight(species)
molweight(species)
species |
character vector with chemical species whose molecular weight is requested. |
Molecular weights of chemical elements may vary due to different isotope compositions, depending on geology, industrial processes or biological activity. Please consult the IUPAC Technical report about the details. The function returns NA for elements (and their compounds) which have no stable isotopes (except U, Th, Pa).
Vector with the molecular weights in g/mol.
This function uses text parsing of chemical formulae, it is strictly case sensitive.
Thomas Petzoldt
Wieser ME, 2006. Atomic weights of the elements 2005 (IUPAC Technical Report). Pure Appl. Chem. 78(11), 2051–2066. doi:10.1351/pac200678112051
AtomicWeight
, molvol
,
redfield
molweight("CO2") molweight("HCO3") molweight("H") molweight("H3PO4") ## eicosapentaenoic acid (EPA) molweight("CH3CH2CHCHCH2CHCHCH2CHCHCH2CHCHCH2CHCH(CH2)3COOH") molweight("C20H30O2") ## works also with vectors molweight(c("C2H5OH", "CO2", "H2O")) molweight(c("SiOH4", "NaHCO3", "C6H12O6", "Ca(HCO3)2", "Pb(NO3)2", "(NH4)2SO4")) ## note that chemical formulae are case-sensitive molweight("Co") # cobalt molweight("CO") # carbon monoxide ## from gram to mol 1/molweight("CO3")
molweight("CO2") molweight("HCO3") molweight("H") molweight("H3PO4") ## eicosapentaenoic acid (EPA) molweight("CH3CH2CHCHCH2CHCHCH2CHCHCH2CHCHCH2CHCH(CH2)3COOH") molweight("C20H30O2") ## works also with vectors molweight(c("C2H5OH", "CO2", "H2O")) molweight(c("SiOH4", "NaHCO3", "C6H12O6", "Ca(HCO3)2", "Pb(NO3)2", "(NH4)2SO4")) ## note that chemical formulae are case-sensitive molweight("Co") # cobalt molweight("CO") # carbon monoxide ## from gram to mol 1/molweight("CO3")
Surface area and volume of the world's oceans
Oceans
Oceans
A list specifying the value, units, and a description of each quantity.
Karline Soetaert <[email protected]>
Sarmiento JL and Gruber N, 2006. Ocean Biogeochemical Dynamics. Princeton University Press, Princeton. p 85.
AtomicWeight
, Bathymetry
,
Constants
, earth_surf
data.frame(cbind(acronym = names(Oceans), matrix(ncol = 3, byrow = TRUE, data = unlist(Oceans), dimnames = list(NULL, c("value", "units", "description")))))
data.frame(cbind(acronym = names(Oceans), matrix(ncol = 3, byrow = TRUE, data = unlist(Oceans), dimnames = list(NULL, c("value", "units", "description")))))
Estimate elemental composition of biomass (or media) according to the Redfield ratio.
redfield(q, species, method = c("mol", "mass"), ratio = c(C=106, H=263, O=110, N=16, P=1))
redfield(q, species, method = c("mol", "mass"), ratio = c(C=106, H=263, O=110, N=16, P=1))
q |
amount of substance of that element (in mol or mass units), |
species |
The element that is given ("C", "H", "O", "N", "P"), |
method |
measurement unit ("mol" or "mass"), |
ratio |
average elemental composition. |
The average elemental composition of marine plankton (Redfield ratio)
is traditionally assumed to be
(Redfield 1934, 1963, Richards 1965). Note that while the C:N:P ratio
is widely agreed there is still discussion about the average of O and
H, e.g.
(Stumm, 1964).
Note also that there are, of course, large differences depending on species and physiological state.
A data frame with the estimated ratio of the main elements.
Redfield AC, 1934. On the proportions of organic derivations in sea water and their relation to the composition of plankton. In: James Johnstone Memorial Volume. (ed. R.J. Daniel). University Press of Liverpool, 177-192.
Redfield, AC, Ketchum, BH and Richards FA, 1963. The influence of organisms on the composition of seawater. In: Hill, MN, Editor, The Sea vol. 2, Interscience, New York (1963), pp.26-77.
Richards FA, 1965. Anoxic basins and fjords. In: Riley JP, Skirrow D. (Eds.), Chemical Oceanography, vol. 1. Academic Press, New York, 611-645. (cited in Hedges et al, 2002).
Stumm W, 1964. Discussion (Methods for the removal of phosphorus and nitrogen from sewage plant effluents by G. A. Rohlich). In Eckenfelder, WW (ed.), Advances in water pollution research. Proc. 1st Int. Conf. London 1962, volume 2, pp. 216-229. Pergamon.
Vollenweider RA, 1985. Elemental and biochemical composition of plankton biomass: some comments and explorations. Arch. Hydrobiol. 105, 11-29.
Anderson LA, 1995. On the hydrogen and oxygen content of marine plankton. Deep-Sea Res. 42, 1675-1680.
Hedges JI., Baldock JA, Gelinas Y, Lee C, Peterson ML and Wakeham SG, 2002. The biochemical and elemental compositions of marine plankton: A NMR perspective. Marine Chemistry 78, 47-63.
AtomicWeight
, molvol
, molweight
## Redfield ratio redfield(1, "P") ## returns the molar Redfield ratio, rescaled to nitrogen redfield(1, "N") ## how many mass units are related to 2 mass units (e.g. mg) P redfield(2, "P", "mass") redfield(c(1, 2, 3), "N", "mass") ## mass percentage of elements x <- redfield(1, "P", "mass") x / sum(x) ## with alternative elemental composition (Stumm, 1964) x <- redfield(1, "P", "mass", ratio = c(C = 106, H = 180, O = 45, N = 16, P = 1)) x / sum(x) ## rule of thumb for fresh mass (in mg) formed by 1 microgram P redfield(1, "P", "mass")$C * 2 * 10 / 1000 sum(redfield(1, "P", "mass", ratio = c(C = 106, H = 180, O = 45, N = 16, P = 1))) * 10 / 1000
## Redfield ratio redfield(1, "P") ## returns the molar Redfield ratio, rescaled to nitrogen redfield(1, "N") ## how many mass units are related to 2 mass units (e.g. mg) P redfield(2, "P", "mass") redfield(c(1, 2, 3), "N", "mass") ## mass percentage of elements x <- redfield(1, "P", "mass") x / sum(x) ## with alternative elemental composition (Stumm, 1964) x <- redfield(1, "P", "mass", ratio = c(C = 106, H = 180, O = 45, N = 16, P = 1)) x / sum(x) ## rule of thumb for fresh mass (in mg) formed by 1 microgram P redfield(1, "P", "mass")$C * 2 * 10 / 1000 sum(redfield(1, "P", "mass", ratio = c(C = 106, H = 180, O = 45, N = 16, P = 1))) * 10 / 1000
The function converts values of sunshine duration (in hours) to global
radiation (in ).
ssd2rad(S, doy, a = 0.25, b = 0.5, rho = 50.29)
ssd2rad(S, doy, a = 0.25, b = 0.5, rho = 50.29)
S |
Sunshine duration (hours) |
doy |
Julian day (for northern hemisphere only) |
a , b , rho
|
site specific conversion parameters, must be fitted to measured data. |
Estimated value of global radiaton in .
Don't forget to fit the function parameters to site specific values!
Dyck S and Peschke G., 1995. Grundlagen der Hydrologie. 3. Auflage. Verlag f?r Bauwesen, Berlin 1995, ISBN 3-345-00586-7.
coriolis
, viscosity
,
diffcoeff
, vertmean
,
gravity
ssd2rad(8, 120)
ssd2rad(8, 120)
Computes the adiabatic temperature gradient in seawater,
using the UNESCO 1983 polynomial.
Also known as the adiabatic lapse rate, the change of temperature per unit pressure for an adiabatic change of pressure of an element of seawater. It is assumed that no heat or salt is exchanged with the surroundings.
sw_adtgrad(S = 35, t = 25, p = P-1.013253, P = 1.013253 )
sw_adtgrad(S = 35, t = 25, p = P-1.013253, P = 1.013253 )
S |
Practical salinity (-), |
t |
Temperature, |
p |
gauge or applied pressure, pressure referenced against the local atmospheric pressure, bar |
P |
true pressure, bar |
adiabatic temperature gradient, in dg K / bar
Note: in the original formula, the units of sw_adtgrad
are dg
K/dbar (here: dg K/bar).
sw_adtgrad
for S = 40, t = 40, p = 1000 is 3.255976e-3
Karline Soetaert <[email protected]>
Fofonoff NP and Millard RC Jr, 1983. Algorithms for computation of
fundamental properties of seawater. UNESCO technical papers in marine
science, 44, 53 pp.
http://unesdoc.unesco.org/images/0005/000598/059832EB.pdf
sw_alpha
, sw_beta
,
sw_comp
, sw_conserv
, sw_cp
,
sw_dens
,
sw_depth
, sw_enthalpy
, sw_entropy
,
sw_gibbs
, sw_kappa
,
sw_kappa_t
, sw_sfac
,
sw_svel
, sw_tfreeze
, sw_tpot
sw_adtgrad(t = 40, S = 40, p = 1000) #3.255976e-4 ## Check values sw_adtgrad(S = 25, t = 10, p = 0) # 0.1002e-3 sw_adtgrad(S = 25, t = 10, p = 100) # 0.1135e-3 sw_adtgrad(S = 25, t = 10, p = 1000) # 0.2069e-3 sw_adtgrad(S = 25, t = 30, p = 0) # 0.2417e-3 sw_adtgrad(S = 40, t = 30, p = 0) # 0.2510e-3 sw_adtgrad(S = 40, t = 0, p = 100) # 0.0630e-3
sw_adtgrad(t = 40, S = 40, p = 1000) #3.255976e-4 ## Check values sw_adtgrad(S = 25, t = 10, p = 0) # 0.1002e-3 sw_adtgrad(S = 25, t = 10, p = 100) # 0.1135e-3 sw_adtgrad(S = 25, t = 10, p = 1000) # 0.2069e-3 sw_adtgrad(S = 25, t = 30, p = 0) # 0.2417e-3 sw_adtgrad(S = 40, t = 30, p = 0) # 0.2510e-3 sw_adtgrad(S = 40, t = 0, p = 100) # 0.0630e-3
Computes the seawater thermal expansion coefficient with respect to in situ temperature, 1/K
sw_alpha(S = 35, t = 25, p = P-1.013253, P = 1.013253)
sw_alpha(S = 35, t = 25, p = P-1.013253, P = 1.013253)
S |
Absolute salinity (g/kg), |
t |
Temperature, |
p |
gauge or applied pressure, pressure referenced against the local atmospheric pressure, bar |
P |
true pressure, bar |
Thermal expansion coefficient, 1/K.
Karline Soetaert <[email protected]>
Feistel R, 2008. A Gibbs function for seawater thermodynamics for -6 to 80 dgC and salinity up to 120 g/kg. Deep-Sea Research I, 55, 1639-1671.
McDougall TJ, Feistel R, Millero FJ, Jackett DR, Wright DG, King BA, Marion GM, Chen C-T A and Spitzer P, 2009. Calculation of the Thermophysical Properties of Seawater, Global Ship-based Repeat Hydrography Manual, IOCCP Report No. 14, ICPO Publication Series no. 134.
sw_tfreeze
, sw_tpot
,
sw_adtgrad
, sw_beta
,
sw_comp
, sw_conserv
, sw_cp
,
sw_dens
,
sw_depth
, sw_enthalpy
, sw_entropy
,
sw_gibbs
, sw_kappa
,
sw_kappa_t
, sw_sfac
,
sw_svel
, sw_tfreeze
, sw_tpot
convert_PStoAS
, to convert from practical salinity (-) to
absolute salinity (g/kg)
sw_alpha(35.7, 25.5, 102.3)#0.000309837839319264
sw_alpha(35.7, 25.5, 102.3)#0.000309837839319264
Computes the seawater haline contraction coefficient with respect to constant, in situ temperature, kg/g
sw_beta(S = 35, t = 25, p = P-1.013253, P = 1.013253)
sw_beta(S = 35, t = 25, p = P-1.013253, P = 1.013253)
S |
Absolute salinity (g/kg), |
t |
Temperature, |
p |
gauge or applied pressure, pressure referenced against the local atmospheric pressure, bar |
P |
true pressure, bar |
Haline contraction coefficient, kg/g.
Karline Soetaert <[email protected]>
Feistel R, 2008. A Gibbs function for seawater thermodynamics for -6 to 80 dgC and salinity up to 120 g/kg. Deep-Sea Research I, 55, 1639-1671.
McDougall TJ, Feistel R, Millero FJ, Jackett DR, Wright DG, King BA, Marion GM, Chen C-T A and Spitzer P, 2009. Calculation of the Thermophysical Properties of Seawater, Global Ship-based Repeat Hydrography Manual, IOCCP Report No. 14, ICPO Publication Series no. 134.
sw_adtgrad
, sw_alpha
,
sw_comp
, sw_conserv
, sw_cp
,
sw_dens
,
sw_depth
, sw_enthalpy
, sw_entropy
,
sw_gibbs
, sw_kappa
,
sw_kappa_t
, sw_sfac
,
sw_svel
, sw_tfreeze
, sw_tpot
convert_PStoAS
, to convert from practical salinity (-) to
absolute salinity (g/kg)
sw_beta(35.7, 25.5, 102.3) #0.000725729797838666
sw_beta(35.7, 25.5, 102.3) #0.000725729797838666
The sea salt composition definition for reference salinity of the standard ocean at 25 dgC and 1.01325 bar (atmospheric pressure), given in mass fractions).
sw_comp(species = c("Na", "Mg", "Ca", "K", "Sr", "Cl", "SO4", "HCO3", "Br", "CO3", "BOH4", "F", "OH", "BOH3", "CO2"))
sw_comp(species = c("Na", "Mg", "Ca", "K", "Sr", "Cl", "SO4", "HCO3", "Br", "CO3", "BOH4", "F", "OH", "BOH3", "CO2"))
species |
character vector with components whose composition should be estimated. |
A vector with the mass fractions.
Karline Soetaert <[email protected]>
Millero FJ, Waters J, Woosley R, Huang F and Chanson M, 2008. The effect of composition of the density of Indian Ocean waters, Deep-Sea Res. I, 55, 960-470.
sw_adtgrad
, sw_alpha
, sw_beta
,
sw_conserv
, sw_cp
,
sw_dens
,
sw_depth
, sw_enthalpy
, sw_entropy
,
sw_gibbs
, sw_kappa
,
sw_kappa_t
, sw_sfac
,
sw_svel
, sw_tfreeze
, sw_tpot
sw_comp("CO2") sw_comp() sum(sw_comp())
sw_comp("CO2") sw_comp() sum(sw_comp())
Estimates the concentration of Borate,Calcite, Sulphate and Fluoride in seawater, as a function of salinity.
sw_conserv(S = 35)
sw_conserv(S = 35)
S |
Practical salinity, (-). |
The borate and calcite concentration as in Millero (1995),
Sulphate as in Morris and Riley, 1966,
Fluoride as in Riley, 1965.
A data frame with the concentrations in micromol/kg.
Karline Soetaert <[email protected]>
Millero FJ, 1995. Thermodynamics of the carbon dioxide system in the oceans. Geochim. Cosmochim. Acta 59, 661 677.
Riley JP, 1965. The occurrence of anomalously high fluoride concentrations in the North Atlantic. Deep-Sea Res. 12, 219 220.
Morris AW, Riley JP, 1966. The bromide- chlorinity and sulphate- chlorinity ratio in seawater. Deep-Sea Res. 13, 699 706.
sw_adtgrad
, sw_alpha
, sw_beta
,
sw_comp
, sw_cp
,
sw_dens
,
sw_depth
, sw_enthalpy
, sw_entropy
,
sw_gibbs
, sw_kappa
,
sw_kappa_t
, sw_sfac
,
sw_svel
, sw_tfreeze
, sw_tpot
data.frame(salinity = 1:35, sw_conserv(1:35) )
data.frame(salinity = 1:35, sw_conserv(1:35) )
Estimates the heat capacity of seawater.
Valid for S = 0 to 40, T = 0 to 35 dg C
sw_cp(S = 35, t = 25, p = P-1.013253, P = 1.013253, method = c("Gibbs", "UNESCO"))
sw_cp(S = 35, t = 25, p = P-1.013253, P = 1.013253, method = c("Gibbs", "UNESCO"))
S |
Salinity, when |
t |
Temperature, |
p |
gauge or applied pressure, pressure referenced against the local atmospheric pressure, bar |
P |
true pressure, bar |
method |
When "UNESCO", uses the UNESCO (1983) polynomial, when "Gibbs", based on the gibbs functions as in Feistel, 2008 |
Heat capacity, in
p
is applied pressure, 0 bar at sea surface.
when using UNESCO polynomial, cp
for S = 40, T = 40, P = 1000
is 3849.5 J/(kg dg C).
Karline Soetaert <[email protected]>
Fofonoff NP and Millard RC Jr, 1983. Algorithms for computation of
fundamental properties of seawater. UNESCO technical papers in marine
science, 44, 53 pp.
http://unesdoc.unesco.org/images/0005/000598/059832EB.pdf
Feistel R, 2008. A Gibbs function for seawater thermodynamics for -6 to 80 dgC and salinity up to 120 g/kg. Deep-Sea Research I, 55, 1639-1671.
McDougall TJ, Feistel R, Millero FJ, Jackett DR, Wright DG, King BA, Marion GM, Chen C-T A and Spitzer P, 2009. Calculation of the Thermophysical Properties of Seawater, Global Ship-based Repeat Hydrography Manual, IOCCP Report No. 14, ICPO Publication Series no. 134.
sw_adtgrad
, sw_alpha
, sw_beta
,
sw_comp
, sw_conserv
, sw_dens
,
sw_depth
, sw_enthalpy
, sw_entropy
,
sw_gibbs
, sw_kappa
,
sw_kappa_t
, sw_sfac
,
sw_svel
, sw_tfreeze
, sw_tpot
convert_PStoAS
, to convert from practical salinity (-) to
absolute salinity (g/kg)
convert_AStoPS
, to convert from absolute salinity (g/kg) to
practical salinity (-)
sw_cp(S = 40, t = 40, p = 1000, method="UNESCO") # 3849.5 # Check value Gibbs function sw_cp(35.7,25.5,102.3)#3974.42541259729 # Check values UNESCO sw_cp(S = 25, t = 10, p = 0, method = "UNESCO") # 4041.8 sw_cp(S = 25, t = 10, p = 1000, method = "UNESCO") # 3842.3 sw_cp(S = 25, t = 30, p = 0, method = "UNESCO") # 4049.1 sw_cp(S = 40, t = 10, p = 0, method = "UNESCO") # 3959.3
sw_cp(S = 40, t = 40, p = 1000, method="UNESCO") # 3849.5 # Check value Gibbs function sw_cp(35.7,25.5,102.3)#3974.42541259729 # Check values UNESCO sw_cp(S = 25, t = 10, p = 0, method = "UNESCO") # 4041.8 sw_cp(S = 25, t = 10, p = 1000, method = "UNESCO") # 3842.3 sw_cp(S = 25, t = 30, p = 0, method = "UNESCO") # 4049.1 sw_cp(S = 40, t = 10, p = 0, method = "UNESCO") # 3959.3
Density of sea water in
sw_dens(S = 35, t = 25, p = max(0, P-1.013253), P = 1.013253, method=c("Gibbs","UNESCO","Chen"))
sw_dens(S = 35, t = 25, p = max(0, P-1.013253), P = 1.013253, method=c("Gibbs","UNESCO","Chen"))
S |
Salinity, when |
t |
Temperature, |
p |
gauge or applied pressure, pressure referenced against the local atmospheric pressure, bar |
P |
true pressure, bar |
method |
When "UNESCO", uses the UNESCO (1983) polynomial, when "Gibbs", based on the Gibbs functions as in Feistel, 2008 "Chen" for the limnological range (i.e. fresh water systems). |
To avoid confusion between the arguments (S, t, p) it is advisable to
use named arguments in general (e.g. rho(t = 4)
.
The UNESCO formula is imported from package seacarb.
Density of water in .
Pressure used here is 1 bar (true pressure), in contrast to hydrostatic pressure (0 bar at surface) in original formula.
The coefficients from McDougall et al., 2009 were used. For temperature, they differ slightly from Feistel 2003 and Feistel 2008, which is why, for temparatures different from 0, there is a slight offset from the estimates as from table 22 or 21 from Feistel (2008).
Chen Ch.-T. and Millero FJ, 1986. Thermodynamic properties of natural waters covering only the limnological range. Limnol. Oceanogr. 31 No. 3, 657 - 662. doi:10.4319/lo.1986.31.3.0657
Fofonoff NP and Millard RC Jr, 1983. Algorithms for computation of
fundamental properties of seawater. UNESCO technical papers in marine
science, 44, 53 pp.
http://unesdoc.unesco.org/images/0005/000598/059832EB.pdf
Feistel R, 2008. A Gibbs function for seawater thermodynamics for -6 to 80 dgC and salinity up to 120 g/kg. Deep-Sea Research I, 55, 1639-1671.
McDougall TJ, Feistel R, Millero FJ, Jackett DR, Wright DG, King BA, Marion GM, Chen C-T A and Spitzer P, 2009. Calculation of the Thermophysical Properties of Seawater, Global Ship-based Repeat Hydrography Manual, IOCCP Report No. 14, ICPO Publication Series no. 134.
rho
in package seacarb.
sw_adtgrad
, sw_alpha
, sw_beta
,
sw_comp
, sw_conserv
, sw_cp
,
sw_depth
, sw_enthalpy
, sw_entropy
,
sw_gibbs
, sw_kappa
,
sw_kappa_t
, sw_sfac
,
sw_svel
, sw_tfreeze
, sw_tpot
convert_PStoAS
, to convert from practical salinity to
absolute salinity
convert_AStoPS
, to convert from absolute salinity to
practical salinity
# table 22 Feistel 2008 sw_dens(0, 0, 0) #0.999843086e3 sw_dens(0, 79.85, 0) #0.97188383e3 - deviates sw_dens(0, 0,998.98675) #0.104527796e4 # table 21 Feistel 2008 sw_dens(35.16504, 0, 0) #0.10281072e4 sw_dens(100, 79.85, 0) #0.102985888e4 sw_dens(35.16504, 0,998.98675) #0.10709264e4 sw_dens(35.7, 25.5, 102.3) #1027.95249315662 S <- 0:40 plot(S, sw_dens(S = S, t = 4, method = "UNESCO")) lines(S, sw_dens(S = S, t = 4, method = "Gibbs"), col = "red") lines(S, sw_dens(S = S, t = 4, method = "Chen"), col = "blue")
# table 22 Feistel 2008 sw_dens(0, 0, 0) #0.999843086e3 sw_dens(0, 79.85, 0) #0.97188383e3 - deviates sw_dens(0, 0,998.98675) #0.104527796e4 # table 21 Feistel 2008 sw_dens(35.16504, 0, 0) #0.10281072e4 sw_dens(100, 79.85, 0) #0.102985888e4 sw_dens(35.16504, 0,998.98675) #0.10709264e4 sw_dens(35.7, 25.5, 102.3) #1027.95249315662 S <- 0:40 plot(S, sw_dens(S = S, t = 4, method = "UNESCO")) lines(S, sw_dens(S = S, t = 4, method = "Gibbs"), col = "red") lines(S, sw_dens(S = S, t = 4, method = "Chen"), col = "blue")
Computes the water depth for water of salinity 35, and temperature 0 dg C, based on latitude and hydrostatic pressure, using the UNESCO 1983 polynomial.
sw_depth(p = P-1.013253, P = 1.013253, lat = 0)
sw_depth(p = P-1.013253, P = 1.013253, lat = 0)
p |
gauge or applied pressure, pressure referenced against the local atmospheric pressure, bar |
P |
true pressure, bar |
lat |
latitude (-90 to +90), -, |
Water depth in m.
sw_depth
for p = 1000, lat = 30 is 9712.653 m.
Karline Soetaert <[email protected]>
Fofonoff NP and Millard RC Jr, 1983. Algorithms for computation of
fundamental properties of seawater. UNESCO technical papers in marine
science, 44, 53 pp.
http://unesdoc.unesco.org/images/0005/000598/059832EB.pdf
sw_adtgrad
, sw_alpha
, sw_beta
,
sw_comp
, sw_conserv
, sw_cp
,
sw_dens
, sw_enthalpy
, sw_entropy
,
sw_gibbs
, sw_kappa
,
sw_kappa_t
, sw_sfac
,
sw_svel
, sw_tfreeze
, sw_tpot
sw_depth(p = 1000, lat = 30:40) ## Check values sw_depth(p = 1000, lat = 30) #9712.65 sw_depth(p = 50, lat = 30) #496.00 sw_depth(p = 50, lat = 60) #494.69 sw_depth(p = 500, lat = 60) #4895.60
sw_depth(p = 1000, lat = 30:40) ## Check values sw_depth(p = 1000, lat = 30) #9712.65 sw_depth(p = 50, lat = 30) #496.00 sw_depth(p = 50, lat = 60) #494.69 sw_depth(p = 500, lat = 60) #4895.60
Computes the seawater specific enthalpy, J/kg
sw_enthalpy(S = 35, t = 25, p = P-1.013253, P = 1.013253)
sw_enthalpy(S = 35, t = 25, p = P-1.013253, P = 1.013253)
S |
Absolute salinity (g/kg), |
t |
Temperature, |
p |
gauge or applied pressure, pressure referenced against the local atmospheric pressure, bar |
P |
true pressure, bar |
Specific enthalpy, J/kg.
Karline Soetaert <[email protected]>
Feistel R, 2008. A Gibbs function for seawater thermodynamics for -6 to 80 dgC and salinity up to 120 g/kg. Deep-Sea Research I, 55, 1639-1671.
McDougall TJ, Feistel R, Millero FJ, Jackett DR, Wright DG, King BA, Marion GM, Chen C-T A and Spitzer P, 2009. Calculation of the Thermophysical Properties of Seawater, Global Ship-based Repeat Hydrography Manual, IOCCP Report No. 14, ICPO Publication Series no. 134.
sw_adtgrad
, sw_alpha
, sw_beta
,
sw_comp
, sw_conserv
, sw_cp
,
sw_dens
,
sw_depth
, sw_entropy
,
sw_gibbs
, sw_kappa
,
sw_kappa_t
, sw_sfac
,
sw_svel
, sw_tfreeze
, sw_tpot
convert_PStoAS
, to convert from practical salinity (-) to
absolute salinity (g/kg)
sw_enthalpy(35.7,25.5,102.3) #110776.712408975
sw_enthalpy(35.7,25.5,102.3) #110776.712408975
Computes the seawater specific entropy, J/(kg*K)
sw_entropy(S = 35, t = 25, p = P-1.013253, P = 1.013253)
sw_entropy(S = 35, t = 25, p = P-1.013253, P = 1.013253)
S |
Absolute salinity (g/kg), |
t |
Temperature, |
p |
gauge or applied pressure, pressure referenced against the local atmospheric pressure, bar |
P |
true pressure, bar |
Specific entropy, J/(kg*K).
Karline Soetaert <[email protected]>
Feistel R, 2008. A Gibbs function for seawater thermodynamics for -6 to 80 dgC and salinity up to 120 g/kg. Deep-Sea Research I, 55, 1639-1671.
McDougall TJ, Feistel R, Millero FJ, Jackett DR, Wright DG, King BA, Marion GM, Chen C-T A and Spitzer P, 2009. Calculation of the Thermophysical Properties of Seawater, Global Ship-based Repeat Hydrography Manual, IOCCP Report No. 14, ICPO Publication Series no. 134.
sw_adtgrad
, sw_alpha
, sw_beta
,
sw_comp
, sw_conserv
, sw_cp
,
sw_dens
,
sw_depth
, sw_enthalpy
,
sw_gibbs
, sw_kappa
,
sw_kappa_t
, sw_sfac
,
sw_svel
, sw_tfreeze
, sw_tpot
convert_PStoAS
, to convert from practical salinity (-) to
absolute salinity (g/kg)
sw_entropy(35.7, 25.5, 102.3) #352.81879771528
sw_entropy(35.7, 25.5, 102.3) #352.81879771528
Calculates the seawater specific gibbs free energy, including derivatives up to order 2, for a given temperature, salinity and pressure.
The Gibbs function of seawater g(S,t,p) is related to the specific enthalpy h and entropy s, by g = h - (273.15 K + t) s
sw_gibbs(S = 35, t = 25, p = P-1.013253, P = 1.013253, dS = 0, dt = 0, dp = 0)
sw_gibbs(S = 35, t = 25, p = P-1.013253, P = 1.013253, dS = 0, dt = 0, dp = 0)
S |
Absolute salinity (g/kg), |
t |
Temperature, |
p |
gauge or applied pressure, pressure referenced against the local atmospheric pressure, bar |
P |
true pressure, bar |
dS |
order of the S derivative |
dt |
order of the t derivative |
dp |
order of the p derivative |
The Gibbs function, J/kg, or its derivative
The gibbs function is defined as the sum of a pure water part and the saline part (IAPWS-08)
The coefficients from McDougall et al., 2009 were used. For temperature, they differ slightly from Feistel 2003 and Feistel 2008, which is why, for temperatures different from 0, there is a slight offset from the estimates as from table 22 or 21 from Feistel (2008).
Karline Soetaert <[email protected]>
Feistel R, 2008. A Gibbs function for seawater thermodynamics for -6 to 80 dgC and salinity up to 120 g/kg. Deep-Sea Research I, 55, 1639-1671.
McDougall TJ, Feistel R, Millero FJ, Jackett DR, Wright DG, King BA, Marion GM, Chen C-T A and Spitzer P, 2009. Calculation of the Thermophysical Properties of Seawater, Global Ship-based Repeat Hydrography Manual, IOCCP Report No. 14, ICPO Publication Series no. 134.
sw_adtgrad
, sw_alpha
, sw_beta
,
sw_comp
, sw_conserv
, sw_cp
,
sw_dens
,
sw_depth
, sw_enthalpy
, sw_entropy
,
sw_kappa
,
sw_kappa_t
, sw_sfac
,
sw_svel
, sw_tfreeze
, sw_tpot
convert_PStoAS
, to convert from practical salinity (-) to
absolute salinity (g/kg)
# table 22 Feistel 2008 sw_gibbs(0, 0, 0) #= 101.34274 sw_gibbs(0, 0, 0, dS = 1) # 0 sw_gibbs(0, 0, 0, dt = 1) #0.147643376 sw_gibbs(0, 0, 0, dp = 1) #0.1000015694e-2 sw_gibbs(0, 0, 0, dS = 1, dp = 1) #0 sw_gibbs(0, 0, 0, dt = 1, dp = 1) #-0.677700318e-7 sw_gibbs(0, 79.85, 0) #-0.446114969e5 differs (see note) sw_gibbs(0, 79.85, 0, dt = 1) #-0.107375993e4 differs sw_gibbs(0, 79.85, 0, dp = 1) #0.102892956e-2 differs sw_gibbs(0, 79.85, 0, dS = 1, dp = 1) #0 sw_gibbs(0, 79.85, 0, dt = 1, dp = 1) #0.659051552e-6 sw_gibbs(0, 0, 998.98675) #0.977303862e5 sw_gibbs(0, 0, 998.98675, dt = 1) #0.851466502e1 sw_gibbs(0, 0, 998.98675, dp = 1) #0.956683329e-3 sw_gibbs(0, 0, 998.98675, dS = 1, dp = 1) #0 sw_gibbs(0, 0, 998.98675, dt = 1, dp = 1) #0.199079571e-6 # table 21 Feistel 2008 sw_gibbs(35.16504, 0, 0) #=0 sw_gibbs(35.16504, 0, 0, dS = 1) #0.639974067e2 differs sw_gibbs(35.16504, 0, 0, dt = 1) #=0 sw_gibbs(35.16504, 0, 0, dp = 1) #0.972661217e-3 sw_gibbs(35.16504, 0, 0, dS = 1, dp = 1) #-0.759615412e-6 sw_gibbs(35.16504, 0, 0, dt = 1, dp = 1) #0.515167556e-7 !!! sw_gibbs(100, 79.85, 0) #=-0.295243229e5 differs sw_gibbs(100, 79.85, 0, dS = 1) #0.251957276e3 sw_gibbs(100, 79.85, 0, dt = 1) #-0.917529024e3 differs sw_gibbs(100, 79.85, 0, dp = 1) #0.971006828e-3 differs sw_gibbs(100, 79.85, 0, dS = 1, dp = 1) #-0.305957802e-6 sw_gibbs(100, 79.85, 0, dt = 1, dp = 1) #0.146211315e-5 sw_gibbs(35.16504, 0, 998.98675) #=0.951294557e5 sw_gibbs(35.16504, 0, 998.98675, dS = 1) #-0.545861581e1 sw_gibbs(35.16504, 0, 998.98675, dt = 1) #0.160551219e2 sw_gibbs(35.16504, 0, 998.98675, dp = 1) #0.933770945e-3 sw_gibbs(35.16504, 0, 998.98675, dS = 1, dp = 1) #-0.640757619e-6 sw_gibbs(35.16504, 0, 998.98675, dt = 1, dp = 1) #0.245708012e-6
# table 22 Feistel 2008 sw_gibbs(0, 0, 0) #= 101.34274 sw_gibbs(0, 0, 0, dS = 1) # 0 sw_gibbs(0, 0, 0, dt = 1) #0.147643376 sw_gibbs(0, 0, 0, dp = 1) #0.1000015694e-2 sw_gibbs(0, 0, 0, dS = 1, dp = 1) #0 sw_gibbs(0, 0, 0, dt = 1, dp = 1) #-0.677700318e-7 sw_gibbs(0, 79.85, 0) #-0.446114969e5 differs (see note) sw_gibbs(0, 79.85, 0, dt = 1) #-0.107375993e4 differs sw_gibbs(0, 79.85, 0, dp = 1) #0.102892956e-2 differs sw_gibbs(0, 79.85, 0, dS = 1, dp = 1) #0 sw_gibbs(0, 79.85, 0, dt = 1, dp = 1) #0.659051552e-6 sw_gibbs(0, 0, 998.98675) #0.977303862e5 sw_gibbs(0, 0, 998.98675, dt = 1) #0.851466502e1 sw_gibbs(0, 0, 998.98675, dp = 1) #0.956683329e-3 sw_gibbs(0, 0, 998.98675, dS = 1, dp = 1) #0 sw_gibbs(0, 0, 998.98675, dt = 1, dp = 1) #0.199079571e-6 # table 21 Feistel 2008 sw_gibbs(35.16504, 0, 0) #=0 sw_gibbs(35.16504, 0, 0, dS = 1) #0.639974067e2 differs sw_gibbs(35.16504, 0, 0, dt = 1) #=0 sw_gibbs(35.16504, 0, 0, dp = 1) #0.972661217e-3 sw_gibbs(35.16504, 0, 0, dS = 1, dp = 1) #-0.759615412e-6 sw_gibbs(35.16504, 0, 0, dt = 1, dp = 1) #0.515167556e-7 !!! sw_gibbs(100, 79.85, 0) #=-0.295243229e5 differs sw_gibbs(100, 79.85, 0, dS = 1) #0.251957276e3 sw_gibbs(100, 79.85, 0, dt = 1) #-0.917529024e3 differs sw_gibbs(100, 79.85, 0, dp = 1) #0.971006828e-3 differs sw_gibbs(100, 79.85, 0, dS = 1, dp = 1) #-0.305957802e-6 sw_gibbs(100, 79.85, 0, dt = 1, dp = 1) #0.146211315e-5 sw_gibbs(35.16504, 0, 998.98675) #=0.951294557e5 sw_gibbs(35.16504, 0, 998.98675, dS = 1) #-0.545861581e1 sw_gibbs(35.16504, 0, 998.98675, dt = 1) #0.160551219e2 sw_gibbs(35.16504, 0, 998.98675, dp = 1) #0.933770945e-3 sw_gibbs(35.16504, 0, 998.98675, dS = 1, dp = 1) #-0.640757619e-6 sw_gibbs(35.16504, 0, 998.98675, dt = 1, dp = 1) #0.245708012e-6
Computes the seawater isentropic compressibility, 1/bar
sw_kappa(S = 35, t = 25, p = P-1.013253, P = 1.013253)
sw_kappa(S = 35, t = 25, p = P-1.013253, P = 1.013253)
S |
Salinity (dimensionless), |
t |
Temperature, |
p |
gauge or applied pressure, pressure referenced against the local atmospheric pressure, bar |
P |
true pressure, bar |
Isentropic compressibility, 1/bar
Karline Soetaert <[email protected]>
Feistel R, 2008. A Gibbs function for seawater thermodynamics for -6 to 80 dgC and salinity up to 120 g/kg. Deep-Sea Research I, 55, 1639-1671.
McDougall TJ, Feistel R, Millero FJ, Jackett DR, Wright DG, King BA, Marion GM, Chen C-T A and Spitzer P, 2009. Calculation of the Thermophysical Properties of Seawater, Global Ship-based Repeat Hydrography Manual, IOCCP Report No. 14, ICPO Publication Series no. 134.
sw_adtgrad
, sw_alpha
, sw_beta
,
sw_comp
, sw_conserv
, sw_cp
,
sw_dens
,
sw_depth
, sw_enthalpy
, sw_entropy
,
sw_gibbs
, sw_kappa_t
, sw_sfac
,
sw_svel
, sw_tfreeze
, sw_tpot
convert_PStoAS
, to convert from practical salinity (-) to
absolute salinity (g/kg)
sw_kappa(35.7, 25.5, 102.3) #4.03386268546478e-6
sw_kappa(35.7, 25.5, 102.3) #4.03386268546478e-6
Computes the seawater isothermal compressibility, 1/Pa
sw_kappa_t(S = 35, t = 25, p = P-1.013253, P = 1.013253)
sw_kappa_t(S = 35, t = 25, p = P-1.013253, P = 1.013253)
S |
Absolute salinity (g/kg), |
t |
Temperature, |
p |
gauge or applied pressure, pressure referenced against the local atmospheric pressure, bar |
P |
true pressure, bar |
isothermal compressibility, 1/Pa.
Karline Soetaert <[email protected]>
Feistel R, 2008. A Gibbs function for seawater thermodynamics for -6 to 80 dgC and salinity up to 120 g/kg. Deep-Sea Research I, 55, 1639-1671.
McDougall TJ, Feistel R, Millero FJ, Jackett DR, Wright DG, King BA, Marion GM, Chen C-T A and Spitzer P, 2009. Calculation of the Thermophysical Properties of Seawater, Global Ship-based Repeat Hydrography Manual, IOCCP Report No. 14, ICPO Publication Series no. 134.
sw_adtgrad
, sw_alpha
, sw_beta
,
sw_comp
, sw_conserv
, sw_cp
,
sw_dens
,
sw_depth
, sw_enthalpy
, sw_entropy
,
sw_gibbs
, sw_kappa
, sw_sfac
,
sw_svel
, sw_tfreeze
, sw_tpot
convert_PStoAS
, to convert from practical salinity (-) to
absolute salinity (g/kg)
sw_kappa_t(35.7, 25.5, 102.3) #4.10403794615135e-6
sw_kappa_t(35.7, 25.5, 102.3) #4.10403794615135e-6
Factors to convert from practical to absolute salinity and vice versa.
sw_sfac
sw_sfac
A list with the following:
the longitude, a vector with 91 elements, range (0,360),
third dimension in del_sa
,
the latitude, second dimension in del_sa
, a vector
with 44 elements, range (-82,90),
dbar , the first dimension in del_sa
, a vector
with 45 elements, range(0,6131),
the number of depth intervals at a certain lat,long, a matrix of dimension (4,91),
the salinity anomaly, an array with dimension (45,44,91), i.e. for (p, lats, longs) values.
Karline Soetaert <[email protected]>
Millero FJ, Feistel R, Wright DG and McDougall TJ, 2008. The composition of Standard Seawater and the definition of the Reference-Composition Salinity Scale, Deep-Sea Res. I, 55, 50-72.
McDougall TJ, Jackett DR and Millero FJ, 2009. An algorithm for estimating Absolute Salinity in the global ocean. Ocean Science Discussions 6, 215-242. http://www.ocean-sci-discuss.net/6/215/2009/
Uses the Fortran code written by David Jackett http://www.teos-10.org/
convert_PStoAS
, to convert from practical salinity to
absolute salinity
convert_AStoPS
, to convert from absolute salinity to
practical salinity
mf <- par(mfrow = c(2, 1)) ma <- par(mar = c(3, 5, 2, 5)) dsal <- t(sw_sfac$del_sa[1, , ]) dsal [dsal < -90] <- NA image(sw_sfac$longs, sw_sfac$lats, dsal, col = femmecol(100), asp = TRUE, xlab = "dg", ylab = "dg", main = "salinity conversion - p = 0 bar") contour(sw_sfac$longs, sw_sfac$lats, dsal, asp = TRUE, add = TRUE) dsal <- t(sw_sfac$del_sa[5,,]) # 5th depth level sw_sfac$p[5] dsal [dsal < -90]<-NA image(sw_sfac$longs, sw_sfac$lats, dsal, col = femmecol(100), asp = TRUE, xlab = "dg", ylab = "dg", main = "salinity conversion - p = 4 bar") contour(sw_sfac$longs, sw_sfac$lats, dsal, asp = TRUE, add = TRUE) par("mfrow" = mf) par("mar" = ma)
mf <- par(mfrow = c(2, 1)) ma <- par(mar = c(3, 5, 2, 5)) dsal <- t(sw_sfac$del_sa[1, , ]) dsal [dsal < -90] <- NA image(sw_sfac$longs, sw_sfac$lats, dsal, col = femmecol(100), asp = TRUE, xlab = "dg", ylab = "dg", main = "salinity conversion - p = 0 bar") contour(sw_sfac$longs, sw_sfac$lats, dsal, asp = TRUE, add = TRUE) dsal <- t(sw_sfac$del_sa[5,,]) # 5th depth level sw_sfac$p[5] dsal [dsal < -90]<-NA image(sw_sfac$longs, sw_sfac$lats, dsal, col = femmecol(100), asp = TRUE, xlab = "dg", ylab = "dg", main = "salinity conversion - p = 4 bar") contour(sw_sfac$longs, sw_sfac$lats, dsal, asp = TRUE, add = TRUE) par("mfrow" = mf) par("mar" = ma)
Computes the velocity of the sound in seawater, using the UNESCO 1983 polynomial or based on the Gibbs function.
Valid for salinity from 0 to 40, temperature from 0 to 40 dgC, pressure from 1 to 1000 bars.
sw_svel(S = 35, t = 25, p = P-1.013253, P = 1.013253, method = c("Gibbs", "UNESCO"))
sw_svel(S = 35, t = 25, p = P-1.013253, P = 1.013253, method = c("Gibbs", "UNESCO"))
S |
Salinity, when |
t |
Temperature, |
p |
gauge or applied pressure, pressure referenced against the local atmospheric pressure, bar |
P |
true pressure, bar |
method |
When "UNESCO", uses the UNESCO (1983) polynomial, when "Gibbs", based on the gibbs functions as in Feistel, 2008 |
Sound velocity, in m / sec.
Sound velocity for S = 40, t = 40, p = 1000 is 1731.995 using UNESCO polynomial.
Karline Soetaert <[email protected]>
Fofonoff NP and Millard RC Jr, 1983. Algorithms for computation of
fundamental properties of seawater. UNESCO technical papers in marine
science, 44, 53 pp.
http://unesdoc.unesco.org/images/0005/000598/059832EB.pdf
Feistel R, 2008. A Gibbs function for seawater thermodynamics for -6 to 80 dgC and salinity up to 120 g/kg. Deep-Sea Research I, 55, 1639-1671.
McDougall TJ, Feistel R, Millero FJ, Jackett DR, Wright DG, King BA, Marion GM, Chen C-T A and Spitzer P, 2009. Calculation of the Thermophysical Properties of Seawater, Global Ship-based Repeat Hydrography Manual, IOCCP Report No. 14, ICPO Publication Series no. 134.
sw_adtgrad
, sw_alpha
, sw_beta
,
sw_comp
, sw_conserv
, sw_cp
,
sw_dens
,
sw_depth
, sw_enthalpy
, sw_entropy
,
sw_gibbs
, sw_kappa
,
sw_kappa_t
, sw_sfac
,
sw_tfreeze
, sw_tpot
convert_PStoAS
, to convert from practical salinity (-) to
absolute salinity (g/kg)
convert_AStoPS
, to convert from absolute salinity (g/kg) to
practical salinity (-)
sw_svel(t = 40, S = 40, p = 10:20, method = "UNESCO") # Check value UNESCO sw_svel(t = 40, S = 40, p = 1000, method = "UNESCO") # 1731.995 sw_svel(t = 0, S = 40, p = 0, method = "UNESCO") # 1455.8 sw_svel(t = 40, S = 25, p = 1000, method = "UNESCO") # 1719.2 sw_svel(t = 40, S = 25, p = 0, method = "UNESCO") # 1553.4 sw_svel(t = 0, S = 25, p = 0, method = "UNESCO") # 1435.8 # Check value Gibbs sw_svel(S = 35.7, t = 25.5, p = 102.3) # 1552.93372863425
sw_svel(t = 40, S = 40, p = 10:20, method = "UNESCO") # Check value UNESCO sw_svel(t = 40, S = 40, p = 1000, method = "UNESCO") # 1731.995 sw_svel(t = 0, S = 40, p = 0, method = "UNESCO") # 1455.8 sw_svel(t = 40, S = 25, p = 1000, method = "UNESCO") # 1719.2 sw_svel(t = 40, S = 25, p = 0, method = "UNESCO") # 1553.4 sw_svel(t = 0, S = 25, p = 0, method = "UNESCO") # 1435.8 # Check value Gibbs sw_svel(S = 35.7, t = 25.5, p = 102.3) # 1552.93372863425
Estimates the freezing temperature of seawater, using the UNESCO 1983 polynomial.
Valid for salinity 4-40
sw_tfreeze(S=35, p = P-1.013253, P = 1.013253 )
sw_tfreeze(S=35, p = P-1.013253, P = 1.013253 )
S |
practical salinity, -, |
p |
gauge or applied pressure, pressure referenced against the local atmospheric pressure, bar |
P |
true pressure, bar |
Temperature, C
freezing temperature for S = 40, p
= 50 is -2.588567 dgC.
Karline Soetaert <[email protected]>
Fofonoff NP and Millard RC Jr, 1983. Algorithms for computation of
fundamental properties of seawater. UNESCO technical papers in marine
science, 44, 53 pp.
http://unesdoc.unesco.org/images/0005/000598/059832EB.pdf
sw_adtgrad
, sw_alpha
, sw_beta
,
sw_comp
, sw_conserv
, sw_cp
,
sw_dens
,
sw_depth
, sw_enthalpy
, sw_entropy
,
sw_gibbs
, sw_kappa
,
sw_kappa_t
, sw_sfac
,
sw_svel
, sw_tpot
sw_tfreeze(S = 40,p = 50) ## Check values sw_tfreeze(S = 10,p = 0) #-0.542 sw_tfreeze(S = 10,p = 10) #-0.618 sw_tfreeze(S = 30,p = 0) #-1.638 sw_tfreeze(S = 40,p = 50) #-2.589
sw_tfreeze(S = 40,p = 50) ## Check values sw_tfreeze(S = 10,p = 0) #-0.542 sw_tfreeze(S = 10,p = 10) #-0.618 sw_tfreeze(S = 30,p = 0) #-1.638 sw_tfreeze(S = 40,p = 50) #-2.589
Estimates the potential temperature of seawater, using the UNESCO 1983 polynomial.
It is the temperature an element of seawater would have if raised adiabatically with no change of salinity, to atmospheric pressure.
sw_tpot(S = 35, t = 25, p, pref = 0)
sw_tpot(S = 35, t = 25, p, pref = 0)
t |
temperature, |
S |
practical salinity, -, |
p |
gauge or applied pressure, pressure referenced against the local atmospheric pressure, bar |
pref |
reference hydrostatic pressure, bar. |
Temperature, C.
sw_tpot
for S = 40, t = 40, p = 1000 is 36.89073 dgC
Karline Soetaert <[email protected]>
Fofonoff NP and Millard RC Jr, 1983. Algorithms for computation of
fundamental properties of seawater. UNESCO technical papers in marine
science, 44, 53 pp.
http://unesdoc.unesco.org/images/0005/000598/059832EB.pdf
sw_adtgrad
, sw_alpha
, sw_beta
,
sw_comp
, sw_conserv
, sw_cp
,
sw_dens
,
sw_depth
, sw_enthalpy
, sw_entropy
,
sw_gibbs
, sw_kappa
,
sw_kappa_t
, sw_sfac
,
sw_svel
, sw_tfreeze
sw_tpot(S = 40, t = 40:45, p = 1000) ## check values sw_tpot(S = 25, t = 40, p = 0) #40 sw_tpot(S = 25, t = 40, p = 100) #36.6921 sw_tpot(S = 25, t = 10, p = 1000) #8.4684 sw_tpot(S = 25, t = 0, p = 100) #-0.0265 sw_tpot(S = 40, t = 40, p = 1000) #36.89073
sw_tpot(S = 40, t = 40:45, p = 1000) ## check values sw_tpot(S = 25, t = 40, p = 0) #40 sw_tpot(S = 25, t = 40, p = 100) #36.6921 sw_tpot(S = 25, t = 10, p = 1000) #8.4684 sw_tpot(S = 25, t = 0, p = 100) #-0.0265 sw_tpot(S = 40, t = 40, p = 1000) #36.89073
The partial pressure of water in saturated air (pH20/P), as in Weiss and Price (1980), where P is the total atmospheric pressure, (1 atmosphere), and pH2O is the partial pressure of the water vapor.
vapor(S = 35, t = 25)
vapor(S = 35, t = 25)
S |
Salinity (-), |
t |
Temperature, |
The saturation vapor pressure (-).
Karline Soetaert <[email protected]>
Sarmiento JL and Gruber N, 2006. Ocean Biogeochemical Dynamics. Princeton University Press, Princeton. p 74
Weiss R and Price BA, 1980. Nitrous oxide solubility in water and seawater. Mar. Chem. 8, 347-359.
gas_O2sat
, gas_satconc
,
gas_schmidt
, gas_solubility
,
gas_transfer
, atmComp
plot(0:30, vapor(t = 0:30), xlab = "Temperature, dgC", ylab = "pH2O/P")
plot(0:30, vapor(t = 0:30), xlab = "Temperature, dgC", ylab = "pH2O/P")
The vapor pressure of water, in hPa.
vapor.hPa(t = 25)
vapor.hPa(t = 25)
t |
Temperature, |
The vapor pressure of water, in hecto Pascal; valid for temperature of [-50,100] dgC.
Karline Soetaert <[email protected]>, Lorenz Meire <[email protected]>
Lowe, P.R. and J.M. Ficke, 1974: The computation of saturation vapor pressure. Tech. Paper No. 4-74, Environmental Prediction Research Facility, Naval Postgraduate School, Monterey, CA, 27 pp.
http://www.cactus2000.de/uk/unit/masshum.shtml
vapor
, air_spechum
, air_density
,
gas_O2sat
, gas_satconc
,
gas_schmidt
, gas_solubility
,
gas_transfer
, atmComp
vapor.hPa(t = 25) plot(0:30, vapor.hPa(t = 0:30), xlab = "Temperature, dgC", ylab = "hPa")
vapor.hPa(t = 25) plot(0:30, vapor.hPa(t = 0:30), xlab = "Temperature, dgC", ylab = "hPa")
Calculate vertical mean values which respect to depths of different layers or lake morphometry.
vertmean(depth, vari, level, top, bot, vol, total=FALSE)
vertmean(depth, vari, level, top, bot, vol, total=FALSE)
depth |
sorted vector of sampled depths, |
vari |
measurements corresponding to |
level |
surface water level (above ground or above sea level (m a.s.l.), depending on bathymetric function used, |
top |
top water level of requested layer over which to average or integrate, |
bot |
bottom water level of requested layer over which to average or intgrate, |
vol |
hypsographic function to be used (e.g. |
total |
if |
Volumetric average respectively total value (for total =TRUE
) for a
given quantity (concentration, energy, temperature) in the requested
layer between depths top
and bottom
.
Thomas Petzoldt
coriolis
, viscosity
,
diffcoeff
, ssd2rad
,
gravity
## define a bathymetric formula for a given lake or basin ## z: water depth (m below surface) ## zz: water column (m above ground) ## level: total water depth (m above ground or above reference level) weight.vol <- function(z, level) { zz <- level - z if (any(zz < 0)) stop("depth > maximum depth") vol <- 175947 * zz^2 + 2686 * zz^3 # m^3 } ## area is first derivative area <- function(z, level) { zz <- level - z A <- 0.5 * 175947 * zz + 1/3 * 2686 * zz^2 # m^2 } ## dummy formula for depth-weighted averaging ## (water column, instead of bathymetric curve) weight.column <- function(z, level) {z} ## Plot of lake volume (bathymetric curve) par(mfrow = c(1, 2)) z <- 0:12 V <- weight.vol(z, 12) plot(V, z, type = "l", ylim = c(12, 0), xlab = "Volume (m3)", ylab = "Depth (m)") polygon(c(V, 0), c(z, 0), col = "cyan") ## Test Data level <- 12 depth <- c(0, 1, 3.5, 5, 7, 10, 10.5, 11.5) pconc <- c(3.7, 4.2, 6.1, 8.9, 7.8, 9.7, 11.4, 11.4) ## Plot test data plot(pconc, depth, xlim=range(c(0, pconc)), ylim=c(12,0), type="n", xlab="P concentration (mu g / L)", ylab="Depth (m)") segments(rep(0, 13), depth, pconc, depth, lwd=3) ## simple means m <- mean(pconc[depth <= 4]) lines(c(m, m), c(0, 4), col="blue", lwd=2) m <- mean(pconc[depth >= 4]) lines(c(m, m), c(4, 12), col="blue", lwd=2) ## depth weighted m <- vertmean(depth, pconc, level, top=0, bot=4, weight.column) lines(c(m, m), c(0, 4), col="red", lwd=2) m <- vertmean(depth, pconc, level, top=4, bot=12, weight.column) lines(c(m, m), c(4, 12), col="red", lwd=2) ## volume weighted m <- vertmean(depth, pconc, level, top=0, bot=4, weight.vol) lines(c(m, m), c(0, 4), col="green", lwd=2) m <- vertmean(depth, pconc, level, top=4, bot=12, weight.vol) lines(c(m, m), c(4, 12), col="green", lwd=2) m <- vertmean(depth, pconc, level, top=4, bot=12, weight.vol) lines(c(m, m), c(4, 12), col="green", lwd=2) legend("topright", col=c("blue", "red", "green"), lwd=2, cex=0.7, legend=c("non weighted", "depth weighted", "volume weighted")) ## total sum over the whole water column vertmean(depth, pconc, level, top=0, bot=12, weight.vol, total=TRUE)
## define a bathymetric formula for a given lake or basin ## z: water depth (m below surface) ## zz: water column (m above ground) ## level: total water depth (m above ground or above reference level) weight.vol <- function(z, level) { zz <- level - z if (any(zz < 0)) stop("depth > maximum depth") vol <- 175947 * zz^2 + 2686 * zz^3 # m^3 } ## area is first derivative area <- function(z, level) { zz <- level - z A <- 0.5 * 175947 * zz + 1/3 * 2686 * zz^2 # m^2 } ## dummy formula for depth-weighted averaging ## (water column, instead of bathymetric curve) weight.column <- function(z, level) {z} ## Plot of lake volume (bathymetric curve) par(mfrow = c(1, 2)) z <- 0:12 V <- weight.vol(z, 12) plot(V, z, type = "l", ylim = c(12, 0), xlab = "Volume (m3)", ylab = "Depth (m)") polygon(c(V, 0), c(z, 0), col = "cyan") ## Test Data level <- 12 depth <- c(0, 1, 3.5, 5, 7, 10, 10.5, 11.5) pconc <- c(3.7, 4.2, 6.1, 8.9, 7.8, 9.7, 11.4, 11.4) ## Plot test data plot(pconc, depth, xlim=range(c(0, pconc)), ylim=c(12,0), type="n", xlab="P concentration (mu g / L)", ylab="Depth (m)") segments(rep(0, 13), depth, pconc, depth, lwd=3) ## simple means m <- mean(pconc[depth <= 4]) lines(c(m, m), c(0, 4), col="blue", lwd=2) m <- mean(pconc[depth >= 4]) lines(c(m, m), c(4, 12), col="blue", lwd=2) ## depth weighted m <- vertmean(depth, pconc, level, top=0, bot=4, weight.column) lines(c(m, m), c(0, 4), col="red", lwd=2) m <- vertmean(depth, pconc, level, top=4, bot=12, weight.column) lines(c(m, m), c(4, 12), col="red", lwd=2) ## volume weighted m <- vertmean(depth, pconc, level, top=0, bot=4, weight.vol) lines(c(m, m), c(0, 4), col="green", lwd=2) m <- vertmean(depth, pconc, level, top=4, bot=12, weight.vol) lines(c(m, m), c(4, 12), col="green", lwd=2) m <- vertmean(depth, pconc, level, top=4, bot=12, weight.vol) lines(c(m, m), c(4, 12), col="green", lwd=2) legend("topright", col=c("blue", "red", "green"), lwd=2, cex=0.7, legend=c("non weighted", "depth weighted", "volume weighted")) ## total sum over the whole water column vertmean(depth, pconc, level, top=0, bot=12, weight.vol, total=TRUE)
Calculates the shear viscosity of water, in centipoise (g/m/sec).
Valid for 0 < t < 30 C, 0 < S < 36, 1
< P < 1000 bars.
Based on the code "CANDI" by B.P. Boudreau
viscosity(S = 35, t = 25, P = 1.013253)
viscosity(S = 35, t = 25, P = 1.013253)
S |
salinity, -, |
t |
temperature, |
P |
True pressure, bar. |
The details given in the original code by B. Boudreau are repeated here:
Uses the equation given by Kukulka et al. (1987).
Shear visocisity in centipoise.
Karline Soetaert <[email protected]>
Based on the FORTRAN implementation of the diagenetic model "CANDI" of B.P. Boudreau:
Boudreau BP, 1996. A method-of-lines code for carbon and nutrient diagenesis in aquatic sediments. Computers & Geosciences 22 (5), 479-496.
Kulkula DJ, Gebhart B and Mollendorf JC, 1987. Thermodynamic and transport properties of pure and saline water. Adv. Heat transfer 18, 325-363.
coriolis
,
diffcoeff
, ssd2rad
, vertmean
,
gravity
plot(0:30, viscosity(t = 0:30, S = 35, P = 1), xlab = "temperature", ylab = "g/m/s", main = "shear viscosity of water", type = "l") lines(0:30, viscosity(t = 0:30, S = 0, P = 1), col = "red") lines(0:30, viscosity(t = 0:30, S = 35, P = 100), col = "blue") legend("topright", col = c("black","red","blue"), lty = 1, legend = c("S=35, P=1", "S=0, P=1", "S=35, P=100"))
plot(0:30, viscosity(t = 0:30, S = 35, P = 1), xlab = "temperature", ylab = "g/m/s", main = "shear viscosity of water", type = "l") lines(0:30, viscosity(t = 0:30, S = 0, P = 1), col = "red") lines(0:30, viscosity(t = 0:30, S = 35, P = 100), col = "blue") legend("topright", col = c("black","red","blue"), lty = 1, legend = c("S=35, P=1", "S=0, P=1", "S=35, P=100"))