swap Subroutine

public subroutine swap(a, b)

Swap arrays a and b

Arguments

Type IntentOptional AttributesName
real(kind=double), intent(inout), dimension(:):: a
real(kind=double), intent(inout), dimension(:):: b

Contents

Source Code


Source Code

  subroutine swap(a,b)
    !+Swap arrays `a` and `b`
    real(double), dimension(:), intent(INOUT) :: a,b
    real(double), dimension(size(a))          :: dum
    dum=a
    a=b
    b=dum
  end subroutine swap