Swaps element at ind1
in arr
with element
at ind2
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(inout), | dimension(:) | :: | arr | ||
integer, | intent(in) | :: | ind1 | |||
integer, | intent(in) | :: | ind2 |
pure subroutine i_swap_elem(arr,ind1,ind2)
implicit none
integer, dimension(:), intent(inout) :: arr
integer, intent(in) :: ind1, ind2
integer :: tmp
tmp=arr(ind1)
arr(ind1)=arr(ind2)
arr(ind2)=tmp
end subroutine i_swap_elem