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

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

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


Revision 1.1 - (show annotations) (download)
Mon Feb 2 22:02:34 2015 UTC (10 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
- routine to read meta file

1 function [meta]=rdmds_meta(fileName);
2
3 %read meta file
4 tmp1=dir([fileName '*.meta']); tmp1=tmp1(1).name;
5 tmp2=strfind(fileName,filesep);
6 if ~isempty(tmp2); tmp2=tmp2(end); else; tmp2=0; end;
7 tmp1=[fileName(1:tmp2) tmp1]; fid=fopen(tmp1);
8 while 1;
9 tline = fgetl(fid);
10 if ~ischar(tline), break, end
11 if isempty(whos('tmp3')); tmp3=tline; else; tmp3=[tmp3 ' ' tline]; end;
12 end
13 fclose(fid);
14
15 %add meta variables to workspace
16 eval(tmp3);
17
18 %reformat to meta structure
19 meta.dataprec=dataprec;
20 meta.nDims=nDims;
21 meta.nFlds=nFlds;
22 meta.nrecords=nrecords;
23 meta.fldList=fldList;
24 meta.dimList=dimList;
25 if ~isempty(who('timeInterval')); meta.timeInterval=timeInterval; end;
26 if ~isempty(who('timeStepNumber')); meta.timeStepNumber=timeStepNumber; end;
27

  ViewVC Help
Powered by ViewVC 1.1.22