source: trunk/src/mode_sahelien/composite_uwnd700_EOF24_1030.m @ 91

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

add semi-colon after end everywhere

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