Return the positions of the true elements in array. Specification
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical, | intent(in) | :: | array(:) |
Mask of logicals |
||
integer, | intent(in), | optional | :: | lbound |
Lower bound of array to index |
Locations of true elements
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