root_finding_m Module

Routines for finding zeros



Abstract Interfaces

abstract interface

  • public function func_if(this, t, iuser, ruser)

    Defines interface of function for find_zero

    Arguments

    Type IntentOptional Attributes Name
    class(func_1D_t), intent(in) :: this

    Instance of type

    real(kind=DP), intent(in) :: t

    Abscissa

    integer, intent(in) :: iuser(:)

    Integer parameters of function

    real(kind=DP), intent(in) :: ruser(:)

    Real parameters of function f

    Return Value real(kind=dp)


Derived Types

type, public, abstract ::  func_1D_t

Defines function type for find_zero

Type-Bound Procedures

procedure(func_if), public, deferred :: func

Subroutines

public subroutine find_zero(a, b, tol, f, iuser, ruser, xzero, ifail)

Finds the zero of function f within interval [a,b] Wrapper for Fortran 77 routine in zeroin.f

Arguments

Type IntentOptional Attributes Name
real(kind=DP), intent(in) :: a

Left limit of interval

real(kind=DP), intent(in) :: b

Right limit of interval

real(kind=DP), intent(in) :: tol

Absolute tolerance of result

class(func_1D_t), intent(in), target :: f

Function f

integer, intent(in), contiguous, target :: iuser(:)

Integer parameters of function f

real(kind=DP), intent(in), contiguous, target :: ruser(:)

Real parameters of function f

real(kind=DP), intent(out) :: xzero

On success: zero of function f

integer, intent(out) :: ifail

On success = 0, otherwise -1