initialize_6d_specify_knots Subroutine

private pure subroutine initialize_6d_specify_knots(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 user-specified knots). This is a wrapper for db6ink.

Type Bound

bspline_6d

Arguments

Type IntentOptional Attributes Name
class(bspline_6d), intent(inout) :: me
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) matrix of function values to interpolate. fcn(i,j,k,l,m,n) 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)

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

The (nx+kx) knots in the direction for the spline interpolant. Must be non-decreasing.

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

The (ny+ky) knots in the direction for the spline interpolant. Must be non-decreasing.

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

The (nz+kz) knots in the direction for the spline interpolant. Must be non-decreasing.

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

The (nq+kq) knots in the direction for the spline interpolant. Must be non-decreasing.

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

The (nr+kr) knots in the direction for the spline interpolant. Must be non-decreasing.

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

The (ns+ks) knots in the direction for the spline interpolant. Must be non-decreasing.

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~~CallsGraph proc~initialize_6d_specify_knots bspline_oo_module::bspline_6d%initialize_6d_specify_knots proc~check_knot_vectors_sizes bspline_oo_module::check_knot_vectors_sizes proc~initialize_6d_specify_knots->proc~check_knot_vectors_sizes proc~db6ink bspline_sub_module::db6ink proc~initialize_6d_specify_knots->proc~db6ink proc~destroy_6d bspline_oo_module::bspline_6d%destroy_6d proc~initialize_6d_specify_knots->proc~destroy_6d proc~set_extrap_flag bspline_oo_module::bspline_class%set_extrap_flag proc~initialize_6d_specify_knots->proc~set_extrap_flag proc~check_inputs bspline_sub_module::check_inputs proc~db6ink->proc~check_inputs proc~dbknot bspline_sub_module::dbknot proc~db6ink->proc~dbknot proc~dbtpcf bspline_sub_module::dbtpcf proc~db6ink->proc~dbtpcf proc~dbintk bspline_sub_module::dbintk proc~dbtpcf->proc~dbintk proc~dbnslv bspline_sub_module::dbnslv proc~dbtpcf->proc~dbnslv proc~dbintk->proc~dbnslv proc~dbnfac bspline_sub_module::dbnfac proc~dbintk->proc~dbnfac proc~dbspvn bspline_sub_module::dbspvn proc~dbintk->proc~dbspvn

Called by

proc~~initialize_6d_specify_knots~~CalledByGraph proc~initialize_6d_specify_knots bspline_oo_module::bspline_6d%initialize_6d_specify_knots proc~bspline_6d_constructor_specify_knots bspline_oo_module::bspline_6d_constructor_specify_knots proc~bspline_6d_constructor_specify_knots->proc~initialize_6d_specify_knots interface~bspline_6d bspline_oo_module::bspline_6d interface~bspline_6d->proc~bspline_6d_constructor_specify_knots

Source Code

    pure subroutine initialize_6d_specify_knots(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
    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)` matrix of function values to interpolate.
                                                      !! `fcn(i,j,k,l,m,n)` should contain the function value at the
                                                      !! point (`x(i)`,`y(j)`,`z(k)`,`q(l)`,`r(m)`,`s(n)`)
    integer(ip),intent(in)                     :: kx  !! The order of spline pieces in \(x\)
                                                      !! ( \( 2 \le k_x < n_x \) )
                                                      !! (order = polynomial degree + 1)
    integer(ip),intent(in)                     :: ky  !! The order of spline pieces in \(y\)
                                                      !! ( \( 2 \le k_y < n_y \) )
                                                      !! (order = polynomial degree + 1)
    integer(ip),intent(in)                     :: kz  !! The order of spline pieces in \(z\)
                                                      !! ( \( 2 \le k_z < n_z \) )
                                                      !! (order = polynomial degree + 1)
    integer(ip),intent(in)                     :: kq  !! The order of spline pieces in \(q\)
                                                      !! ( \( 2 \le k_q < n_q \) )
                                                      !! (order = polynomial degree + 1)
    integer(ip),intent(in)                     :: kr  !! The order of spline pieces in \(r\)
                                                      !! ( \( 2 \le k_r < n_r \) )
                                                      !! (order = polynomial degree + 1)
    integer(ip),intent(in)                     :: ks  !! The order of spline pieces in \(z\)
                                                      !! ( \( 2 \le k_z < n_z \) )
                                                      !! (order = polynomial degree + 1)
    real(wp),dimension(:),intent(in)           :: tx  !! The `(nx+kx)` knots in the \(x\) direction
                                                      !! for the spline interpolant.
                                                      !! Must be non-decreasing.
    real(wp),dimension(:),intent(in)           :: ty  !! The `(ny+ky)` knots in the \(y\) direction
                                                      !! for the spline interpolant.
                                                      !! Must be non-decreasing.
    real(wp),dimension(:),intent(in)           :: tz  !! The `(nz+kz)` knots in the \(z\) direction
                                                      !! for the spline interpolant.
                                                      !! Must be non-decreasing.
    real(wp),dimension(:),intent(in)           :: tq  !! The `(nq+kq)` knots in the \(q\) direction
                                                      !! for the spline interpolant.
                                                      !! Must be non-decreasing.
    real(wp),dimension(:),intent(in)           :: tr  !! The `(nr+kr)` knots in the \(r\) direction
                                                      !! for the spline interpolant.
                                                      !! Must be non-decreasing.
    real(wp),dimension(:),intent(in)           :: ts  !! The `(ns+ks)` knots in the \(s\) direction
                                                      !! for the spline interpolant.
                                                      !! Must be non-decreasing.
    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) :: nx,ny,nz,nq,nr,ns

    call me%destroy()

    nx = size(x,kind=ip)
    ny = size(y,kind=ip)
    nz = size(z,kind=ip)
    nq = size(q,kind=ip)
    nr = size(r,kind=ip)
    ns = size(s,kind=ip)

    call check_knot_vectors_sizes(nx=nx,kx=kx,tx=tx,&
                                  ny=ny,ky=ky,ty=ty,&
                                  nz=nz,kz=kz,tz=tz,&
                                  nq=nq,kq=kq,tq=tq,&
                                  nr=nr,kr=kr,tr=tr,&
                                  ns=ns,ks=ks,ts=ts,&
                                  iflag=iflag)

    if (iflag == 0_ip) then

        me%nx = nx
        me%ny = ny
        me%nz = nz
        me%nq = nq
        me%nr = nr
        me%ns = ns

        me%kx = kx
        me%ky = ky
        me%kz = kz
        me%kq = kq
        me%kr = kr
        me%ks = ks

        allocate(me%tx(nx+kx))
        allocate(me%ty(ny+ky))
        allocate(me%tz(nz+kz))
        allocate(me%tq(nq+kq))
        allocate(me%tr(nr+kr))
        allocate(me%ts(ns+ks))
        allocate(me%bcoef(nx,ny,nz,nq,nr,ns))
        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,nx,y,ny,z,nz,q,nq,r,nr,s,ns,&
                    fcn,&
                    kx,ky,kz,kq,kr,ks,&
                    1_ip,&
                    me%tx,me%ty,me%tz,me%tq,me%tr,me%ts,&
                    me%bcoef,iflag)

        call me%set_extrap_flag(extrap)

    end if

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

    end subroutine initialize_6d_specify_knots