-
Notifications
You must be signed in to change notification settings - Fork 1
/
cMP81.m
28 lines (25 loc) · 1.1 KB
/
cMP81.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function [rho,rho_valid] = cMP81(T,S)
%cMP81 Seawater density / kg/m^3 at pressure = 1 atmosphere
% Standard error = 3.6e-3 kg/m^3
% Inputs: T (temperature / deg C), S (salinity)
% Valid ranges: 0 < T < 40 deg C & 0.5 < S < 43
% Source: Millero & Poisson, 1981, DSR-A 28(6).
% doi:10.1016/0198-0149(81)90122-9
% Written for MATLAB by Matthew P. Humphreys [2015-01-20]
rho = 999.842594 ...
+ 6.793952e-2 * T ...
- 9.095290e-3 * T.^2 ...
+ 1.001685e-4 * T.^3 ...
- 1.120083e-6 * T.^4 ...
+ 6.536336e-9 * T.^5 ...
+ ( 0.824493 ...
- 4.0899e-3 * T ...
+ 7.6438e-5 * T.^2 ...
- 8.2467e-7 * T.^3 ...
+ 5.3875e-9 * T.^4 ) .*S ...
+ ( - 5.72466e-3 ...
+ 1.0227e-4 * T ...
- 1.6546e-6 * T.^2 ) .*S.^1.5 ...
+ 4.8314e-4 .*S.^2 ;
rho_valid = T >= 0 & T <= 40 & S >= 0.5 & S <= 43;
end %function cMP81