source: trunk/src/SIMULS_IRCAAM/time_serie_eof_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.3 KB
Line 
1function time_serie_eof_df(ircaam_dataset,simulation,period1, period2)
2% time_serie_eof_df ++explication between period1 days and period2 days
3
4%+
5%
6% ===================
7% time_serie_eof_df.m
8% ===================
9%
10% ++
11%
12% DESCRIPTION
13% ===========
14%
15% From eof_arpege\_\ *simulation*\ _  \ *period1*\ -\ *period2*\ d.mat,
16% ``time_serie_eof_df`` compute ++.
17%
18% ``time_serie_eof_df`` plot ++.
19%
20% ``time_serie_eof_df`` save eof[12]_arpege_\ *simulation*\ _  \ *period1*\ -\ *period2*\ d.txt.
21%
22% 2 Postscript files
23% time_serie_arpege\_\ *simulation*\ _ \ *period1*\ -\ *period2*\ d_part[12].eps are
24% written.
25%
26% EXAMPLES
27% ========
28%
29% Following line read ``eof_arpege_TrNQIVIV_10-30d.mat``,
30% compute ++,
31% plot ++,
32% write ``eof[12]_arpege_TrNQIVIV_10-30d`` and
33% write ``time_serie_arpege_TrNQIVIV_10-30d_part[12].eps``
34% ::
35%
36% >> time_serie_eof_df('arpege','TrNQIVIV',10,30)
37%
38% SEE ALSO
39% ========
40%
41% eof_df.m_
42%
43% .. _eof_df.m : eof_df.m.html
44%
45% carte_eof_df.m_
46%
47% .. _carte_eof_df.m : carte_eof_df.m.html
48%
49% TODO
50% ====
51%
52% improve description
53%
54% improve file pb
55%
56% use return function
57%
58% EVOLUTIONS
59% ==========
60%
61% $Id$
62%
63% - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin)
64%
65%   * add try/catch on opening file for reading
66%
67% - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin)
68%
69%   * replace ndmin by period1 and ndmax by period2
70%
71% - fplod 2009-02-02T10:01:21Z aedon.locean-ipsl.upmc.fr (Darwin)
72%
73%   * created from time_serie_afr_1030.m to replace it as well as
74%     time_serie_afr_30100.m, time_serie_as_1030.m, time_serie_as_30100.m,
75%     time_serie_ctl_1030.m, time_serie_ctl_30100.m, time_serie_tr_1030.m and
76%     time_serie_tr_30100.m
77%
78%     Days will be now written ``period1``\-``period2d`` (ex: 10-30d) in filenames.
79%
80%     Dataset ``arpege`` will be forced in output file names.
81%
82%     Simulation name will be add to  output file names (see parameters).
83%
84%     Postscript files names will be suffixe by partx instead of letter.
85%
86%-
87
88global IRCAAM_ID;
89global IRCAAM_OD;
90
91if nargin==4
92 % ircaam_dataset must be equal to arpege
93 if ~strcmp(ircaam_dataset,'arpege')
94  disp(['ircaam_dataset = ', ircaam_dataset]);
95  error('eee : ircaam_dataset must be equal to arpege');
96 end
97 if strcmp(ircaam_dataset,'arpege')
98  list_simulation={'AfNQIVIV','TrNQIVIV','AsNQIVIV','CtIV','CtCl'};
99 end
100 switch simulation
101 case list_simulation
102  % ok
103 otherwise
104  disp(['simulation = ', simulation]);
105  disp(['list_simulation = ', mat2str(list_simulation)]);
106  error('eee : simulation must be equal to one of list_simulation');
107 end
108 clear list_simulation;
109 % period1 must be lower than period2
110 if (period1 > period2)
111  disp(['period1 = ', int2str(period1)]);
112  disp(['period2 = ', int2str(period2)]);
113  error('eee : period1 must be lower than period2');
114 end
115else
116  usage='usage : time_serie_jjas_df(ircaam_dataset,simulation,period1, period2)';
117  disp(usage);
118  error('eee : wrong arguments numbers')
119end
120
121% period1 and period2 will be used in xx-yyd form in filenames
122df = [int2str(period1),'-',int2str(period2),'d'];
123clear period1;
124clear period2;
125
126close all;
127
128fullfilename=[IRCAAM_ID,'eof_',ircaam_dataset,'_', simulation, '_', df, '.mat'];
129try
130 status=load(fullfilename,'C','olr');
131catch
132 error('eee : File %s not found\n', fullfilename);
133end
134
135clear fullfilename;
136
137C=status.C;
138olr=status.olr;
139clear status;
140
141olr=olr';
142PC1=olr*C;
143
144%%%%%%% cronique de la VP1
145time_serie_olr1=PC1(:,360);
146time_serie_olr2=PC1(:,359);
147
148dt_olr1=std(time_serie_olr1);
149dt_olr2=std(time_serie_olr2);
150
151for a=1:3538;
152   time_serie_olr1(a)=time_serie_olr1(a)/dt_olr1;
153   time_serie_olr2(a)=time_serie_olr2(a)/dt_olr2;
154end;
155
156fullfilename=[IRCAAM_OD,'eof1_',ircaam_dataset,'_', simulation, '_', df,'.txt'];
157save(fullfilename,'time_serie_olr1','-ASCII');
158clear fullfilename;
159
160fullfilename=[IRCAAM_OD,'eof2_',ircaam_dataset,'_', simulation, '_', df,'.txt'];
161save(fullfilename','time_serie_olr2','-ASCII');
162clear fullfilename;
163
164x=[1:3538]';
165for a=1:29;
166   if a<12;
167      figure(1);
168      subplot(4,3,a);
169   elseif a<23;
170      figure(2);
171      subplot(4,3,a-11);
172   else
173      figure(3);
174      subplot(4,3,a-22);
175   end;
176   clear koro1;
177   debut=(a-1)*122+1;
178   fin=a*122;
179   koro1=time_serie_olr1(debut:fin);
180   koro2=time_serie_olr2(debut:fin);
181   clear x;
182   x=[1:122]';
183   plot(x,koro1,'r');
184   hold on
185   plot(x,koro2,'k');
186   y=zeros(122,1);
187   plot(x,y,'k:');
188   title(a+1970,'FontSize',8);
189   my_title=['serie temporelle eof ', ircaam_dataset, ' ' , simulation, ' ' , df];
190   if a==2;
191       text(0,5.5,my_title);
192   elseif a==13;
193       text(0,5.5,my_title);
194   elseif a==24;
195       text(0,5.5,my_title);
196   end;
197   clear my_title;
198   set (gca,'tickDir','out');
199   axis([1 122 -3 3]);
200
201   set (gca,'YTick',[-3:1:3],'YTickLabel',[-3:1:3],'fontname','Arial','fontsize',6);
202   set (gca,'XTick',[0:20:120],'XTickLabel',[0:20:120],'fontname','Arial','fontsize',6);
203end;
204
205figure(1);
206fullfilename=[IRCAAM_OD,'time_serie_eof_', ircaam_dataset, '_', simulation, '_', df, '_part1.eps'];
207print('-depsc2',fullfilename);
208clear fullfilename;
209
210figure(2);
211fullfilename=[IRCAAM_OD,'time_serie_eof_', ircaam_dataset, '_', simulation, '_', df, '_part2.eps'];
212print('-depsc2',fullfilename);
213clear fullfilename;
214
215figure(3);
216fullfilename=[IRCAAM_OD,'time_serie_eof_', ircaam_dataset, '_', simulation, '_', df, '_part3.eps'];
217print('-depsc2',fullfilename);
218clear fullfilename;
219
220clear ircaam_dataset;
221clear simulation;
222clear df;
Note: See TracBrowser for help on using the repository browser.