get_inverse_error Function

private pure function get_inverse_error(errors) result(inverse_error)

Returns the normalised inverse error estimate. In other words the error tolerance, rtol*errors(2) + atol, divided by the error estimate (plus a small number to avoid divide by zero).

Assumes that errors contains the global magnitude of the error estimate in the first element and the global maximum of the solution in the second element.

Arguments

Type IntentOptional Attributes Name
real, intent(in), dimension(:) :: errors

Return Value real


Contents

Source Code


Source Code

  real pure function get_inverse_error(errors) result(inverse_error)
    implicit none
    real, dimension(:), intent(in) :: errors
    inverse_error = (relative_tolerance * errors(2) + absolute_tolerance) / &
         (errors(1) + epsilon(errors(1)))
  end function get_inverse_error