Fortran-fitpack: a modern Fortran library for curve fitting and surface interpolation

I’ve mostly refactored the FITPACK library to modern Fortran standards, and added a simple object-oriented interface: I’m happy to share the code here:

It seems like FITPACK is the library most scientific packages (scipy, Julia) still wrap against for curve fitting purposes. It’s very robust and very flexible, so hopefully even its modern Fortran interface will get better over time. So far:

  • Code refactored to free-form
  • Real precision generalised
  • All variables and subroutines made explicit
  • Removed all old-style same-continuation double loop constructs
  • Some operations replaced with matmul, dot_product intrinsics
  • A simple object oriented interface is made
  • No external dependencies
16 Likes

This is fantastic! Thanks for doing it.

What is the license for your modifications? Can you release it under a BSD type license? (I think the original code is in SciPy so it must have had a similar license).

Would you like some assistance in eliminating the gotos in the code?

2 Likes

I’m no expert in licenses, but it seems like BSD-3 or MIT fit -

Yeah any contributions are welcome! I’ve also been doing some refactoring of the constants which I just pushed a few minutes ago, so let’s try to not overlap our efforts!

2 Likes