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_eof12_ER1030.m

    r15 r16  
     1% 
     2 
    13% initialisation 
    2 clear; close all; 
    3  
     4clear; 
     5close all; 
    46 
    57% etape 1 :on selectionne les mois d ete (attention aux annees bixestiles!) 
     
    810hgt500=zeros(122,49,144,28); 
    911 
    10 siz=31+28+31+30+31+1; sizbis=31+28+31+30+31+30+31+31+30; 
     12siz=31+28+31+30+31+1; 
     13sizbis=31+28+31+30+31+30+31+31+30; 
    1114ncload('hgt500.1979.nc'); hgt500(:,:,:,1)=hgt(siz:sizbis,1,:,:); clear hgt; 
    1215ncload('hgt500.1980.nc'); hgt500(:,:,:,2)=hgt(siz+1:sizbis+1,1,:,:); clear hgt; 
     
    5457    end 
    5558end 
    56                      
     59 
    5760 
    5861hgt1=zeros(122,28,49,144); 
    5962hgt1(:,:,:,1:72)=hgt500(:,:,:,73:144); 
    6063hgt1(:,:,:,73:144)=hgt500(:,:,:,1:72); 
    61 clear hgt500; hgt500=hgt1; clear hgt1; 
     64clear hgt500; 
     65hgt500=hgt1; 
     66clear hgt1; 
    6267 
    6368hgt1=permute(hgt500,[2 1 3 4]); 
    64 hgt2(:,:,:)=nanmean(hgt1); clear hgt1; 
     69hgt2(:,:,:)=nanmean(hgt1); 
     70clear hgt1; 
    6571hgt3=reshape(hgt500, 3416,49,144); 
    66 hgt4(:,:)=nanmean(hgt3); clear hgt3; 
     72hgt4(:,:)=nanmean(hgt3); 
     73clear hgt3; 
    6774 
    6875for a=1:122; 
    6976   for b=1:28; 
    7077      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));                 
     78         for d=1:144; 
     79             hgt500(a,b,c,d)=hgt500(a,b,c,d)-(hgt2(a,c,d)-hgt4(c,d)); 
    7380         end; 
    7481      end; 
     
    8693% on calcule l ecart type sur la serie entiere de l OLR 
    8794ind_olr1=reshape(ind_olr, k,1); 
    88 ind_olr2=std(ind_olr1); clear ind_olr1; 
    89  
    90 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     95ind_olr2=std(ind_olr1); 
     96clear ind_olr1; 
     97 
    9198% GEOPOTENTIEL 
    9299% intialisation des tableaux 
    93 hgt500_filtre_compomax=NaN*ones(60,31,49,144);  
     100hgt500_filtre_compomax=NaN*ones(60,31,49,144); 
    94101hgt500_filtre_compomin=NaN*ones(60,31,49,144); 
    95102 
    96 compteurmax=0;  
     103compteurmax=0; 
    97104compteurmin=0; 
    98105hgt=hgt500; 
    99106clear hgt500 
    100 for a=1:28; % boucle sur les annees 
    101    clear delta;  
     107% boucle sur les annees 
     108for a=1:28; 
     109   clear delta; 
    102110   delta=zeros(122,1); 
    103    for b=1:122; % boucle sur les jours : on prepare avant    
     111% boucle sur les jours : on prepare avant 
     112   for b=1:122; 
    104113        if b>1; 
    105114            delta(b)=ind_olr(b,a)-ind_olr(b-1,a); 
    106115        end; 
    107116   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);  
     117   % boucle sur les jours 
     118   for b=1:122; 
     119      % 1ere condition (laisser une marge de 10) 
     120      if (b>20 && b<112) 
     121% cas 1 : max deltas apres negetifs et deltas avant postifs 
     122         if (delta(b+1)<0 && delta(b)<0 && delta(b-1)>0 && delta(b-2)>0 && ind_olr(b,a)>ind_olr2); 
    112123            compteurmax=compteurmax+1; 
    113124            hgt500_filtre_compomax(compteurmax,1,:,:)=hgt(b-20,a,:,:); 
     
    144155            hgt500_filtre_compomax(compteurmax,30,:,:)=hgt(b+9,a,:,:); 
    145156            hgt500_filtre_compomax(compteurmax,31,:,:)=hgt(b+10,a,:,:); 
    146 % cas 2 : min deltas apres positifs et deltas avant negatifs    
     157% cas 2 : min deltas apres positifs et deltas avant negatifs 
    147158         elseif (delta(b+1)>0 && delta(b)>0 && delta(b-1)<0 && delta(b-2)<0 && ind_olr(b,a)<(-ind_olr2)); 
    148159            compteurmin=compteurmin+1; 
     
    183194         end; 
    184195      end; 
    185    end;          
     196   end; 
    186197end; 
    187198 
     
    189200% on fait la somme des valeurs de hgt500_filtreentiel sur le nbre d occurences 
    190201% 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);  
     202hgt500_filtre_compomin1(:,:,:)=nanmean(hgt500_filtre_compomin); 
     203clear hgt500_filtre_compomin; 
     204hgt500_filtre_compomax1(:,:,:)=nanmean(hgt500_filtre_compomax); 
     205clear hgt500_filtre_compomax; 
     206 
     207x=[-10:1:10]'; 
     208 
     209figure(1); 
    197210orient('landscape'); 
    198211lat=lat'; 
     
    228241       else 
    229242         set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6); 
    230        end;        
     243       end; 
    231244       set (gca,'YTick',[20:10:70],'YTickLabel',['   ';'30N';'40N';'50N';'60N';'   '],'fontname','Arial','fontsize',6); 
    232245       if e==4; 
    233           co=colorbar;             
     246          co=colorbar; 
    234247          set (co,'ytick',[-40:20:40],'yticklabel',[-40:20:40],'fontname','Arial','fontsize',6); 
    235248       end; 
    236        hold on; cartemonde1; 
     249       hold on; 
     250       cartemonde1; 
    237251       set (gca,'tickDir','out'); 
    238252       axis equal; 
     
    243257       text(-270,50,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); 
    244258       pos_vert=e/10; 
    245        set (gca,'position',[0.2 pos_vert 0.5 0.1]);  
     259       set (gca,'position',[0.2 pos_vert 0.5 0.1]); 
    246260end; 
    247261 
    248262print -depsc2 compo_hgt500_eof12_ER1030a.eps; 
    249263 
    250 figure(2);  
     264figure(2); 
    251265orient('landscape'); 
    252266 
     
    272286       subplot(7,1,8-e); 
    273287       palettejerome30; 
    274       colormap(palette); 
    275   
     288       colormap(palette); 
     289 
    276290       delta_hgt500_filtre_min(1,1)=-50.001; 
    277291       delta_hgt500_filtre_min(1,2)=50.001; 
    278   
     292 
    279293       aa=contourf(lon-180,lat,delta_hgt500_filtre_min,[-50:2.5:50],'LineStyle','none'); 
    280294       if e==1; 
     
    282296       else 
    283297         set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6); 
    284        end;        
     298       end; 
    285299       set (gca,'YTick',[20:10:70],'YTickLabel',['   ';'30N';'40N';'50N';'60N';'   '],'fontname','Arial','fontsize',6); 
    286300       if e==4; 
    287           co=colorbar;             
     301          co=colorbar; 
    288302          set (co,'ytick',[-40:20:40],'yticklabel',[-40:20:40],'fontname','Arial','fontsize',6); 
    289303       end; 
    290        hold on; cartemonde1; 
     304       hold on; 
     305       cartemonde1; 
    291306       set (gca,'tickDir','out'); 
    292307       axis equal; 
     
    297312       text(-270,50,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); 
    298313       pos_vert=e/10; 
    299        set (gca,'position',[0.2 pos_vert 0.5 0.1]);  
     314       set (gca,'position',[0.2 pos_vert 0.5 0.1]); 
    300315end; 
    301316print -depsc2 compo_hgt500_eof12_ER1030b.eps; 
Note: See TracChangeset for help on using the changeset viewer.