initialize_5d_auto_knots_multi Subroutine

private pure subroutine initialize_5d_auto_knots_multi(me, x, y, z, q, r, fcn, kx, ky, kz, kq, kr, iflag, extrap)

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

Type Bound

bspline_5d

Arguments

Type IntentOptional Attributes Name
class(bspline_5d), 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(:,:,:,:,:,:) :: fcn

(nx,ny,nz,nq,nr,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(out) :: iflag

status flag (see db5ink)

logical, intent(in), optional :: extrap

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


Calls

proc~~initialize_5d_auto_knots_multi~~CallsGraph proc~initialize_5d_auto_knots_multi bspline_5d%initialize_5d_auto_knots_multi interface~db5ink db5ink proc~initialize_5d_auto_knots_multi->interface~db5ink proc~destroy_5d bspline_5d%destroy_5d proc~initialize_5d_auto_knots_multi->proc~destroy_5d proc~set_extrap_flag bspline_class%set_extrap_flag proc~initialize_5d_auto_knots_multi->proc~set_extrap_flag proc~db5ink_default db5ink_default interface~db5ink->proc~db5ink_default proc~db5ink_multi db5ink_multi interface~db5ink->proc~db5ink_multi proc~destroy_base bspline_class%destroy_base proc~destroy_5d->proc~destroy_base 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~db5ink_multi->proc~db5ink_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_5d_auto_knots_multi(me,x,y,z,q,r,fcn,kx,ky,kz,kq,kr,iflag,extrap)

    implicit none

    class(bspline_5d),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) :: fcn  !! `(nx,ny,nz,nq,nr,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(out) :: iflag  !! status flag (see [[db5ink]])
    logical,intent(in),optional :: extrap  !! if true, then extrapolation is allowed
                                           !! (default is false)

    integer(ip),dimension(5) :: 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)
    nf = size(fcn,6,kind=ip)

    me%nx = n(1)
    me%ny = n(2)
    me%nz = n(3)
    me%nq = n(4)
    me%nr = n(5)
    me%kx = kx
    me%ky = ky
    me%kz = kz
    me%kq = kq
    me%kr = kr
    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%bcoef(n(1),n(2),n(3),n(4),n(5),nf))
    allocate(me%work_val_1(ky,kz,kq,kr))
    allocate(me%work_val_2(kz,kq,kr))
    allocate(me%work_val_3(kq,kr))
    allocate(me%work_val_4(kr))
    allocate(me%work_val_5(3_ip*max(kx,ky,kz,kq,kr)))

    call db5ink(x,n(1),y,n(2),z,n(3),q,n(4),r,n(5),fcn,kx,ky,kz,kq,kr,0_ip,me%tx,me%ty,me%tz,me%tq,me%tr,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_5d_auto_knots_multi