sort_indices_integer Subroutine

private subroutine sort_indices_integer(values, indices, ascending)

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

Arguments

Type IntentOptional Attributes Name
integer(kind=ik), intent(in), dimension(:) :: values
integer, intent(inout), dimension(:) :: indices
logical, intent(in) :: ascending

Source Code

    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