C
C
C     =================
      SUBROUTINE SYMINV
C     =================
C
C---- invert point group symmetry matrices in common symm
C
C---- External routine used:
C     =====================
C
C  IMINV(IA,IB,JDET)  invert 3 x 3 matrix ib to ia
C
C        IA = (IB)**-1
C        JDET  IS DETERMINANT
C
C
C
C     .. Scalars in Common ..
      INTEGER NISYM
      CHARACTER PGNAME*10
C     ..
C     .. Arrays in Common ..
      INTEGER ISYM
C     ..
C     .. Local Scalars ..
      INTEGER J,JDET,N
C     ..
C     .. Local Arrays ..
      INTEGER MAT(9)
C     ..
C     .. External Subroutines ..
      EXTERNAL IMINV
C     ..
C     .. Common blocks ..
      COMMON /SYMM/NISYM,ISYM(9,47)
      COMMON /SYMM1/PGNAME
C     ..
C
C
      DO 20 N = 1,NISYM
C
C---- invert into mat
C
        CALL IMINV(MAT,ISYM(1,N),JDET)
        IF (JDET.EQ.0) THEN
          GO TO 30
        ELSE
C
C---- copy back
C
          DO 10 J = 1,9
            ISYM(J,N) = MAT(J)
   10     CONTINUE
C
C
        END IF
   20 CONTINUE
C
C
C
      RETURN
C
C
   30 WRITE (6,FMT=6000) N
                CALL CCPERR(1,' STOP in SYMLIB.for 6000')
C
C---- Format statements
C
 6000 FORMAT (//'  !!!!!! SYMMETRY MATRIX',I4,' IS SINGULAR !!!!!!',//)
C
C
      END
