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

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

correction of usage of save function

File size: 11.9 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
42status=load('eof2_olr_rossby_jjas.txt');
43eof2_olr_rossby_jjas=status;
44clear status;
45% on met sous la forme annee mois
46olr_eof=reshape(eof2_olr_rossby_jjas,122,22);
47clear eof2_olr_rossby_jjas;
48
49% on calcule l ecart type sur la serie temporelle de l'olr
50k=122*22;
51olrbis=reshape(olr_eof,k,1);
52olrbis=std(olrbis);
53
54% intialisation des tableaux
55hgt700_filtre_compomax=NaN*ones(60,31,49,144);
56hgt700_filtre_compomin=NaN*ones(60,31,49,144);
57
58compteurmax=0;
59compteurmin=0;
60
61% boucle sur les annees
62for a=1:22;
63   clear delta;
64   delta=zeros(122,1);
65   % boucle sur les jours : on prepare avant
66   for b=1:122;
67        if b>1;
68            delta(b)=olr_eof(b,a)-olr_eof(b-1,a);
69        end;
70   end;
71   % boucle sur les jours
72   for b=1:122;
73      % 1ere condition (laisser une marge de 10)
74      if (b>20 && b<112);
75% cas 1 : max deltas apres negetifs et deltas avant postifs
76         if (delta(b+1)<0 && delta(b)<0 && delta(b-1)>0 && delta(b-2)>0 && olr_eof(b,a)>olrbis);
77            compteurmax=compteurmax+1;
78            hgt700_filtre_compomax(compteurmax,1,:,:)=hgt(b-20,a,:,:);
79            hgt700_filtre_compomax(compteurmax,2,:,:)=hgt(b-19,a,:,:);
80            hgt700_filtre_compomax(compteurmax,3,:,:)=hgt(b-18,a,:,:);
81            hgt700_filtre_compomax(compteurmax,4,:,:)=hgt(b-17,a,:,:);
82            hgt700_filtre_compomax(compteurmax,5,:,:)=hgt(b-16,a,:,:);
83            hgt700_filtre_compomax(compteurmax,6,:,:)=hgt(b-15,a,:,:);
84            hgt700_filtre_compomax(compteurmax,7,:,:)=hgt(b-14,a,:,:);
85            hgt700_filtre_compomax(compteurmax,8,:,:)=hgt(b-13,a,:,:);
86            hgt700_filtre_compomax(compteurmax,9,:,:)=hgt(b-12,a,:,:);
87            hgt700_filtre_compomax(compteurmax,10,:,:)=hgt(b-11,a,:,:);
88
89            hgt700_filtre_compomax(compteurmax,11,:,:)=hgt(b-10,a,:,:);
90            hgt700_filtre_compomax(compteurmax,12,:,:)=hgt(b-9,a,:,:);
91            hgt700_filtre_compomax(compteurmax,13,:,:)=hgt(b-8,a,:,:);
92            hgt700_filtre_compomax(compteurmax,14,:,:)=hgt(b-7,a,:,:);
93            hgt700_filtre_compomax(compteurmax,15,:,:)=hgt(b-6,a,:,:);
94            hgt700_filtre_compomax(compteurmax,16,:,:)=hgt(b-5,a,:,:);
95            hgt700_filtre_compomax(compteurmax,17,:,:)=hgt(b-4,a,:,:);
96            hgt700_filtre_compomax(compteurmax,18,:,:)=hgt(b-3,a,:,:);
97            hgt700_filtre_compomax(compteurmax,19,:,:)=hgt(b-2,a,:,:);
98            hgt700_filtre_compomax(compteurmax,20,:,:)=hgt(b-1,a,:,:);
99
100            hgt700_filtre_compomax(compteurmax,21,:,:)=hgt(b,a,:,:);
101            hgt700_filtre_compomax(compteurmax,22,:,:)=hgt(b+1,a,:,:);
102            hgt700_filtre_compomax(compteurmax,23,:,:)=hgt(b+2,a,:,:);
103            hgt700_filtre_compomax(compteurmax,24,:,:)=hgt(b+3,a,:,:);
104            hgt700_filtre_compomax(compteurmax,25,:,:)=hgt(b+4,a,:,:);
105            hgt700_filtre_compomax(compteurmax,26,:,:)=hgt(b+5,a,:,:);
106            hgt700_filtre_compomax(compteurmax,27,:,:)=hgt(b+6,a,:,:);
107            hgt700_filtre_compomax(compteurmax,28,:,:)=hgt(b+7,a,:,:);
108            hgt700_filtre_compomax(compteurmax,29,:,:)=hgt(b+8,a,:,:);
109            hgt700_filtre_compomax(compteurmax,30,:,:)=hgt(b+9,a,:,:);
110            hgt700_filtre_compomax(compteurmax,31,:,:)=hgt(b+10,a,:,:);
111% cas 2 : min deltas apres positifs et deltas avant negatifs
112         elseif (delta(b+1)>0 && delta(b)>0 && delta(b-1)<0 && delta(b-2)<0 && olr_eof(b,a)<(-olrbis));
113            compteurmin=compteurmin+1;
114
115            hgt700_filtre_compomin(compteurmin,1,:,:)=hgt(b-20,a,:,:);
116            hgt700_filtre_compomin(compteurmin,2,:,:)=hgt(b-19,a,:,:);
117            hgt700_filtre_compomin(compteurmin,3,:,:)=hgt(b-18,a,:,:);
118            hgt700_filtre_compomin(compteurmin,4,:,:)=hgt(b-17,a,:,:);
119            hgt700_filtre_compomin(compteurmin,5,:,:)=hgt(b-16,a,:,:);
120            hgt700_filtre_compomin(compteurmin,6,:,:)=hgt(b-15,a,:,:);
121            hgt700_filtre_compomin(compteurmin,7,:,:)=hgt(b-14,a,:,:);
122            hgt700_filtre_compomin(compteurmin,8,:,:)=hgt(b-13,a,:,:);
123            hgt700_filtre_compomin(compteurmin,9,:,:)=hgt(b-12,a,:,:);
124            hgt700_filtre_compomin(compteurmin,10,:,:)=hgt(b-11,a,:,:);
125
126            hgt700_filtre_compomin(compteurmin,11,:,:)=hgt(b-10,a,:,:);
127            hgt700_filtre_compomin(compteurmin,12,:,:)=hgt(b-9,a,:,:);
128            hgt700_filtre_compomin(compteurmin,13,:,:)=hgt(b-8,a,:,:);
129            hgt700_filtre_compomin(compteurmin,14,:,:)=hgt(b-7,a,:,:);
130            hgt700_filtre_compomin(compteurmin,15,:,:)=hgt(b-6,a,:,:);
131            hgt700_filtre_compomin(compteurmin,16,:,:)=hgt(b-5,a,:,:);
132            hgt700_filtre_compomin(compteurmin,17,:,:)=hgt(b-4,a,:,:);
133            hgt700_filtre_compomin(compteurmin,18,:,:)=hgt(b-3,a,:,:);
134            hgt700_filtre_compomin(compteurmin,19,:,:)=hgt(b-2,a,:,:);
135            hgt700_filtre_compomin(compteurmin,20,:,:)=hgt(b-1,a,:,:);
136
137            hgt700_filtre_compomin(compteurmin,21,:,:)=hgt(b,a,:,:);
138            hgt700_filtre_compomin(compteurmin,22,:,:)=hgt(b+1,a,:,:);
139            hgt700_filtre_compomin(compteurmin,23,:,:)=hgt(b+2,a,:,:);
140            hgt700_filtre_compomin(compteurmin,24,:,:)=hgt(b+3,a,:,:);
141            hgt700_filtre_compomin(compteurmin,25,:,:)=hgt(b+4,a,:,:);
142            hgt700_filtre_compomin(compteurmin,26,:,:)=hgt(b+5,a,:,:);
143            hgt700_filtre_compomin(compteurmin,27,:,:)=hgt(b+6,a,:,:);
144            hgt700_filtre_compomin(compteurmin,28,:,:)=hgt(b+7,a,:,:);
145            hgt700_filtre_compomin(compteurmin,29,:,:)=hgt(b+8,a,:,:);
146            hgt700_filtre_compomin(compteurmin,30,:,:)=hgt(b+9,a,:,:);
147            hgt700_filtre_compomin(compteurmin,31,:,:)=hgt(b+10,a,:,:);
148         end;
149      end;
150   end;
151end;
152
153% on fait la somme des valeurs de hgt700_filtreentiel sur le nbre d occurences
154% on obtent un tableau de la forme (jours-avant-apres,lon,lat)
155hgt700_filtre_compomin1(:,:,:)=nanmean(hgt700_filtre_compomin);
156clear hgt700_filtre_compomin;
157hgt700_filtre_compomax1(:,:,:)=nanmean(hgt700_filtre_compomax);
158clear hgt700_filtre_compomax;
159
160x=[-10:1:10]';
161
162figure(1);
163orient('landscape');
164lat=lat';
165pression=zeros(14,49,144);
166
167for e=1:7;
168       a=7-(e-1)+1;
169       f=2*(a-1)+1;
170       clear delta_hgt700_filtre_min;
171       delta_hgt700_filtre_min=zeros(49,144);
172       for b=1:49;
173          for c=1:144;
174             delta_hgt700_filtre_min(b,c)=hgt700_filtre_compomin1(f,b,c)-hgt700_filtre_compomax1(f,b,c);
175          end;
176       end;
177       for b=1:49;
178          for c=1:144;
179             if delta_hgt700_filtre_min(b,c)<-20;
180                  delta_hgt700_filtre_min(b,c)=-20;
181             elseif delta_hgt700_filtre_min(b,c)>20;
182                  delta_hgt700_filtre_min(b,c)=20;
183             end;
184          end;
185       end;
186       subplot(7,1,8-e);
187       hold on;
188       palette
189       clear delta_hgt700;
190       delta_hgt700_filtre_min(1,1)=-20.0001;
191       delta_hgt700_filtre_min(1,2)=20.0001;
192       delta_hgt700=zeros(49,144);
193       delta_hgt700(:,1:72)=delta_hgt700_filtre_min(:,73:144);
194       delta_hgt700(:,73:144)=delta_hgt700_filtre_min(:,1:72);
195       pression(e,:,:)=delta_hgt700;
196       aa=contourf(lon-180,lat,delta_hgt700,[-20:2:20],'LineStyle','none');
197       if e==1;
198         set (gca,'XTick',[-180:60:180],'XTickLabel',[' 180';'120W';' 60W';'   0';' 60E';'120E';' 180'],'fontname','Arial','fontsize',6);
199       else
200         set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6);
201       end;
202       set (gca,'YTick',[-10:10:40],'YTickLabel',['   ';'  0';'10N';'20N';'30N';'   '],'fontname','Arial','fontsize',6);
203       if e==4;
204          co=colorbar;
205          set (co,'xtick',[-20:10:20],'xticklabel',[-20:10:20],'fontname','Arial','fontsize',6);
206       end;
207       hold on;
208       cartemonde1;
209       set (gca,'tickDir','out');
210       axis equal;
211       axis([-180 180 -10 40]);
212       if e==7;
213           title('EOF2 filtre Rossby','fontsize',8);
214       end;
215       text(-270,10,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10);
216       pos_vert=e/10;
217       set (gca,'position',[0.2 pos_vert 0.5 0.1]);
218end;
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.