clear;
close all;

load eof_1030_ircaam.mat
olr=olr';
PC1=olr*C;


%%%%%%% cronique de la VP1
time_serie_olr1=PC1(:,360);
time_serie_olr2=PC1(:,359);

dt_olr1=std(time_serie_olr1);
dt_olr2=std(time_serie_olr2);


for a=1:3538;
   time_serie_olr1(a)=time_serie_olr1(a)/dt_olr1;
   time_serie_olr2(a)=time_serie_olr2(a)/dt_olr2;
end

save eof1_AFR_1030.txt time_serie_olr1 -ascii;
save eof2_AFR_1030.txt time_serie_olr2 -ascii;

x=[1:3538]';
for a=1:29;
   if a<12;
      figure(1); subplot(4,3,a);
   elseif a<23;
      figure(2); subplot(4,3,a-11);
   else
      figure(3); subplot(4,3,a-22);
   end
   clear koro1 
   debut=(a-1)*122+1;
   fin=a*122;
   koro1=time_serie_olr1(debut:fin);
   koro2=time_serie_olr2(debut:fin);
   clear x; x=[1:122]';
   plot(x,koro1,'r');
   hold on
   plot(x,koro2,'k');
   y=zeros(122,1);
   plot(x,y,'k:');
   title(a+1970,'FontSize',8);
   if a==2;
       text(0,5.5,'serie temporelle eof AFR 1030');
    elseif a==13;
       text(0,5.5,'serie temporelle eof AFR 1030');
   elseif a==24;
       text(0,5.5,'serie temporelle eof AFR 1030');
   end;
   set (gca,'tickDir','out');
   axis([1 122 -3 3]);
   

   set (gca,'YTick',[-3:1:3],'YTickLabel',[-3:1:3],'fontname','Arial','fontsize',6);
set (gca,'XTick',[0:20:120],'XTickLabel',[0:20:120],'fontname','Arial','fontsize',6);
end;

figure(1); print -depsc2 time_serie_eof_afr_1030a.eps;
figure(2); print -depsc2 time_serie_eof_afr_1030b.eps;
figure(3); print -depsc2 time_serie_eof_afr_1030c.eps;

