1 | function time_serie_ER_rossby_df(period1, period2) |
---|
2 | % time_serie_ER_rossby_df ++explication between period1 days and period2 days |
---|
3 | |
---|
4 | %+ |
---|
5 | % module |
---|
6 | % ====== |
---|
7 | % |
---|
8 | % ++ |
---|
9 | % |
---|
10 | % DESCRIPTION |
---|
11 | % =========== |
---|
12 | % |
---|
13 | % plot ++ from file eof_rossby_jjas_2006_10-30d.mat |
---|
14 | % |
---|
15 | % EXAMPLES |
---|
16 | % ======== |
---|
17 | % |
---|
18 | % Following line read eof_rossby_jjas_2006_10-30d.mat, plot ++and produce table_ER_10-30d.txt file |
---|
19 | % |
---|
20 | % :: |
---|
21 | % |
---|
22 | % >> time_serie_ER_rossby_df(10,30); |
---|
23 | % |
---|
24 | % SEE ALSO |
---|
25 | % ======== |
---|
26 | % |
---|
27 | % olr_eof_jjas2006_rossby_df.m_ |
---|
28 | % |
---|
29 | % .. _olr_eof_jjas2006_rossby_df.m : olr_eof_jjas2006_rossby_df.m.html |
---|
30 | % |
---|
31 | % carte_eofER_1030_article.m_ |
---|
32 | % |
---|
33 | % .. _carte_eofER_1030_article.m : carte_eofER_1030_article.m.html |
---|
34 | % |
---|
35 | % carte_eof_ER_jjas_df.m_ |
---|
36 | % |
---|
37 | % .. _carte_eof_ER_jjas_df.m : carte_eof_ER_jjas_df.m.html |
---|
38 | % |
---|
39 | % time_serie_ER_rossby_df_complet.m_ |
---|
40 | % |
---|
41 | % .. _time_serie_ER_rossby_df_complet.m : time_serie_ER_rossby_df_complet.m.html |
---|
42 | % |
---|
43 | % reconstitution_ER_rossby_df.m_ |
---|
44 | % |
---|
45 | % .. _reconstitution_ER_rossby_df.m : reconstitution_ER_rossby_df.m.html |
---|
46 | % |
---|
47 | % TODO |
---|
48 | % ==== |
---|
49 | % |
---|
50 | % improve description |
---|
51 | % |
---|
52 | % improve file pb |
---|
53 | % |
---|
54 | % use return function |
---|
55 | % |
---|
56 | % find where ``table_ER_??-??d.txt`` are used |
---|
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-01-27T10:07:29Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
72 | % |
---|
73 | % * created from time_serie_ER_rossby_1030.m to replace it as well as |
---|
74 | % time_serie_ER_rossby_30100.m |
---|
75 | % |
---|
76 | % Days will be now written ``period1``\-``period2d`` (ex: 10-30d) in filenames. |
---|
77 | % |
---|
78 | %- |
---|
79 | |
---|
80 | global IRCAAM_ID; |
---|
81 | global IRCAAM_OD; |
---|
82 | |
---|
83 | if nargin==2 |
---|
84 | % period1 must be lower than period2 |
---|
85 | if (period1 > period2) |
---|
86 | disp(['period1 = ', int2str(period1)]); |
---|
87 | disp(['period2 = ', int2str(period2)]); |
---|
88 | error('eee : period1 must be lower than period2'); |
---|
89 | end |
---|
90 | else |
---|
91 | usage='usage : time_serie_ER_rossby_df(period1, period2)'; |
---|
92 | disp(usage); |
---|
93 | error('eee : wrong arguments numbers') |
---|
94 | end |
---|
95 | |
---|
96 | % period1 and period2 will be used in xx-yyd form in filenames |
---|
97 | df = [int2str(period1),'-',int2str(period2),'d']; |
---|
98 | clear period1; |
---|
99 | clear period2; |
---|
100 | |
---|
101 | fullfilename=[IRCAAM_ID,'eof_rossby_jjas_2006_',df,'.mat']; |
---|
102 | try |
---|
103 | status=load(fullfilename,'C','olr'); |
---|
104 | catch |
---|
105 | error('eee : File %s not found\n', fullfilename); |
---|
106 | end |
---|
107 | |
---|
108 | clear fullfilename; |
---|
109 | C=status.C; |
---|
110 | olr=status.olr; |
---|
111 | clear status; |
---|
112 | |
---|
113 | olr=olr'; |
---|
114 | PC1=olr*C; |
---|
115 | |
---|
116 | time_serie_olr1=PC1(:,425); |
---|
117 | time_serie_olr2=PC1(:,424); |
---|
118 | year=zeros(122,28); |
---|
119 | for a=1:122 |
---|
120 | for b=1:28; |
---|
121 | year(a,b)=1979+(b-1); |
---|
122 | end; |
---|
123 | end; |
---|
124 | year=reshape(year,3416,1); |
---|
125 | |
---|
126 | day=zeros(122,28); |
---|
127 | for a=1:122 |
---|
128 | for b=1:28; |
---|
129 | day(a,b)=31+28+31+30+31+a; |
---|
130 | end; |
---|
131 | end; |
---|
132 | day=reshape(day,3416,1); |
---|
133 | |
---|
134 | table_ER=zeros(3416,4); |
---|
135 | for a=1:3416; |
---|
136 | for b=1:4; |
---|
137 | table_ER(a,1)=year(a); |
---|
138 | table_ER(a,2)=day(a); |
---|
139 | table_ER(a,3)=time_serie_olr1(a); |
---|
140 | table_ER(a,4)=time_serie_olr2(a); |
---|
141 | end; |
---|
142 | end; |
---|
143 | |
---|
144 | fullfilename=[IRCAAM_OD,'table_ER_',df,'.txt']; |
---|
145 | save(fullfilename,'table_ER','-ASCII'); |
---|
146 | clear fullfilename; |
---|
147 | |
---|
148 | a=1; |
---|
149 | clear koro1 |
---|
150 | debut=(a-1)*122+1; |
---|
151 | fin=a*122; |
---|
152 | koro1=time_serie_olr1(debut:fin); |
---|
153 | koro2=time_serie_olr2(debut:fin); |
---|
154 | x=[1:122]'; |
---|
155 | aa=plot(x,-koro1,'r'); |
---|
156 | hold on; |
---|
157 | bb=plot(x,-koro2,'k'); |
---|
158 | cc=legend('EOF1','EOF2'); |
---|
159 | set (cc,'fontsize',6); |
---|
160 | legend boxoff |
---|
161 | y=zeros(122,1); |
---|
162 | plot(x,y,'k:'); |
---|
163 | |
---|
164 | set (gca,'tickDir','out'); |
---|
165 | axis([1 122 -100 100]); |
---|
166 | |
---|
167 | set (gca,'YTick',[-100:20:100],'YTickLabel',[-100:20:100],'fontname','Arial','fontsize',6); |
---|
168 | set (gca,'XTick',[0:20:120],'XTickLabel',[0:20:120],'fontname','Arial','fontsize',6); |
---|