Check for error occurencies.
If is_severe=.true.
an stop is called.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrator_object), | intent(in) | :: | self | Integrator. |
||
logical, | intent(in), | optional | :: | is_severe | Flag to activate severe faliure, namely errors trigger a stop. |
subroutine check_error(self, is_severe)
!< Check for error occurencies.
!<
!< If `is_severe=.true.` an stop is called.
class(integrator_object), intent(in) :: self !< Integrator.
logical, intent(in), optional :: is_severe !< Flag to activate severe faliure, namely errors trigger a stop.
if (self%error /= 0) then
if (allocated(self%error_message)) then
write(stderr, '(A)')'error: '//self%error_message
else
write(stderr, '(A)')'error: an obscure error occurred!'
endif
write(stderr, '(A,I4)')'error code: ', self%error
if (present(is_severe)) then
if (is_severe) stop
endif
endif
endsubroutine check_error