sort_indices_real Subroutine

private subroutine sort_indices_real(values, indices, ascending)

Sort indices array based on real values

Internal helper that sorts an index array based on corresponding real values

@param[in] values Real values to sort by @param[in,out] indices Index array to be sorted @param[in] ascending Sort direction

Arguments

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

Source Code

    subroutine sort_indices_real(values, indices, ascending)
        real(rk), dimension(:), intent(in) :: values
        integer, dimension(:), intent(inout) :: indices
        logical, intent(in) :: ascending

        if (size(values) > 0) then
            call quicksort_indices_real(values, indices, 1, size(values), ascending)
        end if
    end subroutine sort_indices_real