invert9
C INVERT9 SOURCE FANDEUR 13/01/29 21:15:56 7683 c idim = dimension of the matrix c inv = number of rows and columns of the matrix that will be treated C IMPLICIT REAL*8 (A-B,D-H,O-Z) implicit integer (I-K,M,N) implicit logical (L) implicit character*10 (C) C DECLARATION DES VARIABLES C ------------------------- C DIMENSION A(IDIM,IDIM),B(9,9) c* i1 = 1 c* i2 = 2 c* i3 = 3 r0 = 0.0d0 r1 = 1.0d0 if (idim.gt.9) then write(2,3) idim write(*,3) idim 3 format(' Error from INVERT9. IDIM =',i3,' should not be greater . than 9.') stop endif 4 format(' Error from INVERT9. INV =',i3,' should not be greater . than 9.') stop endif c B = matrice identite if (i.eq.j) then b(i,j) = r1 else b(i,j) = r0 endif enddo enddo C AMI00090 C AMI00100 C ELIMINATION DE GAUSS - TRIANGULATION SUPERIEURE AMI00110 C ----------------------------------------------- AMI00120 C AMI00130 DO K=1,inv-1 IF(A(K,K).eq.r0) THEN WRITE(2,*)' ERROR IN invert9. K =',K write(2,*)' PIVOT TROP PETIT : PIVOT =',A(k,k) write(2,*)' idim =',idim STOP ENDIF EMIK=A(I,K)/A(K,K) A(I,J)=A(I,J)-EMIK*A(K,J) ENDDO B(I,J)=B(I,J)-EMIK*B(K,J) ENDDO enddo enddo C AMI00290 C AMI00300 C SUBSTITUTIONS ARRIERES AMI00310 C ---------------------- AMI00320 C AMI00330 DO I=1,inv-1 SOMAC=r0 SOMAC=SOMAC+A(inv-I,J)*B(J,K) ENDDO B(inv-I,K)=(B(inv-I,K)-SOMAC)/A(inv-I,inv-I) ENDDO ENDDO C AMI00450 C AMI00460 C AMI00470 a(i,j) = b(i,j) enddo enddo RETURN END
© Cast3M 2003 - Tous droits réservés.
Mentions légales