aboutsummaryrefslogtreecommitdiff
path: root/pkg/utilities/nttools/trebin/tuispl.f
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /pkg/utilities/nttools/trebin/tuispl.f
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/utilities/nttools/trebin/tuispl.f')
-rw-r--r--pkg/utilities/nttools/trebin/tuispl.f32
1 files changed, 32 insertions, 0 deletions
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