[56] | 1 | function time_serie_eof_df(ircaam_dataset,simulation,period1, period2) |
---|
| 2 | % time_serie_eof_df ++explication between period1 days and period2 days |
---|
[46] | 3 | |
---|
| 4 | %+ |
---|
[17] | 5 | % |
---|
[82] | 6 | % .. _time_serie_eof_df.m: |
---|
| 7 | % |
---|
[75] | 8 | % =================== |
---|
| 9 | % time_serie_eof_df.m |
---|
| 10 | % =================== |
---|
| 11 | % |
---|
[46] | 12 | % ++ |
---|
| 13 | % |
---|
| 14 | % DESCRIPTION |
---|
| 15 | % =========== |
---|
| 16 | % |
---|
[75] | 17 | % From eof_arpege\_\ *simulation*\ _ \ *period1*\ -\ *period2*\ d.mat, |
---|
[46] | 18 | % ``time_serie_eof_df`` compute ++. |
---|
| 19 | % |
---|
| 20 | % ``time_serie_eof_df`` plot ++. |
---|
| 21 | % |
---|
[56] | 22 | % ``time_serie_eof_df`` save eof[12]_arpege_\ *simulation*\ _ \ *period1*\ -\ *period2*\ d.txt. |
---|
[46] | 23 | % |
---|
| 24 | % 2 Postscript files |
---|
[75] | 25 | % time_serie_arpege\_\ *simulation*\ _ \ *period1*\ -\ *period2*\ d_part[12].eps are |
---|
[46] | 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 | % |
---|
[82] | 43 | % :ref:`eof_df.m` |
---|
[46] | 44 | % |
---|
[82] | 45 | % :ref:`carte_eof_df.m` |
---|
[46] | 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 | % |
---|
[59] | 61 | % - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 62 | % |
---|
| 63 | % * add try/catch on opening file for reading |
---|
| 64 | % |
---|
[56] | 65 | % - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 66 | % |
---|
| 67 | % * replace ndmin by period1 and ndmax by period2 |
---|
| 68 | % |
---|
[46] | 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 | % |
---|
[56] | 76 | % Days will be now written ``period1``\-``period2d`` (ex: 10-30d) in filenames. |
---|
[46] | 77 | % |
---|
[48] | 78 | % Dataset ``arpege`` will be forced in output file names. |
---|
[46] | 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 | %- |
---|
[17] | 85 | |
---|
[46] | 86 | global IRCAAM_ID; |
---|
| 87 | global IRCAAM_OD; |
---|
| 88 | |
---|
| 89 | if nargin==4 |
---|
[52] | 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'); |
---|
[46] | 94 | end |
---|
[52] | 95 | if strcmp(ircaam_dataset,'arpege') |
---|
[46] | 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; |
---|
[56] | 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'); |
---|
[46] | 112 | end |
---|
| 113 | else |
---|
[56] | 114 | usage='usage : time_serie_jjas_df(ircaam_dataset,simulation,period1, period2)'; |
---|
[46] | 115 | disp(usage); |
---|
| 116 | error('eee : wrong arguments numbers') |
---|
| 117 | end |
---|
| 118 | |
---|
[56] | 119 | % period1 and period2 will be used in xx-yyd form in filenames |
---|
| 120 | df = [int2str(period1),'-',int2str(period2),'d']; |
---|
| 121 | clear period1; |
---|
| 122 | clear period2; |
---|
[46] | 123 | |
---|
[17] | 124 | close all; |
---|
| 125 | |
---|
[52] | 126 | fullfilename=[IRCAAM_ID,'eof_',ircaam_dataset,'_', simulation, '_', df, '.mat']; |
---|
[59] | 127 | try |
---|
| 128 | status=load(fullfilename,'C','olr'); |
---|
| 129 | catch |
---|
| 130 | error('eee : File %s not found\n', fullfilename); |
---|
| 131 | end |
---|
| 132 | |
---|
[46] | 133 | clear fullfilename; |
---|
| 134 | |
---|
[24] | 135 | C=status.C; |
---|
| 136 | olr=status.olr; |
---|
| 137 | clear status; |
---|
| 138 | |
---|
[17] | 139 | olr=olr'; |
---|
| 140 | PC1=olr*C; |
---|
| 141 | |
---|
| 142 | %%%%%%% cronique de la VP1 |
---|
| 143 | time_serie_olr1=PC1(:,360); |
---|
| 144 | time_serie_olr2=PC1(:,359); |
---|
| 145 | |
---|
| 146 | dt_olr1=std(time_serie_olr1); |
---|
| 147 | dt_olr2=std(time_serie_olr2); |
---|
| 148 | |
---|
| 149 | for 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; |
---|
[25] | 152 | end; |
---|
[17] | 153 | |
---|
[52] | 154 | fullfilename=[IRCAAM_OD,'eof1_',ircaam_dataset,'_', simulation, '_', df,'.txt']; |
---|
[46] | 155 | save(fullfilename,'time_serie_olr1','-ASCII'); |
---|
| 156 | clear fullfilename; |
---|
[17] | 157 | |
---|
[52] | 158 | fullfilename=[IRCAAM_OD,'eof2_',ircaam_dataset,'_', simulation, '_', df,'.txt']; |
---|
[46] | 159 | save(fullfilename','time_serie_olr2','-ASCII'); |
---|
| 160 | clear fullfilename; |
---|
| 161 | |
---|
[17] | 162 | x=[1:3538]'; |
---|
| 163 | for 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); |
---|
[25] | 173 | end; |
---|
[21] | 174 | clear koro1; |
---|
[17] | 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); |
---|
[52] | 187 | my_title=['serie temporelle eof ', ircaam_dataset, ' ' , simulation, ' ' , df]; |
---|
[17] | 188 | if a==2; |
---|
[46] | 189 | text(0,5.5,my_title); |
---|
[25] | 190 | elseif a==13; |
---|
[46] | 191 | text(0,5.5,my_title); |
---|
[17] | 192 | elseif a==24; |
---|
[46] | 193 | text(0,5.5,my_title); |
---|
[17] | 194 | end; |
---|
[46] | 195 | clear my_title; |
---|
[17] | 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); |
---|
[46] | 200 | set (gca,'XTick',[0:20:120],'XTickLabel',[0:20:120],'fontname','Arial','fontsize',6); |
---|
[17] | 201 | end; |
---|
| 202 | |
---|
| 203 | figure(1); |
---|
[52] | 204 | fullfilename=[IRCAAM_OD,'time_serie_eof_', ircaam_dataset, '_', simulation, '_', df, '_part1.eps']; |
---|
[46] | 205 | print('-depsc2',fullfilename); |
---|
| 206 | clear fullfilename; |
---|
| 207 | |
---|
[17] | 208 | figure(2); |
---|
[52] | 209 | fullfilename=[IRCAAM_OD,'time_serie_eof_', ircaam_dataset, '_', simulation, '_', df, '_part2.eps']; |
---|
[46] | 210 | print('-depsc2',fullfilename); |
---|
| 211 | clear fullfilename; |
---|
| 212 | |
---|
[17] | 213 | figure(3); |
---|
[52] | 214 | fullfilename=[IRCAAM_OD,'time_serie_eof_', ircaam_dataset, '_', simulation, '_', df, '_part3.eps']; |
---|
[46] | 215 | print('-depsc2',fullfilename); |
---|
| 216 | clear fullfilename; |
---|
| 217 | |
---|
[52] | 218 | clear ircaam_dataset; |
---|
[46] | 219 | clear simulation; |
---|
| 220 | clear df; |
---|