*DECK EDIPRR
      SUBROUTINE EDIPRR(IPRINT,NL,ITRANC,NGCOND,NMERGE,ILEAKS,NTAUXT,B2,
     >                  VOLMER,NENER,WENERG,RATECM,SCATTD)
*
*-----------------------------------------------------------------------
*
*Purpose:
* print reaction rates.
*
*Copyright:
* Copyright (C) 2002 Ecole Polytechnique de Montreal
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version
*
*Author(s): G. Marleau
*
*Parameters: input
* IPRINT  print level;
*         = 0 no print;
*         = 1 print fluxes;
*         = 2 1+print reaction rates;
*         = 3 2+print homogenized cross sections.
* NL      number of Legendre orders.
* ITRANC  type of transport correction.
* NGCOND  number of groups condensed.
* NMERGE  number of regions merged.
* ILEAKS  type of leakage calculation:
*         = 0 no leakage;
*         = 1 homogeneous leakage (Diffon);
*         = 2 isotropic streaming (Ecco);
*         = 3 anisotropic streaming (Tibere);
*         = 10 isotropic diffusion coefficients recovered from input
*           macrolib;
*         = 11 anisotropic diffusion coefficients recovered from input
*           macrolib.
* NTAUXT  number of reaction rate edits.
* B2      square buckling:
*         for ILEAKS=1,2: B2(4) is homogeneous;
*         for ILEAKS=3: B2(1),B2(2),B2(3) are directional heterogeneous
*         and B2(4) is homogeneous.
* VOLMER  volume of region merged.
* NENER   number of energy groups limits.
* WENERG  energy group limits.
* RATECM  averaged region/group cross sections:
*         = RATECM(*,1) = fluxes P0;
*         = RATECM(*,2) = fluxes P1;
*         = RATECM(*,3) = total P0;
*         = RATECM(*,4) = total P1;
*         = RATECM(*,5) = absorption;
*         = RATECM(*,6) = nu-sigf;
*         = RATECM(*,7) = fixed sources / productions;
*         = RATECM(*,8) = total leakages;
*         = RATECM(*,9) = total out of group scattering;
*         = RATECM(*,10) = diagonal scattering cross sections;
*         = RATECM(*,11) = fission spectrum;
*         = RATECM(*,12) = transport correction;
*         = RATECM(*,13) = X-directed leakages;
*         = RATECM(*,14) = Y-directed leakages;
*         = RATECM(*,15) = Z-directed leakages;
*         = RATECM(*,16) = nu-sigf for delayed neutrons;
*         = RATECM(*,17+NDEL) = fission spectrum for delayed neutrons.
* SCATTD  scattering rates.
*
*-----------------------------------------------------------------------
*
*----
*  SUBROUTINE ARGUMENTS
*----
      INTEGER     IPRINT,NL,ITRANC,NGCOND,NMERGE,ILEAKS,NTAUXT,NENER
      REAL        B2(4),VOLMER(NMERGE),WENERG(NGCOND+1),
     >            RATECM(NMERGE,NGCOND,NTAUXT)
      DOUBLE PRECISION SCATTD(NMERGE,NGCOND,NGCOND,NL)
*----
*  LOCAL VARIABLES
*----
      CHARACTER   APG*3
      PARAMETER  (IUNOUT=6,APG=' > ')
      DOUBLE PRECISION SCATWG,SCATTN
      REAL, ALLOCATABLE, DIMENSION(:,:) :: FLDMC
*----
*  SCRATCH STORAGE ALLOCATION
*   FLDMC   flux merged and condensed.
*----
      ALLOCATE(FLDMC(NMERGE,NGCOND))
*----
*  COMPUTE AVERAGE FLUX
*----
      DO 224 IGRC=1,NGCOND
        DO 225 IKK=1,NMERGE
          FLDMC(IKK,IGRC)=RATECM(IKK,IGRC,1)/VOLMER(IKK)
 225    CONTINUE
 224  CONTINUE
*----
*  PRINT REACTION RATES
*----
      WRITE(IUNOUT,6000)
      WRITE(IUNOUT,6001) (JJ,VOLMER(JJ),JJ=1,NMERGE)
      IF( (NENER.GT.0) .AND. (IPRINT.GT.1) ) THEN
        WRITE(IUNOUT,6002) (WENERG(IG),APG,IG,APG,IG=1,NGCOND),
     >                        WENERG(NGCOND+1)
      ENDIF
      WRITE(IUNOUT,6003)
      DO 154 IGR=1,NGCOND
        IF(IPRINT.EQ.1) THEN
          WRITE(IUNOUT,6010) IGR
          WRITE(IUNOUT,6012) (RATECM(IKK,IGR,1),IKK=1,NMERGE)
          WRITE(IUNOUT,6011)
          WRITE(IUNOUT,6012) (FLDMC(IKK,IGR),IKK=1,NMERGE)
          GO TO 154
        ENDIF
        IF((ILEAKS.EQ.1).OR.(ILEAKS.EQ.2).OR.(ILEAKS.EQ.10)) THEN
          WRITE(IUNOUT,6013) IGR
        ELSE
          WRITE(IUNOUT,6014) IGR
        ENDIF
        DO 155 IKK=1,NMERGE
