Ignore:
Timestamp:
01/06/09 10:53:18 (16 years ago)
Author:
pinsard
Message:

remove trailing blanks, split lines with multiple statements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mode_sahelien/composite_hgt500_eof1_1030.m

    r15 r16  
     1% 
    12% initialisation 
    2 clear; close all; 
    3  
     3clear; 
     4close all; 
    45 
    56% etape 1 :on selectionne les mois d ete (attention aux annees bixestiles!) 
     
    89hgt500=zeros(122,49,144,28); 
    910 
    10 siz=31+28+31+30+31+1; sizbis=31+28+31+30+31+30+31+31+30; 
     11siz=31+28+31+30+31+1; 
     12sizbis=31+28+31+30+31+30+31+31+30; 
    1113ncload('hgt500.1979.nc'); hgt500(:,:,:,1)=hgt(siz:sizbis,1,:,:); clear hgt; 
    1214ncload('hgt500.1980.nc'); hgt500(:,:,:,2)=hgt(siz+1:sizbis+1,1,:,:); clear hgt; 
     
    5456    end 
    5557end 
    56                      
    5758 
    5859hgt1=zeros(122,28,49,144); 
    5960hgt1(:,:,:,1:72)=hgt500(:,:,:,73:144); 
    6061hgt1(:,:,:,73:144)=hgt500(:,:,:,1:72); 
    61 clear hgt500; hgt500=hgt1; clear hgt1; 
     62clear hgt500; 
     63hgt500=hgt1; 
     64clear hgt1; 
    6265 
    6366hgt1=permute(hgt500,[2 1 3 4]); 
    64 hgt2(:,:,:)=nanmean(hgt1); clear hgt1; 
     67hgt2(:,:,:)=nanmean(hgt1); 
     68clear hgt1; 
    6569hgt3=reshape(hgt500, 3416,49,144); 
    66 hgt4(:,:)=nanmean(hgt3); clear hgt3; 
     70hgt4(:,:)=nanmean(hgt3); 
     71clear hgt3; 
    6772 
    6873for a=1:122; 
    6974   for b=1:28; 
    7075      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));                 
     76         for d=1:144; 
     77             hgt500(a,b,c,d)=hgt500(a,b,c,d)-(hgt2(a,c,d)-hgt4(c,d)); 
    7378         end; 
    7479      end; 
     
    8691% on calcule l ecart type sur la serie entiere de l OLR 
    8792ind_olr1=reshape(ind_olr, k,1); 
    88 ind_olr2=1.5*std(ind_olr1); clear ind_olr1; 
    89 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     93ind_olr2=1.5*std(ind_olr1); 
     94clear ind_olr1; 
     95 
    9096% GEOPOTENTIEL 
    9197% intialisation des tableaux 
    92 hgt500_filtre_compomax=NaN*ones(60,31,49,144);  
     98hgt500_filtre_compomax=NaN*ones(60,31,49,144); 
    9399hgt500_filtre_compomin=NaN*ones(60,31,49,144); 
    94100 
    95 compteurmax=0;  
     101compteurmax=0; 
    96102compteurmin=0; 
    97103hgt=hgt500; 
    98 clear hgt500 
    99 for a=1:28; % boucle sur les annees 
    100    clear delta;  
     104clear hgt500; 
     105% boucle sur les annees 
     106for a=1:28; 
     107   clear delta; 
    101108   delta=zeros(122,1); 
    102    for b=1:122; % boucle sur les jours : on prepare avant    
     109   % boucle sur les jours : on prepare avant 
     110   for b=1:122; 
    103111        if b>1; 
    104112            delta(b)=ind_olr(b,a)-ind_olr(b-1,a); 
    105113        end; 
    106114   end; 
    107    for b=1:122; % boucle sur les jours 
    108       if (b>20 && b<112); % 1ere condition (laisser une marge de 10)  
    109 % cas 1 : max deltas apres negetifs et deltas avant postifs    
    110          if (delta(b+1)<0 && delta(b)<0 && delta(b-1)>0 && delta(b-2)>0 && ind_olr(b,a)>ind_olr2);  
     115   % boucle sur les jours 
     116   for b=1:122; 
     117      % 1ere condition (laisser une marge de 10) 
     118      if (b>20 && b<112); 
     119% cas 1 : max deltas apres negetifs et deltas avant postifs 
     120         if (delta(b+1)<0 && delta(b)<0 && delta(b-1)>0 && delta(b-2)>0 && ind_olr(b,a)>ind_olr2); 
    111121            compteurmax=compteurmax+1; 
    112122            hgt500_filtre_compomax(compteurmax,1,:,:)=hgt(b-20,a,:,:); 
     
    143153            hgt500_filtre_compomax(compteurmax,30,:,:)=hgt(b+9,a,:,:); 
    144154            hgt500_filtre_compomax(compteurmax,31,:,:)=hgt(b+10,a,:,:); 
    145 % cas 2 : min deltas apres positifs et deltas avant negatifs    
     155% cas 2 : min deltas apres positifs et deltas avant negatifs 
    146156         elseif (delta(b+1)>0 && delta(b)>0 && delta(b-1)<0 && delta(b-2)<0 && ind_olr(b,a)<(-ind_olr2)); 
    147157            compteurmin=compteurmin+1; 
     
    182192         end; 
    183193      end; 
    184    end;          
     194   end; 
    185195end; 
    186196disp(['iii : compteurmin =', int2str(compteurmin)]); 
     
    204214% on fait la somme des valeurs de hgt500_filtreentiel sur le nbre d occurences 
    205215% on obtent un tableau de la forme (jours-avant-apres,lon,lat) 
    206 hgt500_filtre_compomin1(:,:,:)=nanmean(hgt500_filtre_compomin); clear hgt500_filtre_compomin; 
    207 hgt500_filtre_compomax1(:,:,:)=nanmean(hgt500_filtre_compomax); clear hgt500_filtre_compomax; 
    208  
    209 x=[-10:1:10]'; %' 
    210  
    211 figure(1);  
     216hgt500_filtre_compomin1(:,:,:)=nanmean(hgt500_filtre_compomin); 
     217clear hgt500_filtre_compomin; 
     218hgt500_filtre_compomax1(:,:,:)=nanmean(hgt500_filtre_compomax); 
     219clear hgt500_filtre_compomax; 
     220 
     221x=[-10:1:10]'; 
     222 
     223figure(1); 
    212224orient('landscape'); 
    213225lat=lat'; 
     
    248260       else 
    249261         set (gca,'XTick',[-60:30:60],'XTickLabel',[' ';' ';' ';' ';' ']); 
    250        end;        
     262       end; 
    251263       set (gca,'YTick',[20:10:70],'YTickLabel',['   ';'30N';'40N';'50N';'60N';'   '],'fontname','Arial','fontsize',6); 
    252264       if e==4; 
    253           co=colorbar;             
     265          co=colorbar; 
    254266          set (co,'ytick',[-40:20:40],'yticklabel',[-40:20:40],'fontname','Arial','fontsize',6); 
    255267       end; 
    256        hold on; cartemonde1; 
     268       hold on; 
     269       cartemonde1; 
    257270       set (gca,'tickDir','out'); 
    258271       axis equal; 
     
    263276       text(-270,50,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); 
    264277       pos_vert=e/10; 
    265        set (gca,'position',[0.2 pos_vert 0.5 0.1]);  
     278       set (gca,'position',[0.2 pos_vert 0.5 0.1]); 
    266279end; 
    267280 
    268281print -depsc2 compo_hgt500_eof1_1030a.eps; 
    269282 
    270 figure(2);  
     283figure(2); 
    271284orient('landscape'); 
    272285 
     
    297310       subplot(7,1,8-e); 
    298311       palettejerome30; 
    299       colormap(palette); 
    300   
     312       colormap(palette); 
     313 
    301314       delta_hgt500_filtre_min(1,1)=-50.001; 
    302315       delta_hgt500_filtre_min(1,2)=50.001; 
    303   
     316 
    304317       aa=contourf(lon-180,lat,delta_hgt500_filtre_min,[-50:2.5:50],'LineStyle','none'); 
    305318       if e==1; 
     
    307320       else 
    308321         set (gca,'XTick',[-60:30:60],'XTickLabel',[' ';' ';' ';' ';' ']); 
    309        end;        
     322       end; 
    310323       set (gca,'YTick',[20:10:70],'YTickLabel',['   ';'30N';'40N';'50N';'60N';'   '],'fontname','Arial','fontsize',6); 
    311324       if e==4; 
    312           co=colorbar;             
     325          co=colorbar; 
    313326          set (co,'ytick',[-40:20:40],'yticklabel',[-40:20:40],'fontname','Arial','fontsize',6); 
    314327       end; 
    315        hold on; cartemonde1; 
     328       hold on; 
     329       cartemonde1; 
    316330       set (gca,'tickDir','out'); 
    317331       axis equal; 
     
    322336       text(-270,50,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); 
    323337       pos_vert=e/10; 
    324        set (gca,'position',[0.2 pos_vert 0.5 0.1]);  
     338       set (gca,'position',[0.2 pos_vert 0.5 0.1]); 
    325339end; 
    326340print -depsc2 compo_hgt500_eof1_1030b.eps; 
Note: See TracChangeset for help on using the changeset viewer.