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

symm =.FALSE.
i_do: do i=1,n
	j_do: do j=1,n
	if(j==i) cycle j_do
	    if (a(i,j) /=a(j,i)) then
	    RETURN
	    endif
	enddo j_do
enddo i_do

symm =.TRUE.
END