Detailed description of Fitgrid procedures


CURV1 - calculate values for CURV2 usage


This subroutine calculates certain values that are used by CURV2 in order to compute an interpolatory spline under tension through a sequence of functional values. The actual computation of the interpolated values must be done using CURV2.
--------------------------------------------------------------
            Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
CALL CURV1 (N,       | Integer | Input  |
            X,       | Real    | Input  | N
            Y,       | Real    | Input  | N
            SLP1,    | Real    | Input  | 
            SLPN,    | Real    | Input  | 
            ISLPSW,  | Integer | Input  |
            YP,      | Real    | Output | N
            TEMP,    | Real    | Input  | N
            SIGMA,   | Real    | Input  | 
            IER)     | Integer | Output | 
--------------------------------------------------------------
N
The number of input data values. (N > 1)
X
An array containing the abscissae for the input function.
Y
An array containing the functional values of the input data -- (Y(K) is the functional value at X(K) for K=1,N).
SLP1
A user-specified value for the desired slope at X(1). See ISLPSW below if you want to have a value calculated internally.
SLPN
A user-specified value for the desired slope at X(N). See ISLPSW below if you want to have a value calculated internally.
ISLPSW
A switch to indicate whether the slopes at the end points should be calculated internally.
= 0 if SLP1 and SLPN are user-specified.
= 1 if SLP1 is user-specified, but SLPN is internally calculated.
= 2 if SLPN is user-specified, but SLP1 is internally calculated.
= 3 if SLP1 and SLPN are internally calculated.
YP
Contains values for the second derivative (CURV1 computes these).
TEMP
Scratch space.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.
IER
An error return value. If IER is returned as 0, then no errors were detected.
= 1 if N is less than 2.
= 2 if X values are not strictly increasing.

CURV2 - interpolate at a specified point


This function interpolates a value at a specified point using a spline under tension. CURV1 must be called prior to calling CURV2, and the values thus obtained used as input to CURV2. CURV2 returns the interpolated function value at the X-coordinate specified.
--------------------------------------------------------------
                Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
FUNCTION CURV2 (T,       | Real    | Input  |
                N,       | Integer | Input  |
                X,       | Real    | Input  | N
                Y,       | Real    | Input  | N
                YP,      | Real    | Input  | N
                SIGMA)   | Real    | Input  | 
--------------------------------------------------------------
T
The abscissa for which an interpolated function value is desired.
N
The number of input data values. (N > 1)
X
An array containing the abscissae for the input function.
Y
An array containing the functional values of the input data -- Y(K) is the functional value at X(K) for K=1,N.
YP
Contains values for the second derivative (as calculated by CURV1).
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

CURVD - calculate a derivative at a specified point


This function calculates a derivative at a specified point using a spline under tension. CURV1 must be called prior to calling CURVD, and the values thus obtained used as input to CURVD. The derivative value is returned.
--------------------------------------------------------------
                Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
FUNCTION CURVD (T,       | Real    | Input  |
                N,       | Integer | Input  |
                X,       | Real    | Input  | N
                Y,       | Real    | Input  | N
                YP,      | Real    | Input  | N
                SIGMA)   | Real    | Input  | 
--------------------------------------------------------------
T
The abscissa for which an interpolated function value is desired.
N
The number of input data values. (N > 1)
X
An array containing the abscissae for the input function.
Y
An array containing the functional values of the input function -- Y(K) is the functional value at X(K) for K=1,N.
YP
Contains values for the second derivative (as calculated by CURV1).
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

CURVI - integrate a spline curve


This function calculates an integral between two specified limits. CURV1 must be called prior to calling CURVI, and the values thus obtained used as input to CURVI. The value of the integral is returned.
--------------------------------------------------------------
                Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
FUNCTION CURVI (XL,      | Real    | Input  |
                XU,      | Real    | Input  |
                N,       | Integer | Input  |
                X,       | Real    | Input  | N
                Y,       | Real    | Input  | N
                YP,      | Real    | Input  | N
                SIGMA)   | Real    | Input  | 
--------------------------------------------------------------
XL
The lower limit of the integration.
XR
The upper limit of the integration.
N
The number of input data values. (N > 1)
X
An array containing the abscissae for the input function.
Y
An array containing the functional values of the input function -- Y(K) is the functional value at X(K) for K=1,N.
YP
Contains values for the second derivative (as calculated by CURV1).
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

CURVP1 - calculate values for CURVP2 usage


This subroutine calculates certain values that are used by CURVP2 in order to compute an interpolatory spline under tension through a sequence of functional values for a periodic function. The actual computation of the interpolated values must be done using CURVP2.
--------------------------------------------------------------
             Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
CALL CURVP1 (N,       | Integer | Input  |
             X,       | Real    | Input  | N
             Y,       | Real    | Input  | N
             P,       | Real    | Input  | 
             YP,      | Real    | Output | N
             TEMP,    | Real    | Input  | N x 2
             SIGMA,   | Real    | Input  | 
             IER)     | Integer | Output | 
--------------------------------------------------------------
N
The number of input data values. (N > 1)
X
An array containing the abscissae for the input function.
Y
An array containing the functional values of the input function -- Y(K) is the functional value at X(K) for K=1,N.
P
The period of the function. P must be greater than X(N)-X(1).
YP
Contains values for the second derivative (these are calculated by CURVP1).
TEMP
Scratch space.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.
IER
An error return value. If IER is returned as 0, then no errors were detected.
= 1 if N is less than 2.
= 2 if P is less than or equal to X(N)-X(1).
= 3 if the X values are not strictly increasing.

CURVP2 - interpolate a periodic function at a specified point


This function interpolates a value at a specified point using a spline under tension. CURVP1 must be called prior to calling CURVP2, and the values thus obtained used as input to CURVP2. The interpolated value is returned.
--------------------------------------------------------------
                 Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
FUNCTION CURVP2 (T,       | Real    | Input  |
                 N,       | Integer | Input  |
                 X,       | Real    | Input  | N
                 Y,       | Real    | Input  | N
                 P,       | Real    | Input  |
                 YP,      | Real    | Input  | N
                 SIGMA)   | Real    | Input  | 
--------------------------------------------------------------
T
The abscissa for which an interpolated function value is desired.
N
The number of input data values. (N > 1)
X
An array containing the abscissae for the input function.
Y
An array containing the functional values for the input function -- Y(K) is the functional value at X(K) for K=1,N.
P
The period of the function.
YP
Contains values for the second derivative (as computed by CURVP1).
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

CURVPI - integrate a periodic spline curve


This function calculates an integral between two specified limits. CURVP1 must be called prior to calling CURVPI, and the values thus obtained used as input to CURVPI. The value of the integral is returned.
--------------------------------------------------------------
                Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
FUNCTION CURVI (XL,      | Real    | Input  |
                XU,      | Real    | Input  |
                N,       | Integer | Input  |
                X,       | Real    | Input  | N
                Y,       | Real    | Input  | N
                P,       | Real    | Input  |
                YP,      | Real    | Input  | N
                SIGMA)   | Real    | Input  | 
--------------------------------------------------------------
XL
The lower limit of the integration.
XR
The upper limit of the integration.
N
The number of input data values. (N > 1)
X
An array containing the abscissae for the input function.
Y
An array containing the functional values of the input function -- Y(K) is the functional value at X(K) for K=1,N.
P
The period of the function.
YP
Contains values for the second derivative (as calculated by CURVP1).
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

CURVS - calculate values for a smoothing spline


This subroutine calculates certain values that are used by CURV2 in order to compute an interpolatory smoothing spline under tension through a sequence of functional values. The actual computation of the interpolated values must be done using CURV2.

Three parameters are used to control the degree of smoothness -- D, S, and EPS.

The parameter D is a value indicating the degree of confidence in the accuracy of the input function values -- it should be an approximation of the standard deviation of error. Effectively the value of D controls how close the smoothed curve comes to the input data points. If D is small then the interpolated curve will pass close to the input data. The larger the value of D, the more freedom the smooth curve has in how close it comes to the input data values.

S is a more subtle global smoothing parameter. S must be non-negative. For small values of S, the interpolated curve approximates the tension spline and for larger values of S, the curve is smoother. A reasonable value for EPS is REAL(N).

EPS controls the precision to which S is interpreted; EPS must be between 0. and 1. inclusive. A reasonable value for S is SQRT(2./REAL(N)).

--------------------------------------------------------------
            Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
CALL CURVS (N,       | Integer | Input  |
            X,       | Real    | Input  | N
            Y,       | Real    | Input  | N
            D,       | Real    | Input  | N 
            ISW,     | Integer | Input  | 
            S,       | Real    | Input  | 
            EPS,     | Real    | Input  | 
            YS,      | Real    | Output | N
            YSP,     | Real    | Output | N
            SIGMA,   | Real    | Input  | 
            TEMP,    | Real    | Input  | N x 9
            IER)     | Integer | Output | 
--------------------------------------------------------------
N
The number of input data values. (N > 1)
X
An array containing the abscissae for the input function.
Y
An array containing the functional values for the input function -- Y(K) is the functional value at X(K) for K=1,N.
D
A user-specified value containing the observed weights. D may be either an array or a scalar, depending on the value of ISW (as described below).
ISW
A switch for interpreting the value of D. If ISW=0, then D is an array of length N (D contains an individual error estimate for each input data value); if ISW=1, then D is a scalar that serves as an error estimate for every single data item.
S
Contains the value for smoothing. S must be non-negative. Larger values for S yield greater smoothing. A reasonable value is REAL(N).
EPS
Contains a tolerance value for the relative precision to which S should be interpreted. EPS must be between 0. and 1. inclusive. A reasonable value is SQRT(2./REAL(N)).
YS
An array of length N.
YSP
An array of length N.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.
TEMP
Scratch space.
IER
An error return value. If IER is returned as 0, then no errors were detected.
= 1 if N is less than 2.
= 2 if S is negative.
= 3 if EPS is negative or greater than 1.
= 4 if X values are not strictly increasing.
= 5 if D is negative.

CURVS1 - calculate values for a smoothing spline in the plane to be used by CURVS2


