MAG3D manual: 
Program library



MAG3D is a program library (version 4.0 as of August 2005) for carrying out forward modelling and inversion of surface, airborne, and/or borehole magnetic data in the presence of a three dimensional Earth. The program library carries out the following functions:

  • Forward modelling of the magnetic field anomaly response to a 3D volume of susceptibility contrast. Data are assumed to be the anomalous magnetic response to buried susceptible material, not including Earth's ambient field.
  • The model is specified using a mesh of rectangular cells, each with a constant value of susceptibility, and topography is included. The magnetic response can be calculated anywhere within the model volume, including above the topography, simulating ground or airborne surveys, and inside the ground simulating borehole surveys.
  • Assumptions:
    • This code assumes susceptibilities are "small". This means results will be wrong when susceptibilties are high enough to cause self-demagnetization.
    • There is no method for incorporating remanent magnetization in this code.
  • Inversion of surface, airborne, and/or borehole magnetic data to generate 3D models of susceptibility contrast.
    • The inversion is solved as an optimization problem with the simultaneous goals of (i) minimizing an objective function on the model and (ii) generating synthetic data that match observations to within a degree of misfit consistent with the statistics of those data.
    • To counteract the inherent lack of information about the distance between source and measurement, the formulation incorporates a depth or distance weighting term.
    • By minimizing the model objective function, distributions of subsurface susceptibility contrast are found that are both close to a reference model and smooth in three dimensions. The degree to which either of these two goals dominates is controlled by the user by incorporating a priori geophysical or geological information into the inversion. Explicit prior information may also take the form of upper and lower bounds on the susceptibility contrast in any cell (as of version 4.0).
    • The regularization parameter (controlling relative importance of objective function and misfit terms) is determined in either of three ways, depending upon how much is known about errors in the measured data.
  • The large size of useful 3D inversion problems is mitigated by the use of wavelet compression. Parameters controlling the implementation of this compression are available for advanced users.

The research was funded principally by the mineral industry consortium "Joint and Cooperative Inversion of Geophysical and Geological Data" (1991 - 1997) which was sponsored by NSERC (Canada's National Science and Engineering Research Council) and the following 11 companies: BHP Minerals, CRA Exploration, Cominco Exploration, Falconbridge, Hudson Bay Exploration and Development, INCO Exploration & Technical Services, Kennecott Exploration Company, Newmont Gold Company, Noranda Exploration, Placer Dome, and WMC.

Since then, improvements have been implemented as time and resources permit, especially in the context of the "ICIS consortium" project, 2005-2006 which supported development of version 4.0.

The theoretical framework for MAG3D is provided in the following papers (see the UBC-GIF website publications page for details):

  • Li, Y. and Oldenburg, D. W., 1996, 3-D inversion of magnetic data: Geophysics, 61, no. 02, 394-408.
  • Li, Yaoguo and Oldenburg, Douglas W., 1998, Separation of regional and residual magnetic field data: Geophysics, 63, no. 02, 431-439.
  • Li, Y. and Oldenburg, D. W., 2000, Joint inversion of surface and three-component borehole magnetic data, Geophysics, Geophysics, 65 , #2, pp540-552.

Two short papers including examples of applying MAG3D in mineral exploration contexts are:

  • Cost effectiveness of geophysical inversions in mineral exploration: Applications at San Nicolas, Nigel Phillips, Doug Oldenburg, and Jiuping Chen, Yaoguo Li, Partha Routh, 2001, The Leading Edge, Volume 20, Issue 12 p. 1351
  • Applications of Geophysical Inversions in Mineral Exploration Problems, Oldenburg D.W., Li Y., Farquharson C.G., Kowalczyk P., Aravanis T., King A., Zhang P., and Watts A. (1998), The Leading Edge, 17, 461 - 465.

Software package contents

The package that can be licensed includes the following components:
  • Executable programs for performing 3D forward modelling and inversion of magnetic surveys. The MAG3D library (WindowsXX or Linux platforms) consists of three major programs and one utility:
    • MAGFOR3D: performs forward modelling.
    • MAGSEN3D: calculates sensitivity and the depth weighting function.
    • MAGINV3D: performs 3D magnetic inversion.
    • MAGPRE3D: multiplies the sensitivityfile by the model to get the predicted data.
  • A graphical user interface is supplied for the WindowsXX platforms only . Facilities include
    • MAG3D-GUI.EXE: a primary interface for setting up the inversion and monitoring the progress of calculations;
    • GM-DATA-VIEWER: a utility for viewing raw surface or airborne data (but not borehole data), error distributions, and for comparing observed to predicted data directly or as difference maps;
    • MESHTOOLS3d: a utility for displaying resulting 3D models as volume renderings. Susceptibility volumes can be sliced in any direction, or isosurface renderings can be generated.
  • Documentation is elsewhere via the menu to the left.
  • Example data sets and excercises are provided on the IAG CD-ROM.


A constrained educational version of the program is avaliable with the IAG CD-ROM. The educational version is fully functional so that users can learn how to carry out effective and efficient 3Dinversions of magnetic data. However, RESEARCH OR COMMERCIAL USE IS NOT POSSIBLE because the educational version will NOT work with more than 200 data points or 12,000 cells in the 3D mesh.

Licensing for an unconstrained academic version is available - see the licensing policy document (on the UBC-GIF website).
all academic licenses will be time-limited to one year. You can re-apply after that time. This ensures that everyone is using the most recent versions of codes.

Licensing for commercial use is managed by distributors, not by the UBC-GIF research group. Details are in the licensing policy document.

For learning and documentation:

For links to documentation, related utilities, and examples, see the menu to the left.