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

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

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


Revision 1.1 - (hide annotations) (download)
Wed Jun 22 02:13:46 2011 UTC (14 years, 1 month ago) by gforget
Branch: MAIN
CVS Tags: checkpoint65r, checkpoint65p, checkpoint65q, checkpoint65t
- 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 [a]=convert2vector(b);
2     %object: gcmfaces to vector format conversion (if gcmfaces input)
3     % or: vector to gcmfaces format conversion (if array input)
4     %
5     %notes: - if vector input, the gcmfaces format will be the one of mygrid.XC, so
6     % the vector input must have originally been created according to convert2vector
7     % - global mygrid parameters (mygrid.XC.gridType) are used
8    
9     global mygrid;
10    
11     if isa(b,'gcmfaces'); do_gcmfaces2vector=1; else; do_gcmfaces2vector=0; end;
12    
13     if do_gcmfaces2vector;
14     bb=convert2array(b);
15     a=bb(:);
16     else;
17     bb=convert2array(mygrid.XC);
18     if mod(length(b(:)),length(bb(:)))~=0;
19     error('vector length is inconsistent with gcmfaces objects');
20     else;
21     n3=length(b(:))/length(bb(:));
22     end;
23     b=reshape(b,[size(bb) n3]);
24     a=convert2array(b);
25     end;
26    
27    
28    

  ViewVC Help
Powered by ViewVC 1.1.22