*DECK SPHBEL
      SUBROUTINE SPHBEL (NGCOND,IGR,NMERGE,FLXMER,SUNMER,NREG,NBMIX,
     1 MAT,VOL,MERG,SIGMA,SIGMS,SPH,SOURCE)
*
*-----------------------------------------------------------------------
*
*Purpose:
* source term calculation for a PIJ discretization with Bell factor
* acceleration.
*
*Copyright:
* Copyright (C) 2008 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): A. Hebert
*
*Parameters: input
* NGCOND  number of groups condensed.
* IGR     energy group index.
* NMERGE  number of merged regions.
* FLXMER  flux estimate per mixture.
* SUNMER  incoming source (scattering+fission) cross sections.
* NREG    number of regions in the macro calculation
* NBMIX   number of macro-mixtures.
* MAT     mixture index per region.
* VOL     volume of regions.
* MERG    index of merged regions.
* SIGMA   within-group macroscopic scattering cross section.
* SIGMS   macroscopic total cross section.
* SPH     SPH factors.
*
*Parameters: output
* SOURCE  global sources.
*
*-----------------------------------------------------------------------
*
*----
*  SUBROUTINE ARGUMENTS
*----
      INTEGER NGCOND,IGR,NMERGE,NREG,NBMIX,MAT(NREG),MERG(NBMIX)
      REAL FLXMER(NMERGE,NGCOND),SUNMER(NMERGE,NGCOND),VOL(NREG),
     1 SIGMA(0:NBMIX),SIGMS(0:NBMIX),SPH(NMERGE),SOURCE(NREG)
*----
*  GLOBAL SOURCE FOR THE BELL FACTOR METHOD.
*----
      CALL XDRSET(SOURCE,NREG,0.0)
      DO 20 IREG=1,NREG
      IMAT=MAT(IREG)
      IF(IMAT.EQ.0) GO TO 20
      IMERG=MERG(IMAT)
      IF(VOL(IREG).EQ.0.0) GO TO 20
      SUM=(SIGMA(IMAT)-SIGMS(IMAT))*FLXMER(IMERG,IGR)/SPH(IMERG)
      DO 10 JGR=1,NGCOND
   10 SUM=SUM+SUNMER(IMERG,JGR)*FLXMER(IMERG,JGR)
      SOURCE(IREG)=SOURCE(IREG)+SUM
   20 CONTINUE
      RETURN
      END
