function  r=oxygen_cal_staslope_ml(sbecoef);

load /TMP/temp_oxydata_ml

p_slope=1;
ox=oxyg_eq(p_equation, p_slope, sbecoef, sbecoefd, btl);

if wswitch==1  % L2 norm weighted by a16n 2003 nominal bottle depths
    
    eps=1e-5;
    wtab=[[0,100,100+eps,300,300+eps,500,500+eps,1200,1200+eps,2000,2000+eps,7000];[20,20,25,25,50,50,100,100,200,200,500,500]];
    wgt=interp1(wtab(1,:),wtab(2,:),btl.dpres);
    
    r=sum((wgt.*(btl.wnklo2um-ox)).^2)/sum(wgt.^2);

elseif wswitch==2  % YIKES, L1 norm
    
    r=sum(abs(btl.wnklo2um-ox));
    
elseif wswitch==3  % DOUBLE YIKES, L4 norm
    
    r=sum((btl.wnklo2um-ox).^4);
    
else  % a plain old vanilla L2 norm
    
    r=sum((btl.wnklo2um-ox).^2);
    
end % if wswitch==1
