  The mean-field theory of magnetized stellar convection gives rise to the two
possibility of distinct instabilities: the large-scale dynamo instability,
operating in the bulk of the convection zone, and a negative effective magnetic
pressure instability (NEMPI) operating in the strongly stratified surface
layers. The latter might be important in connection with magnetic spot
formation, but the growth rate of NEMPI is suppressed with increasing rotation
rates, although recent direct numerical simulations (DNS) have shown a
subsequent increase in the growth rate. We examine quantitatively whether this
increase in the growth rate of NEMPI can be explained by an alpha squared
mean-field dynamo, and whether both NEMPI and the dynamo instability can
operate at the same time. We use both DNS and mean-field simulations (MFS) to
solve the underlying equations numerically either with or without an imposed
horizontal field. We use the test-field method to compute relevant dynamo
coefficients. DNS show that magnetic flux concentrations are still possible up
to rotation rates above which the large-scale dynamo effect produces mean
magnetic fields. The resulting DNS growth rates are quantitatively well
reproduced with MFS. As expected, for weak or vanishing rotation, the growth
rate of NEMPI increases with increasing gravity, but there is a correction term
for strong gravity and large turbulent magnetic diffusivity. Magnetic flux
concentrations are still possible for rotation rates above which dynamo action
takes over. For the solar rotation rate, the corresponding turbulent turnover
time is about 5 hours, with dynamo action commencing in the layers beneath.
