subroutine swap_i(a,b) integer, intent(inout) :: a,b integer :: dum dum=a a=b b=dum end subroutine swap_i