Changeset 16 for trunk/src/mode_sahelien/composite_hgt925_sahel.m
- Timestamp:
- 01/06/09 10:53:18 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mode_sahelien/composite_hgt925_sahel.m
r15 r16 1 % 2 1 3 % initialisation 2 clear; close all;3 4 clear; 5 close all; 4 6 5 7 % etape 1 :on selectionne les mois d ete (attention aux annees bixestiles!) … … 8 10 hgt700=zeros(122,49,144,22); 9 11 10 siz=31+28+31+30+31+1; sizbis=31+28+31+30+31+30+31+31+30; 12 siz=31+28+31+30+31+1; 13 sizbis=31+28+31+30+31+30+31+31+30; 11 14 ncload('hgt700.1979.nc'); hgt700(:,:,:,1)=hgt(siz:sizbis,1,:,:); clear hgt; 12 15 ncload('hgt700.1980.nc'); hgt700(:,:,:,2)=hgt(siz+1:sizbis+1,1,:,:); clear hgt; … … 38 41 39 42 %%%%%%%%%%%%%%% FICHIER OLR 40 % ouverture / lecture du fichier 43 % ouverture / lecture du fichier 41 44 fid=fopen('sahel_pb.dat','r'); 42 45 v=fread(fid,3538,'float'); … … 44 47 45 48 % on met sous la forme annee mois 46 ind_olr=reshape(v,122,29); clear v; 49 ind_olr=reshape(v,122,29); 50 clear v; 47 51 48 52 % 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; 53 ind_olr1=ind_olr(:,1:22); 54 clear ind_olr; 55 k=122*22; 56 ind_olr=ind_olr1; 57 clear ind_olr1; 51 58 52 59 % on calcule l ecart type sur la serie entiere de l OLR 53 60 ind_olr1=reshape(ind_olr, k,1); 54 ind_olr2=std(ind_olr1); clear ind_olr1;55 56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 61 ind_olr2=std(ind_olr1); 62 clear ind_olr1; 63 57 64 % GEOPOTENTIEL 58 65 % intialisation des tableaux 59 hgt700_filtre_compomax=NaN*ones(60,31,49,144); 66 hgt700_filtre_compomax=NaN*ones(60,31,49,144); 60 67 hgt700_filtre_compomin=NaN*ones(60,31,49,144); 61 68 62 compteurmax=0; 69 compteurmax=0; 63 70 compteurmin=0; 64 71 65 for a=1:22; % boucle sur les annees 66 clear delta; 72 % boucle sur les annees 73 for a=1:22; 74 clear delta; 67 75 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; 69 78 if b>1; 70 79 delta(b)=ind_olr(b,a)-ind_olr(b-1,a); 71 80 end; 72 81 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); 77 88 compteurmax=compteurmax+1; 78 89 hgt700_filtre_compomax(compteurmax,1,:,:)=hgt(b-20,a,:,:); … … 109 120 hgt700_filtre_compomax(compteurmax,30,:,:)=hgt(b+9,a,:,:); 110 121 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 112 123 elseif (delta(b+1)>0 && delta(b)>0 && delta(b-1)<0 && delta(b-2)<0 && ind_olr(b,a)<(-ind_olr2)); 113 124 compteurmin=compteurmin+1; … … 148 159 end; 149 160 end; 150 end; 161 end; 151 162 end; 152 163 … … 154 165 % on fait la somme des valeurs de hgt700_filtreentiel sur le nbre d occurences 155 166 % 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); 167 hgt700_filtre_compomin1(:,:,:)=nanmean(hgt700_filtre_compomin); 168 clear hgt700_filtre_compomin; 169 hgt700_filtre_compomax1(:,:,:)=nanmean(hgt700_filtre_compomax); 170 clear hgt700_filtre_compomax; 171 172 x=[-10:1:10]'; 173 174 figure(1); 162 175 orient('landscape'); 163 176 lat=lat'; … … 183 196 end; 184 197 end 185 subplot(7,1,8-e); hold on; 198 subplot(7,1,8-e); 199 hold on; 186 200 palette 187 201 clear delta_hgt700; … … 197 211 else 198 212 set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6); 199 end; 213 end; 200 214 set (gca,'YTick',[-10:10:40],'YTickLabel',[' ';' 0';'10N';'20N';'30N';' '],'fontname','Arial','fontsize',6); 201 215 if e==4; 202 co=colorbar; 216 co=colorbar; 203 217 set (co,'xtick',[-20:10:20],'xticklabel',[-20:10:20],'fontname','Arial','fontsize',6); 204 218 end; 205 hold on; cartemonde1; 219 hold on; 220 cartemonde1; 206 221 set (gca,'tickDir','out'); 207 222 axis equal; … … 212 227 text(-270,10,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); 213 228 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]); 215 230 end; 216 231 print -depsc2 compo_hgt700_sahel.eps 217 232 218 figure(2); 233 figure(2); 219 234 orient('landscape'); 220 235 lat=lat'; … … 240 255 end; 241 256 end 242 subplot(7,1,8-e); hold on; 257 subplot(7,1,8-e); 258 hold on; 243 259 palette 244 260 clear delta_hgt700; … … 254 270 else 255 271 set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6); 256 end; 272 end; 257 273 set (gca,'YTick',[-10:10:40],'YTickLabel',[' ';' 0';'10N';'20N';'30N';' '],'fontname','Arial','fontsize',6); 258 274 if e==4; 259 co=colorbar; 275 co=colorbar; 260 276 set (co,'xtick',[-20:10:20],'xticklabel',[-20:10:20],'fontname','Arial','fontsize',6); 261 277 end; 262 hold on; cartemonde1; 278 hold on; 279 cartemonde1; 263 280 set (gca,'tickDir','out'); 264 281 axis equal; … … 269 286 text(-270,10,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); 270 287 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]); 272 289 end; 273 290
Note: See TracChangeset
for help on using the changeset viewer.