bspline_sub_module Module

Description

Multidimensional (1D-6D) B-spline interpolation of data on a regular grid. Basic pure subroutine interface.

Notes

This module is based on the B-spline and spline routines from [1]. The original Fortran 77 routines were converted to free-form source. Some of them are relatively unchanged from the originals, but some have been extensively refactored. In addition, new routines for 1d, 4d, 5d, and 6d interpolation were also created (these are simply extensions of the same algorithm into higher dimensions).

See also

References

  1. DBSPLIN and DTENSBS from the NIST Core Math Library. Original code is public domain.
  2. Carl de Boor, "A Practical Guide to Splines", Springer-Verlag, New York, 1978.
  3. Carl de Boor, Efficient Computer Manipulation of Tensor Products, ACM Transactions on Mathematical Software, Vol. 5 (1979), p. 173-182.
  4. D.E. Amos, "Computation with Splines and B-Splines", SAND78-1968, Sandia Laboratories, March, 1979.
  5. Carl de Boor, Package for calculating with B-splines, SIAM Journal on Numerical Analysis 14, 3 (June 1977), p. 441-472.
  6. D.E. Amos, "Quadrature subroutines for splines and B-splines", Report SAND79-1825, Sandia Laboratories, December 1979.

Uses

  • module~~bspline_sub_module~~UsesGraph module~bspline_sub_module bspline_sub_module iso_fortran_env iso_fortran_env module~bspline_sub_module->iso_fortran_env module~bspline_kinds_module bspline_kinds_module module~bspline_sub_module->module~bspline_kinds_module module~bspline_kinds_module->iso_fortran_env

Used by

  • module~~bspline_sub_module~~UsedByGraph module~bspline_sub_module bspline_sub_module module~bspline_module bspline_module module~bspline_module->module~bspline_sub_module module~bspline_oo_module bspline_oo_module module~bspline_module->module~bspline_oo_module module~bspline_oo_module->module~bspline_sub_module

Variables

Type Visibility Attributes Name Initial
integer(kind=ip), public, parameter :: bspline_order_linear = 2_ip

spline order k parameter (for input to the db*ink routines) [order = polynomial degree + 1]

integer(kind=ip), public, parameter :: bspline_order_quadratic = 3_ip

spline order k parameter (for input to the db*ink routines) [order = polynomial degree + 1]

integer(kind=ip), public, parameter :: bspline_order_cubic = 4_ip

spline order k parameter (for input to the db*ink routines) [order = polynomial degree + 1]

integer(kind=ip), public, parameter :: bspline_order_quartic = 5_ip

spline order k parameter (for input to the db*ink routines) [order = polynomial degree + 1]

integer(kind=ip), public, parameter :: bspline_order_quintic = 6_ip

spline order k parameter (for input to the db*ink routines) [order = polynomial degree + 1]

integer(kind=ip), public, parameter :: bspline_order_hexic = 7_ip

spline order k parameter (for input to the db*ink routines) [order = polynomial degree + 1]

integer(kind=ip), public, parameter :: bspline_order_heptic = 8_ip

spline order k parameter (for input to the db*ink routines) [order = polynomial degree + 1]

integer(kind=ip), public, parameter :: bspline_order_octic = 9_ip

spline order k parameter (for input to the db*ink routines) [order = polynomial degree + 1]


Interfaces

public interface db1ink

1D initialization routines.

  • private pure subroutine db1ink_default(x, nx, fcn, kx, iknot, tx, bcoef, iflag)

    Determines the parameters of a function that interpolates the one-dimensional gridded data The interpolating function and its derivatives may subsequently be evaluated by the function db1val.

    History

    • Jacob Williams, 10/30/2015 : Created 1D routine.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), dimension(:) :: x

    (nx) array of abcissae. Must be strictly increasing.

    integer(kind=ip), intent(in) :: nx

    Number of abcissae

    real(kind=wp), intent(in), dimension(:) :: fcn

    (nx) array of function values to interpolate. fcn(i) should contain the function value at the point x(i)

    integer(kind=ip), intent(in) :: kx

    The order of spline pieces in ( ) (order = polynomial degree + 1)

    integer(kind=ip), intent(in) :: iknot

    knot sequence flag:

    Read more…
    real(kind=wp), intent(inout), dimension(:) :: tx

    The (nx+kx) knots in the direction for the spline interpolant:

    Read more…
    real(kind=wp), intent(out), dimension(:) :: bcoef

    (nx) array of coefficients of the b-spline interpolant.

    integer(kind=ip), intent(out) :: iflag

    status flag:

    Read more…
  • private pure subroutine db1ink_alt(x, nx, fcn, kx, ibcl, ibcr, fbcl, fbcr, kntopt, tx, bcoef, iflag)

    Alternate version of db1ink_default, where the boundary conditions can be specified.

    History

    • Jacob Williams, 9/4/2018 : created this routine.

    See also

    • dbint4 -- the main routine that is called here.

    Note

    Currently, this only works for 3rd order (k=4).

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), dimension(:) :: x

    vector of abscissae of length nx, distinct and in increasing order

    integer(kind=ip), intent(in) :: nx

    number of data points,

    real(kind=wp), intent(in), dimension(:) :: fcn

    vector of ordinates of length nx

    integer(kind=ip), intent(in) :: kx

    spline order (Currently, this must be 4)

    integer(kind=ip), intent(in) :: ibcl

    selection parameter for left boundary condition:

    Read more…
    integer(kind=ip), intent(in) :: ibcr

    selection parameter for right boundary condition:

    Read more…
    real(kind=wp), intent(in) :: fbcl

    left boundary values governed by ibcl

    real(kind=wp), intent(in) :: fbcr

    right boundary values governed by ibcr

    integer(kind=ip), intent(in) :: kntopt

    knot selection parameter:

    Read more…
    real(kind=wp), intent(out), dimension(:) :: tx

    knot array of length nx+6

    real(kind=wp), intent(out), dimension(:) :: bcoef

    b spline coefficient array of length nx+2

    integer(kind=ip), intent(out) :: iflag

    status flag:

    Read more…
  • private pure subroutine db1ink_alt_2(x, nx, fcn, kx, ibcl, ibcr, fbcl, fbcr, tleft, tright, tx, bcoef, iflag)

    Alternate version of db1ink_alt, where the first and last 3 knots are specified by the user.

    History

    • Jacob Williams, 9/4/2018 : created this routine.

    See also

    • dbint4 -- the main routine that is called here.

    Note

    Currently, this only works for 3rd order (k=4).

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), dimension(:) :: x

    vector of abscissae of length nx, distinct and in increasing order

    integer(kind=ip), intent(in) :: nx

    number of data points,

    real(kind=wp), intent(in), dimension(:) :: fcn

    vector of ordinates of length nx

    integer(kind=ip), intent(in) :: kx

    spline order (Currently, this must be 4)

    integer(kind=ip), intent(in) :: ibcl

    selection parameter for left boundary condition:

    Read more…
    integer(kind=ip), intent(in) :: ibcr

    selection parameter for right boundary condition:

    Read more…
    real(kind=wp), intent(in) :: fbcl

    left boundary values governed by ibcl

    real(kind=wp), intent(in) :: fbcr

    right boundary values governed by ibcr

    real(kind=wp), intent(in), dimension(3) :: tleft

    t(1:3) in increasing order supplied by the user.

    real(kind=wp), intent(in), dimension(3) :: tright

    t(nx+4:nx+6) in increasing order supplied by the user.

    real(kind=wp), intent(out), dimension(:) :: tx

    knot array of length nx+6

    real(kind=wp), intent(out), dimension(:) :: bcoef

    b spline coefficient array of length nx+2

    integer(kind=ip), intent(out) :: iflag

    status flag:

    Read more…

public interface db1val

