      SUBROUTINE TETRA(M)
C
      INCLUDE 'com_coor.f'
      INCLUDE 'com_faces.f'
      INCLUDE 'com_options.f'
      INTEGER M(8),K1(4,5),K2(4,5)
      DATA K1 / 2,5,4,1 , 5,2,7,6 , 5,7,4,8 , 2,4,7,3 , 2,5,7,4 /      
      DATA K2 / 1,8,3,4 , 8,1,6,5 , 8,6,3,7 , 1,3,6,2 , 1,8,6,3 /      
C
      IC1 = ITOUCH(M(K1(4,1))) + ITOUCH(M(K1(4,2)))
     &    + ITOUCH(M(K1(4,3))) + ITOUCH(M(K1(4,4)))
      IC2 = ITOUCH(M(K2(4,1))) + ITOUCH(M(K2(4,2)))
     &    + ITOUCH(M(K2(4,3))) + ITOUCH(M(K2(4,4)))
      IF (IC1.GT.IC2) THEN
        DO I=1,5
          IVOL = IVOL+1
          IF (IVOL.GT.NTMAX) CALL TROPDEPOINTS(IVOL,-2,0)
          DO J=1,4
            NTET(J,IVOL) = M(K1(J,I))
          ENDDO
        ENDDO
        DO I=1,4
          ITOUCH(M(K1(4,I))) = 1
        ENDDO
      ELSE
        DO I=1,5
          IVOL = IVOL+1
          IF (IVOL.GT.NTMAX) CALL TROPDEPOINTS(IVOL,-2,0)
          DO J=1,4
            NTET(J,IVOL) = M(K2(J,I))
          ENDDO
        ENDDO
        DO I=1,4
          ITOUCH(M(K2(4,I))) = 1
        ENDDO
      ENDIF
      ISDEL(IVOL/5) = IGROUP
      END
