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

Diff of /MITgcm_contrib/jmc_script/grph_StD.m

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

revision 1.4 by jmc, Fri Sep 27 23:11:26 2013 UTC revision 1.6 by jmc, Thu Mar 5 20:57:26 2015 UTC
# Line 1  Line 1 
1   prefix='dynStD';   prefix='dynStD';
2   namA={'r16b','r17a'};   namA={'g02','b02'};
3  %namA={'r17a'};  %namA={'r17a'};
4   Nexp=size(namA,2);   Nexp=size(namA,2);
5  %-  %-
 %namA(2)={'r16a'};  
6    
7  % $Header$  % $Header$
8  % $Name$  % $Name$
9    
   
10  nItMx=1e10*ones(1,Nexp); %nItMx(3)=11;  nItMx=1e10*ones(1,Nexp); %nItMx(3)=11;
11  nItMx=2400*ones(1,Nexp);  nItMx=2400*ones(1,Nexp);
12  namLg=namA ; namLg=strrep(namLg,'_','\_');  namLg=namA ; namLg=strrep(namLg,'_','\_');
13    undef=123456.7;
14  %-----------  %-----------
15  %- test if the variable krd is define :  %- test if the variable krd is define :
16  if size(who('krd'),1) > 0,  if size(who('krd'),1) > 0,
# Line 33  if krd > 0, Line 32  if krd > 0,
32    [ntA(n),rList,tim,vv1,listV] = ...    [ntA(n),rList,tim,vv1,listV] = ...
33      read_StD(prefix,namA(n),listV);      read_StD(prefix,namA(n),listV);
34    nIt=ntA(n); nk=size(vv1,1); nRg=size(vv1,3);    nIt=ntA(n); nk=size(vv1,1); nRg=size(vv1,3);
35      vv1(find(vv1==undef))=NaN;
36  %- set global dims: & load vvA --> vvB  %- set global dims: & load vvA --> vvB
37    nbV=size(listV,2);    nbV=size(listV,2);
38    nrec=nIt; n3d=nk; nReg=nRg;    nrec=nIt; n3d=nk; nReg=nRg;
# Line 43  if krd > 0, Line 43  if krd > 0,
43    [ntA(n),rList,tim,vv1,listV] = ...    [ntA(n),rList,tim,vv1,listV] = ...
44      read_StD(prefix,namA(n),listV);      read_StD(prefix,namA(n),listV);
45    nIt=ntA(n); nk=size(vv1,1); nRg=size(vv1,3);    nIt=ntA(n); nk=size(vv1,1); nRg=size(vv1,3);
46      vv1(find(vv1==undef))=NaN;
47    if (nrec < nIt),    if (nrec < nIt),
48      fprintf('\n');      fprintf('\n');
49      error([' Nb of records=',int2str(nIt),' exceeds nrec=',int2str(nrec)]);      error([' Nb of records=',int2str(nIt),' exceeds nrec=',int2str(nrec)]);
# Line 57  if krd > 0, Line 58  if krd > 0,
58     fprintf('save to "sav_StD.mat" file ...');     fprintf('save to "sav_StD.mat" file ...');
59     save('sav_StD.mat','vvA','tiA','ntA','rList','listV');     save('sav_StD.mat','vvA','tiA','ntA','rList','listV');
60     fprintf(' done\n')     fprintf(' done\n')
61   end   end
62  elseif krd < 0,  elseif krd < 0,
63   fprintf('load from "sav_StD.mat" file ...');   fprintf('load from "sav_StD.mat" file ...');
64   load sav_StD   load sav_StD
# Line 85  end; Line 86  end;
86  list_on=zeros(1,nbV);  list_on=zeros(1,nbV);
87  nbG=8;  nbG=8;
88  nbG=min(nbG,nbV); list_on(1:nbG)=1 ;  nbG=min(nbG,nbV); list_on(1:nbG)=1 ;
89    %if nbG < nbV, list_on=0; list_on(nbG:nbV)=1; end %- to get 2nd set of plots
90  %list_on(1:6)=[1 1 1 1 1 1];  %list_on(1:6)=[1 1 1 1 1 1];
91    
92  isA=ones(1,Nexp); ieA=ntA;  isA=ones(1,Nexp); ieA=ntA;
93  %- limit the length : for search of isA <->1500y: find(ttA(:,2) == 1500)  %- limit the length : for search of isA <->1500y: find(ttA(:,2) == 1500)
94  %isA=isA*31 ; % drop the 1rst mnth (1 Monitor/d)  %isA=isA*31 ; % drop the 1rst mnth (1 Monitor/d)
95  isA=isA*2 ; % drop the 1rst mnth (1 Monitor/30d)  isA=isA*2 ; % drop the 1rst mnth (1 Monitor/30d)
96  %isA(1)=31 ; isA(2)=4 ; % drop the 1rst mnth  %isA(1)=31 ; isA(2)=4 ; % drop the 1rst mnth
# Line 102  linA(5,:)='m-'; Line 104  linA(5,:)='m-';
104  linA(6,:)='c-';  linA(6,:)='c-';
105    
106  ieA=min(ieA,nItMx);  ieA=min(ieA,nItMx);
107  %titall='AIM , Cubic-G (32x32) , cpl-FM Forcing' ;  %titall='AIM , Cubic-G (32x32) , cpl-FM Forcing' ;
108  titall='Global Ocean, Cubic-G (32x32) , CORE Forc (2)' ;  titall='Global Ocean, Cubic-G (32x32) , CORE Forc (2)' ;
109  %titall='Dyncore test-case 5 (cs-32)' ;  %titall='Dyncore test-case 5 (cs-32)' ;
110    
111  %=========================================================  %=========================================================
112    
113  for ng=1:nbV,  ng=0;
114    for jv=1:nbV,
115  %-------------------  %-------------------
116   flag=list_on(ng); kl=0;   flag=list_on(jv); kl=0;
117   vv1=vvA(:,:,:,:,ng,:); namV=char(listV(ng));   vv1=vvA(:,:,:,:,jv,:); namV=char(listV(jv));
118   titv=strrep(namV,'_','\_');   titv=strrep(namV,'_','\_');
119  %if strcmp(namV,'Eta'), vv1=vv1/100; titv='Eta [mb]'; end  %if strcmp(namV,'Eta'), vv1=vv1/100; titv='Eta [mb]'; end
120  %if strcmp(namV,'T'), kl=1; end         % <-- to get surf.Temp  %if strcmp(namV,'T'), kl=1; end         % <-- to get surf.Temp
 %if ng == 1, flag=2*list_on(1) ; end  