1D evaluation routines.

  • private pure subroutine db1val_default(xval, idx, tx, nx, kx, bcoef, f, iflag, inbvx, w0, extrap)

    Evaluates the tensor product piecewise polynomial interpolant constructed by the routine db1ink or one of its derivatives at the point xval.

    To evaluate the interpolant itself, set idx=0, to evaluate the first partial with respect to x, set idx=1, and so on.

    db1val returns 0.0 if (xval,yval) is out of range. that is, if

       xval < tx(1) .or. xval > tx(nx+kx)
    

    if the knots tx were chosen by db1ink, then this is equivalent to:

       xval < x(1) .or. xval > x(nx)+epsx
    

    where

       epsx = 0.1*(x(nx)-x(nx-1))
    

    The input quantities tx, nx, kx, and bcoef should be unchanged since the last call of db1ink.

    History

    • Jacob Williams, 10/30/2015 : Created 1D routine.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in) :: xval

    coordinate of evaluation point.

    integer(kind=ip), intent(in) :: idx

    derivative of piecewise polynomial to evaluate.

    real(kind=wp), intent(in), dimension(nx+kx) :: tx

    sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db1ink)

    integer(kind=ip), intent(in) :: nx

    the number of interpolation points in . (same as in last call to db1ink)

    integer(kind=ip), intent(in) :: kx

    order of polynomial pieces in . (same as in last call to db1ink)

    real(kind=wp), intent(in), dimension(nx) :: bcoef

    the b-spline coefficients computed by db1ink.

    real(kind=wp), intent(out) :: f

    interpolated value

    integer(kind=ip), intent(out) :: iflag

    status flag:

    Read more…
    integer(kind=ip), intent(inout) :: inbvx

    initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

    real(kind=wp), intent(inout), dimension(3_ip*kx) :: w0

    work array

    logical, intent(in), optional :: extrap

    if extrapolation is allowed (if not present, default is False)

  • private pure subroutine db1val_alt(xval, idx, tx, nx, n, kx, bcoef, f, iflag, inbvx, w0, extrap)

    Alternate version of db1val_default for use with db1ink_alt and db1ink_alt_2.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in) :: xval

    coordinate of evaluation point.

    integer(kind=ip), intent(in) :: idx

    derivative of piecewise polynomial to evaluate.

    real(kind=wp), intent(in), dimension(n+kx) :: tx

    sequence of knots defining the piecewise polynomial in the direction.

    integer(kind=ip), intent(in) :: nx

    the number of interpolation points in .

    integer(kind=ip), intent(in) :: n

    length of bcoef: nx+2

    integer(kind=ip), intent(in) :: kx

    order of polynomial pieces in . (same as in last call to db1ink)

    real(kind=wp), intent(in), dimension(n) :: bcoef

    the b-spline coefficients computed by db1ink.

    real(kind=wp), intent(out) :: f

    interpolated value

    integer(kind=ip), intent(out) :: iflag

    status flag:

    Read more…
    integer(kind=ip), intent(inout) :: inbvx

    initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

    real(kind=wp), intent(inout), dimension(3_ip*kx) :: w0

    work array

    logical, intent(in), optional :: extrap

    if extrapolation is allowed (if not present, default is False)


Abstract Interfaces

abstract interface

  • public function b1fqad_func(x) result(f)

    interface for the input function in dbfqad

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in) :: x

    Return Value real(kind=wp)

    f(x)


Functions

private pure function check_value(x, t, i, extrap) result(iflag)

Checks if the value is withing the range of the knot vectors. This is called by the various db*val routines.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x

the value to check

real(kind=wp), intent(in), dimension(:) :: t

the knot vector

integer(kind=ip), intent(in) :: i

1=x, 2=y, 3=z, 4=q, 5=r, 6=s

logical, intent(in), optional :: extrap

if extrapolation is allowed (if not present, default is False)

Return Value integer(kind=ip)

returns 0 if value is OK, otherwise returns 600+i

private pure function get_temp_x_for_extrap(x, tmin, tmax, extrap) result(xt)

Returns the value of x to use for computing the interval in t, depending on if extrapolation is allowed or not.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x

variable value

real(kind=wp), intent(in) :: tmin

first knot vector element for b-splines

real(kind=wp), intent(in) :: tmax

last knot vector element for b-splines

logical, intent(in), optional :: extrap

if extrapolation is allowed (if not present, default is False)

Return Value real(kind=wp)

The value returned (it will either be tmin, x, or tmax)

public pure function get_status_message(iflag) result(msg)

Returns a message string associated with the status code.

Arguments

Type IntentOptional Attributes Name
integer(kind=ip), intent(in) :: iflag

return code from one of the routines

Return Value character(len=:), allocatable

status message associated with the flag


Subroutines

private pure subroutine db1ink_default(x, nx, fcn, kx, iknot, tx, bcoef, iflag)

Determines the parameters of a function that interpolates the one-dimensional gridded data The interpolating function and its derivatives may subsequently be evaluated by the function db1val.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(:) :: x

(nx) array of abcissae. Must be strictly increasing.

integer(kind=ip), intent(in) :: nx

Number of abcissae

real(kind=wp), intent(in), dimension(:) :: fcn

(nx) array of function values to interpolate. fcn(i) should contain the function value at the point x(i)

integer(kind=ip), intent(in) :: kx

The order of spline pieces in ( ) (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: iknot

knot sequence flag:

Read more…
real(kind=wp), intent(inout), dimension(:) :: tx

The (nx+kx) knots in the direction for the spline interpolant:

Read more…
real(kind=wp), intent(out), dimension(:) :: bcoef

(nx) array of coefficients of the b-spline interpolant.

integer(kind=ip), intent(out) :: iflag

status flag:

Read more…

private pure subroutine db1ink_alt(x, nx, fcn, kx, ibcl, ibcr, fbcl, fbcr, kntopt, tx, bcoef, iflag)

Alternate version of db1ink_default, where the boundary conditions can be specified.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(:) :: x

vector of abscissae of length nx, distinct and in increasing order

integer(kind=ip), intent(in) :: nx

number of data points,

real(kind=wp), intent(in), dimension(:) :: fcn

vector of ordinates of length nx

integer(kind=ip), intent(in) :: kx

spline order (Currently, this must be 4)

integer(kind=ip), intent(in) :: ibcl

selection parameter for left boundary condition:

Read more…
integer(kind=ip), intent(in) :: ibcr

selection parameter for right boundary condition:

Read more…
real(kind=wp), intent(in) :: fbcl

left boundary values governed by ibcl

real(kind=wp), intent(in) :: fbcr

right boundary values governed by ibcr

integer(kind=ip), intent(in) :: kntopt

knot selection parameter:

Read more…
real(kind=wp), intent(out), dimension(:) :: tx

knot array of length nx+6

real(kind=wp), intent(out), dimension(:) :: bcoef

b spline coefficient array of length nx+2

integer(kind=ip), intent(out) :: iflag

status flag:

Read more…

private pure subroutine db1ink_alt_2(x, nx, fcn, kx, ibcl, ibcr, fbcl, fbcr, tleft, tright, tx, bcoef, iflag)

Alternate version of db1ink_alt, where the first and last 3 knots are specified by the user.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(:) :: x

vector of abscissae of length nx, distinct and in increasing order

integer(kind=ip), intent(in) :: nx

number of data points,

real(kind=wp), intent(in), dimension(:) :: fcn

vector of ordinates of length nx

integer(kind=ip), intent(in) :: kx

spline order (Currently, this must be 4)

integer(kind=ip), intent(in) :: ibcl

selection parameter for left boundary condition:

Read more…
integer(kind=ip), intent(in) :: ibcr

selection parameter for right boundary condition:

Read more…
real(kind=wp), intent(in) :: fbcl

left boundary values governed by ibcl

real(kind=wp), intent(in) :: fbcr

right boundary values governed by ibcr

real(kind=wp), intent(in), dimension(3) :: tleft

t(1:3) in increasing order supplied by the user.

real(kind=wp), intent(in), dimension(3) :: tright

t(nx+4:nx+6) in increasing order supplied by the user.

real(kind=wp), intent(out), dimension(:) :: tx

knot array of length nx+6

real(kind=wp), intent(out), dimension(:) :: bcoef

b spline coefficient array of length nx+2

integer(kind=ip), intent(out) :: iflag

status flag:

Read more…

private pure subroutine db1val_default(xval, idx, tx, nx, kx, bcoef, f, iflag, inbvx, w0, extrap)

Evaluates the tensor product piecewise polynomial interpolant constructed by the routine db1ink or one of its derivatives at the point xval.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: xval

coordinate of evaluation point.

integer(kind=ip), intent(in) :: idx

derivative of piecewise polynomial to evaluate.

real(kind=wp), intent(in), dimension(nx+kx) :: tx

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db1ink)

integer(kind=ip), intent(in) :: nx

the number of interpolation points in . (same as in last call to db1ink)

integer(kind=ip), intent(in) :: kx

order of polynomial pieces in . (same as in last call to db1ink)

real(kind=wp), intent(in), dimension(nx) :: bcoef

the b-spline coefficients computed by db1ink.

real(kind=wp), intent(out) :: f

interpolated value

integer(kind=ip), intent(out) :: iflag

status flag:

Read more…
integer(kind=ip), intent(inout) :: inbvx

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

real(kind=wp), intent(inout), dimension(3_ip*kx) :: w0

work array

logical, intent(in), optional :: extrap

if extrapolation is allowed (if not present, default is False)

