fdoc

subroutinesort_idsprivate

subroutine sort_ids(site, ids)

Sort ids, keeping the source order of equal entries.

Arguments

NameTypeIntentAttributesDescription
sitetype(site_t)in

the site

idsintegerinoutdimension(:)

the entities

Calls

Source

Show the code
subroutine sort_ids(site, ids)
    type(site_t), intent(in) :: site        !! the site
    integer, intent(inout) :: ids(:)        !! the entities
    integer :: i, j, id

    if (site%s%sort == 'src') return
    do i = 2, size(ids)
        id = ids(i)
        j = i - 1
        do while (j >= 1)
            if (.not. sorts_before(site, id, ids(j))) exit
            ids(j + 1) = ids(j)
            j = j - 1
        end do
        ids(j + 1) = id
    end do
end subroutine sort_ids

Graphs

Calls

Called by