assert_close_r Subroutine

private subroutine assert_close_r(this, r1, r2, fail)

Arguments

Type IntentOptional AttributesName
class(tester_t), intent(inout) :: this
real, intent(in) :: r1
real, intent(in) :: r2
logical, intent(in), optional :: fail

Source Code


Source Code

  subroutine assert_close_r(this, r1, r2, fail)
    class(tester_t), intent(inout) :: this
    real, intent(in) :: r1, r2
    logical, intent(in), optional :: fail

    this% n_tests = this% n_tests + 1

    if ( abs(r1-r2) > this% r_tol ) then
       if (.not. present(fail) .or. (present(fail) .and. fail .eqv. .false.)) then
          this% n_errors = this% n_errors + 1
       end if
    end if

  end subroutine assert_close_r