summaryrefslogtreecommitdiff
path: root/Dragon/src/LIBWTF.f
blob: abcd5f572d0946c206e5afc7be993635dfa95b03 (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
*DECK LIBWTF
      SUBROUTINE LIBWTF(NGROUP,NTMP,TERP,SCAT,SIGS,TMPXS,TMPSC)
*
*-----------------------------------------------------------------------
*
*Purpose:
* Perform temperature interpolation for WIMS-E P1 scattering matrices.
*
*Copyright:
* Copyright (C) 2016 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
* NGROUP  number of energy groups.
* NTMP    number of temperatures.
* TERP    temperature coefficients.
* TMPXS   temperature dependent vectorial scattering cross sections.
* TMPSC   temperature dependent scattering matrix.
*
*Parameters: output
* SCAT    complete scattering matrix from ig to jg.
* SIGS    scattering cross sections.
*
*-----------------------------------------------------------------------
*
      IMPLICIT NONE
*----
* INTERFACE VARIABLES
*----
      INTEGER          NGROUP,NTMP
      DOUBLE PRECISION TERP(NTMP)
      REAL             SCAT(NGROUP,NGROUP),SIGS(NGROUP),
     >                 TMPXS(NGROUP,NTMP),TMPSC(NGROUP,NGROUP,NTMP)
*----
* LOCAL VARIABLES
*----
      INTEGER          IGF,ITM,IGD
      REAL             RTERP
*----
*  INTERPOLATE SCATTERING CROSS SECTIONS IN TEMPERATURE
*----
      SIGS(:NGROUP)=0.0
      SCAT(:NGROUP,:NGROUP)=0.0
      DO 130 ITM=1,NTMP
        RTERP=REAL(TERP(ITM))
        IF(RTERP.NE.0.0D0) THEN
          DO 131 IGD=1,NGROUP
            SIGS(IGD)=SIGS(IGD)+RTERP*TMPXS(IGD,ITM)
            DO 132 IGF=1,NGROUP
              SCAT(IGF,IGD)=SCAT(IGF,IGD)+RTERP*TMPSC(IGF,IGD,ITM)
 132        CONTINUE
 131      CONTINUE
        ENDIF
 130  CONTINUE
      RETURN
      END