  Mounting evidence from both seismology and experiments on core composition
suggests the existence of a layer of stably stratified fluid at the top of
Earth's outer core. In this work we examine the structure of the geomagnetic
field within such a layer, building on the important but little known work of
Malkus (1979). We assume (i) an idealised magnetostrophic spherical model of
the geodynamo neglecting inertia, viscosity and the solid inner core, and (ii)
a strongly stratified layer of constant depth immediately below the outer
boundary within which there is no spherically radial flow. Due to the
restricted dynamics, Malkus showed that the geomagnetic field must obey a
certain condition which is a more restrictive version of the condition of
Taylor (1963). The nonlinear nature of these constraints makes finding a
magnetic field that obeys them, here termed a Malkus state, a challenging task.
Nevertheless, such Malkus states when constrained further by geomagnetic
observations have the potential to probe the interior of the core. By focusing
on a particular class of magnetic fields for which the Malkus constraints are
linear, we describe a constructive method that turns any purely-poloidal field
into an exact Malkus state by adding a suitable toroidal field. We consider
poloidal fields following a prescribed smooth profile within the core that
match observation-derived models of the magnetic field in either epoch 2015 or
the 10000-yr time averaged field. Multiple possible solutions for the toroidal
field exist, hence we determine the Malkus state of miumum toroidal energy and
we find that it has a strong azimuthal toroidal field, larger than the observed
poloidal component at the core-mantle boundary. For the 2015 field for a layer
of depth 300 km, we estimate a root mean squared azimuthal toroidal field of 3
mT with a pointwise maximum of 8 mT occurring at a depth of about 70 km.
