get_coefficients_2d Subroutine

private pure subroutine get_coefficients_2d(me, bcoef, iflag)

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

Type Bound

bspline_2d

Arguments

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

the spline

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

(nx,ny) 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_2d(me,bcoef,iflag)

    implicit none

    class(bspline_2d),intent(inout) :: me  !! the spline
    real(wp),dimension(:,:),allocatable,intent(out) :: bcoef  !! `(nx,ny)` 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,0))
    else if (me%initialized) then
        bcoef = me%bcoef(:,:,1)
        iflag = 0_ip
    else
        allocate(bcoef(0,0))
        iflag = 1_ip
    end if
    me%iflag = iflag

    end subroutine get_coefficients_2d