get_coefficients_1d Subroutine

private pure subroutine get_coefficients_1d(me, bcoef, iflag)

Returns the b-spline coefficients of a bspline_1d. These are the values of the control points (see greville_abscissae for their locations).

Type Bound

bspline_1d

Arguments

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

the spline

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

(nx) array of b-spline coefficients

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

status flag: 0 if no errors, 1 if the class is not initialized


Source Code

    pure subroutine get_coefficients_1d(me,bcoef,iflag)

    implicit none

    class(bspline_1d),intent(inout) :: me  !! the spline
    real(wp),dimension(:),allocatable,intent(out) :: bcoef  !! `(nx)` array of b-spline coefficients
    integer(ip),intent(out) :: iflag  !! status flag: 0 if no errors,
                                      !! 1 if the class is not initialized

    if (me%initialized .and. me%nf/=1_ip) then
        iflag = 6003_ip  ! use the multiple-output version
        allocate(bcoef(0))
    else if (me%initialized) then
        bcoef = me%bcoef(:,1)
        iflag = 0_ip
    else
        allocate(bcoef(0))
        iflag = 1_ip
    end if
    me%iflag = iflag

    end subroutine get_coefficients_1d