Skip to content

how to update the model for earth magnetic field

Dan Kelley edited this page Mar 3, 2020 · 10 revisions

The formulae for the earth's magnetic field are provided by links at https://www.ngdc.noaa.gov/IAGA/vmod/igrf.html, in the form of fortran code supplied at https://www.ngdc.noaa.gov/IAGA/vmod/igrf12.f. (These links are valid for version 13 of the calculations, as of March 3, 2020.)

The steps for incorporating this into oce are as follows (a knowledge of git is assumed, since this is a developer page).

  1. In a unix shell:

    1. git checkout develop # switch to develop branch
    2. git pull # get the latest updates
  2. git checkout magneticField # switch branch

  3. `git pull # get updates

  4. git merge --no-ff develop # now we have the "develop" updates and are ready to code

  5. cd src # got to right directory

  6. In R

  7. download.file("https://www.ngdc.noaa.gov/IAGA/vmod/igrf12.f", "igrf12.f")