%
clear;
load eof_1030_ircaam_ctl_clim.mat
carte1=C(:,360);

carte=reshape(carte1,24,15);
carte=carte';

clear carte1;
% defintion des lat et lon
cd('CTL_CLIM')
ncload('rlut_d.CtCl.197106-09.nc','lat','lon');
cd('..');
lon=lon-180;
lon=lon(54:77);
lat=lat(29:43)';

figure(1);
orient('landscape');
subplot(3,2,1);
palette;
for a=1:15;
    for b=1:24;
        if carte(a,b)>0.2;
            carte(a,b)=0.2;
        elseif carte(a,b)<-0.2;
            carte(a,b)=-0.2;
        end;
    end;
end;
carte(1,1)=-0.2001;
carte(1,2)=0.2001;

contourf(lon,lat,-carte,[-0.2:0.02:0.2],'LineStyle','none');
colorbar;
title('OLR EOF1','Fontsize',8);
hold on;
cartemonde;
set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';'  0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6);
set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';'  0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6);
set (gca,'tickDir','out');

clear carte1 x y a b carte coco;
carte1=C(:,359);
carte=reshape(carte1,24,15);
carte=carte';

clear carte1;

subplot(3,2,3);
palette;
for a=1:15;
    for b=1:24;
        if carte(a,b)>0.2;
            carte(a,b)=0.2;
        elseif carte(a,b)<-0.2;
            carte(a,b)=-0.2;
        end;
    end;
end;
carte(1,1)=-0.2001;
carte(1,2)=0.2001;

contourf(lon,lat,carte,[-0.2:0.02:0.2],'LineStyle','none');
colorbar;

title('OLR EOF2','Fontsize',8);
hold on;
cartemonde;
set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';'  0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6);
set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';'  0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6);
set (gca,'tickDir','out');

clear carte1 x y a b carte coco;
carte1=C(:,358);
carte=reshape(carte1,24,15);
carte=carte';
clear carte1;

subplot(3,2,5);
palette;
for a=1:15;
    for b=1:24;
        if carte(a,b)>0.2;
            carte(a,b)=0.2;
        elseif carte(a,b)<-0.2;
            carte(a,b)=-0.2;
        end;
    end;
end;
carte(1,1)=-0.2001;
carte(1,2)=0.2001;

contourf(lon,lat,-carte,[-0.2:0.02:0.2],'LineStyle','none');
colorbar;
title('OLR EOF3','Fontsize',8);
hold on;
cartemonde;
set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';'  0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6);
set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';'  0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6);
set (gca,'tickDir','out');

clear carte1 x y a b carte coco;
carte1=C(:,357);
carte=reshape(carte1,24,15);
carte=carte';
clear carte1;

subplot(3,2,2);
palette;
for a=1:15;
    for b=1:24;
        if carte(a,b)>0.2;
            carte(a,b)=0.2;
        elseif carte(a,b)<-0.2;
            carte(a,b)=-0.2;
        end;
    end;
end;
carte(1,1)=-0.2001;
carte(1,2)=0.2001;

contourf(lon,lat,-carte,[-0.2:0.02:0.2],'LineStyle','none');
colorbar;
title('OLR EOF4','Fontsize',8);
hold on;
cartemonde;
set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';'  0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6);
set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';'  0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6);
set (gca,'tickDir','out');

subplot(3,2,4);
vaude=0;
for a=1:360;
   vaude=vaude+L(a,a);
end
vecteurs=zeros(20,1);
for a=1:20;
   b=360-(a-1);
   vecteurs(a)=100*(L(b,b)/vaude);
end
x=[1:20]';

bar(x,vecteurs,'LineStyle','none')
axis([0.5 20.5 0 25]);
set (gca,'YTick',[0:5:25],'YTickLabel',[0:5:25],'fontname','Arial','fontsize',6);
set (gca,'XTick',[2:2:20],'XTickLabel',[2:2:20],'fontname','Arial','fontsize',6);
set (gca,'tickDir','out');

print -depsc2 eof_ircaam_1030_ctl_clim.eps;
