!======================================================================

!/*@@
!   @routine swap
!   @author T.Haupt 
!   @desc
!   swaps the values in tensors A and B using a temporary array. 
!   swaps time levels of two symmetric tensors
!   @enddesc
!   @calledby f_swap
!   @calledby tstep
!   @comment
!   uses module tensors
!   @endcomment
!@@*/

subroutine swap(a_,b_,temp_) 
use input_params
use tensors
type(GridFunction),dimension(3,3)              :: a_,b_,temp_ 
integer                                        :: i,j


 
   do i = 1 ,3
		do j = 1, 3
			if (i <= j) then
				temp_(i,j)%d = a_(i,j)%d
				a_(i,j)%d    = b_(i,j)%d
				b_(i,j)%d    = temp_(i,j)%d
			end if
		end do
	end do

return 
end 


