      SUBROUTINE EIGV1(IBAL,A,KA,N,WR,WI,ZR,ZI,IERR)
      DIMENSION A(KA,N),WR(N),WI(N),ZR(KA,N),ZI(KA,N)
      LOW=1
      IGH=N
      IF (IBAL.NE.0) CALL BALANC(KA,N,A,LOW,IGH,ZI)
      CALL ORTHES(KA,N,LOW,IGH,A,WR)
      CALL ORTRAN(KA,N,LOW,IGH,A,WR,ZR)
      CALL HQR2(KA,N,LOW,IGH,A,WR,WI,ZR,IERR)
      IF (IERR.NE.0) RETURN
      IF (IBAL.NE.0) CALL BALBAK(KA,N,LOW,IGH,ZI,N,ZR)
C
      DO 30 K=1,N
      IF (WI(K)) 30,10,20
   10 DO 11 J=1,N
   11 ZI(J,K)=0.0
      GO TO 30
   20 KP1=K+1
      DO 21 J=1,N
      ZI(J,K)=ZR(J,KP1)
      ZR(J,KP1)=ZR(J,K)
   21 ZI(J,KP1)=-ZI(J,K)
   30 CONTINUE
      RETURN
      END
