1 | function 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 | |
---|
73 | global IRCAAM_ID; |
---|
74 | global IRCAAM_OD; |
---|
75 | |
---|
76 | if 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 |
---|
83 | else |
---|
84 | usage='usage : reconstitution_ER_rossby_df(period1, period2)'; |
---|
85 | disp(usage); |
---|
86 | error('eee : wrong arguments numbers') |
---|
87 | end |
---|
88 | % period1 and period2 will be used in xx-yyd form in filenames |
---|
89 | df = [int2str(period1),'-',int2str(period2),'d']; |
---|
90 | clear period1; |
---|
91 | clear period2; |
---|
92 | |
---|
93 | close all; |
---|
94 | |
---|
95 | %lon=[-30:2.5:30], lat=[-10:2.5:30] |
---|
96 | |
---|
97 | fullfilename=[IRCAAM_ID,'eof_rossby_jjas_2006_',df,'.mat']; |
---|
98 | try |
---|
99 | status=load(fullfilename,'C','olr'); |
---|
100 | catch |
---|
101 | error('eee : File %s not found\n', fullfilename); |
---|
102 | end |
---|
103 | |
---|
104 | clear fullfilename; |
---|
105 | |
---|
106 | C=status.C; |
---|
107 | olr=status.olr; |
---|
108 | clear status; |
---|
109 | |
---|
110 | olr=olr'; |
---|
111 | PC1=olr*C; |
---|
112 | |
---|
113 | cosa=zeros(3,3416,425); |
---|
114 | % boucle sur les VP |
---|
115 | for 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; |
---|
121 | end; |
---|
122 | |
---|
123 | cosa1(:,:)=cosa(1,:,:); |
---|
124 | cosa1=reshape(cosa1,3416,25,17); |
---|
125 | |
---|
126 | cosa2(:,:)=cosa(2,:,:); |
---|
127 | cosa2=reshape(cosa2,3416,25,17); |
---|
128 | |
---|
129 | cosabis=cosa(1:2,:,:); |
---|
130 | cosa12(:,:)=sum(cosabis); |
---|
131 | clear cosabis; |
---|
132 | cosa12=reshape(cosa12,3416,25,17); |
---|
133 | |
---|
134 | figure(1); |
---|
135 | orient('landscape') |
---|
136 | figure(2); |
---|
137 | orient('landscape') |
---|
138 | figure(3); |
---|
139 | orient('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) |
---|
145 | lat1=8; |
---|
146 | lat2=10; |
---|
147 | lon1=9; |
---|
148 | lon2=17; |
---|
149 | taille=(lat2-lat1+1)*(lon2-lon1+1); |
---|
150 | |
---|
151 | cosa12=cosa12(:,lon1:lon2,lat1:lat2); |
---|
152 | clear cosi2; |
---|
153 | cosa12=reshape(cosa12,3416,taille); |
---|
154 | cosa12=cosa12'; |
---|
155 | cosa12=mean(cosa12); |
---|
156 | cosa12=cosa12'; |
---|
157 | |
---|
158 | fullfilename=[IRCAAM_ID,'eof12_rossby_',df,'.txt']; |
---|
159 | save(fullfilename,'cosa12','-ASCII'); |
---|
160 | clear fullfilename; |
---|
161 | |
---|
162 | cosa12=reshape(cosa12,122,28); |
---|
163 | |
---|
164 | % On selectionne la demaine geographique |
---|
165 | olr=reshape(olr,3416,25,17); |
---|
166 | cosa4=olr(:,lon1:lon2,lat1:lat2); |
---|
167 | clear olr; |
---|
168 | cosa4=reshape(cosa4,3416,taille); |
---|
169 | clear taille; |
---|
170 | cosa4=cosa4'; |
---|
171 | cosa4=mean(cosa4); |
---|
172 | cosa4=cosa4'; |
---|
173 | cosa4=reshape(cosa4,122,28); |
---|
174 | |
---|
175 | for 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 | |
---|
216 | end; |
---|
217 | |
---|
218 | figure(1); |
---|
219 | fullfilename=[IRCAAM_OD,'reconstitution1_eof12_filtreER_',df,'.eps']; |
---|
220 | print('-depsc2',fullfilename); |
---|
221 | clear fullfilename; |
---|
222 | |
---|
223 | figure(2); |
---|
224 | fullfilename=[IRCAAM_OD,'reconstitution2_eof12_filtreER_',df,'.eps']; |
---|
225 | print('-depsc2',fullfilename); |
---|
226 | clear fullfilename; |
---|
227 | |
---|
228 | figure(3); |
---|
229 | fullfilename=[IRCAAM_OD,'reconstitution3_eof12_filtreER_',df,'.eps']; |
---|
230 | print('-depsc2',fullfilename); |
---|
231 | clear fullfilename; |
---|