Returns true if the values in the array are the same (to within the specified absolute tolerance).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | vals |
a set of values |
|
real(kind=wp), | intent(in) | :: | tol |
a positive tolerance value |
true if they are equal within the tolerance
pure function equal_within_tol(vals,tol) result (equal) implicit none real(wp),dimension(:),intent(in) :: vals !! a set of values real(wp),intent(in) :: tol !! a positive tolerance value logical :: equal !! true if they are equal !! within the tolerance equal = all ( abs(vals - vals(1)) <= abs(tol) ) end function equal_within_tol