  We extend the local theory of available potential energy (APE) to a general
multicomponent compressible stratified fluid, accounting for the effects of
diabatic sinks and sources. As for simple compressible fluids, the total
potential energy density of a fluid parcel is the sum of its available elastic
energy (AEE) and APE density. These respectively represent the adiabatic
compression/expansion work needed to bring it from its reference pressure to
its actual pressure and the work against buoyancy forces required to move it
from its reference state position to its actual position. Our expression for
the APE density is new and derived using only elementary manipulations of the
equations of motion; it is significantly simpler than existing published
expressions, while also being more transparently linked to the relevant form of
APE density for the Boussinesq and hydrostatic primitive equations. Our new
framework is used to clarify the links between some aspects of the energetics
of Boussinesq and real fluids, as well as to shed light on the physical basis
underlying the choice of reference state(s) in local APE theory.
