! Checks if the matrix is symmetric
logical function symm(n, a)
real(8) a(n,n)

symm =.true.
i_do: do i=1,n
	j_do: do j=1,n
	if(j==i) cycle j_do
	symm =symm .and. a(i,j) ==a(j,i)
	enddo j_do
enddo i_do

END