--- MITgcm_contrib/enderton/Diagnostics/DiagPlot.m 2005/04/29 17:34:39 1.5 +++ MITgcm_contrib/enderton/Diagnostics/DiagPlot.m 2005/08/10 19:58:03 1.6 @@ -42,14 +42,16 @@ ntrl = length(page{inrow}); if ntrl ~= 1, ntrl = ntrl - 1; end if ntrl == 1, cmp = 'Sep'; else, cmp = page{inrow}{end}; end - if ntrl == 1, ncol = 1; elseif cmp == 'Sbs', ncol = ntrl; else ncol = 1; end + if ntrl == 1, ncol = 1; elseif isequal(cmp,'Sbs'), ncol = ntrl; else ncol = 1; end dx = (1-dxl-dxr-(ncol-1)*dxm)/ncol; dy = (1-dyb-dyt-(nrow-1)*dym)/nrow; for incol = 1:ncol - if size(data{inrow}{incol}) == [6*hres,hres], isCS = 1; else, isCS = 0; end + % Very crude test to see if cube sphere, must be fixed! + test = size(data{inrow}{incol}); + if test(1)./test(2) == 6, isCS = 1; else, isCS = 0; end fln = page{inrow}{incol}{ifln}; pst = page{inrow}{incol}{ipst}; flu = page{inrow}{incol}{iflu}; @@ -75,17 +77,19 @@ '; Cmp: ',cmp]); % Load contour intervals, units (loaded in 'DiagFieldParam[A,O]'). - try, contint; catch - try, eval(['contint = ',fln,'contour',flu,';']); - catch, disp(['***Warning*** No contour information for ',fln]); - disp([' Using 10 generic contour levels.']); - contint = 10; end, end + if ~isequal(cmp,'Dif') + try, contint; catch + try, eval(['contint = ',fln,'contour',flu,';']); + catch, disp(['***Warning*** No contour information for ',fln]); + disp([' Using 10 generic contour levels.']); + contint = 10; end, end + end try, units; catch try, eval(['units = ',fln,'units',flu,';']); catch, disp(['***Warning*** No unit information found for ',fln]); disp([' Using question mark.']); units = '?'; end, end - + xi = dxl + (incol-1)*(dx+dxm); yi = 1-dyt-inrow*dy-(inrow-1)*dym; @@ -109,7 +113,7 @@ DiagPlotResetAxes; DiagPlotMisc; DiagPlotTitles; - clear contint units + clear contint units crange end end