*DECK XELTCW
      SUBROUTINE XELTCW(NANGLE,PTSANG,WGTANG)
*
*-----------------------------------------------------------------------
*
*Purpose:
* compute the integration weights for cyclic tracking.
*
*Copyright:
* Copyright (C) 1994 Ecole Polytechnique de Montreal.
*
*Author(s): A. Hebert
*
*Reference:
* M.J.Halsall, Cactus, a characteritics solution to the neutron
* transport equations in complicated geometries, UK Atomic Energy
* Authority, 1980.
*
*Parameters: input
* NANGLE number of angles.
* PTSANG integration points.
*
*Parameters: output
* WGTANG integration weights.
*
*-----------------------------------------------------------------------
*
      IMPLICIT NONE
*----
*  Subroutine arguments
*----
      INTEGER          NANGLE
      DOUBLE PRECISION PTSANG(NANGLE),WGTANG(NANGLE)
*----
*  Local variables
*----
      INTEGER          LL
      DOUBLE PRECISION ACCUW,PI
      PARAMETER       (PI=3.14159265358979323846D0)
*----
*  Computes weights associated with azimuthal angles (PTSANG)
*----
      IF(NANGLE>1) THEN
         WGTANG(1)=1.0D0-(ACOS(PTSANG(2))+ACOS(PTSANG(1)))/PI
         ACCUW=WGTANG(1)
         DO LL=2,NANGLE-1
*           WGTANG(LL)=(PTSANG(LL+1)+PTSANG(LL))/PI
*                     -(PTSANG(LL)+PTSANG(LL-1))/PI
            WGTANG(LL)=(ACOS(PTSANG(LL-1))-ACOS(PTSANG(LL+1)))/PI
            ACCUW=ACCUW+WGTANG(LL)
         ENDDO
         WGTANG(NANGLE)=(ACOS(PTSANG(NANGLE))+ACOS(PTSANG(NANGLE-1)))/PI
         ACCUW=ACCUW+WGTANG(NANGLE)
      ELSE
         WGTANG(1)=1.0D0
      ENDIF
      RETURN
      END
