15. APEX geomagnetic coordinate conversion

The APEX file processing program provides a determination of the apex coordinates for any selected global location.
The program takes an input file with location and date, calculates the Apex coordinates and prints the results to an output file. Its behavior
is very similar to the WMM file processing program.
The underlying Fortran routines were coded by Art Richmond and John Emmert.

The Apex magnetic longitude is calculated the same way as geomagnetic dipole coordinates (see GMCORD).
The Apex magnetic latitude is calculated such that it is zero where inclination is zero and 90 where inclination is 90. The magnetic latitude is
computed by tracing the magnetic field line at the desired point up to the magnetic field line's apex (where Inclination is 0).
The magnetic field line is then traced back down along the field line of a dipole which has the apex as its magnetic equator to the original altitude,
the magnetic latitude of this reference dipole at that location is the magnetic latitude in apex coordinates. For more information see: