logicalToRealArray Function

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

Converts an array of logicals into an array of reals.

0 equals to false, everything else equals to true.

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: value(n)

The value to interpret as boolean

integer, intent(in) :: n

The number of values in the input array

Return Value real(kind=rk), (n)

The values interpreted as booleans


Called by

proc~~logicaltorealarray~~CalledByGraph proc~logicaltorealarray logicalToRealArray proc~evallogicaland_forpoint evalLogicalAnd_forPoint proc~evallogicaland_forpoint->proc~logicaltorealarray proc~evallogicaland_fromindex evalLogicalAnd_fromIndex proc~evallogicaland_fromindex->proc~logicaltorealarray proc~evallogicalgreater_forpoint evalLogicalGreater_forPoint proc~evallogicalgreater_forpoint->proc~logicaltorealarray proc~evallogicalgreater_fromindex evalLogicalGreater_fromIndex proc~evallogicalgreater_fromindex->proc~logicaltorealarray proc~evallogicalgreaterorequal_forpoint evalLogicalGreaterOrEqual_forPoint proc~evallogicalgreaterorequal_forpoint->proc~logicaltorealarray proc~evallogicalgreaterorequal_fromindex evalLogicalGreaterOrEqual_fromIndex proc~evallogicalgreaterorequal_fromindex->proc~logicaltorealarray proc~evallogicalless_forpoint evalLogicalLess_forPoint proc~evallogicalless_forpoint->proc~logicaltorealarray proc~evallogicalless_fromindex evalLogicalLess_fromIndex proc~evallogicalless_fromindex->proc~logicaltorealarray proc~evallogicallessorequal_forpoint evalLogicalLessOrEqual_forPoint proc~evallogicallessorequal_forpoint->proc~logicaltorealarray proc~evallogicallessorequal_fromindex evalLogicalLessOrEqual_fromIndex proc~evallogicallessorequal_fromindex->proc~logicaltorealarray proc~evallogicalor_forpoint evalLogicalOr_forPoint proc~evallogicalor_forpoint->proc~logicaltorealarray proc~evallogicalor_fromindex evalLogicalOr_fromIndex proc~evallogicalor_fromindex->proc~logicaltorealarray

Source Code

  function logicalToRealArray(value,n) result(res)
    ! ------------------------------------------------------------------------ !
    !> The number of values in the input array
    integer, intent(in) :: n
    !> The value to interpret as boolean
    logical, intent(in) :: value(n)
    !> The values interpreted as booleans
    real(kind=rk) :: res(n)
    ! ------------------------------------------------------------------------ !

    res = numFalse
    where(value) res = numTrue

  end function logicalToRealArray