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

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

modif. of headers for manuals hyperlinks improvements

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