23 coredelta1, coredelta2, coredelta3, &
24 coredelta_out, code_parameters)
32 USE deallocate_structures
39 INTEGER,
PARAMETER :: num_delta=3
43 TYPE (type_coreprof
),
POINTER :: coreprof(:)
45 TYPE (type_coredelta
),
POINTER :: coredelta1(:)
46 TYPE (type_coredelta
),
POINTER :: coredelta2(:)
47 TYPE (type_coredelta
),
POINTER :: coredelta3(:)
48 TYPE (type_coredelta
),
POINTER :: coredelta_out(:)
49 TYPE (type_coredelta
),
POINTER :: coredelta_arr(:)
51 TYPE (type_param
) :: code_parameters
56 REAL (R8),
SAVE :: c_psi(num_delta) = 0.0_r8
57 REAL (R8),
SAVE :: c_te(num_delta) = 0.0_r8
58 REAL (R8),
SAVE :: c_ne(num_delta) = 0.0_r8
59 REAL (R8),
SAVE :: c_ti(num_delta) = 0.0_r8
60 REAL (R8),
SAVE :: c_ni(num_delta) = 0.0_r8
61 REAL (R8),
SAVE :: c_tz(num_delta) = 0.0_r8
62 REAL (R8),
SAVE :: c_nz(num_delta) = 0.0_r8
63 REAL (R8),
SAVE :: c_vtor(num_delta) = 0.0_r8
65 REAL (R8),
ALLOCATABLE :: rho_tor(:)
69 INTEGER,
PARAMETER :: nslice = 1
74 INTEGER,
ALLOCATABLE :: nzimp(:)
75 INTEGER :: nneut, ineut
76 INTEGER,
ALLOCATABLE :: ncomp(:)
77 INTEGER,
ALLOCATABLE :: ntype(:)
80 INTEGER :: inum, ival, iarr
81 INTEGER :: return_status
89 IF (return_status /= 0)
THEN
90 WRITE(*,*)
'ERROR: Could not assign delta multipliers.'
97 nrho =
SIZE(coreprof(1)%rho_tor)
98 ALLOCATE (rho_tor(nrho))
100 CALL
get_comp_dimensions(coreprof(1)%COMPOSITIONS, nnucl, nion, nimp, nzimp, nneut, ntype, ncomp)
103 CALL
allocate_coredelta_cpo(num_delta, nrho, nnucl, nion, nimp, nzimp, nneut, ntype, ncomp, coredelta_arr)
105 CALL deallocate_cpo(coredelta_out(1)%compositions)
106 CALL copy_cpo(coreprof(1)%compositions, coredelta_out(1)%compositions)
109 rho_tor = coreprof(1)%rho_tor
110 coredelta_out(1)%VALUES(1)%rho_tor = rho_tor
113 coredelta_arr(inum)%VALUES(1)%rho_tor = coredelta_out(1)%VALUES(1)%rho_tor
114 CALL deallocate_cpo(coredelta_arr(inum)%compositions)
115 CALL copy_cpo(coredelta_out(1)%compositions, coredelta_arr(inum)%compositions)
129 IF (
ASSOCIATED(coredelta_arr(inum)%VALUES(1)%delta_psi) .AND. c_psi(inum).NE.0.0_r8) &
130 coredelta_out(1)%VALUES(1)%delta_psi = coredelta_out(1)%VALUES(1)%delta_psi + &
131 coredelta_arr(inum)%VALUES(1)%delta_psi * c_psi(inum)
133 IF (
ASSOCIATED(coredelta_arr(inum)%VALUES(1)%delta_ne) .AND. c_ne(inum).NE.0.0_r8) &
134 coredelta_out(1)%VALUES(1)%delta_ne = coredelta_out(1)%VALUES(1)%delta_ne + &
135 coredelta_arr(inum)%VALUES(1)%delta_ne * c_ne(inum)
137 IF (
ASSOCIATED(coredelta_arr(inum)%VALUES(1)%delta_te) .AND. c_te(inum).NE.0.0_r8) &
138 coredelta_out(1)%VALUES(1)%delta_te = coredelta_out(1)%VALUES(1)%delta_te + &
139 coredelta_arr(inum)%VALUES(1)%delta_te * c_te(inum)
141 IF (
ASSOCIATED(coredelta_arr(inum)%VALUES(1)%delta_ni) .AND. c_ni(inum).NE.0.0_r8) &
142 coredelta_out(1)%VALUES(1)%delta_ni = coredelta_out(1)%VALUES(1)%delta_ni + &
143 coredelta_arr(inum)%VALUES(1)%delta_ni * c_ni(inum)
145 IF (
ASSOCIATED(coredelta_arr(inum)%VALUES(1)%delta_ti) .AND. c_ti(inum).NE.0.0_r8) &
146 coredelta_out(1)%VALUES(1)%delta_ti = coredelta_out(1)%VALUES(1)%delta_ti + &
147 coredelta_arr(inum)%VALUES(1)%delta_ti * c_ti(inum)
149 IF (
ASSOCIATED(coredelta_arr(inum)%VALUES(1)%delta_vtor) .AND. c_vtor(inum).NE.0.0_r8) &
150 coredelta_out(1)%VALUES(1)%delta_vtor = coredelta_out(1)%VALUES(1)%delta_vtor + &
151 coredelta_arr(inum)%VALUES(1)%delta_vtor* c_vtor(inum)
154 IF (
ASSOCIATED(coredelta_arr(inum)%VALUES(1)%IMPURITY(iimp)%delta_nz) .AND. c_nz(inum).NE.0.0_r8) &
155 coredelta_out(1)%VALUES(1)%IMPURITY(iimp)%delta_nz = coredelta_out(1)%VALUES(1)%IMPURITY(iimp)%delta_nz + &
156 coredelta_arr(inum)%VALUES(1)%IMPURITY(iimp)%delta_nz * c_nz(inum)
158 IF (
ASSOCIATED(coredelta_arr(inum)%VALUES(1)%IMPURITY(iimp)%delta_tz) .AND. c_tz(inum).NE.0.0_r8) &
159 coredelta_out(1)%VALUES(1)%IMPURITY(iimp)%delta_tz = coredelta_out(1)%VALUES(1)%IMPURITY(iimp)%delta_tz + &
160 coredelta_arr(inum)%VALUES(1)%IMPURITY(iimp)%delta_tz * c_tz(inum)
170 IF(
ALLOCATED(rho_tor))
DEALLOCATE ( rho_tor )
171 IF(
ALLOCATED(nzimp))
DEALLOCATE ( nzimp )
172 IF(
ALLOCATED(ncomp))
DEALLOCATE ( ncomp )
173 IF(
ALLOCATED(ntype))
DEALLOCATE ( ntype )
174 CALL deallocate_cpo(coredelta_arr)
179 ALLOCATE (coredelta_out(1)%VALUES(1)%deltaid%id(1))
180 ALLOCATE (coredelta_out(1)%VALUES(1)%deltaid%description(1))
181 coredelta_out(1)%VALUES(1)%deltaid%id =
'combined'
182 coredelta_out(1)%VALUES(1)%deltaid%flag = 4
183 coredelta_out(1)%VALUES(1)%deltaid%description =
'Combined coredelta'
189 ALLOCATE (coredelta_arr(num_delta+1))
190 CALL copy_cpo(coredelta_out(1), coredelta_arr(1))
191 CALL copy_cpo(coredelta1(1), coredelta_arr(2))
192 CALL copy_cpo(coredelta2(1), coredelta_arr(3))
193 CALL copy_cpo(coredelta3(1), coredelta_arr(4))
194 CALL deallocate_cpo(coredelta_out(1)%VALUES)
195 ALLOCATE (coredelta_out(1)%VALUES(1+ &
196 SIZE(coredelta1(1)%VALUES)+
SIZE(coredelta2(1)%VALUES)+
SIZE(coredelta3(1)%VALUES)))
200 DO inum = 1, num_delta+1
201 DO iarr = 1,
SIZE(coredelta_arr(inum)%VALUES)
202 CALL copy_cpo(coredelta_arr(inum)%VALUES(iarr), coredelta_out(1)%VALUES(ival))
208 CALL deallocate_cpo(coredelta_arr)
242 TYPE(type_param
) :: codeparameters
243 INTEGER(ITM_I4) :: return_status
245 TYPE(tree
) :: parameter_list
246 TYPE(element
),
POINTER :: temp_pointer
247 INTEGER(ITM_I4) :: i, nparm, n_values
248 CHARACTER(len = 132) :: cname
249 CHARACTER(len = 132) :: code_param_name
250 CHARACTER(len = 132) :: parameter_value
251 REAL (R8),
SAVE :: value(1) = 0.0_r8
267 CALL euitm_xml_parse(codeparameters, nparm, parameter_list)
269 temp_pointer => parameter_list%first
270 code_param_name =
'parameters/PSI/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_pellet'
271 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
272 IF (len(trim(parameter_value)).GE.1)
THEN
273 CALL scan_str2real(parameter_value, value, n_data)
276 temp_pointer => parameter_list%first
277 code_param_name =
'parameters/PSI/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_sawtooth'
278 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
279 IF (len(trim(parameter_value)).GE.1)
THEN
280 CALL scan_str2real(parameter_value, value, n_data)
283 temp_pointer => parameter_list%first
284 code_param_name =
'parameters/PSI/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_elm'
285 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
286 IF (len(trim(parameter_value)).GE.1)
THEN
287 CALL scan_str2real(parameter_value, value, n_data)
290 temp_pointer => parameter_list%first
291 code_param_name =
'parameters/NE/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_pellet'
292 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
293 IF (len(trim(parameter_value)).GE.1)
THEN
294 CALL scan_str2real(parameter_value, value, n_data)
297 temp_pointer => parameter_list%first
298 code_param_name =
'parameters/NE/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_sawtooth'
299 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
300 IF (len(trim(parameter_value)).GE.1)
THEN
301 CALL scan_str2real(parameter_value, value, n_data)
304 temp_pointer => parameter_list%first
305 code_param_name =
'parameters/NE/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_elm'
306 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
307 IF (len(trim(parameter_value)).GE.1)
THEN
308 CALL scan_str2real(parameter_value, value, n_data)
311 temp_pointer => parameter_list%first
312 code_param_name =
'parameters/TE/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_pellet'
313 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
314 IF (len(trim(parameter_value)).GE.1)
THEN
315 CALL scan_str2real(parameter_value, value, n_data)
318 temp_pointer => parameter_list%first
319 code_param_name =
'parameters/TE/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_sawtooth'
320 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
321 IF (len(trim(parameter_value)).GE.1)
THEN
322 CALL scan_str2real(parameter_value, value, n_data)
325 temp_pointer => parameter_list%first
326 code_param_name =
'parameters/TE/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_elm'
327 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
328 IF (len(trim(parameter_value)).GE.1)
THEN
329 CALL scan_str2real(parameter_value, value, n_data)
332 temp_pointer => parameter_list%first
333 code_param_name =
'parameters/NI/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_pellet'
334 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
335 IF (len(trim(parameter_value)).GE.1)
THEN
336 CALL scan_str2real(parameter_value, value, n_data)
339 temp_pointer => parameter_list%first
340 code_param_name =
'parameters/NI/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_sawtooth'
341 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
342 IF (len(trim(parameter_value)).GE.1)
THEN
343 CALL scan_str2real(parameter_value, value, n_data)
346 temp_pointer => parameter_list%first
347 code_param_name =
'parameters/NI/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_elm'
348 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
349 IF (len(trim(parameter_value)).GE.1)
THEN
350 CALL scan_str2real(parameter_value, value, n_data)
353 temp_pointer => parameter_list%first
354 code_param_name =
'parameters/TI/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_pellet'
355 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
356 IF (len(trim(parameter_value)).GE.1)
THEN
357 CALL scan_str2real(parameter_value, value, n_data)
360 temp_pointer => parameter_list%first
361 code_param_name =
'parameters/TI/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_sawtooth'
362 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
363 IF (len(trim(parameter_value)).GE.1)
THEN
364 CALL scan_str2real(parameter_value, value, n_data)
367 temp_pointer => parameter_list%first
368 code_param_name =
'parameters/TI/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_elm'
369 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
370 IF (len(trim(parameter_value)).GE.1)
THEN
371 CALL scan_str2real(parameter_value, value, n_data)
374 temp_pointer => parameter_list%first
375 code_param_name =
'parameters/VTOR/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_pellet'
376 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
377 IF (len(trim(parameter_value)).GE.1)
THEN
378 CALL scan_str2real(parameter_value, value, n_data)
381 temp_pointer => parameter_list%first
382 code_param_name =
'parameters/VTOR/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_sawtooth'
383 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
384 IF (len(trim(parameter_value)).GE.1)
THEN
385 CALL scan_str2real(parameter_value, value, n_data)
388 temp_pointer => parameter_list%first
389 code_param_name =
'parameters/VTOR/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_elm'
390 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
391 IF (len(trim(parameter_value)).GE.1)
THEN
392 CALL scan_str2real(parameter_value, value, n_data)
395 temp_pointer => parameter_list%first
396 code_param_name =
'parameters/NZ/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_pellet'
397 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
398 IF (len(trim(parameter_value)).GE.1)
THEN
399 CALL scan_str2real(parameter_value, value, n_data)
402 temp_pointer => parameter_list%first
403 code_param_name =
'parameters/NZ/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_sawtooth'
404 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
405 IF (len(trim(parameter_value)).GE.1)
THEN
406 CALL scan_str2real(parameter_value, value, n_data)
409 temp_pointer => parameter_list%first
410 code_param_name =
'parameters/NZ/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_elm'
411 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
412 IF (len(trim(parameter_value)).GE.1)
THEN
413 CALL scan_str2real(parameter_value, value, n_data)
416 temp_pointer => parameter_list%first
417 code_param_name =
'parameters/PTZ/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_pellet'
418 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
419 IF (len(trim(parameter_value)).GE.1)
THEN
420 CALL scan_str2real(parameter_value, value, n_data)
423 temp_pointer => parameter_list%first
424 code_param_name =
'parameters/TZ/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_sawtooth'
425 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
426 IF (len(trim(parameter_value)).GE.1)
THEN
427 CALL scan_str2real(parameter_value, value, n_data)
430 temp_pointer => parameter_list%first
431 code_param_name =
'parameters/TZ/COMBINE_CONTRIBUTIONS_WITH_WEIGHTS/from_elm'
432 CALL find_parameter(code_param_name, parameter_value, temp_pointer)
433 IF (len(trim(parameter_value)).GE.1)
THEN
434 CALL scan_str2real(parameter_value, value, n_data)
442 CALL destroy_xml_tree(parameter_list)
subroutine allocate_coredelta_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COREDELTA)
This routine allocates COREDELTA CPO.
subroutine get_comp_dimensions(COMPOSITIONS, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP)
subroutine combine_deltas(COREPROF, COREDELTA1, COREDELTA2, COREDELTA3, COREDELTA_OUT, code_parameters)
subroutine interpolate_delta(COREDELTA_IN, COREDELTA_OUT)
This module contains routines for allocation/deallocation if CPOs used in ETS.
subroutine assign_combiner_parameters(codeparameters, return_status)