source: trunk/src/mode_sahelien/reconstitution_ER_rossby_df.m @ 75

Last change on this file since 75 was 75, checked in by pinsard, 14 years ago

improvements of headers and unset in shell scripts

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