      SUBROUTINE checktrack(group,track,ntr,trlen,nca)
      IMPLICIT NONE
      INCLUDE 'general.h'

      CHARACTER(LEN=lgr) :: group(mca)
      INTEGER         :: track(mco,mca)
      INTEGER         :: trlen(mco)
      INTEGER         :: ntr,nca

      INTEGER         :: i,j,k
      LOGICAL         :: isthesame
      

10    CONTINUE

      DO i=1,ntr-1
        DO j=i+1,ntr
          isthesame=.TRUE.
          DO k=1,max(trlen(i),trlen(j))
            IF (group(track(i,k)).NE.group(track(j,k))) THEN
              isthesame=.FALSE.
            ENDIF
          ENDDO
          IF (isthesame) THEN
            track(j:mco-1,:)=track(j+1:mco,:)
            track(mco,:)=0
            trlen(mco)=0
            ntr=ntr-1
            GOTO 10
          ENDIF
        ENDDO
      ENDDO

      END