*----
*  UNCOMMENT THE 2 LINES TO PERFORM TRANSPORT CORRECTION
*----
          TOTAL=RATECM(IKK,IGR,3)
          SCATWG=SCATTD(IKK,IGR,IGR,1)
          IF(ITRANC.NE.0) THEN
*           TOTAL=TOTAL-RATECM(IKK,IGR,12)
*           SCATWG=SCATWG-RATECM(IKK,IGR,12)
          ENDIF
*
          SCATTN=0.0D0
          DO 153 JGR=1,NGCOND
            IF(JGR.NE.IGR) SCATTN=SCATTN+SCATTD(IKK,JGR,IGR,1)
 153      CONTINUE
          IF((ILEAKS.EQ.1).OR.(ILEAKS.EQ.2).OR.(ILEAKS.EQ.10)) THEN
            WRITE(IUNOUT,6020) IKK,FLDMC(IKK,IGR),RATECM(IKK,IGR,1),
     >        TOTAL,RATECM(IKK,IGR,5),RATECM(IKK,IGR,6),
     >        RATECM(IKK,IGR,8)*B2(4),RATECM(IKK,IGR,7),SCATWG,SCATTN
          ELSE
            WRITE(IUNOUT,6021) IKK, FLDMC(IKK,IGR),RATECM(IKK,IGR,1),
     >        TOTAL,RATECM(IKK,IGR,5),RATECM(IKK,IGR,6),
     >        RATECM(IKK,IGR,7),SCATWG,SCATTN
          ENDIF
 155    CONTINUE
        IF((ILEAKS.EQ.3).OR.(ILEAKS.EQ.11)) THEN
          WRITE(IUNOUT,6022)
          DO 156 IKK=1,NMERGE
            WRITE(IUNOUT,6023) IKK,RATECM(IKK,IGR,13)*B2(1)
     >      +RATECM(IKK,IGR,14)*B2(2)+RATECM(IKK,IGR,15)*B2(3),
     >      RATECM(IKK,IGR,13)*B2(1),RATECM(IKK,IGR,14)*B2(2),
     >      RATECM(IKK,IGR,15)*B2(3),RATECM(IKK,IGR,8)*B2(4)
 156      CONTINUE
        ENDIF
 154  CONTINUE
*----
*  SCRATCH STORAGE DEALLOCATION
*----
      DEALLOCATE(FLDMC)
      RETURN
*----
*  FORMAT
*----
 6000 FORMAT(////5(5X,'REGION',6X,'VOLUME  '))
 6001 FORMAT(1P,5(5X,I4,4X,E12.5))
 6002 FORMAT(/' E N E R G Y   L I M I T S   (EV)'/1P,
     >6(2X,E10.4,A3,I3,A3))
 6003 FORMAT(/' F L U X E S   A N D    R E A C T I O N    R A T E S'/
     >1X,51(1H-))
 6010 FORMAT(/' G R O U P   :',I4/' REGION INTEGRATED FLUX')
 6011 FORMAT(' AVERAGED REGIONAL FLUX')
 6012 FORMAT(1P,7(3X,E15.7))
 6013 FORMAT(/14H G R O U P   :,I4/7H REGION,3X,7HAVERAGE,5X,3HINT,
     > 7HEGRATED,5X,9HCOLLISION,4X,10HABSORPTION,4X,10HNU*FISSION,6X,
     > 7HLEAKAGE,5X,10HPRODUCTION,8X,16HSCATTERING RATES/11X,4HFLUX,
     > 10X,4HFLUX,10X,4HRATE,10X,4HRATE,10X,4HRATE,10X,4HRATE,10X,
     > 4HRATE,6X,26HWITHIN GROUP  OUT OF GROUP)
 6014 FORMAT(/14H G R O U P   :,I4/7H REGION,3X,7HAVERAGE,5X,3HINT,
     > 7HEGRATED,5X,9HCOLLISION,4X,10HABSORPTION,4X,10HNU*FISSION,
     > 4X,10HPRODUCTION,8X,16HSCATTERING RATES/11X,4HFLUX,
     > 10X,4HFLUX,10X,4HRATE,10X,4HRATE,10X,4HRATE,10X,
     > 4HRATE,6X,26HWITHIN GROUP  OUT OF GROUP)
 6020 FORMAT(1X,I4,1P,9E14.5)
 6021 FORMAT(1X,I4,1P,8E14.5,3E14.5)
 6022 FORMAT(/' REGION  TOTAL LEAKAGE     X-LEAKAGE',
     >        '     Y-LEAKAGE     Z-LEAKAGE   HOMOGENEOUS'/
     >        '              RATE           RATE   ',
     >        '       RATE          RATE     LEAKAGE RATE')
 6023 FORMAT(1X,I6,1X,1P,5E14.5)
      END
