Sort indices array based on integer values
Internal helper that sorts an index array based on corresponding integer values
@param[in] values Integer values to sort by @param[in,out] indices Index array to be sorted @param[in] ascending Sort direction
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=ik), | intent(in), | dimension(:) | :: | values | ||
integer, | intent(inout), | dimension(:) | :: | indices | ||
logical, | intent(in) | :: | ascending |
subroutine sort_indices_integer(values, indices, ascending) integer(ik), dimension(:), intent(in) :: values integer, dimension(:), intent(inout) :: indices logical, intent(in) :: ascending if (size(values) > 0) then call quicksort_indices_integer(values, indices, 1, size(values), ascending) end if end subroutine sort_indices_integer