  We investigate the dynamics of a fluid layer subject to an imposed bottom
heat flux and a top monotonically-increasing temperature profile driving
horizontal convection. We use direct numerical simulations and consider a large
range of flux-based Rayleigh numbers $10^6 \leq Ra_F \leq 10^9$ and imposed top
horizontal to bottom vertical heat flux ratios $0 \leq \Lambda \leq 1$. The
fluid domain is a closed two-dimensional box with aspect ratio $4\leq \Gamma
\leq 16$ and we consider no-slip boundaries and adiabatic side walls. We
demonstrate a regime transition from Rayleigh--B\'enard convection (RB) to
horizontal convection (HC) at $\Lambda\approx 10^{-2}$, which is independent of
$Ra_F$ and $\Gamma$. At small $\Lambda$, the flow is organized in multiple
overturning cells with approximately unit aspect ratio, while at large
$\Lambda$ a single cell is obtained. The RB-relevant Nusselt number scaling
with $Ra_F$ and the HC-relevant Nusselt number scaling with the horizontal
Rayleigh number $Ra_L=Ra_F\Lambda\Gamma^4$ are in good agreement with previous
results from classical RB convection and HC studies in the limit $\Lambda \ll
10^{-2}$ and $\Lambda \gg 10^{-2}$, respectively. We demonstrate that the
system is multi-stable near the transition $\Lambda\approx10^{-2}$, i.e. the
exact number of cells not only depends on $\Lambda$ but also on the system's
history. Our results suggest that subglacial lakes, which motivated this study,
are likely to be dominated by RB convection, unless the slope of the ice-water
interface, which controls the horizontal temperature gradient via the
pressure-dependence of the freezing point, is greater than unity.
