1 | % |
---|
2 | |
---|
3 | % initialisation |
---|
4 | clear; |
---|
5 | close all; |
---|
6 | |
---|
7 | status=load('hgt500_afr.mat'); |
---|
8 | |
---|
9 | ncload('zg_d.AfNQIVIV.197106-09.nc'); |
---|
10 | |
---|
11 | % selction du domaine geographique |
---|
12 | hgt500b=zeros(122,29,64,128); |
---|
13 | hgt500b(:,:,:,1:64)=hgt500(:,:,:,65:128); |
---|
14 | hgt500b(:,:,:,65:128)=hgt500(:,:,:,1:64); |
---|
15 | clear hgt500; |
---|
16 | hgt500=hgt500b; |
---|
17 | clear hgt500b; |
---|
18 | |
---|
19 | % on desaisonalise |
---|
20 | hgt1=permute(hgt500,[2 1 3 4]); |
---|
21 | hgt2(:,:,:)=nanmean(hgt1); |
---|
22 | clear hgt1; |
---|
23 | hgt3=reshape(hgt500, 3538,64,128); |
---|
24 | hgt4(:,:)=nanmean(hgt3); |
---|
25 | clear hgt3; |
---|
26 | |
---|
27 | for a=1:122; |
---|
28 | for b=1:29; |
---|
29 | for c=1:37; |
---|
30 | for d=1:128; |
---|
31 | hgt500(a,b,c,d)=hgt500(a,b,c,d)-(hgt2(a,c,d)-hgt4(c,d)); |
---|
32 | end; |
---|
33 | end; |
---|
34 | end; |
---|
35 | end; |
---|
36 | clear hgt2 hgt4; |
---|
37 | |
---|
38 | status=load('eof2_AFR_1030.txt'); |
---|
39 | |
---|
40 | % on met sous la forme annee mois |
---|
41 | hgt500_eof=reshape(eof2_AFR_1030,122,29); |
---|
42 | clear eof2_AFR_1030; |
---|
43 | |
---|
44 | % on calcule l ecart type sur la serie temporelle de l HGT500 |
---|
45 | k=122*29; |
---|
46 | hgt500bis=reshape(hgt500_eof,k,1); |
---|
47 | hgt500bis=1.25*std(hgt500bis); |
---|
48 | |
---|
49 | % intialisation des tableaux |
---|
50 | hgt500_filtre_compomax=NaN*ones(50,31,64,128); |
---|
51 | hgt500_filtre_compomin=NaN*ones(50,31,64,128); |
---|
52 | |
---|
53 | compteurmax=0; |
---|
54 | compteurmin=0; |
---|
55 | |
---|
56 | % boucle sur les annees |
---|
57 | for a=1:29; |
---|
58 | clear delta; |
---|
59 | delta=zeros(122,1); |
---|
60 | % boucle sur les jours : on prepare avant |
---|
61 | for b=1:122; |
---|
62 | if b>1; |
---|
63 | delta(b)=hgt500_eof(b,a)-hgt500_eof(b-1,a); |
---|
64 | end; |
---|
65 | end; |
---|
66 | % boucle sur les jours |
---|
67 | for b=1:122; |
---|
68 | % 1ere condition (laisser une marge de 10) |
---|
69 | if (b>20 && b<112); |
---|
70 | % cas 1 : max deltas apres negetifs et deltas avant postifs |
---|
71 | if (delta(b+1)<0 && delta(b)<0 && delta(b-1)>0 && delta(b-2)>0 && hgt500_eof(b,a)>(hgt500bis)); |
---|
72 | compteurmax=compteurmax+1; |
---|
73 | hgt500_filtre_compomax(compteurmax,1,:,:)=hgt500(b-20,a,:,:); |
---|
74 | hgt500_filtre_compomax(compteurmax,2,:,:)=hgt500(b-19,a,:,:); |
---|
75 | hgt500_filtre_compomax(compteurmax,3,:,:)=hgt500(b-18,a,:,:); |
---|
76 | hgt500_filtre_compomax(compteurmax,4,:,:)=hgt500(b-17,a,:,:); |
---|
77 | hgt500_filtre_compomax(compteurmax,5,:,:)=hgt500(b-16,a,:,:); |
---|
78 | hgt500_filtre_compomax(compteurmax,6,:,:)=hgt500(b-15,a,:,:); |
---|
79 | hgt500_filtre_compomax(compteurmax,7,:,:)=hgt500(b-14,a,:,:); |
---|
80 | hgt500_filtre_compomax(compteurmax,8,:,:)=hgt500(b-13,a,:,:); |
---|
81 | hgt500_filtre_compomax(compteurmax,9,:,:)=hgt500(b-12,a,:,:); |
---|
82 | hgt500_filtre_compomax(compteurmax,10,:,:)=hgt500(b-11,a,:,:); |
---|
83 | |
---|
84 | hgt500_filtre_compomax(compteurmax,11,:,:)=hgt500(b-10,a,:,:); |
---|
85 | hgt500_filtre_compomax(compteurmax,12,:,:)=hgt500(b-9,a,:,:); |
---|
86 | hgt500_filtre_compomax(compteurmax,13,:,:)=hgt500(b-8,a,:,:); |
---|
87 | hgt500_filtre_compomax(compteurmax,14,:,:)=hgt500(b-7,a,:,:); |
---|
88 | hgt500_filtre_compomax(compteurmax,15,:,:)=hgt500(b-6,a,:,:); |
---|
89 | hgt500_filtre_compomax(compteurmax,16,:,:)=hgt500(b-5,a,:,:); |
---|
90 | hgt500_filtre_compomax(compteurmax,17,:,:)=hgt500(b-4,a,:,:); |
---|
91 | hgt500_filtre_compomax(compteurmax,18,:,:)=hgt500(b-3,a,:,:); |
---|
92 | hgt500_filtre_compomax(compteurmax,19,:,:)=hgt500(b-2,a,:,:); |
---|
93 | hgt500_filtre_compomax(compteurmax,20,:,:)=hgt500(b-1,a,:,:); |
---|
94 | |
---|
95 | hgt500_filtre_compomax(compteurmax,21,:,:)=hgt500(b,a,:,:); |
---|
96 | hgt500_filtre_compomax(compteurmax,22,:,:)=hgt500(b+1,a,:,:); |
---|
97 | hgt500_filtre_compomax(compteurmax,23,:,:)=hgt500(b+2,a,:,:); |
---|
98 | hgt500_filtre_compomax(compteurmax,24,:,:)=hgt500(b+3,a,:,:); |
---|
99 | hgt500_filtre_compomax(compteurmax,25,:,:)=hgt500(b+4,a,:,:); |
---|
100 | hgt500_filtre_compomax(compteurmax,26,:,:)=hgt500(b+5,a,:,:); |
---|
101 | hgt500_filtre_compomax(compteurmax,27,:,:)=hgt500(b+6,a,:,:); |
---|
102 | hgt500_filtre_compomax(compteurmax,28,:,:)=hgt500(b+7,a,:,:); |
---|
103 | hgt500_filtre_compomax(compteurmax,29,:,:)=hgt500(b+8,a,:,:); |
---|
104 | hgt500_filtre_compomax(compteurmax,30,:,:)=hgt500(b+9,a,:,:); |
---|
105 | hgt500_filtre_compomax(compteurmax,31,:,:)=hgt500(b+10,a,:,:); |
---|
106 | % cas 2 : min deltas apres positifs et deltas avant negatifs |
---|
107 | elseif (delta(b+1)>0 && delta(b)>0 && delta(b-1)<0 && delta(b-2)<0 && hgt500_eof(b,a)<(-hgt500bis)); |
---|
108 | compteurmin=compteurmin+1; |
---|
109 | |
---|
110 | hgt500_filtre_compomin(compteurmin,1,:,:)=hgt500(b-20,a,:,:); |
---|
111 | hgt500_filtre_compomin(compteurmin,2,:,:)=hgt500(b-19,a,:,:); |
---|
112 | hgt500_filtre_compomin(compteurmin,3,:,:)=hgt500(b-18,a,:,:); |
---|
113 | hgt500_filtre_compomin(compteurmin,4,:,:)=hgt500(b-17,a,:,:); |
---|
114 | hgt500_filtre_compomin(compteurmin,5,:,:)=hgt500(b-16,a,:,:); |
---|
115 | hgt500_filtre_compomin(compteurmin,6,:,:)=hgt500(b-15,a,:,:); |
---|
116 | hgt500_filtre_compomin(compteurmin,7,:,:)=hgt500(b-14,a,:,:); |
---|
117 | hgt500_filtre_compomin(compteurmin,8,:,:)=hgt500(b-13,a,:,:); |
---|
118 | hgt500_filtre_compomin(compteurmin,9,:,:)=hgt500(b-12,a,:,:); |
---|
119 | hgt500_filtre_compomin(compteurmin,10,:,:)=hgt500(b-11,a,:,:); |
---|
120 | |
---|
121 | hgt500_filtre_compomin(compteurmin,11,:,:)=hgt500(b-10,a,:,:); |
---|
122 | hgt500_filtre_compomin(compteurmin,12,:,:)=hgt500(b-9,a,:,:); |
---|
123 | hgt500_filtre_compomin(compteurmin,13,:,:)=hgt500(b-8,a,:,:); |
---|
124 | hgt500_filtre_compomin(compteurmin,14,:,:)=hgt500(b-7,a,:,:); |
---|
125 | hgt500_filtre_compomin(compteurmin,15,:,:)=hgt500(b-6,a,:,:); |
---|
126 | hgt500_filtre_compomin(compteurmin,16,:,:)=hgt500(b-5,a,:,:); |
---|
127 | hgt500_filtre_compomin(compteurmin,17,:,:)=hgt500(b-4,a,:,:); |
---|
128 | hgt500_filtre_compomin(compteurmin,18,:,:)=hgt500(b-3,a,:,:); |
---|
129 | hgt500_filtre_compomin(compteurmin,19,:,:)=hgt500(b-2,a,:,:); |
---|
130 | hgt500_filtre_compomin(compteurmin,20,:,:)=hgt500(b-1,a,:,:); |
---|
131 | |
---|
132 | hgt500_filtre_compomin(compteurmin,21,:,:)=hgt500(b,a,:,:); |
---|
133 | hgt500_filtre_compomin(compteurmin,22,:,:)=hgt500(b+1,a,:,:); |
---|
134 | hgt500_filtre_compomin(compteurmin,23,:,:)=hgt500(b+2,a,:,:); |
---|
135 | hgt500_filtre_compomin(compteurmin,24,:,:)=hgt500(b+3,a,:,:); |
---|
136 | hgt500_filtre_compomin(compteurmin,25,:,:)=hgt500(b+4,a,:,:); |
---|
137 | hgt500_filtre_compomin(compteurmin,26,:,:)=hgt500(b+5,a,:,:); |
---|
138 | hgt500_filtre_compomin(compteurmin,27,:,:)=hgt500(b+6,a,:,:); |
---|
139 | hgt500_filtre_compomin(compteurmin,28,:,:)=hgt500(b+7,a,:,:); |
---|
140 | hgt500_filtre_compomin(compteurmin,29,:,:)=hgt500(b+8,a,:,:); |
---|
141 | hgt500_filtre_compomin(compteurmin,30,:,:)=hgt500(b+9,a,:,:); |
---|
142 | hgt500_filtre_compomin(compteurmin,31,:,:)=hgt500(b+10,a,:,:); |
---|
143 | end; |
---|
144 | end; |
---|
145 | end; |
---|
146 | end; |
---|
147 | siz=122*29; |
---|
148 | hgt500=reshape(hgt500,siz,64,128); |
---|
149 | clear hgt |
---|
150 | hgt(:,:)=mean(hgt500); |
---|
151 | |
---|
152 | % on fait le test de Student |
---|
153 | nb_value=min(compteurmin,compteurmax); |
---|
154 | student1=zeros(31,64,128); |
---|
155 | for a=1:31; |
---|
156 | for b=1:64; |
---|
157 | for c=1:128; |
---|
158 | x=hgt500_filtre_compomin(1:nb_value,a,b,c); |
---|
159 | y=hgt500_filtre_compomax(1:nb_value,a,b,c); |
---|
160 | student1(a,b,c)=ttest(x,y,.1); |
---|
161 | end |
---|
162 | end |
---|
163 | end |
---|
164 | disp(['iii : compteurmin =', int2str(compteurmin)]); |
---|
165 | disp(['iii : compteurmax =', int2str(compteurmax)]); |
---|
166 | hgt500_filtre_compomin=hgt500_filtre_compomin(1:compteurmin,:,:,:); |
---|
167 | hgt500_filtre_compomax=hgt500_filtre_compomax(1:compteurmax,:,:,:); |
---|
168 | |
---|
169 | % on fait la somme des valeurs de hgt500_filtreentiel sur le nbre d occurences |
---|
170 | % on obtent un tableau de la forme (jours-avant-apres,lon,lat) |
---|
171 | hgt500_filtre_compomin1(:,:,:)=mean(hgt500_filtre_compomin); |
---|
172 | clear hgt500_filtre_compomin; |
---|
173 | hgt500_filtre_compomax1(:,:,:)=mean(hgt500_filtre_compomax); |
---|
174 | clear hgt500_filtre_compomax; |
---|
175 | |
---|
176 | x=[-10:1:10]'; |
---|
177 | |
---|
178 | figure(1); |
---|
179 | orient('landscape'); |
---|
180 | |
---|
181 | lat=lat'; |
---|
182 | lon=lon-180; |
---|
183 | for e=1:7; |
---|
184 | a=7-(e-1)+1; |
---|
185 | f=2*(a-1)+1; |
---|
186 | clear delta_hgt500_filtre_min; |
---|
187 | delta_hgt500_filtre_min=zeros(64,128); |
---|
188 | for b=1:64; |
---|
189 | for c=1:128; |
---|
190 | % delta_hgt500_filtre_min(b,c)=hgt500_filtre_compomin1(f,b,c)-hgt500_filtre_compomax1(f,b,c); |
---|
191 | % delta_hgt500_filtre_min(b,c)=-(hgt500_filtre_compomax1(f,b,c)-hgt(b,c)); |
---|
192 | delta_hgt500_filtre_min(b,c)=hgt500_filtre_compomin1(f,b,c)-hgt(b,c); |
---|
193 | if student1(f,b,c)==1; |
---|
194 | delta_hgt500_filtre_min(b,c)=delta_hgt500_filtre_min(b,c); |
---|
195 | else |
---|
196 | % delta_hgt500_filtre_min(b,c)=NaN; |
---|
197 | end; |
---|
198 | end; |
---|
199 | end; |
---|
200 | for b=1:64; |
---|
201 | for c=1:128; |
---|
202 | if delta_hgt500_filtre_min(b,c)<-50; |
---|
203 | delta_hgt500_filtre_min(b,c)=-50; |
---|
204 | elseif delta_hgt500_filtre_min(b,c)>50; |
---|
205 | delta_hgt500_filtre_min(b,c)=50; |
---|
206 | end; |
---|
207 | end; |
---|
208 | end |
---|
209 | subplot(7,1,8-e); |
---|
210 | palettecomplet |
---|
211 | delta_hgt500_filtre_min(1,1)=-50.0001; |
---|
212 | delta_hgt500_filtre_min(1,2)=50.0001; |
---|
213 | fin=-30+24*2.5; |
---|
214 | |
---|
215 | clear fin |
---|
216 | fin=-10+16*2.5; |
---|
217 | aa=contourf(lon,lat,delta_hgt500_filtre_min,[-50:5:50],'LineStyle','none'); |
---|
218 | if e==1; |
---|
219 | set (gca,'XTick',[-180:60:180],'XTickLabel',[' 180';'120W';' 60W';' 0';' 60E';'120E';' 180'],'fontname','Arial','fontsize',6); |
---|
220 | else |
---|
221 | set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6); |
---|
222 | end |
---|
223 | set (gca,'YTick',[30:10:70],'YTickLabel',['30N';'40N';'50N';'60N';'70N'],'fontname','Arial','fontsize',6); |
---|
224 | if e==4; |
---|
225 | co=colorbar; |
---|
226 | set (co,'ytick',[-50:5:50],'yticklabel',[-50:5:50],'fontname','Arial','fontsize',5); |
---|
227 | end; |
---|
228 | hold on; |
---|
229 | cartemonde1; |
---|
230 | set (gca,'tickDir','out'); |
---|
231 | axis equal |
---|
232 | axis([-180 180 20 80]); |
---|
233 | if e==7; |
---|
234 | title('HGT500 composite EOF2 1030j simulation AFR','fontsize',8) ; |
---|
235 | end |
---|
236 | text(-270,40,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); |
---|
237 | pos_vert=e/10; |
---|
238 | set (gca,'position',[0.2 pos_vert 0.5 0.1]) |
---|
239 | end; |
---|
240 | status=print('-depsc2','composite_hgt500_afr_eof2_1030a.eps'); |
---|
241 | |
---|
242 | figure(2); |
---|
243 | orient('landscape'); |
---|
244 | |
---|
245 | for e=1:7; |
---|
246 | a=7-(e-1)+1+7; |
---|
247 | f=2*(a-1)+1; |
---|
248 | clear delta_hgt500_filtre_min; |
---|
249 | delta_hgt500_filtre_min=zeros(64,128); |
---|
250 | for b=1:64; |
---|
251 | for c=1:128; |
---|
252 | % delta_hgt500_filtre_min(b,c)=hgt500_filtre_compomin1(f,b,c)-hgt500_filtre_compomax1(f,b,c); |
---|
253 | % delta_hgt500_filtre_min(b,c)=-(hgt500_filtre_compomax1(f,b,c)-hgt(b,c)); |
---|
254 | delta_hgt500_filtre_min(b,c)=hgt500_filtre_compomin1(f,b,c)-hgt(b,c); |
---|
255 | if student1(f,b,c)==1; |
---|
256 | delta_hgt500_filtre_min(b,c)=delta_hgt500_filtre_min(b,c); |
---|
257 | else |
---|
258 | % delta_hgt500_filtre_min(b,c)=NaN; |
---|
259 | end; |
---|
260 | end; |
---|
261 | end; |
---|
262 | for b=1:64; |
---|
263 | for c=1:128; |
---|
264 | if delta_hgt500_filtre_min(b,c)<-50; |
---|
265 | delta_hgt500_filtre_min(b,c)=-50; |
---|
266 | elseif delta_hgt500_filtre_min(b,c)>50; |
---|
267 | delta_hgt500_filtre_min(b,c)=50; |
---|
268 | end; |
---|
269 | end; |
---|
270 | end |
---|
271 | subplot(7,1,8-e); |
---|
272 | palettecomplet |
---|
273 | delta_hgt500_filtre_min(1,1)=-50.0001; |
---|
274 | delta_hgt500_filtre_min(1,2)=50.0001; |
---|
275 | fin=-30+24*2.5; |
---|
276 | |
---|
277 | clear fin |
---|
278 | fin=-10+16*2.5; |
---|
279 | aa=contourf(lon,lat,delta_hgt500_filtre_min,[-50:5:50],'LineStyle','none'); |
---|
280 | if e==1; |
---|
281 | set (gca,'XTick',[-180:60:180],'XTickLabel',[' 180';'120W';' 60W';' 0';' 60E';'120E';' 180'],'fontname','Arial','fontsize',6); |
---|
282 | else |
---|
283 | set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6); |
---|
284 | end |
---|
285 | set (gca,'YTick',[30:10:70],'YTickLabel',['30N';'40N';'50N';'60N';'70N'],'fontname','Arial','fontsize',6); |
---|
286 | if e==4; |
---|
287 | co=colorbar; |
---|
288 | set (co,'ytick',[-40:20:40],'yticklabel',[-40:20:40],'fontname','Arial','fontsize',5); |
---|
289 | end; |
---|
290 | hold on; |
---|
291 | cartemonde1; |
---|
292 | set (gca,'tickDir','out'); |
---|
293 | axis equal |
---|
294 | axis([-180 180 20 80]); |
---|
295 | if e==7; |
---|
296 | title('HGT500 composite EOF2 1030j simulation AFR','fontsize',8) ; |
---|
297 | end |
---|
298 | text(-270,40,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); |
---|
299 | pos_vert=e/10; |
---|
300 | set (gca,'position',[0.2 pos_vert 0.5 0.1]) |
---|
301 | end; |
---|
302 | status=print('-depsc2','composite_hgt500_afr_eof2_1030b.eps'); |
---|