But in my data set I didn't had pressure data, and if calculate pressure by p = p0 + rho*g*h ; if I calculate rho by ferret function rho_un(sal,temp,ref_pressure) again temperature is potential temperature in this situation how should I proceed.
You ask a relevant question. To compute p, we need rho. To compute rho, we need p. How should we proceed?
1) Just use the approximation p = p0 + rho0 * g * z, where rho0 is a constant, mean density of sea water.
2) Iterate: The above procedure gives an initial approximation of p as a function of z. Then compute rho(z) using THAT p(z). Repeat until it converges.
3) Solve the ordinary differential equation dp/dz = g * rho_un(S(z), T(z), p) downwards starting from p = p0.
I have compared methods (1) and (2) and found differences of a few tens of Pascals at a depth of 3500m, IF I REMEMBER CORRECTLY, which I'm not sure at all about! I friend of mine uses method (3) and seems to be successful.
This is a nonlinear problem and I guess multiple solutions may exist, but I guess usually method (1) is good enough for most purposes.