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

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

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


Revision 1.2 - (show annotations) (download)
Sat Jan 18 21:11:00 2014 UTC (11 years, 5 months 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: +4 -2 lines
- convert2array.m : hook to xtrct
- convert2array_llc.m : remove loops for speed up
- convert2pcol.m : hook to xtrct
- convert2pcol_cube.m, convert2pcol_llc.m :
  replicate field to facilitate Pacific centric maps

1 function [a]=convert2array(b,varargin);
2 %object: gcmfaces to array format conversion (if gcmfaces input)
3 % or: array to gcmfaces format conversion (if array input)
4 %
5 %notes: - if array input, the gcmfaces format will be the one of mygrid.XC, so
6 % the array input must have originally been created according to convert2array
7 % - global mygrid parameters (mygrid.XC.gridType) are used
8
9 input_list_check('convert2array',nargin);
10
11 gcmfaces_global;
12
13 if isfield(mygrid,'xtrct');
14 a=convert2array_xtrct(b);
15 elseif strcmp(mygrid.XC.gridType,'llc');
16 a=convert2array_llc(b);
17 elseif strcmp(mygrid.XC.gridType,'cube');
18 a=convert2array_cube(b);
19 elseif strcmp(mygrid.XC.gridType,'llpc');
20 a=convert2array_llpc(b);
21 elseif strcmp(mygrid.XC.gridType,'ll');
22 a=convert2array_ll(b);
23 else;
24 error(['convert2array not implemented for ' mygrid.XC.gridType '!?']);
25 end;
26

  ViewVC Help
Powered by ViewVC 1.1.22