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