function Kh = henrys_coeff_sf6(T,S)

% This function computes and returns the Henry's law coeff Kh for SF6
% in water at T degC and S per mil salinity.
% Kh has units of [mol/m^3/atm]
% Equilibrium concentration in mol/m^3 = Kh*partial pressure of gas (in [atm])
% To convert to mol/m^3/pptv divide Kh by 1e12
% Data from Bullister, Wisegarver, and Menzia (2002), 
% Deep-Sea Research I 49 (2002) 175Ð187 
% This function implements eq(3) from the paper with 
% values taken from Table 2.

% Samar Khatiwala (spk@ldeo.columbia.edu)

a1=-96.5975;
a2=139.883;
a3=37.8193;
b1=0.0310693;
b2=-0.0356385;
b3=0.00743254;

%FP=sw_fp(S,0.*S); % freezing point
%jf=find(T<=FP);
T = (T + 273.16)*0.01;
lnKp = a1 + a2./T + a3*log(T) + S.*(b1 + b2*T + b3*(T.^2));
% exp(lnKp) is K' in mol/l/atm
Kh = 1000*exp(lnKp);  % Henry's law coefficient in mol/m^3/atm

%Kh(jf)=NaN;


