program hellojacobi
   use nrtype
   use nr, ONLY:jacobi
   implicit none
   INTEGER::n
   INTEGER(I4B):: nrot
   REAL, DIMENSION(:),allocatable:: d
   REAL, DIMENSION(:,:),allocatable:: a
   REAL, DIMENSION(:,:),allocatable:: v
   open(1,file="matrix.dat" ) 
   !Matrix file contains Matrix dimension &  arrays respectively.
	read(1,*)n 
	allocate(d(n))
	allocate(a(n,n))
	allocate(v(n,n))

 	read(1,*) a
	call jacobi(a,d,v,nrot)
	write(*,*), "The eigenvalues are:" ,d
	write(*,*), "The eigenvector is:" ,v
   close(1)
end program
