8 real, public
:: expectedScalar
;
11 procedure
:: FCheckArr
12 generic
:: Check
=> FCheck
, FCheckArr
17 subroutine FCheck(this
,X
)
23 if ( abs (X
- this
%expectedScalar
) > 0.0001 ) then
31 subroutine FCheckArr(this
,X
)
36 this
%expectedScalar
= i
- 1.0
37 call this
%FCheck(X(i
))
39 end subroutine FCheckArr
41 subroutine CheckTextVector(vec
, n
, scal
)
42 integer, intent(in
) :: n
43 class(*), intent(in
) :: vec(n
)
44 class(*), intent(in
) :: scal
49 call Tester
%Check(vec
)
50 ! Check a scalar of the same class like the vector
51 Tester
%expectedScalar
= 5.0
52 call Tester
%Check(scal
)
53 ! Check an element of the vector, which is a scalar
55 Tester
%expectedScalar
= 2.0
56 call Tester
%Check(vec(j
))
58 end subroutine CheckTextVector
66 real :: vec(1:6) = (/ 0, 1, 2, 3, 4, 5 /)
67 call checktextvector(vec
, 6, 5.0)