1 |
gforget |
1.1 |
function [X,Y,FLD]=convert2pcol_llpc(x,y,fld,varargin); |
2 |
gforget |
1.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 |
gforget |
1.1 |
|
12 |
gforget |
1.2 |
k3=1; k4=1; |
13 |
gforget |
1.1 |
|
14 |
|
|
%ASSEMBLE "LATLON" FACES: |
15 |
|
|
%---------------------- |
16 |
|
|
X=[x{1};x{2};sym_g(x{3},7,0); sym_g(x{4},7,0)]; |
17 |
|
|
Y=[y{1};y{2};sym_g(y{3},7,0); sym_g(y{4},7,0)]; |
18 |
|
|
FLD=[fld{1}(:,:,k3,k4);fld{2}(:,:,k3,k4);sym_g(fld{3}(:,:,k3,k4),7,0);sym_g(fld{4}(:,:,k3,k4),7,0)]; |
19 |
|
|
|
20 |
|
|
%FIX DATE CHANGE LINE IN LATLON PART: |
21 |
|
|
%-------------------------------------- |
22 |
|
|
X=circshift(X,[55 0]); |
23 |
|
|
Y=circshift(Y,[55 0]); |
24 |
|
|
FLD=circshift(FLD,[55 0]); |
25 |
|
|
|
26 |
|
|
%ADD POINTS TO FIX DATE CHANGE LINE ELSEWHERE: |
27 |
|
|
%--------------------------------------------- |
28 |
|
|
X=[X(353:end,:);X;X(1:32,:)]; |
29 |
|
|
Y=[Y(353:end,:);Y;Y(1:32,:)]; |
30 |
|
|
FLD=[FLD(353:end,:);FLD;FLD(1:32,:)]; |
31 |
|
|
|
32 |
|
|
tmp1=X(1:64,:); tmp1(tmp1>0)=tmp1(tmp1>0)-360; X(1:64,:)=tmp1; |
33 |
|
|
tmp1=X(353:end,:); tmp1(tmp1<0)=tmp1(tmp1<0)+360; X(353:end,:)=tmp1; |
34 |
|
|
|
35 |
|
|
|