private pure subroutine db1val_alt(xval, idx, tx, nx, n, kx, bcoef, f, iflag, inbvx, w0, extrap)

Alternate version of db1val_default for use with db1ink_alt and db1ink_alt_2.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: xval

coordinate of evaluation point.

integer(kind=ip), intent(in) :: idx

derivative of piecewise polynomial to evaluate.

real(kind=wp), intent(in), dimension(n+kx) :: tx

sequence of knots defining the piecewise polynomial in the direction.

integer(kind=ip), intent(in) :: nx

the number of interpolation points in .

integer(kind=ip), intent(in) :: n

length of bcoef: nx+2

integer(kind=ip), intent(in) :: kx

order of polynomial pieces in . (same as in last call to db1ink)

real(kind=wp), intent(in), dimension(n) :: bcoef

the b-spline coefficients computed by db1ink.

real(kind=wp), intent(out) :: f

interpolated value

integer(kind=ip), intent(out) :: iflag

status flag:

Read more…
integer(kind=ip), intent(inout) :: inbvx

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

real(kind=wp), intent(inout), dimension(3_ip*kx) :: w0

work array

logical, intent(in), optional :: extrap

if extrapolation is allowed (if not present, default is False)

public pure subroutine db1sqad(tx, bcoef, nx, kx, x1, x2, f, iflag, w0)

Computes the integral on (x1,x2) of a kx-th order b-spline. Orders kx as high as 20 are permitted by applying a 2, 6, or 10 point gauss formula on subintervals of (x1,x2) which are formed by included (distinct) knots.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(nx+kx) :: tx

knot array

real(kind=wp), intent(in), dimension(nx) :: bcoef

b-spline coefficient array

integer(kind=ip), intent(in) :: nx

length of coefficient array

integer(kind=ip), intent(in) :: kx

order of b-spline, 1 <= k <= 20

real(kind=wp), intent(in) :: x1

left point of quadrature interval in t(kx) <= x <= t(nx+1)

real(kind=wp), intent(in) :: x2

right point of quadrature interval in t(kx) <= x <= t(nx+1)

real(kind=wp), intent(out) :: f

integral of the b-spline over (x1,x2)

integer(kind=ip), intent(out) :: iflag

status flag:

Read more…
real(kind=wp), intent(inout), dimension(3*kx) :: w0

work array for dbsqad

public subroutine db1fqad(fun, tx, bcoef, nx, kx, idx, x1, x2, tol, f, iflag, w0)

Computes the integral on (x1,x2) of a product of a function fun and the idx-th derivative of a kx-th order b-spline, using the b-representation (tx,bcoef,nx,kx), with an adaptive 8-point Legendre-Gauss algorithm. (x1,x2) must be a subinterval of t(kx) <= x <= t(nx+1).

Read more…

Arguments

Type IntentOptional Attributes Name
procedure(b1fqad_func) :: fun

external function of one argument for the integrand bf(x)=fun(x)*dbvalu(tx,bcoef,nx,kx,id,x,inbv,work)

real(kind=wp), intent(in), dimension(nx+kx) :: tx

knot array

real(kind=wp), intent(in), dimension(nx) :: bcoef

b-spline coefficient array

integer(kind=ip), intent(in) :: nx

length of coefficient array

integer(kind=ip), intent(in) :: kx

order of b-spline, kx >= 1

integer(kind=ip), intent(in) :: idx

order of the spline derivative, 0 <= idx <= k-1 idx=0 gives the spline function

real(kind=wp), intent(in) :: x1

left point of quadrature interval in t(k) <= x <= t(n+1)

real(kind=wp), intent(in) :: x2

right point of quadrature interval in t(k) <= x <= t(n+1)

real(kind=wp), intent(in) :: tol

desired accuracy for the quadrature, suggest 10*dtol < tol <= 0.1 where dtol is the maximum of 1.0e-300 and real(wp) unit roundoff for the machine

real(kind=wp), intent(out) :: f

integral of bf(x) on (x1,x2)

integer(kind=ip), intent(out) :: iflag

status flag:

Read more…
real(kind=wp), intent(inout), dimension(3_ip*kx) :: w0

work array for dbfqad

public pure subroutine db2ink(x, nx, y, ny, fcn, kx, ky, iknot, tx, ty, bcoef, iflag)

Determines the parameters of a function that interpolates the two-dimensional gridded data The interpolating function and its derivatives may subsequently be evaluated by the function db2val.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(:) :: x

(nx) array of abcissae. Must be strictly increasing.

integer(kind=ip), intent(in) :: nx

Number of abcissae

real(kind=wp), intent(in), dimension(:) :: y

(ny) array of abcissae. Must be strictly increasing.

integer(kind=ip), intent(in) :: ny

Number of abcissae

real(kind=wp), intent(in), dimension(:,:) :: fcn

(nx,ny) matrix of function values to interpolate. fcn(i,j) should contain the function value at the point (x(i),y(j))

integer(kind=ip), intent(in) :: kx

The order of spline pieces in ( ) (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: ky

The order of spline pieces in ( ) (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: iknot

knot sequence flag:

Read more…
real(kind=wp), intent(inout), dimension(:) :: tx

The (nx+kx) knots in the direction for the spline interpolant.

Read more…
real(kind=wp), intent(inout), dimension(:) :: ty

The (ny+ky) knots in the direction for the spline interpolant.

Read more…
real(kind=wp), intent(out), dimension(:,:) :: bcoef

(nx,ny) matrix of coefficients of the b-spline interpolant.

integer(kind=ip), intent(out) :: iflag Read more…

public pure subroutine db2val(xval, yval, idx, idy, tx, ty, nx, ny, kx, ky, bcoef, f, iflag, inbvx, inbvy, iloy, w1, w0, extrap)

Evaluates the tensor product piecewise polynomial interpolant constructed by the routine db2ink or one of its derivatives at the point (xval,yval).

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: xval

coordinate of evaluation point.

real(kind=wp), intent(in) :: yval

coordinate of evaluation point.

integer(kind=ip), intent(in) :: idx

derivative of piecewise polynomial to evaluate.

integer(kind=ip), intent(in) :: idy

derivative of piecewise polynomial to evaluate.

real(kind=wp), intent(in), dimension(nx+kx) :: tx

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db2ink)

real(kind=wp), intent(in), dimension(ny+ky) :: ty

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db2ink)

integer(kind=ip), intent(in) :: nx

the number of interpolation points in . (same as in last call to db2ink)

integer(kind=ip), intent(in) :: ny

the number of interpolation points in . (same as in last call to db2ink)

integer(kind=ip), intent(in) :: kx

order of polynomial pieces in . (same as in last call to db2ink)

integer(kind=ip), intent(in) :: ky

order of polynomial pieces in . (same as in last call to db2ink)

real(kind=wp), intent(in), dimension(nx,ny) :: bcoef

the b-spline coefficients computed by db2ink.

real(kind=wp), intent(out) :: f

interpolated value

integer(kind=ip), intent(out) :: iflag

status flag:

Read more…
integer(kind=ip), intent(inout) :: inbvx

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: inbvy

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: iloy

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

real(kind=wp), intent(inout), dimension(ky) :: w1

work array

real(kind=wp), intent(inout), dimension(3_ip*max(kx,ky)) :: w0

work array

logical, intent(in), optional :: extrap

if extrapolation is allowed (if not present, default is False)

public pure subroutine db3ink(x, nx, y, ny, z, nz, fcn, kx, ky, kz, iknot, tx, ty, tz, bcoef, iflag)

Determines the parameters of a function that interpolates the three-dimensional gridded data The interpolating function and its derivatives may subsequently be evaluated by the function db3val.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(:) :: x

(nx) array of abcissae. must be strictly increasing.

integer(kind=ip), intent(in) :: nx

number of abcissae ( )

real(kind=wp), intent(in), dimension(:) :: y

(ny) array of abcissae. must be strictly increasing.

integer(kind=ip), intent(in) :: ny

number of abcissae ( )

real(kind=wp), intent(in), dimension(:) :: z

(nz) array of abcissae. must be strictly increasing.

integer(kind=ip), intent(in) :: nz

number of abcissae ( )

real(kind=wp), intent(in), dimension(:,:,:) :: fcn

(nx,ny,nz) matrix of function values to interpolate. fcn(i,j,k) should contain the function value at the point (x(i),y(j),z(k))

integer(kind=ip), intent(in) :: kx

