Skip to content

jacobwilliams/halo

Repository files navigation

NumDiff

Description

Halo orbit solver with modern Fortran

This application can be used to generate long-duration Earth-Moon halo orbits in the ephemeris model. A work in progress.

Build

The application is built using the Fortran Package Manager (FPM). FPM will download all the required dependencies and compile the program, and can also be used to run the tests.

fpm build --profile release

To run an example:

fpm run halo_solver --profile release -- examples/example.json

OpenMP can also be employed to speed up the process. Another example, using the Intel Fortran Compiler with OpenMP:

fpm run halo_solver --profile release --compiler ifort --flag "-qopenmp" -- examples/example.json

Or with Gfortran:

fpm run halo_solver --profile release --flag "-fopenmp" -- examples/example.json

Using qr_mumps

The qr_mumps solver can also be used, which will run much faster than the default LAPACK solver for very large problems. For this, the code must be compiled with the WITH_QRMUMPS preprocessor directive. See the build.sh and run.sh scripts for details.

Building On Windows

Work in progress....

Example:

"<intel install dir>\windows\bin\ifortvars.bat" intel64
"<intel install dir>\windows\mkl\bin\mklvars.bat" intel64

set OMP_NUM_THREADS=12

fpm run halo_solver --profile release --compiler ifort --flag "/fpp /Qmkl:parallel /Qopenmp" -- examples/example.json

Result is:

LINK : fatal error LNK1181: cannot open input file 'lapack.lib'

It's because fmin and nlsolver-fortran both have explicit lapack and blas dependencies specified in their fpm.toml files (link = ["lapack", "blas"]). If i delete those it compiles.

Documentation

The latest API documentation can be found here. This was generated from the source code using FORD.

See also

Reference

  1. J. Williams, R. D. Falck, and I. B. Beekman, "Application of Modern Fortran to Spacecraft Trajectory Design and Optimization", 2018 Space Flight Mechanics Meeting, 8–12 January 2018, AIAA 2018-145.