  We present an energy conserving space discretisation of the rotating shallow
water equations using compatible finite elements. It is based on an energy and
enstrophy conserving Hamiltonian formulation as described in McRae and Cotter
(2014), and extends it to include upwinding in the velocity and depth advection
to increase stability. Upwinding for velocity in an energy conserving context
was introduced for the incompressible Euler equations in Natale and Cotter
(2017), while upwinding in the depth field in a Hamiltonian finite element
context is newly described here. The energy conserving property is validated by
coupling the spatial discretisation to an energy conserving time
discretisation. Further, the discretisation is demonstrated to lead to an
improved field development with respect to stability when upwinding in the
depth field is included.