The order of spline pieces in ( ) (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: ky

The order of spline pieces in ( ) (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: kz

the order of spline pieces in ( ) (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: iknot

knot sequence flag:

Read more…
real(kind=wp), intent(inout), dimension(:) :: tx

The (nx+kx) knots in the direction for the spline interpolant.

Read more…
real(kind=wp), intent(inout), dimension(:) :: ty

The (ny+ky) knots in the direction for the spline interpolant.

Read more…
real(kind=wp), intent(inout), dimension(:) :: tz

The (nz+kz) knots in the direction for the spline interpolant.

Read more…
real(kind=wp), intent(out), dimension(:,:,:) :: bcoef

(nx,ny,nz) matrix of coefficients of the b-spline interpolant.

integer(kind=ip), intent(out) :: iflag Read more…

public pure subroutine db3val(xval, yval, zval, idx, idy, idz, tx, ty, tz, nx, ny, nz, kx, ky, kz, bcoef, f, iflag, inbvx, inbvy, inbvz, iloy, iloz, w2, w1, w0, extrap)

Evaluates the tensor product piecewise polynomial interpolant constructed by the routine db3ink or one of its derivatives at the point (xval,yval,zval).

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: xval

coordinate of evaluation point.

real(kind=wp), intent(in) :: yval

coordinate of evaluation point.

real(kind=wp), intent(in) :: zval

coordinate of evaluation point.

integer(kind=ip), intent(in) :: idx

derivative of piecewise polynomial to evaluate.

integer(kind=ip), intent(in) :: idy

derivative of piecewise polynomial to evaluate.

integer(kind=ip), intent(in) :: idz

derivative of piecewise polynomial to evaluate.

real(kind=wp), intent(in), dimension(nx+kx) :: tx

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db3ink)

real(kind=wp), intent(in), dimension(ny+ky) :: ty

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db3ink)

real(kind=wp), intent(in), dimension(nz+kz) :: tz

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db3ink)

integer(kind=ip), intent(in) :: nx

the number of interpolation points in . (same as in last call to db3ink)

integer(kind=ip), intent(in) :: ny

the number of interpolation points in . (same as in last call to db3ink)

integer(kind=ip), intent(in) :: nz

the number of interpolation points in . (same as in last call to db3ink)

integer(kind=ip), intent(in) :: kx

order of polynomial pieces in . (same as in last call to db3ink)

integer(kind=ip), intent(in) :: ky

order of polynomial pieces in . (same as in last call to db3ink)

integer(kind=ip), intent(in) :: kz

order of polynomial pieces in . (same as in last call to db3ink)

real(kind=wp), intent(in), dimension(nx,ny,nz) :: bcoef

the b-spline coefficients computed by db3ink.

real(kind=wp), intent(out) :: f

interpolated value

integer(kind=ip), intent(out) :: iflag

status flag:

Read more…
integer(kind=ip), intent(inout) :: inbvx

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: inbvy

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: inbvz

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: iloy

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: iloz

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

real(kind=wp), intent(inout), dimension(ky,kz) :: w2

work array

real(kind=wp), intent(inout), dimension(kz) :: w1

work array

real(kind=wp), intent(inout), dimension(3_ip*max(kx,ky,kz)) :: w0

work array

logical, intent(in), optional :: extrap

if extrapolation is allowed (if not present, default is False)

public pure subroutine db4ink(x, nx, y, ny, z, nz, q, nq, fcn, kx, ky, kz, kq, iknot, tx, ty, tz, tq, bcoef, iflag)

Determines the parameters of a function that interpolates the four-dimensional gridded data The interpolating function and its derivatives may subsequently be evaluated by the function db4val.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(:) :: x

(nx) array of abcissae. must be strictly increasing.

integer(kind=ip), intent(in) :: nx

number of abcissae ( )

real(kind=wp), intent(in), dimension(:) :: y

(ny) array of abcissae. must be strictly increasing.

integer(kind=ip), intent(in) :: ny

number of abcissae ( )

real(kind=wp), intent(in), dimension(:) :: z

(nz) array of abcissae. must be strictly increasing.

integer(kind=ip), intent(in) :: nz

number of abcissae ( )

real(kind=wp), intent(in), dimension(:) :: q

(nq) array of abcissae. must be strictly increasing.

integer(kind=ip), intent(in) :: nq

number of abcissae ( )

real(kind=wp), intent(in), dimension(:,:,:,:) :: fcn

(nx,ny,nz,nq) matrix of function values to interpolate. fcn(i,j,k,q) should contain the function value at the point (x(i),y(j),z(k),q(l))

integer(kind=ip), intent(in) :: kx

the order of spline pieces in ( ). (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: ky

the order of spline pieces in ( ). (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: kz

the order of spline pieces in ( ). (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: kq

the order of spline pieces in ( ). (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: iknot

knot sequence flag:

Read more…
real(kind=wp), intent(inout), dimension(:) :: tx

The (nx+kx) knots in the x direction for the spline interpolant.

Read more…
real(kind=wp), intent(inout), dimension(:) :: ty

The (ny+ky) knots in the y direction for the spline interpolant.

Read more…
real(kind=wp), intent(inout), dimension(:) :: tz

The (nz+kz) knots in the z direction for the spline interpolant.

Read more…
real(kind=wp), intent(inout), dimension(:) :: tq

The (nq+kq) knots in the q direction for the spline interpolant.

Read more…
real(kind=wp), intent(out), dimension(:,:,:,:) :: bcoef

(nx,ny,nz,nq) matrix of coefficients of the b-spline interpolant.

integer(kind=ip), intent(out) :: iflag Read more…

public pure subroutine db4val(xval, yval, zval, qval, idx, idy, idz, idq, tx, ty, tz, tq, nx, ny, nz, nq, kx, ky, kz, kq, bcoef, f, iflag, inbvx, inbvy, inbvz, inbvq, iloy, iloz, iloq, w3, w2, w1, w0, extrap)

Evaluates the tensor product piecewise polynomial interpolant constructed by the routine db4ink or one of its derivatives at the point (xval,yval,zval,qval).

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: xval

coordinate of evaluation point.

real(kind=wp), intent(in) :: yval

coordinate of evaluation point.

real(kind=wp), intent(in) :: zval

coordinate of evaluation point.

real(kind=wp), intent(in) :: qval

coordinate of evaluation point.

integer(kind=ip), intent(in) :: idx

derivative of piecewise polynomial to evaluate.

integer(kind=ip), intent(in) :: idy

derivative of piecewise polynomial to evaluate.

integer(kind=ip), intent(in) :: idz

derivative of piecewise polynomial to evaluate.

integer(kind=ip), intent(in) :: idq

derivative of piecewise polynomial to evaluate.

real(kind=wp), intent(in), dimension(nx+kx) :: tx

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db4ink)

real(kind=wp), intent(in), dimension(ny+ky) :: ty

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db4ink)

real(kind=wp), intent(in), dimension(nz+kz) :: tz

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db4ink)

real(kind=wp), intent(in), dimension(nq+kq) :: tq

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db4ink)

integer(kind=ip), intent(in) :: nx

the number of interpolation points in . (same as in last call to db4ink)

integer(kind=ip), intent(in) :: ny

the number of interpolation points in . (same as in last call to db4ink)

integer(kind=ip), intent(in) :: nz

the number of interpolation points in . (same as in last call to db4ink)

integer(kind=ip), intent(in) :: nq

the number of interpolation points in . (same as in last call to db4ink)

integer(kind=ip), intent(in) :: kx

order of polynomial pieces in . (same as in last call to db4ink)

integer(kind=ip), intent(in) :: ky

order of polynomial pieces in . (same as in last call to db4ink)

integer(kind=ip), intent(in) :: kz

order of polynomial pieces in . (same as in last call to db4ink)

integer(kind=ip), intent(in) :: kq

order of polynomial pieces in . (same as in last call to db4ink)

real(kind=wp), intent(in), dimension(nx,ny,nz,nq) :: bcoef

the b-spline coefficients computed by db4ink.

real(kind=wp), intent(out) :: f

interpolated value

integer(kind=ip), intent(out) :: iflag

status flag:

Read more…
integer(kind=ip), intent(inout) :: inbvx

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: inbvy

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: inbvz

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: inbvq

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: iloy

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: iloz

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: iloq

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

real(kind=wp), intent(inout), dimension(ky,kz,kq) :: w3

work array

real(kind=wp), intent(inout), dimension(kz,kq) :: w2

work array

real(kind=wp), intent(inout), dimension(kq) :: w1

work array

real(kind=wp), intent(inout), dimension(3_ip*max(kx,ky,kz,kq)) :: w0

work array

logical, intent(in), optional :: extrap

if extrapolation is allowed (if not present, default is False)

public pure subroutine db5ink(x, nx, y, ny, z, nz, q, nq, r, nr, fcn, kx, ky, kz, kq, kr, iknot, tx, ty, tz, tq, tr, bcoef, iflag)

