summaryrefslogtreecommitdiff
path: root/Dragon/src/PIJD2S.f
blob: 0b81674fc6dce4765001a5b04c97653666c706e5 (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
*DECK PIJD2S
      SUBROUTINE PIJD2S(NREG,NSOUT,PROB,PROBKS)
*
*-----------------------------------------------------------------------
*
*Purpose:
* Charge PROBKS matrices in the DRAGON square format.
*
*Copyright:
* Copyright (C) 1994 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
* NREG    number of zones for geometry.
* NSOUT   number of surfaces for geometry. 
* PROB    collision probabilities.
*
*Parameters: output
* PROBKS  square probability matrix.
*
*-----------------------------------------------------------------------
*
      IMPLICIT NONE
C----
C VARIABLES
C----
      INTEGER          NREG,NSOUT,KPRB,IIU,IIL,II,JJ
      DOUBLE PRECISION PROB(((NSOUT+NREG+2)*(NSOUT+NREG+1))/2)
      REAL             PROBKS(NREG*NREG)
C----
C  STORE IN SQUARE FORMAT
C----
      KPRB=(NSOUT+1)*(NSOUT+2)/2+NSOUT+1
      DO 20 JJ=1,NREG
         IIU=JJ
         IIL=(JJ-1)*NREG+1
         DO 10 II=1,JJ
            KPRB=KPRB+1
            PROBKS(IIL)=REAL(PROB(KPRB))
            PROBKS(IIU)=PROBKS(IIL)
            IIU=JJ+II*NREG
            IIL=IIL+1
   10    CONTINUE
         KPRB=KPRB+NSOUT+1
   20 CONTINUE
C
      RETURN
      END