  Reduced magnetohydrodynamics is a simplified set of magnetohydrodynamics
equations with applications to both fusion and astrophysical plasmas,
possessing a noncanonical Hamiltonian structure and consequently a number of
conserved functionals. We propose a new discretisation strategy for these
equations based on a discrete variational principle applied to a formal
Lagrangian. The resulting integrator preserves important quantities like the
total energy, magnetic helicity and cross helicity exactly (up to machine
precision). As the integrator is free of numerical resistivity, spurious
reconnection along current sheets is absent in the ideal case. If effects of
electron inertia are added, reconnection of magnetic field lines is allowed,
although the resulting model still possesses a noncanonical Hamiltonian
structure. After reviewing the conservation laws of the model equations, the
adopted variational principle with the related conservation laws are described
both at the continuous and discrete level. We verify the favourable properties
of the variational integrator in particular with respect to the preservation of
the invariants of the models under consideration and compare with results from
the literature and those of a pseudo-spectral code.
