1 |
function [] = merccube(XX,YY,C) |
function [] = merccube(XX,YY,C) |
2 |
% merccube(xg,yg,c) |
% merccube(x,y,c) |
3 |
% |
% |
4 |
% Plots cubed-sphere data in mercator projection. (xg,yg) are grid-corners |
% Plots cubed-sphere data in mercator projection. (x,y) are |
5 |
% coordinates, c is cell-centered scalar to be plotted. |
% coordinates, c is cell-centered scalar to be plotted. |
6 |
|
% All arrays (x,y,c) should have dimensions of NxNx6 or 6NxN. |
7 |
|
% |
8 |
|
% The default plotting mode is shading faceted. Using this or |
9 |
|
% shading flat, (x,y) should be the coordinates of grid-corners |
10 |
|
% and can legitimately have dimension (N+1)x(N+1)x6. |
11 |
|
% |
12 |
|
% If using shading interp, then (x,y) must be the coordinates of |
13 |
|
% the cell centers. |
14 |
% |
% |
15 |
% e.g. |
% e.g. |
16 |
% |
% |
19 |
% ps=rdmds('Eta.0000000000'); |
% ps=rdmds('Eta.0000000000'); |
20 |
% mercube(xg,yg,ps); |
% mercube(xg,yg,ps); |
21 |
% colorbar;xlabel('Longitude');ylabel('Latitude'); |
% colorbar;xlabel('Longitude');ylabel('Latitude'); |
22 |
|
% |
23 |
|
% xc=rdmds('XC'); |
24 |
|
% yc=rdmds('YC'); |
25 |
|
% mercube(xc,yc,ps);shading interp |
26 |
|
|
27 |
if max(max(max(YY)))-min(min(min(YY))) < 3*pi |
if max(max(max(YY)))-min(min(min(YY))) < 3*pi |
28 |
X=XX*180/pi; |
X=XX*180/pi; |
34 |
Q=C; |
Q=C; |
35 |
|
|
36 |
if ndims(X)==2 & size(X,1)==6*size(X,2) |
if ndims(X)==2 & size(X,1)==6*size(X,2) |
|
disp('1'); |
|
37 |
[nx ny nt]=size(X); |
[nx ny nt]=size(X); |
38 |
X=permute( reshape(X,[nx/6 6 ny]),[1 3 2]); |
X=permute( reshape(X,[nx/6 6 ny]),[1 3 2]); |
39 |
Y=permute( reshape(Y,[nx/6 6 ny]),[1 3 2]); |
Y=permute( reshape(Y,[nx/6 6 ny]),[1 3 2]); |
52 |
end |
end |
53 |
|
|
54 |
if size(X,1)==size(Q,1) |
if size(X,1)==size(Q,1) |
|
whos |
|
55 |
X(end+1,:,:)=NaN; |
X(end+1,:,:)=NaN; |
56 |
X(:,end+1,:)=NaN; |
X(:,end+1,:)=NaN; |
57 |
X(end,:,[1 3 5])=X(1,:,[2 4 6]); |
X(end,:,[1 3 5])=X(1,:,[2 4 6]); |