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, |
20 |
end |
end |
21 |
if krd > 0, |
if krd > 0, |
22 |
%- define list of fields to read in: |
%- define list of fields to read in: |
|
clear listV ; |
|
23 |
%listV={'Eta','U','V','W','T','S','DETADT2','RELHUM','Phi'}; |
%listV={'Eta','U','V','W','T','S','DETADT2','RELHUM','Phi'}; |
24 |
listV={'Eta','W','T','S','CONVADJ','DETADT2'}; |
%listV={'Eta','W','T','S','CONVADJ','DETADT2'}; |
25 |
%listV={'Eta','UE_VEL_C','VN_VEL_C','W','T','DETADT2','Phi'}; |
%listV={'Eta','UE_VEL_C','VN_VEL_C','W','T','DETADT2','Phi'}; |
26 |
%- or take all them: |
%- or take all them: |
27 |
%clear listV ; listV='all_flds'; |
clear listV ; listV='all_flds'; |
28 |
%----------- |
%----------- |
29 |
|
|
30 |
%- start to read the longest record: |
%- start to read the longest record: |
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; |
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)]); |
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 |
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/3600; titT='hrs'; ttA=ttA/24; titT='days'; |
70 |
|
ttA=ttA/30 ; titT='month'; ttA=ttA/12 ; titT='year'; |
71 |
end |
end |
72 |
%========================================================= |
%========================================================= |
73 |
|
|
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 |
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, |
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 |
%========================================================= |
%========================================================= |