summaryrefslogtreecommitdiff
path: root/Dragon/src/INFNDA.f
blob: 04d6b1d77cbb09edac505a6b777a00b380a6a2d9 (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
*DECK INFNDA
      SUBROUTINE INFNDA(CFILNA,IPRINT,NBISO,HNAMIS,AWRISO)
*
*-----------------------------------------------------------------------
*
*Purpose:
* Recover isotopic masses for isotopes of NDAS-type libraries.
*
*Copyright:
* Copyright (C) 2006 Ecole Polytechnique de Montreal
*
*Author(s): A. Hebert 
*
*Parameters: input
* CFILNA  name of the NDAS file.
* IPRINT  print flag.
* NBISO   number of isotopes present in the calculation domain.
* HNAMIS  isotope names.
*
*Parameters: output
* AWRISO  isotopic masses.
*
*Reference:
* Copyright (C) from NDAS Atomic Energy of Canada Limited utility (2006)
*
*-----------------------------------------------------------------------
*
      USE FSDF
      IMPLICIT NONE
*----
*  Subroutine arguments
*----
      INTEGER IPRINT,NBISO
      CHARACTER CFILNA*(*),HNAMIS(NBISO)*8
      REAL AWRISO(NBISO)
*----
*  Local variables
*----
      INTEGER IOUT,MAXISO
      PARAMETER(IOUT=6,MAXISO=500)
      CHARACTER TEXT8*8,HSMG*131
      INTEGER I,ISO,IND,IERR,NEL,ISOID,ISONRF(2),HEADER(16),
     > HNAM(2,MAXISO)
      REAL RHEAD(200)
*----
*  Read NDAS library parameters
*----
      IF(CFILNA.EQ.' ' )THEN
        CALL XABORT('INFNDA: NDAS library has not been set')
      ENDIF
      CALL XSDOPN(CFILNA,IERR)
      IF(IERR.NE.0) CALL XABORT('INFNDA: XSDOPN could not open Library'
     >  //' files')
      CALL XSDBLD(6001,HEADER,IERR)
      IF(IERR.NE.0) CALL XABORT('INFNDA: XSDBLD could not read library'
     > //' parameters')
      NEL=HEADER(1)
      IF(NEL.GT.MAXISO) THEN
        WRITE(IOUT,30) MAXISO,NEL
        CALL XABORT('INFNDA: Invalid number of isotopes')
      ENDIF
*----
*  Recover the isotope names and identifiers from the library
*----
      DO I=1,NEL
        CALL XSDNAM(I,ISOID,TEXT8,IERR)
        IF(IERR.NE.0) CALL XABORT('INFNDA: XSDNAM index overflow')
        READ(TEXT8,'(2A4)') HNAM(1,I),HNAM(2,I)
      ENDDO
*----
*  Read through NDAS file and accumulate isotopic mass values
*----
      DO ISO=1,NBISO
        READ(HNAMIS(ISO),'(2A4)') (ISONRF(I),I=1,2)
        IND=0
        DO I=1,NEL
          IF((ISONRF(1).EQ.HNAM(1,I)).AND.
     >       (ISONRF(2).EQ.HNAM(2,I))) THEN
            IND=I
            GO TO 10
          ENDIF
        ENDDO
        WRITE(HSMG,30) HNAMIS(ISO),CFILNA
        CALL XABORT(HSMG)
*       Load nuclide header
   10   CALL XSDISO(7000,6001,IND,RHEAD,IERR)
        AWRISO(ISO)=RHEAD(3)
        IF(IPRINT.GE.100) WRITE(IOUT,40) HNAMIS(ISO),AWRISO(ISO)
      ENDDO
      CALL XSDCL()
      RETURN
*
   30 FORMAT('INFNDA: MATERIAL/ISOTOPE ',A8,
     >       ' IS MISSING ON NDAS LIBRARY FILE ',A8)
   40 FORMAT('INFNDA: DRAGON ISOTOPE =',A8,
     >       ' HAS ATOMIC WEIGHT RATIO = ',F12.5)
      END