/[MITgcm]/MITgcm_contrib/jmc_script/read_StD.m
ViewVC logotype

Diff of /MITgcm_contrib/jmc_script/read_StD.m

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

revision 1.1 by jmc, Thu Mar 1 04:35:35 2007 UTC revision 1.4 by jmc, Thu Oct 9 01:09:48 2008 UTC
# Line 1  Line 1 
1  function [nIt,rList,tim,vvA,listV]=read_StD(namF,sufx,listV);  function [nIt,rList,tim,vvA,listV,kList]=read_StD(namF,sufx,listV);
2  % [nIt,rList,tim,vvA,listV]=read_StD(namF,sufx,listV);  % [nIt,rList,tim,vvA,listV,kList]=read_StD(namF,sufx,listV);
3  %  %
4  % read ASCII stat-Diags output files (after splitted by script extract_StD)  % read ASCII stat-Diags output files (after splitted by script extract_StD)
5  %  %
# Line 11  function [nIt,rList,tim,vvA,listV]=read_ Line 11  function [nIt,rList,tim,vvA,listV]=read_
11  %  rList    = list of region number  %  rList    = list of region number
12  %  tim(:,1) = iterations number ; tim(:,2) = time in simulation  %  tim(:,1) = iterations number ; tim(:,2) = time in simulation
13  %  listV    = list of fields  %  listV    = list of fields
14    %  kList    = list of levels number
15  %  vvA      = 5 dims output array:  %  vvA      = 5 dims output array:
16  %           ( kLev, time_rec, region_rec, [ave,std,min,max,vol], var_rec )  %           ( kLev, time_rec, region_rec, [ave,std,min,max,vol], var_rec )
17    
18  % $Header$  % $Header$
19  % $Name$  % $Name$
20    
21    %- Remove insignificant whitespace:
22    %sufx=strtrim(char(sufx)); % <-- only with matlab-7 or more recent
23    sufx=strrep(char(sufx),' ','');
24  namfhd=[namF,'_head','.',sufx];  namfhd=[namF,'_head','.',sufx];
25  namfil=[namF,'_Iter','.',sufx];  namfil=[namF,'_Iter','.',sufx];
26   fprintf(['read ',sufx,' :']);   fprintf(['read ',sufx,' :']);
# Line 67  end Line 71  end
71  fclose(fid);  fclose(fid);
72  if rf > 0,  if rf > 0,
73  %- rename fields (consistent with script "extract_StD"):  %- rename fields (consistent with script "extract_StD"):
74     listV=strrep(listV,'ETAN', 'Eta'); listV=strrep(listV,'ETANSQ','Et2');     for j=1:rf,
75     listV=strrep(listV,'THETA' ,'T');  listV=strrep(listV,'SALT'  ,'S');       var1=char(listV(j));
76     listV=strrep(listV,'UVEL'  ,'U');  listV=strrep(listV,'VVEL'  ,'V');       switch var1
77     listV=strrep(listV,'WVEL'  ,'W');  listV=strrep(listV,'PHIHYD','Phi');       case 'ETAN'    ,  var2='Eta';
78     listV=strrep(listV,'UVELSQ','U2'); listV=strrep(listV,'VVELSQ','V2');       case 'ETANSQ'  ,  var2='Et2';
79         case 'THETA'   ,  var2='T';
80         case 'SALT'    ,  var2='S';
81         case 'UVEL'    ,  var2='U';
82         case 'VVEL'    ,  var2='V';
83         case 'WVEL'    ,  var2='W';
84         case 'PHIHYD'  ,  var2='Phi';
85         case 'UVELSQ'  ,  var2='U2';
86         case 'VVELSQ'  ,  var2='V2';
87         case 'WVELSQ'  ,  var2='W2';
88         case 'THETASQ' ,  var2='T2';
89         otherwise     var2=var1;
90         end
91         listV(j)=cellstr(var2);
92         if strcmp(var1,var2), fprintf(' %s\n',var2);
93              else fprintf(' %s --> %s\n',var1,var2); end
94       end
95    %  listV
96  end  end
97  if flag ~= 0 | k > 0, frq,rList,kList, end  if flag ~= 0 | k > 0, frq,rList,kList, end
98  if flag ~= 0, error(['not normal end after reading ',int2str(l),' lines']); end  if flag ~= 0, error(['not normal end after reading ',int2str(l),' lines']); end

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.22