
%
CNAM='NBF20TROC_f19_tn11_01';
YEAR1=1850;
YEARN=2005;
load(['../Data/timeseries_' CNAM '_' sprintf('%4.4i-%4.4i',YEAR1,YEARN) '.mat']);
fff=15;

% get the anomaly (relative to 1850-1899)
%t2m_anomaly=ts_yr.t2m_yr-mean(ts_yr.t2m_yr(1:50));
% get the anomaly (relative to 1961-1990;consistent with HadCRUT)
t2m_anomaly=ts_yr.t2m_yr-mean(ts_yr.t2m_yr(112:141));

t2m_anomaly_obs=load('HadCRUT.4.5.0.0.annual_ns_avg_colum2.txt');
%
ny=YEARN-YEAR1+1;
%----------------------------------------------------------------
%  Figure1
%----------------------------------------------------------------

yaxiss=[-1 1];

%
figure;
h(1)=plot([1:ny]+YEAR1-1,t2m_anomaly,'color',0.7*[1 1 1],'linewidth',1.5);hold on;
h(2)=plot([1:168]+YEAR1-1,t2m_anomaly_obs,'k','linewidth',1.5);
set(gca,'xlim',[0 ny]+YEAR1-1,'fontweight','bold');
set(gca,'xtick',1850:25:2000,'Xminortick','on','Yminortick','on')
grid on;
xlim([1850 2016]);
ylim(yaxiss);
legend(h,{'NorESM historical','HadCRUT4'},'fontsize',12,'location','best')
xlabel('years','fontsize',fff);
ylabel('T2m anomaly (^{\circ}C)','fontsize',fff);
set(gca,'fontsize',fff);

print(gcf,'-dpng','-r500',['plot_timeseries_yr_t2m_' CNAM '_' sprintf('%4.4i-%4.4i',YEAR1,YEARN) '.png'])
print(gcf,'-depsc',['plot_timeseries_yr_t2m_' CNAM '_' sprintf('%4.4i-%4.4i',YEAR1,YEARN) '.eps'])