Determines the parameters of a function that interpolates the five-dimensional gridded data:

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(:) :: x

(nx) array of abcissae. must be strictly increasing.

integer(kind=ip), intent(in) :: nx

number of abcissae ( )

real(kind=wp), intent(in), dimension(:) :: y

(ny) array of abcissae. must be strictly increasing.

integer(kind=ip), intent(in) :: ny

number of abcissae ( )

real(kind=wp), intent(in), dimension(:) :: z

(nz) array of abcissae. must be strictly increasing.

integer(kind=ip), intent(in) :: nz

number of abcissae ( )

real(kind=wp), intent(in), dimension(:) :: q

(nq) array of abcissae. must be strictly increasing.

integer(kind=ip), intent(in) :: nq

number of abcissae ( )

real(kind=wp), intent(in), dimension(:) :: r

(nr) array of abcissae. must be strictly increasing.

integer(kind=ip), intent(in) :: nr

number of abcissae ( )

real(kind=wp), intent(in), dimension(:,:,:,:,:) :: fcn

(nx,ny,nz,nq,nr) matrix of function values to interpolate. fcn(i,j,k,q,r) should contain the function value at the point (x(i),y(j),z(k),q(l),r(m))

integer(kind=ip), intent(in) :: kx

the order of spline pieces in ( ). (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: ky

the order of spline pieces in ( ). (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: kz

the order of spline pieces in ( ). (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: kq

the order of spline pieces in ( ). (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: kr

the order of spline pieces in ( ). (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: iknot

knot sequence flag:

Read more…
real(kind=wp), intent(inout), dimension(:) :: tx

The (nx+kx) knots in the direction for the spline interpolant.

Read more…
real(kind=wp), intent(inout), dimension(:) :: ty

The (ny+ky) knots in the direction for the spline interpolant.

Read more…
real(kind=wp), intent(inout), dimension(:) :: tz

The (nz+kz) knots in the direction for the spline interpolant.

Read more…
real(kind=wp), intent(inout), dimension(:) :: tq

The (nq+kq) knots in the direction for the spline interpolant.

Read more…
real(kind=wp), intent(inout), dimension(:) :: tr

The (nr+kr) knots in the direction for the spline interpolant.

Read more…
real(kind=wp), intent(out), dimension(:,:,:,:,:) :: bcoef

(nx,ny,nz,nq,nr) matrix of coefficients of the b-spline interpolant.

integer(kind=ip), intent(out) :: iflag Read more…

public pure subroutine db5val(xval, yval, zval, qval, rval, idx, idy, idz, idq, idr, tx, ty, tz, tq, tr, nx, ny, nz, nq, nr, kx, ky, kz, kq, kr, bcoef, f, iflag, inbvx, inbvy, inbvz, inbvq, inbvr, iloy, iloz, iloq, ilor, w4, w3, w2, w1, w0, extrap)

Evaluates the tensor product piecewise polynomial interpolant constructed by the routine db5ink or one of its derivatives at the point (xval,yval,zval,qval,rval).

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: xval

coordinate of evaluation point.

real(kind=wp), intent(in) :: yval

coordinate of evaluation point.

real(kind=wp), intent(in) :: zval

coordinate of evaluation point.

real(kind=wp), intent(in) :: qval

coordinate of evaluation point.

real(kind=wp), intent(in) :: rval

coordinate of evaluation point.

integer(kind=ip), intent(in) :: idx

derivative of piecewise polynomial to evaluate.

integer(kind=ip), intent(in) :: idy

derivative of piecewise polynomial to evaluate.

integer(kind=ip), intent(in) :: idz

derivative of piecewise polynomial to evaluate.

integer(kind=ip), intent(in) :: idq

derivative of piecewise polynomial to evaluate.

integer(kind=ip), intent(in) :: idr

derivative of piecewise polynomial to evaluate.

real(kind=wp), intent(in), dimension(nx+kx) :: tx

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db5ink)

real(kind=wp), intent(in), dimension(ny+ky) :: ty

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db5ink)

real(kind=wp), intent(in), dimension(nz+kz) :: tz

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db5ink)

real(kind=wp), intent(in), dimension(nq+kq) :: tq

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db5ink)

real(kind=wp), intent(in), dimension(nr+kr) :: tr

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db5ink)

integer(kind=ip), intent(in) :: nx

the number of interpolation points in . (same as in last call to db5ink)

integer(kind=ip), intent(in) :: ny

the number of interpolation points in . (same as in last call to db5ink)

integer(kind=ip), intent(in) :: nz

the number of interpolation points in . (same as in last call to db5ink)

integer(kind=ip), intent(in) :: nq

the number of interpolation points in . (same as in last call to db5ink)

integer(kind=ip), intent(in) :: nr

the number of interpolation points in . (same as in last call to db5ink)

integer(kind=ip), intent(in) :: kx

order of polynomial pieces in . (same as in last call to db5ink)

integer(kind=ip), intent(in) :: ky

order of polynomial pieces in . (same as in last call to db5ink)

integer(kind=ip), intent(in) :: kz

order of polynomial pieces in . (same as in last call to db5ink)

integer(kind=ip), intent(in) :: kq

order of polynomial pieces in . (same as in last call to db5ink)

integer(kind=ip), intent(in) :: kr

order of polynomial pieces in . (same as in last call to db5ink)

real(kind=wp), intent(in), dimension(nx,ny,nz,nq,nr) :: bcoef

the b-spline coefficients computed by db5ink.

real(kind=wp), intent(out) :: f

interpolated value

integer(kind=ip), intent(out) :: iflag

status flag:

Read more…
integer(kind=ip), intent(inout) :: inbvx

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: inbvy

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: inbvz

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: inbvq

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: inbvr

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: iloy

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: iloz

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: iloq

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: ilor

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

real(kind=wp), intent(inout), dimension(ky,kz,kq,kr) :: w4

work array

real(kind=wp), intent(inout), dimension(kz,kq,kr) :: w3

work array

real(kind=wp), intent(inout), dimension(kq,kr) :: w2

work array

real(kind=wp), intent(inout), dimension(kr) :: w1

work array

real(kind=wp), intent(inout), dimension(3_ip*max(kx,ky,kz,kq,kr)) :: w0

work array

logical, intent(in), optional :: extrap

if extrapolation is allowed (if not present, default is False)

public pure subroutine db6ink(x, nx, y, ny, z, nz, q, nq, r, nr, s, ns, fcn, kx, ky, kz, kq, kr, ks, iknot, tx, ty, tz, tq, tr, ts, bcoef, iflag)

Determines the parameters of a function that interpolates the six-dimensional gridded data:

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(:) :: x

(nx) array of abcissae. must be strictly increasing.

integer(kind=ip), intent(in) :: nx

number of abcissae ( )

real(kind=wp), intent(in), dimension(:) :: y

(ny) array of abcissae. must be strictly increasing.

integer(kind=ip), intent(in) :: ny

number of abcissae ( )

real(kind=wp), intent(in), dimension(:) :: z

(nz) array of abcissae. must be strictly increasing.

integer(kind=ip), intent(in) :: nz

number of abcissae ( )

real(kind=wp), intent(in), dimension(:) :: q

(nq) array of abcissae. must be strictly increasing.

integer(kind=ip), intent(in) :: nq

number of abcissae ( )

real(kind=wp), intent(in), dimension(:) :: r

(nr) array of abcissae. must be strictly increasing.

integer(kind=ip), intent(in) :: nr

number of abcissae ( )

real(kind=wp), intent(in), dimension(:) :: s

(ns) array of abcissae. must be strictly increasing.

integer(kind=ip), intent(in) :: ns

number of abcissae ( )

real(kind=wp), intent(in), dimension(:,:,:,:,:,:) :: fcn

(nx,ny,nz,nq,nr,ns) matrix of function values to interpolate. fcn(i,j,k,q,r,s) should contain the function value at the point (x(i),y(j),z(k),q(l),r(m),s(n))

integer(kind=ip), intent(in) :: kx

