program Calling implicit none integer i,j,n,ier integer, parameter :: nmax=10 real*8, dimension(nmax,nmax) :: a,s real*8, dimension(nmax) :: spectrum,dummy ! Solving: A*C = E*S*C !Example for 2x2 matrix n=2 ! Generating the A matrix and the S matrix a(1,1)=-2.d0 ;a(1,2)=-1.d0 ;a(2,1)=-1.d0 ; a(2,2)=1.d0 s(1,1)=1.d0 ;s(1,2)=0.3d0 ;s(2,1)=0.3d0 ; s(2,2)=1.d0 ! Calling the subroutine call EWEVGE (nmax,nmax,n,a,s,spectrum,dummy,1,-1,ier) print*,' You should get the following eigenvalues and eigenfunctions:' print*,'Level energy coef(1) coef(2) ' print*,' 1 -2.0487162 0.9570256 0.1209766' print*,' 2 1.6091557 -0.4277886 1.0412808' print*,'The subroutine returned' print*,'Level energy coef(1) coef(2) ' do j=1,2 print 2, j,spectrum(j),(a(i,j),i=1,n) enddo 2 format(i5,3f12.7) stop end program Calling