/[MITgcm]/MITgcm_contrib/gael/matlab_class/gcmfaces_convert/convert2pcol_llpc.m
ViewVC logotype

Contents of /MITgcm_contrib/gael/matlab_class/gcmfaces_convert/convert2pcol_llpc.m

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


Revision 1.2 - (show annotations) (download)
Wed Jun 22 02:13:46 2011 UTC (14 years, 1 month ago) by gforget
Branch: MAIN
CVS Tags: checkpoint65x, checkpoint65r, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, HEAD
Changes since 1.1: +10 -2 lines
- convert2pcol.m and convert2vector.m : as done earlier for convert2array.m,
	simplify the logic, add help section, move routines to gcmfaces_convert
- convert2pcol_cube.m etc., line_greatC_TUV_MASKS_v3, input_list_check.m : update accordingly

1 function [X,Y,FLD]=convert2pcol_llpc(x,y,fld,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 k3=1; k4=1;
13
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

  ViewVC Help
Powered by ViewVC 1.1.22