Degenerate Conic

Algorithms • Modern Fortran Programming • Orbital Mechanics

Oct 18, 2019

Interpolation

regrid

Just in case you find yourself needing to do some multidimensional data interpolation with modern Fortran:

  • I just published a modernized version of REGRIDPACK, a library for "regriding" 1D-4D data sets using linear and spline interpolation. The original version of this library (which used to be called TLCPACK) was formerly available from the UCAR website, but it is now nowhere to be seen. It was a well-written library, and had the nice feature of being able to specify linear or spline interpolation independently for each dimension. My refactoring is simply an update of the old code to modern standards.
  • I also recently added nearest neighbor interpolation to my Finterp library. So, now you can perform linear and nearest neighbor interpolation/extrapolation on 1D-6D data sets.
  • My Bspline-Fortran library can also be used for interpolation/extrapolation of 1D-6D data sets using B-splines. This library is being used by several people for CFD work, it seems.

There are precious few modern Fortran libraries for other types of interpolation. Here are a couple:

  • FOLLIA -- Fortran Library for Lagrange Interpolation
  • curvefit -- A library for fitting functions to sets of data.

There are also any number of old school FORTRAN 77 codes out there that haven't been updated in decades, but still work fine for what they do, including:

  • PCHIP -- Piecewise Cubic Hermite Interpolation Package from SLATEC.
  • PPPACK -- Piecewise polynomial interpolation code from from A Practical Guide to Splines by C. de Boor.
  • FITPACK -- a collection of FORTRAN programs for curve and surface fitting with splines and tensor product splines.

See also