summaryrefslogtreecommitdiff
path: root/Donjon/src/HSTGSD.f
blob: 1008d584df552a119dc9a56fc2d736d6404e5289 (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
*DECK HSTGSD
      SUBROUTINE HSTGSD(IPHST,  MAXI,   IOK,    DENI,   FDEN  )
*
*----------
*
*Purpose:
* To read from or write to to history file
* isotopic and fuel densities. 
*Copyright:
* Copyright (C) 2003 Ecole Polytechnique de Montreal.
*
*Author(s): 
* G. Marleau
*
*Parameters: input
* IPHST   address of the \dds{history} data structure.
* MAXI    maximum number of isotopes.            
*
*Parameters: input/output
* IOK     processing option where:
*         --> on input, a negative value indicates 
*         that the information is to be extracted 
*         from the \dds{history} data structure and a 
*         positive value indicates that the information is to be
*         stored on the \dds{history} data structure;              
*         --> on output, a value of 0 indicates that 
*         the required processing took place
*         successfully while a negative value indicates 
*         a failure of the processing.
* DENI    isotopic concentration.
* FDEN    average fuel density and weight.
* IOK     status of read. 
*         On input ->  IOK< 0 means get densities
*                             densities
*         On input ->  IOK> 0 means save densities
*         On output -> IOK= 0 success
*                      IOK=-1 error: density missing 
*                      IOK=-2 error: involid processing option
* DENI    initial and final isotopic concentration.
* FDEN    initial fuel density and heavy element mass.
*
*----------
*
      USE GANLIB
      IMPLICIT         NONE
*----
*  SUBROUTINE ARGUMENTS
*----
      TYPE(C_PTR)      IPHST
      INTEGER          MAXI,IOK
      REAL             DENI(0:MAXI)
      REAL             FDEN(2)
*----
*  LOCAL PARAMETERS
*----
      INTEGER          IOUT
      CHARACTER        NAMSBR*6
      PARAMETER       (IOUT=6,NAMSBR='HSTGSD')
*----
*  LOCAL VARIABLES
*----                  
      INTEGER          ILCMLN,ILCMTY 
*----
*  Local parameters after refuel
*---- 
      IF(IOK .LT. 0) THEN
        IOK=0
*----
*  Get isotopes concentration
*----
        CALL LCMLEN(IPHST,'ISOTOPESDENS',ILCMLN,ILCMTY)
        IF(ILCMLN .LE. 0 .OR. ILCMLN .GT. MAXI) THEN
          IOK=-1
        ELSE
          CALL LCMGET(IPHST,'ISOTOPESDENS',DENI(1))
        ENDIF
*----
*  Get fuel density
*----
        CALL LCMLEN(IPHST,'FUELDEN-INIT',ILCMLN,ILCMTY)
        IF(ILCMLN .LE. 0 .OR. ILCMLN .GT. 2) THEN
          IOK=-1
        ELSE
          CALL LCMGET(IPHST,'FUELDEN-INIT',FDEN)
        ENDIF
      ELSE IF(IOK .GT. 0) THEN
        IOK=0
*----
*  Put isotopes concentration
*----
        CALL LCMPUT(IPHST,'ISOTOPESDENS',MAXI,2,DENI(1))
*----
*  Put fuel density
*----
        CALL LCMPUT(IPHST,'FUELDEN-INIT',2,2,FDEN)
      ELSE
        IOK=-2
      ENDIF
      RETURN
      END