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_hgt925_sahel.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!) 
     
    810hgt700=zeros(122,49,144,22); 
    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('hgt700.1979.nc'); hgt700(:,:,:,1)=hgt(siz:sizbis,1,:,:); clear hgt; 
    1215ncload('hgt700.1980.nc'); hgt700(:,:,:,2)=hgt(siz+1:sizbis+1,1,:,:); clear hgt; 
     
    3841 
    3942%%%%%%%%%%%%%%% FICHIER OLR 
    40 % ouverture / lecture du fichier  
     43% ouverture / lecture du fichier 
    4144fid=fopen('sahel_pb.dat','r'); 
    4245v=fread(fid,3538,'float'); 
     
    4447 
    4548% on met sous la forme annee mois 
    46 ind_olr=reshape(v,122,29); clear v;  
     49ind_olr=reshape(v,122,29); 
     50clear v; 
    4751 
    4852% 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; 
     53ind_olr1=ind_olr(:,1:22); 
     54clear ind_olr; 
     55k=122*22; 
     56ind_olr=ind_olr1; 
     57clear ind_olr1; 
    5158 
    5259% on calcule l ecart type sur la serie entiere de l OLR 
    5360ind_olr1=reshape(ind_olr, k,1); 
    54 ind_olr2=std(ind_olr1); clear ind_olr1; 
    55  
    56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     61ind_olr2=std(ind_olr1); 
     62clear ind_olr1; 
     63 
    5764% GEOPOTENTIEL 
    5865% intialisation des tableaux 
    59 hgt700_filtre_compomax=NaN*ones(60,31,49,144);  
     66hgt700_filtre_compomax=NaN*ones(60,31,49,144); 
    6067hgt700_filtre_compomin=NaN*ones(60,31,49,144); 
    6168 
    62 compteurmax=0;  
     69compteurmax=0; 
    6370compteurmin=0; 
    6471 
    65 for a=1:22; % boucle sur les annees 
    66    clear delta;  
     72% boucle sur les annees 
     73for a=1:22; 
     74   clear delta; 
    6775   delta=zeros(122,1); 
    68    for b=1:122; % boucle sur les jours : on prepare avant    
     76   % boucle sur les jours : on prepare avant 
     77   for b=1:122; 
    6978        if b>1; 
    7079            delta(b)=ind_olr(b,a)-ind_olr(b-1,a); 
    7180        end; 
    7281   end; 
    73    for b=1:122; % boucle sur les jours 
    74       if (b>20 && b<112); % 1ere condition (laisser une marge de 10)  
    75 % cas 1 : max deltas apres negetifs et deltas avant postifs    
    76          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); 
    7788            compteurmax=compteurmax+1; 
    7889            hgt700_filtre_compomax(compteurmax,1,:,:)=hgt(b-20,a,:,:); 
     
    109120            hgt700_filtre_compomax(compteurmax,30,:,:)=hgt(b+9,a,:,:); 
    110121            hgt700_filtre_compomax(compteurmax,31,:,:)=hgt(b+10,a,:,:); 
    111 % cas 2 : min deltas apres positifs et deltas avant negatifs    
     122% cas 2 : min deltas apres positifs et deltas avant negatifs 
    112123         elseif (delta(b+1)>0 && delta(b)>0 && delta(b-1)<0 && delta(b-2)<0 && ind_olr(b,a)<(-ind_olr2)); 
    113124            compteurmin=compteurmin+1; 
     
    148159         end; 
    149160      end; 
    150    end;          
     161   end; 
    151162end; 
    152163 
     
    154165% on fait la somme des valeurs de hgt700_filtreentiel sur le nbre d occurences 
    155166% on obtent un tableau de la forme (jours-avant-apres,lon,lat) 
    156 hgt700_filtre_compomin1(:,:,:)=nanmean(hgt700_filtre_compomin); clear hgt700_filtre_compomin; 
    157 hgt700_filtre_compomax1(:,:,:)=nanmean(hgt700_filtre_compomax); clear hgt700_filtre_compomax; 
    158  
    159 x=[-10:1:10]'; %' 
    160  
    161 figure(1);  
     167hgt700_filtre_compomin1(:,:,:)=nanmean(hgt700_filtre_compomin); 
     168clear hgt700_filtre_compomin; 
     169hgt700_filtre_compomax1(:,:,:)=nanmean(hgt700_filtre_compomax); 
     170clear hgt700_filtre_compomax; 
     171 
     172x=[-10:1:10]'; 
     173 
     174figure(1); 
    162175orient('landscape'); 
    163176lat=lat'; 
     
    183196          end; 
    184197       end 
    185        subplot(7,1,8-e); hold on; 
     198       subplot(7,1,8-e); 
     199       hold on; 
    186200       palette 
    187201       clear delta_hgt700; 
     
    197211       else 
    198212         set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6); 
    199        end;        
     213       end; 
    200214       set (gca,'YTick',[-10:10:40],'YTickLabel',['   ';'  0';'10N';'20N';'30N';'   '],'fontname','Arial','fontsize',6); 
    201215       if e==4; 
    202           co=colorbar;             
     216          co=colorbar; 
    203217          set (co,'xtick',[-20:10:20],'xticklabel',[-20:10:20],'fontname','Arial','fontsize',6); 
    204218       end; 
    205        hold on; cartemonde1; 
     219       hold on; 
     220       cartemonde1; 
    206221       set (gca,'tickDir','out'); 
    207222       axis equal; 
     
    212227       text(-270,10,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); 
    213228       pos_vert=e/10; 
    214        set (gca,'position',[0.2 pos_vert 0.5 0.1]);  
     229       set (gca,'position',[0.2 pos_vert 0.5 0.1]); 
    215230end; 
    216231print -depsc2 compo_hgt700_sahel.eps 
    217232 
    218 figure(2);  
     233figure(2); 
    219234orient('landscape'); 
    220235lat=lat'; 
     
    240255          end; 
    241256       end 
    242        subplot(7,1,8-e); hold on; 
     257       subplot(7,1,8-e); 
     258       hold on; 
    243259       palette 
    244260       clear delta_hgt700; 
     
    254270       else 
    255271         set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6); 
    256        end;        
     272       end; 
    257273       set (gca,'YTick',[-10:10:40],'YTickLabel',['   ';'  0';'10N';'20N';'30N';'   '],'fontname','Arial','fontsize',6); 
    258274       if e==4; 
    259           co=colorbar;             
     275          co=colorbar; 
    260276          set (co,'xtick',[-20:10:20],'xticklabel',[-20:10:20],'fontname','Arial','fontsize',6); 
    261277       end; 
    262        hold on; cartemonde1; 
     278       hold on; 
     279       cartemonde1; 
    263280       set (gca,'tickDir','out'); 
    264281       axis equal; 
     
    269286       text(-270,10,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); 
    270287       pos_vert=e/10; 
    271        set (gca,'position',[0.2 pos_vert 0.5 0.1]);  
     288       set (gca,'position',[0.2 pos_vert 0.5 0.1]); 
    272289end; 
    273290 
Note: See TracChangeset for help on using the changeset viewer.