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

Diff of /MITgcm_contrib/gmaze_pv/A_compute_potential_density.m

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

revision 1.4 by gmaze, Tue Jan 30 22:10:10 2007 UTC revision 1.5 by gmaze, Thu Feb 1 17:02:02 2007 UTC
# Line 1  Line 1 
1  %  %
2  % [ST,LON,LAT,DPT] = A_compute_potential_density(SNAPSHOT)  % [ST] = A_compute_potential_density(SNAPSHOT)
3  %  %
4  % For a time snapshot, this program computes the  % For a time snapshot, this program computes the
5  % 3D potential density from potential temperature and salinity.  % 3D potential density from potential temperature and salinity.
# Line 20  Line 20 
20  %  %
21    
22        
23  function A_compute_potential_density(snapshot)  function varargout = A_compute_potential_density(snapshot)
24    
25    
26  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Line 155  nc{ncid}.uniquename    = ncchar(uniquena Line 155  nc{ncid}.uniquename    = ncchar(uniquena
155  nc{ncid}(:,:,:)        = SIGMATHETA;  nc{ncid}(:,:,:)        = SIGMATHETA;
156    
157  nc=close(nc);  nc=close(nc);
158    close(ncTHETA);
159    close(ncSALTa);
160    
161    % Outputs:
162  % Output:  output = struct('SIGMATHETA',SIGMATHETA,'dpt',dpt,'lat',lat,'lon',lon);
163  switch nargout  switch nargout
164   case 1   case 1
165    varargout(1) = SIGMATHETA;    varargout(1) = {output};
  case 2  
   varargout(1) = SIGMATHETA;  
   varargout(2) = lon;  
  case 3  
   varargout(1) = SIGMATHETA;  
   varargout(2) = lon;  
   varargout(3) = lat;  
  case 4  
   varargout(1) = SIGMATHETA;  
   varargout(2) = lon;  
   varargout(3) = lat;  
   varargout(4) = dpt;  
166  end  end

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

  ViewVC Help
Powered by ViewVC 1.1.22