From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- pkg/utilities/nttools/trebin/tuispl.f | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 pkg/utilities/nttools/trebin/tuispl.f (limited to 'pkg/utilities/nttools/trebin/tuispl.f') diff --git a/pkg/utilities/nttools/trebin/tuispl.f b/pkg/utilities/nttools/trebin/tuispl.f new file mode 100644 index 00000000..2f4c68b8 --- /dev/null +++ b/pkg/utilities/nttools/trebin/tuispl.f @@ -0,0 +1,32 @@ + subroutine tuispl (xa, ya, y2, x, y) +C +C Interpolate at point X using cubic splines. The array Y2 must have +C previously been computed by calling TUCSPL. Note that XA, YA, Y2 +C are two-element subarrays of the arrays with the same names elsewhere. +C Input and output are all double precision. +C This routine was copied with slight modifications from the SPLINT +C subroutine in Numerical Recipes by Press, Flannery, Teukolsky and +C Vetterling. +C +C XA i: pair of independent-variable values +C YA i: pair of dependent-variable values +C Y2 i: second derivatives of YA at each point +C X i: value at which spline is to be computed +C Y o: interpolated value at X +C +CH Phil Hodge, 14-Apr-1988 Subroutine copied from Numerical Recipes SPLINT. +C + double precision xa(2), ya(2), y2(2), x, y +C-- + double precision h, a, b + + h = xa(2) - xa(1) + + a = (xa(2) - x) / h + b = (x - xa(1)) / h + y = a * ya(1) + b * ya(2) + + + ((a**3 - a) * y2(1) + (b**3 - b) * y2(2)) + + * h * h / 6. + + return + end -- cgit