      SUBROUTINE SORTT2(ICORE,MAXCOR,ISPIN,ILIST,NTOP,TYPE)
C
C DRIVER FOR ROUTINE WHICH PICKS UP THE T2 VECTOR FROM DISK FOR A 
C  SPIN CASE AND FIND THE NTOP LARGEST ELEMENTS BY MAGNITUDE.  THESE ARE
C  PRINTED OUT AT THE END OF THE ROUTINE.
C
CEND
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      CHARACTER*8 LABEL1,LABEL2
      CHARACTER*1 TYPE
      DIMENSION ICORE(MAXCOR)
      COMMON /MACHSP/ IINTLN,IFLTLN,IINTFP,IALONE,IBITWD
      COMMON /INFO/ NOCCO(2),NVRTO(2)
      NNM1O2(I)=(I*(I-1))/2
      NOCCA=NOCCO(1)
      NOCCB=NOCCO(2)
      NVRTA=NVRTO(1)
      NVRTB=NVRTO(2)
      IF(ISPIN.EQ.1)THEN
       NT2SIZ=ISYMSZ(ISPIN,ISPIN+2)
       NSMSZ1=NNM1O2(NVRTO(ISPIN))
       NSMSZ2=NNM1O2(NOCCO(ISPIN))
       LABEL1='SVAVA0  '
       LABEL2='SOAOA0  '
      ELSEIF(ISPIN.EQ.2)THEN
       NT2SIZ=ISYMSZ(ISPIN,ISPIN+2)
       NSMSZ1=NNM1O2(NVRTO(ISPIN))
       NSMSZ2=NNM1O2(NOCCO(ISPIN))
       LABEL1='SVBVB0  '
       LABEL2='SOBOB0  '
      ELSEIF(ISPIN.EQ.3)THEN
       NT2SIZ=ISYMSZ(13,14)
       NSMSZ1=NVRTO(1)*NVRTO(2)
       NSMSZ2=NOCCO(1)*NOCCO(2)
       LABEL1='SVAVB2  '
       LABEL2='SOAOB2  '
      ENDIF
C
C ALLOCATE CORE FOR T VECTOR, SYMMETRY VECTORS AND INDICES.
C
      I000=1
      I010=I000+IINTFP*NT2SIZ
      I020=I010+IINTFP*NTOP
      I030=I020+NSMSZ1
      I040=I030+NSMSZ2
      I050=I040+NTOP
      I060=I050+NTOP
      I070=I060+NTOP
      I080=I070+NTOP
      I090=I080+NTOP
      CALL GETREC(20,'JOBARC',LABEL1,NSMSZ1,ICORE(I020))
      CALL GETREC(20,'JOBARC',LABEL2,NSMSZ2,ICORE(I030))
      CALL TOPT2S(ISPIN,ILIST,NTOP,NT2SIZ,NOCCA,NOCCB,NVRTA,
     &            NVRTB,NSMSZ1,NSMSZ2,ICORE(I000),ICORE(I010),
     &            ICORE(I020),ICORE(I030),ICORE(I040),ICORE(I050),
     &            ICORE(I060),ICORE(I070),ICORE(I080),TYPE)
      RETURN
      END
