[56] | 1 | function carte_eof234_jjas_df(period1, period2) |
---|
| 2 | % carte_eof234_jjas_df ++explication between period1 days and period2 days |
---|
[37] | 3 | |
---|
| 4 | %+ |
---|
[82] | 5 | % |
---|
| 6 | % .. _carte_eof234_jjas_df.m: |
---|
| 7 | % |
---|
[75] | 8 | % ====================== |
---|
| 9 | % carte_eof234_jjas_df.m |
---|
| 10 | % ====================== |
---|
[17] | 11 | % |
---|
[37] | 12 | % ++ |
---|
| 13 | % |
---|
| 14 | % DESCRIPTION |
---|
| 15 | % =========== |
---|
| 16 | % |
---|
[85] | 17 | % plot ++ from file :file:`eof_10-30d_jjas.mat` |
---|
[37] | 18 | % |
---|
| 19 | % EXAMPLES |
---|
| 20 | % ======== |
---|
| 21 | % |
---|
[85] | 22 | % Following line read :file:`eof_10-30d_jjas.mat`, plot ++and produce a Postcript file |
---|
| 23 | % :file:`resultats_eof_jjas_2006_10-30d.eps` |
---|
| 24 | % produce also :file:`carte_eofx_mode_sahel_10-30d.dat` and |
---|
| 25 | % :file:`carte_eofx_mode_sahel_10-30d.ctl` (GRADS files) and |
---|
| 26 | % :file:`vecteurs_eof_10-30d.txt`:: |
---|
[37] | 27 | % |
---|
| 28 | % >> carte_eof234_jjas_df(10,30); |
---|
| 29 | % |
---|
| 30 | % SEE ALSO |
---|
| 31 | % ======== |
---|
| 32 | % |
---|
[82] | 33 | % :ref:`olr_eof_1025.m` |
---|
[37] | 34 | % |
---|
[82] | 35 | % :ref:`reconstitution_1025.m` |
---|
[37] | 36 | % |
---|
[82] | 37 | % :ref:`time_serie_jjas_10_25.m` |
---|
[37] | 38 | % |
---|
[82] | 39 | % :ref:`sauvegrads.m` |
---|
[37] | 40 | % |
---|
| 41 | % TODO |
---|
| 42 | % ==== |
---|
| 43 | % |
---|
| 44 | % improve description |
---|
| 45 | % |
---|
| 46 | % improve file pb |
---|
| 47 | % |
---|
| 48 | % use return function |
---|
| 49 | % |
---|
| 50 | % change filename of Postscript file because same as in carte_eof_ER_jjas_df.m |
---|
| 51 | % |
---|
| 52 | % directory for sauvegrads files |
---|
| 53 | % |
---|
| 54 | % control of sauvegrads call |
---|
| 55 | % |
---|
| 56 | % why ``-carte`` in contourf and sauvegrads instead of ``carte`` ? |
---|
| 57 | % |
---|
| 58 | % EVOLUTIONS |
---|
| 59 | % ========== |
---|
| 60 | % |
---|
| 61 | % $Id$ |
---|
| 62 | % |
---|
[59] | 63 | % - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 64 | % |
---|
| 65 | % * add try/catch on opening file for reading |
---|
| 66 | % |
---|
[56] | 67 | % - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 68 | % |
---|
| 69 | % * replace ndmin by period1 and ndmax by period2 |
---|
| 70 | % |
---|
[37] | 71 | % - fplod 2009-01-27T14:49:51Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 72 | % |
---|
| 73 | % * created from carte_eof234_jjas_1025.m and carte_eof234_jjas_1030.m |
---|
| 74 | % to replace both. |
---|
| 75 | % |
---|
[56] | 76 | % Days will be now written ``period1``\-``period2d`` (ex: 10-30d) in filenames. |
---|
[37] | 77 | % |
---|
| 78 | % * add sauvegrads on first EOF for homogenity |
---|
| 79 | % |
---|
| 80 | %- |
---|
[17] | 81 | |
---|
[37] | 82 | |
---|
| 83 | global IRCAAM_ID; |
---|
| 84 | global IRCAAM_OD; |
---|
| 85 | |
---|
| 86 | if nargin==2 |
---|
[56] | 87 | % period1 must be lower than period2 |
---|
| 88 | if (period1 > period2) |
---|
| 89 | disp(['period1 = ', int2str(period1)]); |
---|
| 90 | disp(['period2 = ', int2str(period2)]); |
---|
| 91 | error('eee : period1 must be lower than period2'); |
---|
[37] | 92 | end |
---|
| 93 | else |
---|
[56] | 94 | usage='usage : carte_eof234_jjas_df(period1, period2)'; |
---|
[37] | 95 | disp(usage); |
---|
| 96 | error('eee : wrong arguments numbers') |
---|
| 97 | end |
---|
| 98 | |
---|
[56] | 99 | % period1 and period2 will be used in xx-yyd form in filenames |
---|
| 100 | df = [int2str(period1),'-',int2str(period2),'d']; |
---|
| 101 | clear period1; |
---|
| 102 | clear period2; |
---|
[37] | 103 | |
---|
| 104 | |
---|
| 105 | fullfilename=[IRCAAM_ID,'eof_',df,'_jjas.mat']; |
---|
[59] | 106 | try |
---|
| 107 | status=load(fullfilename,'C','L'); |
---|
| 108 | catch |
---|
| 109 | error('eee : File %s not found\n', fullfilename); |
---|
| 110 | end |
---|
| 111 | |
---|
[37] | 112 | clear fullfilename; |
---|
| 113 | |
---|
[24] | 114 | C=status.C; |
---|
| 115 | L=status.L; |
---|
| 116 | clear status; |
---|
| 117 | |
---|
[17] | 118 | carte1=C(:,425); |
---|
| 119 | |
---|
| 120 | carte=reshape(carte1,25,17); |
---|
| 121 | carte=carte'; |
---|
| 122 | |
---|
| 123 | clear carte1; |
---|
| 124 | % defintion des lat et lon |
---|
| 125 | lon=[-30:2.5:30]'; |
---|
| 126 | lat=[-10:2.5:30]; |
---|
| 127 | |
---|
| 128 | figure(1); |
---|
| 129 | orient('landscape'); |
---|
| 130 | subplot(3,2,1); |
---|
| 131 | palette; |
---|
| 132 | for a=1:17; |
---|
| 133 | for b=1:25; |
---|
| 134 | if carte(a,b)>0.2; |
---|
| 135 | carte(a,b)=0.2; |
---|
| 136 | elseif carte(a,b)<-0.2; |
---|
| 137 | carte(a,b)=-0.2; |
---|
| 138 | end; |
---|
| 139 | end; |
---|
| 140 | end; |
---|
| 141 | carte(1,1)=-0.2001; |
---|
| 142 | carte(1,2)=0.2001; |
---|
| 143 | |
---|
| 144 | contourf(lon,lat,-carte,[-0.2:0.02:0.2],'LineStyle','none'); |
---|
[37] | 145 | gradsname=['carte_eof1_mode_sahel_',df]; |
---|
| 146 | sauvegrads(gradsname,-carte,[-30 2.5 -10 2.5]); |
---|
| 147 | clear gradsname; |
---|
| 148 | |
---|
[17] | 149 | colorbar; |
---|
| 150 | title('OLR EOF1','Fontsize',8); |
---|
| 151 | hold on; |
---|
| 152 | cartemonde; |
---|
| 153 | set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';' 0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6); |
---|
| 154 | set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';' 0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6); |
---|
| 155 | set (gca,'tickDir','out'); |
---|
| 156 | |
---|
| 157 | clear carte1 x y a b carte coco; |
---|
| 158 | carte1=C(:,424); |
---|
| 159 | carte=reshape(carte1,25,17); |
---|
| 160 | carte=carte'; |
---|
| 161 | |
---|
| 162 | clear carte1; |
---|
| 163 | lon=[-30:2.5:30]'; |
---|
| 164 | lat=[-10:2.5:30]; |
---|
| 165 | |
---|
| 166 | subplot(3,2,3); |
---|
| 167 | palette; |
---|
| 168 | for a=1:17; |
---|
| 169 | for b=1:25; |
---|
| 170 | if carte(a,b)>0.2; |
---|
| 171 | carte(a,b)=0.2; |
---|
| 172 | elseif carte(a,b)<-0.2; |
---|
| 173 | carte(a,b)=-0.2; |
---|
| 174 | end; |
---|
| 175 | end; |
---|
| 176 | end; |
---|
| 177 | carte(1,1)=-0.2001; |
---|
| 178 | carte(1,2)=0.2001; |
---|
| 179 | |
---|
[37] | 180 | contourf(lon,lat,-carte,[-0.2:0.02:0.2],'LineStyle','none'); |
---|
| 181 | gradsname=['carte_eof2_mode_sahel_',df]; |
---|
| 182 | sauvegrads(gradsname,-carte,[-30 2.5 -10 2.5]); |
---|
| 183 | clear gradsname; |
---|
[17] | 184 | colorbar; |
---|
| 185 | |
---|
| 186 | title('OLR EOF2','Fontsize',8); |
---|
| 187 | hold on; |
---|
| 188 | cartemonde; |
---|
| 189 | set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';' 0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6); |
---|
| 190 | set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';' 0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6); |
---|
| 191 | set (gca,'tickDir','out'); |
---|
| 192 | |
---|
| 193 | clear carte1 x y a b carte coco; |
---|
| 194 | carte1=C(:,423); |
---|
| 195 | carte=reshape(carte1,25,17); |
---|
| 196 | carte=carte'; |
---|
| 197 | clear carte1; |
---|
| 198 | |
---|
| 199 | % defintion des lat et lon |
---|
| 200 | lon=[-30:2.5:30]'; |
---|
| 201 | lat=[-10:2.5:30]; |
---|
| 202 | |
---|
| 203 | subplot(3,2,5); |
---|
| 204 | palette; |
---|
| 205 | for a=1:17; |
---|
| 206 | for b=1:25; |
---|
| 207 | if carte(a,b)>0.2; |
---|
| 208 | carte(a,b)=0.2; |
---|
| 209 | elseif carte(a,b)<-0.2; |
---|
| 210 | carte(a,b)=-0.2; |
---|
| 211 | end; |
---|
| 212 | end; |
---|
| 213 | end; |
---|
| 214 | carte(1,1)=-0.2001; |
---|
| 215 | carte(1,2)=0.2001; |
---|
| 216 | |
---|
| 217 | contourf(lon,lat,-carte,[-0.2:0.02:0.2],'LineStyle','none'); |
---|
[37] | 218 | gradsname=['carte_eof3_mode_sahel_',df]; |
---|
| 219 | sauvegrads(gradsname,-carte,[-30 2.5 -10 2.5]); |
---|
| 220 | clear gradsname; |
---|
[17] | 221 | colorbar; |
---|
| 222 | title('OLR EOF3','Fontsize',8); |
---|
| 223 | hold on; |
---|
| 224 | cartemonde; |
---|
| 225 | set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';' 0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6); |
---|
| 226 | set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';' 0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6); |
---|
| 227 | set (gca,'tickDir','out'); |
---|
| 228 | |
---|
| 229 | clear carte1 x y a b carte coco; |
---|
| 230 | carte1=C(:,422); |
---|
| 231 | carte=reshape(carte1,25,17); |
---|
| 232 | carte=carte'; |
---|
| 233 | clear carte1; |
---|
| 234 | |
---|
| 235 | % defintion des lat et lon |
---|
| 236 | lon=[-30:2.5:30]'; |
---|
| 237 | lat=[-10:2.5:30]; |
---|
| 238 | |
---|
| 239 | subplot(3,2,2); |
---|
| 240 | palette; |
---|
| 241 | for a=1:17; |
---|
| 242 | for b=1:25; |
---|
| 243 | if carte(a,b)>0.2; |
---|
| 244 | carte(a,b)=0.2; |
---|
| 245 | elseif carte(a,b)<-0.2; |
---|
| 246 | carte(a,b)=-0.2; |
---|
| 247 | end; |
---|
| 248 | end; |
---|
| 249 | end; |
---|
| 250 | carte(1,1)=-0.2001; |
---|
| 251 | carte(1,2)=0.2001; |
---|
| 252 | |
---|
| 253 | contourf(lon,lat,-carte,[-0.2:0.02:0.2],'LineStyle','none'); |
---|
[37] | 254 | gradsname=['carte_eof4_mode_sahel_',df]; |
---|
| 255 | sauvegrads(gradsname,-carte,[-30 2.5 -10 2.5]); |
---|
| 256 | clear gradsname; |
---|
[17] | 257 | colorbar; |
---|
| 258 | title('OLR EOF4','Fontsize',8); |
---|
| 259 | hold on; |
---|
| 260 | cartemonde; |
---|
| 261 | set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';' 0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6); |
---|
| 262 | set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';' 0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6); |
---|
| 263 | set (gca,'tickDir','out'); |
---|
| 264 | |
---|
| 265 | subplot(3,2,4); |
---|
| 266 | vaude=0; |
---|
| 267 | for a=1:425; |
---|
| 268 | vaude=vaude+L(a,a); |
---|
[26] | 269 | end; |
---|
[17] | 270 | vecteurs=zeros(20,1); |
---|
| 271 | for a=1:20; |
---|
| 272 | b=425-(a-1); |
---|
| 273 | vecteurs(a)=100*(L(b,b)/vaude); |
---|
[26] | 274 | end; |
---|
[17] | 275 | x=[1:20]'; |
---|
| 276 | |
---|
| 277 | bar(x,vecteurs,'LineStyle','none') |
---|
[37] | 278 | fullfilename=[IRCAAM_OD,'vecteurs_eof_',df,'.txt']; |
---|
| 279 | save(fullfilename,'vecteurs','-ASCII'); |
---|
| 280 | clear fullfilename; |
---|
| 281 | |
---|
[17] | 282 | axis([0.5 20.5 0 25]); |
---|
| 283 | set (gca,'YTick',[0:5:25],'YTickLabel',[0:5:25],'fontname','Arial','fontsize',6); |
---|
| 284 | set (gca,'XTick',[2:2:20],'XTickLabel',[2:2:20],'fontname','Arial','fontsize',6); |
---|
| 285 | set (gca,'tickDir','out'); |
---|
| 286 | |
---|
[37] | 287 | fullfilename=[IRCAAM_OD,'resultats_eof_jjas_2006_',df,'.eps']; |
---|
| 288 | print('-depsc2',fullfilename); |
---|
| 289 | clear fullfilename; |
---|