clf
K2 = [-0.000964000000000000 , -1.0013e-03];
CTD_Sal = 31.6:.1:33.6;
pH_tot = nan(size(CTD_Sal));
for i = 1:length(CTD_Sal)
    [pH_tot(i), ~] = calc_dfet_pHext_k0(-0.885, 12,  CTD_Sal(i), k0, cal.k2); % -1.0013e-03
end

plot(CTD_Sal,pH_tot)
xlabel('K2')
ylabel('pH tot')

%%

clf
K2 = [-0.000964000000000000 , -1.0013e-03];
pH_tot = nan(size(K2));
for i = 1:length(K2)
    [pH_tot(i), ~] = calc_dfet_pHext_k0(-0.885, 12,  32.6, k0, K2(i)); % -1.0013e-03
end

plot(K2,pH_tot,'-o')
xlabel('K2')
ylabel('pH tot')

%% 

clf
vrse = -0.885:.01:-0.800;
pH_tot = nan(size(vrse));
for i = 1:length(vrse)
    [pH_tot(i), ~] = calc_dfet_pHext_k0(vrse(i), 12,  32.6, k0, cal.k2); % -1.0013e-03
end
plot(vrse,pH_tot)

xlabel('vrse')
ylabel('pH tot')
%% 

clf
K0 = -1.36:0.005:-1.29;
pH_tot = nan(size(K0));
for i = 1:length(K0)
    [pH_tot(i), ~] = calc_dfet_pHext_k0(-0.885, 12,  32.6, K0(i), cal.k2); % -1.0013e-03
end
plot(K0,pH_tot)

xlabel('K0')
ylabel('pH tot')