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