source: trunk/src/mode_sahelien/composite_hgt500_eof234_1030_min.m @ 18

Last change on this file since 18 was 17, checked in by pinsard, 15 years ago

remove CR from CRLF in matlab files

File size: 12.9 KB
Line 
1%
2% initialisation
3clear;
4close all;
5
6% etape 1 :on selectionne les mois d ete (attention aux annees bixestiles!)
7%          on compile sous forme d'un seul fichier
8
9hgt500=zeros(122,49,144,28);
10
11siz=31+28+31+30+31+1;
12sizbis=31+28+31+30+31+30+31+31+30;
13ncload('hgt500.1979.nc'); hgt500(:,:,:,1)=hgt(siz:sizbis,1,:,:); clear hgt;
14ncload('hgt500.1980.nc'); hgt500(:,:,:,2)=hgt(siz+1:sizbis+1,1,:,:); clear hgt;
15ncload('hgt500.1981.nc'); hgt500(:,:,:,3)=hgt(siz:sizbis,1,:,:);clear hgt;
16ncload('hgt500.1982.nc'); hgt500(:,:,:,4)=hgt(siz:sizbis,1,:,:);clear hgt;
17ncload('hgt500.1983.nc'); hgt500(:,:,:,5)=hgt(siz:sizbis,1,:,:);clear hgt;
18ncload('hgt500.1984.nc'); hgt500(:,:,:,6)=hgt(siz+1:sizbis+1,1,:,:);clear hgt;
19ncload('hgt500.1985.nc'); hgt500(:,:,:,7)=hgt(siz:sizbis,1,:,:);clear hgt;
20ncload('hgt500.1986.nc'); hgt500(:,:,:,8)=hgt(siz:sizbis,1,:,:);clear hgt;
21ncload('hgt500.1987.nc'); hgt500(:,:,:,9)=hgt(siz:sizbis,1,:,:);clear hgt;
22ncload('hgt500.1988.nc'); hgt500(:,:,:,10)=hgt(siz+1:sizbis+1,1,:,:);clear hgt;
23ncload('hgt500.1989.nc'); hgt500(:,:,:,11)=hgt(siz:sizbis,1,:,:);clear hgt;
24ncload('hgt500.1990.nc'); hgt500(:,:,:,12)=hgt(siz:sizbis,1,:,:);clear hgt;
25ncload('hgt500.1991.nc'); hgt500(:,:,:,13)=hgt(siz:sizbis,1,:,:);clear hgt;
26ncload('hgt500.1992.nc'); hgt500(:,:,:,14)=hgt(siz+1:sizbis+1,1,:,:);clear hgt;
27ncload('hgt500.1993.nc'); hgt500(:,:,:,15)=hgt(siz:sizbis,1,:,:);clear hgt;
28ncload('hgt500.1994.nc'); hgt500(:,:,:,16)=hgt(siz:sizbis,1,:,:);clear hgt;
29ncload('hgt500.1995.nc'); hgt500(:,:,:,17)=hgt(siz:sizbis,1,:,:);clear hgt;
30ncload('hgt500.1996.nc'); hgt500(:,:,:,18)=hgt(siz+1:sizbis+1,1,:,:);clear hgt;
31ncload('hgt500.1997.nc'); hgt500(:,:,:,19)=hgt(siz:sizbis,1,:,:);clear hgt;
32ncload('hgt500.1998.nc'); hgt500(:,:,:,20)=hgt(siz:sizbis,1,:,:);clear hgt;
33ncload('hgt500.1999.nc'); hgt500(:,:,:,21)=hgt(siz:sizbis,1,:,:);clear hgt;
34ncload('hgt500.2000.nc'); hgt500(:,:,:,22)=hgt(siz+1:sizbis+1,1,:,:);clear hgt;
35ncload('hgt500.2001.nc'); hgt500(:,:,:,23)=hgt(siz:sizbis,1,:,:);clear hgt;
36ncload('hgt500.2002.nc'); hgt500(:,:,:,24)=hgt(siz:sizbis,1,:,:);clear hgt;
37ncload('hgt500.2003.nc'); hgt500(:,:,:,25)=hgt(siz:sizbis,1,:,:);clear hgt;
38ncload('hgt500.2004.nc'); hgt500(:,:,:,26)=hgt(siz+1:sizbis+1,1,:,:);clear hgt;
39ncload('hgt500.2005.nc'); hgt500(:,:,:,27)=hgt(siz:sizbis,1,:,:);clear hgt;
40ncload('hgt500.2006.nc'); hgt500(:,:,:,28)=hgt(siz:sizbis,1,:,:);clear hgt;
41hgt500=hgt500+31265;
42
43clear siz1 siz1bis;
44
45hgt500=permute(hgt500,[1 4 2 3]);
46
47for a=1:122;
48    for b=1:28;
49        for c=1:49;
50            for d=1:144;
51                if hgt500(a,b,c,d)==31265;
52                    hgt500(a,b,c,d)=NaN;
53                end
54            end
55        end
56    end
57end
58
59hgt1=zeros(122,28,49,144);
60hgt1(:,:,:,1:72)=hgt500(:,:,:,73:144);
61hgt1(:,:,:,73:144)=hgt500(:,:,:,1:72);
62clear hgt500;
63hgt500=hgt1;
64clear hgt1;
65
66hgt1=permute(hgt500,[2 1 3 4]);
67hgt2(:,:,:)=nanmean(hgt1);
68clear hgt1;
69hgt3=reshape(hgt500, 3416,49,144);
70hgt4(:,:)=nanmean(hgt3);
71clear hgt3;
72
73for a=1:122;
74   for b=1:28;
75      for c=1:37;
76         for d=1:144;
77             hgt500(a,b,c,d)=hgt500(a,b,c,d)-(hgt2(a,c,d)-hgt4(c,d));
78         end;
79      end;
80   end;
81end;
82clear hgt2 hgt4;
83
84%%%%%%%%%%%%%%% FICHIER OLR
85load eof24_1030.txt;
86ind_olr=reshape(eof24_1030,122,28);
87clear eof24_1030;
88k=122*28;
89
90% on calcule l ecart type sur la serie entiere de l OLR
91ind_olr1=reshape(ind_olr, k,1);
92ind_olr2=1.5*std(ind_olr1);
93clear ind_olr1;
94
95% GEOPOTENTIEL
96% intialisation des tableaux
97hgt500_filtre_compomax=NaN*ones(60,31,49,144);
98hgt500_filtre_compomin=NaN*ones(60,31,49,144);
99
100compteurmax=0;
101compteurmin=0;
102hgt=hgt500;
103clear hgt500;
104% boucle sur les annees
105for a=1:28;
106   clear delta;
107   delta=zeros(122,1);
108   % boucle sur les jours : on prepare avant
109   for b=1:122;
110        if b>1;
111            delta(b)=ind_olr(b,a)-ind_olr(b-1,a);
112        end;
113   end;
114   % boucle sur les jours
115   for b=1:122;
116      % 1ere condition (laisser une marge de 10)
117      if (b>20 && b<112);
118% cas 1 : max deltas apres negetifs et deltas avant postifs
119         if (delta(b+1)<0 && delta(b)<0 && delta(b-1)>0 && delta(b-2)>0 && ind_olr(b,a)>ind_olr2);
120            compteurmax=compteurmax+1;
121            hgt500_filtre_compomax(compteurmax,1,:,:)=hgt(b-20,a,:,:);
122            hgt500_filtre_compomax(compteurmax,2,:,:)=hgt(b-19,a,:,:);
123            hgt500_filtre_compomax(compteurmax,3,:,:)=hgt(b-18,a,:,:);
124            hgt500_filtre_compomax(compteurmax,4,:,:)=hgt(b-17,a,:,:);
125            hgt500_filtre_compomax(compteurmax,5,:,:)=hgt(b-16,a,:,:);
126            hgt500_filtre_compomax(compteurmax,6,:,:)=hgt(b-15,a,:,:);
127            hgt500_filtre_compomax(compteurmax,7,:,:)=hgt(b-14,a,:,:);
128            hgt500_filtre_compomax(compteurmax,8,:,:)=hgt(b-13,a,:,:);
129            hgt500_filtre_compomax(compteurmax,9,:,:)=hgt(b-12,a,:,:);
130            hgt500_filtre_compomax(compteurmax,10,:,:)=hgt(b-11,a,:,:);
131
132            hgt500_filtre_compomax(compteurmax,11,:,:)=hgt(b-10,a,:,:);
133            hgt500_filtre_compomax(compteurmax,12,:,:)=hgt(b-9,a,:,:);
134            hgt500_filtre_compomax(compteurmax,13,:,:)=hgt(b-8,a,:,:);
135            hgt500_filtre_compomax(compteurmax,14,:,:)=hgt(b-7,a,:,:);
136            hgt500_filtre_compomax(compteurmax,15,:,:)=hgt(b-6,a,:,:);
137            hgt500_filtre_compomax(compteurmax,16,:,:)=hgt(b-5,a,:,:);
138            hgt500_filtre_compomax(compteurmax,17,:,:)=hgt(b-4,a,:,:);
139            hgt500_filtre_compomax(compteurmax,18,:,:)=hgt(b-3,a,:,:);
140            hgt500_filtre_compomax(compteurmax,19,:,:)=hgt(b-2,a,:,:);
141            hgt500_filtre_compomax(compteurmax,20,:,:)=hgt(b-1,a,:,:);
142
143            hgt500_filtre_compomax(compteurmax,21,:,:)=hgt(b,a,:,:);
144            hgt500_filtre_compomax(compteurmax,22,:,:)=hgt(b+1,a,:,:);
145            hgt500_filtre_compomax(compteurmax,23,:,:)=hgt(b+2,a,:,:);
146            hgt500_filtre_compomax(compteurmax,24,:,:)=hgt(b+3,a,:,:);
147            hgt500_filtre_compomax(compteurmax,25,:,:)=hgt(b+4,a,:,:);
148            hgt500_filtre_compomax(compteurmax,26,:,:)=hgt(b+5,a,:,:);
149            hgt500_filtre_compomax(compteurmax,27,:,:)=hgt(b+6,a,:,:);
150            hgt500_filtre_compomax(compteurmax,28,:,:)=hgt(b+7,a,:,:);
151            hgt500_filtre_compomax(compteurmax,29,:,:)=hgt(b+8,a,:,:);
152            hgt500_filtre_compomax(compteurmax,30,:,:)=hgt(b+9,a,:,:);
153            hgt500_filtre_compomax(compteurmax,31,:,:)=hgt(b+10,a,:,:);
154% cas 2 : min deltas apres positifs et deltas avant negatifs
155         elseif (delta(b+1)>0 && delta(b)>0 && delta(b-1)<0 && delta(b-2)<0 && ind_olr(b,a)<(-ind_olr2));
156            compteurmin=compteurmin+1;
157
158            hgt500_filtre_compomin(compteurmin,1,:,:)=hgt(b-20,a,:,:);
159            hgt500_filtre_compomin(compteurmin,2,:,:)=hgt(b-19,a,:,:);
160            hgt500_filtre_compomin(compteurmin,3,:,:)=hgt(b-18,a,:,:);
161            hgt500_filtre_compomin(compteurmin,4,:,:)=hgt(b-17,a,:,:);
162            hgt500_filtre_compomin(compteurmin,5,:,:)=hgt(b-16,a,:,:);
163            hgt500_filtre_compomin(compteurmin,6,:,:)=hgt(b-15,a,:,:);
164            hgt500_filtre_compomin(compteurmin,7,:,:)=hgt(b-14,a,:,:);
165            hgt500_filtre_compomin(compteurmin,8,:,:)=hgt(b-13,a,:,:);
166            hgt500_filtre_compomin(compteurmin,9,:,:)=hgt(b-12,a,:,:);
167            hgt500_filtre_compomin(compteurmin,10,:,:)=hgt(b-11,a,:,:);
168
169            hgt500_filtre_compomin(compteurmin,11,:,:)=hgt(b-10,a,:,:);
170            hgt500_filtre_compomin(compteurmin,12,:,:)=hgt(b-9,a,:,:);
171            hgt500_filtre_compomin(compteurmin,13,:,:)=hgt(b-8,a,:,:);
172            hgt500_filtre_compomin(compteurmin,14,:,:)=hgt(b-7,a,:,:);
173            hgt500_filtre_compomin(compteurmin,15,:,:)=hgt(b-6,a,:,:);
174            hgt500_filtre_compomin(compteurmin,16,:,:)=hgt(b-5,a,:,:);
175            hgt500_filtre_compomin(compteurmin,17,:,:)=hgt(b-4,a,:,:);
176            hgt500_filtre_compomin(compteurmin,18,:,:)=hgt(b-3,a,:,:);
177            hgt500_filtre_compomin(compteurmin,19,:,:)=hgt(b-2,a,:,:);
178            hgt500_filtre_compomin(compteurmin,20,:,:)=hgt(b-1,a,:,:);
179
180            hgt500_filtre_compomin(compteurmin,21,:,:)=hgt(b,a,:,:);
181            hgt500_filtre_compomin(compteurmin,22,:,:)=hgt(b+1,a,:,:);
182            hgt500_filtre_compomin(compteurmin,23,:,:)=hgt(b+2,a,:,:);
183            hgt500_filtre_compomin(compteurmin,24,:,:)=hgt(b+3,a,:,:);
184            hgt500_filtre_compomin(compteurmin,25,:,:)=hgt(b+4,a,:,:);
185            hgt500_filtre_compomin(compteurmin,26,:,:)=hgt(b+5,a,:,:);
186            hgt500_filtre_compomin(compteurmin,27,:,:)=hgt(b+6,a,:,:);
187            hgt500_filtre_compomin(compteurmin,28,:,:)=hgt(b+7,a,:,:);
188            hgt500_filtre_compomin(compteurmin,29,:,:)=hgt(b+8,a,:,:);
189            hgt500_filtre_compomin(compteurmin,30,:,:)=hgt(b+9,a,:,:);
190            hgt500_filtre_compomin(compteurmin,31,:,:)=hgt(b+10,a,:,:);
191         end;
192      end;
193   end;
194end;
195
196siz=122*28;
197hgt1=reshape(hgt,siz,49,144);
198clear hgt;
199hgt(:,:)=mean(hgt1);
200
201% on fait la somme des valeurs de hgt500_filtreentiel sur le nbre d occurences
202% on obtent un tableau de la forme (jours-avant-apres,lon,lat)
203hgt500_filtre_compomin1(:,:,:)=nanmean(hgt500_filtre_compomin);
204clear hgt500_filtre_compomin;
205hgt500_filtre_compomax1(:,:,:)=nanmean(hgt500_filtre_compomax);
206clear hgt500_filtre_compomax;
207
208x=[-10:1:10]';
209
210figure(1);
211orient('landscape');
212lat=lat';
213
214for e=1:7;
215       a=7-(e-1)+1;
216       f=2*(a-1)+1;
217       clear delta_hgt500_filtre_min;
218       delta_hgt500_filtre_min=zeros(49,144);
219       for b=1:49;
220          for c=1:144;
221%             delta_hgt500_filtre_min(b,c)=hgt500_filtre_compomin1(f,b,c)-hgt500_filtre_compomax1(f,b,c);
222 %             delta_hgt500_filtre_min(b,c)=hgt500_filtre_compomin1(f,b,c)-hgt(b,c);
223             delta_hgt500_filtre_min(b,c)=-(hgt500_filtre_compomax1(f,b,c)-hgt(b,c));
224          end;
225       end;
226       for b=1:49;
227          for c=1:144;
228             if delta_hgt500_filtre_min(b,c)<-50;
229                  delta_hgt500_filtre_min(b,c)=-50;
230             elseif delta_hgt500_filtre_min(b,c)>50;
231                  delta_hgt500_filtre_min(b,c)=50;
232             end;
233          end;
234       end
235       subplot(7,1,8-e);
236       palettejerome30
237       colormap(palette);
238       delta_hgt500_filtre_min(1,1)=-50.001;
239       delta_hgt500_filtre_min(1,2)=50.001;
240
241       aa=contourf(lon-180,lat,delta_hgt500_filtre_min,[-50:2.5:50],'LineStyle','none');
242       if e==1;
243         set (gca,'XTick',[-60:30:60],'XTickLabel',['60W';'30W';' 0 ';'30W';'60W'],'fontsize',6);
244       else
245         set (gca,'XTick',[-60:30:60],'XTickLabel',[' ';' ';' ';' ';' ']);
246       end;
247       set (gca,'YTick',[20:10:70],'YTickLabel',['   ';'30N';'40N';'50N';'60N';'   '],'fontname','Arial','fontsize',6);
248       if e==4;
249          co=colorbar;
250          set (co,'ytick',[-40:20:40],'yticklabel',[-40:20:40],'fontname','Arial','fontsize',6);
251       end;
252       hold on;
253       cartemonde1;
254       set (gca,'tickDir','out');
255       axis equal;
256       axis([-80 100 20 70]);
257       if e==7;
258           title('EOF234 filtre 10-30j reconstitue indice ITCZ','fontsize',8);
259       end;
260       text(-270,50,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10);
261       pos_vert=e/10;
262       set (gca,'position',[0.2 pos_vert 0.5 0.1]);
263end;
264
265print -depsc2 compo_hgt500_eof234_1030a_min.eps;
266
267figure(2);
268orient('landscape');
269
270for e=1:7;
271       a=7-(e-1)+1+7;
272       f=2*(a-1)+1;
273       clear delta_hgt500_filtre_min;
274       delta_hgt500_filtre_min=zeros(49,144);
275       for b=1:49;
276          for c=1:144;
277%             delta_hgt500_filtre_min(b,c)=hgt500_filtre_compomin1(f,b,c)-hgt500_filtre_compomax1(f,b,c);
278%              delta_hgt500_filtre_min(b,c)=hgt500_filtre_compomin1(f,b,c)-hgt(b,c);
279               delta_hgt500_filtre_min(b,c)=-(hgt500_filtre_compomax1(f,b,c)-hgt(b,c));
280          end;
281       end;
282       for b=1:49;
283          for c=1:144;
284             if delta_hgt500_filtre_min(b,c)<-50;
285                  delta_hgt500_filtre_min(b,c)=-50;
286             elseif delta_hgt500_filtre_min(b,c)>50;
287                  delta_hgt500_filtre_min(b,c)=50;
288             end;
289          end;
290       end
291       subplot(7,1,8-e);
292       palettejerome30;
293      colormap(palette);
294
295       delta_hgt500_filtre_min(1,1)=-50.001;
296       delta_hgt500_filtre_min(1,2)=50.001;
297
298       aa=contourf(lon-180,lat,delta_hgt500_filtre_min,[-50:2.5:50],'LineStyle','none');
299       if e==1;
300         set (gca,'XTick',[-60:30:60],'XTickLabel',['60W';'30W';' 0 ';'30W';'60W'],'fontsize',6);
301       else
302         set (gca,'XTick',[-60:30:60],'XTickLabel',[' ';' ';' ';' ';' ']);
303       end;
304       set (gca,'YTick',[20:10:70],'YTickLabel',['   ';'30N';'40N';'50N';'60N';'   '],'fontname','Arial','fontsize',6);
305       if e==4;
306          co=colorbar;
307          set (co,'ytick',[-40:20:40],'yticklabel',[-40:20:40],'fontname','Arial','fontsize',6);
308       end;
309       hold on;
310       cartemonde1;
311       set (gca,'tickDir','out');
312       axis equal;
313       axis([-80 100 20 70]);
314       if e==7;
315           title('EOF234 filtre 10-30j reconstitue indice ITCZ','fontsize',8);
316       end;
317       text(-270,50,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10);
318       pos_vert=e/10;
319       set (gca,'position',[0.2 pos_vert 0.5 0.1]);
320end;
321print -depsc2 compo_hgt500_eof234_1030b_min.eps;
Note: See TracBrowser for help on using the repository browser.