121   if kl > 0, titv=[titv,'\_',int2str(kl)];   if kl > 0, titv=[titv,'\_',int2str(kl)];
122     fprintf([' var= ',namV,' at level k= %i \n'],kl);     fprintf([' var= ',namV,' at level k= %i \n'],kl);
123   end   end
124    
125   if flag == 1   if flag == 1
126  %--  %--
127      ng=ng+1;
128    %- reset "ng" to jv for fix fig number (independent of which one is in list_on):
129      %ng=jv;
130    figure(ng); set(ng,'position',[100+100*ng 60+40*ng 500 700]);clf;    figure(ng); set(ng,'position',[100+100*ng 60+40*ng 500 700]);clf;
131    var=squeeze(vv1(1+kl,:,1,:,:)); dd=zeros(5,Nexp); av=zeros(5,Nexp);    var=squeeze(vv1(1+kl,:,1,:,:)); dd=zeros(5,Nexp); av=zeros(5,Nexp);
132    for n=1:Nexp,    for n=1:Nexp,
# Line 151  for ng=1:nbV, Line 156  for ng=1:nbV,
156    set(T,'HorizontalAlignment','center','FontSize',12);    set(T,'HorizontalAlignment','center','FontSize',12);
157    Td=text(0.99,0.01,date);    Td=text(0.99,0.01,date);
158    set(Td,'HorizontalAlignment','right','FontSize',6);    set(Td,'HorizontalAlignment','right','FontSize',6);
159  %---  %---
160   end   end
161    
162  %-------------------  %-------------------
163  end  end
164    
165  %=========================================================  %=========================================================

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

  ViewVC Help
Powered by ViewVC 1.1.22