stepsize_class_tolerance Function

private pure function stepsize_class_tolerance(me, rtol, atol, x, xf) result(tol)

The error tolerance vector for a step from x to xf: rtol*s + atol, where s depends on the rtol_scaling option.

Type Bound

stepsize_class

Arguments

Type IntentOptional Attributes Name
class(stepsize_class), intent(in) :: me
real(kind=wp), intent(in), dimension(:) :: rtol

relative tolerance

real(kind=wp), intent(in), dimension(:) :: atol

absolute tolerance

real(kind=wp), intent(in), dimension(:) :: x

state at the start of the step

real(kind=wp), intent(in), dimension(:) :: xf

state at the end of the step

Return Value real(kind=wp), dimension(size(x))

the error tolerance for each component


Called by

proc~~stepsize_class_tolerance~~CalledByGraph proc~stepsize_class_tolerance stepsize_class%stepsize_class_tolerance proc~integrate_to_event_variable_step rk_variable_step_class%integrate_to_event_variable_step proc~integrate_to_event_variable_step->proc~stepsize_class_tolerance proc~integrate_variable_step rk_variable_step_class%integrate_variable_step proc~integrate_variable_step->proc~stepsize_class_tolerance program~rklib_example rklib_example program~rklib_example->proc~integrate_variable_step

Source Code

    pure function stepsize_class_tolerance(me,rtol,atol,x,xf) result(tol)

    implicit none

    class(stepsize_class),intent(in) :: me
    real(wp),dimension(:),intent(in) :: rtol !! relative tolerance
    real(wp),dimension(:),intent(in) :: atol !! absolute tolerance
    real(wp),dimension(:),intent(in) :: x    !! state at the start of the step
    real(wp),dimension(:),intent(in) :: xf   !! state at the end of the step
    real(wp),dimension(size(x)) :: tol       !! the error tolerance for each component

    select case (me%rtol_scaling)
    case (2)
        tol = rtol * max(abs(x),abs(xf)) + atol
    case default
        tol = rtol * abs(xf) + atol
    end select

    end function stepsize_class_tolerance