/[MITgcm]/MITgcm_contrib/gmaze_pv/compute_density.m
ViewVC logotype

Diff of /MITgcm_contrib/gmaze_pv/compute_density.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.3 by gmaze, Tue Jan 30 22:10:10 2007 UTC revision 1.4 by gmaze, Thu Feb 1 17:02:02 2007 UTC
# Line 1  Line 1 
1  %  %
2  % [RHO,LON,LAT,DPT] = compute_density(SNAPSHOT)  % [RHO] = compute_density(SNAPSHOT)
3  %  %
4  % For a time snapshot, this program computes the  % For a time snapshot, this program computes the
5  % 3D density from potential temperature and salinity fields.  % 3D density from potential temperature and salinity fields.
# Line 21  Line 21 
21  %  %
22    
23        
24  function compute_density(snapshot)  function varargout = compute_density(snapshot)
25    
26    
27  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Line 159  close(nc); Line 159  close(nc);
159    
160    
161  % Output:  % Output:
162    output = struct('RHO',RHO,'dpt',dpt,'lat',lat,'lon',lon);
163  switch nargout  switch nargout
164   case 1   case 1
165    varargout(1) = RHO;    varargout(1) = {output};
  case 2  
   varargout(1) = RHO;  
   varargout(2) = lon;  
  case 3  
   varargout(1) = RHO;  
   varargout(2) = lon;  
   varargout(3) = lat;  
  case 4  
   varargout(1) = RHO;  
   varargout(2) = lon;  
   varargout(3) = lat;  
   varargout(4) = dpt;  
166  end  end

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.22