Sort send buffers according to the idbuf array
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mg_buf_t), | intent(inout) | :: | gc | |||
| integer, | intent(in) | :: | dsize |
Size of send buffer elements |
subroutine sort_sendbuf(gc, dsize) type(mg_buf_t), intent(inout) :: gc integer, intent(in) :: dsize !< Size of send buffer elements integer :: ix_sort(gc%i_ix) real(dp) :: buf_cpy(gc%i_send) integer :: i, j, n call mrgrnk(gc%ix(1:gc%i_ix), ix_sort) buf_cpy = gc%send(1:gc%i_send) do n = 1, gc%i_ix i = (n-1) * dsize j = (ix_sort(n)-1) * dsize gc%send(i+1:i+dsize) = buf_cpy(j+1:j+dsize) end do gc%ix(1:gc%i_ix) = gc%ix(ix_sort) end subroutine sort_sendbuf