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