  Given a fluid equation with reduced Lagrangian $l$ which is a functional of
velocity $\MM{u}$ and advected density $D$ given in Eulerian coordinates, we
give a general method for semidiscretising the equations to give a canonical
Hamiltonian system; this system may then be integrated in time using a
symplectic integrator. The method is Lagrangian, with the variables being a set
of Lagrangian particle positions and their associated momenta. The canonical
equations obtained yield a discrete form of Euler-Poincar\'e equations for $l$
when projected onto the grid, with a new form of discrete calculus to represent
the gradient and divergence operators. Practical symplectic time integrators
are suggested for a large family of equations which include the shallow-water
equations, the EP-Diff equations and the 3D compressible Euler equations, and
we illustrate the technique by showing results from a numerical experiment for
the EP-Diff equations.
