close all;clear all
load model_decadal_change.mat
magep1=nanmean(maget(:,1:10),2);
magep2=nanmean(maget(:,11:20),2);
depth=ncread('~/tools/data/tnx1v1_depth.nc','depth');

figure; hold on;
plot(magep1,depth,'r-','linewidth',3);
plot(magep2,depth,'b-','linewidth',3);
legend('1990s','2000s');
set(gca,'ydir','reverse','fontsize',20);
set(gca,'ylim',[0 3500]);
xlabel('Time (year)','fontsize',20);
ylabel('depth (m)','fontsize',20);
title('model','fontsize',20);
save2pdf('age_model_profile');

load ttd_decadal_change_sf6.mat
magep1=nanmean(maget(:,1:10),2);
magep2=nanmean(maget(:,11:20),2);
depth=ncread('~/tools/data/tnx1v1_depth.nc','depth');

figure; hold on;
plot(magep1,depth,'r-','linewidth',3);
plot(magep2,depth,'b-','linewidth',3);
legend('1990s','2000s');
set(gca,'ydir','reverse','fontsize',20);
set(gca,'ylim',[0 3500]);
xlabel('Time (year)','fontsize',20);
ylabel('depth (m)','fontsize',20);
title('TTD','fontsize',20);
save2pdf('age_TTD_profile');
