An Energy Consistent Discretization of the Nonhydrostatic Equations in Primitive Variables. (10th January 2020)