45
46
47
54
55
56
57#include "implicit_f.inc"
58
59
60
61#include "scr17_c.inc"
62#include "units_c.inc"
63
64
65
66 INTEGER NFUNCT, NPTS_ALLOC
67 INTEGER NPC(*),FUNCRYPT(*)
69 TYPE(TTABLE) TABLE(*)
70 INTEGER NOM_OPT(LNOPT1,*)
71 TYPE(SUBMODEL_DATA), DIMENSION(NSUBMOD), INTENT(IN) :: LSUBMODEL
72 TYPE(UNIT_TYPE_), INTENT(IN) :: UNITAB
73
74
75
76 INTEGER I,J,L,FUNC_ID,NPTS,STAT,N,II,ISMOOTH
77 INTEGER :: IPYTHON
79 my_real xscale,yscale,xshift,yshift
80 CHARACTER(LEN=NCHARTITLE) :: TITR
81 CHARACTER *40,KEY*20
82 DATA mess/' FUNCTION & TABLES DEFINITION '/
83 LOGICAL :: IS_ENCRYPTED, IS_AVAILABLE
84 INTEGER :: NB_FUNCT, NB_FUNCT_SMOOTH, IPT, NPT
85
86
87
88 IF (nfunct == 0) RETURN
89
90 stat = 0
91
92 WRITE (iout,2000) nfunct
93
94
95 is_encrypted = .false.
96 is_available = .false.
97
98 npc(1)=1
99 l =0
100
101
102
105 IF (nb_funct > 0) THEN
107 DO i = 1, nb_funct
108
110 . option_titr = titr,
111 . option_id = func_id,
112 . keyword1 = key)
113
114 ismooth = 0
115 ipython = 0
116 IF(key(6:12) == '_SMOOTH') ismooth = 1
117 IF(key(6:12) == '_PYTHON') ipython = 1
118
119 IF(ismooth == 0 .AND. ipython == 0 ) THEN
121 l = l + 1
122 CALL fretitl(titr,nom_opt(lnopt1-ltitr+1,l),ltitr)
123 nom_opt(1, l) = func_id
124 npc(nfunct + l + 1) = func_id
125 npc(2 * nfunct + l + 1) = ismooth
126 npc(l + 1) = npc(l)
127 npts = 0
128 WRITE(iout, 2100) func_id
129
130 CALL hm_get_intv(
'numberofpoints', npt, is_available, lsubmodel)
131
132 DO ipt = 1, npt
135 IF (.NOT. is_encrypted) THEN
136 WRITE(iout,'(3X,1PG20.13,2X,1G20.13)') time,funct
137 ENDIF
138 npts = npts + 1
139 pld(npc(l + 1)) = time
140 IF (npts > 1) THEN
141 IF (pld(npc(l+1)) <= pld(npc(l+1)-2)) THEN
142
143 CALL ancmsg(msgid = 156, msgtype = msgerror, anmode = aninfo_blind_1,
144 . i1 = func_id, c1 = titr, i2 = npts, i3 = npts-1)
145 ENDIF
146 ENDIF
147 npc(l + 1) = npc(l + 1) + 1
148 pld(npc(l + 1)) = funct
149 npc(l + 1) = npc(l + 1) + 1
150 ENDDO
151
152 IF (npt < 2) THEN
153 CALL ancmsg(msgid=1874, msgtype=msgwarning, anmode=aninfo_blind_1,
154 . i1=func_id,
155 . c1=titr)
156 END IF
157
158
159 table(l)%NOTABLE=func_id
160 table(l)%NDIM =1
161
162 ALLOCATE(table(l)%X(1),stat=stat)
163 IF (stat /= 0)
CALL ancmsg(msgid=268,anmode=aninfo,
164 . msgtype=msgerror,
165 . c1='TABLE')
166 ALLOCATE(table(l)%X(1)%VALUES(npts),stat=stat)
167 IF (stat /= 0)
CALL ancmsg(msgid=268,anmode=aninfo,
168 . msgtype=msgerror,
169 . c1='TABLE')
170 ALLOCATE(table(l)%Y,stat=stat)
171 IF (stat /= 0)
CALL ancmsg(msgid=268,anmode=aninfo,
172 . msgtype=msgerror,
173 . c1='TABLE')
174 ALLOCATE(table(l)%Y%VALUES(npts),stat=stat)
175 IF (stat /= 0)
CALL ancmsg(msgid=268,anmode=aninfo,
176 . msgtype=msgerror,
177 . c1='TABLE')
178
179 DO n=1,npts
180 table(l)%X(1)%VALUES(n)=pld(npc(l)+2*n-2)
181 table(l)%Y%VALUES(n) =pld(npc(l)+2*n-1)
182 ENDDO
183 IF (is_encrypted) THEN
184 WRITE(iout,'(A)')'CONFIDENTIAL DATA'
185 funcrypt(l) = 1
186 ENDIF
187 ENDIF
188 ENDDO
189 ENDIF
190
191
192
193 IF (nb_funct_smooth > 0) THEN
195 DO i = 1, nb_funct_smooth
196
198 . option_titr = titr,
199 . option_id = func_id,
200 . keyword1 = key)
201
203 ismooth = 1
204 l = l + 1
205 CALL fretitl(titr,nom_opt(lnopt1-ltitr+1,l),ltitr)
206 nom_opt(1, l) = func_id
207 npc(nfunct + l + 1) = func_id
208 npc(2 * nfunct + l + 1) = ismooth
209 npc(l + 1) = npc(l)
210 npts = 0
211 WRITE(iout, 2200) func_id
212
213 CALL hm_get_floatv(
'A_SCALE_X' ,xscale ,is_available ,lsubmodel ,unitab)
214 CALL hm_get_floatv(
'F_SCALE_Y' ,yscale ,is_available ,lsubmodel ,unitab)
215 CALL hm_get_floatv(
'A_SHIFT_X' ,xshift ,is_available ,lsubmodel ,unitab)
216 CALL hm_get_floatv(
'F_SHIFT_Y' ,yshift ,is_available ,lsubmodel ,unitab)
217 IF (xscale == zero) xscale = one
218 IF (yscale == zero) yscale = one
219
220 WRITE (iout,2300)
221 IF (.NOT. is_encrypted)
222 . WRITE(iout,'(3X,1PG20.13,3(2X,1G20.13))') xscale,yscale,xshift,yshift
223 WRITE (iout,2400)
224
225
226 CALL hm_get_intv(
'numberofpoints', npt, is_available, lsubmodel)
227
228 DO ipt = 1, npt
231
232 time = time * xscale + xshift
233 funct = funct * yscale + yshift
234
235 IF (.NOT. is_encrypted) THEN
236 WRITE(iout,'(3X,1PG20.13,2X,1G20.13)') time,funct
237 ENDIF
238 npts = npts + 1
239 pld(npc(l + 1)) = time
240 IF (npts > 1) THEN
241 IF (pld(npc(l+1)) <= pld(npc(l+1)-2)) THEN
242
243 CALL ancmsg(msgid = 156, msgtype = msgerror, anmode = aninfo_blind_1,
244 . i1 = func_id, c1 = titr, i2 = npts, i3 = npts-1)
245 ENDIF
246 ENDIF
247 npc(l + 1) = npc(l + 1) + 1
248 pld(npc(l + 1)) = funct
249 npc(l + 1) = npc(l + 1) + 1
250 ENDDO
251
252 IF (npt < 2) THEN
253 CALL ancmsg(msgid=1874, msgtype=msgwarning, anmode=aninfo_blind_1,
254 . i1=func_id,
255 . c1=titr)
256 END IF
257
258
259 table(l)%NOTABLE=func_id
260 table(l)%NDIM =1
261
262 ALLOCATE(table(l)%X(1),stat=stat)
263 IF (stat /= 0)
CALL ancmsg(msgid=268,anmode=aninfo,
264 . msgtype=msgerror,
265 . c1='TABLE')
266 ALLOCATE(table(l)%X(1)%VALUES(npts),stat=stat)
267 IF (stat /= 0)
CALL ancmsg(msgid=268,anmode=aninfo,
268 . msgtype=msgerror,
269 . c1='TABLE')
270 ALLOCATE(table(l)%Y,stat=stat)
271 IF (stat /= 0)
CALL ancmsg(msgid=268,anmode=aninfo,
272 . msgtype=msgerror,
273 . c1='TABLE')
274 ALLOCATE(table(l)%Y%VALUES(npts),stat=stat)
275 IF (stat /= 0)
CALL ancmsg(msgid=268,anmode=aninfo,
276 . msgtype=msgerror,
277 . c1='TABLE')
278
279 DO n=1,npts
280 table(l)%X(1)%VALUES(n)=pld(npc(l)+2*n-2)
281 table(l)%Y%VALUES(n) =pld(npc(l)+2*n-1)
282 ENDDO
283 IF (is_encrypted) THEN
284 WRITE(iout,'(A)')'CONFIDENTIAL DATA'
285 funcrypt(l) = 1
286 ENDIF
287 ENDDO
288 ENDIF
289
290
291 RETURN
292
2932000 FORMAT(//
294 . ' LOAD CURVES'/
295 . ' -----------'/
296 . ' NUMBER OF LOAD CURVES. . . . . . . . =',i10/)
2972100 FORMAT(/' LOAD CURVE ID . . . . . . . . . . . =',i10//
298 . ' X Y ')
2992200 FORMAT(/' LOAD SMOOTH CURVE ID . . . . . . . =',i10)
3002300 FORMAT(/' XSCALE YSCALE XSHIFT
301 . YSHIFT ')
3022400 FORMAT(/' X Y ')
subroutine hm_get_float_array_index(name, rval, index, is_available, lsubmodel, unitab)
subroutine hm_get_floatv(name, rval, is_available, lsubmodel, unitab)
subroutine hm_get_intv(name, ival, is_available, lsubmodel)
subroutine hm_option_count(entity_type, hm_option_number)
subroutine hm_option_is_encrypted(is_encrypted)
subroutine hm_option_start(entity_type)
integer, parameter nchartitle
subroutine ancmsg(msgid, msgtype, anmode, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, r1, r2, r3, r4, r5, r6, r7, r8, r9, c1, c2, c3, c4, c5, c6, c7, c8, c9, prmode)