1 | function reconstitution_ER_rossby_df(period1, period2) |
---|
2 | % reconstitution_ER_rossby_df ++explication between period1 days and period2 days |
---|
3 | |
---|
4 | %+ |
---|
5 | % |
---|
6 | % .. _reconstitution_ER_rossby_df.m: |
---|
7 | % |
---|
8 | % ============================= |
---|
9 | % reconstitution_ER_rossby_df.m |
---|
10 | % ============================= |
---|
11 | % |
---|
12 | % ++ |
---|
13 | % |
---|
14 | % DESCRIPTION |
---|
15 | % =========== |
---|
16 | % |
---|
17 | % plot ++ from file :file:`eof_rossby_jjas_2006_10-30d.mat`, |
---|
18 | % produce a ASCII file :file:`eof12_rossby_10-30d.txt`, |
---|
19 | % produce 3 Postscript files :file:`reconstitution1_eof12_filtreER_10-30d.eps`. |
---|
20 | % |
---|
21 | % EXAMPLES |
---|
22 | % ======== |
---|
23 | % |
---|
24 | % Following line read :file:`eof_rossby_jjas_2006_10-30d.mat`, produce an ASCII file |
---|
25 | % :file:`eof12_rossby_10-30d.txt`, produce 3 Postscript files |
---|
26 | % :file:`reconstitution1_eof12_filtreER_10-30d.eps`:: |
---|
27 | % |
---|
28 | % >> reconstitution_ER_rossby_df(10,30); |
---|
29 | % |
---|
30 | % SEE ALSO |
---|
31 | % ======== |
---|
32 | % |
---|
33 | % :ref:`carte_eof_ER_jjas_df.m` |
---|
34 | % |
---|
35 | % :ref:`carte_eof_ER_1030_article.m` |
---|
36 | % |
---|
37 | % :ref:`time_serie_ER_rossby_df.m` |
---|
38 | % |
---|
39 | % TODO |
---|
40 | % ==== |
---|
41 | % |
---|
42 | % improve description |
---|
43 | % |
---|
44 | % improve file pb |
---|
45 | % |
---|
46 | % use return function |
---|
47 | % |
---|
48 | % clean variables and plot |
---|
49 | % |
---|
50 | % EVOLUTIONS |
---|
51 | % ========== |
---|
52 | % |
---|
53 | % $Id$ |
---|
54 | % |
---|
55 | % - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
56 | % |
---|
57 | % * add try/catch on opening file for reading |
---|
58 | % |
---|
59 | % - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
60 | % |
---|
61 | % * replace ndmin by period1 and ndmax by period2 |
---|
62 | % |
---|
63 | % - fplod 2009-01-28T07:50:45Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
64 | % |
---|
65 | % * created from reconstitution_ER_rossby_1030.m to replace it as well as |
---|
66 | % reconstitution_ER_rossby_30100.m |
---|
67 | % |
---|
68 | % Days will be now written ``period1``\-``period2d`` (ex: 10-30d) in filenames. |
---|
69 | % |
---|
70 | %- |
---|
71 | |
---|
72 | global IRCAAM_ID; |
---|
73 | global IRCAAM_OD; |
---|
74 | |
---|
75 | if nargin==2 |
---|
76 | % period1 must be lower than period2 |
---|
77 | if (period1 > period2) |
---|
78 | disp(['period1 = ', int2str(period1)]); |
---|
79 | disp(['period2 = ', int2str(period2)]); |
---|
80 | error('eee : period1 must be lower than period2'); |
---|
81 | end |
---|
82 | else |
---|
83 | usage='usage : reconstitution_ER_rossby_df(period1, period2)'; |
---|
84 | disp(usage); |
---|
85 | error('eee : wrong arguments numbers') |
---|
86 | end |
---|
87 | % period1 and period2 will be used in xx-yyd form in filenames |
---|
88 | df = [int2str(period1),'-',int2str(period2),'d']; |
---|
89 | clear period1; |
---|
90 | clear period2; |
---|
91 | |
---|
92 | close all; |
---|
93 | |
---|
94 | %lon=[-30:2.5:30], lat=[-10:2.5:30] |
---|
95 | |
---|
96 | fullfilename=[IRCAAM_ID,'eof_rossby_jjas_2006_',df,'.mat']; |
---|
97 | try |
---|
98 | status=load(fullfilename,'C','olr'); |
---|
99 | catch |
---|
100 | error('eee : File %s not found\n', fullfilename); |
---|
101 | end |
---|
102 | |
---|
103 | clear fullfilename; |
---|
104 | |
---|
105 | C=status.C; |
---|
106 | olr=status.olr; |
---|
107 | clear status; |
---|
108 | |
---|
109 | olr=olr'; |
---|
110 | PC1=olr*C; |
---|
111 | |
---|
112 | cosa=zeros(3,3416,425); |
---|
113 | % boucle sur les VP |
---|
114 | for a=1:3; |
---|
115 | for b=1:3416 % boucle sur le temps |
---|
116 | for c=1:425 % boucle sur l espace |
---|
117 | cosa(a,b,c)=PC1(b,426-a)*C(c,426-a); |
---|
118 | end; |
---|
119 | end; |
---|
120 | end; |
---|
121 | |
---|
122 | cosa1(:,:)=cosa(1,:,:); |
---|
123 | cosa1=reshape(cosa1,3416,25,17); |
---|
124 | |
---|
125 | cosa2(:,:)=cosa(2,:,:); |
---|
126 | cosa2=reshape(cosa2,3416,25,17); |
---|
127 | |
---|
128 | cosabis=cosa(1:2,:,:); |
---|
129 | cosa12(:,:)=sum(cosabis); |
---|
130 | clear cosabis; |
---|
131 | cosa12=reshape(cosa12,3416,25,17); |
---|
132 | |
---|
133 | figure(1); |
---|
134 | orient('landscape') |
---|
135 | figure(2); |
---|
136 | orient('landscape') |
---|
137 | figure(3); |
---|
138 | orient('landscape') |
---|
139 | |
---|
140 | % On sélectionne le domaine géographique |
---|
141 | |
---|
142 | % la latitude : 7.5N (8) 12.5N (10) |
---|
143 | % la longitude : 10W (9) 10E(17) |
---|
144 | lat1=8; |
---|
145 | lat2=10; |
---|
146 | lon1=9; |
---|
147 | lon2=17; |
---|
148 | taille=(lat2-lat1+1)*(lon2-lon1+1); |
---|
149 | |
---|
150 | cosa12=cosa12(:,lon1:lon2,lat1:lat2); |
---|
151 | clear cosi2; |
---|
152 | cosa12=reshape(cosa12,3416,taille); |
---|
153 | cosa12=cosa12'; |
---|
154 | cosa12=mean(cosa12); |
---|
155 | cosa12=cosa12'; |
---|
156 | |
---|
157 | fullfilename=[IRCAAM_ID,'eof12_rossby_',df,'.txt']; |
---|
158 | save(fullfilename,'cosa12','-ASCII'); |
---|
159 | clear fullfilename; |
---|
160 | |
---|
161 | cosa12=reshape(cosa12,122,28); |
---|
162 | |
---|
163 | % On sélectionne le domaine géographique |
---|
164 | olr=reshape(olr,3416,25,17); |
---|
165 | cosa4=olr(:,lon1:lon2,lat1:lat2); |
---|
166 | clear olr; |
---|
167 | cosa4=reshape(cosa4,3416,taille); |
---|
168 | clear taille; |
---|
169 | cosa4=cosa4'; |
---|
170 | cosa4=mean(cosa4); |
---|
171 | cosa4=cosa4'; |
---|
172 | cosa4=reshape(cosa4,122,28); |
---|
173 | |
---|
174 | for a=1:28; |
---|
175 | if a<12; |
---|
176 | figure(1); |
---|
177 | subplot(4,3,a); |
---|
178 | elseif a<24 |
---|
179 | figure(2); |
---|
180 | subplot(4,3,a-11); |
---|
181 | else |
---|
182 | figure(3); |
---|
183 | subplot(4,3,a-23); |
---|
184 | end; |
---|
185 | y2=cosa12(:,a); |
---|
186 | y4=cosa4(:,a); |
---|
187 | x=[1:122]'; |
---|
188 | plot(x,y2); |
---|
189 | hold on; |
---|
190 | plot(x,y4,'k'); |
---|
191 | y5=zeros(122,1); |
---|
192 | plot(x,y5,'k:'); |
---|
193 | |
---|
194 | title(a+1978,'Fontsize',8); |
---|
195 | if a==2; |
---|
196 | text(0,65,'OLR 5 -17.5N et 10W - 10E'); |
---|
197 | elseif a==13; |
---|
198 | text(0,65,'OLR 5 - 17.5N et 10W - 10E'); |
---|
199 | end; |
---|
200 | set (gca,'tickDir','out'); |
---|
201 | if a==11; |
---|
202 | aa=legend('OLR VP1-2','OLR NOAA'); |
---|
203 | set (aa,'fontsize',8,'Position',[0.6800 0.1039 0.1270 0.1642]) |
---|
204 | legend boxoff; |
---|
205 | elseif a==22; |
---|
206 | clear aa; |
---|
207 | aa=legend('OLR VP1-2','OLR NOAA'); |
---|
208 | set (aa,'fontsize',8,'Position',[0.6800 0.1039 0.1270 0.1642]) |
---|
209 | legend boxoff; |
---|
210 | end; |
---|
211 | axis([1 122 -15 15]); |
---|
212 | set (gca,'YTick',[-15:5:15],'YTickLabel',[-15:5:15],'fontname','Arial','fontsize',6); |
---|
213 | set (gca,'XTick',[10:10:122],'XTickLabel',[10:10:122],'fontname','Arial','fontsize',6); |
---|
214 | |
---|
215 | end; |
---|
216 | |
---|
217 | figure(1); |
---|
218 | fullfilename=[IRCAAM_OD,'reconstitution1_eof12_filtreER_',df,'.eps']; |
---|
219 | print('-depsc2',fullfilename); |
---|
220 | clear fullfilename; |
---|
221 | |
---|
222 | figure(2); |
---|
223 | fullfilename=[IRCAAM_OD,'reconstitution2_eof12_filtreER_',df,'.eps']; |
---|
224 | print('-depsc2',fullfilename); |
---|
225 | clear fullfilename; |
---|
226 | |
---|
227 | figure(3); |
---|
228 | fullfilename=[IRCAAM_OD,'reconstitution3_eof12_filtreER_',df,'.eps']; |
---|
229 | print('-depsc2',fullfilename); |
---|
230 | clear fullfilename; |
---|