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.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in), | dimension(:) | :: | errors |
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