1 |
|
---|
2 |
function S = sw_salt(cndr,T,P) |
---|
3 |
|
---|
4 |
% SW_SALT Salinity from cndr, T, P |
---|
5 |
%========================================================================= |
---|
6 |
% SW_SALT $Id: sw_salt.m,v 1.2 2004/03/18 20:27:03 pen078 Exp $ |
---|
7 |
% Copyright (C) CSIRO, Phil Morgan 1993. |
---|
8 |
% |
---|
9 |
% USAGE: S = sw_salt(cndr,T,P) |
---|
10 |
% |
---|
11 |
% DESCRIPTION: |
---|
12 |
% Calculates Salinity from conductivity ratio. UNESCO 1983 polynomial. |
---|
13 |
% |
---|
14 |
% INPUT: |
---|
15 |
% cndr = Conductivity ratio R = C(S,T,P)/C(35,15(IPTS-68),0) [no units] |
---|
16 |
% T = temperature [degree C (ITS-90)] |
---|
17 |
% P = pressure [db] |
---|
18 |
% |
---|
19 |
% OUTPUT: |
---|
20 |
% S = salinity [psu (PSS-78)] |
---|
21 |
% |
---|
22 |
% AUTHOR: Phil Morgan 93-04-17, Lindsay Pender (Lindsay.Pender@csiro.au) |
---|
23 |
% |
---|
24 |
% DISCLAIMER: |
---|
25 |
% This software is provided "as is" without warranty of any kind. |
---|
26 |
% See the file sw_copy.m for conditions of use and licence. |
---|
27 |
% |
---|
28 |
% REFERENCES: |
---|
29 |
% Fofonoff, P. and Millard, R.C. Jr |
---|
30 |
% Unesco 1983. Algorithms for computation of fundamental properties of |
---|
31 |
% seawater, 1983. _Unesco Tech. Pap. in Mar. Sci._, No. 44, 53 pp. |
---|
32 |
%========================================================================= |
---|
33 |
|
---|
34 |
% Modifications |
---|
35 |
% 03-12-12. Lindsay Pender, Converted to ITS-90. |
---|
36 |
|
---|
37 |
% CALLER: general purpose |
---|
38 |
% CALLEE: sw_sals.m sw_salrt.m sw_salrp.m |
---|
39 |
|
---|
40 |
|
---|
41 |
%---------------------------------- |
---|
42 |
% CHECK INPUTS ARE SAME DIMENSIONS |
---|
43 |
%---------------------------------- |
---|
44 |
[mc,nc] = size(cndr); |
---|
45 |
[mt,nt] = size(T); |
---|
46 |
[mp,np] = size(P); |
---|
47 |
|
---|
48 |
if ~(mc==mt | mc==mp | nc==nt | nc==np) |
---|
49 |
error('sw_salt.m: cndr,T,P must all have the same dimensions') |
---|
50 |
end %if |
---|
51 |
|
---|
52 |
%------- |
---|
53 |
% BEGIN |
---|
54 |
%------- |
---|
55 |
R = cndr; |
---|
56 |
rt = sw_salrt(T); |
---|
57 |
Rp = sw_salrp(R,T,P); |
---|
58 |
Rt = R./(Rp.*rt); |
---|
59 |
S = sw_sals(Rt,T); |
---|
60 |
|
---|