source: trunk/src/mode_sahelien/composite_hgt700_EOF12_ER1030.m @ 26

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

add semi-colon after end everywhere

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