/[MITgcm]/MITgcm_contrib/enderton/Diagnostics/DiagSlice.m
ViewVC logotype

Diff of /MITgcm_contrib/enderton/Diagnostics/DiagSlice.m

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

revision 1.1 by enderton, Mon Jan 31 15:43:27 2005 UTC revision 1.5 by molod, Tue Jul 5 18:57:48 2005 UTC
# Line 1  Line 1 
1  function [data,xax,yax,pltslc] = ...  function [data,xax,yax,pltslc] = ...
2      DiagSlice(data,fln,exp,dat,dad,grd,itr,tst,...      DiagSlice(data,fln,trl,dat,dad,grd,itr,tst,flu,ddf,gdf,...
3                flu,ddf,gdf,avg,slc,pst,LoadGridData,GridSuffix,ZcordFile);                avg,slc,pst,LoadGridData,GridSuffix,ZcordFile,Vector,FieldName);
4    
5  % Function: DiagSlice  % Function: DiagSlice
6  % Author:   Daniel Enderton  % Author:   Daniel Enderton
# Line 53  datasize = size(data); Line 53  datasize = size(data);
53  % since those handle the cubed sphere data.  If the 'pst' is 'Con' or 'Cnf',  % since those handle the cubed sphere data.  If the 'pst' is 'Con' or 'Cnf',
54  % convert data to a lat-lon grid so that it can easily be contours.  % convert data to a lat-lon grid so that it can easily be contours.
55  if isequal(slc,'Sur')  if isequal(slc,'Sur')
56      if ismember(fln,{'TX','TY','USTR','VSTR'})      if ismember(fln,{'TX','TY','USTR','VSTR'}) | ~isequal(Vector,0)
57          data = data'; xax = XL; yax = YL;          data = data'; xax = XL; yax = YL;
58      elseif ~isequal(datasize,[faces*hres,hres])      elseif ~isequal(datasize,[faces*hres,hres])
59          error('Incorrect dimensions for slc:  ',slc);          error('Incorrect dimensions for slc:  ',slc);
# Line 90  if isequal(slc,'Sur') Line 90  if isequal(slc,'Sur')
90  elseif isequal(slc,'Zon')  elseif isequal(slc,'Zon')
91      if isequal(datasize(1:2),[faces*hres,hres])      if isequal(datasize(1:2),[faces*hres,hres])
92          if isequal(flu,'O'), nBas = 0; end          if isequal(flu,'O'), nBas = 0; end
93            if isequal(flu,'A'), nBas = 0; end
94              [data,dump1,dump2] = ...              [data,dump1,dump2] = ...
95                  calc_ZonAv_CS(data,kpr,kwr,nBas,XC,YC,XG,YG,RAC,dad,HFacC);                  calc_ZonAv_CS(data,kpr,kwr,nBas,XC,YC,XG,YG,RAC,dad,HFacC);
96          if isequal(avg,'Tse')          if isequal(avg,'Tse')
# Line 102  elseif isequal(slc,'Zon') Line 103  elseif isequal(slc,'Zon')
103              data=data(:,:,1)'; xax=Ylat;   yax=ZC;   pltslc='lathgt';              data=data(:,:,1)'; xax=Ylat;   yax=ZC;   pltslc='lathgt';
104          end          end
105      elseif isequal(datasize(1:2),[length(XL),length(YL)])      elseif isequal(datasize(1:2),[length(XL),length(YL)])
106          if ismember(fln,{'U','V','uVel','vVel'})          if ~isequal(pst,'Lin')
107              data = squeeze(mean(data,1))'; xax=YL; yax=ZC;  pltslc='lathgt';              data = squeeze(mean(data,1))'; xax=YL; yax=ZC;  pltslc='lathgt';
         elseif ismember(fln,{'TX','TY','USTR','VSTR'})  
             data = squeeze(mean(data,1))'; xax=YL; yax=NaN; pltslc='latfld';  
108          else          else
109              error(['Unknown field for U,V type zonal average data:  ',fln]);              data = squeeze(mean(data,1))'; xax=YL; yax=NaN; pltslc='latfld';
110          end          end
111      else      else
112          error('Incorrect dimensions for slc = ''Zon''');          error('Incorrect dimensions for slc = ''Zon''');
# Line 150  elseif isequal(slc(1:2),'j=') Line 149  elseif isequal(slc(1:2),'j=')
149  elseif isequal(slc(1:2),'k=')  elseif isequal(slc(1:2),'k=')
150      kk = str2num(slc(3:end));      kk = str2num(slc(3:end));
151      data = squeeze(data(:,:,kk));      data = squeeze(data(:,:,kk));
152      if ismember(fln,{'U','V','uVel','vVel'})      if ismember(fln,{'U','V','uVel','vVel','fizhi_U','fizhi_V'})
153          data = data'; xax = XL; yax = YL;          data = data'; xax = XL; yax = YL;
154      elseif ismember(pst,{'Grd','Int'})      elseif ismember(pst,{'Grd','Int'})
155          if isequal(pst,'Grd'),          if isequal(pst,'Grd'),
# Line 187  try Line 186  try
186  catch  catch
187      disp(['***Warning***  No range information found for ',fln]);      disp(['***Warning***  No range information found for ',fln]);
188      disp(['               Data range:  ',mat2str(datarange)]);      disp(['               Data range:  ',mat2str(datarange)]);
 end  
189    end

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

  ViewVC Help
Powered by ViewVC 1.1.22