clear all
close all
clc
load('/phoddat/share/pita/EN4/EN4_T_S_SA.mat')
yfrac = month2yfraction(julian2month(time));%35S
month=julian2month(time);
mes = str2num(month(:,5:6));
S_34=squeeze(S(:,7,1,:));
[S_clim,~,std_S_clim] = make_clim(S_34',month,'clim');
S_clim=squeeze(S_clim)';
std_S_clim=squeeze(std_S_clim)';
std_S_clim=std_S_clim./sqrt(length(time)/12);
Sa_34=S_34-S_clim(:,mes);

load mapanom;
figure
set(gcf,'Units', 'Normalized', 'OuterPosition', [0, 0.04, 1, 0.96],'color','w','visible','on')
subplot(1,3,3)
pcolor(lon,yfrac,Sa_34'),shading flat,colormap(mapanom);
hold on,
plot([-55 20],[2017.5 2017.5],'--k','linewidth',1)
xlabel('Longitude')
ylabel('Time (years)')
xlim([-55 20])
ylim([2005 2024])
c=colorbar;caxis([-1 1])
ylabel(c,'S_{Anomaly} (PSU)')
set(gca,'FontName','Arial','fontsize',20,'fontweight','bold')

subplot(3,3,[4:5])
plot(yfrac,nanmean(Sa_34,1),'k','linewidth',2)
hold on
plot([2017.5 2017.5],[-1 1],'--k','linewidth',1)
xlim([2005 2024])
ylim([-.3 .3])
ylabel('S_{Anomaly} (PSU)')
xlabel('Time (years)')
set(gca,'FontName','Arial','fontsize',20,'fontweight','bold')


