function ACS_T_S_correction(Sal)

%Input Salinity to correct T_S effect
%Other paratermeters are read from file name or data file
%Written by Linhai Li, July 9, 2013

[filename, t, T, Tcal, wla, wlc, a_uncorr, c_uncorr]=read_acs_data;

%Read T&S correction coefficient
tmp = xlsread('Sullivan_etal_2006_instrumentspecific.xls');

phi_Ta=interp1(tmp(:,1),tmp(:,2),wla,'linear');
phi_Tc=interp1(tmp(:,1),tmp(:,2),wla,'linear');
phi_Sc=interp1(tmp(:,1),tmp(:,4),wlc,'linear');
phi_Sa=interp1(tmp(:,1),tmp(:,6),wla,'linear');

for i=1:numel(t)
    a_tscorr(i,:)=a_uncorr(i,:)-(T-Tcal)*phi_Ta-Sal*phi_Sa;
    c_tscorr(i,:)=c_uncorr(i,:)-(T-Tcal)*phi_Tc-Sal*phi_Sc;
end

figure('Name', filename, 'NumberTitle', 'off');
subplot(2,1,1);
plot(wla, a_uncorr, '-', wla, a_tscorr, '--');
ylabel('a_tscorr (1/m)', 'interpreter', 'none');

subplot(2,1,2);
plot(wlc, c_uncorr, '-', wlc, c_tscorr, '--');
xlabel('Wavelength (nm)');
ylabel('c_tscorr (1/m)', 'interpreter', 'none');

save([filename,'.mat'],['a_tscorr',filename],['c_tscorr',filename]);

