/[MITgcm]/MITgcm_contrib/gael/matlab_class/gcmfaces_IO/rdmds2gcmfaces.m
ViewVC logotype

Contents of /MITgcm_contrib/gael/matlab_class/gcmfaces_IO/rdmds2gcmfaces.m

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


Revision 1.5 - (show annotations) (download)
Fri Mar 17 17:41:56 2017 UTC (8 years, 3 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint66f, checkpoint66e, checkpoint66o, HEAD
Changes since 1.4: +2 -2 lines
o grid_load_native.m
 - revise help section
 - add option to initialize hFacC etc. to 1 when called in stand-alone mode (i.e., with 3 arguments)
 - set gcm2facesFast,memoryLimit,facesExpand to false,0,[].
 - assign ioSize based on convert2gcmfaces(mygrid.XC) size (convert2gcmfaces now calls
   convert2array when fileFormat is 'native ') and facesSize based on mygrid.XC face sizes.
o rdmds2gcmfaces.m
 - allow for secondary output from rdmds.m
o write2nctiles.m
 - comment out definition of never-used itxt dimension (was copied from MITprof?)
o convert2gcmfaces.m
 - use convert2array convert2gcmfaces when mygrid.fileFormat is 'native'

1 function [fldOut,IT,M]=rdmds2gcmfaces(varargin);
2 %object: read with rmds then apply convert2gcmfaces
3 %input: varargin are the options to pass to rdmds (type help rdmds)
4 %output: fldOut is a gcmfaces object
5 %
6 %note: an earlier version was expecting nFaces to be passed
7 % as the last argument; this is not the case anymore.
8
9 gcmfaces_global;
10
11 [v0,IT,M]=rdmds(varargin{1:end});
12
13 nn=size(v0);
14 test1=isfield(mygrid,'xtrct');
15 test1=test1&(prod(mygrid.ioSize)~=prod(nn(1:2)));
16 if test1;
17 if length(nn)==2; nn=[nn 1]; end;
18 v0=reshape(v0,[nn(1)*nn(2) nn(3:end)]);
19 v0=v0(mygrid.xtrct_inFull,:,:,:);
20 v0=reshape(v0,[mygrid.ioSize nn(3:end)]);
21 end;
22
23 fldOut=convert2gcmfaces(v0);

  ViewVC Help
Powered by ViewVC 1.1.22