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

Annotation of /MITgcm_contrib/gael/matlab_class/gcmfaces_convert/convert2pcol_ll.m

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


Revision 1.2 - (hide 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 gforget 1.1 function [X,Y,FLD]=convert2pcol_ll(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     global regularizeXC;
15     if isempty(regularizeXC);
16     fprintf('\n\nconvert2pcol_ll.m init: by default gcmfaces assumes\n');
17     fprintf(' that XC is longitude in the [-180 180] range, and \n');
18     fprintf(' if XC shows values outside this range, gcmfaces \n');
19     fprintf(' will to enforce this convention in graphs. If this is \n');
20     fprintf(' inadequate, you may try to set regularizeXC to 0 below \n\n');
21     regularizeXC=1;
22     end;
23    
24     %ASSEMBLE "LATLON" FACES:
25     %----------------------
26     X=x{1}; Y=y{1}; FLD=fld{1}(:,:,k3,k4);
27    
28     %FIX DATE CHANGE LINE IN LATLON PART:
29     %--------------------------------------
30     if regularizeXC;
31     ii=max(find(X(:,1)<=180));
32     X=circshift(X,[-ii 0]); X(X>180)=X(X>180)-360;
33     Y=circshift(Y,[-ii 0]);
34     FLD=circshift(FLD,[-ii 0]);
35     end;
36    

  ViewVC Help
Powered by ViewVC 1.1.22