Skip to content

jacobwilliams/geodesic-fortran

Repository files navigation

geodesic-fortran

Implementation of geodesic routines in modern Fortran.

GitHub release Build Status codecov

Description

This is a library to solve geodesic problems on a planetary body (e.g., the Earth).

Documentation

Some of the algorithms in this library:

Procedure Body Shape Description Reference
cartesian_to_geodetic_triaxial Triaxial Cartesian to geodetic Panou & Korakitis (2022)
cartesian_to_geodetic_triaxial_2 Triaxial Cartesian to geodetic Bektas (2015)
heikkinen Biaxial Cartesian to geodetic Heikkinen (1982)
olson Biaxial Cartesian to geodetic Olson (1996)
direct Biaxial Direct geodesic problem Karney (2013)
direct_vincenty Biaxial Direct geodesic problem Vincenty (1975)
inverse Biaxial Inverse geodesic problem Karney (2013)
inverse_vincenty Biaxial Inverse geodesic problem Vincenty (1975)
great_circle_distance Sphere Great circle distance Vincenty (1975)

See the latest API documentation for the full list. This was generated from the source code using FORD (i.e. by running ford ford.md).

Compiling

A fpm.toml file is provided for compiling geodesic-fortran with the Fortran Package Manager. For example, to build:

fpm build --profile release

By default, the library is built with double precision (real64) real values. Explicitly specifying the real kind can be done using the following processor flags:

Preprocessor flag Kind Number of bytes
REAL32 real(kind=real32) 4
REAL64 real(kind=real64) 8
REAL128 real(kind=real128) 16

For example, to build a single precision version of the library, use:

fpm build --profile release --flag "-DREAL32"

To run the unit tests:

fpm test --profile release

To use geodesic-fortran within your fpm project, add the following to your fpm.toml file:

[dependencies]
geodesic-fortran = { git="https://github.com/jacobwilliams/geodesic-fortran.git" }

or, to use a specific version:

[dependencies]
geodesic-fortran = { git="https://github.com/jacobwilliams/geodesic-fortran.git", tag = "1.0.0"  }

License

  • This library is licensed under a permissive MIT/X11/BSD license.

References

Other links: