| 1 | 
  prefix='stDiag'; | 
  prefix='dynStD'; | 
| 2 | 
  namA={'mG_2','vmUpW'};  | 
  namA={'r16b','r17a'};  | 
| 3 | 
 %namA=char{'r525','r526','r527','r528'};  | 
 %namA={'r17a'};  | 
| 4 | 
  Nexp=size(namA,2); | 
  Nexp=size(namA,2); | 
| 5 | 
 %- | 
 %- | 
| 6 | 
 %namA(2)={'r528'}; | 
 %namA(2)={'r16a'}; | 
| 7 | 
  | 
  | 
| 8 | 
 % $Header$ | 
 % $Header$ | 
| 9 | 
 % $Name$ | 
 % $Name$ | 
| 10 | 
  | 
  | 
| 11 | 
  | 
  | 
| 12 | 
 nItMx=1e10*ones(1,Nexp); %nItMx(3)=11; | 
 nItMx=1e10*ones(1,Nexp); %nItMx(3)=11; | 
| 13 | 
 %nItMx=60*ones(1,Nexp); | 
 nItMx=2400*ones(1,Nexp); | 
| 14 | 
 namLg=namA ; namLg=strrep(namLg,'_','\_'); | 
 namLg=namA ; namLg=strrep(namLg,'_','\_'); | 
| 15 | 
 %----------- | 
 %----------- | 
 | 
 %- ngEn = Nb of Energy plot: = 2 or = 4  ; | 
  | 
 | 
 ngEn=2; | 
  | 
| 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, | 
| 18 | 
  fprintf('krd is defined and = %i \n',krd); | 
  fprintf('krd is defined and = %i \n',krd); | 
| 21 | 
 end | 
 end | 
| 22 | 
 if krd > 0, | 
 if krd > 0, | 
| 23 | 
 %- define list of fields to read in: | 
 %- define list of fields to read in: | 
| 24 | 
  | 
  clear listV ; | 
| 25 | 
 %listV={'Eta','U','V','W','T','S','DETADT2','RELHUM','Phi'}; | 
 %listV={'Eta','U','V','W','T','S','DETADT2','RELHUM','Phi'}; | 
| 26 | 
 %listV={'Eta','U','V','W','T','S','CONVADJ','DETADT2'}; | 
  listV={'Eta','W','T','S','CONVADJ','DETADT2'}; | 
| 27 | 
 %listV={'Eta','UE_VEL_C','VN_VEL_C','W','T','DETADT2','Phi'}; | 
 %listV={'Eta','UE_VEL_C','VN_VEL_C','W','T','DETADT2','Phi'}; | 
| 28 | 
 %- or take all them: | 
 %- or take all them: | 
| 29 | 
  clear listV ; listV='all_flds'; | 
 %clear listV ; listV='all_flds'; | 
| 30 | 
 %----------- | 
 %----------- | 
| 31 | 
  | 
  | 
| 32 | 
 %- start to read the longest record: | 
 %- start to read the longest record: | 
| 66 | 
 end | 
 end | 
| 67 | 
 if krd ~= 0, | 
 if krd ~= 0, | 
| 68 | 
  ttA=squeeze(tiA(:,2,:)); | 
  ttA=squeeze(tiA(:,2,:)); | 
| 69 | 
  ttA=ttA/86400; titT='days'; %ttA=ttA/30 ; titT='month'; ttA=ttA/12 ; titT='year'; | 
  ttA=ttA/86400; titT='days'; ttA=ttA/30 ; titT='month'; ttA=ttA/12 ; titT='year'; | 
| 70 | 
 end | 
 end | 
| 71 | 
 %========================================================= | 
 %========================================================= | 
| 72 | 
  | 
  | 
| 90 | 
 isA=ones(1,Nexp); ieA=ntA; | 
 isA=ones(1,Nexp); ieA=ntA; | 
| 91 | 
 %- limit the length : for search of isA <->1500y: find(ttA(:,2) == 1500)  | 
 %- limit the length : for search of isA <->1500y: find(ttA(:,2) == 1500)  | 
| 92 | 
 %isA=isA*31 ; % drop the 1rst mnth (1 Monitor/d) | 
 %isA=isA*31 ; % drop the 1rst mnth (1 Monitor/d) | 
