assert_close_d_1 Subroutine

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

Arguments

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

Source Code


Source Code

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

    this% n_tests = this% n_tests + 1

    if ( size(d1) .ne. size(d2) ) then
       if (.not. present(fail) .or. (present(fail) .and. fail .eqv. .false.)) then
          this% n_errors = this% n_errors + 1
       end if
    else
       if ( maxval(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 if

  end subroutine assert_close_d_1