--- MITgcm_contrib/enderton/Diagnostics/DiagSlice.m 2005/02/02 15:38:21 1.2 +++ MITgcm_contrib/enderton/Diagnostics/DiagSlice.m 2005/07/05 18:57:48 1.5 @@ -1,6 +1,6 @@ function [data,xax,yax,pltslc] = ... DiagSlice(data,fln,trl,dat,dad,grd,itr,tst,flu,ddf,gdf,... - avg,slc,pst,LoadGridData,GridSuffix,ZcordFile); + avg,slc,pst,LoadGridData,GridSuffix,ZcordFile,Vector,FieldName); % Function: DiagSlice % Author: Daniel Enderton @@ -53,7 +53,7 @@ % since those handle the cubed sphere data. If the 'pst' is 'Con' or 'Cnf', % convert data to a lat-lon grid so that it can easily be contours. if isequal(slc,'Sur') - if ismember(fln,{'TX','TY','USTR','VSTR'}) + if ismember(fln,{'TX','TY','USTR','VSTR'}) | ~isequal(Vector,0) data = data'; xax = XL; yax = YL; elseif ~isequal(datasize,[faces*hres,hres]) error('Incorrect dimensions for slc: ',slc); @@ -90,6 +90,7 @@ elseif isequal(slc,'Zon') if isequal(datasize(1:2),[faces*hres,hres]) if isequal(flu,'O'), nBas = 0; end + if isequal(flu,'A'), nBas = 0; end [data,dump1,dump2] = ... calc_ZonAv_CS(data,kpr,kwr,nBas,XC,YC,XG,YG,RAC,dad,HFacC); if isequal(avg,'Tse') @@ -102,12 +103,10 @@ data=data(:,:,1)'; xax=Ylat; yax=ZC; pltslc='lathgt'; end elseif isequal(datasize(1:2),[length(XL),length(YL)]) - if ismember(fln,{'U','V','uVel','vVel'}) + if ~isequal(pst,'Lin') 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'; else - error(['Unknown field for U,V type zonal average data: ',fln]); + data = squeeze(mean(data,1))'; xax=YL; yax=NaN; pltslc='latfld'; end else error('Incorrect dimensions for slc = ''Zon'''); @@ -150,7 +149,7 @@ elseif isequal(slc(1:2),'k=') kk = str2num(slc(3:end)); data = squeeze(data(:,:,kk)); - if ismember(fln,{'U','V','uVel','vVel'}) + if ismember(fln,{'U','V','uVel','vVel','fizhi_U','fizhi_V'}) data = data'; xax = XL; yax = YL; elseif ismember(pst,{'Grd','Int'}) if isequal(pst,'Grd'), @@ -187,4 +186,4 @@ catch disp(['***Warning*** No range information found for ',fln]); disp([' Data range: ',mat2str(datarange)]); -end \ No newline at end of file +end