source: trunk/src/mode_sahelien/composite_hgt500_eof12_ER30100.m @ 10

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

first commit with original work of Sebastien Gervois

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