function [ww] = THOONpH_adj(ww,k0_adj)
% recalculate pH total and free with the adjusted k0 value, k2, and Pcoefs

% Vext = ww.pH_voltage;
% tempC = ww.Temperature;
% salt = ww.Practical_Salinity;
% k0_adj = ww.k0_adj;
% k2_gdf5 = -9.66638e-04; % Lab calibration % prob shouldn't hard code in future
% 
% [ww.pHext_tot_adj, ww.pHext_free_adj] = calc_pHext(Vext, tempC, salt, k0_adj, k2_gdf5);
try % some files have this
    Vrs = ww.pH_voltage;
catch % other files have this
    Vrs = ww.pH_VRS;
end
Press = ww.Pressure;
Temp = ww.Temperature;
Salt = ww.Practical_Salinity;
if nargin < 2
    k0_adj = ww.k0_adj;
end
k2 = ww.k2;
Pcoefs = ww.Pcoefs;
[ww.pH_free_adj, ww.pH_tot_adj] = phcalc_jp(Vrs, Press, Temp, Salt, k0_adj, k2, Pcoefs);

end