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_eof234_1025_3j.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; 
     
    8491 
    8592% on met sous la forme annee mois 
    86 ind_olr=reshape(v,122,29); clear v;  
     93ind_olr=reshape(v,122,29); 
     94clear v; 
    8795 
    8896% on selectionne les annees de 1979 a 2006 
    89 ind_olr=ind_olr(:,1:28);  
    90 k=122*28;  
     97ind_olr=ind_olr(:,1:28); 
     98k=122*28; 
    9199 
    92100% on centre et on reduit la serie de l OLR 
    93101ind_olr=reshape(ind_olr, k,1); 
    94 olr_std=std(ind_olr);  
    95 olr_moy=mean(ind_olr);  
     102olr_std=std(ind_olr); 
     103olr_moy=mean(ind_olr); 
    96104 
    97105for a=1:3416; 
     
    100108ind_olr=reshape(ind_olr,122,28); 
    101109 
    102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    103110% GEOPOTENTIEL 
    104111% intialisation des tableaux 
    105 hgt500_filtre_compomax=NaN*ones(3,80,31,49,144);  
     112hgt500_filtre_compomax=NaN*ones(3,80,31,49,144); 
    106113hgt500_filtre_compomin=NaN*ones(3,80,31,49,144); 
    107114tablecompteurmax=zeros(80,4); 
    108115tablecompteurmin=zeros(80,4); 
    109 compteurmax=0;  
     116compteurmax=0; 
    110117compteurmin=0; 
    111118hgt=hgt500; 
    112119clear hgt500 
    113 for a=1:28; % boucle sur les annees 
    114    clear delta;  
     120% boucle sur les annees 
     121for a=1:28; 
     122   clear delta; 
    115123   delta=zeros(122,1); 
    116    for b=1:122; % boucle sur les jours : on prepare avant    
     124   % boucle sur les jours : on prepare avant 
     125   for b=1:122; 
    117126        if b>1; 
    118127            delta(b)=ind_olr(b,a)-ind_olr(b-1,a); 
    119128        end; 
    120129   end; 
    121    for b=1:122; % boucle sur les jours 
    122       if (b>21 && b<112); % 1ere condition (laisser une marge de 10)  
    123 % cas 1 : max deltas apres negetifs et deltas avant postifs    
    124          if (delta(b+1)<0 && delta(b)>0 && ind_olr(b,a)>1.50);  
     130   % boucle sur les jours 
     131   for b=1:122; 
     132      % 1ere condition (laisser une marge de 10) 
     133      if (b>21 && b<112); 
     134% cas 1 : max deltas apres negetifs et deltas avant postifs 
     135         if (delta(b+1)<0 && delta(b)>0 && ind_olr(b,a)>1.50); 
    125136compteurmax=compteurmax+1; 
    126  format short g;  
     137 format short g; 
    127138 
    128139tablecompteurmax(compteurmax,:)=[compteurmax b 1978+a ind_olr(b,a)]; 
     
    224235 
    225236 
    226 % cas 2 : min deltas apres positifs et deltas avant negatifs    
     237% cas 2 : min deltas apres positifs et deltas avant negatifs 
    227238         elseif (delta(b+1)>0 && delta(b)<0 && ind_olr(b,a)<-1.50); 
    228239            compteurmin=compteurmin+1; 
    229240format short g; 
    230 tablecompteurmin(compteurmin,:)=[compteurmin b 1978+a ind_olr(b,a)];  
     241tablecompteurmin(compteurmin,:)=[compteurmin b 1978+a ind_olr(b,a)]; 
    231242hgt500_filtre_compomin(1,compteurmin,1,:,:)=hgt(b-21,a,:,:); 
    232243hgt500_filtre_compomin(1,compteurmin,2,:,:)=hgt(b-20,a,:,:); 
     
    326337         end; 
    327338      end; 
    328    end;          
     339   end; 
    329340end; 
    330341disp(['iii : compteurmin =', int2str(compteurmin)]); 
     
    337348hgt500_filtre_compomin=reshape(hgt500_filtre_compomin,240,31,49,144); 
    338349hgt500_filtre_compomax=reshape(hgt500_filtre_compomax,240,31,49,144); 
    339 hgt500_filtre_compomin1(:,:,:)=nanmean(hgt500_filtre_compomin); clear hgt500_filtre_compomin; 
    340 hgt500_filtre_compomax1(:,:,:)=nanmean(hgt500_filtre_compomax); clear hgt500_filtre_compomax; 
    341  
    342 x=[-10:1:10]'; %' 
    343  
    344 figure(1);  
     350hgt500_filtre_compomin1(:,:,:)=nanmean(hgt500_filtre_compomin); 
     351clear hgt500_filtre_compomin; 
     352hgt500_filtre_compomax1(:,:,:)=nanmean(hgt500_filtre_compomax); 
     353clear hgt500_filtre_compomax; 
     354 
     355x=[-10:1:10]'; 
     356 
     357figure(1); 
    345358orient('landscape'); 
    346359lat=lat'; 
     
    376389       else 
    377390         set (gca,'XTick',[-60:30:60],'XTickLabel',[' ';' ';' ';' ';' ']); 
    378        end;        
     391       end; 
    379392       set (gca,'YTick',[20:10:70],'YTickLabel',['   ';'30N';'40N';'50N';'60N';'   '],'fontname','Arial','fontsize',6); 
    380393       if e==4; 
    381           co=colorbar;             
     394          co=colorbar; 
    382395          set (co,'ytick',[-40:20:40],'yticklabel',[-40:20:40],'fontname','Arial','fontsize',6); 
    383396       end; 
    384        hold on; cartemonde1; 
     397       hold on; 
     398       cartemonde1; 
    385399       set (gca,'tickDir','out'); 
    386400       axis equal; 
     
    391405       text(-180,50,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); 
    392406       pos_vert=e/10; 
    393        set (gca,'position',[0.2 pos_vert 0.5 0.1]);  
     407       set (gca,'position',[0.2 pos_vert 0.5 0.1]); 
    394408end; 
    395409 
    396410print -depsc2 compo_hgt500_eof234_1025_pb1_seuil150.eps; 
    397411 
    398 figure(2);  
     412figure(2); 
    399413orient('landscape'); 
    400414 
     
    421435       palettejerome30; 
    422436      colormap(palette); 
    423   
     437 
    424438       delta_hgt500_filtre_min(1,1)=-50.001; 
    425439       delta_hgt500_filtre_min(1,2)=50.001; 
    426   
     440 
    427441       aa=contourf(lon-180,lat,delta_hgt500_filtre_min,[-50:2.5:50],'LineStyle','none'); 
    428442       if e==1; 
     
    430444       else 
    431445         set (gca,'XTick',[-60:30:60],'XTickLabel',[' ';' ';' ';' ';' ']); 
    432        end;        
     446       end; 
    433447       set (gca,'YTick',[20:10:70],'YTickLabel',['   ';'30N';'40N';'50N';'60N';'   '],'fontname','Arial','fontsize',6); 
    434448       if e==4; 
    435           co=colorbar;             
     449          co=colorbar; 
    436450          set (co,'ytick',[-40:20:40],'yticklabel',[-40:20:40],'fontname','Arial','fontsize',6); 
    437451       end; 
    438        hold on; cartemonde1; 
     452       hold on; 
     453       cartemonde1; 
    439454       set (gca,'tickDir','out'); 
    440455       axis equal; 
     
    445460       text(-180,50,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); 
    446461       pos_vert=e/10; 
    447        set (gca,'position',[0.2 pos_vert 0.5 0.1]);  
     462       set (gca,'position',[0.2 pos_vert 0.5 0.1]); 
    448463end; 
    449464print -depsc2 compo_hgt500_eof234_1025_pb2_seuil150.eps; 
    450  
    451  
Note: See TracChangeset for help on using the changeset viewer.