realToLogicalArray Function

public function realToLogicalArray(value, n) result(res)

Converts an array of reals into an array of logicals.

0 equals to false, everything else equals to true.

Arguments

Type IntentOptional 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

Return Value logical, (n)

The values interpreted as booleans


Called by

proc~~realtologicalarray~~CalledByGraph proc~realtologicalarray realToLogicalArray proc~evallogicaland_forpoint evalLogicalAnd_forPoint proc~evallogicaland_forpoint->proc~realtologicalarray proc~evallogicaland_fromindex evalLogicalAnd_fromIndex proc~evallogicaland_fromindex->proc~realtologicalarray proc~evallogicalor_forpoint evalLogicalOr_forPoint proc~evallogicalor_forpoint->proc~realtologicalarray proc~evallogicalor_fromindex evalLogicalOr_fromIndex proc~evallogicalor_fromindex->proc~realtologicalarray

Source Code

  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