clear all;format compact


load PRECC

panels=[.05  .62 .29 .24;.36 .62 .29 .24;.67 .62 .29 .24;...
        .05 .36 .29 .24;.36 .36 .29 .24;.67 .36 .29 .24;...
        .05 .1 .29 .24;.36 .1 .29 .24;.67 .1 .29 .24];

font = 7;

figure(1);orient tall;orient landscape;colormap(ctb)
subplot('position',panels(1,:))
v=linspace(-5,5,41);
YY=reshape(squeeze(mean(X3-X1,1)),im*jm,1);
YY1=max(min(YY,max(v)),min(v));
YY2=reshape(YY1,im,jm);
YY2 = YY2.*Y1;
[c,h]=contourf(lon,lat,YY2',v);
set(gca,'clim',[min(v) max(v)]);
set(h,'edgecolor','none')
axis([0 360 -90 90])
set(gca,'xtick',[0:60:360],'xticklabel',[])
set(gca,'ytick',[-90:30:90],'yticklabel',[])
hold on
plot(lon1,lat1,'k-')
set(title('(a)\DeltaPRECC ANN, MCB(2050-2069) - base(2020-2039)'),'fontsize',font)

subplot('position',panels(2,:))
YY=squeeze(mean(X3-X2,1));
YY1=max(min(YY,max(v)),min(v));
YY2=reshape(YY1,im,jm);
YY2 = YY2.*Y2;
[c,h]=contourf(lon,lat,YY2',v);
set(gca,'clim',[min(v) max(v)]);
set(h,'edgecolor','none')
axis([0 360 -90 90])
set(gca,'xtick',[0:60:360],'xticklabel',[])
set(gca,'ytick',[-90:30:90],'yticklabel',[])
hold on
plot(lon1,lat1,'k-')
set(title('(b)\DeltaPRECC ANN, MCB(2050-2069) - base(2050-2069)'),'fontsize',font)

subplot('position',panels(3,:))
YY=squeeze(mean(X2-X1,1));
YY1=max(min(YY,max(v)),min(v));
YY2=reshape(YY1,im,jm);
[c,h]=contourf(lon,lat,YY2',v);
set(gca,'clim',[min(v) max(v)]);
set(h,'edgecolor','none')
axis([0 360 -90 90])
set(gca,'xtick',[0:60:360],'xticklabel',[])
set(gca,'ytick',[-90:30:90],'yticklabel',[])
hold on
plot(lon1,lat1,'k-')
set(title('(c)\DeltaPRECC ANN, base(2050-2069) - base(2020-2039)'),'fontsize',font)

subplot('position',panels(4,:))
YY=squeeze(mean(X3_DJF-X1_DJF,1));
YY1=max(min(YY,max(v)),min(v));
YY2=reshape(YY1,im,jm);
YY2 = YY2.*Y1_DJF;
[c,h]=contourf(lon,lat,YY2',v);
set(gca,'clim',[min(v) max(v)]);
set(h,'edgecolor','none')
axis([0 360 -90 90])
set(gca,'xtick',[0:60:360],'xticklabel',[])
set(gca,'ytick',[-90:30:90],'yticklabel',[])
hold on
plot(lon1,lat1,'k-')
set(title('(d)\DeltaPRECC DJF, MCB(2050-2069) - base(2020-2039)'),'fontsize',font)

subplot('position',panels(5,:))
YY=squeeze(mean(X3_DJF-X2_DJF,1));
YY1=max(min(YY,max(v)),min(v));
YY2=reshape(YY1,im,jm);
YY2 = YY2.*Y2_DJF;
[c,h]=contourf(lon,lat,YY2',v);
set(gca,'clim',[min(v) max(v)]);
set(h,'edgecolor','none')
axis([0 360 -90 90])
set(gca,'xtick',[0:60:360],'xticklabel',[])
set(gca,'ytick',[-90:30:90],'yticklabel',[])
hold on
plot(lon1,lat1,'k-')
set(title('(e)\DeltaPRECC DJF, MCB(2050-2069) - base(2050-2069)'),'fontsize',font)

subplot('position',panels(6,:))
YY=squeeze(mean(X2_DJF-X1_DJF,1));
YY1=max(min(YY,max(v)),min(v));
YY2=reshape(YY1,im,jm);
[c,h]=contourf(lon,lat,YY2',v);
set(gca,'clim',[min(v) max(v)]);
set(h,'edgecolor','none')
axis([0 360 -90 90])
set(gca,'xtick',[0:60:360],'xticklabel',[])
set(gca,'ytick',[-90:30:90],'yticklabel',[])
hold on
plot(lon1,lat1,'k-')
set(title('(f)\DeltaPRECC DJF, base(2050-2069) - base(2020-2039)'),'fontsize',font)


subplot('position',panels(7,:))
YY=squeeze(mean(X3_JJA-X1_JJA,1));
YY1=max(min(YY,max(v)),min(v));
YY2=reshape(YY1,im,jm);
YY2 = YY2.*Y1_JJA;
[c,h]=contourf(lon,lat,YY2',v);
set(gca,'clim',[min(v) max(v)]);
set(h,'edgecolor','none')
axis([0 360 -90 90])
set(gca,'xtick',[0:60:360],'xticklabel',[])
set(gca,'ytick',[-90:30:90],'yticklabel',[])
hold on
plot(lon1,lat1,'k-')
set(title('(g)\DeltaPRECC JJA, MCB(2050-2069) - base(2020-2039)'),'fontsize',font)

subplot('position',panels(8,:))
YY=squeeze(mean(X3_JJA-X2_JJA,1));
YY1=max(min(YY,max(v)),min(v));
YY2=reshape(YY1,im,jm);
YY2 = YY2.*Y2_JJA;
[c,h]=contourf(lon,lat,YY2',v);
set(gca,'clim',[min(v) max(v)]);
set(h,'edgecolor','none')
axis([0 360 -90 90])
set(gca,'xtick',[0:60:360],'xticklabel',[])
set(gca,'ytick',[-90:30:90],'yticklabel',[])
hold on
plot(lon1,lat1,'k-')
set(title('(h)\DeltaPRECC JJA, MCB(2050-2069) - base(2050-2069)'),'fontsize',font)

subplot('position',panels(9,:))
YY=squeeze(mean(X2_JJA-X1_JJA,1));
YY1=max(min(YY,max(v)),min(v));
YY2=reshape(YY1,im,jm);
[c,h]=contourf(lon,lat,YY2',v);
set(gca,'clim',[min(v) max(v)]);
set(h,'edgecolor','none')
axis([0 360 -90 90])
set(gca,'xtick',[0:60:360],'xticklabel',[])
set(gca,'ytick',[-90:30:90],'yticklabel',[])
hold on
plot(lon1,lat1,'k-')
set(title('(i)\DeltaPRECC JJA, base(2050-2069) - base(2050-2069)'),'fontsize',font)

h=colorbar('horiz');
set(h,'position',[0.21 .07 0.6 0.01])


