swap_int32 Subroutine

private elemental subroutine swap_int32(a, b)

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(inout) :: a
integer(kind=int32), intent(inout) :: b

Contents

Source Code


Source Code

    elemental subroutine swap_int32(a, b)
        ! exchange the value of two integers a,b
        ! Input: a,b - integers to swapp (on return, a has the value of b on call and vice versa)
        integer(int32), intent(inout) :: a, b
        integer(int32) :: tmp

        tmp = a
        a = b
        b = tmp
    end subroutine swap_int32