registerdFORTRAN function

Internal FORTRAN routines for working with grids and finding distances.