rk_scheme_validate Function

private pure function rk_scheme_validate(self) result(valid)

Perform a small check of the consistency. Returns an error code built from bitwise flags to give information about which checks, if any, failed. Success is repesented by zero.

Type Bound

rk_scheme_type

Arguments

Type IntentOptional Attributes Name
class(rk_scheme_type), intent(in) :: self

Return Value integer


Contents

Source Code


Source Code

  integer pure function rk_scheme_validate(self) result(valid)
    implicit none
    class(rk_scheme_type), intent(in) :: self
    integer :: i
    real, parameter :: tolerance = 10*epsilon(1.0)
    valid = 0
    if (.not.(abs(sum(self%lower_order_coeffs) - 1.0) < tolerance)) valid = valid + 1
    if (.not.(abs(sum(self%high_order_coeffs) - 1.0) < tolerance)) valid = valid + 2
    do i = 1, self%number_of_stages
       if (.not.(abs(sum(self%coeffs(:, i)) - self%time_points(i)) < tolerance)) valid = valid + (2**(i+1))
    end do
  end function rk_scheme_validate