      SUBROUTINE SYMTRA2(IRREP,NUM1,NUM2,DIS,NUM,A,B)
C
C  THIS ROUTINE TRANSPOSES THE FIRST TWO INDICES OF A GIVEN MATRIX A
C
C     A(I,J,K,L) --> B(J,I,K,L)
C
C  THE TRANSPOSITION IS NOT DONE IN PLACE(SEE THEREFORE SYMTR3)
C
C  INPUT : IRREP .......  IRREP OF THE GIVEN PART OF A
C          NUM1 ........  POPULATION VECTOR FOR I
C          NUM2 ........  POPULATION VECTOR FOR J
C          DIS .........  DISTRIBUTION SIZE OF A
C          NUM .........  NUMBER OF DISTRIBUTION OF A
C          A ...........  INPUT MATRIX A
C
C  OUTPUT :
C          B ...........  TRANPOSED OUTPUT MATRIX B
C
CEND
C
C CODED JULY/90 JG
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      INTEGER DIS,DIRPRD
      DIMENSION A(DIS,NUM),B(DIS,NUM),NUM1(8),NUM2(8)
      COMMON /SYMINF/NSTART,NIRREP,IRREPA(255),IRREPB(255),
     &DIRPRD(8,8)
      DIMENSION IPI(8),IPJ(8)
C
      IPI(1)=0
      IPJ(1)=0          
      DO 10 IRREPJ=1,NIRREP-1
       IRREPI=DIRPRD(IRREP,IRREPJ)
       IPJ(IRREPJ+1)=IPJ(IRREPJ)+NUM2(IRREPJ)*NUM1(IRREPI)
       IPI(IRREPJ+1)=IPI(IRREPJ)+NUM1(IRREPJ)*NUM2(IRREPI)
10    CONTINUE
       
C
      DO 20  IRREPJ=1,NIRREP
       NUMJ=NUM2(IRREPJ)
       IRREPI=DIRPRD(IRREP,IRREPJ)
       NUMI=NUM1(IRREPI)
       DO 15 J=1,NUMJ
       DO 15 I=1,NUMI
        IND1=IPJ(IRREPJ)+(J-1)*NUMI+I
        IND2=IPI(IRREPI)+(I-1)*NUMJ+J
        DO 11 L=1,NUM
         B(IND2,L)=A(IND1,L)
11      CONTINUE
15     CONTINUE
20    CONTINUE
      RETURN
      END
