      SUBROUTINE DRTSTS(ICORE,MAXCOR,ICYCLE,IUHF,ICONVG,
     &                  ICONTL,SING1,NLIST,TYPE)
C
C DRIVER FOR ROUTINE WHICH LOOKS AT OLD AND NEW T VECTORS,
C   AND RETURNS STATISTICS ON THEM.
C
CEND
      IMPLICIT INTEGER (A-Z)
      DOUBLE PRECISION TOL
      CHARACTER*1 TYPE
      CHARACTER*2 SPCASE
      CHARACTER*8 SYMLBV(3),SYMLBO(3),LABEL1,LABEL2,SYMLVO(2)
      LOGICAL SING1
      DIMENSION ICORE(MAXCOR)
      COMMON /MACHSP/ IINTLN,IFLTLN,IINTFP,IALONE,IBITWD
      COMMON /INFO/ NOCCO(2),NVRTO(2)
      COMMON /SYMPOP/ IRPDPD(8,22),ISYTYP(2,500),ID(18)
      COMMON /FLAGS/ IFLAGS(100)
      DATA SYMLBV /'SVAVA0  ','SVBVB0  ','SVAVB2  '/
      DATA SYMLBO /'SOAOA0  ','SOBOB0  ','SOAOB2  '/
      DATA SYMLVO /'SVAOA2  ','SVBOB2  '/
      NNM1O2(IX)=(IX*(IX-1))/2
      ICONVG=0
      IF(IFLAGS(1).GE.10)THEN
       WRITE(*,100)ICYCLE
  100  FORMAT(T3,' After ',I3,' iterations, amplitude changes are:')
       WRITE(*,101)
  101  FORMAT(T5,67('-'))
       WRITE(*,102)
  102  FORMAT(T18,'Spin',T28,'RMS',T41,'Max.',T51,'Max. change for',/,
     &        T6,'Amplitude',T18,'Case',T27,'Change',T40,'Change',
     &        T53,'i',T58,'j',T63,'a',T68,'b')
       WRITE(*,101)
      ENDIF
      TOL=10.D0**(-ICONTL)
C
C T1 VECTOR STATISTICS IF AVAILABLE
C
      IF(SING1)THEN
       DO 900 ISPIN=1,1+IUHF
        NSMSZ=NVRTO(ISPIN)*NOCCO(ISPIN)
        LABEL1=SYMLVO(ISPIN)
        NSIZET=IRPDPD(1,8+ISPIN)
        I000=1
        I010=I000+NSIZET*IINTFP
        I020=I010+NSIZET*IINTFP
        I030=I020+NSMSZ
        CALL GETREC(20,'JOBARC',LABEL1,NSMSZ,ICORE(I020))
        CALL T1STAT(ICORE,ICORE(I010),ICORE(I020),NSIZET,NSMSZ,
     &             ISPIN,ICONVG,TOL,NLIST,TYPE)
900    CONTINUE
      ENDIF
C
C T2 VECTOR STATISTICS - AA AND BB SPIN CASES
C
      DO 10 ISPIN=1,1+IUHF
       LISTT=43+ISPIN
       NSMSZ1=NNM1O2(NVRTO(ISPIN))
       NSMSZ2=NNM1O2(NOCCO(ISPIN))
       LABEL1=SYMLBV(ISPIN)
       LABEL2=SYMLBO(ISPIN)
       NSIZET=ISYMSZ(ISYTYP(1,LISTT),ISYTYP(2,LISTT))
       I000=1
       I010=I000+NSIZET*IINTFP
       I020=I010+NSIZET*IINTFP
       I030=I020+NSMSZ1
       I040=I030+NSMSZ2
       CALL GETREC(20,'JOBARC',LABEL1,NSMSZ1,ICORE(I020))
       CALL GETREC(20,'JOBARC',LABEL2,NSMSZ2,ICORE(I030))
       CALL T2STAT(ICORE,ICORE(I010),ICORE(I020),ICORE(I030),
     &             NSIZET,NSMSZ1,NSMSZ2,ISPIN,ICONVG,TOL,NLIST,
     &             TYPE)
10    CONTINUE
C
C T2 VECTOR STATISTICS - AB SPIN CASE
C
      LISTT=46
      NSMSZ1=NVRTO(1)*NVRTO(2)
      NSMSZ2=NOCCO(1)*NOCCO(2)
      LABEL1=SYMLBV(3)
      LABEL2=SYMLBO(3)
      NSIZET=ISYMSZ(ISYTYP(1,LISTT),ISYTYP(2,LISTT))
      NT2DSZ=NVRTO(1)*NVRTO(2)
      I000=1
      I010=I000+NSIZET*IINTFP
      I020=I010+NSIZET*IINTFP
      I030=I020+NSMSZ1
      I040=I030+NSMSZ2
      CALL GETREC(20,'JOBARC',LABEL1,NSMSZ1,ICORE(I020))
      CALL GETREC(20,'JOBARC',LABEL2,NSMSZ2,ICORE(I030))
      CALL T2STAT(ICORE,ICORE(I010),ICORE(I020),ICORE(I030),
     &            NSIZET,NSMSZ1,NSMSZ2,3,ICONVG,TOL,NLIST,TYPE)
      IF(IFLAGS(1).GE.10)THEN
       WRITE(*,101)
      ENDIF
      RETURN
      END
