Changeset 16 for trunk/src/mode_sahelien/composite_wind925_sahel.m
- Timestamp:
- 01/06/09 10:53:18 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mode_sahelien/composite_wind925_sahel.m
r15 r16 1 % 2 1 3 % initialisation 2 4 close all … … 8 10 uwnd700=zeros(122,49,144,22); 9 11 10 siz=31+28+31+30+31+1; sizbis=31+28+31+30+31+30+31+31+30; 12 siz=31+28+31+30+31+1; 13 sizbis=31+28+31+30+31+30+31+31+30; 11 14 ncload('uwnd700.1979.nc'); uwnd700(:,:,:,1)=uwnd(siz:sizbis,1,:,:); clear uwnd; 12 15 ncload('uwnd700.1980.nc'); uwnd700(:,:,:,2)=uwnd(siz+1:sizbis+1,1,:,:); clear uwnd; … … 38 41 39 42 %%%%%%%%%%%%%%% FICHIER OLR 40 % ouverture / lecture du fichier 43 % ouverture / lecture du fichier 41 44 fid=fopen('sahel_pb.dat','r'); 42 45 v=fread(fid,3538,'float'); … … 44 47 45 48 % on met sous la forme annee mois 46 ind_olr=reshape(v,122,29); clear v; 49 ind_olr=reshape(v,122,29); 50 clear v; 47 51 48 52 % on selectionne les annees de 1979 a 2000 49 ind_olr1=ind_olr(:,1:22); clear ind_olr; 50 k=122*22; ind_olr=ind_olr1; clear ind_olr1; 53 ind_olr1=ind_olr(:,1:22); 54 clear ind_olr; 55 k=122*22; 56 ind_olr=ind_olr1; 57 clear ind_olr1; 51 58 52 59 % on calcule l ecart type sur la serie entiere de l OLR 53 60 ind_olr1=reshape(ind_olr, k,1); 54 ind_olr2=std(ind_olr1); clear ind_olr1; 61 ind_olr2=std(ind_olr1); 62 clear ind_olr1; 55 63 56 64 57 65 % intialisation des tableaux 58 uwnd700_filtre_compomax=NaN*ones(60,31,49,144); 66 uwnd700_filtre_compomax=NaN*ones(60,31,49,144); 59 67 uwnd700_filtre_compomin=NaN*ones(60,31,49,144); 60 68 61 compteurmax=0; 69 compteurmax=0; 62 70 compteurmin=0; 63 71 64 for a=1:22; % boucle sur les annees 65 clear delta; 72 % boucle sur les annees 73 for a=1:22; 74 clear delta; 66 75 delta=zeros(122,1); 67 for b=1:122; % boucle sur les jours : on prepare avant 76 % boucle sur les jours : on prepare avant 77 for b=1:122; 68 78 if b>1; 69 79 delta(b)=ind_olr(b,a)-ind_olr(b-1,a); 70 80 end; 71 81 end; 72 for b=1:122; % boucle sur les jours 73 if (b>20 && b<112); % 1ere condition (laisser une marge de 10) 74 % cas 1 : max deltas apres negetifs et deltas avant postifs 75 if (delta(b+1)<0 && delta(b)<0 && delta(b-1)>0 && delta(b-2)>0 && ind_olr(b,a)>ind_olr2); 82 % boucle sur les jours 83 for b=1:122; 84 % 1ere condition (laisser une marge de 10) 85 if (b>20 && b<112); 86 % cas 1 : max deltas apres negetifs et deltas avant postifs 87 if (delta(b+1)<0 && delta(b)<0 && delta(b-1)>0 && delta(b-2)>0 && ind_olr(b,a)>ind_olr2); 76 88 compteurmax=compteurmax+1; 77 89 uwnd700_filtre_compomax(compteurmax,1,:,:)=uwnd(b-20,a,:,:); … … 108 120 uwnd700_filtre_compomax(compteurmax,30,:,:)=uwnd(b+9,a,:,:); 109 121 uwnd700_filtre_compomax(compteurmax,31,:,:)=uwnd(b+10,a,:,:); 110 % cas 2 : min deltas apres positifs et deltas avant negatifs 122 % cas 2 : min deltas apres positifs et deltas avant negatifs 111 123 elseif (delta(b+1)>0 && delta(b)>0 && delta(b-1)<0 && delta(b-2)<0 && ind_olr(b,a)<(-ind_olr2)); 112 124 compteurmin=compteurmin+1; … … 147 159 end; 148 160 end; 149 end; 161 end; 150 162 end; 151 163 … … 153 165 % on fait la somme des valeurs de uwnd700_filtreentiel sur le nbre d occurences 154 166 % on obtent un tableau de la forme (jours-avant-apres,lon,lat) 155 uwnd700_filtre_compomin1(:,:,:)=nanmean(uwnd700_filtre_compomin); clear uwnd700_filtre_compomin; 156 uwnd700_filtre_compomax1(:,:,:)=nanmean(uwnd700_filtre_compomax); clear uwnd700_filtre_compomax; 157 158 159 160 161 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 167 uwnd700_filtre_compomin1(:,:,:)=nanmean(uwnd700_filtre_compomin); 168 clear uwnd700_filtre_compomin; 169 uwnd700_filtre_compomax1(:,:,:)=nanmean(uwnd700_filtre_compomax); 170 clear uwnd700_filtre_compomax; 162 171 163 172 % etape 1 :on selectionne les mois d ete (attention aux annees bixestiles!) … … 166 175 vwnd700=zeros(122,49,144,22); 167 176 168 siz=31+28+31+30+31+1; sizbis=31+28+31+30+31+30+31+31+30; 177 siz=31+28+31+30+31+1; 178 sizbis=31+28+31+30+31+30+31+31+30; 169 179 ncload('vwnd700.1979.nc'); vwnd700(:,:,:,1)=vwnd(siz:sizbis,1,:,:); clear vwnd; 170 180 ncload('vwnd700.1980.nc'); vwnd700(:,:,:,2)=vwnd(siz+1:sizbis+1,1,:,:); clear vwnd; … … 195 205 196 206 %%%%%%%%%%%%%% FICHIER OLR 197 % ouverture / lecture du fichier 207 % ouverture / lecture du fichier 198 208 fid=fopen('sahel_pb.dat','r'); 199 209 v=fread(fid,3538,'float'); … … 201 211 202 212 % on met sous la forme annee mois 203 ind_olr=reshape(v,122,29); clear v; 213 ind_olr=reshape(v,122,29); 214 clear v; 204 215 205 216 % on selectionne les annees de 1979 a 2000 206 ind_olr1=ind_olr(:,1:22); clear ind_olr; 207 k=122*22; ind_olr=ind_olr1; clear ind_olr1; 217 ind_olr1=ind_olr(:,1:22); 218 clear ind_olr; 219 k=122*22; 220 ind_olr=ind_olr1; 221 clear ind_olr1; 208 222 209 223 % on calcule l ecart type sur la serie entiere de l OLR 210 224 ind_olr1=reshape(ind_olr, k,1); 211 ind_olr2=std(ind_olr1); clear ind_olr1;212 225 ind_olr2=std(ind_olr1); 226 clear ind_olr1; 213 227 214 228 % intialisation des tableaux 215 vwnd700_filtre_compomax=NaN*ones(60,31,49,144); 229 vwnd700_filtre_compomax=NaN*ones(60,31,49,144); 216 230 vwnd700_filtre_compomin=NaN*ones(60,31,49,144); 217 231 218 compteurmax=0; 232 compteurmax=0; 219 233 compteurmin=0; 220 234 221 for a=1:22; % boucle sur les annees 222 clear delta; 235 % boucle sur les annees 236 for a=1:22; 237 clear delta; 223 238 delta=zeros(122,1); 224 for b=1:122; % boucle sur les jours : on prepare avant 239 % boucle sur les jours : on prepare avant 240 for b=1:122; 225 241 if b>1; 226 242 delta(b)=ind_olr(b,a)-ind_olr(b-1,a); 227 243 end; 228 244 end; 229 for b=1:122; % boucle sur les jours 230 if (b>20 && b<112); % 1ere condition (laisser une marge de 10) 231 % cas 1 : max deltas apres negetifs et deltas avant postifs 232 if (delta(b+1)<0 && delta(b)<0 && delta(b-1)>0 && delta(b-2)>0 && ind_olr(b,a)>ind_olr2); 245 % boucle sur les jours 246 for b=1:122; 247 % 1ere condition (laisser une marge de 10) 248 if (b>20 && b<112); 249 % cas 1 : max deltas apres negetifs et deltas avant postifs 250 if (delta(b+1)<0 && delta(b)<0 && delta(b-1)>0 && delta(b-2)>0 && ind_olr(b,a)>ind_olr2); 233 251 compteurmax=compteurmax+1; 234 252 vwnd700_filtre_compomax(compteurmax,1,:,:)=vwnd(b-20,a,:,:); … … 265 283 vwnd700_filtre_compomax(compteurmax,30,:,:)=vwnd(b+9,a,:,:); 266 284 vwnd700_filtre_compomax(compteurmax,31,:,:)=vwnd(b+10,a,:,:); 267 % cas 2 : min deltas apres positifs et deltas avant negatifs 285 % cas 2 : min deltas apres positifs et deltas avant negatifs 268 286 elseif (delta(b+1)>0 && delta(b)>0 && delta(b-1)<0 && delta(b-2)<0 && ind_olr(b,a)<(-ind_olr2)); 269 287 compteurmin=compteurmin+1; … … 304 322 end; 305 323 end; 306 end; 324 end; 307 325 end; 308 326 … … 310 328 % on fait la somme des valeurs de vwnd700_filtreentiel sur le nbre d occurences 311 329 % on obtent un tableau de la forme (jours-avant-apres,lon,lat) 312 vwnd700_filtre_compomin1(:,:,:)=nanmean(vwnd700_filtre_compomin); clear vwnd700_filtre_compomin;313 vwnd700_filtre_compomax1(:,:,:)=nanmean(vwnd700_filtre_compomax); clear vwnd700_filtre_compomax;314 315 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 330 vwnd700_filtre_compomin1(:,:,:)=nanmean(vwnd700_filtre_compomin); 331 clear vwnd700_filtre_compomin; 332 vwnd700_filtre_compomax1(:,:,:)=nanmean(vwnd700_filtre_compomax); 333 clear vwnd700_filtre_compomax; 316 334 317 335 figure(1) … … 331 349 delta_uwnd700_filtre_min(b,c)=uwnd700_filtre_compomin1(f,b,c)-uwnd700_filtre_compomax1(f,b,c); 332 350 delta_vwnd700_filtre_min(b,c)=vwnd700_filtre_compomin1(f,b,c)-vwnd700_filtre_compomax1(f,b,c); 333 351 334 352 end; 335 353 end; … … 342 360 delta_uwnd700_filtre(:,1:72)=delta_uwnd700_filtre_min(:,73:144); 343 361 delta_uwnd700_filtre(:,73:144)=delta_uwnd700_filtre_min(:,1:72); 344 xi=[-180:3.75:176.25]; xi=xi'; yi=[-87.1591:3.708895:87.1591]; 362 xi=[-180:3.75:176.25]; 363 xi=xi'; 364 yi=[-87.1591:3.708895:87.1591]; 345 365 clear carteu cartev; 346 carteu=interp2(lon-180,lat,delta_uwnd700_filtre,xi,yi); 366 carteu=interp2(lon-180,lat,delta_uwnd700_filtre,xi,yi); 347 367 cartev=interp2(lon-180,lat,delta_vwnd700_filtre,xi,yi); 348 368 clear coco ; 349 369 coco(:,:)=pression(e,:,:); 350 hgt=interp2(lon-180,lat,coco,xi,yi);370 hgt=interp2(lon-180,lat,coco,xi,yi); 351 371 palette 352 aa=contourf(xi,yi,hgt,[-20:2:20],'LineStyle','none'); hold on; 372 aa=contourf(xi,yi,hgt,[-20:2:20],'LineStyle','none'); 373 hold on; 353 374 aa=quiver(xi,yi,carteu,cartev,'k'); 354 375 if e==1; … … 356 377 else 357 378 set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6); 358 end 379 end 359 380 set (gca,'YTick',[-10:10:40],'YTickLabel',[' ';' 0';'10N';'20N';'30N';' '],'fontname','Arial','fontsize',6); 360 381 cartemonde1; 361 382 if e==4; 362 co=colorbar; 383 co=colorbar; 363 384 set (co,'xtick',[-40:20:40],'xticklabel',[-40:20:40],'fontname','Arial','fontsize',6); 364 385 end; … … 372 393 text(-270,10,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); 373 394 pos_vert=e/10; 374 set (gca,'position',[0.2 pos_vert 0.5 0.1]) 395 set (gca,'position',[0.2 pos_vert 0.5 0.1]) 375 396 end; 376 397 377 378 398 print -depsc2 composite_sahel_1_u700_hgt.eps; 379 399 380 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ù381 400 figure(2) 382 401 orient('landscape') … … 395 414 delta_uwnd700_filtre_min(b,c)=uwnd700_filtre_compomin1(f,b,c)-uwnd700_filtre_compomax1(f,b,c); 396 415 delta_vwnd700_filtre_min(b,c)=vwnd700_filtre_compomin1(f,b,c)-vwnd700_filtre_compomax1(f,b,c); 397 416 398 417 end; 399 418 end; … … 406 425 delta_uwnd700_filtre(:,1:72)=delta_uwnd700_filtre_min(:,73:144); 407 426 delta_uwnd700_filtre(:,73:144)=delta_uwnd700_filtre_min(:,1:72); 408 xi=[-180:3.75:176.25]; xi=xi'; yi=[-87.1591:3.708895:87.1591]; 427 xi=[-180:3.75:176.25]; 428 xi=xi'; 429 yi=[-87.1591:3.708895:87.1591]; 409 430 clear carteu cartev; 410 carteu=interp2(lon-180,lat,delta_uwnd700_filtre,xi,yi); 431 carteu=interp2(lon-180,lat,delta_uwnd700_filtre,xi,yi); 411 432 cartev=interp2(lon-180,lat,delta_vwnd700_filtre,xi,yi); 412 433 clear coco ; 413 434 coco(:,:)=pression(e+7,:,:); 414 hgt=interp2(lon-180,lat,coco,xi,yi);435 hgt=interp2(lon-180,lat,coco,xi,yi); 415 436 palette 416 aa=contourf(xi,yi,hgt,[-20:2:20],'LineStyle','none'); hold on; 437 aa=contourf(xi,yi,hgt,[-20:2:20],'LineStyle','none'); 438 hold on; 417 439 aa=quiver(xi,yi,carteu,cartev,'k'); 418 440 if e==1; … … 420 442 else 421 443 set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6); 422 end 444 end 423 445 set (gca,'YTick',[-10:10:40],'YTickLabel',[' ';' 0';'10N';'20N';'30N';' '],'fontname','Arial','fontsize',6); 424 446 cartemonde1; 425 447 if e==4; 426 co=colorbar; 448 co=colorbar; 427 449 set (co,'xtick',[-40:20:40],'xticklabel',[-40:20:40],'fontname','Arial','fontsize',6); 428 450 end; … … 436 458 text(-270,10,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); 437 459 pos_vert=e/10; 438 set (gca,'position',[0.2 pos_vert 0.5 0.1]) 460 set (gca,'position',[0.2 pos_vert 0.5 0.1]) 439 461 end; 440 462 441 442 463 print -depsc2 composite_sahel_2_u700_hgt.eps; 443 444 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ù
Note: See TracChangeset
for help on using the changeset viewer.