summaryrefslogtreecommitdiff
path: root/Dragon/src/MCGSIG.f
blob: 3589cd64d8e0c81956f86825ae5b2d38e0648ff7 (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
*DECK MCGSIG
      SUBROUTINE MCGSIG(IPTRK,NMAT,NGEFF,NALBP,KPSYS,SIGAL,LVOID)
*
*-----------------------------------------------------------------------
*
*Purpose:
* Construct total cross sections and albedos array and check for void.
*
*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
* IPTRK   pointer to the tracking (L_TRACK signature).
* NMAT    number of mixtures.
* NGEFF   effective number of energy groups.
* NALBP   number of physical albedos.
* KPSYS   pointer array for each group properties.
*
*Parameters: output
* SIGAL   total cross sections and albedos array.
* LVOID   void flag.
*
*-----------------------------------------------------------------------
*
      USE GANLIB
      IMPLICIT NONE
*---
* SUBROUTINES ARGUMENTS
*---
      TYPE(C_PTR) IPTRK,KPSYS(NGEFF)
      INTEGER NMAT,NGEFF,NALBP
      REAL SIGAL(-6:NMAT,NGEFF)
      LOGICAL LVOID
*---
* LOCAL VARIABLES
*---
      TYPE(C_PTR) JPSYS
      INTEGER I,II,ISA,ICODE(6),ILONG,ITYLCM
      REAL ALBG(6),ALBEDO(6)
      REAL, ALLOCATABLE, DIMENSION(:) :: ALBP
*---
* RECOVER ALBEDO INFORMATION FROM TRACKING
*---
      CALL LCMLEN(IPTRK,'ICODE',ILONG,ITYLCM)
      IF(ILONG.GT.6) CALL XABORT('MCGSIG: ALBEDO OVERFLOW.')
      CALL LCMGET(IPTRK,'ICODE',ICODE)
      CALL LCMGET(IPTRK,'ALBEDO',ALBG)
*
      LVOID=.FALSE.
      ALLOCATE(ALBP(NALBP))
      DO II=1,NGEFF
         JPSYS=KPSYS(II)
         DO ISA=1,6
           ALBEDO(ISA)=ALBG(ISA)
         ENDDO
         IF(NALBP .GT. 0) THEN
           CALL LCMGET(JPSYS,'ALBEDO',ALBP)
           DO ISA=1,6
             IF(ICODE(ISA).GT.0) ALBEDO(ISA)=ALBP(ICODE(ISA))
           ENDDO
         ENDIF
         CALL LCMGET(JPSYS,'DRAGON-TXSC',SIGAL(0,II))
         DO I=1,NMAT
            IF (SIGAL(I,II).EQ.0.0) LVOID=.TRUE.
         ENDDO
         DO ISA=-6,-1
            SIGAL(ISA,II)=ALBEDO(-ISA)
         ENDDO
      ENDDO
      DEALLOCATE(ALBP)
*
      RETURN
      END