1 | function carte_eof234_jjas_df(period1, period2) |
---|
2 | % carte_eof234_jjas_df ++explication between period1 days and period2 days |
---|
3 | |
---|
4 | %+ |
---|
5 | % ====================== |
---|
6 | % carte_eof234_jjas_df.m |
---|
7 | % ====================== |
---|
8 | % |
---|
9 | % ++ |
---|
10 | % |
---|
11 | % DESCRIPTION |
---|
12 | % =========== |
---|
13 | % |
---|
14 | % plot ++ from file eof_10-30d_jjas.mat |
---|
15 | % |
---|
16 | % EXAMPLES |
---|
17 | % ======== |
---|
18 | % |
---|
19 | % Following line read eof_10-30d_jjas.mat, plot ++and produce a Postcript file |
---|
20 | % resultats_eof_jjas_2006_10-30d.eps |
---|
21 | % produce also carte_eofx_mode_sahel_10-30d.dat and |
---|
22 | % carte_eofx_mode_sahel_10-30d.ctl (GRADS files) and vecteurs_eof_10-30d.txt. |
---|
23 | % :: |
---|
24 | % |
---|
25 | % >> carte_eof234_jjas_df(10,30); |
---|
26 | % |
---|
27 | % SEE ALSO |
---|
28 | % ======== |
---|
29 | % |
---|
30 | % olr_eof_1025.m_ |
---|
31 | % |
---|
32 | % .. _olr_eof_1025.m : olr_eof_1025.m.html |
---|
33 | % |
---|
34 | % reconstitution_1025.m_ |
---|
35 | % |
---|
36 | % .. _reconstitution_1025.m : reconstitution_1025.m.html |
---|
37 | % |
---|
38 | % time_serie_jjas_10_25.m_ |
---|
39 | % |
---|
40 | % .. _time_serie_jjas_10_25.m : time_serie_jjas_10_25.m.html |
---|
41 | % |
---|
42 | % sauvegrads.m_ |
---|
43 | % |
---|
44 | % .. _sauvegrads.m : sauvegrads.m.html |
---|
45 | % |
---|
46 | % TODO |
---|
47 | % ==== |
---|
48 | % |
---|
49 | % improve description |
---|
50 | % |
---|
51 | % improve file pb |
---|
52 | % |
---|
53 | % use return function |
---|
54 | % |
---|
55 | % change filename of Postscript file because same as in carte_eof_ER_jjas_df.m |
---|
56 | % |
---|
57 | % directory for sauvegrads files |
---|
58 | % |
---|
59 | % control of sauvegrads call |
---|
60 | % |
---|
61 | % why ``-carte`` in contourf and sauvegrads instead of ``carte`` ? |
---|
62 | % |
---|
63 | % EVOLUTIONS |
---|
64 | % ========== |
---|
65 | % |
---|
66 | % $Id$ |
---|
67 | % |
---|
68 | % - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
69 | % |
---|
70 | % * add try/catch on opening file for reading |
---|
71 | % |
---|
72 | % - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
73 | % |
---|
74 | % * replace ndmin by period1 and ndmax by period2 |
---|
75 | % |
---|
76 | % - fplod 2009-01-27T14:49:51Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
77 | % |
---|
78 | % * created from carte_eof234_jjas_1025.m and carte_eof234_jjas_1030.m |
---|
79 | % to replace both. |
---|
80 | % |
---|
81 | % Days will be now written ``period1``\-``period2d`` (ex: 10-30d) in filenames. |
---|
82 | % |
---|
83 | % * add sauvegrads on first EOF for homogenity |
---|
84 | % |
---|
85 | %- |
---|
86 | |
---|
87 | |
---|
88 | global IRCAAM_ID; |
---|
89 | global IRCAAM_OD; |
---|
90 | |
---|
91 | if nargin==2 |
---|
92 | % period1 must be lower than period2 |
---|
93 | if (period1 > period2) |
---|
94 | disp(['period1 = ', int2str(period1)]); |
---|
95 | disp(['period2 = ', int2str(period2)]); |
---|
96 | error('eee : period1 must be lower than period2'); |
---|
97 | end |
---|
98 | else |
---|
99 | usage='usage : carte_eof234_jjas_df(period1, period2)'; |
---|
100 | disp(usage); |
---|
101 | error('eee : wrong arguments numbers') |
---|
102 | end |
---|
103 | |
---|
104 | % period1 and period2 will be used in xx-yyd form in filenames |
---|
105 | df = [int2str(period1),'-',int2str(period2),'d']; |
---|
106 | clear period1; |
---|
107 | clear period2; |
---|
108 | |
---|
109 | |
---|
110 | fullfilename=[IRCAAM_ID,'eof_',df,'_jjas.mat']; |
---|
111 | try |
---|
112 | status=load(fullfilename,'C','L'); |
---|
113 | catch |
---|
114 | error('eee : File %s not found\n', fullfilename); |
---|
115 | end |
---|
116 | |
---|
117 | clear fullfilename; |
---|
118 | |
---|
119 | C=status.C; |
---|
120 | L=status.L; |
---|
121 | clear status; |
---|
122 | |
---|
123 | carte1=C(:,425); |
---|
124 | |
---|
125 | carte=reshape(carte1,25,17); |
---|
126 | carte=carte'; |
---|
127 | |
---|
128 | clear carte1; |
---|
129 | % defintion des lat et lon |
---|
130 | lon=[-30:2.5:30]'; |
---|
131 | lat=[-10:2.5:30]; |
---|
132 | |
---|
133 | figure(1); |
---|
134 | orient('landscape'); |
---|
135 | subplot(3,2,1); |
---|
136 | palette; |
---|
137 | for a=1:17; |
---|
138 | for b=1:25; |
---|
139 | if carte(a,b)>0.2; |
---|
140 | carte(a,b)=0.2; |
---|
141 | elseif carte(a,b)<-0.2; |
---|
142 | carte(a,b)=-0.2; |
---|
143 | end; |
---|
144 | end; |
---|
145 | end; |
---|
146 | carte(1,1)=-0.2001; |
---|
147 | carte(1,2)=0.2001; |
---|
148 | |
---|
149 | contourf(lon,lat,-carte,[-0.2:0.02:0.2],'LineStyle','none'); |
---|
150 | gradsname=['carte_eof1_mode_sahel_',df]; |
---|
151 | sauvegrads(gradsname,-carte,[-30 2.5 -10 2.5]); |
---|
152 | clear gradsname; |
---|
153 | |
---|
154 | colorbar; |
---|
155 | title('OLR EOF1','Fontsize',8); |
---|
156 | hold on; |
---|
157 | cartemonde; |
---|
158 | set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';' 0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6); |
---|
159 | set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';' 0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6); |
---|
160 | set (gca,'tickDir','out'); |
---|
161 | |
---|
162 | clear carte1 x y a b carte coco; |
---|
163 | carte1=C(:,424); |
---|
164 | carte=reshape(carte1,25,17); |
---|
165 | carte=carte'; |
---|
166 | |
---|
167 | clear carte1; |
---|
168 | lon=[-30:2.5:30]'; |
---|
169 | lat=[-10:2.5:30]; |
---|
170 | |
---|
171 | subplot(3,2,3); |
---|
172 | palette; |
---|
173 | for a=1:17; |
---|
174 | for b=1:25; |
---|
175 | if carte(a,b)>0.2; |
---|
176 | carte(a,b)=0.2; |
---|
177 | elseif carte(a,b)<-0.2; |
---|
178 | carte(a,b)=-0.2; |
---|
179 | end; |
---|
180 | end; |
---|
181 | end; |
---|
182 | carte(1,1)=-0.2001; |
---|
183 | carte(1,2)=0.2001; |
---|
184 | |
---|
185 | contourf(lon,lat,-carte,[-0.2:0.02:0.2],'LineStyle','none'); |
---|
186 | gradsname=['carte_eof2_mode_sahel_',df]; |
---|
187 | sauvegrads(gradsname,-carte,[-30 2.5 -10 2.5]); |
---|
188 | clear gradsname; |
---|
189 | colorbar; |
---|
190 | |
---|
191 | title('OLR EOF2','Fontsize',8); |
---|
192 | hold on; |
---|
193 | cartemonde; |
---|
194 | set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';' 0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6); |
---|
195 | set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';' 0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6); |
---|
196 | set (gca,'tickDir','out'); |
---|
197 | |
---|
198 | clear carte1 x y a b carte coco; |
---|
199 | carte1=C(:,423); |
---|
200 | carte=reshape(carte1,25,17); |
---|
201 | carte=carte'; |
---|
202 | clear carte1; |
---|
203 | |
---|
204 | % defintion des lat et lon |
---|
205 | lon=[-30:2.5:30]'; |
---|
206 | lat=[-10:2.5:30]; |
---|
207 | |
---|
208 | subplot(3,2,5); |
---|
209 | palette; |
---|
210 | for a=1:17; |
---|
211 | for b=1:25; |
---|
212 | if carte(a,b)>0.2; |
---|
213 | carte(a,b)=0.2; |
---|
214 | elseif carte(a,b)<-0.2; |
---|
215 | carte(a,b)=-0.2; |
---|
216 | end; |
---|
217 | end; |
---|
218 | end; |
---|
219 | carte(1,1)=-0.2001; |
---|
220 | carte(1,2)=0.2001; |
---|
221 | |
---|
222 | contourf(lon,lat,-carte,[-0.2:0.02:0.2],'LineStyle','none'); |
---|
223 | gradsname=['carte_eof3_mode_sahel_',df]; |
---|
224 | sauvegrads(gradsname,-carte,[-30 2.5 -10 2.5]); |
---|
225 | clear gradsname; |
---|
226 | colorbar; |
---|
227 | title('OLR EOF3','Fontsize',8); |
---|
228 | hold on; |
---|
229 | cartemonde; |
---|
230 | set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';' 0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6); |
---|
231 | set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';' 0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6); |
---|
232 | set (gca,'tickDir','out'); |
---|
233 | |
---|
234 | clear carte1 x y a b carte coco; |
---|
235 | carte1=C(:,422); |
---|
236 | carte=reshape(carte1,25,17); |
---|
237 | carte=carte'; |
---|
238 | clear carte1; |
---|
239 | |
---|
240 | % defintion des lat et lon |
---|
241 | lon=[-30:2.5:30]'; |
---|
242 | lat=[-10:2.5:30]; |
---|
243 | |
---|
244 | subplot(3,2,2); |
---|
245 | palette; |
---|
246 | for a=1:17; |
---|
247 | for b=1:25; |
---|
248 | if carte(a,b)>0.2; |
---|
249 | carte(a,b)=0.2; |
---|
250 | elseif carte(a,b)<-0.2; |
---|
251 | carte(a,b)=-0.2; |
---|
252 | end; |
---|
253 | end; |
---|
254 | end; |
---|
255 | carte(1,1)=-0.2001; |
---|
256 | carte(1,2)=0.2001; |
---|
257 | |
---|
258 | contourf(lon,lat,-carte,[-0.2:0.02:0.2],'LineStyle','none'); |
---|
259 | gradsname=['carte_eof4_mode_sahel_',df]; |
---|
260 | sauvegrads(gradsname,-carte,[-30 2.5 -10 2.5]); |
---|
261 | clear gradsname; |
---|
262 | colorbar; |
---|
263 | title('OLR EOF4','Fontsize',8); |
---|
264 | hold on; |
---|
265 | cartemonde; |
---|
266 | set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';' 0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6); |
---|
267 | set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';' 0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6); |
---|
268 | set (gca,'tickDir','out'); |
---|
269 | |
---|
270 | subplot(3,2,4); |
---|
271 | vaude=0; |
---|
272 | for a=1:425; |
---|
273 | vaude=vaude+L(a,a); |
---|
274 | end; |
---|
275 | vecteurs=zeros(20,1); |
---|
276 | for a=1:20; |
---|
277 | b=425-(a-1); |
---|
278 | vecteurs(a)=100*(L(b,b)/vaude); |
---|
279 | end; |
---|
280 | x=[1:20]'; |
---|
281 | |
---|
282 | bar(x,vecteurs,'LineStyle','none') |
---|
283 | fullfilename=[IRCAAM_OD,'vecteurs_eof_',df,'.txt']; |
---|
284 | save(fullfilename,'vecteurs','-ASCII'); |
---|
285 | clear fullfilename; |
---|
286 | |
---|
287 | axis([0.5 20.5 0 25]); |
---|
288 | set (gca,'YTick',[0:5:25],'YTickLabel',[0:5:25],'fontname','Arial','fontsize',6); |
---|
289 | set (gca,'XTick',[2:2:20],'XTickLabel',[2:2:20],'fontname','Arial','fontsize',6); |
---|
290 | set (gca,'tickDir','out'); |
---|
291 | |
---|
292 | fullfilename=[IRCAAM_OD,'resultats_eof_jjas_2006_',df,'.eps']; |
---|
293 | print('-depsc2',fullfilename); |
---|
294 | clear fullfilename; |
---|