Home > air_sea > sw_tcond.m

sw_tcond

PURPOSE ^

SW_TCOND thermal conductivity

SYNOPSIS ^

function tcond = sw_tcond(S,T,P)

DESCRIPTION ^

 SW_TCOND   thermal conductivity 
===========================================================================
 SW_TCOND  $Revision: 0.0 $  $Date: 1998/01/19 $
           Copyright (C) Ayal Anis 1998. 

 USAGE:  tcond = sw_tcond(S,T,P) 

 DESCRIPTION:
    Calculates thermal conductivity of sea-water. 
    Two options (Note: one option has to be remarked): 
    1) based on Caldwell's DSR 21:131-137 (1974)  EQN. 9
    2) based on Catelli et al.'s DSR 21:311-3179(1974)  EQN. 5

 INPUT:  (all must have same dimensions)
   S  = salinity    [psu      (PSS-78) ]
   T  = temperature [degree C (IPTS-68)]
   P  = pressure    [db]
       (P may have dims 1x1, mx1, 1xn or mxn for S(mxn) )

 OUTPUT:
   tcond = thermal conductivity of sea-water [W/m/K] 

   tcond(35,20,0)=0.5972

 DISCLAIMER:
   This software is provided "as is" without warranty of any kind.  
=========================================================================

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function tcond = sw_tcond(S,T,P)
0002 
0003 % SW_TCOND   thermal conductivity
0004 %===========================================================================
0005 % SW_TCOND  $Revision: 0.0 $  $Date: 1998/01/19 $
0006 %           Copyright (C) Ayal Anis 1998.
0007 %
0008 % USAGE:  tcond = sw_tcond(S,T,P)
0009 %
0010 % DESCRIPTION:
0011 %    Calculates thermal conductivity of sea-water.
0012 %    Two options (Note: one option has to be remarked):
0013 %    1) based on Caldwell's DSR 21:131-137 (1974)  EQN. 9
0014 %    2) based on Catelli et al.'s DSR 21:311-3179(1974)  EQN. 5
0015 %
0016 % INPUT:  (all must have same dimensions)
0017 %   S  = salinity    [psu      (PSS-78) ]
0018 %   T  = temperature [degree C (IPTS-68)]
0019 %   P  = pressure    [db]
0020 %       (P may have dims 1x1, mx1, 1xn or mxn for S(mxn) )
0021 %
0022 % OUTPUT:
0023 %   tcond = thermal conductivity of sea-water [W/m/K]
0024 %
0025 %   tcond(35,20,0)=0.5972
0026 %
0027 % DISCLAIMER:
0028 %   This software is provided "as is" without warranty of any kind.
0029 %=========================================================================
0030 
0031 % CALLER:  general purpose
0032 % CALLEE:  none
0033 
0034 %----------------------
0035 % CHECK INPUT ARGUMENTS
0036 %----------------------
0037 if nargin ~= 3
0038    error('sw_tcond.m: Must pass 3 parameters ')
0039 end 
0040 
0041 % CHECK S,T,P dimensions and verify consistent
0042 [ms,ns] = size(S);
0043 [mt,nt] = size(T);
0044 [mp,np] = size(P);
0045 
0046   
0047 % CHECK THAT S & T HAVE SAME SHAPE
0048 if (ms~=mt) | (ns~=nt)
0049    error('check_stp: S & T must have same dimensions')
0050 end %if
0051 
0052 % CHECK OPTIONAL SHAPES FOR P
0053 if     mp==1  & np==1      % P is a scalar.  Fill to size of S
0054    P = P(1)*ones(ms,ns);
0055 elseif np==ns & mp==1      % P is row vector with same cols as S
0056    P = P( ones(1,ms), : ); %   Copy down each column.
0057 elseif mp==ms & np==1      % P is column vector
0058    P = P( :, ones(1,ns) ); %   Copy across each row
0059 elseif mp==ms & np==ns     % P is a matrix size(S)
0060    % shape ok
0061 else
0062    error('check_stp: P has wrong dimensions')
0063 end %if
0064 [mp,np] = size(P);
0065  
0066 
0067 % IF ALL ROW VECTORS ARE PASSED THEN LET US PRESERVE SHAPE ON RETURN.
0068 Transpose  = 0;
0069 if mp == 1  % row vector
0070    P       =  P(:);
0071    T       =  T(:);
0072    S       =  S(:);   
0073 
0074    Transpose = 1;
0075 end
0076 
0077 %------
0078 % BEGIN
0079 %------
0080 
0081 % 1) Caldwell's option # 2 - simplified formula, accurate to 0.5% (eqn. 9)
0082 tcond1 = 0.001365*(1+0.003*T-1.025e-5*T.^2+0.0653*(1e-4*P)-0.00029*S); % [cal/cm/C/sec]
0083 tcond = tcond1*418.4; % [cal/cm/C/sec] ->[W/m/K]
0084 
0085 % 2) Castelli's option
0086 %tcond2 = 100*(5.5286e-3+3.4025e-8*P+1.8364e-5*T-3.3058e-9*T.^3); % [W/m/K]
0087 %tcond = tcond2 % [W/m/K]
0088 
0089 if Transpose
0090    tcond  = tcond';
0091 end
0092 
0093 return      
0094 %=========================================================================
0095

Generated on Thu 26-Apr-2007 12:23:13 by m2html © 2003