As shown by Gauss in 1839, the main geomagnetic field (i.e., magnetic potential)
can be represented by a spherical harmonic series, the first term being the
simple dipole term. A gradient of the potential determines the magnetic vector
field. The Earth's real magnetic field is the sum of several contributions
including the main (core) field, the crustal (anomaly) field, and the external
source (magnetospheric) fields.

The principal data sources for the main geomagnetic field modeling are the
following:

- Permanent (standard) magnetic observatories worldwide
- Repeat measurements (stations) at selected sites
- Magnetic surveys from the aircraft and ships
- Global satellite magnetic measurements.

Whereas the Cosmos 49 (October and November 1964) and OGO 2, 4, 6 (October 1965 through July 1971) satellites provided only the field magnitude, the MAGSAT and Dynamic Explorer 2 spacecraft were capable of measuring the field magnitude and direction. Satellite data have also helped to evaluate the crustal (anomaly) fields at individual observatories and regions and have thus greatly enhanced the accuracy of observatory data for the main field modeling. Temporal variations of the internal field have been modeled by expanding the coefficients in a Taylor series in time. Most models include only the constant and first time derivative (secular variation) terms. Some recent models have incorporated the second and third derivative terms, too (see the Summary Table).

In recent years a number of empirical models of the Earth's magnetic field including magnetospheric field models were developed. The main geomagnetic field models listed in the following pages differ in the data base used, in the number of coefficients (i.e., degree/order of Legendre polynomials and Taylor series expansion), and in the epoch represented. All coefficient sets are based on the usual Schmidt quasi-normalized form of associated Legendre functions. It is recommended in all cases to use a specific model only for the time period covered by the data base on which the specific model is based.

The main geomagnetic field software package consists in most cases of the coefficients only. Computer programs to calculate geomagnetic parameters from these sets of coefficients are also available.

This section lists several computer programs related to the geomagnetic models including software (1) to compute the geomagnetic field strength B and its vector components and the L-shell values, (2) to convert between different coordinate systems, and (3) for the magnetic field-line tracing. L is McIlwain's (1961) shell parameter, which at the magnetic equator corresponds to the radial distance from the Earth's center expressed in units of Earth radii. In the case of a dipole magnetic field (no multipole terms), the parameter L labels the dipole field lines. In the case of the real field, however, L varies along a field line, although the variation is less than 1% in the inner magnetosphere. L is defined as a function of the adiabatic invariant I; I is the curve integral over the particle momentum (parallel to the magnetic field) integrating along the field line between conjugate points. The functional dependence between L and I was determined for a pure dipole field and was then also used for the real field.

The widely used and recommended Definitive/International Geomagnetic Reference Field (DGRF/IGRF) models and the software package GEOPACK include computer codes for the B calculations and field-line tracing.