the order of spline pieces in ( ) (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: ky

the order of spline pieces in ( ) (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: kz

the order of spline pieces in ( ) (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: kq

the order of spline pieces in ( ) (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: kr

the order of spline pieces in ( ) (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: ks

the order of spline pieces in ( ) (order = polynomial degree + 1)

integer(kind=ip), intent(in) :: iknot

knot sequence flag:

Read more…
real(kind=wp), intent(inout), dimension(:) :: tx

The (nx+kx) knots in the direction for the spline interpolant.

Read more…
real(kind=wp), intent(inout), dimension(:) :: ty

The (ny+ky) knots in the direction for the spline interpolant.

Read more…
real(kind=wp), intent(inout), dimension(:) :: tz

The (nz+kz) knots in the direction for the spline interpolant.

Read more…
real(kind=wp), intent(inout), dimension(:) :: tq

The (nq+kq) knots in the direction for the spline interpolant.

Read more…
real(kind=wp), intent(inout), dimension(:) :: tr

The (nr+kr) knots in the direction for the spline interpolant.

Read more…
real(kind=wp), intent(inout), dimension(:) :: ts

The (ns+ks) knots in the direction for the spline interpolant.

Read more…
real(kind=wp), intent(out), dimension(:,:,:,:,:,:) :: bcoef

(nx,ny,nz,nq,nr,ns) matrix of coefficients of the b-spline interpolant.

integer(kind=ip), intent(out) :: iflag Read more…

public pure subroutine db6val(xval, yval, zval, qval, rval, sval, idx, idy, idz, idq, idr, ids, tx, ty, tz, tq, tr, ts, nx, ny, nz, nq, nr, ns, kx, ky, kz, kq, kr, ks, bcoef, f, iflag, inbvx, inbvy, inbvz, inbvq, inbvr, inbvs, iloy, iloz, iloq, ilor, ilos, w5, w4, w3, w2, w1, w0, extrap)

Evaluates the tensor product piecewise polynomial interpolant constructed by the routine db6ink or one of its derivatives at the point (xval,yval,zval,qval,rval,sval).

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: xval

coordinate of evaluation point.

real(kind=wp), intent(in) :: yval

coordinate of evaluation point.

real(kind=wp), intent(in) :: zval

coordinate of evaluation point.

real(kind=wp), intent(in) :: qval

coordinate of evaluation point.

real(kind=wp), intent(in) :: rval

coordinate of evaluation point.

real(kind=wp), intent(in) :: sval

coordinate of evaluation point.

integer(kind=ip), intent(in) :: idx

derivative of piecewise polynomial to evaluate.

integer(kind=ip), intent(in) :: idy

derivative of piecewise polynomial to evaluate.

integer(kind=ip), intent(in) :: idz

derivative of piecewise polynomial to evaluate.

integer(kind=ip), intent(in) :: idq

derivative of piecewise polynomial to evaluate.

integer(kind=ip), intent(in) :: idr

derivative of piecewise polynomial to evaluate.

integer(kind=ip), intent(in) :: ids

derivative of piecewise polynomial to evaluate.

real(kind=wp), intent(in), dimension(nx+kx) :: tx

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db6ink)

real(kind=wp), intent(in), dimension(ny+ky) :: ty

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db6ink)

real(kind=wp), intent(in), dimension(nz+kz) :: tz

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db6ink)

real(kind=wp), intent(in), dimension(nq+kq) :: tq

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db6ink)

real(kind=wp), intent(in), dimension(nr+kr) :: tr

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db6ink)

real(kind=wp), intent(in), dimension(ns+ks) :: ts

sequence of knots defining the piecewise polynomial in the direction. (same as in last call to db6ink)

integer(kind=ip), intent(in) :: nx

the number of interpolation points in . (same as in last call to db6ink)

integer(kind=ip), intent(in) :: ny

the number of interpolation points in . (same as in last call to db6ink)

integer(kind=ip), intent(in) :: nz

the number of interpolation points in . (same as in last call to db6ink)

integer(kind=ip), intent(in) :: nq

the number of interpolation points in . (same as in last call to db6ink)

integer(kind=ip), intent(in) :: nr

the number of interpolation points in . (same as in last call to db6ink)

integer(kind=ip), intent(in) :: ns

the number of interpolation points in . (same as in last call to db6ink)

integer(kind=ip), intent(in) :: kx

order of polynomial pieces in . (same as in last call to db6ink)

integer(kind=ip), intent(in) :: ky

order of polynomial pieces in . (same as in last call to db6ink)

integer(kind=ip), intent(in) :: kz

order of polynomial pieces in . (same as in last call to db6ink)

integer(kind=ip), intent(in) :: kq

order of polynomial pieces in . (same as in last call to db6ink)

integer(kind=ip), intent(in) :: kr

order of polynomial pieces in . (same as in last call to db6ink)

integer(kind=ip), intent(in) :: ks

order of polynomial pieces in . (same as in last call to db6ink)

real(kind=wp), intent(in), dimension(nx,ny,nz,nq,nr,ns) :: bcoef

the b-spline coefficients computed by db6ink.

real(kind=wp), intent(out) :: f

interpolated value

integer(kind=ip), intent(out) :: iflag

status flag:

Read more…
integer(kind=ip), intent(inout) :: inbvx

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: inbvy

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: inbvz

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: inbvq

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: inbvr

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: inbvs

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: iloy

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: iloz

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: iloq

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: ilor

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

integer(kind=ip), intent(inout) :: ilos

initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user.

real(kind=wp), intent(inout), dimension(ky,kz,kq,kr,ks) :: w5

work array

real(kind=wp), intent(inout), dimension(kz,kq,kr,ks) :: w4

work array

real(kind=wp), intent(inout), dimension(kq,kr,ks) :: w3

work array

real(kind=wp), intent(inout), dimension(kr,ks) :: w2

work array

real(kind=wp), intent(inout), dimension(ks) :: w1

work array

real(kind=wp), intent(inout), dimension(3_ip*max(kx,ky,kz,kq,kr,ks)) :: w0

work array

logical, intent(in), optional :: extrap

if extrapolation is allowed (if not present, default is False)

private pure subroutine check_inputs(iknot, iflag, nx, ny, nz, nq, nr, ns, kx, ky, kz, kq, kr, ks, x, y, z, q, r, s, tx, ty, tz, tq, tr, ts, f1, f2, f3, f4, f5, f6, bcoef1, bcoef2, bcoef3, bcoef4, bcoef5, bcoef6, alt, status_ok)

Check the validity of the inputs to the db*ink routines. Prints warning message if there is an error, and also sets iflag and status_ok.

Read more…

Arguments

Type IntentOptional Attributes Name
integer(kind=ip), intent(in) :: iknot

= 0 if the INK routine is computing the knots.

integer(kind=ip), intent(out) :: iflag
integer(kind=ip), intent(in), optional :: nx
integer(kind=ip), intent(in), optional :: ny
integer(kind=ip), intent(in), optional :: nz
integer(kind=ip), intent(in), optional :: nq
integer(kind=ip), intent(in), optional :: nr
integer(kind=ip), intent(in), optional :: ns
integer(kind=ip), intent(in), optional :: kx
integer(kind=ip), intent(in), optional :: ky
integer(kind=ip), intent(in), optional :: kz
integer(kind=ip), intent(in), optional :: kq
integer(kind=ip), intent(in), optional :: kr
integer(kind=ip), intent(in), optional :: ks
real(kind=wp), intent(in), optional, dimension(:) :: x
real(kind=wp), intent(in), optional, dimension(:) :: y
real(kind=wp), intent(in), optional, dimension(:) :: z
real(kind=wp), intent(in), optional, dimension(:) :: q
real(kind=wp), intent(in), optional, dimension(:) :: r
real(kind=wp), intent(in), optional, dimension(:) :: s
real(kind=wp), intent(in), optional, dimension(:) :: tx
real(kind=wp), intent(in), optional, dimension(:) :: ty
real(kind=wp), intent(in), optional, dimension(:) :: tz
real(kind=wp), intent(in), optional, dimension(:) :: tq
real(kind=wp), intent(in), optional, dimension(:) :: tr
real(kind=wp), intent(in), optional, dimension(:) :: ts
real(kind=wp), intent(in), optional, dimension(:) :: f1
real(kind=wp), intent(in), optional, dimension(:,:) :: f2
real(kind=wp), intent(in), optional, dimension(:,:,:) :: f3
real(kind=wp), intent(in), optional, dimension(:,:,:,:) :: f4
real(kind=wp), intent(in), optional, dimension(:,:,:,:,:) :: f5
real(kind=wp), intent(in), optional, dimension(:,:,:,:,:,:) :: f6
real(kind=wp), intent(in), optional, dimension(:) :: bcoef1
real(kind=wp), intent(in), optional, dimension(:,:) :: bcoef2
real(kind=wp), intent(in), optional, dimension(:,:,:) :: bcoef3
real(kind=wp), intent(in), optional, dimension(:,:,:,:) :: bcoef4
real(kind=wp), intent(in), optional, dimension(:,:,:,:,:) :: bcoef5
real(kind=wp), intent(in), optional, dimension(:,:,:,:,:,:) :: bcoef6
logical, intent(in), optional :: alt

