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