[17] | 1 | % |
---|
[41] | 2 | %+ |
---|
| 3 | % |
---|
| 4 | % EVOLUTIONS |
---|
| 5 | % =========== |
---|
| 6 | % |
---|
| 7 | % $Id$ |
---|
| 8 | % |
---|
| 9 | % - fplod 2009-01-28T08:54:32Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 10 | % |
---|
| 11 | % * replaced by time_serie_histog_phase_num.m |
---|
| 12 | % |
---|
| 13 | %- |
---|
[17] | 14 | |
---|
[41] | 15 | |
---|
[17] | 16 | clear; |
---|
[23] | 17 | status=load('phase6.txt'); |
---|
[24] | 18 | phase6=status; |
---|
| 19 | clear status; |
---|
[17] | 20 | phase6=reshape(phase6,122,28,3); |
---|
| 21 | |
---|
| 22 | %%%%%%%%%%%% FICHIER TYPE DE TEMPS |
---|
| 23 | % on ouvre le fichier |
---|
[23] | 24 | status=load('occu.txt'); |
---|
[24] | 25 | occu=status; |
---|
| 26 | clear status; |
---|
[17] | 27 | |
---|
| 28 | % on reorganise le fichier de type de temps (jours,annees,cluster) |
---|
| 29 | y=reshape(occu,122,58,4); |
---|
| 30 | clear occu; |
---|
| 31 | |
---|
| 32 | % on selectionne les annees de 1979 a 2006 |
---|
| 33 | occu_type_tps(:,:,:)=y(:,30:57,:); |
---|
| 34 | clear y; |
---|
| 35 | |
---|
| 36 | % intialisation des tableaux |
---|
| 37 | type_temps_compomax=zeros(80,21,4); |
---|
| 38 | compteurmax=0; |
---|
| 39 | |
---|
| 40 | % boucle sur les annees |
---|
| 41 | for a=1:28; |
---|
| 42 | for b=1:122; |
---|
| 43 | % 1ere condition (laisser une marge de 10) |
---|
| 44 | if (b>11 && b<112); |
---|
| 45 | % condition 1 on est a un maximum deltas apres sont negetifs et |
---|
| 46 | % delta avant postifs |
---|
| 47 | if phase6(b,a,1)==1; |
---|
| 48 | compteurmax=compteurmax+1; |
---|
| 49 | type_temps_compomax(compteurmax,1,:)=occu_type_tps(b-10,a,:); |
---|
| 50 | type_temps_compomax(compteurmax,2,:)=occu_type_tps(b-9,a,:); |
---|
| 51 | type_temps_compomax(compteurmax,3,:)=occu_type_tps(b-8,a,:); |
---|
| 52 | type_temps_compomax(compteurmax,4,:)=occu_type_tps(b-7,a,:); |
---|
| 53 | type_temps_compomax(compteurmax,5,:)=occu_type_tps(b-6,a,:); |
---|
| 54 | type_temps_compomax(compteurmax,6,:)=occu_type_tps(b-5,a,:); |
---|
| 55 | type_temps_compomax(compteurmax,7,:)=occu_type_tps(b-4,a,:); |
---|
| 56 | type_temps_compomax(compteurmax,8,:)=occu_type_tps(b-3,a,:); |
---|
| 57 | type_temps_compomax(compteurmax,9,:)=occu_type_tps(b-2,a,:); |
---|
| 58 | type_temps_compomax(compteurmax,10,:)=occu_type_tps(b-1,a,:); |
---|
| 59 | type_temps_compomax(compteurmax,11,:)=occu_type_tps(b,a,:); |
---|
| 60 | type_temps_compomax(compteurmax,12,:)=occu_type_tps(b+1,a,:); |
---|
| 61 | type_temps_compomax(compteurmax,13,:)=occu_type_tps(b+2,a,:); |
---|
| 62 | type_temps_compomax(compteurmax,14,:)=occu_type_tps(b+3,a,:); |
---|
| 63 | type_temps_compomax(compteurmax,15,:)=occu_type_tps(b+4,a,:); |
---|
| 64 | type_temps_compomax(compteurmax,16,:)=occu_type_tps(b+5,a,:); |
---|
| 65 | type_temps_compomax(compteurmax,17,:)=occu_type_tps(b+6,a,:); |
---|
| 66 | type_temps_compomax(compteurmax,18,:)=occu_type_tps(b+7,a,:); |
---|
| 67 | type_temps_compomax(compteurmax,19,:)=occu_type_tps(b+8,a,:); |
---|
| 68 | type_temps_compomax(compteurmax,20,:)=occu_type_tps(b+9,a,:); |
---|
| 69 | type_temps_compomax(compteurmax,21,:)=occu_type_tps(b+10,a,:); |
---|
| 70 | end; |
---|
| 71 | end; |
---|
| 72 | end; |
---|
| 73 | end; |
---|
| 74 | |
---|
| 75 | % on ne selectionne que la partie du tableau ou il y a des valeurs |
---|
| 76 | type_temps_compomax=type_temps_compomax(1:compteurmax,:,:); |
---|
| 77 | |
---|
| 78 | type_temps_moy=reshape(occu_type_tps,3416,4); |
---|
| 79 | disp(['iii : compteurmax =', int2str(compteurmax)]); |
---|
| 80 | % on fait la somme des types de temps sur toute la periode de temps |
---|
| 81 | % on obtent un tableau de la forme (jours-avant-apres,cluster) |
---|
| 82 | |
---|
| 83 | type_temps_compomax1(:,:)=sum(type_temps_compomax); |
---|
| 84 | type_temps_moy=sum(type_temps_moy); |
---|
| 85 | |
---|
| 86 | clear type_temps_compomax; |
---|
| 87 | |
---|
| 88 | % on fait la somme => le nbre de jour avec 1 type de temps persistant |
---|
| 89 | % pour chaque jour |
---|
| 90 | sum_kara_max=sum((type_temps_compomax1)'); |
---|
| 91 | |
---|
| 92 | % on traduit le nbre d occurence en frequences relatives |
---|
| 93 | kara_max=zeros(21,4); |
---|
| 94 | kara_moy=zeros(21,4); |
---|
| 95 | for a=1:21; |
---|
| 96 | for b=1:4; |
---|
| 97 | kara_max(a,b)=type_temps_compomax1(a,b)/sum_kara_max(a); |
---|
| 98 | kara_moy(b)=type_temps_moy(b)/3416; |
---|
| 99 | end; |
---|
| 100 | end; |
---|
| 101 | |
---|
| 102 | x=[-10:1:10]'; |
---|
| 103 | kara_diff=zeros(21,4); |
---|
| 104 | for a=1:21; |
---|
| 105 | for b=1:4 |
---|
| 106 | kara_diff(a,b)=kara_max(a,b)-kara_moy(b); |
---|
[21] | 107 | end; |
---|
| 108 | end; |
---|
[17] | 109 | |
---|
| 110 | for a=1:4; |
---|
| 111 | subplot(4,4,a+4); |
---|
| 112 | diff=kara_diff(:,a)*100; |
---|
| 113 | jour=[-10:10]'; |
---|
| 114 | if a==1; |
---|
| 115 | bar(jour,diff,'r'); |
---|
| 116 | c=[1 0.55 0]; |
---|
| 117 | bar(jour,diff),colormap(c); |
---|
| 118 | elseif a==2; |
---|
| 119 | bar(jour,diff,'g'); |
---|
| 120 | elseif a==3; |
---|
| 121 | bar(jour,diff,'b'); |
---|
| 122 | else |
---|
| 123 | bar(jour,diff,'r'); |
---|
[21] | 124 | end; |
---|
[17] | 125 | set (gca,'XTick',[-10:2:10],'XTickLabel',[-10:2:10],'fontname','Arial','fontsize',6); |
---|
| 126 | set (gca,'YTick',[-20:10:20],'YTickLabel',[-20:5:20],'fontname','Arial','fontsize',6); |
---|
| 127 | axis([-10 10 -20 20]); |
---|
| 128 | set (gca,'tickDir','out'); |
---|
| 129 | if a==1; |
---|
| 130 | title('Atl low','Fontsize',8,'Fontname','Arial'); |
---|
| 131 | text(-20,0,'Phase6'); |
---|
| 132 | elseif a==2; |
---|
| 133 | title('Atl Ridge','Fontsize',8,'Fontname','Arial'); |
---|
| 134 | elseif a==3; |
---|
| 135 | title('NAO-','Fontsize',8,'Fontname','Arial'); |
---|
| 136 | else |
---|
| 137 | title('Blocking','Fontsize',8,'Fontname','Arial'); |
---|
| 138 | end; |
---|
[21] | 139 | end; |
---|