i_swap_elem Subroutine

private pure subroutine i_swap_elem(arr, ind1, ind2)

Swaps element at ind1 in arr with element at ind2.

Arguments

Type IntentOptional Attributes Name
integer, intent(inout), dimension(:) :: arr
integer, intent(in) :: ind1
integer, intent(in) :: ind2

Contents

Source Code


Source Code

  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