--- MITgcm_contrib/jmc_script/grph_StD.m 2013/09/27 23:11:26 1.4 +++ MITgcm_contrib/jmc_script/grph_StD.m 2017/08/23 22:17:40 1.10 @@ -1,17 +1,17 @@ prefix='dynStD'; - namA={'r16b','r17a'}; -%namA={'r17a'}; +%prefix='iceStD'; + namA={'g02','b02'}; +%namA={'r17a'}; Nexp=size(namA,2); %- -%namA(2)={'r16a'}; -% $Header: /home/ubuntu/mnt/e9_copy/MITgcm_contrib/jmc_script/grph_StD.m,v 1.4 2013/09/27 23:11:26 jmc Exp $ +% $Header: /home/ubuntu/mnt/e9_copy/MITgcm_contrib/jmc_script/grph_StD.m,v 1.10 2017/08/23 22:17:40 jmc Exp $ % $Name: $ - nItMx=1e10*ones(1,Nexp); %nItMx(3)=11; -nItMx=2400*ones(1,Nexp); +%nItMx=2400*ones(1,Nexp); namLg=namA ; namLg=strrep(namLg,'_','\_'); +undef=123456.7; %----------- %- test if the variable krd is define : if size(who('krd'),1) > 0, @@ -57,7 +57,7 @@ fprintf('save to "sav_StD.mat" file ...'); save('sav_StD.mat','vvA','tiA','ntA','rList','listV'); fprintf(' done\n') - end + end elseif krd < 0, fprintf('load from "sav_StD.mat" file ...'); load sav_StD @@ -83,12 +83,13 @@ %-- list_on=zeros(1,nbV); -nbG=8; +nbG=18; nbG=min(nbG,nbV); list_on(1:nbG)=1 ; +%if nbG < nbV, list_on=0; list_on(nbG:nbV)=1; end %- to get 2nd set of plots %list_on(1:6)=[1 1 1 1 1 1]; isA=ones(1,Nexp); ieA=ntA; -%- limit the length : for search of isA <->1500y: find(ttA(:,2) == 1500) +%- limit the length : for search of isA <->1500y: find(ttA(:,2) == 1500) %isA=isA*31 ; % drop the 1rst mnth (1 Monitor/d) isA=isA*2 ; % drop the 1rst mnth (1 Monitor/30d) %isA(1)=31 ; isA(2)=4 ; % drop the 1rst mnth @@ -102,32 +103,39 @@ linA(6,:)='c-'; ieA=min(ieA,nItMx); -%titall='AIM , Cubic-G (32x32) , cpl-FM Forcing' ; +%titall='AIM , Cubic-G (32x32) , cpl-FM Forcing' ; titall='Global Ocean, Cubic-G (32x32) , CORE Forc (2)' ; %titall='Dyncore test-case 5 (cs-32)' ; %========================================================= - -for ng=1:nbV, +ng=0; fxb=100; fyb=60; fdx=100; fdy=40; fsc=1.; +%fyb=-360; fxb=-2600; fdy=60; fsc=1.5; + +for jv=1:nbV, %------------------- - flag=list_on(ng); kl=0; - vv1=vvA(:,:,:,:,ng,:); namV=char(listV(ng)); + flag=list_on(jv); kl=0; + vv1=vvA(:,:,:,:,jv,:); namV=char(listV(jv)); titv=strrep(namV,'_','\_'); %if strcmp(namV,'Eta'), vv1=vv1/100; titv='Eta [mb]'; end %if strcmp(namV,'T'), kl=1; end % <-- to get surf.Temp -%if ng == 1, flag=2*list_on(1) ; end if kl > 0, titv=[titv,'\_',int2str(kl)]; fprintf([' var= ',namV,' at level k= %i \n'],kl); end if flag == 1 %-- - figure(ng); set(ng,'position',[100+100*ng 60+40*ng 500 700]);clf; + ng=ng+1; +%- reset "ng" to jv for fix fig number (independent of which one is in list_on): + %ng=jv; + figure(ng); set(ng,'position',[fxb+fdx*ng fyb+fdy*ng [500 700]*fsc]);clf; var=squeeze(vv1(1+kl,:,1,:,:)); dd=zeros(5,Nexp); av=zeros(5,Nexp); for n=1:Nexp, - dd(:,n)=max(var(isA(n):ieA(n),:,n))-min(var(isA(n):ieA(n),:,n)); - av(:,n)=mean(var(isA(n):ieA(n),:,n)); + tmp=var(isA(n):ieA(n),:,n); [I]=find(tmp(:,1)==undef); tmp(I,:)=0; + av(:,n)=sum(tmp); + if length(I) < size(tmp,1), av(:,n)=av(:,n)/(size(tmp,1)-length(I)); end + tmp(I,:)=NaN; dd(:,n)=max(tmp)-min(tmp); end + var(find(var==undef))=NaN; for nv=1:4, subplot(410+nv); ttmn=' Mx-mn:'; ttav=' Av:'; for n=1:Nexp, @@ -142,7 +150,8 @@ axis(AA); grid ; if nv == 1, title(['Avr ',titv,' ',ttmn]); end if nv == 2, title(['Std-Dev ',titv,' ',ttav]); end - if nv == 3, title(['min ',titv,' ',ttav]); legend(namLg,0); end + if nv == 3, title(['min ',titv,' ',ttav]); + legend(namLg,'Location','best'); end if nv == 4, title(['Max ',titv,' ',ttav]); end end ; xlabel(titT); %-- @@ -151,10 +160,10 @@ set(T,'HorizontalAlignment','center','FontSize',12); Td=text(0.99,0.01,date); set(Td,'HorizontalAlignment','right','FontSize',6); -%--- +%--- end -%------------------- +%------------------- end %=========================================================