Michigan State University, East Lansing, MI 48824
Magnetic fields in the Sun are produced by dynamo action in the solar convection zone, which extends from the surface down to a depth of 200 Mm below the surface (2/7 the radius of the Sun). The convective motions stretch and twist the magnetic field which increases its strength. Where the field becomes strong, it becomes buoyant and rises towards the surface of the Sun. The field is observed to emerge from the solar interior as bipoles of opposite polarity field with a wide range of sizes. Where the field is strong it inhibits the convective transport of heat to the surface, resulting in cooler darker areas called pores (if small) or sunspots (if large and surrounded by striated penumbra). Different models have been proposed for the structure of these pores and sunspots: monolithic, funnel-shaped flux tube vs. spaghetti cluster. See review  and references contained therein.
Fig 1: Magnetic field lines through the three large dark pores produced by magneto-convection from initially uniform, untwisted horizontal field entering in upflows through the bottom boundary of the simulation domain. Color identifies individual field lines. All the structures show some twist. The right-most remains coherent down to the bottom boundary at 20 Mm. The left-most separates into substrands that are themselves twisted and also twist around one another. The central one remains coherent down to about 10 Mm and then connects in complicated ways to the surrounding magnetic field.
Computer simulations model this rise and emergence of magnetic field by solving the conservation equations for the mass, momentum and energy and the induction equation for the magnetic field. Starting from an initial, non-magnetic, convective state, a magnetic field is introduced. Various field configurations have been explored — vertical field, half torus of field, horizontal field. In one such calculation, starting from uniform, horizontal field advected into the computational domain by inflows at a depth of 20 Mm (10% of the solar convection zones depth, but 2/3 of its pressure stratification), the convective upflows and downflows produced serpentine loops that emerged through the surface as bipoles with a wide range of scales. The opposite polarity field in the small scale bipoles counter streamed into larger, strong magnetic field concentrations at the legs of the largest loops. At these locations the convection was inhibited and large, dark pores formed. Figure 1 shows magnetic field lines in three pores, with different colors to distinguish the different field lines. As can be seen, these simulation results indicate that there are different possible subsurface structures for pores (and sunspots). They may be deep coherent flux tubes. They may be like twisted spaghetti. They may be shallow structures. It may well be that all the models proposed for sunspot structures are correct for some spot somewhere.
 Deinzer, W., 1965, ApJ, 141, 548
 Parker, E.N., 1979, ApJ, 230, 905, 1979
 Rempel and Schlichenmaier, 2011, Living Rev. Sol. Phys., 8, 3
 Rempel, M., 2009, ASPC, 416, 461
 Cheung, M.C.M, Rempel, M., Title, A.M., Schussler, M, 2010, ApJ, 720, 333
 Stein and Nordlund 2012, ApJL, 753, l13