Converts an array of reals into an array of logicals.
0 equals to false, everything else equals to true.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rk), | intent(in) | :: | value(n) |
The value to interpret as boolean |
||
integer, | intent(in) | :: | n |
The number of values in the input array |
The values interpreted as booleans
function realToLogicalArray(value,n) result(res) ! ------------------------------------------------------------------------ ! !> The number of values in the input array integer, intent(in) :: n !> The value to interpret as boolean real(kind=rk), intent(in) :: value(n) !> The values interpreted as booleans logical :: res(n) ! ------------------------------------------------------------------------ ! integer :: ii ! ------------------------------------------------------------------------ ! do ii = 1, n res(ii) = .not. (value(ii) .feq. numFalse) end do end function realToLogicalArray