1 | function carte_eof_df(ircaam_dataset,simulation,period1, period2) |
---|
2 | % carte_eof_df ++explication between period1 days and period2 days |
---|
3 | |
---|
4 | %+ |
---|
5 | % |
---|
6 | % .. _carte_eof_df.m: |
---|
7 | % |
---|
8 | % ============== |
---|
9 | % carte_eof_df.m |
---|
10 | % ============== |
---|
11 | % |
---|
12 | % ++ |
---|
13 | % |
---|
14 | % DESCRIPTION |
---|
15 | % =========== |
---|
16 | % |
---|
17 | % From :file:`eof_arpege_{simulation}_{period1}-{period2}d.mat` |
---|
18 | % and :file:`rlut_d.{simulation}.197106-09.nc`, |
---|
19 | % ``carte_eof_df`` compute ++. |
---|
20 | % |
---|
21 | % ``carte_eof_df`` plot ++. |
---|
22 | % |
---|
23 | % 1 Postscript file |
---|
24 | % :file:`carte_arpege_{simulation}_{period1}-{period2}d.eps` is |
---|
25 | % written. |
---|
26 | % |
---|
27 | % CAUTIONS |
---|
28 | % ======== |
---|
29 | % |
---|
30 | % can't work with octave because of ncload. |
---|
31 | % |
---|
32 | % EXAMPLES |
---|
33 | % ======== |
---|
34 | % |
---|
35 | % Following line read :file:`eof_arpege_AfNQIVIV_10-30d.mat` and |
---|
36 | % :file:`rlut_d.AfNQIVIV.197106-09.nc`, |
---|
37 | % compute ++, |
---|
38 | % plot ++, |
---|
39 | % write :file:`carte_arpege_AfNQIVIV_10-30d.eps`:: |
---|
40 | % |
---|
41 | % >> carte_eof_df('arpege','AfNQIVIV',10,30) |
---|
42 | % |
---|
43 | % SEE ALSO |
---|
44 | % ======== |
---|
45 | % |
---|
46 | % :ref:`eof_df.m` |
---|
47 | % |
---|
48 | % :ref:`time_serie_eof_df.m` |
---|
49 | % |
---|
50 | % TODO |
---|
51 | % ==== |
---|
52 | % |
---|
53 | % improve description |
---|
54 | % |
---|
55 | % improve file pb |
---|
56 | % |
---|
57 | % use return function |
---|
58 | % |
---|
59 | % EVOLUTIONS |
---|
60 | % ========== |
---|
61 | % |
---|
62 | % $Id$ |
---|
63 | % |
---|
64 | % - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
65 | % |
---|
66 | % * replace ndmin by period1 and ndmax by period2 |
---|
67 | % |
---|
68 | % - fplod 2009-02-02T13:45:57Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
69 | % |
---|
70 | % * created from carte_eof_ircaam_1030.m to replace it as well as |
---|
71 | % carte_eof_ircaam_1030_as.m, carte_eof_ircaam_1030_ctl.m, |
---|
72 | % carte_eof_ircaam_1030_ctl_clim.m, carte_eof_ircaam_1030_tr.m, |
---|
73 | % carte_eof_ircaam_30100.m, carte_eof_ircaam_30100_as.m, |
---|
74 | % carte_eof_ircaam_30100_ctl.m and carte_eof_ircaam_30100_tr.m |
---|
75 | % |
---|
76 | % Days will be now written ``period1``\-``period2d`` (ex: 10-30d) in filenames. |
---|
77 | % |
---|
78 | % Dataset ``arpege`` will be forced in output file names. |
---|
79 | % |
---|
80 | % Simulation name will be add to output file names (see parameters). |
---|
81 | % |
---|
82 | %- |
---|
83 | |
---|
84 | global IRCAAM_ID; |
---|
85 | global IRCAAM_OD; |
---|
86 | |
---|
87 | if nargin==4 |
---|
88 | % ircaam_dataset must be equal to arpege |
---|
89 | if ~strcmp(ircaam_dataset,'arpege') |
---|
90 | disp(['ircaam_dataset = ', ircaam_dataset]); |
---|
91 | error('eee : ircaam_dataset must be equal to arpege'); |
---|
92 | end |
---|
93 | if strcmp(ircaam_dataset,'arpege') |
---|
94 | list_simulation={'AfNQIVIV','TrNQIVIV','AsNQIVIV','CtIV','CtCl'}; |
---|
95 | end |
---|
96 | switch simulation |
---|
97 | case list_simulation |
---|
98 | % ok |
---|
99 | otherwise |
---|
100 | disp(['simulation = ', simulation]); |
---|
101 | disp(['list_simulation = ', mat2str(list_simulation)]); |
---|
102 | error('eee : simulation must be equal to one of list_simulation'); |
---|
103 | end |
---|
104 | clear list_simulation; |
---|
105 | % period1 must be lower than period2 |
---|
106 | if (period1 > period2) |
---|
107 | disp(['period1 = ', int2str(period1)]); |
---|
108 | disp(['period2 = ', int2str(period2)]); |
---|
109 | error('eee : period1 must be lower than period2'); |
---|
110 | end |
---|
111 | else |
---|
112 | usage='usage : carte_eof_df(ircaam_dataset,simulation,period1, period2)'; |
---|
113 | disp(usage); |
---|
114 | error('eee : wrong arguments numbers') |
---|
115 | end |
---|
116 | |
---|
117 | % period1 and period2 will be used in xx-yyd form in filenames |
---|
118 | df = [int2str(period1),'-',int2str(period2),'d']; |
---|
119 | clear period1; |
---|
120 | clear period2; |
---|
121 | |
---|
122 | close all; |
---|
123 | |
---|
124 | fullfilename=[IRCAAM_ID,'eof_',ircaam_dataset,'_', simulation, '_', df, '.mat']; |
---|
125 | try |
---|
126 | status=load(fullfilename,'C','L'); |
---|
127 | catch |
---|
128 | error('eee : File %s not found\n', fullfilename); |
---|
129 | end |
---|
130 | |
---|
131 | clear fullfilename; |
---|
132 | |
---|
133 | C=status.C; |
---|
134 | L=status.L; |
---|
135 | clear status; |
---|
136 | |
---|
137 | carte1=C(:,360); |
---|
138 | carte=reshape(carte1,24,15); |
---|
139 | carte=carte'; |
---|
140 | clear carte1; |
---|
141 | |
---|
142 | % definition des lat et lon |
---|
143 | fullfilename=[IRCAAM_ID,'rlut_d.',simulation, '.197106-09.nc']; |
---|
144 | ncload(fullfilename,'lat','lon'); |
---|
145 | clear fullfilename; |
---|
146 | |
---|
147 | lon=lon-180; |
---|
148 | lon=lon(54:77); |
---|
149 | lat=lat(29:43)'; |
---|
150 | |
---|
151 | figure(1); |
---|
152 | orient('landscape'); |
---|
153 | subplot(3,2,1); |
---|
154 | palette; |
---|
155 | for a=1:15; |
---|
156 | for b=1:24; |
---|
157 | if carte(a,b)>0.2; |
---|
158 | carte(a,b)=0.2; |
---|
159 | elseif carte(a,b)<-0.2; |
---|
160 | carte(a,b)=-0.2; |
---|
161 | end; |
---|
162 | end; |
---|
163 | end; |
---|
164 | carte(1,1)=-0.2001; |
---|
165 | carte(1,2)=0.2001; |
---|
166 | |
---|
167 | contourf(lon,lat,-carte,[-0.2:0.02:0.2],'LineStyle','none'); |
---|
168 | colorbar; |
---|
169 | title('OLR EOF1','Fontsize',8); |
---|
170 | hold on; |
---|
171 | cartemonde; |
---|
172 | set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';' 0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6); |
---|
173 | set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';' 0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6); |
---|
174 | set (gca,'tickDir','out'); |
---|
175 | |
---|
176 | clear carte1 x y a b carte coco; |
---|
177 | carte1=C(:,359); |
---|
178 | carte=reshape(carte1,24,15); |
---|
179 | carte=carte'; |
---|
180 | |
---|
181 | clear carte1; |
---|
182 | |
---|
183 | subplot(3,2,3); |
---|
184 | palette; |
---|
185 | for a=1:15; |
---|
186 | for b=1:24; |
---|
187 | if carte(a,b)>0.2; |
---|
188 | carte(a,b)=0.2; |
---|
189 | elseif carte(a,b)<-0.2; |
---|
190 | carte(a,b)=-0.2; |
---|
191 | end; |
---|
192 | end; |
---|
193 | end; |
---|
194 | carte(1,1)=-0.2001; |
---|
195 | carte(1,2)=0.2001; |
---|
196 | |
---|
197 | contourf(lon,lat,carte,[-0.2:0.02:0.2],'LineStyle','none'); |
---|
198 | colorbar; |
---|
199 | |
---|
200 | title('OLR EOF2','Fontsize',8); |
---|
201 | hold on; |
---|
202 | cartemonde; |
---|
203 | set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';' 0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6); |
---|
204 | set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';' 0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6); |
---|
205 | set (gca,'tickDir','out'); |
---|
206 | |
---|
207 | clear carte1 x y a b carte coco; |
---|
208 | carte1=C(:,358); |
---|
209 | carte=reshape(carte1,24,15); |
---|
210 | carte=carte'; |
---|
211 | clear carte1; |
---|
212 | |
---|
213 | subplot(3,2,5); |
---|
214 | palette; |
---|
215 | for a=1:15; |
---|
216 | for b=1:24; |
---|
217 | if carte(a,b)>0.2; |
---|
218 | carte(a,b)=0.2; |
---|
219 | elseif carte(a,b)<-0.2; |
---|
220 | carte(a,b)=-0.2; |
---|
221 | end; |
---|
222 | end; |
---|
223 | end; |
---|
224 | carte(1,1)=-0.2001; |
---|
225 | carte(1,2)=0.2001; |
---|
226 | |
---|
227 | contourf(lon,lat,-carte,[-0.2:0.02:0.2],'LineStyle','none'); |
---|
228 | colorbar; |
---|
229 | title('OLR EOF3','Fontsize',8); |
---|
230 | hold on; |
---|
231 | cartemonde; |
---|
232 | set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';' 0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6); |
---|
233 | set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';' 0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6); |
---|
234 | set (gca,'tickDir','out'); |
---|
235 | |
---|
236 | clear carte1 x y a b carte coco; |
---|
237 | carte1=C(:,357); |
---|
238 | carte=reshape(carte1,24,15); |
---|
239 | carte=carte'; |
---|
240 | clear carte1; |
---|
241 | |
---|
242 | subplot(3,2,2); |
---|
243 | palette; |
---|
244 | for a=1:15; |
---|
245 | for b=1:24; |
---|
246 | if carte(a,b)>0.2; |
---|
247 | carte(a,b)=0.2; |
---|
248 | elseif carte(a,b)<-0.2; |
---|
249 | carte(a,b)=-0.2; |
---|
250 | end; |
---|
251 | end; |
---|
252 | end; |
---|
253 | carte(1,1)=-0.2001; |
---|
254 | carte(1,2)=0.2001; |
---|
255 | |
---|
256 | contourf(lon,lat,-carte,[-0.2:0.02:0.2],'LineStyle','none'); |
---|
257 | colorbar; |
---|
258 | title('OLR EOF4','Fontsize',8); |
---|
259 | hold on; |
---|
260 | cartemonde; |
---|
261 | set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';' 0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6); |
---|
262 | set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';' 0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6); |
---|
263 | set (gca,'tickDir','out'); |
---|
264 | |
---|
265 | subplot(3,2,4); |
---|
266 | vaude=0; |
---|
267 | for a=1:360; |
---|
268 | vaude=vaude+L(a,a); |
---|
269 | end; |
---|
270 | vecteurs=zeros(20,1); |
---|
271 | for a=1:20; |
---|
272 | b=360-(a-1); |
---|
273 | vecteurs(a)=100*(L(b,b)/vaude); |
---|
274 | end; |
---|
275 | x=[1:20]'; |
---|
276 | |
---|
277 | bar(x,vecteurs,'LineStyle','none') |
---|
278 | axis([0.5 20.5 0 25]); |
---|
279 | set (gca,'YTick',[0:5:25],'YTickLabel',[0:5:25],'fontname','Arial','fontsize',6); |
---|
280 | set (gca,'XTick',[2:2:20],'XTickLabel',[2:2:20],'fontname','Arial','fontsize',6); |
---|
281 | set (gca,'tickDir','out'); |
---|
282 | |
---|
283 | fullfilename=[IRCAAM_OD,'carte_eof_', ircaam_dataset, '_', simulation, '_', df, '.eps']; |
---|
284 | print('-depsc2',fullfilename); |
---|
285 | clear fullfilename; |
---|
286 | |
---|
287 | clear ircaam_dataset; |
---|
288 | clear simulation; |
---|
289 | clear df; |
---|