This subroutine calculates certain values that are used by CURVS2 in order to compute an interpolatory smoothing spline under tension through a sequence of functional values in the plane. The actual computation of the interpolated values must be done using CURVS2.

Three parameters are used to control the degree of smoothness -- D, S, and EPS.

The parameter D is a value indicating the degree of confidence in the accuracy of the input function values -- it should be an approximation of the standard deviation of error. Effectively the value of D controls how close the smoothed curve comes to the input data points. If D is small then the interpolated curve will pass close to the input data. The larger the value of D, the more freedom the smooth curve has in how close it comes to the input data values.

S is a more subtle global smoothing parameter. S must be non-negative. For small values of S, the interpolated curve approximates the tension spline and for larger values of S, the curve is smoother. A reasonable value for EPS is REAL(N).

EPS controls the precision to which S is interpreted; EPS must be between 0. and 1. inclusive. A reasonable value for S is SQRT(2./REAL(N)).

--------------------------------------------------------------
             Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
CALL CURVS1 (N,       | Integer | Input  | 
             X,       | Real    | Input  | N
             Y,       | Real    | Input  | N
             D,       | Real    | Input  | N or 1 (see desc.)
             ISW,     | Integer | Input  | 
             S,       | Real    | Input  | 
             EPS,     | Real    | Input  | 
             PARAM,   | Real    | Output | N
             XS,      | Real    | Output | N
             YS,      | Real    | Output | N
             XSP,     | Real    | Output | N
             YSP,     | Real    | Output | N
             SIGMA,   | Real    | Input  | 
             TEMP,    | Real    | Input  | N x 19
             IER)     | Integer | Output | 
--------------------------------------------------------------
N
The number of input data values. (N > 1)
X
An array containing the X-coordinates for the input data. These need not be increasing.
Y
An array containing the Y-coordinates for the input data.
D
A user-specified value containing the observed weights. D may be either an array or a scalar, depending on the value of ISW (as described below). D effectively controls how close the interpolated curve will come to the input points.
ISW
A switch for interpreting the value of D. If ISW=0, then D is an array of length N (D contains an individual error estimate for each input data value); if ISW=1, then D is a scalar that serves as an error estimate for every single data item.
S
Contains the value for smoothing. S must be non-negative. Larger values for S yield greater smoothing. A reasonable value is REAL(N).
EPS
Contains a tolerance value for the relative precision to which S should be interpreted. EPS must be between 0. and 1. inclusive. A reasonable value is SQRT(2./REAL(N)).
XS
An array of length N, contains the smoothed values.
YS
An array of length N, contains the smoothed values.
XSP
An array of length N. Contains second derivative information for the X-coordinate values.
YSP
An array of length N. Contains second derivative information for the Y-coordinate values.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.
TEMP
Scratch space.
IER
An error return value. If IER is returned as 0, then no errors were detected.
= 1 if N is less than 2.
= 2 if S is negative.
= 3 if EPS is negative or greater than 1.
= 4 if X values are not strictly increasing.
= 5 if D is negative.

CURVS2 - calculate values for a smoothing spline in the plane


This subroutine is a companion to CURV1S which must be called before calling this subroutine. CURV2S calculates an interpolated value for a smoothing spline under tension at a given point.

--------------------------------------------------------------
             Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
CALL CURVS2 (T,       | Real    | Input  | 
             N,       | Integer | Input  |
             PARAM,   | Real    | Input  | N
             X,       | Real    | Input  | N
             Y,       | Real    | Input  | N
             XP,      | Real    | Input  | N
             YP,      | Real    | Input  | N
             SIGMA,   | Real    | Input  | 
             XO,      | Real    | Output | 
             YO)      | Real    | Output |
--------------------------------------------------------------
T
A real value to be mapped onto the interpolating curve. Values of T between zero and one interpolate the original data; any values of T outside this range result in extrapolation.
N
The number of points which were specified to determine the curve in CURVS1.
PARAM
The arc lengths as computed by CURVS1.
X
An array containing the X-coordinates for the input data as input to CURVS1. These need not be increasing.
Y
An array containing the Y-coordinates for the input data as input to CURVS1.
XP
An array of second derivative values as calculated by CURVS1.
YP
An array of second derivative values as calculated by CURVS1.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.
XO
The interpolated X value.
YO
The interpolated Y value.

CURVPS - calculate values for a smoothing spline


This subroutine calculates certain values that are used by CURVP2 in order to compute an interpolatory smoothing spline under tension through a sequence of functional values for a periodic function. The actual computation of the interpolated values must be done using CURVP2.

Three parameters are used to control the degree of smoothness -- D, S, and EPS.

The parameter D is a value indicating the degree of confidence in the accuracy of the input function values -- it should be an approximation of the standard deviation of error. Effectively the value of D controls how close the smoothed curve comes to the input data points. If D is small then the interpolated curve will pass close to the input data. The larger the value of D, the more freedom the smooth curve has in how close it comes to the input data values.

S is a more subtle global smoothing parameter. S must be non-negative. For small values of S, the curve approximates the tension spline and for larger values of S, the curve is smoother. A reasonable value for S is REAL(N).

EPS controls the precision to which S is interpreted; EPS must be between 0. and 1. inclusive. A reasonable value for EPS is SQRT(2./REAL(N)).

--------------------------------------------------------------
             Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
CALL CURVPS (N,       | Integer | Input  |
             X,       | Real    | Input  | N
             Y,       | Real    | Input  | N
             P,       | Real    | Input  |
             D,       | Real    | Input  | N 
             ISW,     | Integer | Input  | 
             S,       | Real    | Input  | 
             EPS,     | Real    | Input  | 
             YS,      | Real    | Output | N
             YSP,     | Real    | Output | N
             SIGMA,   | Real    | Input  | 
             TEMP,    | Real    | Input  | N x 11
             IER)     | Integer | Output | 
--------------------------------------------------------------
N
The number of input data values. (N > 1)
X
An array containing the abscissae for the input function.
Y
An array containing the functional values of the input function -- Y(K) is the functional value at X(K) for K=1,N.
P
The period of the function. P must be greater than X(N)-X(1).
D
A user-specified value containing the observed weights. D may either be an array or a scalar, depending on the value of ISW.
ISW
A switch for interpreting the value of D. If ISW=0, then D is an array of length N (an error estimate for each input data value); if ISW=1, then D is a scalar that serves as an error estimate for every single data item.
S
Contains the value for smoothing. S must be non-negative. Larger values for S yield greater smoothing. A reasonable value is REAL(N).
EPS
Contains a tolerance value for the relative precision to which S should be interpreted. EPS must be between 0. and 1. inclusive. A reasonable value is SQRT(2./REAL(N)).
YS
An array of length N.
YSP
An array of length N.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.
TEMP
Scratch space.
IER
An error return value. If IER is returned as 0, then no errors were detected.
= 1 if N is less than 2.
= 2 if S is negative.
= 3 if EPS is negative or greater than 1.
= 4 if X values are not strictly increasing.
= 5 if D is negative.
= 6 if P is less than or equal to X(N)-X(1).

KURV1 - calculate values for KURV2 usage


This subroutine calculates certain values that are used by KURV2 in order to compute an interpolatory spline under tension through a sequence of points in the plane. The actual computation of the interpolated values must be done using KURV2.
--------------------------------------------------------------
            Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
CALL KURV1 (N,       | Integer | Input  |
            X,       | Real    | Input  | N
            Y,       | Real    | Input  | N
            SLP1,    | Real    | Input  | 
            SLPN,    | Real    | Input  | 
            ISLPSW,  | Integer | Input  |
            XP,      | Real    | Output | N
            YP,      | Real    | Output | N
            TEMP,    | Real    | Input  | N
            S,       | Real    | Output | N
            SIGMA,   | Real    | Input  | 
            IER)     | Integer | Output | 
--------------------------------------------------------------
N
The number of input data values. (N > 1)
X
An array containing the X values of the points.
Y
An array containing the Y values of the points. Adjacent pairs of points must be distinct.
SLP1
A value (in radians) containing the slope at (X(1),Y(1)). The angles are measured counter-clockwise from the X axis and the positive sense of the curve is assumed to be that moving from point 1 to point N. A value for SLP1 may be omitted as indicated by the switch ISLPSW.
SLPN
A value (in radians) containing the slope at (X(N),Y(N)). The angles are measured counter-clockwise from the X axis and the positive sense of the curve is assumed to be that moving from point 1 to point N. A value for SLP2 may be omitted as indicated by the switch ISLPSW.
ISLPSW
A switch to indicate whether the slopes at the end points should be calculated internally.
= 0 if SLP1 and SLPN are user-specified.
= 1 if SLP1 is user-specified, but SLPN calculated internally.
= 2 if SLPN is user-specified, but SLP1 calculated internally.
= 3 if SLP1 and SLPN are internally calculated.
XP
An array of length N.
YP
An array of length N.
TEMP
Scratch space.
S
An array of length N. On output, S contains the polygonal arclengths of the curve.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.
IER
An error return value. If IER is returned as 0, then no errors were detected.
= 1 if N is less than 2.
= 2 if a pair of adjacent points coincide.

KURV2 - does interpolation for parametric curves


The interpolated curve is parameterized by mapping points in the interval [0.,1.] onto the interpolated curve. The resulting curve has a parametric representation both of whose components are splines under tension and functions of the polygonal arc length. The value 0. is mapped onto (X[1],Y[1]) and the value 1. is mapped onto (X[N],Y[N]). KURV1 must be called before calling KURV2.
--------------------------------------------------------------
            Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
CALL KURV2 (T,       | Real    | Input  |
            XS,      | Real    | Output |
            YS,      | Real    | Output |
            N,       | Integer | Input  |
            X,       | Real    | Input  | N
            Y,       | Real    | Input  | N
            XP,      | Real    | Input  | N
            YP,      | Real    | Input  | N
            S,       | Real    | Input  | N
            SIGMA)   | Real    | Input  | 
