SWIFT, Swifter, and GFortran

2002 AA29 Simulation Horseshoe
ApproachesI've recently been wanting to run a few simulations of solar system dynamics to generate data for animations of various phenomena. One of the most used tools for this in astronomy circles has been the SWIFT package by Hal Levison and Martin Duncan. I used a web-hosted version of SWIFT during my studies at Swinburne University (producing graphs such as the one above).

Written in glorious Fortran 77, SWIFT could be built with many commercial Fortran compilers including Intel's Fortran Compiler. I successfully built SWIFT using the Intel compiler although I never used it in anger. I was never able to build it with the GCC 3.x Fortran (g77) because of the code's use of recursive routines. Two things have changed in this regard:

  • GCC 4.1+ now includes gfortran, which aims to be Fortran 95 compliant.
  • David E. Kaufmann has authored a completely redesigned version of the Swift package with the support of NASA's Applied Information Systems Research Program (AISRP).

The enhanced package is called Swifter and is written to Fortran 90 standards. It now compiles with the GCC gfortran compiler with the following change made to the Makefile.Defines:

FORTRAN         = gfortran 
FFLAGS          = -O -ffree-line-length-none

Now I can attack the problem of building funky animations.

Clear skies!