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

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

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

revision 1.5 by molod, Fri Apr 29 17:34:39 2005 UTC revision 1.7 by enderton, Tue Sep 13 19:32:03 2005 UTC
# Line 42  for inrow = 1:nrow Line 42  for inrow = 1:nrow
42            
43      ntrl = length(page{inrow}); if ntrl ~= 1, ntrl = ntrl - 1; end      ntrl = length(page{inrow}); if ntrl ~= 1, ntrl = ntrl - 1; end
44      if ntrl == 1, cmp = 'Sep'; else, cmp = page{inrow}{end}; end      if ntrl == 1, cmp = 'Sep'; else, cmp = page{inrow}{end}; end
45      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
46            
47      dx = (1-dxl-dxr-(ncol-1)*dxm)/ncol;      dx = (1-dxl-dxr-(ncol-1)*dxm)/ncol;
48      dy = (1-dyb-dyt-(nrow-1)*dym)/nrow;      dy = (1-dyb-dyt-(nrow-1)*dym)/nrow;
49            
50      for incol = 1:ncol      for incol = 1:ncol
51                    
52          if size(data{inrow}{incol}) == [6*hres,hres], isCS = 1; else, isCS = 0; end          if ~isequal(data{inrow}{incol},'Empty')
         fln = page{inrow}{incol}{ifln};  
         pst = page{inrow}{incol}{ipst};  
         flu = page{inrow}{incol}{iflu};  
53                    
54          % Set panel settings to default values, override with optional              % Very crude test to see if cube sphere, must be fixed!
55          % settings.              test = size(data{inrow}{incol});
56          DiagPlotDefaults;              if test(1)./test(2) == 6, isCS = 1; else, isCS = 0; end
57                  ExpInfo = page{inrow}{incol};              fln = page{inrow}{incol}{ifln};
58                  for iarg = 14:2:length(ExpInfo)              pst = page{inrow}{incol}{ipst};
59              if ~ismember(ExpInfo{iarg},diagrunparam)              flu = page{inrow}{incol}{iflu};
60                  ivalue=ExpInfo{iarg+1};              
61                  if isstr(ivalue), fvalue=['''',ivalue,''''];              % Set panel settings to default values, override with optional
62                  elseif prod(size(ivalue))>1, fvalue=mat2str(ivalue);              % settings.
63                  else fvalue=num2str(ivalue); end              DiagPlotDefaults;
64                  evalexpr = [ExpInfo{iarg},'=',fvalue,';'];                          ExpInfo = page{inrow}{incol};
65                  if DiagDebug, disp(['  Optional plot parameter evaluation:  ',evalexpr]); end                          for iarg = 14:2:length(ExpInfo)
66                  eval(evalexpr);                  if ~ismember(ExpInfo{iarg},diagrunparam)
67              end                      ivalue=ExpInfo{iarg+1};
68                  end                      if isstr(ivalue), fvalue=['''',ivalue,''''];
69                                elseif prod(size(ivalue))>1, fvalue=mat2str(ivalue);
70          disp(['  Row: ',num2str(inrow),'/',num2str(nrow),...                      else fvalue=num2str(ivalue); end
71                '; Col: ',num2str(incol),'/',num2str(ncol),...                      evalexpr = [ExpInfo{iarg},'=',fvalue,';'];
72                '; Cmp: ',cmp]);                      if DiagDebug, disp(['  Optional plot parameter evaluation:  ',evalexpr]); end
73                                eval(evalexpr);
74          % Load contour intervals, units (loaded in 'DiagFieldParam[A,O]').                  end
75          try, contint; catch                          end
76              try, eval(['contint = ',fln,'contour',flu,';']);              
77              catch, disp(['***Warning***  No contour information for ',fln]);              disp(['  Row: ',num2str(inrow),'/',num2str(nrow),...
78                     disp(['               Using 10 generic contour levels.']);                    '; Col: ',num2str(incol),'/',num2str(ncol),...
79                     contint = 10; end, end                    '; Cmp: ',cmp]);
80          try, units; catch              
81              try, eval(['units = ',fln,'units',flu,';']);              % Load contour intervals, units (loaded in
82              catch, disp(['***Warning***  No unit information found for ',fln]);              % 'DiagFieldParam[A,O]').
83                     disp(['               Using question mark.']);              if ~isequal(cmp,'Dif')
84                     units = '?'; end, end                  try, contint; catch
85                              try, eval(['contint = ',fln,'contour',flu,';']);
86          xi = dxl + (incol-1)*(dx+dxm);                      catch, disp(['***Warning***  No contour information for ',fln]);
87          yi = 1-dyt-inrow*dy-(inrow-1)*dym;                             disp(['               Using 10 generic contour levels.']);
88                                       contint = 10; end, end
89          isp = (inrow-1)*ncol+incol;              else, try, contint; catch, contint = 10; end, end
90          if DiagDebug, disp(['  DiagDebug:  Subplot:  ',mat2str([nrow,ncol,isp])]); end              try, units; catch
91          if DiagDebug, disp(['  DiagDebug:  SP Range: ',mat2str([xi,yi,dx,dy])]); end                  try, eval(['units = ',fln,'units',flu,';']);
92          subplot(nrow,ncol,isp); hold on;                  catch, disp(['***Warning***  No unit information found for ',fln]);
93          set(gca,'position',[xi,yi,dx,dy],'fontsize',fs_axis);                         disp(['               Using question mark.']);
94                                   units = '?'; end, end
95          if Coast              
96              fac = pi./180;              xi = dxl + (incol-1)*(dx+dxm);
97              xax{inrow}{incol} = xax{inrow}{incol}.*fac;              yi = 1-dyt-inrow*dy-(inrow-1)*dym;
98              yax{inrow}{incol} = yax{inrow}{incol}.*fac;              
99          else, fac = 1; end              isp = (inrow-1)*ncol+incol;
100                        if DiagDebug, disp(['  DiagDebug:  Subplot:  ',mat2str([nrow,ncol,isp])]); end
101          % (Re)set axes and color axis -- Accounts for things like a possible              if DiagDebug, disp(['  DiagDebug:  SP Range: ',mat2str([xi,yi,dx,dy])]); end
102          % colorbar, or trimming the axis in certain ways.              subplot(nrow,ncol,isp); hold on;
103          % Apply desired colorbar, contour label, tick labels, box, grid, and              set(gca,'position',[xi,yi,dx,dy],'fontsize',fs_axis);
104          % other such odds and ends.              
105          DiagPlotMakePlot;              if Coast
106          DiagPlotResetAxes;                  fac = pi./180;
107          DiagPlotMisc;                  xax{inrow}{incol} = xax{inrow}{incol}.*fac;
108          DiagPlotTitles;                  yax{inrow}{incol} = yax{inrow}{incol}.*fac;
109          clear contint units              else, fac = 1; end
110                
111                % (Re)set axes and color axis -- Accounts for things like a possible
112                % colorbar, or trimming the axis in certain ways.
113                % Apply desired colorbar, contour label, tick labels, box, grid, and
114                % other such odds and ends.
115                DiagPlotMakePlot;
116                DiagPlotResetAxes;
117                DiagPlotMisc;
118                DiagPlotTitles;
119                clear contint units crange
120            end
121      end      end
122  end  end
123    

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

  ViewVC Help
Powered by ViewVC 1.1.22