Sound speed in sea. Mackenzie equation

Mathematical definition

$$\boxed{\begin{array}{l} C\left( {T,S,D} \right) = 1448.96 + 4.591T - 5.304 \times {10^{ - 2}}{T^2} + 2.374 \times {10^{ - 4}}{T^3}\\ + 1.340\left( {S - 35} \right) + 1.630 \times {10^{ - 2}}D + 1.675 \times {10^{ - 7}}{D^2}\\ - 1.025 \times {10^{ - 2}}T\left( {S - 35} \right) - 7.139 \times {10^{ - 13}}T{D^3} \end{array}}$$

Notation Description Units Limits
$C$ sound speed $\text{m/s}$
$T$ temperature $^{\circ}\text{C}$ $-2 < T < 30$
$S$ salinity $\text{‰}$ $25 < S < 40$
$D$ depth $\text{m}$ $0 < D < 8000$

Octave/Matlab implementation

function C = sound_speed_sea_mackenzie(T,S,D)
% Inputs
%   T: temperature \ degree Celsius \ -2 < T < 30 
%   S: salinity \ ppt \ 25 < S < 40
%   D: depth \ m \ 0 < D < 8000
% Outputs
%   C: speed of sound in seawater \ m/s

    C = 1448.96 + 4.591*T - (5.304e-2)*(T.^2) + (2.374e-4)*(T.^3) ...
        + 1.340*(S-35) + (1.630e-2)*D + (1.675e-7)*(D.^2) ...
        - (1.025e-2)*T.*(S-35) - (7.139e-13)*T.*(D.^3);
end

Computational examples

$D$\$T$ $0°\text{C}$ $10°\text{C}$ $20°\text{C}$ $30°\text{C}$ $40°\text{C}$
$10\ \text{m}$ $1442.42$ $1483.78$ $1515.95$ $1540.36$ $1558.44$
$1000\ \text{m}$ $1458.73$ $1500.08$ $1532.24$ $1556.65$ $1574.72$
$2000\ \text{m}$ $1475.53$ $1516.83$ $1548.94$ $1573.30$ $1591.32$
$5000\ \text{m}$ $1527.95$ $1568.41$ $1599.69$ $1623.21$ $1640.40$

References

  1. Mackenzie, Kenneth V, "Nine‐term equation for sound speed in the oceans", 1981