Skip to contents

Compute the seawater speed of sound.

Usage

swSoundSpeed(
  salinity,
  temperature = NULL,
  pressure = NULL,
  longitude = NULL,
  latitude = NULL,
  eos = getOption("oceEOS", default = "gsw")
)

Arguments

salinity

either practical salinity (in which case temperature and pressure must be provided) or an oce object, in which case salinity, temperature (in the ITS-90 scale; see next item), etc. are inferred from the object, ignoring the other parameters, if they are supplied.

temperature

in-situ temperature (\(^\circ\)C), defined on the ITS-90 scale. This scale is used by GSW-style calculation (as requested by setting eos="gsw"), and is the value contained within ctd objects (and probably most other objects created with data acquired in the past decade or two). Since the UNESCO-style calculation is based on IPTS-68, the temperature is converted within the present function, using T68fromT90().

pressure

pressure (dbar)

longitude

longitude of observation (only used if eos="gsw"; see “Details”).

latitude

latitude of observation (only used if eos="gsw"; see “Details”).

eos

equation of state, either "unesco" (references 1 and 2) or "gsw" (references 3 and 4).

Value

Sound speed (m/s).

Details

If eos="unesco", the sound speed is calculated using the formulation in section 9 of Fofonoff and Millard (1983). If eos="gsw", then the gsw::gsw_sound_speed() function from the gsw package is used.

References

Fofonoff, P. and R. C. Millard Jr, 1983. Algorithms for computation of fundamental properties of seawater. Unesco Technical Papers in Marine Science, 44, 53 pp. (See section 9.)

Author

Dan Kelley

Examples

swSoundSpeed(40, T90fromT68(40), 10000) # 1731.995 (p48 of Fofonoff + Millard 1983)
#> [1] 1731.995