source: trunk/src/mode_sahelien/composite_hgt925_eof23_2590.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: 12.4 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
10hgt925=zeros(122,49,144,28);
11
12siz=31+28+31+30+31+1;
13sizbis=31+28+31+30+31+30+31+31+30;
14ncload('hgt925.1979.nc'); hgt925(:,:,:,1)=hgt(siz:sizbis,1,:,:); clear hgt;
15ncload('hgt925.1980.nc'); hgt925(:,:,:,2)=hgt(siz+1:sizbis+1,1,:,:); clear hgt;
16ncload('hgt925.1981.nc'); hgt925(:,:,:,3)=hgt(siz:sizbis,1,:,:);clear hgt;
17ncload('hgt925.1982.nc'); hgt925(:,:,:,4)=hgt(siz:sizbis,1,:,:);clear hgt;
18ncload('hgt925.1983.nc'); hgt925(:,:,:,5)=hgt(siz:sizbis,1,:,:);clear hgt;
19ncload('hgt925.1984.nc'); hgt925(:,:,:,6)=hgt(siz+1:sizbis+1,1,:,:);clear hgt;
20ncload('hgt925.1985.nc'); hgt925(:,:,:,7)=hgt(siz:sizbis,1,:,:);clear hgt;
21ncload('hgt925.1986.nc'); hgt925(:,:,:,8)=hgt(siz:sizbis,1,:,:);clear hgt;
22ncload('hgt925.1987.nc'); hgt925(:,:,:,9)=hgt(siz:sizbis,1,:,:);clear hgt;
23ncload('hgt925.1988.nc'); hgt925(:,:,:,10)=hgt(siz+1:sizbis+1,1,:,:);clear hgt;
24ncload('hgt925.1989.nc'); hgt925(:,:,:,11)=hgt(siz:sizbis,1,:,:);clear hgt;
25ncload('hgt925.1990.nc'); hgt925(:,:,:,12)=hgt(siz:sizbis,1,:,:);clear hgt;
26ncload('hgt925.1991.nc'); hgt925(:,:,:,13)=hgt(siz:sizbis,1,:,:);clear hgt;
27ncload('hgt925.1992.nc'); hgt925(:,:,:,14)=hgt(siz+1:sizbis+1,1,:,:);clear hgt;
28ncload('hgt925.1993.nc'); hgt925(:,:,:,15)=hgt(siz:sizbis,1,:,:);clear hgt;
29ncload('hgt925.1994.nc'); hgt925(:,:,:,16)=hgt(siz:sizbis,1,:,:);clear hgt;
30ncload('hgt925.1995.nc'); hgt925(:,:,:,17)=hgt(siz:sizbis,1,:,:);clear hgt;
31ncload('hgt925.1996.nc'); hgt925(:,:,:,18)=hgt(siz+1:sizbis+1,1,:,:);clear hgt;
32ncload('hgt925.1997.nc'); hgt925(:,:,:,19)=hgt(siz:sizbis,1,:,:);clear hgt;
33ncload('hgt925.1998.nc'); hgt925(:,:,:,20)=hgt(siz:sizbis,1,:,:);clear hgt;
34ncload('hgt925.1999.nc'); hgt925(:,:,:,21)=hgt(siz:sizbis,1,:,:);clear hgt;
35ncload('hgt925.2000.nc'); hgt925(:,:,:,22)=hgt(siz+1:sizbis+1,1,:,:);clear hgt;
36ncload('hgt925.2001.nc'); hgt925(:,:,:,23)=hgt(siz:sizbis,1,:,:);clear hgt;
37ncload('hgt925.2002.nc'); hgt925(:,:,:,24)=hgt(siz:sizbis,1,:,:);clear hgt;
38ncload('hgt925.2003.nc'); hgt925(:,:,:,25)=hgt(siz:sizbis,1,:,:);clear hgt;
39ncload('hgt925.2004.nc'); hgt925(:,:,:,26)=hgt(siz+1:sizbis+1,1,:,:);clear hgt;
40ncload('hgt925.2005.nc'); hgt925(:,:,:,27)=hgt(siz:sizbis,1,:,:);clear hgt;
41ncload('hgt925.2006.nc'); hgt925(:,:,:,28)=hgt(siz:sizbis,1,:,:);clear hgt;
42
43clear siz1 siz1bis;
44
45hgt=permute(hgt925,[1 4 2 3]);
46clear hgt925;
47
48%%%%%%%%%%%%%%% FICHIER OLR
49% ouverture / lecture du fichier
50status=load('ind_olr_25_90_eof23.txt');
51ind_olr_25_90_eof23=status;
52clear status;
53ind_olr=reshape(ind_olr_25_90_eof23,122,28);
54k=122*28;
55
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
63hgt925_filtre_compomax=NaN*ones(60,31,49,144);
64hgt925_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            hgt925_filtre_compomax(compteurmax,1,:,:)=hgt(b-20,a,:,:);
87            hgt925_filtre_compomax(compteurmax,2,:,:)=hgt(b-19,a,:,:);
88            hgt925_filtre_compomax(compteurmax,3,:,:)=hgt(b-18,a,:,:);
89            hgt925_filtre_compomax(compteurmax,4,:,:)=hgt(b-17,a,:,:);
90            hgt925_filtre_compomax(compteurmax,5,:,:)=hgt(b-16,a,:,:);
91            hgt925_filtre_compomax(compteurmax,6,:,:)=hgt(b-15,a,:,:);
92            hgt925_filtre_compomax(compteurmax,7,:,:)=hgt(b-14,a,:,:);
93            hgt925_filtre_compomax(compteurmax,8,:,:)=hgt(b-13,a,:,:);
94            hgt925_filtre_compomax(compteurmax,9,:,:)=hgt(b-12,a,:,:);
95            hgt925_filtre_compomax(compteurmax,10,:,:)=hgt(b-11,a,:,:);
96
97            hgt925_filtre_compomax(compteurmax,11,:,:)=hgt(b-10,a,:,:);
98            hgt925_filtre_compomax(compteurmax,12,:,:)=hgt(b-9,a,:,:);
99            hgt925_filtre_compomax(compteurmax,13,:,:)=hgt(b-8,a,:,:);
100            hgt925_filtre_compomax(compteurmax,14,:,:)=hgt(b-7,a,:,:);
101            hgt925_filtre_compomax(compteurmax,15,:,:)=hgt(b-6,a,:,:);
102            hgt925_filtre_compomax(compteurmax,16,:,:)=hgt(b-5,a,:,:);
103            hgt925_filtre_compomax(compteurmax,17,:,:)=hgt(b-4,a,:,:);
104            hgt925_filtre_compomax(compteurmax,18,:,:)=hgt(b-3,a,:,:);
105            hgt925_filtre_compomax(compteurmax,19,:,:)=hgt(b-2,a,:,:);
106            hgt925_filtre_compomax(compteurmax,20,:,:)=hgt(b-1,a,:,:);
107
108            hgt925_filtre_compomax(compteurmax,21,:,:)=hgt(b,a,:,:);
109            hgt925_filtre_compomax(compteurmax,22,:,:)=hgt(b+1,a,:,:);
110            hgt925_filtre_compomax(compteurmax,23,:,:)=hgt(b+2,a,:,:);
111            hgt925_filtre_compomax(compteurmax,24,:,:)=hgt(b+3,a,:,:);
112            hgt925_filtre_compomax(compteurmax,25,:,:)=hgt(b+4,a,:,:);
113            hgt925_filtre_compomax(compteurmax,26,:,:)=hgt(b+5,a,:,:);
114            hgt925_filtre_compomax(compteurmax,27,:,:)=hgt(b+6,a,:,:);
115            hgt925_filtre_compomax(compteurmax,28,:,:)=hgt(b+7,a,:,:);
116            hgt925_filtre_compomax(compteurmax,29,:,:)=hgt(b+8,a,:,:);
117            hgt925_filtre_compomax(compteurmax,30,:,:)=hgt(b+9,a,:,:);
118            hgt925_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            hgt925_filtre_compomin(compteurmin,1,:,:)=hgt(b-20,a,:,:);
124            hgt925_filtre_compomin(compteurmin,2,:,:)=hgt(b-19,a,:,:);
125            hgt925_filtre_compomin(compteurmin,3,:,:)=hgt(b-18,a,:,:);
126            hgt925_filtre_compomin(compteurmin,4,:,:)=hgt(b-17,a,:,:);
127            hgt925_filtre_compomin(compteurmin,5,:,:)=hgt(b-16,a,:,:);
128            hgt925_filtre_compomin(compteurmin,6,:,:)=hgt(b-15,a,:,:);
129            hgt925_filtre_compomin(compteurmin,7,:,:)=hgt(b-14,a,:,:);
130            hgt925_filtre_compomin(compteurmin,8,:,:)=hgt(b-13,a,:,:);
131            hgt925_filtre_compomin(compteurmin,9,:,:)=hgt(b-12,a,:,:);
132            hgt925_filtre_compomin(compteurmin,10,:,:)=hgt(b-11,a,:,:);
133
134            hgt925_filtre_compomin(compteurmin,11,:,:)=hgt(b-10,a,:,:);
135            hgt925_filtre_compomin(compteurmin,12,:,:)=hgt(b-9,a,:,:);
136            hgt925_filtre_compomin(compteurmin,13,:,:)=hgt(b-8,a,:,:);
137            hgt925_filtre_compomin(compteurmin,14,:,:)=hgt(b-7,a,:,:);
138            hgt925_filtre_compomin(compteurmin,15,:,:)=hgt(b-6,a,:,:);
139            hgt925_filtre_compomin(compteurmin,16,:,:)=hgt(b-5,a,:,:);
140            hgt925_filtre_compomin(compteurmin,17,:,:)=hgt(b-4,a,:,:);
141            hgt925_filtre_compomin(compteurmin,18,:,:)=hgt(b-3,a,:,:);
142            hgt925_filtre_compomin(compteurmin,19,:,:)=hgt(b-2,a,:,:);
143            hgt925_filtre_compomin(compteurmin,20,:,:)=hgt(b-1,a,:,:);
144
145            hgt925_filtre_compomin(compteurmin,21,:,:)=hgt(b,a,:,:);
146            hgt925_filtre_compomin(compteurmin,22,:,:)=hgt(b+1,a,:,:);
147            hgt925_filtre_compomin(compteurmin,23,:,:)=hgt(b+2,a,:,:);
148            hgt925_filtre_compomin(compteurmin,24,:,:)=hgt(b+3,a,:,:);
149            hgt925_filtre_compomin(compteurmin,25,:,:)=hgt(b+4,a,:,:);
150            hgt925_filtre_compomin(compteurmin,26,:,:)=hgt(b+5,a,:,:);
151            hgt925_filtre_compomin(compteurmin,27,:,:)=hgt(b+6,a,:,:);
152            hgt925_filtre_compomin(compteurmin,28,:,:)=hgt(b+7,a,:,:);
153            hgt925_filtre_compomin(compteurmin,29,:,:)=hgt(b+8,a,:,:);
154            hgt925_filtre_compomin(compteurmin,30,:,:)=hgt(b+9,a,:,:);
155            hgt925_filtre_compomin(compteurmin,31,:,:)=hgt(b+10,a,:,:);
156         end;
157      end;
158   end;
159end;
160
161% on fait la somme des valeurs de hgt925_filtreentiel sur le nbre d occurences
162% on obtent un tableau de la forme (jours-avant-apres,lon,lat)
163hgt925_filtre_compomin1(:,:,:)=nanmean(hgt925_filtre_compomin);
164clear hgt925_filtre_compomin;
165hgt925_filtre_compomax1(:,:,:)=nanmean(hgt925_filtre_compomax);
166clear hgt925_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_hgt925_filtre_min;
179       delta_hgt925_filtre_min=zeros(49,144);
180       for b=1:49;
181          for c=1:144;
182             delta_hgt925_filtre_min(b,c)=hgt925_filtre_compomin1(f,b,c)-hgt925_filtre_compomax1(f,b,c);
183          end;
184       end;
185       for b=1:49;
186          for c=1:144;
187             if delta_hgt925_filtre_min(b,c)<-20;
188                  delta_hgt925_filtre_min(b,c)=-20;
189             elseif delta_hgt925_filtre_min(b,c)>20;
190                  delta_hgt925_filtre_min(b,c)=20;
191             end;
192          end;
193       end;
194       subplot(7,1,8-e);
195       hold on;
196       palette
197       clear delta_hgt925;
198       delta_hgt925_filtre_min(1,1)=-20.0001;
199       delta_hgt925_filtre_min(1,2)=20.0001;
200       delta_hgt925=zeros(49,144);
201       delta_hgt925(:,1:72)=delta_hgt925_filtre_min(:,73:144);
202       delta_hgt925(:,73:144)=delta_hgt925_filtre_min(:,1:72);
203       pression(8-e,:,:)=delta_hgt925;
204       aa=contourf(lon-180,lat,-delta_hgt925,[-20:2:20],'LineStyle','none');
205       if e==1;
206         set (gca,'XTick',[-180:60:180],'XTickLabel',[' 180';'120W';' 60W';'   0';' 60E';'120E';' 180'],'fontname','Arial','fontsize',6);
207       else
208         set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6);
209       end;
210       set (gca,'YTick',[-10:10:40],'YTickLabel',['   ';'  0';'10N';'20N';'30N';'   '],'fontname','Arial','fontsize',6);
211       if e==4;
212          co=colorbar;
213          set (co,'xtick',[-20:10:20],'xticklabel',[-20:10:20],'fontname','Arial','fontsize',6);
214       end;
215       hold on;
216       cartemonde1;
217       set (gca,'tickDir','out');
218       axis equal;
219       axis([-180 180 -10 40]);
220       if e==7;
221           title('EOF1 filtre Rossby','fontsize',8);
222       end;
223       text(-270,10,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10);
224       pos_vert=e/10;
225       set (gca,'position',[0.2 pos_vert 0.5 0.1]);
226end;
227
228print('-depsc2','compo_hgt925_eof2590_part1.eps');
229
230figure(2);
231orient('landscape');
232lat=lat';
233
234for e=1:7;
235       a=7-(e-1)+1+7;
236       f=2*(a-1)+1;
237       clear delta_hgt925_filtre_min;
238       delta_hgt925_filtre_min=zeros(49,144);
239       for b=1:49;
240          for c=1:144;
241             delta_hgt925_filtre_min(b,c)=hgt925_filtre_compomin1(f,b,c)-hgt925_filtre_compomax1(f,b,c);
242          end;
243       end;
244       for b=1:49;
245          for c=1:144;
246             if delta_hgt925_filtre_min(b,c)<-20;
247                  delta_hgt925_filtre_min(b,c)=-20;
248             elseif delta_hgt925_filtre_min(b,c)>20;
249                  delta_hgt925_filtre_min(b,c)=20;
250             end;
251          end;
252       end;
253       subplot(7,1,8-e);
254       hold on;
255       palette
256       clear delta_hgt925;
257       delta_hgt925_filtre_min(1,1)=-20.0001;
258       delta_hgt925_filtre_min(1,2)=20.0001;
259       delta_hgt925=zeros(49,144);
260       delta_hgt925(:,1:72)=delta_hgt925_filtre_min(:,73:144);
261       delta_hgt925(:,73:144)=delta_hgt925_filtre_min(:,1:72);
262       pression(8-e+7,:,:)=delta_hgt925;
263       aa=contourf(lon-180,lat,-delta_hgt925,[-20:2:20],'LineStyle','none');
264       if e==1;
265         set (gca,'XTick',[-180:60:180],'XTickLabel',[' 180';'120W';' 60W';'   0';' 60E';'120E';' 180'],'fontname','Arial','fontsize',6);
266       else
267         set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6);
268       end;
269       set (gca,'YTick',[-10:10:40],'YTickLabel',['   ';'  0';'10N';'20N';'30N';'   '],'fontname','Arial','fontsize',6);
270       if e==4;
271          co=colorbar;
272          set (co,'xtick',[-20:10:20],'xticklabel',[-20:10:20],'fontname','Arial','fontsize',6);
273       end;
274       hold on;
275       cartemonde1;
276       set (gca,'tickDir','out');
277       axis equal;
278       axis([-180 180 -10 40]);
279       if e==7;
280           title('EOF1 filtre Rossby','fontsize',8);
281       end;
282       text(-270,10,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10);
283       pos_vert=e/10;
284       set (gca,'position',[0.2 pos_vert 0.5 0.1]);
285end;
286
287print('-depsc2','compo_hgt925_eof2590_part2.eps');
288
289save('pression.mat','pression;');
Note: See TracBrowser for help on using the repository browser.