{'fraction_non_alphanumeric': 0.027130974420484472, 'fraction_numerical': 0.009008891554327136, 'mean_word_length': 4.81700288184438, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Solar Magnetic Fields

This review provides an introduction to the generation and evolution of the Sun's magnetic field, summarising both observational evidence and theoretical models. The eleven year solar cycle, which is well known from a variety of observed quantities, strongly supports the idea of a large-scale solar dynamo. Current theoretical ideas on the location and mechanism of this dynamo are presented. The solar cycle influences the behaviour of the global coronal magnetic field and it is the eruptions of this field that can impact on the Earth's environment. These global coronal variations can be modelled to a surprising degree of accuracy. Recent high resolution observations of the Sun's magnetic field in quiet regions, away from sunspots, show that there is a continual evolution of a small-scale magnetic field, presumably produced by small-scale dynamo action in the solar interior. Sunspots, a natural consequence of the large-scale dynamo, emerge, evolve and disperse over a period of several days. Numerical simulations can help to determine the physical processes governing the emergence of sunspots. We discuss the interaction of these emerging fields with the pre-existing coronal field, resulting in a variety of dynamic phenomena.


Introduction
The Sun's magnetic field is generated through dynamo action in the solar interior. While the key physical processes involved with this dynamo are hidden from view, the consequences of the resulting magnetic field can be seen in the solar atmosphere. The large-scale magnetic field is characterised by the appearance of sunspots, regions of intense magnetic field, the number of which varies with a cycle of approximately eleven years. In addition, there is a small-scale magnetic field that varies on a much shorter timescale. The appearance of sunspots and the continual motion of the small-scale field ensure that the magnetic field of the solar atmosphere is very dynamic, with many solar phenomena owing their existence to this evolving field. The aim of this article is to describe the present theoretical ideas behind various aspects of the solar magnetic field. In particular, we shall look at current ideas for the dynamo mechanism(s) responsible for the generation of large-and smallscale fields, and will then consider the dynamical behaviour of the surface manifestations of these fields, how they might burst through the solar surface and interact with magnetic field in the solar atmosphere. We have tried to address an audience familiar with aspects of the Earth's magnetic field, but maybe less so with those of the Sun. Thus it is perhaps appropriate first to present a short description of the basic properties of the solar interior and the solar atmosphere.

Properties of the solar interior
The radius of the Sun is R ⊙ = 696 Mm, or equivalently 69 600 km. From the theory of stellar structure, it follows that the interior of the Sun has three physically distinct regions. At the centre, extending to approximately 0.25R ⊙ , is the core, in which nuclear reactions fuse hydrogen into helium, with the associated release of energy. From 0.25R ⊙ to 0.71R ⊙ , through what is known as the radiative zone, energy is transferred by the emission and absorption of photons. The outer 30% by radius of the Sun (which, however, constitutes only 2% of the solar mass) is the convection zone; here, the increase in opacity leads to a temperature gradient sufficiently steep to trigger convective motions. Recently, in only the past thirty years or so, it has become possible actually to determine properties of the solar interior via observation and inversion of the sound waves propagating through the interior -a field known as helioseismology. Of particular interest for theories concerning the generation of the solar magnetic field is the deduction of the solar interior rotation rate, Ω. Although, through observations of surface magnetic features, it has been known for hundreds of years that the solar surface rotates differentially, with the equator rotating faster than the poles, with periods of approximately 25 and 34 days respectively, the nature of the internal rotation rate remained a matter for theoretical speculation. The actual internal rotation rate revealed by helioseismology turned out to be rather surprising (Schou et al., 1998). The differential rotation in latitude of the surface is maintained throughout the convection zone, with very little radial variation; the radiative zone is in solid body rotation, with an angular velocity comparable with that of the surface at approximately 30 • latitude. The abrupt change in angular rotation between the convection and radiative zones is then accommodated in a very thin shear layer, known as the tachocline; ∂Ω/∂r > 0 at low latitudes, ∂Ω/∂r < 0 at higher latitudes. Although very thin in extent, occupying just a few per cent of the solar radius, the existence of the tachocline is of great significance both in determining the long-term evolution of the Sun and also for its possible role in the generation of the solar magnetic field; all currently known aspects of tachocline dynamics are covered in the recent volume edited by Hughes et al. (2007).
Magnetic field pervades all regions of the Sun. In the radiative zone, it is presumably responsible for enforcing the observed solid body rotation (see Mestel and Weiss, 1987) and hence the dynamical behaviour of the magnetic field is a key factor in the evolution of the radiative zone. For the purposes of this review however, which concentrates on the observed solar magnetic field and the processes responsible for that field, we shall confine our attention to the magnetic field in the convection zone (including the tachocline) and the solar atmosphere. A comprehensive discussion of all aspects of stellar magnetic fields can be found in Mestel (1999).

Properties of the solar atmosphere
The visible 'surface' of the Sun is the photosphere. The temperature is around 6 000 K and the radiation is in the form of white light. The thickness of the photosphere is only 500 km; the base of the photosphere is where the optical depth is τ 500 = 1 and the top is where the temperature reaches its minimum value.
The most obvious surface features are sunspots; an example is shown in Figure 1. Sunspots have been observed in detail since the invention of the telescope in the 17th century; they were first identified as regions of extremely strong magnetic field by Hale (1908). The typical magnitude of the magnetic field in a sunspot is the order of 3 000 G or 0.3 Tesla. The magnetic field manifested in sunspots is generated by dynamo action in the solar interior.
High resolution images of the photosphere, away from sunspots, show evidence of convection through granules and supergranules. Granules are approximately 1000 km in horizontal extent and cover the entire surface of the Sun. Hot plasma rises up from the solar interior in the bright centres, spreads out across the surface and then cools and sinks into the interior along dark lanes. The lifetime of an individual granule is about 20 minutes, with the granulation pattern continually changing as newly formed granules push aside old ones. The horizontal plasma flow within a granule can reach speeds of around 7 km s −1 .
Supergranules are much larger, with a size of about 14 000 km. They are not visible in white light but are revealed through Doppler velocity measurements. Like the granules, which lie inside the supergranules, they cover the entire photosphere and are continually changing. Individual supergranules last for around 24 hours and have much slower plasma speeds of about 0.5 km s −1 .
Above the photosphere, the chromosphere is an irregular layer with a thickness of around 10 000 km, in which the temperature rises from 6 000 K to about 20 000 K. The plasma now emits in the wavelength of Hydrogen alpha (Hα); features seen in Hα are thought to outline the local magnetic field lines. At the top of the chromosphere, the temperature rises sharply through a thin layer called the transition region.
The corona is the Sun's outer atmosphere. It is visible from Earth during total eclipses of the Sun as a diffuse white region surrounding the Sun. The temperature in the corona increases dramatically, to the order of 1 million K, and the wavelength of the plasma emission is in the X-ray and Extreme Ultra-Violet ranges. One major problem in solar physics is to explain why the corona is so hot. The corona displays a variety of features that are entirely controlled by the local, evolving coronal magnetic field, including streamers, plumes, and loops.

Modelling philosophy
To reproduce through numerical simulations all the detailed observations of the evolution of the Sun's magnetic field, obtained from various instruments, is certainly currently impossible since there are simply too many distinct timescales and lengthscales to resolve in numerical simulations. Indeed, even with the continuing increase in computational power and affordability, such direct modelling will remain impossible for the foreseeable future. There are many physical and atomic processes required for a complete modelling of the solar atmosphere. For example, computationally demanding processes include (i) radiative transfer effects in the photosphere and chromosphere and (ii) optically thin radiative losses, thermal conduction and heating in the corona. In addition, in the cool photosphere and low chromosphere, partial ionisation must be considered. All of these processes require knowledge of, for example, the ion abundances, whether the plasma is in local thermodynamic equilibrium or not, and whether the plasma is in ionisation balance.
Controlled numerical experiments allow one to specify which physical effects are to be studied. Hence, the modelling philosophy is to consider a simpler initial state, for example one that is in equilibrium, and then modify it in a controlled manner to see how one effect at a time influences the evolution. Incorporating too many variations all at once obscures the important or dominant physical processes.

Outline
The outline of the paper is as follows. Section 2 presents the MHD equations used in modelling the solar dynamo, the Earth's dynamo and the magnetic field evolution in the solar corona. In Section 3 the observational evidence for the solar cycle is presented. Next, Section 4 describes the current state of modelling the generation of the Sun's magnetic field, both the largescale magnetic field, on the scale of active regions, and the small-scale field, on the scale of the granulation. Section 5 compares the dynamo mechanisms of the Sun and the Earth, and looks at the similarities and differences in the computational models of both types of dynamo. Moving to the atmospheric consequences of the solar dynamo, Section 6 considers the nature of the coronal magnetic field, and the manner in which it is influenced by the movement of the photospheric field. Returning to the formation of individual active regions, Section 7 investigates how the strong magnetic field generated in the solar interior actually emerges through the photosphere and rises into the corona, where it interacts with the pre-existing field. During this process, many of the observational phenomena, whose properties are linked to the solar cycle, are seen to occur in a self-consistent manner. The final section summarises the paper.

MHD Equations
The gas of the Sun, both in the interior and the atmosphere, is ionised. Its dynamical evolution can be described by the equations of MagnetoHydro-Dynamics (MHD), a set of coupled, non-linear partial differential equations, which may be stated as Here ρ is the mass density, u the plasma velocity, Ω the rotation vector, p the plasma pressure, j the current density, B the magnetic induction (though commonly called the magnetic field) and T the temperature; g is the gravitational acceleration, γ the ratio of specific heats, commonly assumed to be 5/3,μ is the mean molecular weight, R is the gas constant, µ the magnetic permeability, and η the magnetic diffusivity, with η = 1/µσ and σ the electrical conductivity. In the momentum equation (1), F ν represents the viscous force for a Newtonian fluid. The thermal conductivity tensor, κ, is normally taken as isotropic in the solar interior but is highly anisotropic in the solar corona. Ohm's law in its simplest form has been used to derive the induction equation. The energy equation consists of the adiabatic terms together with sources of heating through Ohmic and viscous heating, including shock heating. However, additional terms such as optically thin radiation, radiative transfer effects, partial ionisation, etc. may need to be included in different levels of the solar atmosphere. These equations can be solved (at least in certain parameter regimes) using 3D MHD simulation codes on a parallel computer. For example, compressible magnetoconvection has been modelled by Matthews et al. (1995), magnetic events in the solar atmosphere by the Lare3d code (Arber et al., 2001). These basic equations are also the appropriate fundamental equations for modelling the Earth's magnetic field, although it should be noted that sound waves have no dynamic effects in the Earth, and hence it is then advantageous to adopt equations in which they are neglected. Consequently, geodynamo models typically adopt either the Boussinesq approximation (in which sound waves and stratification are ignored) or, more realistically, the anelastic approximation (in which sound waves are again filtered out, but stratification retained). Indeed, the anelastic approximation may also be valid for the deep solar interior, and global solar dynamo models often employ this approximation (e.g. Clune et al., 1999). Under the Boussinesq approximation, density variations appear only in the buoyancy term in equation (1), and equation (2) simplifies to ∇ · u = 0; viscous and Ohmic heating are omitted from equation (4). The anelastic approximation, which is less restrictive (but inevitably more complicated) than the Boussinesq approximation, considers departures from an adiabatic reference state, leading to changes in equations (1), (2) (which becomes ∇ · (ρu) = 0) and (4). A detailed discussion of the two approximations may be found in Lantz and Fan (1999).
The relative importance of the various terms in the MHD equations can be gauged by the size of various dimensionless parameters. The ratio of advective to diffusive terms in the momentum equation (1) and the induction equation (3) are given, respectively, by the Reynolds number Re and the magnetic Reynolds number Rm, defined by where U and L are characteristic velocity and length scales and ν is the kinematic viscosity. Both Reynolds numbers are large in the solar interior (Re = O(10 9 ), Rm = O(10 6 )), with their ratio P m = Rm/Re = ν/η, the magnetic Prandtl number, being small. In the solar corona, Rm = O(10 8 ) -O(10 12 ) while Re is also larger than unity and is of probably O(10 4 ). The value of Re is based on the kinematic viscosity parallel to the magnetic field. Large values of Re are characteristic of turbulent flows; large values of Rm mean that resistive effects are restricted to thin regions where the current density is large. However, if the plasma flows are turbulent, then Rm can be reduced significantly. The regular Prandtl number is defined by P r = ν/κ. The importance of the viscous to Coriolis terms in (1) is given by the Ekman number, defined by Alternatively, the relative importance of these two terms is expressed, conversely, as the Taylor number, defined by T a = E −2 .

Solar Cycle Variations
The main evidence for the solar cycle comes from studying the evolution of sunspots over time. The number of sunspots and the area they occupy vary with a rough period of 11 years. At the start of a cycle, these quantities are low. They rapidly increase in value to reach a maximum before decreasing, more slowly this time, down to minimum values. The existence of the Sun's cyclic variation is evident from observations of (i) 10.7 cm solar flux, (ii) the total solar irradiance, (iii) solar flares and Coronal Mass Ejections (CMEs), (iv) interactions with the geomagnetic field, (v) cosmic rays at the Earth, and (vi) radioisotopes in tree rings and ice cores.
Measurements of isotopes such as 14 C, found in trees, and 10 Be, deposited in ice cores, reflect the number of cosmic rays reaching the Earth; they provide a proxy measure of the solar magnetic field, since a strong field emanating from the Sun acts to shield the Earth from cosmic rays. Records of such radioisotopes provide information on the 11-year solar cycle for the past 600 years, and on longer time variations of the magnetic field stretching back nearly 10 000 years (Beer, 2000). They show that solar activity is modulated in an aperiodic and apparently chaotic manner, with episodes both of enhanced and diminished magnetic activity (Weiss, 2010). The most recent dramatic example of the latter was the Maunder minimum, the period from 1645-1715, during which very few sunspots appeared.

Sunspot cycle
Sunspots typically appear as a bipolar region (an active region), with a dominant sunspot of one polarity leading (in the sense of the solar rotation) the trailing, opposite polarity region. At the start of a new sunspot cycle, the sunspots appear at high latitudes, around ±30 • , and, as the cycle continues, the new sunspots emerge closer and closer to the equator. The trailing polarity may be another sunspot or it can be a more diffuse magnetic region. Hale's polarity law states that at any given time, the polarity of the leading (and hence also the trailing) spot is the same in a given hemisphere, but is reversed from northern to southern hemispheres. This is illustrated in Figure 1 (top) which shows a magnetogram, with white corresponding to positive polarity and black to negative; in the northern hemisphere, the leading polarity is positive and in the southern hemisphere it is negative. During the next solar cycle, this reverses and the leading polarity in the northern hemisphere will now be negative (so a full magnetic cycle takes approximately 22 years).
In addition, Joy's law states that, while the bipolar region is essentially in the East-West direction, the leading polarity is always slightly closer to the equator than the trailing polarity. Figure 1 (bottom) shows a bipolar sunspot pair in the northern hemisphere and the corresponding tilt angle. These properties are important and must be built into models that use the photospheric magnetic field to extrapolate the field into the corona. The magnetic field strength in a new sunspot grows in magnitude over a few days. Most sunspots decay within a few days after that, although extremely large sunspots and active regions can last for up to 28 days. When the sunspot starts to decay, supergranulation eventually assists in the breakup of the strong magnetic field region, a process that can be modelled by a diffusion equation.

Small-scale fields
Sunspots and active regions are the most obvious indicators of the solar dynamo. However, away from the active regions, there is a continual emergence and evolution, including fragmentation, coalescence and cancellation, of much smaller-scale fields. Such fields emerge as ephemeral regions within supergranules and on much smaller scales within granules. The recent observations from the Solar Optical Telescope on board the Hinode mission has the resolution to investigate the distribution of magnetic fields, from very weak fields with a flux of around 10 16 Mx to the large active region sunspots with a flux of up to 10 22 Mx. How important is this small-scale field? Figure 2 shows the probability distribution function of emergence events in units of Mx −1 cm −2 day −1 as a function of the magnetic flux. The key point is that the various data sets can be approximated by a single power law fit with a slope of −2.7. Since the slope is greater than 2, this implies that there is more photospheric magnetic flux contained within the small-scale field than in the active regions. A single power law indicates that there is no preferred scale for the emergence of magnetic flux at the solar photosphere, providing useful constraints on solar dynamo models.  (2001). The results from SOT on Hinode, which can observe the small-scale field more accurately, are also shown. It is clear that at solar maximum the tail of the distribution function is enhanced and a single power law fit is possible. At solar minimum there is now less large-scale flux as there are few active regions. However, the small-scale flux appears to maintain the same slope at both stages of the solar cycle. Thus, while the large-scale magnetic fields in sunspots varies during the solar cycle, there is no decrease in the small-scale field during solar minimum.
The small-scale magnetic features are, therefore, extremely important. These are moved around the solar photospheric surface by the continually changing granulation and supergranulation flow patterns; the movement of these magnetic features is often referred to as the magnetic carpet. A simple estimate of the Poynting flux, the magnetic energy flowing into the upper solar atmosphere due to the motion of the magnetic carpet, indicates that there is sufficient energy to heat the solar corona and explain why the coronal temperature is around a million degrees (Mackay et al., 2011).

The Solar Dynamo
It is almost universally accepted that the solar magnetic field is the result of some sort of hydromagnetic dynamo action, in which plasma motions maintain the magnetic field against its tendency otherwise to decay. The alternative possibility, namely that the observed field is derived from a very slowly decaying primordial field, is almost impossible to reconcile with the short term oscillations of the field exhibited by the solar cycle. That said, there is still no consensus regarding the location or the underlying physical mechanism of the solar dynamo.
Hydromagnetic dynamos can be classified in a number of different ways; for the solar dynamo it is helpful to make the distinction between large-scale and small-scale dynamo action. A large-scale dynamo may be categorised as one for which the magnetic field contains a significant proportion of its energy on scales greater than that of the motions responsible for generating the field (in a turbulent flow this would be a typical eddy size); a smallscale dynamo, by contrast, has the bulk of its energy on scales comparable with, or smaller than, that of the velocity. Although such a distinction is not clear-cut, it is nonetheless instructive in providing a framework in which to discuss various types of generation mechanism. The magnetic field of the solar cycle has a spatial scale comparable with that of the Sun itself, and so would certainly seem to be the product of a large-scale dynamo. In contrast, the small magnetic elements of both signs that are observed on the quiet Sun (sometimes referred to as 'salt and pepper field') could be generated in situ by the small-scale granular and supergranular convection or, alternatively, could be the result of the shredding of the large-scale (solar cycle) field by the surface convection.
In this section we shall give a brief account of both the theoretical ideas underlying astrophysical dynamo theory and the major unresolved problems, in order that we can then discuss the present thinking on the solar dynamo. With the wide range of material covered in this review, it is simply not possible to give anything like a full set of references; we refer the reader to the review articles on the solar dynamo by Ossendrijver (2003) and Jones et al. (2010), and to the volume edited by Dormy and Soward (2007), which covers all the mathematical aspects of astrophysical dynamos.

Mean field dynamos
Historically, astrophysical dynamo theory has focused on the problem of large-scale field generation; for the Sun this has meant seeking an explanation of the solar cycle. Mathematically, this involves seeking a full solution of equations (1) to (6) for a highly turbulent flow covering a large range of spatial scales, a problem that, without approximations, is both analytically and computationally intractable. The most fruitful analytical approach has been via mean field electrodynamics, an extremely elegant formulation of MHD turbulence that describes the evolution of the mean (large-scale) field in terms of transport tensors determined by the statistical properties of the small-scale velocity field (Steenbeck et al., 1966;Krause and Rädler, 1980). The large-scale field B 0 then evolves according to the mean induction equation where U 0 is the large-scale velocity field and where the mean electromotive force (emf) E = u×b , with denoting a spatial average over intermediate scales, and where u and b are the small-scale velocity and magnetic fields. Mean field electrodynamics is, at heart, a kinematic theory, in which the magnetic field is assumed not to influence the velocity field. Then, assuming that any fluctuating magnetic field arises solely from the influence of the small-scale velocity on the mean field, an assumption to which we shall return shortly, one may postulate the expansion (see, for example, Moffatt, 1978) where α ij and β ijk are pseudo-tensors, dependent on the properties of the velocity field and on the magnetic diffusivity η (pseudo-tensors since E is a polar vector whereas B 0 is an axial vector). Substitution for E from (8) into (7) then yields an equation for the evolution of the mean magnetic field. For illustrative purposes, it is instructive to consider the simplest case of isotropic turbulence, for which α ij = αδ ij and β ijk = βǫ ijk (with α a pseudo-scalar and β a scalar); equation (7) then takes the form The most striking difference between the unaveraged and averaged induction equations ( (3) and (9)) is the appearance of the term involving α (the 'αeffect' of mean field dynamo theory). It makes explicit the possibility of dynamo action through its ability both to generate poloidal magnetic field from toroidal and, conversely, toroidal field from poloidal. Furthermore, since α is a pseudo-scalar, it follows that it can be non-zero only for flows that, on average, lack reflectional symmetry. These are typically characterised by having non-zero helicity (the correlation between the flow velocity and the vorticity), a natural consequence of rotating flows. From equation (9), it can be seen that the β ijk term, in its simplest isotropic form, can be thought of as a turbulent diffusivity; in general though, for non-isotropic turbulence, its physical interpretation is much more complicated (Krause and Rädler, 1980). A mean field dynamo in which both parts of the dynamo cycle are driven by α-effects (i.e. in which the second term on the right hand side of equation (9) dominates the first term) is known as an α 2 -dynamo. The first term on the right hand side of equation (9) represents the advection and stretching of the large-scale field by the large-scale flow. For many astrophysical bodies, and in particular for the Sun, the generation of toroidal magnetic field is ascribed to the stretching of the poloidal field by the differential rotation of the body (known as the 'ω-effect'). A mean field dynamo in which the largescale poloidal field arises from the α-effect and the large-scale toroidal field from the ω-effect is known as an αω-dynamo. The prototypical αω-dynamo model was first described by Parker (1955), who demonstrated how a radially dependent ω-effect would lead to latitudinally propagating dynamo waves, as observed on the Sun. It should be noted that although an α 2 dynamo can categorically be described as a large-scale dynamo (since all the motions are small-scale), such a designation is less precise for an αω-dynamo, which has a combination of small-scale motions (contributing to α) and a large-scale differential rotation ω -although ω of itself cannot lead to dynamo action.
Unfortunately, only for the case when the magnetic Reynolds number Rm is small -which is never realised astrophysically -is it is possible to solve explicitly for the transport tensors α ij and β ijk . Thus the most common approach to astrophysical mean field dynamo modelling is to adopt plausible, physically motivated expressions for α ij and β ijk (and ω if this is not known) and to explore the nature of the resulting dynamo action. Via this approach, it is also possible to model the nonlinear back-reaction of the magnetic field on the flow (via the Lorentz force) through modification of the mean field transport coefficients. Through a judicious choice of coefficients it is then possible to replicate a whole range of astrophysical magnetic fields. It is though worth sounding the note of caution that such an approach, although physically plausible, does not emanate directly from the governing equations of MHD.

Small-scale dynamos
Whereas large-scale dynamo action requires organisation of the field by a large-scale emf, the key part of which is typically an α-effect, dependent on the flow lacking reflectional symmetry, small-scale turbulent dynamo action relies on the local stretching and constructive folding of the field overcoming dissipative effects. Small-scale dynamos have mainly been studied within the framework of the fast dynamo problem, which investigates the possibility of (kinematic) dynamo action in the limit of Rm → ∞; a comprehensive account of the fast dynamo problem can be found in the monograph by Childress and Gilbert (1995). Du and Ott (1993) derived an expression for the fast dynamo growth rate, dependent on the Lyapunov exponents of the flow (reflecting the ability of the flow to stretch field exponentially) and the cancellation exponent, encapsulating the folding and dissipative effects of the flow. Given that one expects diverging fluid particle paths (Lagrangian chaos) in a turbulent flow, it is therefore natural to associate small-scale dynamo action with any suitably turbulent flow. This is borne out by a number of numerical simulations of MHD turbulence (e.g. Schekochihin et al., 2007). One issue though that is not fully resolved is whether small-scale turbulent dynamo action can persist at very small magnetic Prandtl number, P m. This is a difficult problem to address numerically; the indications are however that dynamo action does survive at small values of P m (Boldyrev and Cattaneo, 2004).

How do the two dynamo mechanisms interact?
The theoretical treatment of large-and (fast) small-scale dynamos has developed along independent lines, reflecting the different physical processes needed for each type of dynamo action; a lack of reflectional symmetry in the flow for the former, a suitably chaotic flow for the latter. However, whereas such a distinction is convenient for dynamo theorists, in reality, a turbulent, rotationally-influenced astrophysical flow will possess the necessary ingredients for both large-and small-scale dynamo action. Given this, it is important to look again at the mean field formulation so as to understand the impact of small-scale dynamo action. As mentioned above, the crucial point is that the expansion (8) assumes that any fluctuating field results entirely from distortion of the large-scale field; this is equivalent to saying that the small-scale field would decay of its own accord -i.e. no small-scale dynamo. However, if there is a small-scale dynamo then, at least kinematically, the fluctuating field will grow according to the local stretching and folding properties of the flow. Boldyrev et al. (2005) and Cattaneo and Hughes (2009) have argued that, under these circumstances, the growth rate for the smallscale dynamo will dominate that of a mean field dynamo (certainly in the case of an α 2 -dynamo) and that consequently the resulting field will result from small-scale dynamo action, with any large-scale component simply a result of the 'spilling out' of the small-scale eigenfunction to larger scales, and not governed by an equation such as (9). In other words, the idea of building up a large-scale field from a weak seed field, via the standard ideas of mean field electrodynamics, seems problematic. That said, large-scale astrophysical magnetic fields do, of course, exist, and it is therefore important to understand how these may be generated, and how the problems of mean field theory may be circumvented.
One of the great unknowns in large-scale field generation is the precise role of large-scale velocity shear. Hughes and Proctor (2009) have shown how the addition of a large-scale shear to a rotating convective flow that has a weak α-effect but no dynamo (large-scale or small-scale) can indeed facilitate large-scale dynamo action. There are various mechanisms by which this might occur. Even within the mean field framework there are three possibilities: one is simply that a vigorous ω can compensate for a feeble α; another is that the existing α-effect is 'improved' by the introduction of large-scale coherence; and a third is that there can be a more complicated mean field mechanism, essentially through modification of the non-diffusive elements of the β ijk tensor (e.g. Rogachevskii and Kleeorin, 2003;Proctor, 2007). A very different possibility is that the large-scale shear, although not of itself capable of dynamo action, interacts with the small-scale convective flow to produce a flow that, entirely through its large scales, can now act as a dynamo; such a dynamo would then be a 'small-scale' dynamo (field and flow on the same scales) but at the large scales! The important task of untangling the various possible mechanisms is, however, far from straightforward; the recent efforts of Proctor and Hughes (2011) proved inconclusive. It is also far from clear whether the addition of a large-scale shear flow to flows that act as healthy small-scale dynamos (which is probably a truer reflection of astrophysical flows) will generate a significant large-scale magnetic field. Fully understanding the interplay between large-and small-scale flows in a highly turbulent flow remains one of the great challenges of the solar dynamo problem.

The dynamo(s) in the Sun
The first point to address is whether two separate dynamo mechanisms are operating in the Sun; i.e., is the small-scale field observed at the solar surface generated locally by the granular and supergranular convection, or is it simply due to the shredding of the large-scale, solar cycle field? On theoretical grounds, we would certainly expect local small-scale dynamo action, since flows in the surface regions are turbulent and have a high value of Rm. Observationally, there are two factors that point to the existence of a smallscale dynamo. One is that the small-scale surface field is not correlated with the solar cycle, as discussed earlier; the other is that observations suggest a renewal time for magnetic flux in the quiet Sun on a timescale of less than a day (Hagenaar et al., 2003). So, most probably, there are indeed two distinct dynamo mechanisms operating in the Sun.
Notwithstanding the possible problems discussed in Section 4.1, the largescale solar dynamo is generally discussed within the framework of mean field αω-dynamos; three very different models have been quite widely discussed -though it should be stressed that there is no guarantee that the solar dynamo necessarily falls into any of these possibilities. Here we shall discuss the pros and cons of these various models before looking into an alternative, less widely studied, possibility.
In some sense, the most natural explanation of the solar dynamo, certainly without any detailed knowledge of the internal flow dynamics, is that it is a 'distributed dynamo', with α and ω distributed smoothly throughout the convection zone; such a dynamo could occur wherever rotation and convection take place together. There are, however, some major difficulties with this idea. One is that concentrated magnetic field is buoyant and hence will escape from the convection zone on a timescale much shorter than the 11 year generation time of the dynamo (see Parker, 1979). Furthermore, Galloway and Weiss (1981) pointed out that weaker fields also would be expelled, in this case by convective motions. Thus the idea was advanced of a dynamo located at or just beneath the convective zone (Spiegel and Weiss, 1980;Golub et al., 1981). Several years later, further support for the idea of such a deep-seated dynamo came from the helioseismological deductions of the internal rotation; the strong radial gradient of differential rotation in the tachocline makes this an obvious location for the ω-effect.
The most popular current explanation of such a deep-seated dynamo is as an interface dynamo, in which the two elements of the dynamo cycle ('α' and 'ω' in simple terms) are spatially separated, an idea first proposed by Parker (1993). The α-effect is envisaged to result from helical motions at the base of the convection zone, whereas the ω-effect comes from the differential rotation in the tachocline. Such a dynamo makes natural use of the radial variation of ω in the tachocline, though suffers from no proper knowledge of how a significant α-effect may be generated, nor how the two parts of the dynamo cycle may be realistically coupled.
For both of the two dynamo mechanisms described above, sunspots and active regions are 'by-products' of the dynamo process ('epiphenomena' in the terminology of Cowling (1975)) -albeit ones of great interest -but are not critical to the operation of the dynamo. By contrast, in the third model of the solar dynamo that is currently widely discussed, the surface field is inherent to the dynamo process. As in the interface dynamo, the flux transport dynamo has spatially separated α and ω effects, but now they are assumed to be widely separated, by the entire depth of the convection zone.
The ω-effect is again supplied by the differential rotation in the tachocline, with the α-effect resulting from the dispersal of the surface poloidal field acting to cancel out the field of the previous cycle and initiate a new poloidal field with a change of sign -this idea dates back to the ideas of Babcock (1961) and Leighton (1969). In its modern incarnation, the two components of the dynamo cycle are linked by a meridional flow, which acts to transport poloidal field from the solar surface to the tachocline, where it is sheared out to produce toroidal field (e.g. Choudhuri et al., 1995). The flux transport dynamo has the pleasing feature, at least to external observers, that part of the dynamo cycle can actually be observed. It does though rely crucially on a meridional circulation that (i) extends across the entire depth of the convection zone, and (ii) is able to transport a magnetic field unscathed through the highly turbulent convection zone. Neither of these are particularly plausible. Indeed, very recent observations by Hathaway (2011) of the motions of supergranules suggest that the poleward meridional flow observed at the surface has a very shallow return (equatorward) flow, at a depth of only 35 Mm. If this is indeed the case, then it deals a fatal blow to the idea of a flux transport dynamo.
Thus, all three current models have serious difficulties, and indeed the answer might lie elsewhere. One possibility is a variation on the interface dynamo discussed above, in which the electromotive force needed to generate poloidal field comes not from convection but from a magnetic buoyancy instability of the magnetic field (Schmitt, 1984;Thelen, 2000a,b;Davies and Hughes, 2011). The instability would then play two roles: to release magnetic flux from the tachocline, eventually to appear as active regions, and also to generate an electromotive force, which could close the dynamo cycle. A dynamo of this form is inherently nonlinear, since the electromotive force arises only from a pre-existing field; there is no kinematic, or weak field, regime. Such a dynamo mechanism escapes some of the problems of obtaining an α-effect from turbulent convection; although no fully convincing such model has yet been developed, the idea certainly deserves further study.

Comparison Between the Dynamos of the Sun and the Earth
The aim of this section is certainly not to provide a review of the geodynamo problem (see, for example, the comprehensive reviews by Roberts and Glatzmaier (2000); Glatzmaier (2002); Fearn (2007)), but rather to discuss the similarities and differences between the geodynamo and solar dynamo; both in terms of the dynamos themselves and also in the attempts to understand them theoretically and computationally. It may be regarded as being complementary to the more detailed comparison between terrestrial and solar dynamos conducted by Zhang and Schubert (2006).
One of the most striking differences between the magnetic fields of the Earth and the Sun concerns their variability in time. Whereas the geomagnetic field is characterised by long periods of one polarity, interspersed with fairly rapid periods of field reversal, the solar field changes sign on a timescale of only about 11 years (though with modulation of the whole cycle, as discussed in Section 3.1). For both bodies, but for different reasons, it is difficult to infer through surface observations the structure of the magnetic field in the region in which it is generated. For the Earth, it is possible, at least in theory, to deduce the potential field in the mantle (assuming it is a perfect insulator) through knowledge of the surface field. Through the continuity of the normal field, this would then convey information about the radial field at the top of the core. However, modes with wavenumber greater than about 15 are dominated by the crustal magnetic field, and so it is only possible to say anything about low order modes. For the Sun, it is now possible to resolve surface and coronal magnetic features on scales down to a few hundred kilometres; the difficulty, in terms of the dynamo, is trying to relate this activity to the seat of dynamo activity, which is probably located beneath the convection zone.
In terms of the energy source for the dynamos, the picture is much clearer for the Sun. Whatever the precise dynamo mechanism, the energy source is rotationally-influenced thermal convection (even in the flux transport dynamo, for which the convection seems to play no obvious role, the meridional circulation is a consequence of convection in a rotating frame). In the Earth, possible energy sources are thermal convection, compositional convection or precession. The consensus seems to be that the most likely energy source is compositional convection, resulting from solidification at the inner core and the subsequent release of light elements. However, this is a complex and imperfectly understood process, and in most dynamo models standard thermal convection is employed. In the Sun, the difficulty is not in identifying the source of energy, but rather in ascertaining the nature of turbulent, compressible, rotating convection at the parameter regimes that pertain in the Sun. For both bodies it is certainly fair to say that the nature of the motion that drives the dynamo is far from clear.
Quantitative differences between the geodynamo and the solar dynamo are provided by comparisons between the dimensionless parameters describing each. The geodynamo is characterised by being turbulent (Re = O(10 9 )) and strongly constrained by rotation (Ekman number E = O(10 −15 )); it does though operate at a rather modest magnetic Reynolds number (Rm = O(10 2 )). The solar dynamo, on the other hand, is less rotationally constrained, but operates at very high values of both Reynolds numbers (Re = O(10 13 ), Rm = O(10 10 )). Even with the most powerful computers, it is impossible to perform dynamo simulations at parameter values even remotely close to their realistic values. Thus, in models of the geodynamo, E is orders of magnitude too large, with Re similarly too small, whereas in solar dynamo simulations the problem is that both the Reynolds numbers are too small; the usual approach is to push these as high as possible, currently O(10 5 ), though this means operating at P m of order unity, which is also unrealistic. Thus, the unavoidable compromises result in computational models of the geodynamo and solar dynamo being much more similar than the dynamos themselves.
Although, historically, both the geodynamo and solar dynamo have been explored via mean field dynamo models, most of the current thrust of research is through numerical simulations, employing either spherical models, designed to capture the global magnetic field, or more local plane layer models, aimed at understanding specific physical process in detail. In terms of global modelling, it seems that geodynamo models are closer to reality than their solar counterparts. The most ambitious models are those of Glatzmaier and Roberts (1995Roberts ( , 1996; and other papers reviewed in Roberts and Glatzmaier, 2000;Glatzmaier, 2002), which describe dynamo action in a spherical shell driven by rapidly rotating convection. The early models are Boussinesq and consider only thermal buoyancy; the later models employ the anelastic approximation and also consider compositional buoyancy. The success of the simulations is that the resulting field is Earth-like in that it undergoes polarity excursions and dipole reversals. Of necessity in such a computational undertaking, as discussed earlier, approximations have to be made. Roberts (1995, 1996) adopt what is known as hyperdiffusion, which, for their models, weights the various diffusivities according to spatial scales, leading, for example, to a smaller Ekman number at the larger scales than the smaller scales. This allows exploration of the small Ekman number regime, though at the possible risk of distorting the dynamics of the dynamo, as discussed by Zhang and Jones (1997).
Global models of the solar dynamo date back to the pioneering work of Gilman and Miller (1981), who considered a rotating, convective, Boussinesq fluid, and Glatzmaier (1984Glatzmaier ( , 1985, who employed the anelastic approxima-tion. These models demonstrated, for the first time, the possibility of dynamo action without the need for any parameterisation such as an α-effect. The most recent global modelling of the solar dynamo has been performed with the ASH (Anelastic Spherical Harmonic) code (Clune et al., 1999), which evolved from the earlier anelastic code of Glatzmaier. Thus, interestingly, and reinforcing the earlier comment that computational models of the geo and solar dynamos are not as dissimilar as the dynamos themselves, two of the most widely used codes for modelling these two dynamos have a common ancestry. The ASH code results of Brun et al. (2004) again demonstrated the viability of self-consistent dynamo action by rotating convection, but showed that the resulting magnetic field was essentially small-scale, in contrast to that of the Sun. The dominance of the small-scale magnetic field was demonstrated also, in a very different model, by Livermore et al. (2007), who considered the generation of magnetic fields by forced flows, of differing helicities, in a spherical shell.
The greater success of geodynamo models may reflect the fact that in the Earth, dynamo action is indeed distributed across the outer core, and hence is well represented by a global model, whereas in the Sun, localised generation at the base of the convection zone and in the tachocline is the crucial element. Current global models are unable to resolve all the details of the thin tachocline region; achieving a greater understanding of the solar dynamo will certainly therefore require a better understanding of the more localised physics in this region.

Global Coronal Magnetic Field
The structure of the global coronal magnetic field, as it varies during the solar cycle, is important in determining where magnetic energy is stored and where it may be released in the form of solar flares, prominence eruptions and CMEs. At large heights in the corona, the magnetic field becomes sufficiently weak that the solar wind can pull the field open into interplanetary space. At this point, the field is almost radial, with the magnetic field emanating from the north pole separated from that of the south pole by an equatorial current sheet. The amount of open magnetic flux varies over the solar cycle, with the maximum occurring around two years after the maximum number of sunspots. The open flux influences the number of cosmic rays hitting Earth's atmosphere and so the variation in the amount of open flux during the solar cycle is linked to the variation in cosmic rays reaching the Earth.
Modelling the evolution of the global coronal magnetic field requires knowledge of the evolution of the photospheric magnetic field in order to provide the correct boundary condition on the photospheric surface. Unfortunately, this field is not easy to impose. Ideally, one would use the observed magnetic field from magnetograms but the resolution of the global numerical calculations is much coarser than the observations and some averaging is needed. As far as the global coronal field is concerned, it is the active region magnetic fields that dominate the large-scale structure. Ideally, a numerical simulation should combine the evolving photospheric magnetic field with the evolution of the global coronal field. A model that provides the photospheric radial component of the magnetic field as a suitable boundary condition is now described.

Flux transport model of the photospheric magnetic field
The nature of the solar cycle becomes clear when the line-of-sight magnetic field, averaged in longitude, is plotted as a function of latitude and time (see Figure 4). What is clear is that the evolution of the magnetic field is different in the low latitudes, between ±30 • , compared with the high latitudes, above ±30 • . In the low latitudes, the sunspots of a new solar cycle emerge at around ±30 • . Here regions of strong magnetic field may last for around two weeks before dispersing. As the cycle advances, new sunspots emerge closer and closer to the equator. In contrast, at higher latitudes, there is a slow drift of the trailing polarity magnetic flux towards the polar region. This is not due to the emergence of sunspots but instead to a slow, observed plasma flow called the meridional flow. This drifting field is of opposite polarity to the field in the polar regions. Eventually it cancels with the polar field, creating a reversal in the sign of the polar polarity. Note that the reversal in the polar polarity occurs around one to two years after cycle maximum. How or if this is linked to the solar dynamo is unknown (see Section 4.4).
Once a new sunspot pair has emerged, it evolves in response to three main effects. First, the two sunspots tend to appear at slightly different latitudes, with the leading spot being closer to the equator than the following spot. The two sunspots appear to drift apart owing to the photospheric differential rotation, discussed above. Second, there is the slow meridional flow from the equator to the poles, with, presumably, a return flow somewhere in the solar interior (see Hathaway, 2011). Third, towards the end of the sunspots' lifetime, they begin to spread out, with supergranular flows producing a random walk of the dispersed magnetic elements. This random walk can be described by a diffusion process. Each of these three effects is now discussed.

Large-scale surface flows
Observations of the rotation speed of photospheric features indicate that the surface rotation of the Sun can be described by (see Snodgrass, 1983), Ω(θ) = 13.38 − 2.30 cos 2 θ − 1.62 cos 4 θ deg day −1 , where θ is the co-latitude. The meridional flow profile may be specified as where λ = π/2 − θ is the latitude and λ 0 = 75 • is the latitude above which the meridional flow vanishes. The typical flow speed, u 0 = 11m s −1 , is taken from Hathaway (1996). The diffusion of active region magnetic fields can be described by a uniform diffusivity coefficient D = 200 − 450 km 2 s −1 . The diffusion timescale, based on the value of D and global lengthscales, is of the order of 34 years. This makes diffusion the slowest of the physical processes involved in the evolution of the photospheric magnetic field over the solar cycle. In contrast, differential rotation is the fastest process with a timescale of around a quarter of a year.

A flux transport model
Using the three physical processes above, fitted to observed data, it is possible to model the evolution of the radial component of the photospheric magnetic field over the solar cycle (see Wang and Sheeley, 1989;Sheeley, 2005;Mackay and van Ballegooijen, 2006). The key ingredient is insertion of new active regions, taken from their observed properties of flux, latitude and tilt. The long time evolution of B r at the solar surface is based on the radial component of the induction equation (3), (12) (see Wang and Sheeley, 1989, for details). Thus, the surface distribution of the radial component of the coronal magnetic field can be determined and used as input to models that predict the global structure of the coronal field. While this model governing the transport of the surface magnetic flux has a certain simplicity to it, it has been successful in reproducing (i) the strength of mid-latitude fields, (ii) the reversal of the polar fields and the timing of the reversal after the start of the new cycle, (iii) the origin of certain repeating 28-29 day patterns.

Force-free coronal fields
Since the plasma β (the ratio of gas to magnetic pressure) in the low solar corona is small, it is normal to model the global coronal magnetic field as a force-free field. It can be modelled by a variety of different schemes of varying complexity. The simplest is the potential field model, in which the field is described by a magnetic potential satisfying Laplace's equation (Schatten et al., 1969). Next, more generally, is the force-free field model where j × B = 0. This implies ∇ × B = αB, and B · ∇α = 0; α = 0 gives the potential field, α = constant corresponds to the linear forcefree field. In general, α is constant along a magnetic field line, but if it varies from field line to field line then the result is a non-linear force-free field . [Note that in this section, following standard notation, α is related to the component of the current parallel to the magnetic field and β is the ratio of gas to magnetic pressures. In Section 4.1 (also in standard notation!), α and β were pseudo-tensors in the expansion of the mean electromotive force.] Boundary conditions must be specified before the magnetic field can be determined. At the solar surface (r = R ⊙ ) the observed radial magnetic field values are used and at an outer radius (normally taken as 2.5R ⊙ ) the magnetic field is assumed to be purely radial. This latter condition simulates the effect of the solar wind opening the field. These models are called forcefree source surface models.
Vector magnetograms (Metcalf et al., 1995) provide information about the horizontal magnetic field components and estimates of the spatial variation in α. What is clear is that the photospheric field has non-zero α and, thus, the coronal field cannot be represented by simple potential models. Modelling non-linear force-free fields is much more complicated, and models that use magnetic field data from a single magnetogram are very limited. To make real progress, it is essential to track the movement of the magnetic footpoints at the photosphere in response to the differential rotation, the meridional flow and the diffusion that describes the breakup of active regions. Non-linear force-free fields, based on the photospheric magnetic field distribution described by the surface flux transport model are particularly powerful at predicting various coronal phenomena (Mackay and van Ballegooijen, 2006).

Results from global field models
The global coronal magnetic field model of Mackay and van Ballegooijen (2006) has successfully predicted some important features that can be tested by observations. In agreement with observations, it has been shown that (i) the open magnetic flux reaches a maximum about two years after solar maximum, and (ii) it is the non-potential nature of the coronal magnetic field that is responsible for the inflation of the corona and the opening of the closed magnetic field (Yeates et al., 2010).
The global model has also successfully predicted many properties of solar filaments or, synonymously, solar prominences. Prominences consist of cool dense plasma, supported high in the hot tenuous corona by the local magnetic field. They are very narrow (width around 5 Mm) and extremely long structures (lengths up to 700 Mm). They always lie above the polarity inversion line, a line observed in magnetograms that separates photospheric regions of positive and negative polarity. Solar prominences tend to form when the local magnetic field has a dip (a location where the magnetic tension force acts vertically upward). In addition, the direction of the dominant component of the magnetic field along the prominence is called the chirality. Prominences in the northern hemisphere are predominantly dextral while those in the southern hemisphere are predominantly sinistral . However, there are a few exceptions to this hemispheric pattern. The global model is able to predict the location of prominences and their chirality with up to 96% accuracy, including the hemispheric exceptions (Yeates et al., 2008a). In addition, the loss of a stable equilibrium, which the code can detect, can be linked to the initiation of a CME. The location of a CME can be predicted with 50% accuracy (Yeates and Mackay, 2009), something that no other simulation code is able to do.

Numerical Simulation Results
Recently, numerical simulations have been used to investigate how the magnetic field emerges from the solar interior. An initial magnetic structure is chosen and its subsequent evolution tracked. Presently, the exact form of the initial interior magnetic field is unknown, although helioseismology does indicate the presence of sub-photospheric fields. In principle, this should be given by the results of dynamo simulations but at present there is no such input. In the absence of accurate observational data, the initial magnetic field is chosen as either a twisted cylindrical flux tube (Fan, 2001;Archontis et al., 2004) or a twisted toroidal flux tube MacTaggart and Hood, 2009b). This seems reasonable since sunspots appear to consist of a large flux tube. In addition, Emonet and Moreno-Insertis (1998) and Hughes et al. (1998) have shown that a magnetic flux tube rising in the solar convection zone must be twisted in order that it is not pulled apart by the turbulent convective flows.
Consider a flux tube near the top of the solar convection zone. If the tube is in total horizontal pressure balance (i.e. gas pressure plus magnetic pressure), then the gas pressure inside the tube must be less than the surrounding external gas pressure. Now if the tube is in horizontal temperature balance, then using the ideal gas law, the density inside the tube must be less than the density in the exterior. The tube is light and begins to rise owing to buoyancy. Since the solar convection zone is unstably stratified, this rise will continue unchecked. The plasma β is large in the interior and so the magnetic flux tube is simply carried along by the rising plasma. This is illustrated in Figure 5 (top right).
However, once the magnetic field reaches the photosphere, the atmosphere is stably stratified. Thus, the magnetic field is trapped at the solar surface and starts to expand horizontally as shown in Figure 5 (bottom left). However, the field in the interior continues to push towards the photosphere, increasing the magnetic field strength at the solar surface until a magnetic buoyancy instability is triggered. Only now is it possible for the magnetic field finally to rise into the corona ( Figure 5, bottom right). The condition for the onset of the magnetic buoyancy instability is presented in Acheson (1979) and the application to emergence at the solar photosphere is discussed in Archontis et al. (2004).
Two points are worth noting. First, there is a large amount of magnetic flux that remains trapped in the interior, even after the emergence process has occurred. Second, the emergence due to the magnetic buoyancy instability starts once the gradient in the magnetic field has increased and the plasma β has dropped to order unity. Hence, the Lorentz force is now comparable with the pressure gradient force and the magnetic forces are strong enough to move the plasma. This is different to the situation in the solar interior and is important when interpreting the consequences of emerging fields, as discussed below.

Sunspots
The first magnetic field to emerge in numerical simulations always appears in the North-South direction, but quickly spreads apart into the correct East-West direction. This is due to the twist in the magnetic field, needed to keep it coherent in the solar interior. As the flux tube starts to rise in the interior, it expands and the azimuthal magnetic field component is enhanced as compared with the axial component. Thus, the outer sections of the flux tube become more twisted and the first fields to emerge are perpendicular to the main axis of the tube.
The magnetic field, when it expands into the corona, becomes simpler in structure and rapidly relaxes towards a force-free state. The field remaining in the interior is still twisted and torsional Alfvén waves propagate from the interior up towards the untwisted coronal field. The net effect at the photosphere is a rotation of the sunspots and, indeed, rotating sunspots are frequently observed.
The sunspots in active regions tend to drift apart but eventually reach The grey region represents the solar interior. The initial tube is buoyant and rises to the photosphere (top right). Since the atmosphere is stably stratified, the rise stops and the field spreads out (bottom left) until the magnetic buoyancy instability is triggered (bottom right).
a final separation, before they start to break up and disperse. This final separation distance of sunspots depends on how the tube becomes buoyant in the interior and where in the interior the ends of the flux tube are rooted.
The toroidal model has a fixed separation distance given by the major diameter (see Hood et al., 2009). This is not the case in the cylindrical models, where there must be a restriction on the size of the buoyant section (see MacTaggart and Hood, 2009a) to avoid a continual separation of the spots.

Flux rope formation
The emergence process readily results in the formation of new flux ropes that then begin to erupt outwards towards the corona and may represent the initiation of a CME. This is discussed in Archontis and Török (2008), but is seen in many other simulations (for example, Manchester et al., 2004). As discussed above, the magnetic field begins to emerge through the photosphere only once the conditions for a magnetic buoyancy instability are satisfied. This requires that the magnetic pressure is comparable with the gas pressure. Since the gas pressure has a very small gravitational scale height, the background gas pressure drops off rapidly. So once the magnetic Figure 6: Contours of plasma density are shown, with a few sample magnetic field lines in orange. The structure seen is erupting out towards the top of the computation box and consists of dense plasma surrounded by the magnetic field of a newly formed flux rope. (MacTaggart, private communication.) pressure exceeds the gas pressure at the photosphere, the magnetic forces cause a rapid rise of the magnetic field, removing the excess pressure and, indeed, producing a total pressure deficit. Thus, after the rapid rise of the field, there is an inflow or converging motion in the mid to high photosphere.
In addition, the rapid expansion of the emerging magnetic field, into a dipole structure, creates magnetic field lines that almost bend back on themselves. Hence, there are strong currents at the photosphere and the resulting Lorentz force gives rise to a shearing motion on either side of the polarity inversion line. The shearing, together with the inflow, results in inclined magnetic field lines being brought together. A current sheet forms and magnetic reconnection results in the formation of a flux rope that starts to erupt into the corona (see Figure 6). This new rope may be either above the original axis of the original flux tube or below it.

Sigmoids
Sigmoids are observed in X-rays in the solar corona. They take the form of forward or reverse S-shaped structures and are an indication that the magnetic field is highly non-potential. Sigmoids have been recorded by several solar missions (e.g. Skylab, Yohkoh, SoHO, Hinode); the forward S-shape structures are mainly formed in the southern hemisphere, while the inverse S-shape structures are observed in the northern hemisphere (see Pevtsov, Canfield and McClymont, 1997). These brightenings were named sigmoids by Rust and Kumar (1996), who also showed that many of the sigmoidal brightenings evolve into arcades, which are often associated with the eruption of CMEs. In general, the appearance of sigmoids in active regions is closely related to intense solar activity. Observational studies of sigmoids can be found in Canfield et al. (1999Canfield et al. ( , 2007. Sigmoid structures naturally appear when a twisted flux rope emerges owing to the emergence of non-potential magnetic fields and the injection of magnetic helicity. The simulation results of Archontis et al. (2009) show good agreement between the emerging magnetic fields and observations, as shown in Figure 7. In the left hand column, isosurfaces of current density show the evolution of sigmoidal structures, from their first appearance as two separate J-like structures that coalesce to form a single sigmoid in the middle row before starting to fragment at the end of the simulation. The regions of strong current density are the locations where Ohmic heating is likely to occur. In the middle column, the soft X-ray plasma emission is estimated as I = ρ 2 dz, where the integration is along the line of sight and of plasma within the specific temperature range of the telescope bandpass. The final column presents the observations of a sigmoid from the X-Ray Telescope (XRT) on the Hinode satellite. Note that in the top row, the sigmoid does appear as two separate J-like structures. In the middle, the J-like structures have combined to form a single structure. In the bottom row, the observations show a very bright core at the centre of the sigmoid. This bright core appears to correspond to the formation of a new flux rope, as discussed in Section 7.1.2. The reconnection responsible for the formation of the new rope heats the plasma locally, producing hot dense plasma, which is seen in soft X-rays. This flux rope can erupt, as discussed in Section 7.1.4 below, and these observations actually do show a dynamic bright feature moving away from the sigmoid in exactly the manner predicted by the simulations.

Eruptions -the role of the overlying field
Observations of newly emerging magnetic regions frequently have associated eruptions of plasma that are sufficiently energetic to escape into interplanetary space. As mentioned in Section 7.1.2, many simulations (e.g.  Manchester et al., 2004;Archontis and Török, 2008) have found that a flux rope forms as part of the emergence process. These flux tubes rise but do not always erupt. So why do some fail to erupt while others do?
Consider, first, a corona with no pre-existing magnetic field. As mentioned above, the first field to emerge from the interior is in a North-South direction. This field is strongly anchored in the dense photosphere. When the flux rope finally forms, by the process described above, it is not so securely held down because its footpoints are in the more distant sunspots and not in the nearby photosphere. It tries to breaks away from the photosphere but there is a significant amount of already emerged magnetic field above it, which is strongly anchored to the photosphere. The magnetic tension in this North-South field can prevent the full eruption of the flux rope. Now consider emergence when there is a pre-existing coronal magnetic field and, in particular, one that is not aligned with the direction of the first field  Hood, 2009b) to emerge. Magnetic reconnection between these fields can remove the magnetic tension and allow the flux rope to fully erupt. Before the magnetic field emerges, there is an initially horizontal coronal magnetic field. As the new field emerges through the photospheric boundary, this rising field reconnects with the overlying field. Figure 8 shows how the reconnected coronal magnetic field lines (traced from the sides of the computational box) now drop down into the outer regions of the emerging flux tube. The newly formed flux rope is shown by green field lines. Since all the field above the flux rope has reconnected with the overlying field, there is no longer any magnetic tension to hold it down and the flux rope can erupt unhindered into an almost field-free region.

Summary
The recent theoretical ideas to explain the solar dynamo, covering both the generation of the large-scale and small-scale magnetic fields, have been presented. Small-scale magnetic dynamo action results in any suitably turbulent flow provided the magnetic Reynolds number is sufficiently high. Purely on theoretical grounds, therefore, it is to be expected that the granules and supergranules, confined close to the surface, will, of themselves, act to generate small-scale magnetic field. This idea is confirmed by observations that show that the amount of small-scale field is independent of the solar cycle, and hence is not simply a by-product of the large-scale dynamo.
Understanding the generation of the Sun's large-scale magnetic fieldthe field of the solar cycle -remains one of the great challenges of astrophysical MHD. Although most dynamo modelling has been performed within the framework of mean field electrodynamics, there are significant problems in applying this theory to the astrophysically relevant, high Rm regime. Current solar dynamo models fall into one of three broad categories: distributed dynamos, in which dynamo action takes place throughout the convection zone; interface dynamos, in which dynamo action is localised in the tachocline and lower convection zone; and flux transport dynamos, in which the two key components of the dynamo cycle ('α' and 'ω') are separated by the extent of the convection zone but are connected by a large-scale meridional cell. As discussed in Section 4.4, there are problems with all three models, though the idea that the solar magnetic field is generated by a flux transport dynamo does seem the least plausible. Progress with the solar dynamo problem will result from a combination of high resolution numerical simulations, both global and local, focusing on the tachocline for example, together with an improved theoretical understanding of the fundamental aspects of MHD turbulence.
The eleven year sunspot cycle has a profound effect on the evolution of the global coronal magnetic field. For example, the amount of open magnetic flux tends to peak two years after solar maximum. This is due to the nonpotential nature of the coronal magnetic field that inflates the corona, causing the opening of closed field lines. Properties of solar prominences can be difficult to predict but, by following the motions of the observed surface magnetic fields and, hence, the build-up of stresses in the coronal magnetic field, it is now possible to predict where prominences will form and which are likely to erupt as a CME. The ideas behind the global coronal field models, namely the inclusion of new emerging magnetic fields, the stressing due to shearing by differential rotation, the transport of magnetic flux to the poles, the break up of strong field regions and the decay of active regions through diffusion, can be used to follow the evolution of an individual active region. The time resolution of the order of 30 seconds, full disk observations from the Solar Dynamics Observatory now mean that the line-of-sight magnetic field and the observed photospheric flow patterns can be used as input for this model and the subsequent evolution of the coronal magnetic field determined. Initially, the models will require the real-time surface flow velocity as input and the evolution of the resulting coronal magnetic field will be compared with observations. Next, more generic flow fields can be used to see if a similar evolution is generated and if similar dynamic features are seen. Then, in the future development of this model, it will be possible to predict whether a newly emerging sunspot or active region is likely to become unstable and generate a large solar flare or not.
One by-product of the large-scale dynamo is sunspots. They emerge, evolve and disperse on the order of a few weeks and the interaction between the emergence of these strong magnetic fields and the pre-existing coronal magnetic field creates a variety of dynamic solar phenomena. At present, numerical simulations can identify the physical processes responsible for the emergence. However, current computational resources, mainly computer memory, mean that only the uppermost part of the solar convection zone and the low corona can be modelled. In addition, the simulation timescales are based on resolving the shortest timescales, determined by the propagation of Alfvén waves in the solar corona, and these are significantly shorter than the observed times for flux emergence. Hence, to save on computing time, the magnetic buoyancy of the emerging flux tubes is chosen to produce a faster evolution. Thus, the magnetic field strength at the photosphere increases much faster than would be liked and this means that the emergence process is also faster. Now this mismatch in timescales is not a major issue since the correct ordering of the timescales for each physical process is preserved, i.e. Alfvén wave timescale is shortest and so on. Nonetheless, the issue of timescales will be addressed with the next generation of parallel computers.
The simulations of flux emergence are now being performed with more realistic pre-existing magnetic environments. For example, as discussed in Section 7.1.2, the formation of a new flux rope, during the simulations of the emergence of magnetic fields, often results in the eruption of dense plasma from the lower corona. How closely are these eruptions related to the observed CMEs? Again the timescales are wrong but it is possible that the basic physical processes involving the removal of the overlying magnetic field (see Section 7.1.4) are correct.
Another coronal feature frequently observed is the sigmoid, observed in Xrays. Sigmoids naturally arise in simulations from the emergence of a twisted flux rope. However, some of them seem to occur during the decaying phase of an active region. Nonetheless, although in this case new magnetic flux is not emerging, there does seem to be a shearing motion along the magnetic polarity inversion line and a general increase in the magnetic helicity. Both properties occur naturally in the emergence simulations. So again, the key physical processes are correctly described even when sigmoids do not exhibit an increase in photospheric magnetic flux.
We have described some of the wide variety of problems currently of importance in the generation and evolution of solar magnetic fields. The nature of the generation of the large-scale solar magnetic field is still far from understood, and remains one of the great challenges of astrophysical MHD. The continual improvement in the quality of the observations of the solar surface and atmosphere is helping to improve modelling of the photospheric and coronal fields; with the advances in computational resources, the simulations are now allowing us to compare theory and observations at a level never before achievable.