trueloc Function

public pure function trueloc(array, lbound) result(loc)

Return the positions of the true elements in array. Specification

Arguments

TypeIntentOptionalAttributesName
logical, intent(in) :: array(:)

Mask of logicals

integer, intent(in), optional :: lbound

Lower bound of array to index

Return Value integer(count(array))

Locations of true elements


Contents

Source Code


Source Code

  pure function trueloc(array, lbound) result(loc)
    !> Mask of logicals
    logical, intent(in) :: array(:)
    !> Lower bound of array to index
    integer, intent(in), optional :: lbound
    !> Locations of true elements
    integer :: loc(count(array))

    call logicalloc(loc, array, .true., lbound)
  end function trueloc