summaryrefslogtreecommitdiff
path: root/Dragon/src/MCGDS4.f
blob: a9b64c82e459e45c1247b0868d424875d903237a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
*DECK MCGDS4
      SUBROUTINE MCGDS4(SUBSCH,NSEG,NSUB,NMU,LPS,NFUNL,NANGL,NGEFF,
     1                  WEI2D,KANGL,TRHAR,H2D,ZMU,WZMU,NOMCEL,NZON,NFI,
     2                  NREG,NDIM,M,IS,JS,PJJ,PSJ,LPJJAN,NPJJM,PJJIND,
     3                  SIGAL,MUST)
*
*-----------------------------------------------------------------------
*
*Purpose:
* Calculation of the PJJ and PSJ.
*
*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): R. Le Tellier
*
*Parameters: input
* SUBSCH  track coefficients calculation subroutine.
* NSEG    number of elements in the current track.
* NSUB    number of subtracks in the current track.
* NMU     order of the polar quadrature set.
* LPS     first dimension of PSJ.
* NFUNL   number of moments of the flux (in 2D : NFUNL=NANI*(NANI+1)/2).
* NANGL   number of tracking angles in the plane.
* NGEFF   number of energy groups to process.
* NFI     total number of volumes for which specific values
*         of the neutron flux and reactions rates are required.
* NREG    number of volumes for which specific values
*         of the neutron flux and reactions rates are required.
* NDIM    number of dimensions for the geometry.
* M       number of material mixtures.
* IS      arrays for surfaces neighbors
* JS      JS(IS(ISOUT)+1:IS(ISOUT+1)) give the neighboring regions to
*         surface ISOUT.
* NZON    index-number of the mixture type assigned to each volume.
* TRHAR   spherical harmonics components for each angle in the plane.
* WEI2D   track weight.
* KANGL   track direction indices.
* NOMCEL  integer tracking elements.
* H2D     real tracking elements.
* ZMU     polar quadrature set.
* WZMU    polar quadrature set.
* LPJJAN  flag for the calculation of anisotropic moments of the pjj.
* NPJJM   number of pjj modes to store for LPJJAN option.
* PJJIND  index of the modes for LPJJAN option.
* SIGAL   albedos and total cross sections array.
* MUST    polar index in TRHAR for 3D geometry.
*
*Parameters: input/output
* PJJ     collision probabilities.
* PSJ     escape probabilities.
*
*-----------------------------------------------------------------------
*
*----
*  SUBROUTINE ARGUMENTS
*----
      INTEGER NGEFF,NSEG,NSUB,NMU,LPS,NFUNL,NANGL,KANGL(NSEG),
     1 NOMCEL(NSEG),NZON(NFI),NFI,M,NREG,NDIM,IS(NFI-NREG+1),JS(LPS),
     2 NPJJM,PJJIND(NPJJM,2),MUST
      DOUBLE PRECISION WEI2D,H2D(NSEG)
      REAL TRHAR(NMU,NFUNL,NANGL),ZMU(NMU),WZMU(NMU),PSJ(LPS,NGEFF),
     1 SIGAL(-6:M,NGEFF)
      DOUBLE PRECISION PJJ(NREG,NPJJM,NGEFF)
      LOGICAL LPJJAN
      EXTERNAL SUBSCH
*----
*  LOCAL VARIABLES
*----
      DOUBLE PRECISION W
      DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:) :: HG
*----
*  CALCULATION OF COEFFICIENTS
*----
      IF(NDIM.EQ.3) THEN
*     3D calculation -> no loop over a polar angle   
         DO II=1,NGEFF
*           MCGDSCA: Step-Characteristics Scheme with Tabulated Exponentials
*           MCGDSCE: Step-Characteristics Scheme with Exact Exponentials
*           MCGDDDF: Diamond-Differencing Scheme
            CALL SUBSCH(M,NSEG,NSUB,LPS,IS,JS,H2D,KANGL,NOMCEL,NZON,
     1           SIGAL(0,II),WEI2D,NFI,NREG,PJJ(1,1,II),PSJ(1,II),MUST,
     2           NMU,NFUNL,NANGL,NPJJM,TRHAR,LPJJAN,PJJIND)
         ENDDO
      ELSE
*     2D calculation -> loop over the polar angle
         ALLOCATE(HG(NSEG))
         DO IMU=1,NMU
            ZMUI=ZMU(IMU)
            W=WEI2D*WZMU(IMU)
            DO I=1,NSEG
               IF(NZON(NOMCEL(I)).GE.0) HG(I)=H2D(I)*ZMUI
            ENDDO
            DO II=1,NGEFF
               CALL SUBSCH(M,NSEG,NSUB,LPS,IS,JS,HG,KANGL,NOMCEL,NZON,
     1              SIGAL(0,II),W,NFI,NREG,PJJ(1,1,II),PSJ(1,II),IMU,
     2              NMU,NFUNL,NANGL,NPJJM,TRHAR,LPJJAN,PJJIND)
            ENDDO
         ENDDO
         DEALLOCATE(HG)
      ENDIF
*
      RETURN
      END