wm_to_vol converts a water mass to a water volume. Requires temperature, salinity and atmospheric pressure. These are used to calculate the density, which is then used to convert the mass to volume.

wm_to_vol(mass, t, S, P)

Arguments

mass

numeric (kg). Water mass to convert to volume

t

numeric (°C). Temperature

S

numeric (ppt). Salinity

P

numeric (bar). Atmospheric pressure. Defaults to 1.013253

Inputs

Inputs must be in SI units:

  • mass in kg

  • t in °C

  • S in ppt

  • P in bar (Defaults to 1.013253)

Output

Output is a single numeric value for the water volume in L.

Examples

## Should return 0.9767414 wm_to_vol(mass = 1, t = 23, S = 35)
#> [1] 0.9767414