db5ink_multi Subroutine

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

Multiple-output version of db5ink: interpolates nf functions on the same grid, with the same knots. The last dimension of fcn and bcoef is the output index. Evaluate them with db5val (multiple-output version).

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,nf) array of function values to interpolate: fcn(i1,i2,i3,i4,i5,j) is output j at grid point (x(i1),y(i2),z(i3),q(i4),r(i5))

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

The order of spline pieces in

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

The order of spline pieces in

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

The order of spline pieces in

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

The order of spline pieces in

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

The order of spline pieces in

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

knot sequence flag (see db5ink_default)

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

The (nx+kx) knots in the direction

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

The (ny+ky) knots in the direction

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

The (nz+kz) knots in the direction

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

The (nq+kq) knots in the direction

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

The (nr+kr) knots in the direction

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

(nx,ny,nz,nq,nr,nf) array of b-spline coefficients

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

status flag (see db5ink_default), or 6001 if fcn and bcoef do not have the same number of outputs (or it is zero)


Calls

proc~~db5ink_multi~~CallsGraph proc~db5ink_multi db5ink_multi proc~db5ink_default db5ink_default proc~db5ink_multi->proc~db5ink_default proc~check_inputs check_inputs proc~db5ink_default->proc~check_inputs proc~dbknot dbknot proc~db5ink_default->proc~dbknot proc~dbtpcf dbtpcf proc~db5ink_default->proc~dbtpcf proc~dbintk dbintk proc~dbtpcf->proc~dbintk proc~dbnslv dbnslv proc~dbtpcf->proc~dbnslv proc~dbintk->proc~dbnslv proc~dbnfac dbnfac proc~dbintk->proc~dbnfac proc~dbspvn dbspvn proc~dbintk->proc~dbspvn

Called by

proc~~db5ink_multi~~CalledByGraph proc~db5ink_multi db5ink_multi interface~db5ink db5ink interface~db5ink->proc~db5ink_multi proc~initialize_5d_auto_knots bspline_5d%initialize_5d_auto_knots proc~initialize_5d_auto_knots->interface~db5ink proc~initialize_5d_auto_knots_multi bspline_5d%initialize_5d_auto_knots_multi proc~initialize_5d_auto_knots_multi->interface~db5ink proc~initialize_5d_specify_knots bspline_5d%initialize_5d_specify_knots proc~initialize_5d_specify_knots->interface~db5ink proc~initialize_5d_specify_knots_multi bspline_5d%initialize_5d_specify_knots_multi proc~initialize_5d_specify_knots_multi->interface~db5ink proc~bspline_5d_constructor_auto_knots bspline_5d_constructor_auto_knots proc~bspline_5d_constructor_auto_knots->proc~initialize_5d_auto_knots proc~bspline_5d_constructor_specify_knots bspline_5d_constructor_specify_knots proc~bspline_5d_constructor_specify_knots->proc~initialize_5d_specify_knots interface~bspline_5d bspline_5d interface~bspline_5d->proc~bspline_5d_constructor_auto_knots interface~bspline_5d->proc~bspline_5d_constructor_specify_knots

Source Code

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

    implicit none

    integer(ip),intent(in)              :: nx     !! Number of \(x\) abcissae
    integer(ip),intent(in)              :: ny     !! Number of \(y\) abcissae
    integer(ip),intent(in)              :: nz     !! Number of \(z\) abcissae
    integer(ip),intent(in)              :: nq     !! Number of \(q\) abcissae
    integer(ip),intent(in)              :: nr     !! Number of \(r\) abcissae
    integer(ip),intent(in)              :: kx     !! The order of spline pieces in \(x\)
    integer(ip),intent(in)              :: ky     !! The order of spline pieces in \(y\)
    integer(ip),intent(in)              :: kz     !! The order of spline pieces in \(z\)
    integer(ip),intent(in)              :: kq     !! The order of spline pieces in \(q\)
    integer(ip),intent(in)              :: kr     !! The order of spline pieces in \(r\)
    real(wp),dimension(:),intent(in)    :: x      !! `(nx)` array of \(x\) abcissae. Must be strictly increasing.
    real(wp),dimension(:),intent(in)    :: y      !! `(ny)` array of \(y\) abcissae. Must be strictly increasing.
    real(wp),dimension(:),intent(in)    :: z      !! `(nz)` array of \(z\) abcissae. Must be strictly increasing.
    real(wp),dimension(:),intent(in)    :: q      !! `(nq)` array of \(q\) abcissae. Must be strictly increasing.
    real(wp),dimension(:),intent(in)    :: r      !! `(nr)` array of \(r\) abcissae. Must be strictly increasing.
    real(wp),dimension(:,:,:,:,:,:),intent(in) :: fcn  !! `(nx,ny,nz,nq,nr,nf)` array of function values to interpolate:
                                                   !! `fcn(i1,i2,i3,i4,i5,j)` is output `j` at grid point
                                                   !! (`x(i1)`,`y(i2)`,`z(i3)`,`q(i4)`,`r(i5)`)
    integer(ip),intent(in)              :: iknot  !! knot sequence flag (see [[db5ink_default]])
    real(wp),dimension(:),intent(inout) :: tx     !! The `(nx+kx)` knots in the \(x\) direction
    real(wp),dimension(:),intent(inout) :: ty     !! The `(ny+ky)` knots in the \(y\) direction
    real(wp),dimension(:),intent(inout) :: tz     !! The `(nz+kz)` knots in the \(z\) direction
    real(wp),dimension(:),intent(inout) :: tq     !! The `(nq+kq)` knots in the \(q\) direction
    real(wp),dimension(:),intent(inout) :: tr     !! The `(nr+kr)` knots in the \(r\) direction
    real(wp),dimension(:,:,:,:,:,:),intent(out) :: bcoef  !! `(nx,ny,nz,nq,nr,nf)` array of b-spline coefficients
    integer(ip),intent(out)             :: iflag  !! status flag (see [[db5ink_default]]),
                                                  !! or 6001 if `fcn` and `bcoef` do not have the
                                                  !! same number of outputs (or it is zero)

    integer(ip) :: nf  !! number of outputs
    integer(ip) :: j   !! output index

    nf = size(fcn,6,kind=ip)
    if (nf<1_ip .or. size(bcoef,6,kind=ip)/=nf) then
        iflag = 6001_ip
        return
    end if

    ! the knots are computed (if iknot=0) for the first output, and then reused
    do j = 1_ip, nf
        call db5ink_default(x,nx,y,ny,z,nz,q,nq,r,nr,fcn(:,:,:,:,:,j),kx,ky,kz,kq,kr,merge(iknot,1_ip,j==1_ip),&
                  tx,ty,tz,tq,tr,bcoef(:,:,:,:,:,j),iflag)
        if (iflag/=0_ip) return
    end do

    end subroutine db5ink_multi