1 SUBROUTINE DJACOB(N,NMAX,MAXJAC,E,A,C,AII)
2 IMPLICIT REAL*8 (A-H,O-Z)
3 C THE JACOBI DIAGONALIZATION PROCEDURE
5 DIMENSION A(NMAX,N),C(NMAX,N),AII(150),AJJ(150)
10 C UNIT EIGENVECTOR MATRIX
17 C DETERMINATION OF SEARCH ARGUMENT, TEST
26 C SEARCH FOR LARGEST OFF DIAGONAL ELEMENT
33 IF (AIJMAX-TAIJ) 4,3,3
38 IF(AIJMAX-TEST)300,300,5
39 C PARAMETERS FOR ROTATION
44 IF(DABS(TMT/TAIJ)-1.0D-12) 60,60,6
46 6 ZAMMA=TAIJ/(2.0*TMT)
47 90 IF(DABS(ZAMMA)-0.38268)8,8,9
57 SINT=2.0*ZAMMA/(1.0+GAMSQ)
58 COST = (1.0-GAMSQ)/(1.0+GAMSQ)
65 A(IPIV,K) = TAIK*COST+TAJK*SINT
66 A(JPIV,K) = TAJK*COST-TAIK*SINT
69 C(IPIV,K) = TCIK*COST+TCJK*SINT
70 13 C(JPIV,K) = TCJK*COST-TCIK*SINT
71 A(IPIV,IPIV) = TAII*COSSQ+TAJJ*SINSQ+2.0*TAIJ*SINT*COST
72 A(JPIV,JPIV) = TAII*SINSQ+TAJJ*COSSQ-2.0*TAIJ*SINT*COST
73 A(IPIV,JPIV) = TAIJ*(COSSQ-SINSQ)-SINT*COST*TMT
74 A(JPIV,IPIV) = A(IPIV,JPIV)
77 30 A(K,JPIV) = A(JPIV,K)
79 WRITE (IOUT,1000) AIJMAX
80 1000 FORMAT (/1X,'NONCONVERGENT JACOBI. LARGEST OFF-DIAGONAL ELE',
82 C ARRANGEMENT OF EIGENVALUES IN ASCENDING ORDER
90 IF(AJJ(I)-AIIMIN)17,16,16