fdoc

subroutinesort_intspureprivate

pure subroutine sort_ints(list)

Put list in order.

Arguments

NameTypeIntentAttributesDescription
listintegerinoutdimension(:)

the list

Source

Show the code
pure subroutine sort_ints(list)
    integer, intent(inout) :: list(:)   !! the list
    integer :: k, j, value

    do k = 2, size(list)
        value = list(k)
        j = k - 1
        do while (j >= 1)
            if (list(j) <= value) exit
            list(j + 1) = list(j)
            j = j - 1
        end do
        list(j + 1) = value
    end do
end subroutine sort_ints

Graphs

Called by