roots_1d Subroutine

private pure subroutine roots_1d(me, a, x, iflag)

All the roots of for a bspline_1d. This is a wrapper for db1root.

Type Bound

bspline_1d

Arguments

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

the spline

real(kind=wp), intent(in) :: a

the value to solve for

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

the roots, in increasing order (size 0 if there are none)

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

status flag (see db1root)


Calls

proc~~roots_1d~~CallsGraph proc~roots_1d bspline_1d%roots_1d proc~db1root db1root proc~roots_1d->proc~db1root proc~check_root_inputs check_root_inputs proc~db1root->proc~check_root_inputs proc~dbvalu dbvalu proc~db1root->proc~dbvalu proc~in_flat_region in_flat_region proc~db1root->proc~in_flat_region proc~root_dup_tol root_dup_tol proc~db1root->proc~root_dup_tol proc~sort_unique sort_unique proc~db1root->proc~sort_unique proc~spline_derivative spline_derivative proc~db1root->proc~spline_derivative proc~spline_roots spline_roots proc~db1root->proc~spline_roots proc~dintrv dintrv proc~dbvalu->proc~dintrv proc~in_flat_region->proc~dintrv proc~spline_roots->proc~dbvalu proc~spline_roots->proc~in_flat_region proc~spline_roots->proc~root_dup_tol proc~spline_roots->proc~sort_unique proc~get_temp_x_for_extrap get_temp_x_for_extrap proc~dintrv->proc~get_temp_x_for_extrap

Called by

proc~~roots_1d~~CalledByGraph proc~roots_1d bspline_1d%roots_1d proc~inverse_1d bspline_1d%inverse_1d proc~inverse_1d->proc~roots_1d

Source Code

    pure subroutine roots_1d(me,a,x,iflag)

    implicit none

    class(bspline_1d),intent(inout)               :: me  !! the spline
    real(wp),intent(in)                           :: a      !! the value to solve for
    real(wp),dimension(:),allocatable,intent(out) :: x      !! the roots, in increasing order
                                                            !! (size 0 if there are none)
    integer(ip),intent(out)                       :: iflag  !! status flag (see [[db1root]])

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

    end subroutine roots_1d