{'fraction_non_alphanumeric': 0.025470533451733772, 'fraction_numerical': 0.014576249160728597, 'mean_word_length': 4.896807151979566, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 2, '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}}
Modular model for Mercury's magnetospheric magnetic field confined within the average observed magnetopause

Abstract Accurate knowledge of Mercury's magnetospheric magnetic field is required to understand the sources of the planet's internal field. We present the first model of Mercury's magnetospheric magnetic field confined within a magnetopause shape derived from Magnetometer observations by the MErcury Surface, Space ENvironment, GEochemistry, and Ranging spacecraft. The field of internal origin is approximated by a dipole of magnitude 190 nT RM 3, where RM is Mercury's radius, offset northward by 479 km along the spin axis. External field sources include currents flowing on the magnetopause boundary and in the cross‐tail current sheet. The cross‐tail current is described by a disk‐shaped current near the planet and a sheet current at larger (≳ 5 RM) antisunward distances. The tail currents are constrained by minimizing the root‐mean‐square (RMS) residual between the model and the magnetic field observed within the magnetosphere. The magnetopause current contributions are derived by shielding the field of each module external to the magnetopause by minimizing the RMS normal component of the magnetic field at the magnetopause. The new model yields improvements over the previously developed paraboloid model in regions that are close to the magnetopause and the nightside magnetic equatorial plane. Magnetic field residuals remain that are distributed systematically over large areas and vary monotonically with magnetic activity. Further advances in empirical descriptions of Mercury's magnetospheric external field will need to account for the dependence of the tail and magnetopause currents on magnetic activity and additional sources within the magnetosphere associated with Birkeland currents and plasma distributions near the dayside magnetopause.


Introduction
Understanding Mercury's internal magnetic field requires knowledge of the structure of its magnetosphere because of substantial and time-dependent contributions to the observed magnetic field from external current systems. Early models of Mercury's magnetospheric magnetic field were either Earth-like models scaled in size to account for Mercury's smaller planetary magnetic moment [Luhmann et al., 1998;Korth et al., 2004] or developed specifically for the innermost planet with simplified assumptions for the geometry of the magnetospheric cavity [Grosser et al., 2004]. Although deviations of these models from the observed system were recognized, the exploratory observations obtained during two flybys through Mercury's magnetosphere by Mariner 10 in 1974and 1975[Ness et al., 1974, 1975, 1976Lepping et al., 1979] did not constrain the distribution of the external current systems. Detailed modeling of Mercury's magnetospheric magnetic field was enabled by the insertion of the MErcury Surface, Space ENvironment, GEochemistry, and Ranging (MESSENGER) spacecraft into orbit about the innermost planet on 18 March 2011. Since then, nearly continuous magnetic field data have been acquired by MESSENGER's Magnetometer [Anderson et al., 2007], and observations over multiple Mercury years have yielded repeated coverage in planetary longitude and local time. The new data set and an improved magnetospheric model featuring a magnetopause prescribed by a paraboloid of revolution [Alexeev et al., northern cusp  indicated by adiabatic depressions in field magnitude, as well as the detection of signatures of Birkeland currents ].
An empirical determination of Mercury's magnetopause shape [Winslow et al., 2013] revealed that the average observed shape departs substantially from the parabolic shape of the model magnetopause and is better represented by the functional form proposed by Shue et al. [1997] for the terrestrial magnetosphere. The differences in magnetopause shape result in differences between observed fields and model predictions in regions near the dayside magnetopause and at high northern latitudes. In addition, the paraboloid model produces magnetic islands, also termed O lines, near the inner edge of the cross-tail current sheet, which is discontinuous in the model. This artifact leads to void regions when mapping the MESSENGER trajectory to the magnetic equatorial plane and was avoided in previous work by modifying the best fit parameterization of the model with an unrealistically thick cross-tail current sheet .
Further advances in studies of the internal field and magnetospheric structure and current systems require a new empirical model that resolves these issues. The high-northern latitude region is of particular interest since MESSENGER traversals at altitudes as low as 15 km are planned in this region, and those passages will provide the best opportunity in the mission to search for nondipolar fields of internal origin, including remanent crustal magnetic fields. Reliable identification of such nondipolar fields requires accurate correction for the low-order internal planetary field and external magnetic fields. Further understanding of Mercury's magnetosphere depends on accurate description of the known currents at the tail and magnetopause that are as free from discontinuities and mathematical artifacts as possible to allow reliable specification of additional external current sources. There is thus a need for a different formalism, one that can incorporate the observed magnetopause shape and accommodate additional external current systems.
Generalized approaches to shielding arbitrary current systems at the magnetopause have been demonstrated for the terrestrial magnetosphere. To develop a magnetospheric magnetic field model, one must derive the magnetopause shape. One then solves the Chapman-Ferraro problem [Chapman and Ferraro, 1930] to derive the magnetopause current system that separates planetary and interplanetary magnetic fields. Given a magnetopause shape, the shielding magnetopause currents yield a net magnetic field at the magnetopause for which the component normal to the magnetopause, B n , vanishes. Similar to the paraboloid model, early models of the terrestrial magnetosphere [e.g., Mead, 1964] sought analytic solutions to this problem, which exist only for certain magnetopause shapes and magnetic field source distributions. Schulz and McNab [1987] generalized a technique to treat the magnetopause as a source surface [Schatten et al., 1969] and determined the shielding field by minimizing the mean value of B n on the magnetopause rather than requiring that it be precisely zero everywhere on this surface. Alternatively, a finite difference technique can be used to solve the Chapman-Ferraro problem numerically [Toffoletto et al., 1994]. These approaches allow fitting of shielding fields to arbitrary current distributions in the magnetosphere and to arbitrary shapes of the magnetopause. The source-surface method has been adopted for a series of empirical models of the terrestrial magnetosphere [Tsyganenko, 1995[Tsyganenko, , 2002a[Tsyganenko, , 2002bTsyganenko and Sitnov, 2005]. These models are modular in the sense that a magnetopause Chapman-Ferraro current system is derived for each magnetospheric current system, and the complete model field is obtained by adding the magnetic fields of each magnetospheric current system together with its magnetopause shielding field. This approach substantially decreases the mathematical complexity and allows the addition of new current systems without reformulating the entire model. The computational demands of the source-surface method are no longer as substantial relative to conveniently available resources as they once were, so this approach is particularly attractive.
In this paper, we describe a new model of Mercury's magnetospheric magnetic field, denoted KT14 in reference to the principal developers, that is based on the source-surface technique and that includes a continuous cross-tail current sheet. The model development followed the data-based approach used for Earth's magnetosphere [Tsyganenko, 2013, and references therein]. Whereas construction of the KT14 model employed methods similar to those used at Earth, the model itself was built specifically for Mercury and is not a terrestrial model scaled to Mercury's magnetosphere [e.g., Luhmann et al., 1998;Korth et al., 2004]. The paper is organized as follows. We describe the model structure and mathematical framework in section 2 and the fitting of model parameters in section 3. Aspects of the data fitting, the magnetic field Journal of Geophysical Research: Space Physics 10.1002/2015JA021022 residuals with respect to the KT14 model, and their comparison with those from the paraboloid model are discussed in section 4. Finally, the results are summarized in section 5.

Magnetospheric Magnetic Field
The magnetic field in Mercury's magnetosphere consists of contributions from sources below (internal) and above (external) the planetary surface. The internal field is thought to be generated by a dynamo operating in Mercury's liquid outer core [Margot et al., 2007;Cao et al., 2014] and can be conveniently described by a dipole of magnitude 190 nT R M 3 , where R M is Mercury's radius, offset northward by 479 km along the spin axis Johnson et al., 2012]. The external magnetic field is generated by the magnetopause currents and current systems inside Mercury's magnetosphere, here restricted to the cross-tail current. The magnetopause or Chapman-Ferraro currents Ferraro, 1931a, 1931b] are induced by the interaction of solar ionized particles with the planetary field on the magnetopause boundary. The magnetotail currents flow from dawn to dusk in the magnetic equatorial plane and close the tail Chapman-Ferraro currents to produce the dual lobe structure of the magnetotail. Our model combines individual modules for the dynamo magnetic fields of internal origin, B int , and of external origin resulting from currents flowing in the cross-tail current sheet, B t , and the Chapman-Ferraro currents on the magnetopause boundary, B cf : (1) The field B int has previously been characterized, and we focus on deriving the contributions from B t and B cf . The field B cf is derived from scalar potential functions as the sum of the shielding fields required to confine the magnetic fields of the internal dipole and the cross-tail current within the magnetosphere. The magnetopause shape is prescribed by its observed average location.

Magnetic Field of the Equatorial Current System
The stretching of the magnetic field in the magnetotail implies a dawn-to-dusk current centered at the magnetic equator. In the far magnetotail, ≳ 10 R M antisunward, the current density at the magnetic equator is assumed to be constant with radial distance and vanishes toward the northern and southern edges of the current sheet. Closer to the planet on the nightside (~1.5-5 R M from Mercury's center), the current density is higher corresponding to higher magnetic field strength in the lobes. The resulting current distribution can be modeled with a disk-shaped current sheet [Tsyganenko and Peredo, 1994] in the near magnetotail and a sheet-shaped current farther tailward. These geometrical approximations were introduced in order to avoid an unphysically sharp inner edge of the cross-tail current. The magnetic field of the cross-tail current sheet is given by the sum of the contributions from the disk, B d , and the sheet, B s , currents: The advantages of this current configuration over the constant cross-tail current of the paraboloid model are that it can be better tailored to fit the observed system and that it is continuous at the inner edge.

Magnetic Field of the Disk Current Sheet
The definition of the current disk follows the mathematical description by Tsyganenko and Peredo [1994]. The external currents are most conveniently treated in Mercury solar magnetospheric (MSM) coordinates, which are offset 479 km to the north from the planet-centered Mercury solar orbital (MSO) coordinate system and for which +x is toward the Sun, +y is duskward, +z is northward [e.g., Korth et al., 2011], and the cylindrical radial coordinate is ρ ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi x 2 þ y 2 p . The essentials of the current disk are as follows. The current, I, as a function of radial distance, ρ, is a piecewise-continuous function: In equation (3), I m is the peak current, ρ 1 and ρ 2 are the radial distances of the inner edge of the current sheet and the peak current, respectively, and the e-folding scale L imposes a decrease of the current for large ρ. , we set the inner edge of the current sheet to ρ 1 = 1.41 R M . This value represents the mean radial distance of MESSENGER's crossing of the magnetic equatorial plane on the descending orbit legs, when the spacecraft was found, on average, to pass close to but not through the cross-tail current sheet. In the absence of observations required to determine ρ 2 and L experimentally, we chose ρ 2 = 1.56 R M and L = 1.43 a posteriori to yield a gradient near the inner edge as steep as could be fit using the procedure below and a decay to I m /10 at a radial distance of 5 R M . The corresponding current profile is shown by the solid black line in Figure 1.
Outside the current sheet, the vector potential, A, satisfies If the electric currents are axially symmetric, which in cylindrical coordinates ( ρ, φ, z) implies A ρ = A z = 0, the magnitude of the vector potential A = A φ is given by the solution to the differential equation A practical solution to equation (5) is given by where f i are linear coefficients and b i and c i are sets of nonlinear coefficients. To account for the finite thickness of the cross-tail current sheet, in equation (6) the following substitution has been made: is the half-thickness of the current sheet. In the latter definition, d 0 is the nominal half-thickness of the current sheet, and spatial variations thereof are provided by the scale factors δx, δy, s x , and s y . The thickness of the current sheet varies in the x direction such that it becomes infinite toward the dayside and increases slightly toward the flanks of the magnetosphere. The electric current per unit tail length was obtained from equation (6) as where μ 0 is the magnetic permeability of free space. Fitting the expansion series of order N = 5 obtained by inserting equation (6) in equation (7) to the current profile defined by equation (3) yields the coefficients f i , b i , and c i of the vector potential A. The fit is represented by the dashed red line in Figure 1 and agrees well with the prescribed profile. Finally, the magnetic field is obtained from the vector potential as where the amplitude of the disk current, t 1 , is obtained by fitting the model to the observations (see section 3).

Magnetic Field of the Quasi-Harris Current Sheet
At large antisunward distances (>5 R M ), the tail lobe field asymptotically approaches a state that can be modeled by a magnetic field that points sunward (+x) in the northern lobe and antisunward (Àx) in the southern lobe and varies in magnitude in the north-south (z) direction. The corresponding vector potential can be chosen to be of the form A = (0, A y , 0), where and where t 2 is the current amplitude. The half-thickness of the current sheet, d, and its variation as a function of x and y is of the same functional form as that of the disk current (section 2.2.1) but has different scale factors s x and s y . The functional form of equation (9) is similar to that derived by Harris [1962] as an exact solution to the Vlasov equation, but it is not a solution to a plasma equilibrium. We therefore term this module a quasi-Harris sheet. The amplitude of the quasi-Harris sheet current, t 2 , was obtained by fitting the model to the observations (see section 3). From equation (9), the associated magnetic field, B s = ∇ × A, is found to be

Magnetopause Currents and Shielding Field
The magnetopause boundary between the shocked solar wind plasma of the magnetosheath and the magnetosphere carries electric currents that shield the magnetosheath from the magnetic field sources internal to the magnetosphere. This shielding corresponds to a zero normal component of the total magnetic field vector at the boundary, and the associated field produced by the magnetopause currents is obtained by negating the normal component of the field from internal sources at the magnetopause [Tsyganenko, 2013]. The magnetopause field B cf is curl free inside the magnetosphere and can be represented as the gradient of a scalar potential function, U: The scalar potential satisfies Laplace's equation where B j is the magnetic field of the magnetospheric source to be shielded and n is the unit vector normal to the magnetopause surface. The shielding field is obtained by representing U as a series expansion of Cartesian harmonic basis functions, with N 2 linear coefficients a ik and N nonlinear coefficients p i . This series in equation (12) yields a magnetic field having the symmetry properties of an untilted dipole: B x and B y are odd with respect to z, whereas B z is even. For each source field evaluated at the j-th location on the boundary surface, B j , the coefficients a ik and p i were obtained by minimizing the root mean square (RMS) residual of the magnetic field component normal to the boundary surface, where M is the number of data points on the boundary surface.
The shape of the average magnetopause surface has been determined statistically from observations by the Magnetometer on the MESSENGER spacecraft, which crosses the magnetospheric boundary twice on every orbit. Winslow et al. [2013] used a set of more than 1000 such observed crossings to fit the magnetopause function of Shue et al. [1997], which describes the radial distance, r, of the magnetopause from the dipole center as a function of the angle, ε, between the planet-Sun line and the direction to the corresponding point on the magnetopause, the subsolar standoff distance, R SS , and the flaring parameter α. They found best fit values of R SS = 1.45 R M and α = 0.5. An updated analysis that included additional observations of magnetopause crossings through 28 November 2012 yielded best fit values of R SS = 1.42 R M and α = 0.5. We adopted equation (14) and the updated best fit values to prescribe the location of the magnetopause in the model.

10.1002/2015JA021022
The coefficients of the expansion series in equation (12) were obtained by combining linear least squares fitting with nonlinear optimization. For fixed p i and a set of l points on the magnetopause, equation (12) yields a system of linear equations, for which the least squares solution for the coefficients a ik can be conveniently found with singular value decomposition [Lanczos, 1958;Press et al., 1993]. From the coefficients a ik obtained in this manner, the residual σ j for a given set of p i was then computed from equation (13). To minimize σ j over the parameter space of p i , the system of linear equations was solved repeatedly within an optimization algorithm that implemented the downhill simplex method [Press et al., 1993], which requires only function evaluations but no derivatives.
To fit the shielding fields, we used the expansion series in equation (12) with orders N = 4 for B cf,int and N = 6 for B cf,d and B cf,s . The magnitudes of the residuals σ j depend on the nature of the source field but are typically on the order of 10 pT, which is much smaller than the observed values (>10 nT) of the magnetopause-normal magnetic fields [Slavin et al., 2009]. To reduce σ s to this level, it was necessary to position image current sheets outside the model magnetosphere at z = ±3.5 R M . The purpose of the image current sheets is to reduce gradients in the magnetic field so that they can be represented by a low-order expansion series such as that in equation (12). The above technique was applied separately to each magnetic field source (the internal offset axial dipole field, the tail current disk, and the tail current sheet) inside the magnetosphere, and the total Chapman-Ferraro field was computed from the sum of the shielding fields from each module:

Solar Wind Pressure Scaling
The solar wind ram pressure varies with heliocentric distance, r Sun , leading to systematic changes in ram pressure during Mercury's eccentric orbit around the Sun, as discussed by Korth et al. [2012]. In response to solar wind pressure changes, the magnetosphere was assumed to expand and contract self-similarly [Shue et al., 1998]. This deformation can be modeled by rescaling the magnetosphere from a standard pressure, p ram , to its new value, p ′ ram [Tsyganenko, 2013]. The first-order scaling equations for the magnetopause shielding fields are where κ ¼ p ′ ram =p ram À Á β , and a simple balance between the internal dipole magnetic field pressure and the solar wind dynamic pressure yields β = 1/6. The factor κ 3 in the above equation for B cf,int ensures proper scaling of R SS with p ram for the Chapman-Ferraro field associated with the internal dipole. The omission of this term in the pressure scaling of B cf,d and B cf,s implies that a variation in p ram yields solely a self-similar geometrical resizing of the tail field. Winslow et al. [2013] showed that R SS is proportional to p À1=6 ram to first order, giving κ ¼ R SS =R ′ SS . With the updated R SS fit value noted above and from p e r À2 Sun implied by solar wind mass flow continuity, we obtain To account for solar wind pressure modulations at Mercury, κ is computed with R ′ SS from equation (17) and the model field is scaled with equation (16).

Model Parameterization and Fitting
The KT14 model includes a number of free parameters, which were set as follows. The estimates for the dipole moment, μ, and the nominal half-thickness of the cross-tail current sheet, d 0 , were adopted from Johnson et al. [2012]. The value for d 0 was determined statistically from rotations in the magnetic field observed by MESSENGER during crossings of the current sheet. Furthermore, we used the updated values for the magnetopause subsolar magnetopause standoff distance, R SS , and flaring factor, α, given in section 2.3.
Unlike the parameters above, the spatial variation in the current sheet thickness is more difficult to determine from the observations because of the limited spatial sampling provided by the MESSENGER orbit. The thickness variation in the dawn-to-dusk direction, defined by δy and s y , was chosen to reproduce the approximate location of the boundary between open and closed field lines. The statistical location of this boundary was previously inferred from plasma enhancements observed by the Fast Imaging Plasma Journal of Geophysical Research: Space Physics 10.1002/2015JA021022 Spectrometer (FIPS) in a narrow-latitude band extending from local midnight via dawn and dusk to the dayside . The resulting parameterization features only a small broadening of the current sheet from center toward the dawn and dusk flanks of the magnetosphere. The variation of the current sheet thickness in the sunward direction is defined by δx and s x , and these parameters were chosen a priori to widen the current sheet in the dayside magnetosphere such that the current density is reduced to the degree possible while minimally modifying the distribution of the nightside currents. The robustness of the model was verified by comparing the solutions for different values of the hand-picked parameters.
Finally, the amplitudes t 1 and t 2 , which quantify the intensity of the cross-tail current sheet, were determined from MESSENGER magnetic field data. This determination was accomplished by expressing the total model field as and fitting t 1 and t 2 to minimize the mean RMS residual of the model with respect to the set of T MESSENGER observations: We fit 1 min averages of data in MSM coordinates corrected for aberration of the magnetotail resulting from Mercury's orbital velocity, which is substantial (47 km/s average) compared with the speed of the solar wind. We used data obtained within the magnetosphere (defined by the intervals between the innermost magnetopause crossings) [Winslow et al., 2013] during the period 24 March 2011 to 28 November 2012 (7 Mercury years). Observations within 5 min of the magnetopause encounters were excluded to ensure that magnetic field variations associated with dynamic processes at this boundary and human error in the boundary identification did not bias the fit. The distribution of the data points is shown in Figure 2. For each data point, we first determined Mercury's heliocentric distance and scaled the model as described in section 2.4. Then, for a constant solar wind speed of v sw = 400 km/s, we used the tangential component of Mercury's instantaneous orbital velocity around the Sun, v M , and computed the aberration angle, χ = tan À 1 (v M /v sw ), of the magnetosphere. The x and y components of spacecraft position and observed magnetic field vector in MSM coordinates were then corrected for aberration by applying a counterclockwise rotation by the angle χ. Note that the z components of spacecraft position and magnetic field vector are invariant in the transformation into aberrated coordinates. Finally, we computed the model field at the aberration-corrected location and the difference vector with respect to the observed field. The downhill simplex method was used to identify the tail parameters t 1 and t 2 that minimize δB.
The MESSENGER observations were obtained in the region near the planet, within~3 R M antisunward, where the current disk dominates the quasi-Harris sheet current. Therefore, the parameter t 2 is poorly constrained when fitting both parameters simultaneously. Thus, the parameter t 1 was fit first with t 2 set to zero, and then the parameter t 2 was determined with t 1 set to its previously obtained, best fit value. The fit parameters, t 1 = 7.37 and t 2 = 2.16, yield δB ¼ 24:8 nT. The complete set of model parameters is shown in Table 1. The model configuration is shown in Figures 2 and 3. Figure 3 shows in black the geometry of magnetic field [1997] magnetopause model with the above best fit parameters, depicted in red, is in good agreement with the envelope of the field lines, demonstrating that the shielding fields successfully confine the net magnetospheric field within its average observed boundary. In the nightside magnetic equatorial plane, the closed field line region is limited to radial distances within~4 R M of the planet center, which maps to the planetary surface at 54°N and 29°S MSO latitude in the northern and southern hemispheres, respectively. Open field lines originating poleward of this boundary are rooted at the planet at only one end and extend far downtail. On the dayside, the planetary field is compressed by the solar wind, and the boundary between open and closed field lines extends to higher latitudes.
The distribution of the dawn-to-dusk current density, j y , is shown in Figure 4 in three different cuts through the model magnetosphere. Figure 4a shows j y in the x-z plane at y = 0 R M , i.e., the noon-midnight meridian plane, normalized with respect to the maximum current density in this plane. The figure shows that the cross-tail current sheet, which has a uniform thickness far from the planet and thickens toward the planet, has a peak in the current density near x = À2 R M . Close examination also shows that the current density exhibits a minimum near x = À5 R M and increases in the equatorial plane toward larger downtail distances. Outside the cross-tail current sheet, the current density vanishes as expected. Figure 4b shows j y in the x-y plane at z = 0, i.e., the magnetic equatorial plane, normalized with respect to the maximum current density in this plane. The distribution shows more clearly the midtail minimum in the current density and the lack of current sunward of the terminator. The decrease in current density toward the magnetosphere flanks results from the distribution of the cross-tail current over a larger cross section in these regions compared with the center of the magnetotail. Finally, Figure 4c shows j y in the y-z plane at x = À2 R M . In contrast to Figures 4a and 4b, this distribution is normalized with respect to the maximum current density at a given y value in the plane. This normalization was chosen to emphasize the structure of the current sheet in the dawn-dusk direction and shows the current sheet thickness to increase slightly toward the flanks of the magnetosphere. Figure 4 indicates that the peak in the current density occurs near (x, y, z) = (À2, 0, 0) R M , and the magnitude of the current density amounts to~0.1 μA/m 2 at this location. Overall, the distribution of current in the model magnetosphere is consistent with the contributions from the current systems described in section 2.2. Since the magnetotail field in equation (10) and the shielding fields in equation (15) are obtained, respectively, as the curl of the vector 1.0 Expansion magnitude of tail current sheet in y direction δy 0.1 Scale factor for disk current expansion in x direction s x,d 1.0 Scale factor for disk current expansion in y direction s y,d 2.9 Scale factor for quasi-Harris sheet expansion in x direction s x,s 1.5 Scale factor for quasi-Harris sheet expansion in y direction s y,s 9.0 Location of image sheets for quasi-Harris sheet 3.5 R M Figure 3. Model magnetic field lines (black) in the MSM x-z plane confined within the observed average magnetopause (red) modeled after Shue et al. [1997] using best fit parameters determined from Magnetometer observations. The planet is shown as a circle with dayside and nightside in orange and black, respectively.

Journal of Geophysical Research: Space Physics
10.1002/2015JA021022 potential in equation (9) and as a gradient of the scalar potential in equation (12), they are automatically divergence free by construction. We verified that the model magnetic field is divergence free by ensuring that, throughout the magnetosphere, the ratio ∇ Á B/∇B approaches the limit of the machine numerical precision, which was 10 À8 .

Discussion
We have developed a new magnetic field model for Mercury's magnetosphere using the source-surface approach pioneered by Schulz andMcNab [1987, 1996] and applied in state-of-the-art terrestrial magnetic field models [Tsyganenko, 2013, and references therein]. The magnetospheric magnetic field includes contributions from the internal dipole and the cross-tail and magnetopause currents and is confined within the average observed magnetopause boundary. The KT14 model features a more complex structure of the magnetospheric current systems, and the number of free parameters defining these currents is larger, than in the paraboloid model. Because of the geometry of the MESSENGER orbit, some parameters cannot be independently derived, whereas others cannot be determined from the observations at all and had to be chosen a priori.

Cross-Tail Current System
The shape of the cross-tail current sheet in the KT14 model cannot be constrained well from MESSENGER observations. The thickness of the current sheet can be established along the spacecraft orbit , but its spatial variation throughout the magnetosphere cannot be determined because of the distribution of the data antisunward of the planet. However, since such observations may become available in the future, accommodating spatial variations of the current sheet thickness in the model formalism is useful. Moreover, such variations are required for modeling the current sheet in a continuous fashion to avoid discontinuities in the magnetic field magnitude near the inner edge of the sheet. This continuity condition is accomplished by an exponential broadening of the current sheet toward the dayside magnetosphere using scale factors chosen a priori. The broadening of the current sheet distributes the current density over a larger volume and substantially reduces the contribution of the tail current to the magnetic field in the dayside magnetosphere. This mathematical implementation yields the desired equatorial current distribution and mimics the inner edge of the current sheet, but the current distribution and closure may deviate from the natural system sunward of this region. In addition, the cross-tail current configuration allows for variations in the dawn-dusk direction to reproduce the thickening of the plasma sheet toward the magnetosphere flanks [Fairfield, 1979]. As noted in section 3, the ability to characterize the parameters δy and s y from MESSENGER observations is limited, given the spatial distribution of these data. Instead, these parameters were chosen to yield a boundary between open and closed field lines consistent with FIPS observations . In the future, the Mercury Magnetospheric Orbiter of the BepiColombo mission [Benkhoff et al., 2010] may provide supplemental observations to determine this variation more accurately.
Unlike the spatial variations of the current sheet thickness, the current intensity can be fit to MESSENGER data to yield the amplitudes t 1 and t 2 in equations (8) and (10), respectively. The mean RMS misfits obtained for combinations of these parameters are shown in Figure 5. It is apparent that δB exhibits only small variations (less than 10% relative changes in misfit) over a large parameter space along the major semi-axis. Thus, the magnetic field generated by the cross-tail current represents the data similarly well over a wide range of values for current amplitudes in the disk and quasi-Harris sheet.
The current regions of the disk and quasi-Harris sheet overlap spatially, and the amplitudes t 1 and t 2 are not independent, as seen by the contours in Figure 5. The negative slope of the major semi-axis indicates that t 1 and t 2 are anticorrelated. Unlike the misfit, the topology of the magnetic field lines changes substantially as t 1 and t 2 are varied. At a minimum of δB (t 1 = 4.13, t 2 = 4.93), the magnetic field lines, shown in Figure 6, appear inflated in the tail region where no observations have been obtained. To avoid such a field configuration, which is inconsistent with the geometry of the terrestrial magnetotail, we determined the parameters independently as described above, beginning with the disk current region, which is better constrained by the observations. The resulting parameter values (t 1 = 7.37, t 2 = 2.16), indicated by the red dot in Figure 5, yield a mean RMS misfit that deviates from the minimum δB by less than 1 nT. The low sensitivity of δB to variations in t 1 and t 2 implies that the cross-tail current is not the major contributor to the remaining magnetic field residuals, so the source of the residuals has to be sought elsewhere.

Systematic Distribution of Residuals
Magnetic field residuals can result from systematic departures of the model from the natural system or from random fluctuations, among others, in response to variations in the solar wind conditions. The random variability of the magnetospheric magnetic field was previously studied by Anderson et al. [2013]. These authors examined the standard deviations in the magnetic  field observations to derive an index for the magnetic activity for each orbit. In the 20-300 s period band (relevant to the 1 min data used in our study), an average value of~4 nT was obtained, which is much lower than the 24.8 nT RMS residual between the observed and modeled magnetic field. This result suggests that the differences between the observations and the model are, for the most part, not random in nature. Therefore, we next analyze the spatial distribution of the magnetic field residuals with respect to the KT14 model.
The spatial distribution was obtained by first sorting the 1 min residuals into bins of width 5°in latitude by 0.33 h in local time and then averaging the vector components in each bin. The resulting distributions are shown in Figure 7 separately for the ascending (a-c) and descending (d-f) orbit legs and for the radial, B r (a and d, positive outward), colatitudinal, B θ (b and e, positive southward), and longitudinal, B ϕ (c and f, positive eastward), components of a spherical coordinate system centered on the dipole. Although the local time of the observations is phase locked with Mercury's orbit around the Sun and the model is static for a given heliocentric distance, the latitude of the magnetopause crossing at a given local time varies as a result of the evolution of the MESSENGER orbit. The residuals of the best fit paraboloid magnetosphere model  are shown in Figure 8 in the same format. Finally, the distributions of the mean and standard deviation of the altitude corresponding to the residuals are shown in Figure 9.
The magnetic field residuals exhibit several systematic features. First, the largest KT14 residuals are in B r (Figures 7a and 7d) and B θ (Figures 7b and 7e) near the dayside magnetopause, where they are somewhat larger than those obtained from the paraboloid model (Figures 8a, 8b, 8d, and 8e). These residuals may originate from a dayside boundary layer located inside the magnetosphere adjacent to the magnetopause. Such a boundary layer was observed during the first and second Mercury flybys, during which depressions in the magnetic field magnitude and enhanced proton fluxes were observed approximately 5 min prior to the outbound magnetopause encounters . The observed sharp drop in the magnetic field magnitude without a change in direction is consistent with the southward residuals seen in Figures 7b and 7e near the magnetopause.  Residuals in the downward (ÀB r ) and poleward (ÀB θ ) directions are observed in a partial ring structure extending between latitudes 30°N and 60°N; the structure is especially pronounced on the descending orbit legs. The residuals for the KT14 and paraboloid models are similar, but those for the KT14 model are typically lower in magnitude, particularly on the dayside (Figures 7b and 7e), than those for the paraboloid model (Figures 8b and 8e). Previous analysis  led to the suggestion that these residuals resulted in part from the deviations in the shape of the actual magnetopause from that of the model paraboloid magnetopause. Although the reduction of these residuals in the KT14 model is noticeable, their overall large-scale structure is essentially unchanged. This similarity in structure implies that the unrealistic magnetopause shape in the paraboloid model is not the primary origin of the residuals, but rather there are additional magnetic field sources not represented by either model. The source of these residuals is presently unknown.
Large-scale residuals in B ϕ (Figures 7c and 7f) are found on both the ascending and descending orbit legs and extend from about 30°N to the north pole. The magnetic perturbations are directed eastward at dawn and westward at dusk. Their distribution is consistent with the existence of steady field-aligned Birkeland currents [Birkeland, 1908], which have recently been discovered at Mercury . The magnitudes of the residuals are larger on the descending orbit leg than they are on the ascending orbit leg, consistent with intensifications of the field-aligned currents at lower altitudes where the magnetic field lines converge. The distributions of the B ϕ residuals for the KT14 model are similar to those for the paraboloid model (Figures 8c and 8f), although the perturbations with respect to the latter model are slightly smaller.
Finally, persistent radial magnetic field residuals are found within narrow latitude bands extending near the equator on the nightside between dusk and dawn (Figures 7a and 7d). The residuals, which are similarly found in the distributions of the paraboloid model (Figures 8a and 8d), are directed away from and toward the planet in the northern and southern hemisphere, respectively. These residuals are consistent with diamagnetic decreases in magnetic field magnitude, which are frequently observed at Mercury in the presence of enhanced plasma densities . The extent of these residuals in local time is further consistent with that of the enhanced plasma population associated with the plasma sheet, which has been inferred from the magnetic field depressions and directly documented by FIPS observations . Additional diamagnetic depressions have been previously observed within the northern magnetospheric cusp  and are manifested in Figures 7a, 7d, 8a, and 8d as positive radial and colatitudinal residuals in the region poleward of 60°N latitude on the dayside. Since neither the KT14 nor the paraboloid model includes the diamagnetic effects of the plasma populations in the cusp and the equatorial inner magnetosphere, these models cannot account for local magnetic field variations associated with the maintenance of total pressure balance in these regions.

Magnetic Disturbance Dependence
Comparison of residuals from the paraboloid and KT14 models has shown that, whereas the latter yields an improved representation of the average magnetospheric magnetic field, systematic residuals remain that are presently unmodeled. There are two possible explanations for the origin of these residuals. First, as noted above, they may be caused by magnetic field sources not considered in either model. Second, they may result from temporal variations in the intensity of the magnetospheric currents driven by variations in external forces that are not treated here. Although detailed investigations into the origin of the discrepancies between the model and the observations are beyond the scope of this work, we consider the overall result of magnetospheric forcing conditions on the residuals. To examine the dependence of the residuals on the magnetic activity index, the orbits were sorted into quartile bins of the magnetic activity, and the residuals in each bin were averaged on a grid of latitude and local time using the technique described above. Figure 10 shows the average B r (a and d), B θ (b and e), and B ϕ (c and f) components on the descending orbit legs for the lowest (a-c) and the highest (d-f) quartile bins, representing the quietest and most active intervals, respectively. As seen in the figure, the overall structure of the residuals remains unaffected by changes in magnetic activity. However, the residuals for the higher-activity orbits have substantially larger magnitudes in some regions compared with those for lower activity orbits. There are two possible explanations for the occurrence of high-intensity residuals during magnetically active times. First, enhancements in the coupling between the solar wind and magnetosphere should result in stronger magnetospheric currents. For example, the residuals in B ϕ show that the intensity of the Birkeland currents increases with magnetic activity, as shown by Anderson et al. [2014], which is consistent with observations at Earth [Korth et al., 2010]. Second, increased residuals may reflect a discrepancy in the true and modeled locations of the currents. For example, the subsolar standoff distance of Mercury's magnetopause varies with solar wind pressure , and although our model includes an average annual variation in this standoff distance related to Mercury's changing heliocentric distance, fluctuations on periods shorter than a Mercury year are not considered. Studies of Earth's magnetopause have shown that the shape of the magnetopause can also vary with the solar wind conditions [Sibeck et al., 1991;Shue et al., 1998]. In particular, higher solar wind pressure or a larger magnitude of a southward directed IMF result in a smaller magnetosphere and a dayside magnetopause at lower altitudes. The enhanced dynamics of Mercury's environment suggests that these effects are even greater at the innermost planet. Such dynamical variations in the magnetopause location and structure are presently not considered in the KT14 model, so the magnetopause currents in the model may not always represent the observed magnetic field adequately. The strong dependence of the magnetic field residuals on magnetic activity suggests that they are primarily of external origin and implies the need to consider additional forcings to further reduce the magnetic field residuals and yield a more accurate description of the magnetospheric magnetic field.

Summary
We have developed a magnetic field model for Mercury's magnetosphere based on the source-surface approach followed by the Tsyganenko models for the terrestrial magnetosphere. The KT14 model features a continuous cross-tail current sheet and can be adapted to arbitrary magnetopause shapes. The model presented here employs an average magnetopause obtained by fitting the observed magnetopause crossings to the functional form of the model of Shue et al. [1997]. The magnetopause shielding fields are provided by magnetic potential functions, which minimize the RMS magnetic field component normal to the magnetopause. The modular structure of the model enables future implementation of additional magnetic field sources. Owing to the improved magnetopause shape, the KT14 model yields reduced magnetic field residuals at high latitudes on the dayside and more pronounced signatures of Birkeland currents and nightside equatorial plasma. However, systematic residuals remain despite substantial advances over the earlier paraboloid model. The dependence of the magnitude of the magnetic field residuals on the magnetic activity index implies that variations in solar wind forcing other than the systematic pressure variations with heliocentric distance encountered during Mercury's eccentric orbit about the Sun contribute to the external magnetic field. Furthermore, the large magnitudes of the remaining magnetic field residuals, their low sensitivity to the intensity of the cross-tail current, and the robustness of their spatial distribution to variations in magnetic activity suggest the presence of additional magnetic field sources that are not captured in the KT14 model and warrant further investigation.