  The parameterization of moist convection contributes to uncertainty in
climate modeling and numerical weather prediction. Machine learning (ML) can be
used to learn new parameterizations directly from high-resolution model output,
but it remains poorly understood how such parameterizations behave when fully
coupled in a general circulation model (GCM) and whether they are useful for
simulations of climate change or extreme events. Here, we focus on these issues
using idealized tests in which an ML-based parameterization is trained on
output from a conventional parameterization and its performance is assessed in
simulations with a GCM. We use an ensemble of decision trees (random forest) as
the ML algorithm, and this has the advantage that it automatically ensures
conservation of energy and non-negativity of surface precipitation. The GCM
with the ML convective parameterization runs stably and accurately captures
important climate statistics including precipitation extremes without the need
for special training on extremes. Climate change between a control climate and
a warm climate is not captured if the ML parameterization is only trained on
the control climate, but it is captured if the training includes samples from
both climates. Remarkably, climate change is also captured when training only
on the warm climate, and this is because the extratropics of the warm climate
provides training samples for the tropics of the control climate. In addition
to being potentially useful for the simulation of climate, we show that ML
parameterizations can be interrogated to provide diagnostics of the interaction
between convection and the large-scale environment.
