summaryrefslogtreecommitdiff
path: root/Donjon/src/HSTGSL.f
blob: be685b876c2b676e5e06adf3aa90309b8f29482d (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
101
102
103
104
105
106
107
108
109
110
111
*DECK HSTGSL
      SUBROUTINE HSTGSL(IPHST, MAXL,   IOK,    TIMPOW, PARAML)
*
*----------
*
*Purpose:
* To read from or save to history file the local parameters 
*
*Copyright:
* Copyright (C) 2003 Ecole Polytechnique de Montreal.
*
*Author(s): 
* G. Marleau
*
*Parameters: input
* IPHST   address of the \dds{history} data structure.
* MAXL    maximum number of local parameters.                   
*
*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 
*         (-1 and 1 for before refueling and -2, 2 for after refueling);             
*         --> on output, a value of 0 indicates that the required
*         processing took place successfully while a negative 
*         value indicates a failure of the processing. 
* TIMPOW  burnup time and power density.
* PARAML  local parameters.
*
*----------
*
      USE GANLIB
      IMPLICIT         NONE
*----
*  SUBROUTINE ARGUMENTS
*----
      TYPE(C_PTR)      IPHST
      INTEGER          MAXL,IOK
      REAL             PARAML(0:MAXL)
      REAL             TIMPOW(2)
*----
*  LOCAL PARAMETERS
*----
      INTEGER          IOUT
      CHARACTER        NAMSBR*6
      PARAMETER       (IOUT=6,NAMSBR='HSTGSL')
*----
*  LOCAL VARIABLES
*----                  
      INTEGER          ILCMLN,ILCMTY 
*----
*  Local parameters after refuel
*---- 
      IF(IOK .EQ. -2) THEN
*----
*  Get local parameters after refuel
*---- 
        CALL LCMLEN(IPHST,'PARAMLOCALAR',ILCMLN,ILCMTY)
        IF(ILCMLN .LE. 0 .OR. ILCMLN .GT. MAXL) THEN
          IOK=-1
        ELSE 
          CALL LCMGET(IPHST,'PARAMLOCALAR',PARAML(1))
          IOK=0
        ENDIF
        CALL LCMLEN(IPHST,'PARAMBURNTAR',ILCMLN,ILCMTY)
        IF(ILCMLN .LE. 0 .OR. ILCMLN .GT. 2) THEN
          IOK=-1
        ELSE 
          CALL LCMGET(IPHST,'PARAMBURNTAR',TIMPOW)
          IOK=0
        ENDIF
      ELSE IF(IOK .EQ. -1) THEN
*----
*  Get local parameters before refuel
*---- 
        PARAML(0)=0
        CALL LCMLEN(IPHST,'PARAMLOCALBR',ILCMLN,ILCMTY)
        IF(ILCMLN .LE. 0 .OR. ILCMLN .GT. MAXL) THEN
          IOK=-1
        ELSE 
          CALL LCMGET(IPHST,'PARAMLOCALBR',PARAML(1))
          IOK=0
        ENDIF
        CALL LCMLEN(IPHST,'PARAMBURNTBR',ILCMLN,ILCMTY)
        IF(ILCMLN .LE. 0 .OR. ILCMLN .GT. 2) THEN
          IOK=-1
        ELSE 
          CALL LCMGET(IPHST,'PARAMBURNTBR',TIMPOW)
          IOK=0
        ENDIF
      ELSE IF(IOK .EQ. 1) THEN
*----
*  Save local parameters before refuel
*---- 
        CALL LCMPUT(IPHST,'PARAMLOCALBR',MAXL,2,PARAML(1))
        CALL LCMPUT(IPHST,'PARAMBURNTBR',2,2,TIMPOW)
        IOK=0
      ELSE IF(IOK .EQ. 2) THEN
*----
*  Save local parameters after refuel
*---- 
        CALL LCMPUT(IPHST,'PARAMLOCALAR',MAXL,2,PARAML(1))
        CALL LCMPUT(IPHST,'PARAMBURNTAR',2,2,TIMPOW)
        IOK=0 
      ELSE
        IOK=-2
      ENDIF
      RETURN
      END