using the alt routine where 1st or 2nd deriv is fixed at endpoints [default is False]

logical, intent(out) :: status_ok

private pure subroutine dbknot(x, n, k, t)

dbknot chooses a knot sequence for interpolation of order k at the data points x(i), i=1,..,n. the n+k knots are placed in the array t. k knots are placed at each endpoint and not-a-knot end conditions are used. the remaining knots are placed at data points if n is even and between data points if n is odd. the rightmost knot is shifted slightly to the right to insure proper interpolation at x(n) (see page 350 of the reference).

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(:) :: x
integer(kind=ip), intent(in) :: n

dimension of x

integer(kind=ip), intent(in) :: k
real(kind=wp), intent(out), dimension(:) :: t

private pure subroutine dbtpcf(x, n, fcn, ldf, nf, t, k, bcoef, work, iflag)

dbtpcf computes b-spline interpolation coefficients for nf sets of data stored in the columns of the array fcn. the b-spline coefficients are stored in the rows of bcoef however. each interpolation is based on the n abcissa stored in the array x, and the n+k knots stored in the array t. the order of each interpolation is k.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(:) :: x
integer(kind=ip), intent(in) :: n

dimension of x

real(kind=wp), intent(in), dimension(ldf,nf) :: fcn
integer(kind=ip), intent(in) :: ldf
integer(kind=ip), intent(in) :: nf
real(kind=wp), intent(in), dimension(:) :: t
integer(kind=ip), intent(in) :: k
real(kind=wp), intent(out), dimension(nf,n) :: bcoef
real(kind=wp), intent(out), dimension(*) :: work

work array of size >= 2*k*(n+1)

integer(kind=ip), intent(out) :: iflag

status flag:

Read more…

private pure subroutine dbintk(x, y, t, n, k, bcoef, q, work, iflag)

dbintk produces the b-spline coefficients, bcoef, of the b-spline of order k with knots t(i), i=1,...,n+k, which takes on the value y(i) at x(i), i=1,...,n. the spline or any of its derivatives can be evaluated by calls to dbvalu.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(n) :: x

vector of length n containing data point abscissa in strictly increasing order.

real(kind=wp), intent(in), dimension(n) :: y

corresponding vector of length n containing data point ordinates.

real(kind=wp), intent(in), dimension(*) :: t

knot vector of length n+k since t(1),..,t(k) <= x(1) and t(n+1),..,t(n+k)

Read more…
integer(kind=ip), intent(in) :: n

number of data points, n >= k

integer(kind=ip), intent(in) :: k

order of the spline, k >= 1

real(kind=wp), intent(out), dimension(n) :: bcoef

a vector of length n containing the b-spline coefficients

real(kind=wp), intent(out), dimension(*) :: q

a work vector of length (2k-1)n, containing the triangular factorization of the coefficient matrix of the linear system being solved. the coefficients for the interpolant of an additional data set (x(i),yy(i)), i=1,...,n with the same abscissa can be obtained by loading yy into bcoef and then executing call dbnslv(q,2k-1,n,k-1,k-1,bcoef)

real(kind=wp), intent(out), dimension(*) :: work

work vector of length 2*k

integer(kind=ip), intent(out) :: iflag Read more…

private pure subroutine dbnfac(w, nroww, nrow, nbandl, nbandu, iflag)

Returns in w the LU-factorization (without pivoting) of the banded matrix a of order nrow with (nbandl + 1 + nbandu) bands or diagonals in the work array w .

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout), dimension(nroww,nrow) :: w

work array. See header for details.

integer(kind=ip), intent(in) :: nroww

row dimension of the work array w. must be >= nbandl + 1 + nbandu.

integer(kind=ip), intent(in) :: nrow

matrix order

integer(kind=ip), intent(in) :: nbandl

number of bands of a below the main diagonal

integer(kind=ip), intent(in) :: nbandu

number of bands of a above the main diagonal

integer(kind=ip), intent(out) :: iflag

indicating success(=1) or failure (=2)

private pure subroutine dbnslv(w, nroww, nrow, nbandl, nbandu, b)

Companion routine to dbnfac. it returns the solution x of the linear system a*x = b in place of b, given the lu-factorization for a in the work array w from dbnfac.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(nroww,nrow) :: w

describes the lu-factorization of a banded matrix a of order nrow as constructed in dbnfac.

integer(kind=ip), intent(in) :: nroww

describes the lu-factorization of a banded matrix a of order nrow as constructed in dbnfac.

integer(kind=ip), intent(in) :: nrow

describes the lu-factorization of a banded matrix a of order nrow as constructed in dbnfac.

integer(kind=ip), intent(in) :: nbandl

describes the lu-factorization of a banded matrix a of order nrow as constructed in dbnfac.

integer(kind=ip), intent(in) :: nbandu

describes the lu-factorization of a banded matrix a of order nrow as constructed in dbnfac.

real(kind=wp), intent(inout), dimension(nrow) :: b Read more…

private pure subroutine dbspvn(t, jhigh, k, index, x, ileft, vnikx, work, iwork, iflag)

Calculates the value of all (possibly) nonzero basis functions at x of order max(jhigh,(j+1)*(index-1)), where t(k) <= x <= t(n+1) and j=iwork is set inside the routine on the first call when index=1. ileft is such that t(ileft) <= x < t(ileft+1). a call to dintrv(t,n+1,x,ilo,ileft,mflag) produces the proper ileft. dbspvn calculates using the basic algorithm needed in dbspvd. if only basis functions are desired, setting jhigh=k and index=1 can be faster than calling dbspvd, but extra coding is required for derivatives (index=2) and dbspvd is set up for this purpose.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(*) :: t

knot vector of length n+k, where n = number of b-spline basis functions n = sum of knot multiplicities-k dimension t(ileft+jhigh)

integer(kind=ip), intent(in) :: jhigh

order of b-spline, 1 <= jhigh <= k

integer(kind=ip), intent(in) :: k

highest possible order

integer(kind=ip), intent(in) :: index

index = 1 gives basis functions of order jhigh = 2 denotes previous entry with work, iwork values saved for subsequent calls to dbspvn.

real(kind=wp), intent(in) :: x

argument of basis functions, t(k) <= x <= t(n+1)

integer(kind=ip), intent(in) :: ileft

largest integer such that t(ileft) <= x < t(ileft+1)

real(kind=wp), intent(out), dimension(k) :: vnikx

vector of length k for spline values.

real(kind=wp), intent(inout), dimension(*) :: work

a work vector of length 2*k

integer(kind=ip), intent(inout) :: iwork

a work parameter. both work and iwork contain information necessary to continue for index = 2. when index = 1 exclusively, these are scratch variables and can be used for other purposes.

integer(kind=ip), intent(out) :: iflag Read more…

private pure subroutine dbvalu(t, a, n, k, ideriv, x, inbv, work, iflag, val, extrap)

Evaluates the b-representation (t,a,n,k) of a b-spline at x for the function value on ideriv=0 or any of its derivatives on ideriv=1,2,...,k-1. right limiting values (right derivatives) are returned except at the right end point x=t(n+1) where left limiting values are computed. the spline is defined on t(k) x t(n+1). dbvalu returns a fatal error message when x is outside of this interval.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(:) :: t

knot vector of length n+k

real(kind=wp), intent(in), dimension(n) :: a

b-spline coefficient vector of length n

integer(kind=ip), intent(in) :: n

number of b-spline coefficients. (sum of knot multiplicities-k)

integer(kind=ip), intent(in) :: k

order of the b-spline, k >= 1

integer(kind=ip), intent(in) :: ideriv

order of the derivative, 0 <= ideriv <= k-1. ideriv = 0 returns the b-spline value

real(kind=wp), intent(in) :: x

argument, t(k) <= x <= t(n+1)

integer(kind=ip), intent(inout) :: inbv

an initialization parameter which must be set to 1 the first time dbvalu is called. inbv contains information for efficient processing after the initial call and inbv must not be changed by the user. distinct splines require distinct inbv parameters.

real(kind=wp), intent(inout), dimension(:) :: work

work vector of length at least 3*k

integer(kind=ip), intent(out) :: iflag

status flag:

Read more…
real(kind=wp), intent(out) :: val

the interpolated value

logical, intent(in), optional :: extrap

if extrapolation is allowed (if not present, default is False)

private pure subroutine dintrv(xt, lxt, xx, ilo, ileft, mflag, extrap)

Computes the largest integer ileft in 1 ileft lxt such that xt(ileft) x where xt(*) is a subdivision of the x interval. precisely,

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(:) :: xt

a knot or break point vector of length lxt

integer(kind=ip), intent(in) :: lxt

length of the xt vector