--------------------------------------------------------------
T
A value to be mapped to a point on the curve. The interval [0.,1.] is mapped onto the curve such that 0. is mapped to (X(1),Y(1)) and 1. is mapped to (X(N),Y(N)). Values outside of [0.,1.] result in extrapolation.
XS
Contains the X coordinate of the interpolated point that T maps to.
YS
Contains the Y coordinate of the interpolated point that T maps to.
N
The number of input data points. (N > 1)
X
An array containing the X values of the input points.
Y
An array containing the Y values of the input points. Adjacent pairs of points must be distinct.
XP
An array of length N as computed by KURV1.
YP
An array of length N as computed by KURV1.
S
An array of length N containing the polygonal arc lengths of the curve.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

KURVD - interpolation and derivatives for parametric curves


This subroutine behaves like KURV2 except that in addition it returns the first and second derivatives of the component functions in the parameterization. The interval [0.,1.] maps onto a curve in the plane. The resulting curve has a parametric representation both of whose components are splines under tension and functions of the polygonal arc length. KURV1 must be called before calling KURVD.
--------------------------------------------------------------
            Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
CALL KURVD (T,       | Real    | Input  |
            XS,      | Real    | Output |
            YS,      | Real    | Output |
            XST,     | Real    | Output |
            YST,     | Real    | Output |
            XSTT,    | Real    | Output |
            YSTT,    | Real    | Output |
            N,       | Integer | Input  |
            X,       | Real    | Input  | N
            Y,       | Real    | Input  | N
            XP,      | Real    | Input  | N
            YP,      | Real    | Input  | N
            S,       | Real    | Input  | N
            SIGMA)   | Real    | Input  | 
--------------------------------------------------------------
T
A value to be mapped to a point on the curve. The interval [0.,1.] is mapped onto the curve such that 0. is mapped to (X(1),Y(1)) and 1. is mapped to (X(N),Y(N)). Values outside of [0.,1.] result in extrapolation.
XS
Contains the X coordinate of the point that T maps to.
YS
Contains the Y coordinate of the point that T maps to.
XST
Contains the first derivatives of the X component with respect to T.
YST
Contains the first derivatives of the Y component with respect to T.
XSTT
Contains the second derivatives of the X component with respect to T.
YSTT
Contains the second derivatives of the X component with respect to T.
N
The number of input data points. (N > 1)
X
An array containing the X values of the input points.
Y
An array containing the Y values of the input points. Adjacent pairs of points must be distinct.
XP
An array of length N as computed by KURV1.
YP
An array of length N as computed by KURV1.
S
An array of length N containing the polygonal arc lengths of the curve, as computed by KURV1.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

KURVP1 - calculate values for KURVP2 usage


This subroutine calculates certain values that are used by KURVP2 in order to compute an interpolatory spline under tension through a sequence of points in the plane that form a closed curve. The actual computation of the interpolated values must be done using KURVP2.
--------------------------------------------------------------
             Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
CALL KURVP1 (N,       | Integer | Input  |
             X,       | Real    | Input  | N
             Y,       | Real    | Input  | N
             XP,      | Real    | Output | N
             YP,      | Real    | Output | N
             TEMP,    | Real    | Input  | N x 2
             S,       | Real    | Output | N
             SIGMA,   | Real    | Input  | 
             IER)     | Integer | Output | 
--------------------------------------------------------------
N
The number of input data points. (N > 1)
X
An array containing the X values of the points.
Y
An array containing the Y values of the points. Adjacent pairs of points must be distinct.
XP
An array of length N.
YP
An array of length N.
TEMP
Scratch space.
S
An array of length N.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.
IER
An error return value. If IER is returned as 0, then no errors were detected.
= 1 if N is less than 2.
= 2 if a pair of adjacent points coincide.

KURVP2 - does interpolation for closed parametric curves


The interpolated curve is parameterized by mapping points in the interval [0.,1.] onto an interpolated closed curve. The resulting curve has a parametric representation both of whose components are splines under tension and functions of the polygonal arc length. The value 0. is mapped onto (X[1],Y[1]) and the value 1. is also mapped onto (X[1],Y[1]), since the interpolated curve is closed. KURVP1 must be called before calling KURVP2.
--------------------------------------------------------------
             Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
CALL KURVP2 (T,       | Real    | Input  |
             XS,      | Real    | Output |
             YS,      | Real    | Output |
             N,       | Integer | Input  |
             X,       | Real    | Input  | N
             Y,       | Real    | Input  | N
             XP,      | Real    | Input  | N
             YP,      | Real    | Input  | N
             S,       | Real    | Input  | N
             SIGMA)   | Real    | Input  | 
--------------------------------------------------------------
T
A value to be mapped to a point on the curve. The interval [0.,1.] is mapped onto the curve such that 0. is mapped to (X(1),Y(1)) and 1. is mapped to (X(1),Y(1)), since the interpolated curve is closed. Any interval [TT,TT+1.] maps onto the entire curve.
XS
Contains the X coordinate of the point that T maps to.
YS
Contains the Y coordinate of the point that T maps to.
N
The number of input data points. (N > 1)
X
An array containing the X values of the points.
Y
An array containing the Y values of the points. Adjacent pairs of points must be distinct.
XP
An array of length N as computed by KURV1.
YP
An array of length N as computed by KURV1.
S
An array of length N containing the polygonal arc lengths of the curve, as computed by KURV1.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

KURVPD - interpolation and derivatives for closed parametric curves


This subroutine behaves like KURVP2 except that in addition it returns the first and second derivatives of the component functions in the parameterization. The interval [0.,1.] maps onto a closed curve in the plane. The resulting curve has a parametric representation both of whose components are splines under tension and functions of the polygonal arc length. KURVP1 must be called before calling KURVPD.
--------------------------------------------------------------
             Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
CALL KURVPD (T,       | Real    | Input  |
             XS,      | Real    | Output |
             YS,      | Real    | Output |
             XST,     | Real    | Output |
             YST,     | Real    | Output |
             XSTT,    | Real    | Output |
             YSTT,    | Real    | Output |
             N,       | Integer | Input  |
             X,       | Real    | Input  | N
             Y,       | Real    | Input  | N
             XP,      | Real    | Input  | N
             YP,      | Real    | Input  | N
             S,       | Real    | Input  | N
             SIGMA)   | Real    | Input  | 
--------------------------------------------------------------
T
A value to be mapped to a point on the curve. The interval [0.,1.] is mapped onto the curve such that 0. is mapped to (X(1),Y(1)) and 1. is mapped to (X(1),Y(1)). Any interval [TT,TT+1.] maps onto the entire closed curve.
XS
Contains the X coordinate of the point that T maps to.
YS
Contains the Y coordinate of the point that T maps to.
XST
Contains the first derivatives of the X component with respect to T.
YST
Contains the first derivatives of the Y component with respect to T.
XSTT
Contains the second derivatives of the X component with respect to T.
YSTT
Contains the second derivatives of the X component with respect to T.
N
The number of input data points. (N > 1)
X
An array containing the X values of the input points.
Y
An array containing the Y values of the input points. Adjacent pairs of points must be distinct.
XP
An array of length N as computed by KURVP1.
YP
An array of length N as computed by KURVP1.
S
An array of length N containing the polygonal arc lengths of the curve, as computed by KURVP1.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

SURF1 - calculate values for SURF2 usage


This subroutine calculates certain values that are used by SURF2 in order to compute an interpolatory surface passing through a rectangular grid of function values. The surface computed is a tensor product of splines under tension. To calculate actual interpolated values, SURF2 must be called.
--------------------------------------------------------------
            Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
CALL SURF1 (M,       | Integer | Input  |
            N,       | Integer | Input  |
            X,       | Real    | Input  | M
            Y,       | Real    | Input  | N
            Z,       | Real    | Input  | IZ x N
            IZ,      | Integer | Input  |  
            ZX1,     | Real    | Input  | N
            ZXM,     | Real    | Input  | N
            ZY1,     | Real    | Input  | M
            ZYN,     | Real    | Input  | M
            ZXY11,   | Real    | Input  | 
            ZXYM1,   | Real    | Input  | 
            ZXY1N,   | Real    | Input  | 
            ZXYMN,   | Real    | Input  | 
            ISLPSW,  | Integer | Input  |
            ZP,      | Real    | Output | M x N x 3
            TEMP,    | Real    | Input  | N + N + M
            SIGMA,   | Real    | Input  | 
            IER)     | Integer | Output | 
