  Wind forcing of the ocean generates a spectrum of inertia-gravity waves that
is sharply peaked near the local inertial (or Coriolis) frequency. The
corresponding near-inertial waves (NIWs) are highly energetic and play a
significant role in the slow, large-scale dynamics of the ocean. To analyse
this role, we develop a new model of the nondissipative interactions between
NIWs and balanced motion. The model is derived using the
generalised-Lagrangian-mean (GLM) framework (specifically, the glm variant of
Soward & Roberts (2010)), taking advantage of the time-scale separation between
the two types of motion to average over the short NIW period.
  We combine Salmon's (2013) variational formulation of GLM with Whitham
averaging to obtain a system of equations governing the joint evolution of NIWs
and mean flow. Assuming that the mean flow is geostrophically balanced reduces
this system to a simple model coupling Young & Ben Jelloul's (1997) equation
for NIWs with a modified quasi-geostrophic equation. In this coupled model, the
mean flow affects the NIWs through advection and refraction; conversely, the
NIWs affect the mean flow by modifying the potential-vorticity inversion - the
relation between advected potential vorticity and advecting mean velocity -
through a quadratic wave term, consistent with the GLM results of Buhler &
McIntyre (1998).
  The coupled model is Hamiltonian and its conservation laws, for wave action
and energy in particular, prove illuminating: on their basis, we identify a new
interaction mechanism whereby NIWs forced at large scales extract energy from
the balanced flow as their horizontal scale is reduced by differential
advection and refraction so that their potential energy increases. A rough
estimate suggests that this mechanism could provide a significant sink of
energy for mesoscale motion and play a part in the global energetics of the
ocean.
