/[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.7 by gmaze, Wed Sep 19 15:37:38 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 38  filSALTa = strcat(netcdf_SALTanom,'.',ne Line 38  filSALTa = strcat(netcdf_SALTanom,'.',ne
38    
39  %% Path and extension to find them:  %% Path and extension to find them:
40  pathname = strcat('netcdf-files',sla,snapshot);  pathname = strcat('netcdf-files',sla,snapshot);
41    %pathname = '.';
42  ext      = strcat('.',netcdf_suff);  ext      = strcat('.',netcdf_suff);
43    
44  %% Load netcdf files:  %% Load netcdf files:
# Line 159  close(nc); Line 160  close(nc);
160    
161    
162  % Output:  % Output:
163    output = struct('RHO',RHO,'dpt',dpt,'lat',lat,'lon',lon);
164  switch nargout  switch nargout
165   case 1   case 1
166    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;  
167  end  end

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

  ViewVC Help
Powered by ViewVC 1.1.22