function r=eosben07_rho_p(p,th,s)
%EOSBEN07_RHO_P Derivative of density with respect to pressure.
%   EOSBEN07_RHO_P(P, TH, S) computes the derivative of seawater density
%   [kg m-3] with respect to pressure at pressure, P [dbar], potential
%   temperature (referenced to 0 dbar), TH [degC], and salinity, S [g
%   kg-1].

eosben07_const

Q0=a21+th.*(a22+a24*th+a25*s)+s.*(a23+a26*s);
Q1=b21+b22*th+b23*s;
r=((b11+b12*th+b13*s).*Q0-(a11+th.*(a12+a14*th+a15*s)+s.*(a13+a16*s)).*Q1)./(Q0+p.*Q1).^2;