| 93 | 
 %isA=isA*36 ; % drop the 1rst year (1 Monitor/10d) | 
 isA=isA*2 ; % drop the 1rst mnth (1 Monitor/30d) | 
| 94 | 
 %isA(1)=31 ; isA(2)=4 ; % drop the 1rst mnth | 
 %isA(1)=31 ; isA(2)=4 ; % drop the 1rst mnth | 
| 95 | 
 %ieA(:)=360; isA(:)=1; | 
 %ieA(:)=240; %isA(:)=1; | 
| 96 | 
  | 
  | 
| 97 | 
 linA(1,:)='k-'; % ieA(1)=60 ; % ieA(1)=1152 ; | 
 linA(1,:)='k-'; % ieA(1)=60 ; % ieA(1)=1152 ; | 
| 98 | 
 linA(2,:)='b-'; | 
 linA(2,:)='b-'; | 
| 103 | 
  | 
  | 
| 104 | 
 ieA=min(ieA,nItMx); | 
 ieA=min(ieA,nItMx); | 
| 105 | 
 %titall='AIM , Cubic-G (32x32) , cpl-FM Forcing' ;  | 
 %titall='AIM , Cubic-G (32x32) , cpl-FM Forcing' ;  | 
| 106 | 
 titall='Global Ocean, Cubic-G (32x32) , NCEP Forc (2)' ; | 
 titall='Global Ocean, Cubic-G (32x32) , CORE Forc (2)' ; | 
| 107 | 
 %titall='Dyncore test-case 5 (cs-32)' ; | 
 %titall='Dyncore test-case 5 (cs-32)' ; | 
| 108 | 
  | 
  | 
| 109 | 
 %========================================================= | 
 %========================================================= | 
| 114 | 
  vv1=vvA(:,:,:,:,ng,:); namV=char(listV(ng)); | 
  vv1=vvA(:,:,:,:,ng,:); namV=char(listV(ng)); | 
| 115 | 
  titv=strrep(namV,'_','\_'); | 
  titv=strrep(namV,'_','\_'); | 
| 116 | 
 %if strcmp(namV,'Eta'), vv1=vv1/100; titv='Eta [mb]'; end | 
 %if strcmp(namV,'Eta'), vv1=vv1/100; titv='Eta [mb]'; end | 
| 117 | 
 %if strcmp(namV,'T'), kl=1; end | 
 %if strcmp(namV,'T'), kl=1; end         % <-- to get surf.Temp | 
| 118 | 
 %if ng == 1, flag=2*list_on(1) ; end | 
 %if ng == 1, flag=2*list_on(1) ; end | 
| 119 | 
  if kl > 0, titv=[titv,'\_',int2str(kl)]; | 
  if kl > 0, titv=[titv,'\_',int2str(kl)]; | 
| 120 | 
    fprintf([' var= ',namV,' at level k= %i \n'],kl); | 
    fprintf([' var= ',namV,' at level k= %i \n'],kl); | 
| 123 | 
  if flag == 1 | 
  if flag == 1 | 
| 124 | 
 %-- | 
 %-- | 
| 125 | 
   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; | 
| 126 | 
 % if ng == 2, var=squeeze(vv1(2,:,1,:,:)); end % to get surf.Temp | 
   var=squeeze(vv1(1+kl,:,1,:,:)); dd=zeros(5,Nexp); av=zeros(5,Nexp); | 
| 127 | 
   var=squeeze(vv1(1+kl,:,1,:,:)); | 
   for n=1:Nexp, | 
| 128 | 
   dd=squeeze(max(var)-min(var)); av=squeeze(mean(var)); | 
    dd(:,n)=max(var(isA(n):ieA(n),:,n))-min(var(isA(n):ieA(n),:,n)); | 
| 129 | 
    if Nexp == 1, av=av'; dd=dd'; end ; | 
    av(:,n)=mean(var(isA(n):ieA(n),:,n)); | 
| 130 | 
  | 
   end | 
| 131 | 
   for nv=1:4, | 
   for nv=1:4, | 
| 132 | 
     subplot(410+nv); ttmn=' Mx-mn:'; ttav=' Av:'; | 
     subplot(410+nv); ttmn=' Mx-mn:'; ttav=' Av:'; | 
| 133 | 
     for n=1:Nexp, | 
     for n=1:Nexp, |