clear all;close all;
addpath('~/output/carbon/NOIIANOC_mr03_hist2/Cant');
DataPath='~/output/carbon/NOIIANOC_mr03_hist2/Cant/';

load model_decadal_change.mat
anthct_mdl=anthct;
maget_mdl=maget;
%load ttd_decadal_change_sf6.mat
load ttd_decadal_change_cfc12.mat
anthct_ttd=anthct;
maget_ttd=maget;

anthct=anthct_ttd-anthct_mdl;
maget=maget_ttd-maget_mdl;

%% anthc
figure; hold on;
pcolor(yr,depth,anthct);shading flat;hc=colorbar;
set(gca,'ydir','reverse','xlim',[1990 2009],'ylim',[0 4000],'fontsize',16,'fontweight','bold');
grid on;box on;
caxis([-7 7]);
xlabel('Year','fontsize',16,'fontweight','bold');
ylabel('Depth (m)','fontsize',16,'fontweight','bold');
title('Cant (ttd-model; umol/kg)','fontsize',16,'fontweight','bold');
%cmap=cbrewer('seq','YlOrRd',24);
cmap=cbrewer('div','RdBu',20);
colormap(flipud(cmap));
cbfit(hc,4);
set(gcf,'color','white');figsize(11.69,8.26);
%pathout='~/output/carbon/NOIIANOC_mr03_hist2/profile/hovmoller/';
pathout='/Users/heyc/output/carbon/NOIIANOC_mr03_hist2/profile/hovmoller/';
%figname='anthc_ttd_sf6-mdl_1990-2009';
figname='anthc_ttd_cfc12-mdl_1990-2009';
mfile=[mfilename('fullpath'),'.m'];
fighist(mfile,pathout,figname)
%save2pdf([pathout,figname])
export_fig (gcf, [pathout,figname], '-png','-m2.5','-r300', '-a2', '-q101', '-painters', '-rgb');
%

%% maget
figure; hold on;
pcolor(yr,depth,maget);shading flat;hc=colorbar;
set(gca,'ydir','reverse','xlim',[1990 2009],'ylim',[0 4000],'fontsize',16,'fontweight','bold');
%caxis([-70 70]);
xlabel('Year','fontsize',16,'fontweight','bold');
ylabel('Depth (m)','fontsize',16,'fontweight','bold');
title('Age diff. (ttd-model; yr)','fontsize',16,'fontweight','bold');
cmap=cbrewer('div','RdBu',24);
colormap(flipud(cmap));cbfit(hc,4);
set(gcf,'color','white');figsize(11.69,8.26);
mfile=[mfilename('fullpath'),'.m'];
fighist(mfile,pathout,figname)
pathout='~/output/carbon/NOIIANOC_mr03_hist2/profile/hovmoller/';
%figname='mage_ttd_sf6-mdl_1990-2009';
figname='mage_ttd_cfc12-mdl_1990-2009';
mfile=[mfilename('fullpath'),'.m'];
fighist(mfile,pathout,figname)
%save2pdf([pathout,figname])
export_fig (gcf, [pathout,figname], '-png','-m2.5','-r300', '-a2', '-q101', '-painters', '-rgb');
