Ignore:
Timestamp:
01/06/09 10:53:18 (15 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_eof12_ER30100.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=std(ind_olr1); clear ind_olr1; 
    89  
    90 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     93ind_olr2=std(ind_olr1); 
     94clear ind_olr1; 
     95 
    9196% GEOPOTENTIEL 
    9297% intialisation des tableaux 
    93 hgt500_filtre_compomax=NaN*ones(60,31,49,144);  
     98hgt500_filtre_compomax=NaN*ones(60,31,49,144); 
    9499hgt500_filtre_compomin=NaN*ones(60,31,49,144); 
    95100 
    96 compteurmax=0;  
     101compteurmax=0; 
    97102compteurmin=0; 
    98103hgt=hgt500; 
    99 clear hgt500 
    100 for a=1:28; % boucle sur les annees 
    101    clear delta;  
     104clear hgt500; 
     105% boucle sur les annees 
     106for a=1:28; 
     107   clear delta; 
     108   % boucle sur les jours : on prepare avant 
    102109   delta=zeros(122,1); 
    103    for b=1:122; % boucle sur les jours : on prepare avant    
     110   for b=1:122; 
    104111        if b>1; 
    105112            delta(b)=ind_olr(b,a)-ind_olr(b-1,a); 
    106113        end; 
    107114   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);  
     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); 
    112121            compteurmax=compteurmax+1; 
    113122            hgt500_filtre_compomax(compteurmax,1,:,:)=hgt(b-20,a,:,:); 
     
    144153            hgt500_filtre_compomax(compteurmax,30,:,:)=hgt(b+9,a,:,:); 
    145154            hgt500_filtre_compomax(compteurmax,31,:,:)=hgt(b+10,a,:,:); 
    146 % cas 2 : min deltas apres positifs et deltas avant negatifs    
     155% cas 2 : min deltas apres positifs et deltas avant negatifs 
    147156         elseif (delta(b+1)>0 && delta(b)>0 && delta(b-1)<0 && delta(b-2)<0 && ind_olr(b,a)<(-ind_olr2)); 
    148157            compteurmin=compteurmin+1; 
     
    183192         end; 
    184193      end; 
    185    end;          
     194   end; 
    186195end; 
    187196 
     
    189198% on fait la somme des valeurs de hgt500_filtreentiel sur le nbre d occurences 
    190199% on obtent un tableau de la forme (jours-avant-apres,lon,lat) 
    191 hgt500_filtre_compomin1(:,:,:)=nanmean(hgt500_filtre_compomin); clear hgt500_filtre_compomin; 
    192 hgt500_filtre_compomax1(:,:,:)=nanmean(hgt500_filtre_compomax); clear hgt500_filtre_compomax; 
    193  
    194 x=[-10:1:10]'; %' 
    195  
    196 figure(1);  
     200hgt500_filtre_compomin1(:,:,:)=nanmean(hgt500_filtre_compomin); 
     201clear hgt500_filtre_compomin; 
     202hgt500_filtre_compomax1(:,:,:)=nanmean(hgt500_filtre_compomax); 
     203clear hgt500_filtre_compomax; 
     204 
     205x=[-10:1:10]'; 
     206 
     207figure(1) 
    197208orient('landscape'); 
    198209lat=lat'; 
     
    228239       else 
    229240         set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6); 
    230        end;        
     241       end; 
    231242       set (gca,'YTick',[20:10:70],'YTickLabel',['   ';'30N';'40N';'50N';'60N';'   '],'fontname','Arial','fontsize',6); 
    232243       if e==4; 
    233           co=colorbar;             
     244          co=colorbar; 
    234245          set (co,'ytick',[-40:20:40],'yticklabel',[-40:20:40],'fontname','Arial','fontsize',6); 
    235246       end; 
    236        hold on; cartemonde1; 
     247       hold on; 
     248       cartemonde1; 
    237249       set (gca,'tickDir','out'); 
    238250       axis equal; 
     
    243255       text(-270,50,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); 
    244256       pos_vert=e/10; 
    245        set (gca,'position',[0.2 pos_vert 0.5 0.1]);  
     257       set (gca,'position',[0.2 pos_vert 0.5 0.1]); 
    246258end; 
    247259 
    248260print -depsc2 compo_hgt500_eof12_ER30100a.eps; 
    249261 
    250 figure(2);  
     262figure(2); 
    251263orient('landscape'); 
    252264 
     
    273285       palettejerome30; 
    274286      colormap(palette); 
    275   
     287 
    276288       delta_hgt500_filtre_min(1,1)=-50.001; 
    277289       delta_hgt500_filtre_min(1,2)=50.001; 
    278   
     290 
    279291       aa=contourf(lon-180,lat,delta_hgt500_filtre_min,[-50:2.5:50],'LineStyle','none'); 
    280292       if e==1; 
     
    282294       else 
    283295         set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6); 
    284        end;        
     296       end; 
    285297       set (gca,'YTick',[20:10:70],'YTickLabel',['   ';'30N';'40N';'50N';'60N';'   '],'fontname','Arial','fontsize',6); 
    286298       if e==4; 
    287           co=colorbar;             
     299          co=colorbar; 
    288300          set (co,'ytick',[-40:20:40],'yticklabel',[-40:20:40],'fontname','Arial','fontsize',6); 
    289301       end; 
    290        hold on; cartemonde1; 
     302       hold on; 
     303       cartemonde1; 
    291304       set (gca,'tickDir','out'); 
    292305       axis equal; 
     
    297310       text(-270,50,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); 
    298311       pos_vert=e/10; 
    299        set (gca,'position',[0.2 pos_vert 0.5 0.1]);  
     312       set (gca,'position',[0.2 pos_vert 0.5 0.1]); 
    300313end; 
    301314print -depsc2 compo_hgt500_eof12_ER30100b.eps; 
Note: See TracChangeset for help on using the changeset viewer.