real(kind=wp), intent(in) :: xx

argument

integer(kind=ip), intent(inout) :: ilo

an initialization parameter which must be set to 1 the first time the spline array xt is processed by dintrv. ilo contains information for efficient processing after the initial call and ilo must not be changed by the user. distinct splines require distinct ilo parameters.

integer(kind=ip), intent(out) :: ileft

largest integer satisfying xt(ileft) x

integer(kind=ip), intent(out) :: mflag

signals when x lies out of bounds

logical, intent(in), optional :: extrap

if extrapolation is allowed (if not present, default is False)

private pure subroutine dbint4(x, y, ndata, ibcl, ibcr, fbcl, fbcr, kntopt, tleft, tright, t, bcoef, n, k, w, iflag)

DBINT4 computes the B representation (t,bcoef,n,k) of a cubic spline (k=4) which interpolates data (x(i),y(i)),i=1,ndata.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(:) :: x

x vector of abscissae of length ndata, distinct and in increasing order

real(kind=wp), intent(in), dimension(:) :: y

y vector of ordinates of length ndata

integer(kind=ip), intent(in) :: ndata

number of data points, ndata >= 2

integer(kind=ip), intent(in) :: ibcl

selection parameter for left boundary condition:

Read more…
integer(kind=ip), intent(in) :: ibcr

selection parameter for right boundary condition:

Read more…
real(kind=wp), intent(in) :: fbcl

left boundary values governed by ibcl

real(kind=wp), intent(in) :: fbcr

right boundary values governed by ibcr

integer(kind=ip), intent(in) :: kntopt

knot selection parameter:

Read more…
real(kind=wp), intent(in), dimension(3) :: tleft

when kntopt = 3: t(1:3) in increasing order to be supplied by the user.

real(kind=wp), intent(in), dimension(3) :: tright

when kntopt = 3: t(n+2:n+4) in increasing order to be supplied by the user.

real(kind=wp), intent(out), dimension(:) :: t

knot array of length n+4

real(kind=wp), intent(out), dimension(:) :: bcoef

b spline coefficient array of length n

integer(kind=ip), intent(out) :: n

number of coefficients, n=ndata+2

integer(kind=ip), intent(out) :: k

order of spline, k=4

real(kind=wp), intent(inout), dimension(5,ndata+2) :: w

work array

integer(kind=ip), intent(out) :: iflag

status flag:

Read more…

private pure subroutine dbspvd(t, k, nderiv, x, ileft, ldvnik, vnikx, work, iflag)

DBSPVD calculates the value and all derivatives of order less than nderiv of all basis functions which do not (possibly) vanish at x. ileft is input such that t(ileft) <= x < t(ileft+1). A call to dintrv(t,n+1,x, ilo,ileft,mflag) will produce the proper ileft. The output of dbspvd is a matrix vnikx(i,j) of dimension at least (k,nderiv) whose columns contain the k nonzero basis functions and their nderiv-1 right derivatives at x, i=1,k, j=1,nderiv. These basis functions have indices ileft-k+i, i=1,k, k <= ileft <= n. The nonzero part of the i-th basis function lies in (t(i),t(i+k)), i=1,n).

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(:) :: t

knot vector of length n+k, where n = number of b-spline basis functions n = sum of knot multiplicities-k

integer(kind=ip), intent(in) :: k

order of the b-spline, k >= 1

integer(kind=ip), intent(in) :: nderiv

number of derivatives = nderiv-1, 1 <= nderiv <= k

real(kind=wp), intent(in) :: x

argument of basis functions, t(k) <= x <= t(n+1)

integer(kind=ip), intent(in) :: ileft

largest integer such that t(ileft) <= x < t(ileft+1)

integer(kind=ip), intent(in) :: ldvnik

leading dimension of matrix vnikx

real(kind=wp), intent(out), dimension(ldvnik,nderiv) :: vnikx

matrix of dimension at least (k,nderiv) containing the nonzero basis functions at x and their derivatives columnwise.

real(kind=wp), intent(out), dimension(*) :: work

a work vector of length (k+1)*(k+2)/2

integer(kind=ip), intent(out) :: iflag

status flag:

Read more…

private pure subroutine dbsqad(t, bcoef, n, k, x1, x2, bquad, work, iflag)

DBSQAD computes the integral on (x1,x2) of a k-th order b-spline using the b-representation (t,bcoef,n,k). orders k as high as 20 are permitted by applying a 2, 6, or 10 point gauss formula on subintervals of (x1,x2) which are formed by included (distinct) knots.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(:) :: t

knot array of length n+k

real(kind=wp), intent(in), dimension(:) :: bcoef

b-spline coefficient array of length n

integer(kind=ip), intent(in) :: n

length of coefficient array

integer(kind=ip), intent(in) :: k

order of b-spline, 1 <= k <= 20

real(kind=wp), intent(in) :: x1

end point of quadrature interval in t(k) <= x <= t(n+1)

real(kind=wp), intent(in) :: x2

end point of quadrature interval in t(k) <= x <= t(n+1)

real(kind=wp), intent(out) :: bquad

integral of the b-spline over (x1,x2)

real(kind=wp), intent(inout), dimension(:) :: work

work vector of length 3*k

integer(kind=ip), intent(out) :: iflag

status flag:

Read more…

private subroutine dbfqad(f, t, bcoef, n, k, id, x1, x2, tol, quad, iflag, work)

dbfqad computes the integral on (x1,x2) of a product of a function f and the id-th derivative of a k-th order b-spline, using the b-representation (t,bcoef,n,k). (x1,x2) must be a subinterval of t(k) <= x <= t(n+1). an integration routine, dbsgq8 (a modification of gaus8), integrates the product on subintervals of (x1,x2) formed by included (distinct) knots

Read more…

Arguments

Type IntentOptional Attributes Name
procedure(b1fqad_func) :: f

external function of one argument for the integrand bf(x)=f(x)*dbvalu(t,bcoef,n,k,id,x,inbv,work)

real(kind=wp), intent(in), dimension(n+k) :: t

knot array

real(kind=wp), intent(in), dimension(n) :: bcoef

coefficient array

integer(kind=ip), intent(in) :: n

length of coefficient array

integer(kind=ip), intent(in) :: k

order of b-spline, k >= 1

integer(kind=ip), intent(in) :: id

order of the spline derivative, 0 <= id <= k-1 id=0 gives the spline function

real(kind=wp), intent(in) :: x1

left point of quadrature interval in t(k) <= x <= t(n+1)

real(kind=wp), intent(in) :: x2

right point of quadrature interval in t(k) <= x <= t(n+1)

real(kind=wp), intent(in) :: tol

desired accuracy for the quadrature, suggest 10*dtol < tol <= 0.1 where dtol is the maximum of 1.0e-300 and real(wp) unit roundoff for the machine

real(kind=wp), intent(out) :: quad

integral of bf(x) on (x1,x2)

integer(kind=ip), intent(out) :: iflag

status flag:

Read more…
real(kind=wp), intent(inout), dimension(:) :: work

work vector of length 3*k

private subroutine dbsgq8(fun, xt, bc, n, kk, id, a, b, inbv, err, ans, iflag, work)

DBSGQ8, a modification of gaus8, integrates the product of fun(x) by the id-th derivative of a spline dbvalu between limits a and b using an adaptive 8-point Legendre-Gauss algorithm.

Read more…

Arguments

Type IntentOptional Attributes Name
procedure(b1fqad_func) :: fun

name of external function of one argument which multiplies dbvalu.

real(kind=wp), intent(in), dimension(:) :: xt

knot array for dbvalu

real(kind=wp), intent(in), dimension(n) :: bc

b-coefficient array for dbvalu

integer(kind=ip), intent(in) :: n

number of b-coefficients for dbvalu

integer(kind=ip), intent(in) :: kk

order of the spline, kk>=1

integer(kind=ip), intent(in) :: id

Order of the spline derivative, 0<=id<=kk-1

real(kind=wp), intent(in) :: a

lower limit of integral

real(kind=wp), intent(in) :: b

upper limit of integral (may be less than a)

integer(kind=ip), intent(inout) :: inbv

initialization parameter for dbvalu

real(kind=wp), intent(inout) :: err

IN: is a requested pseudorelative error tolerance. normally pick a value of abs(err)<1e-3. ans will normally have no more error than abs(err) times the integral of the absolute value of fun(x)*[[dbvalu]]().

Read more…
real(kind=wp), intent(out) :: ans

computed value of integral

integer(kind=ip), intent(out) :: iflag

a status code:

Read more…
real(kind=wp), intent(inout), dimension(:) :: work

work vector of length 3*k for dbvalu