--------------------------------------------------------------
M
The number of grid lines in the X direction. (M > 1)
N
The number of grid lines in the Y direction. (N > 1)
X
An array containing M X coordinates for grid lines in the X direction. These values must be strictly increasing.
Y
An array containing N Y coordinates for grid lines in the Y direction. These values must be strictly increasing.
Z
An array containing M x N functional values at the grid points; Z(I,J) contains the functional value at (X(I),Y(J)) for I=1,M and J=1,N.
IZ
The row dimension of the matrix Z (IZ is greater than or equal to M).
ZX1
An array containing N X-partial derivatives of the function along the line X(1), that is ZX1(J) is the X-partial derivative at point (X(1),Y(J)) for J=1,N. This parameter may be defaulted by setting ISLPSW appropriately.
ZXM
An array containing N X-partial derivatives of the function along the line X(M), that is ZXM(J) is the X-partial derivative at point (X(M),Y(J)) for J=1,N. This parameter may be defaulted by setting ISLPSW appropriately.
ZY1
An array containing M Y-partial derivatives of the function along the line Y(1), that is ZY1(I) is the Y-partial derivative at point (X(I),Y(1)) for I=1,M. This parameter may be defaulted by setting ISLPSW appropriately.
ZYN
An array containing M Y-partial derivatives of the function along the line Y(N), that is ZY1(I) is the Y-partial derivative at point (X(I),Y(N)) for I=1,M. This parameter may be defaulted by setting ISLPSW appropriately.
ZXY11
The X-Y-partial derivative at (X(1),Y(1). This parameter may be defaulted by setting ISLPSW appropriately.
ZXYM1
The X-Y-partial derivative at (X(M),Y(1). This parameter may be defaulted by setting ISLPSW appropriately.
ZXY1N
The X-Y-partial derivative at (X(1),Y(N). This parameter may be defaulted by setting ISLPSW appropriately.
ZXYMN
The X-Y-partial derivative at (X(M),Y(N). This parameter may be defaulted by setting ISLPSW appropriately.
ISLPSW
A switch to indicate which boundary derivatives are user supplied and which should be estimated internally. Where

I1 = 0 if ZX1 is user-supplied and 1 otherwise.
I2 = 0 if ZXM is user-supplied and 1 otherwise.
I3 = 0 if ZY1 is user-supplied and 1 otherwise.
I4 = 0 if ZYN is user-supplied and 1 otherwise.
I5 = 0 if ZXY11 is user-supplied and 1 otherwise.
I6 = 0 if ZXYM1 is user-supplied and 1 otherwise.
I7 = 0 if ZXY1N is user-supplied and 1 otherwise.
I8 = 0 if ZXYMN is user-supplied and 1 otherwise.

set ISLPSW = I1 + 2*I2 + 4*I3 +8*I4 +16*I5 +32*I6 + 64*I7 + 128*I8. Then, for example, if ISLPSW=0, then all derivative information is user-supplied and if ISLPSW=255, then all derivative information is to be internally estimated.

ZP
An array of size M x N x 3. On output this contains partial derivatives of the surface at the given nodes. ZP is used by SURF2.
TEMP
Scratch space.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.
IER
An error return value. If IER is returned as 0, then no errors were detected.
= 1 if N is less than 2.
= 2 if X or Y values are not strictly increasing.

SURF2 - 2D interpolation for gridded data


This function interpolates a surface value at a specified coordinate using bi-splines under tension. SURF1 must be called before invoking SURF2. The desired interpolated value is returned as the value of the function.
--------------------------------------------------------------
                Argument | Type    |  Mode  | Dimension
--------------------------------------------------------------
FUNCTION SURF2 (XX,      | Real    | Input  |
                YY,      | Real    | Input  |
                M,       | Integer | Input  |
                N,       | Integer | Input  |
                X,       | Real    | Input  | M
                Y,       | Real    | Input  | N
                Z,       | Real    | Input  | IZ x N
                IZ,      | Integer | Input  |  
                ZP,      | Real    | Input  | M x N x 3
                SIGMA)   | Real    | Input  | 
--------------------------------------------------------------
XX
Contains the X coordinate of a point to be mapped onto the interpolated surface.
YY
Contains the Y coordinate of a point to be mapped onto the interpolated surface.
M
The number of grid lines in the X direction. (M > 1)
N
The number of grid lines in the Y direction. (N > 1)
X
An array containing M X coordinates for grid lines in the X direction. These values must be strictly increasing.
Y
An array containing N Y coordinates for grid lines in the Y direction. These values must be strictly increasing.
Z
An array containing M x N functional values at the grid points; Z(I,J) contains the functional value at (X(I),Y(J)) for I=1,M and J=1,N.
IZ
The row dimension of the matrix Z (IZ is greater than or equal to M).
ZP
An array of size M x N x 3.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

CURV1DP - calculate values for CURV2DP usage

(Double precision version of CURV1)


This subroutine calculates certain values that are used by CURV2DP in order to compute an interpolatory spline under tension through a sequence of functional values. The actual computation of the interpolated values must be done using CURV2DP.
--------------------------------------------------------------
            Argument   | Type             |  Mode  | Dimension
--------------------------------------------------------------
CALL CURV1DP (N,       | Integer          | Input  |
              X,       | Double precision | Input  | N
              Y,       | Double precision | Input  | N
              SLP1,    | Double precision | Input  | 
              SLPN,    | Double precision | Input  | 
              ISLPSW,  | Integer          | Input  |
              YP,      | Double precision | Output | N
              TEMP,    | Double precision | Input  | N
              SIGMA,   | Double precision | Input  | 
              IER)     | Integer          | Output | 
--------------------------------------------------------------
N
The number of input data values. (N > 1)
X
An array containing the abscissae for the input function.
Y
An array containing the functional values of the input data -- (Y(K) is the functional value at X(K) for K=1,N).
SLP1
A user-specified value for the desired slope at X(1). See ISLPSW below if you want to have a value calculated internally.
SLPN
A user-specified value for the desired slope at X(N). See ISLPSW below if you want to have a value calculated internally.
ISLPSW
A switch to indicate whether the slopes at the end points should be calculated internally.
= 0 if SLP1 and SLPN are user-specified.
= 1 if SLP1 is user-specified, but SLPN is internally calculated.
= 2 if SLPN is user-specified, but SLP1 is internally calculated.
= 3 if SLP1 and SLPN are internally calculated.
YP
Contains values for the second derivative (CURV1DP computes these).
TEMP
Scratch space.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.
IER
An error return value. If IER is returned as 0, then no errors were detected.
= 1 if N is less than 2.
= 2 if X values are not strictly increasing.

CURV2DP - interpolate at a specified point

(Double precision version of CURV2)


This function interpolates a value at a specified point using a spline under tension. CURV1DP must be called prior to calling CURV2DP, and the values thus obtained used as input to CURV2DP. CURV2DP returns the interpolated function value at the X-coordinate specified.
------------------------------------------------------------------
                  Argument | Type             |  Mode  | Dimension
------------------------------------------------------------------
FUNCTION CURV2DP (T,       | Double precision | Input  |
                  N,       | Integer          | Input  |
                  X,       | Double precision | Input  | N
                  Y,       | Double precision | Input  | N
                  YP,      | Double precision | Input  | N
                  SIGMA)   | Double precision | Input  | 
------------------------------------------------------------------
T
The abscissa for which an interpolated function value is desired.
N
The number of input data values. (N > 1)
X
An array containing the abscissae for the input function.
Y
An array containing the functional values of the input data -- Y(K) is the functional value at X(K) for K=1,N.
YP
Contains values for the second derivative (as calculated by CURV1DP).
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

CURVDDP - calculate a derivative at a specified point

(Double precision version of CURVD)


This function calculates a derivative at a specified point using a spline under tension. CURV1DP must be called prior to calling CURVDDP, and the values thus obtained used as input to CURVDDP. The derivative value is returned.
------------------------------------------------------------------
                  Argument | Type             |  Mode  | Dimension
------------------------------------------------------------------
FUNCTION CURVDDP (T,       | Double precision | Input  |
                  N,       | Integer          | Input  |
                  X,       | Double precision | Input  | N
                  Y,       | Double precision | Input  | N
                  YP,      | Double precision | Input  | N
                  SIGMA)   | Double precision | Input  | 
------------------------------------------------------------------
T
The abscissa for which an interpolated function value is desired.
N
The number of input data values. (N > 1)
X
An array containing the abscissae for the input function.
Y
An array containing the functional values of the input function -- Y(K) is the functional value at X(K) for K=1,N.
YP
Contains values for the second derivative (as calculated by CURV1DP).
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

CURVIDP - integrate a spline curve

(Double precision version of CURVI)


This function calculates an integral between two specified limits. CURV1DP must be called prior to calling CURVIDP, and the values thus obtained used as input to CURVIDP. The value of the integral is returned.
------------------------------------------------------------------
                  Argument | Type             |  Mode  | Dimension
------------------------------------------------------------------
FUNCTION CURVIDP (XL,      | Double precision | Input  |
                  XU,      | Double precision | Input  |
                  N,       | Integer          | Input  |
                  X,       | Double precision | Input  | N
                  Y,       | Double precision | Input  | N
                  YP,      | Double precision | Input  | N
                  SIGMA)   | Double precision | Input  | 
------------------------------------------------------------------
XL
The lower limit of the integration.
XR
The upper limit of the integration.
N
The number of input data values. (N > 1)
X
An array containing the abscissae for the input function.
Y
An array containing the functional values of the input function -- Y(K) is the functional value at X(K) for K=1,N.
YP
Contains values for the second derivative (as calculated by CURV1DP).
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

CURVP1DP - calculate values for CURVP2DP usage

(Double precision version of CURVP1)


This subroutine calculates certain values that are used by CURVP2DP in order to compute an interpolatory spline under tension through a sequence of functional values for a periodic function. The actual computation of the interpolated values must be done using CURVP2DP.
---------------------------------------------------------------
               Argument | Type             |  Mode  | Dimension
---------------------------------------------------------------
CALL CURVP1DP (N,       | Integer          | Input  |
               X,       | Double precision | Input  | N
               Y,       | Double precision | Input  | N
               P,       | Double precision | Input  | 
               YP,      | Double precision | Output | N
               TEMP,    | Double precision | Input  | N x 2
               SIGMA,   | Double precision | Input  | 
               IER)     | Integer          | Output | 
---------------------------------------------------------------
N
The number of input data values. (N > 1)
X
An array containing the abscissae for the input function.
Y
An array containing the functional values of the input function -- Y(K) is the functional value at X(K) for K=1,N.
P
The period of the function. P must be greater than X(N)-X(1).
YP
Contains values for the second derivative (these are calculated by CURVP1DP).
TEMP
Scratch space.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.
IER
An error return value. If IER is returned as 0, then no errors were detected.
= 1 if N is less than 2.
= 2 if P is less than or equal to X(N)-X(1).
= 3 if the X values are not strictly increasing.

CURVP2DP - interpolate a periodic function at a specified point

(Double precision version of CURVP2)


This function interpolates a value at a specified point using a spline under tension. CURVP1DP must be called prior to calling CURVP2DP, and the values thus obtained used as input to CURVP2DP. The interpolated value is returned.
-------------------------------------------------------------------
                   Argument | Type             |  Mode  | Dimension
-------------------------------------------------------------------
FUNCTION CURVP2DP (T,       | Double precision | Input  |
                   N,       | Integer          | Input  |
                   X,       | Double precision | Input  | N
                   Y,       | Double precision | Input  | N
                   P,       | Double precision | Input  |
                   YP,      | Double precision | Input  | N
                   SIGMA)   | Double precision | Input  | 
-------------------------------------------------------------------
T
The abscissa for which an interpolated function value is desired.
N
The number of input data values. (N > 1)
X
An array containing the abscissae for the input function.
Y
An array containing the functional values for the input function -- Y(K) is the functional value at X(K) for K=1,N.
P
The period of the function.
YP
Contains values for the second derivative (as computed by CURVP1DP).
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

CURVPIDP - integrate a periodic spline curve

(Double precision version of CURVPI)


This function calculates an integral between two specified limits. CURVP1DP must be called prior to calling CURVPIDP, and the values thus obtained used as input to CURVPIDP. The value of the integral is returned.
------------------------------------------------------------------
                  Argument | Type             |  Mode  | Dimension
------------------------------------------------------------------
FUNCTION CURVIDP (XL,      | Double precision | Input  |
                  XU,      | Double precision | Input  |
                  N,       | Integer          | Input  |
                  X,       | Double precision | Input  | N
                  Y,       | Double precision | Input  | N
                  P,       | Double precision | Input  |
                  YP,      | Double precision | Input  | N
                  SIGMA)   | Double precision | Input  | 
------------------------------------------------------------------
XL
The lower limit of the integration.
XR
The upper limit of the integration.
N
The number of input data values. (N > 1)
X
An array containing the abscissae for the input function.
Y
An array containing the functional values of the input function -- Y(K) is the functional value at X(K) for K=1,N.
P
The period of the function.
YP
Contains values for the second derivative (as calculated by CURVP1DP).
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

CURVSDP - calculate values for a smoothing spline

(Double precision version of CURVS)


This subroutine calculates certain values that are used by CURV2DP in order to compute an interpolatory smoothing spline under tension through a sequence of functional values. The actual computation of the interpolated values must be done using CURV2DP.

Three parameters are used to control the degree of smoothness -- D, S, and EPS.

The parameter D is a value indicating the degree of confidence in the accuracy of the input function values -- it should be an approximation of the standard deviation of error. Effectively the value of D controls how close the smoothed curve comes to the input data points. If D is small then the interpolated curve will pass close to the input data. The larger the value of D, the more freedom the smooth curve has in how close it comes to the input data values.

S is a more subtle global smoothing parameter. S must be non-negative. For small values of S, the interpolated curve approximates the tension spline and for larger values of S, the curve is smoother. A reasonable value for EPS is REAL(N).

EPS controls the precision to which S is interpreted; EPS must be between 0. and 1. inclusive. A reasonable value for S is SQRT(2./REAL(N)).

--------------------------------------------------------------
              Argument | Type             |  Mode  | Dimension
--------------------------------------------------------------
CALL CURVSDP (N,       | Integer          | Input  |
              X,       | Double precision | Input  | N
              Y,       | Double precision | Input  | N
              D,       | Double precision | Input  | N 
              ISW,     | Integer          | Input  | 
              S,       | Double precision | Input  | 
              EPS,     | Double precision | Input  | 
              YS,      | Double precision | Output | N
              YSP,     | Double precision | Output | N
              SIGMA,   | Double precision | Input  | 
              TEMP,    | Double precision | Input  | N x 9
              IER)     | Integer          | Output | 
--------------------------------------------------------------
N
The number of input data values. (N > 1)
X
An array containing the abscissae for the input function.
Y
An array containing the functional values for the input function -- Y(K) is the functional value at X(K) for K=1,N.
D
A user-specified value containing the observed weights. D may be either an array or a scalar, depending on the value of ISW (as described below).
ISW
A switch for interpreting the value of D. If ISW=0, then D is an array of length N (D contains an individual error estimate for each input data value); if ISW=1, then D is a scalar that serves as an error estimate for every single data item.
S
Contains the value for smoothing. S must be non-negative. Larger values for S yield greater smoothing. A reasonable value is REAL(N).
EPS
Contains a tolerance value for the relative precision to which S should be interpreted. EPS must be between 0. and 1. inclusive. A reasonable value is SQRT(2./REAL(N)).
YS
An array of length N.
YSP
An array of length N.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.
TEMP
Scratch space.
IER
An error return value. If IER is returned as 0, then no errors were detected.
= 1 if N is less than 2.
= 2 if S is negative.
= 3 if EPS is negative or greater than 1.
= 4 if X values are not strictly increasing.
= 5 if D is negative.

CURVS1DP - calculate values for a smoothing spline in the plane to be used by CURVS2DP

(Double precision version of CURVS1)


This subroutine calculates certain values that are used by CURVS2DP in order to compute an interpolatory smoothing spline under tension through a sequence of functional values in the plane. The actual computation of the interpolated values must be done using CURVS2DP.

Three parameters are used to control the degree of smoothness -- D, S, and EPS.

The parameter D is a value indicating the degree of confidence in the accuracy of the input function values -- it should be an approximation of the standard deviation of error. Effectively the value of D controls how close the smoothed curve comes to the input data points. If D is small then the interpolated curve will pass close to the input data. The larger the value of D, the more freedom the smooth curve has in how close it comes to the input data values.

S is a more subtle global smoothing parameter. S must be non-negative. For small values of S, the interpolated curve approximates the tension spline and for larger values of S, the curve is smoother. A reasonable value for EPS is REAL(N).

EPS controls the precision to which S is interpreted; EPS must be between 0. and 1. inclusive. A reasonable value for S is SQRT(2./REAL(N)).

---------------------------------------------------------------
               Argument | Type             |  Mode  | Dimension
---------------------------------------------------------------
CALL CURVS1DP (N,       | Integer          | Input  | 
               X,       | Double precision | Input  | N
               Y,       | Double precision | Input  | N
               D,       | Double precision | Input  | N or 1 (see desc.)
               ISW,     | Integer          | Input  | 
               S,       | Double precision | Input  | 
               EPS,     | Double precision | Input  | 
               PARAM,   | Double precision | Output | N
               XS,      | Double precision | Output | N
               YS,      | Double precision | Output | N
               XSP,     | Double precision | Output | N
               YSP,     | Double precision | Output | N
               SIGMA,   | Double precision | Input  | 
               TEMP,    | Double precision | Input  | N x 19
               IER)     | Integer          | Output | 
---------------------------------------------------------------
N
The number of input data values. (N > 1)
X
An array containing the X-coordinates for the input data. These need not be increasing.
Y
An array containing the Y-coordinates for the input data.
D
A user-specified value containing the observed weights. D may be either an array or a scalar, depending on the value of ISW (as described below). D effectively controls how close the interpolated curve will come to the input points.
ISW
A switch for interpreting the value of D. If ISW=0, then D is an array of length N (D contains an individual error estimate for each input data value); if ISW=1, then D is a scalar that serves as an error estimate for every single data item.
S
Contains the value for smoothing. S must be non-negative. Larger values for S yield greater smoothing. A reasonable value is REAL(N).
EPS
Contains a tolerance value for the relative precision to which S should be interpreted. EPS must be between 0. and 1. inclusive. A reasonable value is SQRT(2./REAL(N)).
XS
An array of length N, contains the smoothed values.
YS
An array of length N, contains the smoothed values.
XSP
An array of length N. Contains second derivative information for the X-coordinate values.
YSP
An array of length N. Contains second derivative information for the Y-coordinate values.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.
TEMP
Scratch space.
IER
An error return value. If IER is returned as 0, then no errors were detected.
= 1 if N is less than 2.
= 2 if S is negative.
= 3 if EPS is negative or greater than 1.
= 4 if X values are not strictly increasing.
= 5 if D is negative.

CURVS2DP - calculate values for a smoothing spline in the plane

(Double precision version of CURVS2)


This subroutine is a companion to CURV1SDP which must be called before calling this subroutine. CURV2SDP calculates an interpolated value for a smoothing spline under tension at a given point.

---------------------------------------------------------------
               Argument | Type             |  Mode  | Dimension
---------------------------------------------------------------
CALL CURVS2DP (T,       | Double precision | Input  | 
               N,       | Integer          | Input  |
               PARAM,   | Double precision | Input  | N
               X,       | Double precision | Input  | N
               Y,       | Double precision | Input  | N
               XP,      | Double precision | Input  | N
               YP,      | Double precision | Input  | N
               SIGMA,   | Double precision | Input  | 
               XO,      | Double precision | Output | 
               YO)      | Double precision | Output |
---------------------------------------------------------------
T
A real value to be mapped onto the interpolating curve. Values of T between zero and one interpolate the original data; any values of T outside this range result in extrapolation.
N
The number of points which were specified to determine the curve in CURVS1DP.
PARAM
The arc lengths as computed by CURVS1DP.
X
An array containing the X-coordinates for the input data as input to CURVS1DP. These need not be increasing.
Y
An array containing the Y-coordinates for the input data as input to CURVS1DP.
XP
An array of second derivative values as calculated by CURVS1DP.
YP
An array of second derivative values as calculated by CURVS1DP.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.
XO
The interpolated X value.
YO
The interpolated Y value.

CURVPSDP - calculate values for a smoothing spline

(Double precision version of CURVPS)


This subroutine calculates certain values that are used by CURVP2DP in order to compute an interpolatory smoothing spline under tension through a sequence of functional values for a periodic function. The actual computation of the interpolated values must be done using CURVP2DP.

Three parameters are used to control the degree of smoothness -- D, S, and EPS.

The parameter D is a value indicating the degree of confidence in the accuracy of the input function values -- it should be an approximation of the standard deviation of error. Effectively the value of D controls how close the smoothed curve comes to the input data points. If D is small then the interpolated curve will pass close to the input data. The larger the value of D, the more freedom the smooth curve has in how close it comes to the input data values.

S is a more subtle global smoothing parameter. S must be non-negative. For small values of S, the curve approximates the tension spline and for larger values of S, the curve is smoother. A reasonable value for S is REAL(N).

EPS controls the precision to which S is interpreted; EPS must be between 0. and 1. inclusive. A reasonable value for EPS is SQRT(2./REAL(N)).

---------------------------------------------------------------
               Argument | Type             |  Mode  | Dimension
---------------------------------------------------------------
CALL CURVPSDP (N,       | Integer          | Input  |
               X,       | Double precision | Input  | N
               Y,       | Double precision | Input  | N
               P,       | Double precision | Input  |
               D,       | Double precision | Input  | N 
               ISW,     | Integer          | Input  | 
               S,       | Double precision | Input  | 
               EPS,     | Double precision | Input  | 
               YS,      | Double precision | Output | N
               YSP,     | Double precision | Output | N
               SIGMA,   | Double precision | Input  | 
               TEMP,    | Double precision | Input  | N x 11
               IER)     | Integer          | Output | 
---------------------------------------------------------------
N
The number of input data values. (N > 1)
X
An array containing the abscissae for the input function.
Y
An array containing the functional values of the input function -- Y(K) is the functional value at X(K) for K=1,N.
P
The period of the function. P must be greater than X(N)-X(1).
D
A user-specified value containing the observed weights. D may either be an array or a scalar, depending on the value of ISW.
ISW
A switch for interpreting the value of D. If ISW=0, then D is an array of length N (an error estimate for each input data value); if ISW=1, then D is a scalar that serves as an error estimate for every single data item.
S
Contains the value for smoothing. S must be non-negative. Larger values for S yield greater smoothing. A reasonable value is REAL(N).
EPS
Contains a tolerance value for the relative precision to which S should be interpreted. EPS must be between 0. and 1. inclusive. A reasonable value is SQRT(2./REAL(N)).
YS
An array of length N.
YSP
An array of length N.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.
TEMP
Scratch space.
IER
An error return value. If IER is returned as 0, then no errors were detected.
= 1 if N is less than 2.
= 2 if S is negative.
= 3 if EPS is negative or greater than 1.
= 4 if X values are not strictly increasing.
= 5 if D is negative.
= 6 if P is less than or equal to X(N)-X(1).

KURV1DP - calculate values for KURV2 usage

(Double precision version of KURV1)


This subroutine calculates certain values that are used by KURV2DP in order to compute an interpolatory spline under tension through a sequence of points in the plane. The actual computation of the interpolated values must be done using KURV2DP.
--------------------------------------------------------------
              Argument | Type             |  Mode  | Dimension
--------------------------------------------------------------
CALL KURV1DP (N,       | Integer          | Input  |
              X,       | Double precision | Input  | N
              Y,       | Double precision | Input  | N
              SLP1,    | Double precision | Input  | 
              SLPN,    | Double precision | Input  | 
              ISLPSW,  | Integer          | Input  |
              XP,      | Double precision | Output | N
              YP,      | Double precision | Output | N
              TEMP,    | Double precision | Input  | N
              S,       | Double precision | Output | N
              SIGMA,   | Double precision | Input  | 
              IER)     | Integer          | Output | 
--------------------------------------------------------------
N
The number of input data values. (N > 1)
X
An array containing the X values of the points.
Y
An array containing the Y values of the points. Adjacent pairs of points must be distinct.
SLP1
A value (in radians) containing the slope at (X(1),Y(1)). The angles are measured counter-clockwise from the X axis and the positive sense of the curve is assumed to be that moving from point 1 to point N. A value for SLP1 may be omitted as indicated by the switch ISLPSW.
SLPN
A value (in radians) containing the slope at (X(N),Y(N)). The angles are measured counter-clockwise from the X axis and the positive sense of the curve is assumed to be that moving from point 1 to point N. A value for SLP2 may be omitted as indicated by the switch ISLPSW.
ISLPSW
A switch to indicate whether the slopes at the end points should be calculated internally.
= 0 if SLP1 and SLPN are user-specified.
= 1 if SLP1 is user-specified, but SLPN calculated internally.
= 2 if SLPN is user-specified, but SLP1 calculated internally.
= 3 if SLP1 and SLPN are internally calculated.
XP
An array of length N.
YP
An array of length N.
TEMP
Scratch space.
S
An array of length N. On output, S contains the polygonal arclengths of the curve.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.
IER
An error return value. If IER is returned as 0, then no errors were detected.
= 1 if N is less than 2.
= 2 if a pair of adjacent points coincide.

KURV2DP - does interpolation for parametric curves

(Double precision version of KURV2)


The interpolated curve is parameterized by mapping points in the interval [0.,1.] onto the interpolated curve. The resulting curve has a parametric representation both of whose components are splines under tension and functions of the polygonal arc length. The value 0. is mapped onto (X[1],Y[1]) and the value 1. is mapped onto (X[N],Y[N]). KURV1DP must be called before calling KURV2DP.
--------------------------------------------------------------
              Argument | Type             |  Mode  | Dimension
--------------------------------------------------------------
CALL KURV2DP (T,       | Double precision | Input  |
              XS,      | Double precision | Output |
              YS,      | Double precision | Output |
              N,       | Integer          | Input  |
              X,       | Double precision | Input  | N
              Y,       | Double precision | Input  | N
              XP,      | Double precision | Input  | N
              YP,      | Double precision | Input  | N
              S,       | Double precision | Input  | N
              SIGMA)   | Double precision | Input  | 
--------------------------------------------------------------
T
A value to be mapped to a point on the curve. The interval [0.,1.] is mapped onto the curve such that 0. is mapped to (X(1),Y(1)) and 1. is mapped to (X(N),Y(N)). Values outside of [0.,1.] result in extrapolation.
XS
Contains the X coordinate of the interpolated point that T maps to.
YS
Contains the Y coordinate of the interpolated point that T maps to.
N
The number of input data points. (N > 1)
X
An array containing the X values of the input points.
Y
An array containing the Y values of the input points. Adjacent pairs of points must be distinct.
XP
An array of length N as computed by KURV1DP.
YP
An array of length N as computed by KURV1DP.
S
An array of length N containing the polygonal arc lengths of the curve.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

KURVDDP - interpolation and derivatives for parametric curves

(Double precision version of KURVD)


This subroutine behaves like KURV2DP except that in addition it returns the first and second derivatives of the component functions in the parameterization. The interval [0.,1.] maps onto a curve in the plane. The resulting curve has a parametric representation both of whose components are splines under tension and functions of the polygonal arc length. KURV1DP must be called before calling KURVDDP.
--------------------------------------------------------------
              Argument | Type             |  Mode  | Dimension
--------------------------------------------------------------
CALL KURVDDP (T,       | Double precision | Input  |
              XS,      | Double precision | Output |
              YS,      | Double precision | Output |
              XST,     | Double precision | Output |
              YST,     | Double precision | Output |
              XSTT,    | Double precision | Output |
              YSTT,    | Double precision | Output |
              N,       | Integer          | Input  |
              X,       | Double precision | Input  | N
              Y,       | Double precision | Input  | N
              XP,      | Double precision | Input  | N
              YP,      | Double precision | Input  | N
              S,       | Double precision | Input  | N
              SIGMA)   | Double precision | Input  | 
--------------------------------------------------------------
T
A value to be mapped to a point on the curve. The interval [0.,1.] is mapped onto the curve such that 0. is mapped to (X(1),Y(1)) and 1. is mapped to (X(N),Y(N)). Values outside of [0.,1.] result in extrapolation.
XS
Contains the X coordinate of the point that T maps to.
YS
Contains the Y coordinate of the point that T maps to.
XST
Contains the first derivatives of the X component with respect to T.
YST
Contains the first derivatives of the Y component with respect to T.
XSTT
Contains the second derivatives of the X component with respect to T.
YSTT
Contains the second derivatives of the X component with respect to T.
N
The number of input data points. (N > 1)
X
An array containing the X values of the input points.
Y
An array containing the Y values of the input points. Adjacent pairs of points must be distinct.
XP
An array of length N as computed by KURV1DP.
YP
An array of length N as computed by KURV1DP.
S
An array of length N containing the polygonal arc lengths of the curve, as computed by KURV1DP.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

KURVP1DP - calculate values for KURVP2 usage

(Double precision version of KURVP1)


This subroutine calculates certain values that are used by KURVP2DP in order to compute an interpolatory spline under tension through a sequence of points in the plane that form a closed curve. The actual computation of the interpolated values must be done using KURVP2DP.
---------------------------------------------------------------
               Argument | Type             |  Mode  | Dimension
---------------------------------------------------------------
CALL KURVP1DP (N,       | Integer          | Input  |
               X,       | Double precision | Input  | N
               Y,       | Double precision | Input  | N
               XP,      | Double precision | Output | N
               YP,      | Double precision | Output | N
               TEMP,    | Double precision | Input  | N x 2
               S,       | Double precision | Output | N
               SIGMA,   | Double precision | Input  | 
               IER)     | Integer          | Output | 
---------------------------------------------------------------
N
The number of input data points. (N > 1)
X
An array containing the X values of the points.
Y
An array containing the Y values of the points. Adjacent pairs of points must be distinct.
XP
An array of length N.
YP
An array of length N.
TEMP
Scratch space.
S
An array of length N.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.
IER
An error return value. If IER is returned as 0, then no errors were detected.
= 1 if N is less than 2.
= 2 if a pair of adjacent points coincide.

KURVP2DP - does interpolation for closed parametric curves

(Double precision version of KURVP2)


The interpolated curve is parameterized by mapping points in the interval [0.,1.] onto an interpolated closed curve. The resulting curve has a parametric representation both of whose components are splines under tension and functions of the polygonal arc length. The value 0. is mapped onto (X[1],Y[1]) and the value 1. is also mapped onto (X[1],Y[1]), since the interpolated curve is closed. KURVP1DP must be called before calling KURVP2DP.
---------------------------------------------------------------
               Argument | Type             |  Mode  | Dimension
---------------------------------------------------------------
CALL KURVP2DP (T,       | Double precision | Input  |
               XS,      | Double precision | Output |
               YS,      | Double precision | Output |
               N,       | Integer          | Input  |
               X,       | Double precision | Input  | N
               Y,       | Double precision | Input  | N
               XP,      | Double precision | Input  | N
               YP,      | Double precision | Input  | N
               S,       | Double precision | Input  | N
               SIGMA)   | Double precision | Input  | 
---------------------------------------------------------------
T
A value to be mapped to a point on the curve. The interval [0.,1.] is mapped onto the curve such that 0. is mapped to (X(1),Y(1)) and 1. is mapped to (X(1),Y(1)), since the interpolated curve is closed. Any interval [TT,TT+1.] maps onto the entire curve.
XS
Contains the X coordinate of the point that T maps to.
YS
Contains the Y coordinate of the point that T maps to.
N
The number of input data points. (N > 1)
X
An array containing the X values of the points.
Y
An array containing the Y values of the points. Adjacent pairs of points must be distinct.
XP
An array of length N as computed by KURV1DP.
YP
An array of length N as computed by KURV1DP.
S
An array of length N containing the polygonal arc lengths of the curve, as computed by KURV1DP.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

KURVPDDP - interpolation and derivatives for closed parametric curves

(Double precision version of KURVPD)


This subroutine behaves like KURVP2DP except that in addition it returns the first and second derivatives of the component functions in the parameterization. The interval [0.,1.] maps onto a closed curve in the plane. The resulting curve has a parametric representation both of whose components are splines under tension and functions of the polygonal arc length. KURVP1DP must be called before calling KURVPDDP.
---------------------------------------------------------------
               Argument | Type             |  Mode  | Dimension
---------------------------------------------------------------
CALL KURVPDDP (T,       | Double precision | Input  |
               XS,      | Double precision | Output |
               YS,      | Double precision | Output |
               XST,     | Double precision | Output |
               YST,     | Double precision | Output |
               XSTT,    | Double precision | Output |
               YSTT,    | Double precision | Output |
               N,       | Integer          | Input  |
               X,       | Double precision | Input  | N
               Y,       | Double precision | Input  | N
               XP,      | Double precision | Input  | N
               YP,      | Double precision | Input  | N
               S,       | Double precision | Input  | N
               SIGMA)   | Double precision | Input  | 
---------------------------------------------------------------
T
A value to be mapped to a point on the curve. The interval [0.,1.] is mapped onto the curve such that 0. is mapped to (X(1),Y(1)) and 1. is mapped to (X(1),Y(1)). Any interval [TT,TT+1.] maps onto the entire closed curve.
XS
Contains the X coordinate of the point that T maps to.
YS
Contains the Y coordinate of the point that T maps to.
XST
Contains the first derivatives of the X component with respect to T.
YST
Contains the first derivatives of the Y component with respect to T.
XSTT
Contains the second derivatives of the X component with respect to T.
YSTT
Contains the second derivatives of the X component with respect to T.
N
The number of input data points. (N > 1)
X
An array containing the X values of the input points.
Y
An array containing the Y values of the input points. Adjacent pairs of points must be distinct.
XP
An array of length N as computed by KURVP1DP.
YP
An array of length N as computed by KURVP1DP.
S
An array of length N containing the polygonal arc lengths of the curve, as computed by KURVP1DP.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

SURF1DP - calculate values for SURF2DP usage

(Double precision version of SURF1)


This subroutine calculates certain values that are used by SURF2DP in order to compute an interpolatory surface passing through a rectangular grid of function values. The surface computed is a tensor product of splines under tension. To calculate actual interpolated values, SURF2DP must be called.
--------------------------------------------------------------
              Argument | Type             |  Mode  | Dimension
--------------------------------------------------------------
CALL SURF1DP (M,       | Integer          | Input  |
              N,       | Integer          | Input  |
              X,       | Double precision | Input  | M
              Y,       | Double precision | Input  | N
              Z,       | Double precision | Input  | IZ x N
              IZ,      | Integer          | Input  |  
              ZX1,     | Double precision | Input  | N
              ZXM,     | Double precision | Input  | N
              ZY1,     | Double precision | Input  | M
              ZYN,     | Double precision | Input  | M
              ZXY11,   | Double precision | Input  | 
              ZXYM1,   | Double precision | Input  | 
              ZXY1N,   | Double precision | Input  | 
              ZXYMN,   | Double precision | Input  | 
              ISLPSW,  | Integer          | Input  |
              ZP,      | Double precision | Output | M x N x 3
              TEMP,    | Double precision | Input  | N + N + M
              SIGMA,   | Double precision | Input  | 
              IER)     | Integer          | Output | 
--------------------------------------------------------------
M
The number of grid lines in the X direction. (M > 1)
N
The number of grid lines in the Y direction. (N > 1)
X
An array containing M X coordinates for grid lines in the X direction. These values must be strictly increasing.
Y
An array containing N Y coordinates for grid lines in the Y direction. These values must be strictly increasing.
Z
An array containing M x N functional values at the grid points; Z(I,J) contains the functional value at (X(I),Y(J)) for I=1,M and J=1,N.
IZ
The row dimension of the matrix Z (IZ is greater than or equal to M).
ZX1
An array containing N X-partial derivatives of the function along the line X(1), that is ZX1(J) is the X-partial derivative at point (X(1),Y(J)) for J=1,N. This parameter may be defaulted by setting ISLPSW appropriately.
ZXM
An array containing N X-partial derivatives of the function along the line X(M), that is ZXM(J) is the X-partial derivative at point (X(M),Y(J)) for J=1,N. This parameter may be defaulted by setting ISLPSW appropriately.
ZY1
An array containing M Y-partial derivatives of the function along the line Y(1), that is ZY1(I) is the Y-partial derivative at point (X(I),Y(1)) for I=1,M. This parameter may be defaulted by setting ISLPSW appropriately.
ZYN
An array containing M Y-partial derivatives of the function along the line Y(N), that is ZY1(I) is the Y-partial derivative at point (X(I),Y(N)) for I=1,M. This parameter may be defaulted by setting ISLPSW appropriately.
ZXY11
The X-Y-partial derivative at (X(1),Y(1). This parameter may be defaulted by setting ISLPSW appropriately.
ZXYM1
The X-Y-partial derivative at (X(M),Y(1). This parameter may be defaulted by setting ISLPSW appropriately.
ZXY1N
The X-Y-partial derivative at (X(1),Y(N). This parameter may be defaulted by setting ISLPSW appropriately.
ZXYMN
The X-Y-partial derivative at (X(M),Y(N). This parameter may be defaulted by setting ISLPSW appropriately.
ISLPSW
A switch to indicate which boundary derivatives are user supplied and which should be estimated internally. Where

I1 = 0 if ZX1 is user-supplied and 1 otherwise.
I2 = 0 if ZXM is user-supplied and 1 otherwise.
I3 = 0 if ZY1 is user-supplied and 1 otherwise.
I4 = 0 if ZYN is user-supplied and 1 otherwise.
I5 = 0 if ZXY11 is user-supplied and 1 otherwise.
I6 = 0 if ZXYM1 is user-supplied and 1 otherwise.
I7 = 0 if ZXY1N is user-supplied and 1 otherwise.
I8 = 0 if ZXYMN is user-supplied and 1 otherwise.

set ISLPSW = I1 + 2*I2 + 4*I3 +8*I4 +16*I5 +32*I6 + 64*I7 + 128*I8. Then, for example, if ISLPSW=0, then all derivative information is user-supplied and if ISLPSW=255, then all derivative information is to be internally estimated.

ZP
An array of size M x N x 3. On output this contains partial derivatives of the surface at the given nodes. ZP is used by SURF2DP.
TEMP
Scratch space.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.
IER
An error return value. If IER is returned as 0, then no errors were detected.
= 1 if N is less than 2.
= 2 if X or Y values are not strictly increasing.

SURF2DP - 2D interpolation for gridded data

(Double precision version of SURF2)


This function interpolates a surface value at a specified coordinate using bi-splines under tension. SURF1DP must be called before invoking SURF2DP. The desired interpolated value is returned as the value of the function.
------------------------------------------------------------------
                  Argument | Type             |  Mode  | Dimension
------------------------------------------------------------------
FUNCTION SURF2DP (XX,      | Double precision | Input  |
                  YY,      | Double precision | Input  |
                  M,       | Integer          | Input  |
                  N,       | Integer          | Input  |
                  X,       | Double precision | Input  | M
                  Y,       | Double precision | Input  | N
                  Z,       | Double precision | Input  | IZ x N
                  IZ,      | Integer          | Input  |  
                  ZP,      | Double precision | Input  | M x N x 3
                  SIGMA)   | Double precision | Input  | 
------------------------------------------------------------------
XX
Contains the X coordinate of a point to be mapped onto the interpolated surface.
YY
Contains the Y coordinate of a point to be mapped onto the interpolated surface.
M
The number of grid lines in the X direction. (M > 1)
N
The number of grid lines in the Y direction. (N > 1)
X
An array containing M X coordinates for grid lines in the X direction. These values must be strictly increasing.
Y
An array containing N Y coordinates for grid lines in the Y direction. These values must be strictly increasing.
Z
An array containing M x N functional values at the grid points; Z(I,J) contains the functional value at (X(I),Y(J)) for I=1,M and J=1,N.
IZ
The row dimension of the matrix Z (IZ is greater than or equal to M).
ZP
An array of size M x N x 3.
SIGMA
Tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. Values of SIGMA larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

c_ftcurv - 1D interpolation for non-periodic functions


This function calculates an interpolatory spline under tension through a sequence of functional values.

c_ftcurv is called after all of the desired values for control parameters have been set using the procedures c_ftseti, c_ftsetr, c_ftsetrd, c_ftsetc. Control parameters that apply to c_ftcurv are: sig, sl1, sln, sf1.

The value for the parameter sig specifies the tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. (the default). Values of sig larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

The values for sl1 and sln specify the slope of the curve at the first point and last point, respectively.

The value of sf1 controls whether to use the values for sl1 and sln, or compute those values internally. Specifically, sf1

= 0 if sl1 and sln are user-specified.
= 1 if sl1 is user-specified, but sln is internally calculated.
= 2 if sln is user-specified, but sl1 is internally calculated.
= 3 if sl1 and sln are internally calculated.
By default the slopes at the end points are computed internally.

Function prototype:

  int c_ftcurv (int, float [], float [], int, float [], float []);
Return value:

c_ftcurv returns an error value as per:

= 0 -- no error.
= 1 -- if n is less than 2.
= 2 -- if X values are not strictly increasing.

Argument description:

-------------------------------------------------
              Argument | Type     |  Size
-------------------------------------------------
int c_ftcurv (n,       | int      |
              xi,      | float [] | n
              yi,      | float [] | n
              m,       | int      | 
              xo,      | float [] | m
              yo       | float [] | m
             );
-------------------------------------------------
n
The number of input data points. (n > 1)
xi
An array containing the abscissae for the input function.
yi
An array containing the functional values of the input function -- yi[k] is the functional value at xi[k] for k=0,n-1.
m
The number of desired interpolated values.
xo
An array of length m containing the abscissae for the interpolated values.
yo
An array containing the interpolated functional values -- yo[k] is the functional value at xo[k] for k=0,m-1.

c_ftcurvd - calculate derivatives


This function calculates the derivatives of an interpolatory spline under tension.

c_ftcurvd is called after all of the desired values for control parameters have been set using the procedures c_ftseti, c_ftsetr, c_ftsetrd, c_ftsetc. Control parameters that apply to c_ftcurvd are: sig, sl1, sln, sf1.

The value for the parameter sig specifies the tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. (the default). Values of sig larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

The values for sl1 and sln specify the slope of the curve at the first point and last point, respectively.

The value of sf1 controls whether to use the values for sl1 and sln, or compute those values internally. Specifically, sf1

= 0 if sl1 and sln are user-specified.
= 1 if sl1 is user-specified, but sln is internally calculated.
= 2 if sln is user-specified, but sl1 is internally calculated.
= 3 if sl1 and sln are internally calculated.
By default the slopes at the end points are computed internally.

Function prototype:

  int c_ftcurvd (int, float [], float [], int, float [], float []);
Return value:

c_ftcurvd returns an error value as per:

= 0 -- no error.
= 1 -- if N is less than 2.
= 2 -- if X values are not strictly increasing.

Argument description:

-------------------------------------------------
               Argument | Type     |  Size
-------------------------------------------------
int c_ftcurvd (n,       | int      |
               xi,      | float [] | n
               yi,      | float [] | n
               m,       | int      | 
               xo,      | float [] | m
               yo       | float [] | m
              );
-------------------------------------------------
n
The number of input data points. (n > 1)
xi
An array containing the abscissae for the input function.
yi
An array containing the functional values (y[k] is the functional value at x[k] for k=0,n).
m
The number of desired derivatives.
xo
An array containing the abscissae for the output points.
yo
An array containing the interpolated derivative values -- yo[k] is the functional derivative at xo[k] for k=0,n.

c_ftcurvi - calculate integrals


This function calculates integrals of an interpolatory spline under tension between two user-specified limits.

c_ftcurvi is called after all of the desired values for control parameters have been set using the procedures c_ftseti, c_ftsetr, c_ftsetrd, c_ftsetc. Control parameters that apply to c_ftcurvd are: sig, sl1, sln, sf1.

The value for the parameter sig specifies the tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. (the default). Values of sig larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

The values for sl1 and sln specify the slope of the curve at the first point and last point, respectively.

The value of sf1 controls whether to use the values for sl1 and sln, or compute those values internally. Specifically, sf1

= 0 if sl1 and sln are user-specified.
= 1 if sl1 is user-specified, but sln is internally calculated.
= 2 if sln is user-specified, but sl1 is internally calculated.
= 3 if sl1 and sln are internally calculated.
By default the slopes at the end points are computed internally.

Function prototype:

  int c_ftcurvi (float, float, int, float [], float [], float *);
Return value:

c_ftcurvi returns an error value as per:

= 0 -- no error.
= 1 -- if n is less than 2.
= 2 -- if X values are not strictly increasing.

Argument description:

-------------------------------------------------
               Argument | Type     |  Size
-------------------------------------------------
int c_ftcurvi (xl,      | float    |
               xr,      | float    |
               n,       | int      | 
               xi,      | float [] | n
               yi,      | float [] | n
               integral | float *  | 
              );
-------------------------------------------------
xl
The lower limit of the integration.
xr
The upper limit of the integration.
n
The number of input data points. (N > 1)
xi
An array containing the abscissae for the input function.
yi
An array containing the functional values of the input function (y[k] is the functional value at x[k] for k=0,n).
integral
The integral of the function from xl to xr is given by *integral.

c_ftcurvp - 1D interpolation for periodic functions


This function calculates an interpolatory spline under tension through a sequence of functional values for a periodic function.

c_ftcurvp is called after all of the desired values for control parameters have been set using the procedures c_ftseti, c_ftsetr, c_ftsetrd, c_ftsetc. The only control parameter that applies to c_ftcurvp is: sig.

The value for the parameter sig specifies the tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. (the default). Values of sig larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

Function prototype:

  int c_ftcurvp (int, float [], float [], float, int, float [], float []);
Return value:

c_ftcurvp returns an error value as per:

= 0 -- no error.
= 1 -- if n is less than 2.
= 2 -- if the period is strictly less than the span of the abscissae.

Argument description:

-------------------------------------------------
               Argument | Type     |  Size
-------------------------------------------------
int c_ftcurvp (n,       | int      |
               xi,      | float [] | n
               yi,      | float [] | n
               p,       | float    |
               m,       | int      | 
               xo,      | float [] | m
               yo       | float [] | m
              );
-------------------------------------------------
n
The number of input data points. (n > 1)
xi
An array containing the abscissae for the input function.
yi
An array containing the input functional values (y[k] is the functional value at x[k] for k=0,n).
p
The period of the function; p must not be less than xi[n-1] - xi[0].
m
The number of desired interpolated points.
xo
An array containing the abscissae for the interpolated values.
yo
An array containing the interpolated functional values (yo[k] is the functional value at xo[k] for k=0,n).

c_ftcurvpi - calculate integrals for periodic functions


This function calculates an integral between two specified points.

c_ftcurvpi is called after all of the desired values for control parameters have been set using the procedures c_ftseti, c_ftsetr, c_ftsetrd, c_ftsetc. The only control parameter that applies to c_ftcurvpi is: sig.

The value for the parameter sig specifies the tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. (the default). Values of sig larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

Function prototype:

  int c_ftcurvpi (float, float, float, int, float [], float [], float *);
Return value:

c_ftcurpi returns an error value as per:

= 0 -- no error.
= 1 -- if n is less than 2.
= 2 -- if the period is strictly less than the span of the abscissae.

Argument description:

-------------------------------------------------
                Argument | Type     |  Size
-------------------------------------------------
int c_ftcurvpi (xl,      | float    |
                xr,      | float    |
                p,       | float    |
                m,       | int      | 
                xi,      | float [] | m
                yi,      | float [] | m
                integral | float *  |
               );
-------------------------------------------------
xl
The lower limit of the integration.
xr
The upper limit of the integration.
p
The period of the function; p must not be less than xi[n-1] - xi[0].
m
The number of input points.
xi
An array containing the abscissae for the input points.
yi
An array containing the values of the input points (yi[k] is the functional value at xi[k] for k=0,m-1).
integral
The desired integral value is returned in *integral.

c_ftcurvs - smoothing spline


This function computes an interpolatory smoothing spline under tension through a sequence of functional values.

Two parameters and one function argument used to control the degree of smoothness -- the parameters are smt, and eps and the function argument is d.

The argument d is a value indicating the degree of confidence in the accuracy of the input function values -- it should be an approximation of the standard deviation of error. Effectively the value of d controls how close the smoothed curve comes to the input data points. If d is small, then the interpolated curve will pass close to the input data. The larger the value of d, the more freedom the smooth curve has in how close it comes to the input data values.

The parameter smt is a more subtle global smoothing parameter; smt must be non-negative. For small values of smt, the curve approximates the tension spline and for larger values of smt, the curve is smoother. A reasonable value for smt is (float) n.

The parameter eps controls the precision to which smt is interpreted; eps must be between 0. and 1. inclusive. A reasonable value for eps is sqrt( 2./(float) n ).

c_ftcurvs is called after all of the desired values for control parameters have been set using the procedures c_ftseti, c_ftsetr, c_ftsetrd, c_ftsetc. Control parameters that apply to c_ftcurvs are: sig, smt, eps, sf2.

The value for the parameter sig specifies the tension factor. Values near zero result in a cubic spline; large values (e.g. 30) result in nearly a polygonal line. A typical value is 1. (the default). Values of sig larger than about 40. can result in an internal floating point overflow on 32-bit machines, so you should keep SIGMA below that number on such machines.

Function prototype:

   int c_ftcurvs (int, float [], float [], int, float [], int, 
                  float [], float []);
Return value:

c_ftcurvs returns an error value as per:

= 1 if N is less than 2.
= 2 if smt is negative.
= 3 if eps is negative or greater than 1.
= 4 if X values are not strictly increasing.
= 5 if d is negative.

Argument description:

--------------------------------------------------------------
               Argument | Type     |  Size
--------------------------------------------------------------
int c_ftcurvs (n,       | int      |
               xi,      | float [] | n
               yi,      | float [] | n
               dflg,    | int      |
               d,       | float [] | n
               m,       | int      |  
               xo,      | float [] | m
               yo       | float [] | m
              );
--------------------------------------------------------------
n
The number of input data points. (n > 1)
xi
An array containing the abscissae for the input function.
yi
An array containing the functional values of the input function (yi[k] is the functional value at x[k] for k=0,n-1).
dflg
A switch for interpreting the value of d (as described below). If dflg=0, then d is an array of length n (an error estimate for each input data value); if dflg=1, then d is a scalar that serves as an error estimate for every single data item.
d
A user-specified value containing the observed weights. d may either be an array or a scalar, depending on the value of dflg.
m
The number of output values.
xo
Contains the abscissae for the output values.
yo
Contains the functional values for the smoothing spline ((yo[k] is the functional value at xo[k] for k=0,n-1).

c_ftcurvs1 - calculate values for a smoothing spline for data in the plane.


This function computes an interpolatory smoothing spline under tension through a sequence of values in the plane.

Two parameters and one function argument are used to control the degree of smoothness -- the parameters are smt, and eps and the function argument is d.

The argument d is a value indicating the degree of confidence in the accuracy of the input function values -- it should be an approximation of the standard deviation of error. Effectively the value of d controls how close the smoothed curve comes to the input data points. If d is small, then the interpolated curve will pass close to the input data. The larger the value of d, the more freedom the smooth curve has in how close it comes to the input data values.

The parameter smt is a more subtle global smoothing parameter; smt must be non-negative. For small values of smt, the curve approximates the tension spline and for larger values of smt, the curve is smoother.