%

clear;

status=load('eof_rossby_jjas_2006_1030.mat');
olr=olr';
PC1=olr*C;

time_serie_olr1=PC1(:,425);
time_serie_olr2=PC1(:,424);
year=zeros(122,28);
for a=1:122
    for b=1:28;
       year(a,b)=1979+(b-1);
    end;
end;
year=reshape(year,3416,1);

day=zeros(122,28);
for a=1:122
    for b=1:28;
       day(a,b)=31+28+31+30+31+a;
    end;
end;
day=reshape(day,3416,1);

table_ER_1030=zeros(3416,4);
for a=1:3416;
     for b=1:4;
        table_ER_1030(a,1)=year(a);
        table_ER_1030(a,2)=day(a);
        table_ER_1030(a,3)=time_serie_olr1(a);
        table_ER_1030(a,4)=time_serie_olr2(a);
     end;
end;

status=save('table_ER_1030.txt','table_ER_1030','-ASCII');

a=1;
clear koro1
debut=(a-1)*122+1;
fin=a*122;
koro1=time_serie_olr1(debut:fin);
koro2=time_serie_olr2(debut:fin);
x=[1:122]';
aa=plot(x,-koro1,'r');
hold on;
bb=plot(x,-koro2,'k');
cc=legend('EOF1','EOF2');
set (cc,'fontsize',6)
legend boxoff
y=zeros(122,1);
plot(x,y,'k:');

set (gca,'tickDir','out');
axis([1 122 -100 100]);

set (gca,'YTick',[-100:20:100],'YTickLabel',[-100:20:100],'fontname','Arial','fontsize',6);
set (gca,'XTick',[0:20:120],'XTickLabel',[0:20:120],'fontname','Arial','fontsize',6);
