source: trunk/src/mode_sahelien/composite_uwnd925_EOF23_1030.m @ 18

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

squeeze multiple blank lines

File size: 14.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
10uwnd925=zeros(122,49,144,28);
11
12siz=31+28+31+30+31+1;
13sizbis=31+28+31+30+31+30+31+31+30;
14ncload('uwnd925.1979.nc'); uwnd925(:,:,:,1)=uwnd(siz:sizbis,1,:,:); clear uwnd;
15ncload('uwnd925.1980.nc'); uwnd925(:,:,:,2)=uwnd(siz+1:sizbis+1,1,:,:); clear uwnd;
16ncload('uwnd925.1981.nc'); uwnd925(:,:,:,3)=uwnd(siz:sizbis,1,:,:);clear uwnd;
17ncload('uwnd925.1982.nc'); uwnd925(:,:,:,4)=uwnd(siz:sizbis,1,:,:);clear uwnd;
18ncload('uwnd925.1983.nc'); uwnd925(:,:,:,5)=uwnd(siz:sizbis,1,:,:);clear uwnd;
19ncload('uwnd925.1984.nc'); uwnd925(:,:,:,6)=uwnd(siz+1:sizbis+1,1,:,:);clear uwnd;
20ncload('uwnd925.1985.nc'); uwnd925(:,:,:,7)=uwnd(siz:sizbis,1,:,:);clear uwnd;
21ncload('uwnd925.1986.nc'); uwnd925(:,:,:,8)=uwnd(siz:sizbis,1,:,:);clear uwnd;
22ncload('uwnd925.1987.nc'); uwnd925(:,:,:,9)=uwnd(siz:sizbis,1,:,:);clear uwnd;
23ncload('uwnd925.1988.nc'); uwnd925(:,:,:,10)=uwnd(siz+1:sizbis+1,1,:,:);clear uwnd;
24ncload('uwnd925.1989.nc'); uwnd925(:,:,:,11)=uwnd(siz:sizbis,1,:,:);clear uwnd;
25ncload('uwnd925.1990.nc'); uwnd925(:,:,:,12)=uwnd(siz:sizbis,1,:,:);clear uwnd;
26ncload('uwnd925.1991.nc'); uwnd925(:,:,:,13)=uwnd(siz:sizbis,1,:,:);clear uwnd;
27ncload('uwnd925.1992.nc'); uwnd925(:,:,:,14)=uwnd(siz+1:sizbis+1,1,:,:);clear uwnd;
28ncload('uwnd925.1993.nc'); uwnd925(:,:,:,15)=uwnd(siz:sizbis,1,:,:);clear uwnd;
29ncload('uwnd925.1994.nc'); uwnd925(:,:,:,16)=uwnd(siz:sizbis,1,:,:);clear uwnd;
30ncload('uwnd925.1995.nc'); uwnd925(:,:,:,17)=uwnd(siz:sizbis,1,:,:);clear uwnd;
31ncload('uwnd925.1996.nc'); uwnd925(:,:,:,18)=uwnd(siz+1:sizbis+1,1,:,:);clear uwnd;
32ncload('uwnd925.1997.nc'); uwnd925(:,:,:,19)=uwnd(siz:sizbis,1,:,:);clear uwnd;
33ncload('uwnd925.1998.nc'); uwnd925(:,:,:,20)=uwnd(siz:sizbis,1,:,:);clear uwnd;
34ncload('uwnd925.1999.nc'); uwnd925(:,:,:,21)=uwnd(siz:sizbis,1,:,:);clear uwnd;
35ncload('uwnd925.2000.nc'); uwnd925(:,:,:,22)=uwnd(siz+1:sizbis+1,1,:,:);clear uwnd;
36ncload('uwnd925.2001.nc'); uwnd925(:,:,:,23)=uwnd(siz:sizbis,1,:,:);clear uwnd;
37ncload('uwnd925.2002.nc'); uwnd925(:,:,:,24)=uwnd(siz:sizbis,1,:,:);clear uwnd;
38ncload('uwnd925.2003.nc'); uwnd925(:,:,:,25)=uwnd(siz:sizbis,1,:,:);clear uwnd;
39ncload('uwnd925.2004.nc'); uwnd925(:,:,:,26)=uwnd(siz+1:sizbis+1,1,:,:);clear uwnd;
40ncload('uwnd925.2005.nc'); uwnd925(:,:,:,27)=uwnd(siz:sizbis,1,:,:);clear uwnd;
41ncload('uwnd925.2006.nc'); uwnd925(:,:,:,28)=uwnd(siz:sizbis,1,:,:);clear uwnd;
42uwnd925=uwnd925*0.01;
43uwnd925=uwnd925-187.65;
44
45clear siz1 siz1bis;
46
47uwnd=permute(uwnd925,[1 4 2 3]);
48clear uwnd925;
49
50%%%%%%%%%%%%%%% FICHIER OLR
51% ouverture / lecture du fichier
52load eof23_1030.txt
53ind_olr=reshape(eof23_1030,122,28);
54k=122*28;
55clear eof23_1030;
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
63uwnd925_filtre_compomax=NaN*ones(60,31,49,144);
64uwnd925_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            uwnd925_filtre_compomax(compteurmax,1,:,:)=uwnd(b-20,a,:,:);
87            uwnd925_filtre_compomax(compteurmax,2,:,:)=uwnd(b-19,a,:,:);
88            uwnd925_filtre_compomax(compteurmax,3,:,:)=uwnd(b-18,a,:,:);
89            uwnd925_filtre_compomax(compteurmax,4,:,:)=uwnd(b-17,a,:,:);
90            uwnd925_filtre_compomax(compteurmax,5,:,:)=uwnd(b-16,a,:,:);
91            uwnd925_filtre_compomax(compteurmax,6,:,:)=uwnd(b-15,a,:,:);
92            uwnd925_filtre_compomax(compteurmax,7,:,:)=uwnd(b-14,a,:,:);
93            uwnd925_filtre_compomax(compteurmax,8,:,:)=uwnd(b-13,a,:,:);
94            uwnd925_filtre_compomax(compteurmax,9,:,:)=uwnd(b-12,a,:,:);
95            uwnd925_filtre_compomax(compteurmax,10,:,:)=uwnd(b-11,a,:,:);
96
97            uwnd925_filtre_compomax(compteurmax,11,:,:)=uwnd(b-10,a,:,:);
98            uwnd925_filtre_compomax(compteurmax,12,:,:)=uwnd(b-9,a,:,:);
99            uwnd925_filtre_compomax(compteurmax,13,:,:)=uwnd(b-8,a,:,:);
100            uwnd925_filtre_compomax(compteurmax,14,:,:)=uwnd(b-7,a,:,:);
101            uwnd925_filtre_compomax(compteurmax,15,:,:)=uwnd(b-6,a,:,:);
102            uwnd925_filtre_compomax(compteurmax,16,:,:)=uwnd(b-5,a,:,:);
103            uwnd925_filtre_compomax(compteurmax,17,:,:)=uwnd(b-4,a,:,:);
104            uwnd925_filtre_compomax(compteurmax,18,:,:)=uwnd(b-3,a,:,:);
105            uwnd925_filtre_compomax(compteurmax,19,:,:)=uwnd(b-2,a,:,:);
106            uwnd925_filtre_compomax(compteurmax,20,:,:)=uwnd(b-1,a,:,:);
107
108            uwnd925_filtre_compomax(compteurmax,21,:,:)=uwnd(b,a,:,:);
109            uwnd925_filtre_compomax(compteurmax,22,:,:)=uwnd(b+1,a,:,:);
110            uwnd925_filtre_compomax(compteurmax,23,:,:)=uwnd(b+2,a,:,:);
111            uwnd925_filtre_compomax(compteurmax,24,:,:)=uwnd(b+3,a,:,:);
112            uwnd925_filtre_compomax(compteurmax,25,:,:)=uwnd(b+4,a,:,:);
113            uwnd925_filtre_compomax(compteurmax,26,:,:)=uwnd(b+5,a,:,:);
114            uwnd925_filtre_compomax(compteurmax,27,:,:)=uwnd(b+6,a,:,:);
115            uwnd925_filtre_compomax(compteurmax,28,:,:)=uwnd(b+7,a,:,:);
116            uwnd925_filtre_compomax(compteurmax,29,:,:)=uwnd(b+8,a,:,:);
117            uwnd925_filtre_compomax(compteurmax,30,:,:)=uwnd(b+9,a,:,:);
118            uwnd925_filtre_compomax(compteurmax,31,:,:)=uwnd(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            uwnd925_filtre_compomin(compteurmin,1,:,:)=uwnd(b-20,a,:,:);
124            uwnd925_filtre_compomin(compteurmin,2,:,:)=uwnd(b-19,a,:,:);
125            uwnd925_filtre_compomin(compteurmin,3,:,:)=uwnd(b-18,a,:,:);
126            uwnd925_filtre_compomin(compteurmin,4,:,:)=uwnd(b-17,a,:,:);
127            uwnd925_filtre_compomin(compteurmin,5,:,:)=uwnd(b-16,a,:,:);
128            uwnd925_filtre_compomin(compteurmin,6,:,:)=uwnd(b-15,a,:,:);
129            uwnd925_filtre_compomin(compteurmin,7,:,:)=uwnd(b-14,a,:,:);
130            uwnd925_filtre_compomin(compteurmin,8,:,:)=uwnd(b-13,a,:,:);
131            uwnd925_filtre_compomin(compteurmin,9,:,:)=uwnd(b-12,a,:,:);
132            uwnd925_filtre_compomin(compteurmin,10,:,:)=uwnd(b-11,a,:,:);
133
134            uwnd925_filtre_compomin(compteurmin,11,:,:)=uwnd(b-10,a,:,:);
135            uwnd925_filtre_compomin(compteurmin,12,:,:)=uwnd(b-9,a,:,:);
136            uwnd925_filtre_compomin(compteurmin,13,:,:)=uwnd(b-8,a,:,:);
137            uwnd925_filtre_compomin(compteurmin,14,:,:)=uwnd(b-7,a,:,:);
138            uwnd925_filtre_compomin(compteurmin,15,:,:)=uwnd(b-6,a,:,:);
139            uwnd925_filtre_compomin(compteurmin,16,:,:)=uwnd(b-5,a,:,:);
140            uwnd925_filtre_compomin(compteurmin,17,:,:)=uwnd(b-4,a,:,:);
141            uwnd925_filtre_compomin(compteurmin,18,:,:)=uwnd(b-3,a,:,:);
142            uwnd925_filtre_compomin(compteurmin,19,:,:)=uwnd(b-2,a,:,:);
143            uwnd925_filtre_compomin(compteurmin,20,:,:)=uwnd(b-1,a,:,:);
144
145            uwnd925_filtre_compomin(compteurmin,21,:,:)=uwnd(b,a,:,:);
146            uwnd925_filtre_compomin(compteurmin,22,:,:)=uwnd(b+1,a,:,:);
147            uwnd925_filtre_compomin(compteurmin,23,:,:)=uwnd(b+2,a,:,:);
148            uwnd925_filtre_compomin(compteurmin,24,:,:)=uwnd(b+3,a,:,:);
149            uwnd925_filtre_compomin(compteurmin,25,:,:)=uwnd(b+4,a,:,:);
150            uwnd925_filtre_compomin(compteurmin,26,:,:)=uwnd(b+5,a,:,:);
151            uwnd925_filtre_compomin(compteurmin,27,:,:)=uwnd(b+6,a,:,:);
152            uwnd925_filtre_compomin(compteurmin,28,:,:)=uwnd(b+7,a,:,:);
153            uwnd925_filtre_compomin(compteurmin,29,:,:)=uwnd(b+8,a,:,:);
154            uwnd925_filtre_compomin(compteurmin,30,:,:)=uwnd(b+9,a,:,:);
155            uwnd925_filtre_compomin(compteurmin,31,:,:)=uwnd(b+10,a,:,:);
156         end;
157      end;
158   end;
159end;
160
161% on fait la somme des valeurs de uwnd925_filtreentiel sur le nbre d occurences
162% on obtent un tableau de la forme (jours-avant-apres,lon,lat)
163uwnd925_filtre_compomin1(:,:,:)=nanmean(uwnd925_filtre_compomin);
164clear uwnd925_filtre_compomin;
165uwnd925_filtre_compomax1(:,:,:)=nanmean(uwnd925_filtre_compomax);
166clear uwnd925_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_uwnd925_filtre_min;
179       delta_uwnd925_filtre_min=zeros(49,144);
180       for b=1:49;
181          for c=1:144;
182             delta_uwnd925_filtre_min(b,c)=uwnd925_filtre_compomin1(f,b,c)-uwnd925_filtre_compomax1(f,b,c);
183          end;
184       end;
185       for b=1:49;
186          for c=1:144;
187             if delta_uwnd925_filtre_min(b,c)<-5;
188                  delta_uwnd925_filtre_min(b,c)=-5;
189             elseif delta_uwnd925_filtre_min(b,c)>5;
190                  delta_uwnd925_filtre_min(b,c)=5;
191             end;
192          end;
193       end
194       subplot(7,1,8-e);
195       palette
196       clear delta_uwnd925;
197       delta_uwnd925_filtre_min(1,1)=-5.001;
198       delta_uwnd925_filtre_min(1,2)=5.001;
199       delta_uwnd925=zeros(49,144);
200       delta_uwnd925(:,1:72)=delta_uwnd925_filtre_min(:,73:144);
201       delta_uwnd925(:,73:144)=delta_uwnd925_filtre_min(:,1:72);
202       pression(8-e,:,:)=delta_uwnd925;
203       aa=contourf(lon-180,lat,delta_uwnd925,[-5:0.5:5],'LineStyle','none');
204       delta_uwnd925=flipud(delta_uwnd925);
205      if e==1;
206            sauvegrads('composite_uwnd925_mode_sahel_1030_moins6',delta_uwnd925,[-180 2.5 -40 2.5]);
207       elseif e==2;
208            sauvegrads('composite_uwnd925_mode_sahel_1030_moins8',delta_uwnd925,[-180 2.5 -40 2.5]);
209       elseif e==3;
210            sauvegrads('composite_uwnd925_mode_sahel_1030_moins10',delta_uwnd925,[-180 2.5 -40 2.5]);
211       elseif e==4;
212            sauvegrads('composite_uwnd925_mode_sahel_1030_moins12',delta_uwnd925,[-180 2.5 -40 2.5]);
213       elseif e==5;
214            sauvegrads('composite_uwnd925_mode_sahel_1030_moins14',delta_uwnd925,[-180 2.5 -40 2.5]);
215       elseif e==6;
216            sauvegrads('composite_uwnd925_mode_sahel_1030_moins16',delta_uwnd925,[-180 2.5 -40 2.5]);
217       else
218            sauvegrads('composite_uwnd925_mode_sahel_1030_moins18',delta_uwnd925,[-180 2.5 -40 2.5]);
219       end
220delta_uwnd925=flipud(delta_uwnd925);
221
222        if e==1;
223         set (gca,'XTick',[-180:60:180],'XTickLabel',[' 180';'120W';' 60W';'   0';' 60E';'120E';' 180'],'fontname','Arial','fontsize',6);
224       else
225         set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6);
226       end;
227       set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';' 0 ';'10N';'20N';'30N'],'fontname','Arial','fontsize',6);
228       if e==4;
229          co=colorbar;
230          set (co,'ytick',[-5:1:5],'yticklabel',[-5:1:5],'fontname','Arial','fontsize',6);
231       end;
232       hold on;
233       cartemonde1;
234       set (gca,'tickDir','out');
235       axis equal;
236       axis([-180 180 -20 40]);
237       if e==7;
238           title('OLR composite EOF23 1030j ITCZ 7.5-12.5','fontsize',8);
239       end;
240       text(-270,10,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10);
241       pos_vert=e/10;
242       set (gca,'position',[0.2 pos_vert 0.5 0.1]);
243end;
244
245print -depsc2 composite_uwnd925_EOF23_1030_part1.eps;
246
247figure(2);
248orient('landscape');
249
250for e=1:7;
251       a=7-(e-1)+1+7;
252       f=2*(a-1)+1;
253       clear delta_uwnd925_filtre_min;
254       delta_uwnd925_filtre_min=zeros(49,144);
255       for b=1:49;
256          for c=1:144;
257             delta_uwnd925_filtre_min(b,c)=uwnd925_filtre_compomin1(f,b,c)-uwnd925_filtre_compomax1(f,b,c);
258          end;
259       end;
260       for b=1:49;
261          for c=1:144;
262             if delta_uwnd925_filtre_min(b,c)<-5;
263                  delta_uwnd925_filtre_min(b,c)=-5;
264             elseif delta_uwnd925_filtre_min(b,c)>5;
265                  delta_uwnd925_filtre_min(b,c)=5;
266             end;
267          end;
268       end
269       subplot(7,1,8-e);
270       palette;
271       clear delta_uwnd925;
272       delta_uwnd925_filtre_min(1,1)=-5.001;
273       delta_uwnd925_filtre_min(1,2)=5.001;
274       delta_uwnd925=zeros(49,144);
275       delta_uwnd925(:,1:72)=delta_uwnd925_filtre_min(:,73:144);
276       delta_uwnd925(:,73:144)=delta_uwnd925_filtre_min(:,1:72);
277       pression(15-e,:,:)=delta_uwnd925;
278       delta_uwnd925=flipud(delta_uwnd925);
279       if e==1;
280            sauvegrads('composite_uwnd925_mode_sahel_1030_plus8',delta_uwnd925,[-180 2.5 -40 2.5]);
281       elseif e==2;
282            sauvegrads('composite_uwnd925_mode_sahel_1030_plus6',delta_uwnd925,[-180 2.5 -40 2.5]);
283       elseif e==3;
284            sauvegrads('composite_uwnd925_mode_sahel_1030_plus4',delta_uwnd925,[-180 2.5 -40 2.5]);
285       elseif e==4;
286            sauvegrads('composite_uwnd925_mode_sahel_1030_plus2',delta_uwnd925,[-180 2.5 -40 2.5]);
287       elseif e==5;
288            sauvegrads('composite_uwnd925_mode_sahel_1030_0',delta_uwnd925,[-180 2.5 -40 2.5]);
289       elseif e==6;
290            sauvegrads('composite_uwnd925_mode_sahel_1030_moins2',delta_uwnd925,[-180 2.5 -40 2.5]);
291       else
292            sauvegrads('composite_uwnd925_mode_sahel_1030_moins4',delta_uwnd925,[-180 2.5 -40 2.5]);
293       end;
294delta_uwnd925=flipud(delta_uwnd925);
295
296       aa=contourf(lon-180,lat,delta_uwnd925,[-5:0.5:5],'LineStyle','none');
297       if e==1;
298         set (gca,'XTick',[-180:60:180],'XTickLabel',[' 180';'120W';' 60W';'   0';' 60E';'120E';' 180'],'fontname','Arial','fontsize',6);
299       else
300         set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6);
301       end;
302       set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';' 0 ';'10N';'20N';'30N'],'fontname','Arial','fontsize',6);
303       if e==4;
304          co=colorbar;
305          set (co,'ytick',[-5:1:5],'yticklabel',[-5:1:5],'fontname','Arial','fontsize',6);
306       end;
307       hold on;
308       cartemonde1;
309       set (gca,'tickDir','out');
310       axis equal;
311       axis([-180 180 -20 40]);
312       if e==7;
313            title('OLR composite EOF23 1030j ITCZ 7.5-12.5','fontsize',8);
314       end;
315       text(-270,10,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10);
316       pos_vert=e/10;
317       set (gca,'position',[0.2 pos_vert 0.5 0.1]);
318end;
319
320print -depsc2 composite_uwnd925_EOF23_1030_part2.eps;
Note: See TracBrowser for help on using the repository browser.