NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/gliderproc/trunk/MATLAB/seawater/sw_satAr.m

Revision 495 (checked in by cbc, 12 years ago)

Initial import of Stark code.

Line 
1 %$$$
2 %$$$ #undef __PR
3 %$$$ #include "VARIANT.h"
4
5 function c = sw_satAr(S,T)
6
7 % SW_SATAr   Satuaration of Ar in sea water
8 %=========================================================================
9 % sw_satAr $Id: sw_satAr.m,v 1.1 2003/12/12 04:23:22 pen078 Exp $
10 %          Copyright (C) CSIRO, Phil Morgan 1998.
11 %
12 % USAGE:  satAr = sw_satAr(S,T)
13 %
14 % DESCRIPTION:
15 %    Solubility (satuaration) of Argon (Ar) in sea water
16 %
17 % INPUT:  (all must have same dimensions)
18 %   S = salinity    [psu      (PSS-78)]
19 %   T = temperature [degree C (ITS-90)]
20 %
21 % OUTPUT:
22 %   satAr = solubility of Ar  [ml/l]
23 %
24 % AUTHOR:  Phil Morgan 97-11-05, Lindsay Pender (Lindsay.Pender@csiro.au)
25 %
26 %$$$ #include "disclaimer_in_code.inc"
27 %
28 % REFERENCES:
29 %    Weiss, R. F. 1970
30 %    "The solubility of nitrogen, oxygen and argon in water and seawater."
31 %    Deap-Sea Research., 1970, Vol 17, pp721-735.
32 %=========================================================================
33
34 % Modifications
35 % 99-06-25. Lindsay Pender, Fixed transpose of row vectors.
36 % 03-12-12. Lindsay Pender, Converted to ITS-90.
37
38 % CALLER: general purpose
39 % CALLEE:
40
41 %$$$ #ifdef VARIANT_PRIVATE
42 %$$$ %***********************************************************
43 %$$$ %
44 %$$$ %$Log: sw_satAr.m,v $
45 %$$$ %Revision 1.1  2003/12/12 04:23:22  pen078
46 %$$$ %*** empty log message ***
47 %$$$ %
48
49 %$$$ %
50 %$$$ %***********************************************************
51 %$$$ #endif
52
53 %----------------------
54 % CHECK INPUT ARGUMENTS
55 %----------------------
56 if nargin ~=2
57    error('Must pass 2 parameters')
58 end %if
59
60 % CHECK S,T dimensions and verify consistent
61 [ms,ns] = size(S);
62 [mt,nt] = size(T);
63
64
65 % CHECK THAT S & T HAVE SAME SHAPE
66 if (ms~=mt) | (ns~=nt)
67    error('S & T must have same dimensions')
68 end %if
69
70 %------
71 % BEGIN
72 %------
73
74 % convert T to Kelvin
75 T = 273.15 + T * 1.00024;
76
77 % constants for Eqn (4) of Weiss 1970
78 a1 = -173.5146;
79 a2 =  245.4510;
80 a3 =  141.8222;
81 a4 =  -21.8020;
82 b1 =   -0.034474;
83 b2 =    0.014934;
84 b3 =   -0.0017729;
85
86 % Eqn (4) of Weiss 1970
87 lnC = a1 + a2.*(100./T) + a3.*log(T./100) + a4.*(T./100) + ...
88       S.*( b1 + b2.*(T./100) + b3.*((T./100).^2) );
89
90 c = exp(lnC);
91
92 return
93
94
Note: See TracBrowser for help on using the browser.