source: trunk/src/mode_sahelien/composite_hgt925_rossby.m @ 16

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

remove trailing blanks, split lines with multiple statements

File size: 12.1 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,22);
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;
15
16ncload('hgt700.1980.nc'); hgt700(:,:,:,2)=hgt(siz+1:sizbis+1,1,:,:); clear hgt;
17ncload('hgt700.1981.nc'); hgt700(:,:,:,3)=hgt(siz:sizbis,1,:,:);clear hgt;
18ncload('hgt700.1982.nc'); hgt700(:,:,:,4)=hgt(siz:sizbis,1,:,:);clear hgt;
19ncload('hgt700.1983.nc'); hgt700(:,:,:,5)=hgt(siz:sizbis,1,:,:);clear hgt;
20ncload('hgt700.1984.nc'); hgt700(:,:,:,6)=hgt(siz+1:sizbis+1,1,:,:);clear hgt;
21ncload('hgt700.1985.nc'); hgt700(:,:,:,7)=hgt(siz:sizbis,1,:,:);clear hgt;
22ncload('hgt700.1986.nc'); hgt700(:,:,:,8)=hgt(siz:sizbis,1,:,:);clear hgt;
23ncload('hgt700.1987.nc'); hgt700(:,:,:,9)=hgt(siz:sizbis,1,:,:);clear hgt;
24ncload('hgt700.1988.nc'); hgt700(:,:,:,10)=hgt(siz+1:sizbis+1,1,:,:);clear hgt;
25ncload('hgt700.1989.nc'); hgt700(:,:,:,11)=hgt(siz:sizbis,1,:,:);clear hgt;
26ncload('hgt700.1990.nc'); hgt700(:,:,:,12)=hgt(siz:sizbis,1,:,:);clear hgt;
27ncload('hgt700.1991.nc'); hgt700(:,:,:,13)=hgt(siz:sizbis,1,:,:);clear hgt;
28ncload('hgt700.1992.nc'); hgt700(:,:,:,14)=hgt(siz+1:sizbis+1,1,:,:);clear hgt;
29ncload('hgt700.1993.nc'); hgt700(:,:,:,15)=hgt(siz:sizbis,1,:,:);clear hgt;
30ncload('hgt700.1994.nc'); hgt700(:,:,:,16)=hgt(siz:sizbis,1,:,:);clear hgt;
31ncload('hgt700.1995.nc'); hgt700(:,:,:,17)=hgt(siz:sizbis,1,:,:);clear hgt;
32ncload('hgt700.1996.nc'); hgt700(:,:,:,18)=hgt(siz+1:sizbis+1,1,:,:);clear hgt;
33ncload('hgt700.1997.nc'); hgt700(:,:,:,19)=hgt(siz:sizbis,1,:,:);clear hgt;
34ncload('hgt700.1998.nc'); hgt700(:,:,:,20)=hgt(siz:sizbis,1,:,:);clear hgt;
35ncload('hgt700.1999.nc'); hgt700(:,:,:,21)=hgt(siz:sizbis,1,:,:);clear hgt;
36ncload('hgt700.2000.nc'); hgt700(:,:,:,22)=hgt(siz+1:sizbis+1,1,:,:);clear hgt;
37clear siz1 siz1bis;
38
39hgt=permute(hgt700,[1 4 2 3]);
40clear hgt700;
41
42load eof2_olr_rossby_jjas.txt;
43% on met sous la forme annee mois
44olr_eof=reshape(eof2_olr_rossby_jjas,122,22);
45clear eof2_olr_rossby_jjas;
46
47% on calcule l ecart type sur la serie temporelle de l'olr
48k=122*22;
49olrbis=reshape(olr_eof,k,1);
50olrbis=std(olrbis);
51
52% intialisation des tableaux
53hgt700_filtre_compomax=NaN*ones(60,31,49,144);
54hgt700_filtre_compomin=NaN*ones(60,31,49,144);
55
56compteurmax=0;
57compteurmin=0;
58
59% boucle sur les annees
60for a=1:22;
61   clear delta;
62   delta=zeros(122,1);
63   % boucle sur les jours : on prepare avant
64   for b=1:122;
65        if b>1;
66            delta(b)=olr_eof(b,a)-olr_eof(b-1,a);
67        end;
68   end;
69   % boucle sur les jours
70   for b=1:122;
71      % 1ere condition (laisser une marge de 10)
72      if (b>20 && b<112);
73% cas 1 : max deltas apres negetifs et deltas avant postifs
74         if (delta(b+1)<0 && delta(b)<0 && delta(b-1)>0 && delta(b-2)>0 && olr_eof(b,a)>olrbis);
75            compteurmax=compteurmax+1;
76            hgt700_filtre_compomax(compteurmax,1,:,:)=hgt(b-20,a,:,:);
77            hgt700_filtre_compomax(compteurmax,2,:,:)=hgt(b-19,a,:,:);
78            hgt700_filtre_compomax(compteurmax,3,:,:)=hgt(b-18,a,:,:);
79            hgt700_filtre_compomax(compteurmax,4,:,:)=hgt(b-17,a,:,:);
80            hgt700_filtre_compomax(compteurmax,5,:,:)=hgt(b-16,a,:,:);
81            hgt700_filtre_compomax(compteurmax,6,:,:)=hgt(b-15,a,:,:);
82            hgt700_filtre_compomax(compteurmax,7,:,:)=hgt(b-14,a,:,:);
83            hgt700_filtre_compomax(compteurmax,8,:,:)=hgt(b-13,a,:,:);
84            hgt700_filtre_compomax(compteurmax,9,:,:)=hgt(b-12,a,:,:);
85            hgt700_filtre_compomax(compteurmax,10,:,:)=hgt(b-11,a,:,:);
86
87            hgt700_filtre_compomax(compteurmax,11,:,:)=hgt(b-10,a,:,:);
88            hgt700_filtre_compomax(compteurmax,12,:,:)=hgt(b-9,a,:,:);
89            hgt700_filtre_compomax(compteurmax,13,:,:)=hgt(b-8,a,:,:);
90            hgt700_filtre_compomax(compteurmax,14,:,:)=hgt(b-7,a,:,:);
91            hgt700_filtre_compomax(compteurmax,15,:,:)=hgt(b-6,a,:,:);
92            hgt700_filtre_compomax(compteurmax,16,:,:)=hgt(b-5,a,:,:);
93            hgt700_filtre_compomax(compteurmax,17,:,:)=hgt(b-4,a,:,:);
94            hgt700_filtre_compomax(compteurmax,18,:,:)=hgt(b-3,a,:,:);
95            hgt700_filtre_compomax(compteurmax,19,:,:)=hgt(b-2,a,:,:);
96            hgt700_filtre_compomax(compteurmax,20,:,:)=hgt(b-1,a,:,:);
97
98            hgt700_filtre_compomax(compteurmax,21,:,:)=hgt(b,a,:,:);
99            hgt700_filtre_compomax(compteurmax,22,:,:)=hgt(b+1,a,:,:);
100            hgt700_filtre_compomax(compteurmax,23,:,:)=hgt(b+2,a,:,:);
101            hgt700_filtre_compomax(compteurmax,24,:,:)=hgt(b+3,a,:,:);
102            hgt700_filtre_compomax(compteurmax,25,:,:)=hgt(b+4,a,:,:);
103            hgt700_filtre_compomax(compteurmax,26,:,:)=hgt(b+5,a,:,:);
104            hgt700_filtre_compomax(compteurmax,27,:,:)=hgt(b+6,a,:,:);
105            hgt700_filtre_compomax(compteurmax,28,:,:)=hgt(b+7,a,:,:);
106            hgt700_filtre_compomax(compteurmax,29,:,:)=hgt(b+8,a,:,:);
107            hgt700_filtre_compomax(compteurmax,30,:,:)=hgt(b+9,a,:,:);
108            hgt700_filtre_compomax(compteurmax,31,:,:)=hgt(b+10,a,:,:);
109% cas 2 : min deltas apres positifs et deltas avant negatifs
110         elseif (delta(b+1)>0 && delta(b)>0 && delta(b-1)<0 && delta(b-2)<0 && olr_eof(b,a)<(-olrbis));
111            compteurmin=compteurmin+1;
112
113            hgt700_filtre_compomin(compteurmin,1,:,:)=hgt(b-20,a,:,:);
114            hgt700_filtre_compomin(compteurmin,2,:,:)=hgt(b-19,a,:,:);
115            hgt700_filtre_compomin(compteurmin,3,:,:)=hgt(b-18,a,:,:);
116            hgt700_filtre_compomin(compteurmin,4,:,:)=hgt(b-17,a,:,:);
117            hgt700_filtre_compomin(compteurmin,5,:,:)=hgt(b-16,a,:,:);
118            hgt700_filtre_compomin(compteurmin,6,:,:)=hgt(b-15,a,:,:);
119            hgt700_filtre_compomin(compteurmin,7,:,:)=hgt(b-14,a,:,:);
120            hgt700_filtre_compomin(compteurmin,8,:,:)=hgt(b-13,a,:,:);
121            hgt700_filtre_compomin(compteurmin,9,:,:)=hgt(b-12,a,:,:);
122            hgt700_filtre_compomin(compteurmin,10,:,:)=hgt(b-11,a,:,:);
123
124            hgt700_filtre_compomin(compteurmin,11,:,:)=hgt(b-10,a,:,:);
125            hgt700_filtre_compomin(compteurmin,12,:,:)=hgt(b-9,a,:,:);
126            hgt700_filtre_compomin(compteurmin,13,:,:)=hgt(b-8,a,:,:);
127            hgt700_filtre_compomin(compteurmin,14,:,:)=hgt(b-7,a,:,:);
128            hgt700_filtre_compomin(compteurmin,15,:,:)=hgt(b-6,a,:,:);
129            hgt700_filtre_compomin(compteurmin,16,:,:)=hgt(b-5,a,:,:);
130            hgt700_filtre_compomin(compteurmin,17,:,:)=hgt(b-4,a,:,:);
131            hgt700_filtre_compomin(compteurmin,18,:,:)=hgt(b-3,a,:,:);
132            hgt700_filtre_compomin(compteurmin,19,:,:)=hgt(b-2,a,:,:);
133            hgt700_filtre_compomin(compteurmin,20,:,:)=hgt(b-1,a,:,:);
134
135            hgt700_filtre_compomin(compteurmin,21,:,:)=hgt(b,a,:,:);
136            hgt700_filtre_compomin(compteurmin,22,:,:)=hgt(b+1,a,:,:);
137            hgt700_filtre_compomin(compteurmin,23,:,:)=hgt(b+2,a,:,:);
138            hgt700_filtre_compomin(compteurmin,24,:,:)=hgt(b+3,a,:,:);
139            hgt700_filtre_compomin(compteurmin,25,:,:)=hgt(b+4,a,:,:);
140            hgt700_filtre_compomin(compteurmin,26,:,:)=hgt(b+5,a,:,:);
141            hgt700_filtre_compomin(compteurmin,27,:,:)=hgt(b+6,a,:,:);
142            hgt700_filtre_compomin(compteurmin,28,:,:)=hgt(b+7,a,:,:);
143            hgt700_filtre_compomin(compteurmin,29,:,:)=hgt(b+8,a,:,:);
144            hgt700_filtre_compomin(compteurmin,30,:,:)=hgt(b+9,a,:,:);
145            hgt700_filtre_compomin(compteurmin,31,:,:)=hgt(b+10,a,:,:);
146         end;
147      end;
148   end;
149end;
150
151
152% on fait la somme des valeurs de hgt700_filtreentiel sur le nbre d occurences
153% on obtent un tableau de la forme (jours-avant-apres,lon,lat)
154hgt700_filtre_compomin1(:,:,:)=nanmean(hgt700_filtre_compomin);
155clear hgt700_filtre_compomin;
156hgt700_filtre_compomax1(:,:,:)=nanmean(hgt700_filtre_compomax);
157clear hgt700_filtre_compomax;
158
159x=[-10:1:10]';
160
161figure(1);
162orient('landscape');
163lat=lat';
164pression=zeros(14,49,144);
165
166for e=1:7;
167       a=7-(e-1)+1;
168       f=2*(a-1)+1;
169       clear delta_hgt700_filtre_min;
170       delta_hgt700_filtre_min=zeros(49,144);
171       for b=1:49;
172          for c=1:144;
173             delta_hgt700_filtre_min(b,c)=hgt700_filtre_compomin1(f,b,c)-hgt700_filtre_compomax1(f,b,c);
174          end;
175       end;
176       for b=1:49;
177          for c=1:144;
178             if delta_hgt700_filtre_min(b,c)<-20;
179                  delta_hgt700_filtre_min(b,c)=-20;
180             elseif delta_hgt700_filtre_min(b,c)>20;
181                  delta_hgt700_filtre_min(b,c)=20;
182             end;
183          end;
184       end
185       subplot(7,1,8-e);
186       hold on;
187       palette
188       clear delta_hgt700;
189       delta_hgt700_filtre_min(1,1)=-20.0001;
190       delta_hgt700_filtre_min(1,2)=20.0001;
191       delta_hgt700=zeros(49,144);
192       delta_hgt700(:,1:72)=delta_hgt700_filtre_min(:,73:144);
193       delta_hgt700(:,73:144)=delta_hgt700_filtre_min(:,1:72);
194       pression(e,:,:)=delta_hgt700;
195       aa=contourf(lon-180,lat,delta_hgt700,[-20:2:20],'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',[-10:10:40],'YTickLabel',['   ';'  0';'10N';'20N';'30N';'   '],'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 -10 40]);
211       if e==7;
212           title('EOF2 filtre Rossby','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]);
217end;
218
219
220%%%%%%%%%%%%%%%%%%%%
221figure(2)
222orient('landscape')
223
224for e=1:7;
225       a=7-(e-1)+1+7;
226       f=2*(a-1)+1;
227       clear delta_hgt700_filtre_min;
228       delta_hgt700_filtre_min=zeros(49,144);
229       for b=1:49;
230          for c=1:144;
231             delta_hgt700_filtre_min(b,c)=hgt700_filtre_compomin1(f,b,c)-hgt700_filtre_compomax1(f,b,c);
232          end;
233       end;
234       for b=1:49;
235          for c=1:144;
236             if delta_hgt700_filtre_min(b,c)<-20;
237                  delta_hgt700_filtre_min(b,c)=-20;
238             elseif delta_hgt700_filtre_min(b,c)>20;
239                  delta_hgt700_filtre_min(b,c)=20;
240             end;
241          end;
242       end;
243       subplot(7,1,8-e);
244       hold on;
245       palette
246       delta_hgt700_filtre_min(1,1)=-20.0001;
247       delta_hgt700_filtre_min(1,2)=20.0001;
248       clear delta_hgt700;
249       delta_hgt700_filtre_min(1,1)=-20.0001;
250       delta_hgt700_filtre_min(1,2)=20.0001;
251       delta_hgt700=zeros(49,144);
252       delta_hgt700(:,1:72)=delta_hgt700_filtre_min(:,73:144);
253       delta_hgt700(:,73:144)=delta_hgt700_filtre_min(:,1:72);
254       pression(e+7,:,:)=delta_hgt700;
255       aa=contourf(lon-180,lat,delta_hgt700,[-20:2:20],'LineStyle','none');
256       if e==1;
257       set (gca,'XTick',[-180:60:180],'XTickLabel',[' 180';'120W';' 60W';'   0';' 60E';'120E';' 180'],'fontname','Arial','fontsize',6);
258       else
259      set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6);
260       end
261       set (gca,'YTick',[-10:10:40],'YTickLabel',['   ';'  0';'10N';'20N';'30N';'   '],'fontname','Arial','fontsize',6);
262       if e==4;
263          co=colorbar;
264          set (co,'xtick',[-20:10:20],'xticklabel',[-20:10:20],'fontname','Arial','fontsize',5);
265       end;
266       hold on;
267       cartemonde1;
268       set (gca,'tickDir','out');
269       axis equal
270       axis([-180 180 -10 40]);
271       if e==7;
272           title('EOF2 filtre Rossby','fontsize',8) ;
273       end
274       text(-270,10,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10);
275       pos_vert=e/10;
276       set (gca,'position',[0.2 pos_vert 0.5 0.1])
277end;
278
279save pression.mat pression;
Note: See TracBrowser for help on using the repository browser.