initialize_6d_specify_knots_multi Subroutine

private pure subroutine initialize_6d_specify_knots_multi(me, x, y, z, q, r, s, fcn, kx, ky, kz, kq, kr, ks, tx, ty, tz, tq, tr, ts, iflag, extrap)

Initialize a bspline_6d type with multiple outputs: nf functions of the same inputs, on the same grid (with user-specified knots). The last dimension of fcn is the output index. This is a wrapper for db6ink (multiple-output version).

Type Bound

bspline_6d

Arguments

Type IntentOptional Attributes Name
class(bspline_6d), intent(inout) :: me

the spline

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

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

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

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

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

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

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

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

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

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

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

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

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

(nx,ny,nz,nq,nr,ns,nf) array of function values to interpolate (the last dimension is the output index)

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) :: ks

The order of spline pieces in

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

The (nx+kx) knots in the direction.

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

The (ny+ky) knots in the direction.

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

The (nz+kz) knots in the direction.

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

The (nq+kq) knots in the direction.

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

The (nr+kr) knots in the direction.

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

The (ns+ks) knots in the direction.

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

status flag (see db6ink)

logical, intent(in), optional :: extrap

if true, then extrapolation is allowed (default is false)


Calls

proc~~initialize_6d_specify_knots_multi~~CallsGraph proc~initialize_6d_specify_knots_multi bspline_6d%initialize_6d_specify_knots_multi interface~db6ink db6ink proc~initialize_6d_specify_knots_multi->interface~db6ink proc~check_knot_vectors_sizes check_knot_vectors_sizes proc~initialize_6d_specify_knots_multi->proc~check_knot_vectors_sizes proc~destroy_6d bspline_6d%destroy_6d proc~initialize_6d_specify_knots_multi->proc~destroy_6d proc~set_extrap_flag bspline_class%set_extrap_flag proc~initialize_6d_specify_knots_multi->proc~set_extrap_flag proc~db6ink_default db6ink_default interface~db6ink->proc~db6ink_default proc~db6ink_multi db6ink_multi interface~db6ink->proc~db6ink_multi proc~destroy_base bspline_class%destroy_base proc~destroy_6d->proc~destroy_base proc~check_inputs check_inputs proc~db6ink_default->proc~check_inputs proc~dbknot dbknot proc~db6ink_default->proc~dbknot proc~dbtpcf dbtpcf proc~db6ink_default->proc~dbtpcf proc~db6ink_multi->proc~db6ink_default 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

Source Code

    pure subroutine initialize_6d_specify_knots_multi(me,x,y,z,q,r,s,fcn,kx,ky,kz,kq,kr,ks,tx,ty,tz,tq,tr,ts,iflag,extrap)

    implicit none

    class(bspline_6d),intent(inout) :: me  !! the spline
    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) :: s  !! `(ns)` array of \(s\) abcissae. Must be strictly increasing.
    real(wp),dimension(:,:,:,:,:,:,:),intent(in) :: fcn  !! `(nx,ny,nz,nq,nr,ns,nf)` array of function values to interpolate
                                                  !! (the last dimension is the output index)
    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\)
    integer(ip),intent(in) :: ks  !! The order of spline pieces in \(s\)
    real(wp),dimension(:),intent(in) :: tx  !! The `(nx+kx)` knots in the \(x\) direction.
    real(wp),dimension(:),intent(in) :: ty  !! The `(ny+ky)` knots in the \(y\) direction.
    real(wp),dimension(:),intent(in) :: tz  !! The `(nz+kz)` knots in the \(z\) direction.
    real(wp),dimension(:),intent(in) :: tq  !! The `(nq+kq)` knots in the \(q\) direction.
    real(wp),dimension(:),intent(in) :: tr  !! The `(nr+kr)` knots in the \(r\) direction.
    real(wp),dimension(:),intent(in) :: ts  !! The `(ns+ks)` knots in the \(s\) direction.
    integer(ip),intent(out) :: iflag  !! status flag (see [[db6ink]])
    logical,intent(in),optional :: extrap  !! if true, then extrapolation is allowed
                                           !! (default is false)

    integer(ip),dimension(6) :: n  !! number of points in each direction
    integer(ip) :: nf  !! number of outputs

    call me%destroy()

    n(1) = size(x,kind=ip)
    n(2) = size(y,kind=ip)
    n(3) = size(z,kind=ip)
    n(4) = size(q,kind=ip)
    n(5) = size(r,kind=ip)
    n(6) = size(s,kind=ip)
    nf = size(fcn,7,kind=ip)

    call check_knot_vectors_sizes(nx=n(1),kx=kx,tx=tx,ny=n(2),ky=ky,ty=ty,nz=n(3),kz=kz,tz=tz,nq=n(4),kq=kq,tq=tq,nr=n(5),kr=kr,tr=tr,ns=n(6),ks=ks,ts=ts,iflag=iflag)
    if (iflag/=0_ip) then
        me%iflag = iflag
        return
    end if

    me%nx = n(1)
    me%ny = n(2)
    me%nz = n(3)
    me%nq = n(4)
    me%nr = n(5)
    me%ns = n(6)
    me%kx = kx
    me%ky = ky
    me%kz = kz
    me%kq = kq
    me%kr = kr
    me%ks = ks
    allocate(me%tx(n(1)+kx))
    allocate(me%ty(n(2)+ky))
    allocate(me%tz(n(3)+kz))
    allocate(me%tq(n(4)+kq))
    allocate(me%tr(n(5)+kr))
    allocate(me%ts(n(6)+ks))
    allocate(me%bcoef(n(1),n(2),n(3),n(4),n(5),n(6),nf))
    allocate(me%work_val_1(ky,kz,kq,kr,ks))
    allocate(me%work_val_2(kz,kq,kr,ks))
    allocate(me%work_val_3(kq,kr,ks))
    allocate(me%work_val_4(kr,ks))
    allocate(me%work_val_5(ks))
    allocate(me%work_val_6(3_ip*max(kx,ky,kz,kq,kr,ks)))

    me%tx = tx
    me%ty = ty
    me%tz = tz
    me%tq = tq
    me%tr = tr
    me%ts = ts
    call db6ink(x,n(1),y,n(2),z,n(3),q,n(4),r,n(5),s,n(6),fcn,kx,ky,kz,kq,kr,ks,1_ip,me%tx,me%ty,me%tz,me%tq,me%tr,me%ts,me%bcoef,iflag)

    if (iflag==0_ip) then
        me%nf = nf
        call me%set_extrap_flag(extrap)
    end if

    me%initialized = iflag==0_ip
    me%iflag = iflag

    end subroutine initialize_6d_specify_knots_multi