/[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.9 by jmc, Sat Sep 10 22:05:35 2016 UTC
# Line 1  Line 1 
1   prefix='dynStD';   prefix='dynStD';
2   namA={'r16b','r17a'};  %prefix='iceStD';
3  %namA={'r17a'};   namA={'g02','b02'};
4    %namA={'r17a'};
5   Nexp=size(namA,2);   Nexp=size(namA,2);
6  %-  %-
 %namA(2)={'r16a'};  
7    
8  % $Header$  % $Header$
9  % $Name$  % $Name$
10    
   
11  nItMx=1e10*ones(1,Nexp); %nItMx(3)=11;  nItMx=1e10*ones(1,Nexp); %nItMx(3)=11;
12  nItMx=2400*ones(1,Nexp);  %nItMx=2400*ones(1,Nexp);
13  namLg=namA ; namLg=strrep(namLg,'_','\_');  namLg=namA ; namLg=strrep(namLg,'_','\_');
14    undef=123456.7;
15  %-----------  %-----------
16  %- test if the variable krd is define :  %- test if the variable krd is define :
17  if size(who('krd'),1) > 0,  if size(who('krd'),1) > 0,
# Line 57  if krd > 0, Line 57  if krd > 0,
57     fprintf('save to "sav_StD.mat" file ...');     fprintf('save to "sav_StD.mat" file ...');
58     save('sav_StD.mat','vvA','tiA','ntA','rList','listV');     save('sav_StD.mat','vvA','tiA','ntA','rList','listV');
59     fprintf(' done\n')     fprintf(' done\n')
60   end   end
61  elseif krd < 0,  elseif krd < 0,
62   fprintf('load from "sav_StD.mat" file ...');   fprintf('load from "sav_StD.mat" file ...');
63   load sav_StD   load sav_StD
# Line 83  end; Line 83  end;
83  %--  %--
84    
85  list_on=zeros(1,nbV);  list_on=zeros(1,nbV);
86  nbG=8;  nbG=18;
87  nbG=min(nbG,nbV); list_on(1:nbG)=1 ;  nbG=min(nbG,nbV); list_on(1:nbG)=1 ;
88    %if nbG < nbV, list_on=0; list_on(nbG:nbV)=1; end %- to get 2nd set of plots
89  %list_on(1:6)=[1 1 1 1 1 1];  %list_on(1:6)=[1 1 1 1 1 1];
90    
91  isA=ones(1,Nexp); ieA=ntA;  isA=ones(1,Nexp); ieA=ntA;
92  %- limit the length : for search of isA <->1500y: find(ttA(:,2) == 1500)  %- limit the length : for search of isA <->1500y: find(ttA(:,2) == 1500)
93  %isA=isA*31 ; % drop the 1rst mnth (1 Monitor/d)  %isA=isA*31 ; % drop the 1rst mnth (1 Monitor/d)
94  isA=isA*2 ; % drop the 1rst mnth (1 Monitor/30d)  isA=isA*2 ; % drop the 1rst mnth (1 Monitor/30d)
95  %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 103  linA(5,:)='m-';
103  linA(6,:)='c-';  linA(6,:)='c-';
104    
105  ieA=min(ieA,nItMx);  ieA=min(ieA,nItMx);
106  %titall='AIM , Cubic-G (32x32) , cpl-FM Forcing' ;  %titall='AIM , Cubic-G (32x32) , cpl-FM Forcing' ;
107  titall='Global Ocean, Cubic-G (32x32) , CORE Forc (2)' ;  titall='Global Ocean, Cubic-G (32x32) , CORE Forc (2)' ;
108  %titall='Dyncore test-case 5 (cs-32)' ;  %titall='Dyncore test-case 5 (cs-32)' ;
109    
110  %=========================================================  %=========================================================
111    ng=0; fxb=100; fyb=60; fdx=100; fdy=40; fsc=1.;
112  for ng=1:nbV,  %fyb=-360; fxb=-2600; fdy=60; fsc=1.5;
113    
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    figure(ng); set(ng,'position',[100+100*ng 60+40*ng 500 700]);clf;    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',[fxb+fdx*ng fyb+fdy*ng [500 700]*fsc]);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,
133     dd(:,n)=max(var(isA(n):ieA(n),:,n))-min(var(isA(n):ieA(n),:,n));     tmp=var(isA(n):ieA(n),:,n); [I]=find(tmp(:,1)==undef); tmp(I,:)=0;
134     av(:,n)=mean(var(isA(n):ieA(n),:,n));     av(:,n)=sum(tmp);
135       if length(I) < size(tmp,1), av(:,n)=av(:,n)/(size(tmp,1)-length(I)); end
136       tmp(I,:)=NaN; dd(:,n)=max(tmp)-min(tmp);
137    end    end
138      var(find(var==undef))=NaN;
139    for nv=1:4,    for nv=1:4,
140      subplot(410+nv); ttmn=' Mx-mn:'; ttav=' Av:';      subplot(410+nv); ttmn=' Mx-mn:'; ttav=' Av:';
141      for n=1:Nexp,      for n=1:Nexp,
# Line 151  for ng=1:nbV, Line 159  for ng=1:nbV,
159    set(T,'HorizontalAlignment','center','FontSize',12);    set(T,'HorizontalAlignment','center','FontSize',12);
160    Td=text(0.99,0.01,date);    Td=text(0.99,0.01,date);
161    set(Td,'HorizontalAlignment','right','FontSize',6);    set(Td,'HorizontalAlignment','right','FontSize',6);
162  %---  %---
163   end   end
164    
165  %-------------------  %-------------------
166  end  end
167    
168  %=========================================================  %=========================================================

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

  ViewVC Help
Powered by ViewVC 1.1.22