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