This library contains routines for fitting (least squares) a multidimensional cubic spline to arbitrarily located data. It also contains routines for evaluating this spline (or its partial derivatives) at any point. This is a modernization of the double precision SPLPAK files from NCL.
A fpm.toml
file is provided for compiling splpak 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 splpak
within your fpm project, add the following to your fpm.toml
file:
[dependencies]
splpak = { git="https://github.com/jacobwilliams/splpak.git" }
or, to use a specific version:
[dependencies]
splpak = { git="https://github.com/jacobwilliams/splpak.git", tag = "2.0.0" }
The latest API documentation can be found here. This was generated from the source code using FORD (i.e. by running ford ford.md
).
- The NCAR Command Language (specificially, the csagrid directory)
- bspline - Cubic B-Spline implementation in C++ templates. Also has a copy of splpak.f
- Ngmath Library Overview
- bspline-fortran Multidimensional B-Spline Interpolation of Data on a Regular Grid
- regridpack Linear or cubic interpolation for 1D-4D grids
- finterp 1D-6D linear or nearest-neighbor interpolation