1 |
function [X,Y,FLD]=convert2pcol(varargin); |
2 |
%object: gcmfaces to 'pcolor format' conversion |
3 |
%inputs: x is longitude (e.g. mygrid.XC) |
4 |
% y is latitude (e.g. mygrid.YC) |
5 |
% fld is the 2D field of interest (e.g. mygrid.hFacC(:,:,1)) |
6 |
%outputs: X,Y,FLD are array versions of x,y,fld |
7 |
% |
8 |
%note: this function is designed so that one may readily |
9 |
% plot the output in geographic coordinates |
10 |
% using e.g. 'figure; pcolor(X,Y,FLD);' |
11 |
|
12 |
input_list_check('convert2pcol',nargin); |
13 |
|
14 |
gcmfaces_global; |
15 |
|
16 |
c=varargin{1}; |
17 |
|
18 |
if isfield(mygrid,'xtrct'); |
19 |
[X,Y,FLD]=convert2pcol_xtrct(varargin{:}); |
20 |
elseif strcmp(c.gridType,'llc'); |
21 |
[X,Y,FLD]=convert2pcol_llc(varargin{:}); |
22 |
elseif strcmp(c.gridType,'cube'); |
23 |
[X,Y,FLD]=convert2pcol_cube(varargin{:}); |
24 |
elseif strcmp(c.gridType,'llpc'); |
25 |
[X,Y,FLD]=convert2pcol_llpc(varargin{:}); |
26 |
elseif strcmp(c.gridType,'ll'); |
27 |
[X,Y,FLD]=convert2pcol_ll(varargin{:}); |
28 |
else; |
29 |
error(['convert2pcol not implemented for ' c.gridType '!?']); |
30 |
end; |
31 |
|