  In Hamiltonian systems characterized by a degenerate Poisson algebra, we show
how to construct a local energy-like quantity that can be used to study
diabatic effects on the evolution of the Available Energy of the system, the
latter concept formalizing the original idea of Margules'. We calculate the
local diagnostic energy for geophysically relevant flows. For the particular
case of stratified Boussinesq flows, we show that under moderately general
conditions, in inertial frames where the initial distribution of potential
vorticity is even around the origin, our framework recovers the Available
Potential Energy introduced by Holliday and McIntyre \cite{HollidayM81}, and as
such depends only on the mass distribution of the flow. In non-inertial frames,
we show that the local diagnostic energy of flows which are, in an appropriate
sense, characterized by a low-Rossby number ${\rm Ro}$ ground state, has to
lowest order in ${\rm Ro}$, a universal character.
