assert_close_d Subroutine

private subroutine assert_close_d(this, d1, d2, fail)

Arguments

Type IntentOptional AttributesName
class(tester_t), intent(inout) :: this
double precision, intent(in) :: d1
double precision, intent(in) :: d2
logical, intent(in), optional :: fail

Source Code


Source Code

  subroutine assert_close_d(this, d1, d2, fail)
    class(tester_t), intent(inout) :: this
    double precision, intent(in) :: d1, d2
    logical, intent(in), optional :: fail

    this% n_tests = this% n_tests + 1

    if ( abs(d1-d2) > this% d_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_d