SUBROUTINE ZGE(A,INT,N,NC,EMACH) IMPLICIT NONE C ------------------------------------------------------------------ C ZGE IS A STANDARD SUBROUTINE TO PERFORM GAUSSIAN ELIMINATION ON C A NC*NC MATRIX 'A' PRIOR TO INVERSION, DETAILS STORED IN 'INT' C ------------------------------------------------------------------ C C .. SCALAR ARGUMENTS .. C INTEGER N,NC REAL*8 EMACH C C .. ARRAY ARGUMENTS .. C INTEGER INT(NC) COMPLEX*16 A(NC,NC) C C .. LOCAL SCALARS .. C INTEGER I,II,IN,J,K COMPLEX*16 YR,DUM C C .. INTRINSIC FUNCTIONS .. C * INTRINSIC ABS C ------------------------------------------------------------------ C DO 10 II=2,N I=II-1 YR=A(I,I) IN=I * * Finding an element with the largest magnitude in the I-th column * below the matrix diagonal (including the diag. element): DO 2 J=II,N IF(ABS(YR)-ABS(A(J,I)))1,2,2 1 YR=A(J,I) IN=J 2 CONTINUE INT(I)=IN !The largest element in the I-th column below the matrix !diagonal is in the IN-th row and is denoted by YR * IF(IN-I)3,5,3 !If IN.NE.I switch the I-th and IN-th rows to the 3 DO 4 J=I,N !right of the matrix diagonal (including the diag. element) DUM=A(I,J) A(I,J)=A(IN,J) 4 A(IN,J)=DUM 5 IF(ABS(YR)-EMACH)10,10,6 * * Gaussian elemination of matrix elements below the matrix diagonal. * Subtraction of (A(J,I)/A(I,I)) multiple of the Ith row from the Jth row * in the sub-matrix beginning with the (I+1,I+1) diag. element * 6 DO 9 J=II,N IF(ABS(A(J,I))-EMACH)9,9,7 7 A(J,I)=A(J,I)/YR DO 8 K=II,N 8 A(J,K)=A(J,K)-A(J,I)*A(I,K) 9 CONTINUE * 10 CONTINUE !end of "row loop" RETURN END