Extended Magnetic Model (EMM) and Potsdam Magnetic Model of the Earth (POMME)
-----------------------------------------------------------------------------
                                  source code


The EMM is an extended geomagnetic field model. It represents not only the
main field from the Earth's core, but also a degree 720 (15 arc minute
resolution) contribution from crustal magnetization, and a simple model 
of the magnetosphere. This magnetospheric contribution includes daily
and annually varying fields which induce electric currents in the Earth,
giving rise to secondary induced magnetic fields. These induced fields
are also represented in this model.

The EMM uses only the first time derivative (secular variation) for the 
extrapolation of the field in time, the most conservative approach. 
In contrast, the POMME models include the 2nd time derivative, also
called secular acceleration. This more accurately reflects the present
behavior of the field, but carries the risk of larger extrapolation
errors in the future, when the acceleration of the true field changes.

The models are more accurate if the present state of the magnetosphere
is provided as an input in the form of magnetic indices. Unfortunately,
these indices are presently not available in real-time, so any real-time
evaluation of the model has to set these indices to zero. 

For previous periods, the E_st and I_st indices are available from:
ftp://ftp.ngdc.noaa.gov/STP/GEOMAGNETIC_DATA/INDICES/EST_IST/Est_Ist_index.lis

The IMF-By is available from:
http://spidr.ngdc.noaa.gov/spidr/index.jsp
or from
http://omniweb.gsfc.nasa.gov/

This archive contains two main programs:
1) EMM_calc.c is a simple main program that will ask for the location and other
relevant input parameters and compute the magnetic field components. For
testing, it can be set up to replicate the WMM, which can then be compared
with the online calculator at
http://www.ngdc.noaa.gov/seg/geomag/jsp/IGRFWMM.jsp
2) EMM_smp_demo.c shows how to run the model in a multi-threaded application.
This may be important in case many values are to be computed. For example to
generate a grid or a time series. Since the model has half a million coefficients, 
it takes a while to evaluate it for a given point.

After adjusting the compiler options in 'Makefile', compile the programs using:
make EMM_calc
make EMM_smp_demo

The executables are then found in the subdirectory ./exe

Before running the programs, make sure that the stack size limit is larger than
30 MB. To increase the stack size to 100 MB do (bash shell)
> ulimit -s 100000
To increase the OpenMP stack to 100 MB do (bash shell)
> declare -x KMP_STACKSIZE=100m
These commands may depend on the shell and compilers used.

