source: trunk/src/mode_sahelien/carte_eof234_jjas_df.m @ 44

Last change on this file since 44 was 37, checked in by pinsard, 15 years ago

parametrisation of carte_eof234_jjas_....m

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