  We present the first model that couples the formation of the corona of a
solar active region to a model of the emergence of a sunspot pair. This allows
us to study when, where, and why active region loops form, and how they evolve.
We use a 3D radiation MHD simulation of the emergence of an active region
through the upper convection zone and the photosphere as a lower boundary for a
3D MHD coronal model. The latter accounts for the braiding of the magnetic
fieldlines, which induces currents in the corona heating up the plasma. We
synthesize the coronal emission for a direct comparison to observations.
Starting with a basically field-free atmosphere we follow the filling of the
corona with magnetic field and plasma. Numerous individually identifiable hot
coronal loops form, and reach temperatures well above 1 MK with densities
comparable to observations. The footpoints of these loops are found where small
patches of magnetic flux concentrations move into the sunspots. The loop
formation is triggered by an increase of upwards-directed Poynting flux at
their footpoints in the photosphere. In the synthesized EUV emission these
loops develop within a few minutes. The first EUV loop appears as a thin tube,
then rises and expands significantly in the horizontal direction. Later, the
spatially inhomogeneous heat input leads to a fragmented system of multiple
loops or strands in a growing envelope.
