Explicit expressions of the 3D velocity field in terms of the conserved quantities of ideal fluid thermocline theory, namely the Bernoulli function, density, and potential vorticity, are generalised in this paper to a compressible ocean with a realistic nonlinear equation of state. The most general such expression is the ‘inactive wind’ solution, an exact nonlinear solution of the inviscid compressible Navier–Stokes equation that satisfies the continuity equation as a consequence of Ertel’s potential vorticity theorem. However, due to the non-uniqueness of the choice of the Bernoulli function, such expressions are not unique and primarily differ in the magnitude of their vertical velocity component. Due to the thermobaric nonlinearity of the equation of state, the expression for the 3D velocity field of a compressible ocean is found to resemble its ideal fluid counterpart only if constructed using the available form of the Bernoulli function, the Bernoulli equivalent of Lorenz’s available potential energy (APE). APE theory also naturally defines a quasi-material, approximately neutral density variable known as the Lorenz reference density. This density variable, in turn, defines a potential vorticity variable that is minimally affected by thermobaric production, thus providing all the necessary tools for extending most results of ideal fluid thermocline theory to a compressible ocean.