ETS  \$Id: Doxyfile 2162 2020-02-26 14:16:09Z g2dpc $
 All Classes Files Functions Variables Pages
allocate_deallocate.f90
Go to the documentation of this file.
1 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
7 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
9 !-------------------------------------------------------!
10 ! !
11 ! This module contains routines for !
12 ! allocation/deallocation if CPOs used in ETS !
13 ! !
14 !-------------------------------------------------------!
15 ! !
16 ! Source: --- !
17 ! Developers: D.Kalupin !
18 ! Kontacts: D.Kalupin@fz-juelich.de !
19 ! !
20 ! Comments: --- !
21 ! !
22 !-------------------------------------------------------!
23 
24 CONTAINS
25 
26 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
32 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
33  SUBROUTINE allocate_coreprof_cpo (NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COREPROF)
34 
35 !-------------------------------------------------------!
36 ! !
37 ! This routine allocates COREPROF CPO !
38 ! !
39 !-------------------------------------------------------!
40 ! !
41 ! Source: --- !
42 ! Developers: D.Kalupin !
43 ! Kontacts: D.Kalupin@fz-juelich.de !
44 ! !
45 ! Comments: --- !
46 ! !
47 !-------------------------------------------------------!
48 
49 
50  USE euitm_schemas
51  USE itm_types
52  USE copy_structures
53  USE deallocate_structures
54 
55  IMPLICIT NONE
56 
57  INTEGER :: nslice, islice !number of slices and slice index
58  INTEGER :: nrho !number of radial points (input)
59  INTEGER :: nnucl, inucl !number of nuclei species
60  INTEGER :: nion, iion !number of ion species
61  INTEGER :: nimp, iimp !number of impurity species
62  INTEGER, ALLOCATABLE :: nzimp(:) !number of ionization states for each impurity
63  INTEGER :: izimp
64  INTEGER :: nneut, ineut !number of neutrals species
65  INTEGER, ALLOCATABLE :: ncomp(:) !number of components for each neutral
66  INTEGER :: icomp
67  INTEGER, ALLOCATABLE :: ntype(:) !number of types for each neutral
68  INTEGER :: itype
69 
70  TYPE (type_coreprof), POINTER :: coreprof(:) !CPO with internal ETS parameters profiles
71  TYPE (type_compositions_type) :: compositions
72 
73 ! write(*,*) '*** ALLOCATE_COREPROF_CPO CALLED ***'
74 
75  ALLOCATE (coreprof(nslice))
76  CALL allocate_compositions(nslice, nnucl, nion, nimp, nzimp, nneut, ntype, ncomp, compositions)
77 
78 
79  DO islice = 1,nslice
80 
81  CALL deallocate_cpo(coreprof(islice)%compositions)
82  CALL copy_cpo(compositions, coreprof(islice)%compositions)
83 
84 
85 ! +++ Codeparam:
86  ALLOCATE (coreprof(islice)%codeparam%codename(1))
87  ALLOCATE (coreprof(islice)%codeparam%codeversion(1))
88  ALLOCATE (coreprof(islice)%codeparam%output_diag(1))
89 
90 
91 ! +++ Radial coordinate:
92  ALLOCATE (coreprof(islice)%rho_tor(nrho))
93  ALLOCATE (coreprof(islice)%rho_tor_norm(nrho))
94 
95 
96 
97 ! +++ Plasma primary profiles:
98  ALLOCATE (coreprof(islice)%psi%value(nrho))
99  ALLOCATE (coreprof(islice)%ni%value(nrho,nion))
100  ALLOCATE (coreprof(islice)%ne%value(nrho))
101  ALLOCATE (coreprof(islice)%ti%value(nrho,nion))
102  ALLOCATE (coreprof(islice)%te%value(nrho))
103  ALLOCATE (coreprof(islice)%vtor%value(nrho,nion))
104 
105 
106 ! +++ Derivatives of plasma primary profiles: (AF - 25.Sep.2014)
107  ALLOCATE (coreprof(islice)%psi%ddrho(nrho))
108  ALLOCATE (coreprof(islice)%ni%ddrho(nrho,nion))
109  ALLOCATE (coreprof(islice)%ne%ddrho(nrho))
110  ALLOCATE (coreprof(islice)%ti%ddrho(nrho,nion))
111  ALLOCATE (coreprof(islice)%te%ddrho(nrho))
112  ALLOCATE (coreprof(islice)%vtor%ddrho(nrho,nion))
113 
114 
115 ! +++ Boundary conditions:
116  ALLOCATE (coreprof(islice)%ni%flag(nion))
117  ALLOCATE (coreprof(islice)%ti%flag(nion))
118  ALLOCATE (coreprof(islice)%vtor%flag(nion))
119 
120  ALLOCATE (coreprof(islice)%ni%boundary%type(nion))
121  ALLOCATE (coreprof(islice)%ti%boundary%type(nion))
122  ALLOCATE (coreprof(islice)%vtor%boundary%type(nion))
123 
124  ALLOCATE (coreprof(islice)%ni%boundary%rho_tor(nion))
125  ALLOCATE (coreprof(islice)%ti%boundary%rho_tor(nion))
126  ALLOCATE (coreprof(islice)%vtor%boundary%rho_tor(nion))
127 
128  ALLOCATE (coreprof(islice)%psi%boundary%value(3))
129  ALLOCATE (coreprof(islice)%ni%boundary%value(3,nion))
130  ALLOCATE (coreprof(islice)%ne%boundary%value(3))
131  ALLOCATE (coreprof(islice)%ti%boundary%value(3,nion))
132  ALLOCATE (coreprof(islice)%te%boundary%value(3))
133  ALLOCATE (coreprof(islice)%vtor%boundary%value(3,nion))
134 
135 
136 ! +++ Profiles of transport coefficients:
137  ALLOCATE (coreprof(islice)%psi%sigma_par%value(nrho))
138  ALLOCATE (coreprof(islice)%ni%transp_coef%diff(nrho,nion))
139  ALLOCATE (coreprof(islice)%ne%transp_coef%diff(nrho))
140  ALLOCATE (coreprof(islice)%ti%transp_coef%diff(nrho,nion))
141  ALLOCATE (coreprof(islice)%te%transp_coef%diff(nrho))
142  ALLOCATE (coreprof(islice)%vtor%transp_coef%diff(nrho,nion))
143  ALLOCATE (coreprof(islice)%ni%transp_coef%vconv(nrho,nion))
144  ALLOCATE (coreprof(islice)%ne%transp_coef%vconv(nrho))
145  ALLOCATE (coreprof(islice)%ti%transp_coef%vconv(nrho,nion))
146  ALLOCATE (coreprof(islice)%te%transp_coef%vconv(nrho))
147  ALLOCATE (coreprof(islice)%vtor%transp_coef%vconv(nrho,nion))
148  ALLOCATE (coreprof(islice)%profiles1d%wtor%value(nrho,nion))
149 
150 
151 ! +++ Flux profiles:
152  ALLOCATE (coreprof(islice)%ni%flux%flux_dv(nrho,nion))
153  ALLOCATE (coreprof(islice)%ne%flux%flux_dv(nrho))
154  ALLOCATE (coreprof(islice)%ti%flux%flux_dv(nrho,nion))
155  ALLOCATE (coreprof(islice)%te%flux%flux_dv(nrho))
156  ALLOCATE (coreprof(islice)%vtor%flux%flux_dv(nrho,nion))
157 
158 
159 ! +++ Source profiles:
160  ALLOCATE (coreprof(islice)%psi%jni%value(nrho))
161  ALLOCATE (coreprof(islice)%ni%source_term%value(nrho,nion))
162  ALLOCATE (coreprof(islice)%ni%source_term%integral(nrho,nion))
163  ALLOCATE (coreprof(islice)%ne%source_term%value(nrho))
164  ALLOCATE (coreprof(islice)%ne%source_term%integral(nrho))
165  ALLOCATE (coreprof(islice)%ti%source_term%value(nrho,nion))
166  ALLOCATE (coreprof(islice)%ti%source_term%integral(nrho,nion))
167  ALLOCATE (coreprof(islice)%te%source_term%value(nrho))
168  ALLOCATE (coreprof(islice)%te%source_term%integral(nrho))
169  ALLOCATE (coreprof(islice)%vtor%source_term%value(nrho,nion))
170  ALLOCATE (coreprof(islice)%vtor%source_term%integral(nrho,nion))
171 
172 
173 ! +++ Plasma profiles 1-D:
174  ALLOCATE (coreprof(islice)%profiles1d%pr_th%value(nrho))
175  ALLOCATE (coreprof(islice)%profiles1d%pr_perp%value(nrho))
176  ALLOCATE (coreprof(islice)%profiles1d%pr_parallel%value(nrho))
177  ALLOCATE (coreprof(islice)%profiles1d%pe%value(nrho))
178  ALLOCATE (coreprof(islice)%profiles1d%pi_tot%value(nrho))
179  ALLOCATE (coreprof(islice)%profiles1d%pi%value(nrho,nion))
180  ALLOCATE (coreprof(islice)%profiles1d%jtot%value(nrho))
181  ALLOCATE (coreprof(islice)%profiles1d%jni%value(nrho))
182  ALLOCATE (coreprof(islice)%profiles1d%jphi%value(nrho))
183  ALLOCATE (coreprof(islice)%profiles1d%joh%value(nrho))
184  ALLOCATE (coreprof(islice)%profiles1d%q%value(nrho))
185  ALLOCATE (coreprof(islice)%profiles1d%vloop%value(nrho))
186  ALLOCATE (coreprof(islice)%profiles1d%sigmapar%value(nrho))
187  ALLOCATE (coreprof(islice)%profiles1d%qoh%value(nrho))
188  ALLOCATE (coreprof(islice)%profiles1d%qoh%integral(nrho))
189  ALLOCATE (coreprof(islice)%profiles1d%eparallel%value(nrho))
190  ALLOCATE (coreprof(islice)%profiles1d%shear%value(nrho))
191  ALLOCATE (coreprof(islice)%profiles1d%bpol%value(nrho))
192  ALLOCATE (coreprof(islice)%profiles1d%zeff%value(nrho))
193  ALLOCATE (coreprof(islice)%profiles1d%qei%value(nrho))
194 
195 
196 ! +++ Zero out arrays
197  coreprof(islice)%codeparam%codename = '-999999999'
198  coreprof(islice)%codeparam%codeversion = '-999999999'
199  coreprof(islice)%codeparam%output_diag = '-999999999'
200  coreprof(islice)%codeparam%output_flag = -999999999
201 
202  coreprof(islice)%rho_tor(:) = 0.0_r8
203  coreprof(islice)%rho_tor_norm(:) = 0.0_r8
204 
205  coreprof(islice)%psi%flag = 0
206  coreprof(islice)%ne%flag = 0
207  coreprof(islice)%te%flag = 0
208  coreprof(islice)%ni%flag(:) = 0
209  coreprof(islice)%ti%flag(:) = 0
210  coreprof(islice)%vtor%flag(:) = 0
211 
212  coreprof(islice)%psi%boundary%type = 0
213  coreprof(islice)%ne%boundary%type = 0
214  coreprof(islice)%te%boundary%type = 0
215  coreprof(islice)%ni%boundary%type(:) = 0
216  coreprof(islice)%ti%boundary%type(:) = 0
217  coreprof(islice)%vtor%boundary%type(:) = 0
218 
219  coreprof(islice)%psi%boundary%rho = 0.0_r8
220  coreprof(islice)%ni%boundary%rho_tor = 0.0_r8
221  coreprof(islice)%ne%boundary%rho_tor = 0.0_r8
222  coreprof(islice)%ti%boundary%rho_tor = 0.0_r8
223  coreprof(islice)%te%boundary%rho_tor = 0.0_r8
224  coreprof(islice)%vtor%boundary%rho_tor = 0.0_r8
225 
226 
227  coreprof(islice)%psi%boundary%value(:) = 0.0_r8
228  coreprof(islice)%ni%boundary%value(:,:) = 0.0_r8
229  coreprof(islice)%ne%boundary%value(:) = 0.0_r8
230  coreprof(islice)%ti%boundary%value(:,:) = 0.0_r8
231  coreprof(islice)%te%boundary%value(:) = 0.0_r8
232  coreprof(islice)%vtor%boundary%value(:,:) = 0.0_r8
233 
234 
235  coreprof(islice)%psi%value(:) = 0.0_r8
236  coreprof(islice)%ni%value(:,:) = 0.0_r8
237  coreprof(islice)%ne%value(:) = 0.0_r8
238  coreprof(islice)%ti%value(:,:) = 0.0_r8
239  coreprof(islice)%te%value(:) = 0.0_r8
240  coreprof(islice)%vtor%value(:,:) = 0.0_r8
241 
242 
243  coreprof(islice)%psi%sigma_par%value = 0.0_r8
244  coreprof(islice)%profiles1d%q%value(:) = 0.0_r8
245  coreprof(islice)%profiles1d%jtot%value(:) = 0.0_r8
246  coreprof(islice)%profiles1d%jni%value(:) = 0.0_r8
247  coreprof(islice)%profiles1d%jphi%value(:) = 0.0_r8
248  coreprof(islice)%profiles1d%joh%value(:) = 0.0_r8
249  coreprof(islice)%profiles1d%vloop%value(:) = 0.0_r8
250  coreprof(islice)%profiles1d%sigmapar%value(:) = 0.0_r8
251  coreprof(islice)%profiles1d%qoh%value(:) = 0.0_r8
252  coreprof(islice)%profiles1d%qoh%integral(:) = 0.0_r8
253  coreprof(islice)%profiles1d%eparallel%value(:) = 0.0_r8
254  coreprof(islice)%profiles1d%pr_th%value(:) = 0.0_r8
255  coreprof(islice)%profiles1d%pr_perp%value(:) = 0.0_r8
256  coreprof(islice)%profiles1d%pr_parallel%value(:) = 0.0_r8
257  coreprof(islice)%profiles1d%pe%value(:) = 0.0_r8
258  coreprof(islice)%profiles1d%pi_tot%value(:) = 0.0_r8
259  coreprof(islice)%profiles1d%pi%value(:,:) = 0.0_r8
260  coreprof(islice)%ni%flux%flux_dv(:,:) = 0.0_r8
261  coreprof(islice)%ne%flux%flux_dv(:) = 0.0_r8
262  coreprof(islice)%ti%flux%flux_dv(:,:) = 0.0_r8
263  coreprof(islice)%te%flux%flux_dv(:) = 0.0_r8
264  coreprof(islice)%vtor%flux%flux_dv(:,:) = 0.0_r8
265  coreprof(islice)%ni%transp_coef%diff(:,:) = 0.0_r8
266  coreprof(islice)%ne%transp_coef%diff(:) = 0.0_r8
267  coreprof(islice)%ti%transp_coef%diff(:,:) = 0.0_r8
268  coreprof(islice)%te%transp_coef%diff(:) = 0.0_r8
269  coreprof(islice)%vtor%transp_coef%diff(:,:) = 0.0_r8
270  coreprof(islice)%ni%transp_coef%vconv(:,:) = 0.0_r8
271  coreprof(islice)%ne%transp_coef%vconv(:) = 0.0_r8
272  coreprof(islice)%ti%transp_coef%vconv(:,:) = 0.0_r8
273  coreprof(islice)%te%transp_coef%vconv(:) = 0.0_r8
274  coreprof(islice)%vtor%transp_coef%vconv(:,:) = 0.0_r8
275  coreprof(islice)%profiles1d%bpol%value(:) = 0.0_r8
276  coreprof(islice)%profiles1d%zeff%value(:) = 0.0_r8
277  coreprof(islice)%profiles1d%qei%value(:) = 0.0_r8
278  coreprof(islice)%profiles1d%shear%value(:) = 0.0_r8
279 
280  coreprof(islice)%psi%jni%value(:) = 0.0_r8
281  coreprof(islice)%ni%source_term%value(:,:) = 0.0_r8
282  coreprof(islice)%ni%source_term%integral(:,:) = 0.0_r8
283  coreprof(islice)%ne%source_term%value(:) = 0.0_r8
284  coreprof(islice)%ne%source_term%integral(:) = 0.0_r8
285  coreprof(islice)%ti%source_term%value(:,:) = 0.0_r8
286  coreprof(islice)%ti%source_term%integral(:,:) = 0.0_r8
287  coreprof(islice)%te%source_term%value(:) = 0.0_r8
288  coreprof(islice)%te%source_term%integral(:) = 0.0_r8
289  coreprof(islice)%vtor%source_term%value(:,:) = 0.0_r8
290  coreprof(islice)%vtor%source_term%integral(:,:) = 0.0_r8
291 
292 
293  END DO
294 
295 
296  CALL deallocate_cpo(compositions)
297 
298 
299  RETURN
300 
301  END SUBROUTINE allocate_coreprof_cpo
302 
303 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
304 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
305 
306 
307 
308 
309 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
315 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
316  SUBROUTINE allocate_coretransp_cpo (NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, CORETRANSP)
317 
318 !-------------------------------------------------------!
319 ! !
320 ! This routine allocates CORETRANSP CPO !
321 ! !
322 !-------------------------------------------------------!
323 ! !
324 ! Source: --- !
325 ! Developers: D.Kalupin !
326 ! Kontacts: D.Kalupin@fz-juelich.de !
327 ! !
328 ! Comments: --- !
329 ! !
330 !-------------------------------------------------------!
331 
332 
333  USE euitm_schemas
334  USE itm_types
335  USE copy_structures
336  USE deallocate_structures
337 
338  IMPLICIT NONE
339 
340  INTEGER :: nslice, islice !number of slices and slice index
341  INTEGER :: nrho !number of radial points (input)
342  INTEGER :: nnucl, inucl !number of nuclei species
343  INTEGER :: nion, iion !number of ion species
344  INTEGER :: nimp, iimp !number of impurity species
345  INTEGER, ALLOCATABLE :: nzimp(:) !number of ionization states for each impurity
346  INTEGER :: izimp
347  INTEGER :: nneut, ineut !number of neutrals species
348  INTEGER, ALLOCATABLE :: ncomp(:) !number of components for each neutral
349  INTEGER :: icomp
350  INTEGER, ALLOCATABLE :: ntype(:) !number of types for each neutral
351  INTEGER :: itype
352 
353  TYPE (type_coretransp), POINTER :: coretransp(:) !CPO with transport coefficients
354  TYPE (type_compositions_type) :: compositions
355 
356  ALLOCATE (coretransp(nslice))
357  CALL allocate_compositions(nslice, nnucl, nion, nimp, nzimp, nneut, ntype, ncomp, compositions)
358 
359 
360 
361  DO islice = 1,nslice
362 
363  CALL deallocate_cpo(coretransp(islice)%compositions)
364  CALL copy_cpo(compositions, coretransp(islice)%compositions)
365 
366 
367  ALLOCATE(coretransp(islice)%values(1))
368 
369 
370 
371 ! +++ Codeparam:
372  ALLOCATE (coretransp(islice)%codeparam%codename(1))
373  ALLOCATE (coretransp(islice)%codeparam%codeversion(1))
374  ALLOCATE (coretransp(islice)%codeparam%output_diag(1))
375 
376 
377 ! +++ Radial coordinate:
378  ALLOCATE (coretransp(islice)%values(1)%rho_tor(nrho))
379  ALLOCATE (coretransp(islice)%values(1)%rho_tor_norm(nrho))
380 
381  coretransp(islice)%VALUES(1)%rho_tor(:) = 0.0_r8
382  coretransp(islice)%VALUES(1)%rho_tor_norm(:) = 0.0_r8
383 
384 
385 
386 
387 ! +++ Profiles of transport coefficients:
388  ALLOCATE (coretransp(islice)%values(1)%sigma(nrho))
389  ALLOCATE (coretransp(islice)%values(1)%ne_transp%diff_eff(nrho,3))
390  ALLOCATE (coretransp(islice)%values(1)%ne_transp%vconv_eff(nrho,3))
391  ALLOCATE (coretransp(islice)%values(1)%ni_transp%diff_eff(nrho,nion,3))
392  ALLOCATE (coretransp(islice)%values(1)%ni_transp%vconv_eff(nrho,nion,3))
393  ALLOCATE (coretransp(islice)%values(1)%ti_transp%diff_eff(nrho,nion))
394  ALLOCATE (coretransp(islice)%values(1)%ti_transp%vconv_eff(nrho,nion))
395  ALLOCATE (coretransp(islice)%values(1)%te_transp%diff_eff(nrho))
396  ALLOCATE (coretransp(islice)%values(1)%te_transp%vconv_eff(nrho))
397  ALLOCATE (coretransp(islice)%values(1)%vtor_transp%diff_eff(nrho,nion))
398  ALLOCATE (coretransp(islice)%values(1)%vtor_transp%vconv_eff(nrho,nion))
399 
400 
401  coretransp(islice)%codeparam%codename = '-999999999'
402  coretransp(islice)%codeparam%codeversion = '-999999999'
403  coretransp(islice)%codeparam%output_diag = '-999999999'
404  coretransp(islice)%codeparam%output_flag = -999999999
405 
406  coretransp(islice)%VALUES(1)%sigma(:) = 0.0_r8
407  coretransp(islice)%VALUES(1)%ne_transp%diff_eff(:,:) = 0.0_r8
408  coretransp(islice)%VALUES(1)%ne_transp%vconv_eff(:,:) = 0.0_r8
409  coretransp(islice)%VALUES(1)%ni_transp%diff_eff(:,:,:) = 0.0_r8
410  coretransp(islice)%VALUES(1)%ni_transp%vconv_eff(:,:,:) = 0.0_r8
411  coretransp(islice)%VALUES(1)%ti_transp%diff_eff(:,:) = 0.0_r8
412  coretransp(islice)%VALUES(1)%ti_transp%vconv_eff(:,:) = 0.0_r8
413  coretransp(islice)%VALUES(1)%te_transp%diff_eff(:) = 0.0_r8
414  coretransp(islice)%VALUES(1)%te_transp%vconv_eff(:) = 0.0_r8
415  coretransp(islice)%VALUES(1)%vtor_transp%diff_eff(:,:) = 0.0_r8
416  coretransp(islice)%VALUES(1)%vtor_transp%vconv_eff(:,:) = 0.0_r8
417 
418  IF(nimp.GE.1) THEN
419  ALLOCATE (coretransp(islice)%values(1)%nz_transp(nimp))
420  ALLOCATE (coretransp(islice)%values(1)%tz_transp(nimp))
421 
422  DO iimp=1, nimp
423  ALLOCATE (coretransp(islice)%values(1)%nz_transp(iimp)%diff_eff(nrho,nzimp(iimp)))
424  ALLOCATE (coretransp(islice)%values(1)%nz_transp(iimp)%vconv_eff(nrho,nzimp(iimp)))
425  ALLOCATE (coretransp(islice)%values(1)%tz_transp(iimp)%diff_eff(nrho,nzimp(iimp)))
426  ALLOCATE (coretransp(islice)%values(1)%tz_transp(iimp)%vconv_eff(nrho,nzimp(iimp)))
427 
428 
429  coretransp(islice)%values(1)%nz_transp(iimp)%diff_eff(:,:) = 0.0_r8
430  coretransp(islice)%values(1)%nz_transp(iimp)%vconv_eff(:,:) = 0.0_r8
431  coretransp(islice)%values(1)%tz_transp(iimp)%diff_eff(:,:) = 0.0_r8
432  coretransp(islice)%values(1)%tz_transp(iimp)%vconv_eff(:,:) = 0.0_r8
433  ENDDO
434  ENDIF
435 
436  END DO
437 
438 
439  CALL deallocate_cpo(compositions)
440 
441 
442  RETURN
443 
444  END SUBROUTINE allocate_coretransp_cpo
445 
446 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
447 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
448 
449 
450 
451 
452 
453 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
459 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
460  SUBROUTINE allocate_coresource_cpo (NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, CORESOURCE)
461 
462 !-------------------------------------------------------!
463 ! !
464 ! This routine allocates CORESOURCE CPO !
465 ! !
466 !-------------------------------------------------------!
467 ! !
468 ! Source: --- !
469 ! Developers: D.Kalupin !
470 ! Kontacts: D.Kalupin@fz-juelich.de !
471 ! !
472 ! Comments: --- !
473 ! !
474 !-------------------------------------------------------!
475 
476 
477  USE euitm_schemas
478  USE itm_types
479  USE copy_structures
480  USE deallocate_structures
481 
482  IMPLICIT NONE
483 
484  INTEGER :: nslice, islice !number of slices and slice index
485  INTEGER :: nrho !number of radial points (input)
486  INTEGER :: nnucl, inucl !number of nuclei species
487  INTEGER :: nion, iion !number of ion species
488  INTEGER :: nimp, iimp !number of impurity species
489  INTEGER, ALLOCATABLE :: nzimp(:) !number of ionization states for each impurity
490  INTEGER :: izimp
491  INTEGER :: nneut, ineut !number of neutrals species
492  INTEGER, ALLOCATABLE :: ncomp(:) !number of components for each neutral
493  INTEGER :: icomp
494  INTEGER, ALLOCATABLE :: ntype(:) !number of types for each neutral
495  INTEGER :: itype
496 
497  TYPE (type_coresource), POINTER :: coresource(:) !CPO with sources
498  TYPE (type_compositions_type) :: compositions
499 
500 
501 
502  ALLOCATE (coresource(nslice))
503  CALL allocate_compositions(nslice, nnucl, nion, nimp, nzimp, nneut, ntype, ncomp, compositions)
504 
505 
506  DO islice = 1,nslice
507 
508  CALL deallocate_cpo(coresource(islice)%compositions)
509  CALL copy_cpo(compositions, coresource(islice)%compositions)
510 
511 
512  ALLOCATE(coresource(islice)%values(1))
513 
514 ! +++ Codeparam:
515  ALLOCATE (coresource(islice)%codeparam%codename(1))
516  ALLOCATE (coresource(islice)%codeparam%codeversion(1))
517  ALLOCATE (coresource(islice)%codeparam%output_diag(1))
518 
519 
520 ! +++ Radial coordinate:
521  ALLOCATE (coresource(islice)%VALUES(1)%rho_tor(nrho))
522  ALLOCATE (coresource(islice)%VALUES(1)%rho_tor_norm(nrho))
523 
524  coresource(islice)%VALUES(1)%rho_tor(:) = 0.0_r8
525  coresource(islice)%VALUES(1)%rho_tor_norm(:) = 0.0_r8
526 
527 
528 ! +++ Profiles of sources:
529  ALLOCATE (coresource(islice)%VALUES(1)%sigma(nrho))
530  ALLOCATE (coresource(islice)%VALUES(1)%j(nrho))
531  ALLOCATE (coresource(islice)%VALUES(1)%se%exp(nrho))
532  ALLOCATE (coresource(islice)%VALUES(1)%se%imp(nrho))
533  ALLOCATE (coresource(islice)%VALUES(1)%qe%exp(nrho))
534  ALLOCATE (coresource(islice)%VALUES(1)%qe%imp(nrho))
535  ALLOCATE (coresource(islice)%VALUES(1)%si%exp(nrho,nion))
536  ALLOCATE (coresource(islice)%VALUES(1)%si%imp(nrho,nion))
537  ALLOCATE (coresource(islice)%VALUES(1)%qi%exp(nrho,nion))
538  ALLOCATE (coresource(islice)%VALUES(1)%qi%imp(nrho,nion))
539  ALLOCATE (coresource(islice)%VALUES(1)%ui%exp(nrho,nion))
540  ALLOCATE (coresource(islice)%VALUES(1)%ui%imp(nrho,nion))
541 
542 
543  coresource(islice)%codeparam%codename = '-999999999'
544  coresource(islice)%codeparam%codeversion = '-999999999'
545  coresource(islice)%codeparam%output_diag = '-999999999'
546  coresource(islice)%codeparam%output_flag = -999999999
547 
548  coresource(islice)%VALUES(1)%sigma(:) = 0.0_r8
549  coresource(islice)%VALUES(1)%j(:) = 0.0_r8
550  coresource(islice)%VALUES(1)%se%exp(:) = 0.0_r8
551  coresource(islice)%VALUES(1)%se%imp(:) = 0.0_r8
552  coresource(islice)%VALUES(1)%qe%exp(:) = 0.0_r8
553  coresource(islice)%VALUES(1)%qe%imp(:) = 0.0_r8
554  coresource(islice)%VALUES(1)%si%exp(:,:) = 0.0_r8
555  coresource(islice)%VALUES(1)%si%imp(:,:) = 0.0_r8
556  coresource(islice)%VALUES(1)%qi%exp(:,:) = 0.0_r8
557  coresource(islice)%VALUES(1)%qi%imp(:,:) = 0.0_r8
558  coresource(islice)%VALUES(1)%ui%exp(:,:) = 0.0_r8
559  coresource(islice)%VALUES(1)%ui%imp(:,:) = 0.0_r8
560 
561 
562  IF(nimp.GE.1) THEN
563  ALLOCATE (coresource(islice)%VALUES(1)%sz(nimp))
564  ALLOCATE (coresource(islice)%VALUES(1)%qz(nimp))
565 
566  DO iimp=1, nimp
567  ALLOCATE (coresource(islice)%VALUES(1)%sz(iimp)%exp(nrho,nzimp(iimp)))
568  ALLOCATE (coresource(islice)%VALUES(1)%sz(iimp)%imp(nrho,nzimp(iimp)))
569  ALLOCATE (coresource(islice)%VALUES(1)%qz(iimp)%exp(nrho,nzimp(iimp)))
570  ALLOCATE (coresource(islice)%VALUES(1)%qz(iimp)%imp(nrho,nzimp(iimp)))
571 
572 
573  coresource(islice)%VALUES(1)%sz(iimp)%exp(:,:) = 0.0_r8
574  coresource(islice)%VALUES(1)%sz(iimp)%imp(:,:) = 0.0_r8
575  coresource(islice)%VALUES(1)%qz(iimp)%exp(:,:) = 0.0_r8
576  coresource(islice)%VALUES(1)%qz(iimp)%imp(:,:) = 0.0_r8
577  ENDDO
578 
579  ENDIF
580 
581  END DO
582 
583 
584  CALL deallocate_cpo(compositions)
585 
586 
587  RETURN
588 
589  END SUBROUTINE allocate_coresource_cpo
590 
591 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
592 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
593 
594 
595 
596 
597 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
603 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
604 
605 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
606 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
607 
608  SUBROUTINE allocate_coreimpur_cpo (NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COREIMPUR)
609 
610 !-------------------------------------------------------!
611 ! !
612 ! This routine allocates COREIMPUR CPO !
613 ! !
614 !-------------------------------------------------------!
615 ! !
616 ! Source: --- !
617 ! Developers: I.Ivanova-Stanik !
618 ! Kontacts: irena@ifpilm.waw.pl !
619 ! !
620 ! Comments: --- !
621 ! !
622 !-------------------------------------------------------!
623 
624 
625  USE euitm_schemas
626  USE itm_types
627  USE copy_structures
628  USE deallocate_structures
629 
630  IMPLICIT NONE
631 
632  INTEGER :: nslice, islice !number of slices and slice index
633  INTEGER :: nrho !number of radial points (input)
634  INTEGER :: nnucl, inucl !number of nuclei species
635  INTEGER :: nion, iion !number of ion species
636  INTEGER :: nimp, iimp !number of impurity species
637  INTEGER, ALLOCATABLE :: nzimp(:) !number of ionization states for each impurity
638  INTEGER :: izimp
639  INTEGER :: nneut, ineut !number of neutrals species
640  INTEGER, ALLOCATABLE :: ncomp(:) !number of components for each neutral
641  INTEGER :: icomp
642  INTEGER, ALLOCATABLE :: ntype(:) !number of types for each neutral
643  INTEGER :: itype
644 
645  TYPE (type_coreimpur), POINTER :: coreimpur(:) !CPO with impurities
646  TYPE (type_compositions_type) :: compositions
647 
648 
649 
650  ALLOCATE (coreimpur(nslice))
651  CALL allocate_compositions(nslice, nnucl, nion, nimp, nzimp, nneut, ntype, ncomp, compositions)
652 
653 
654 
655  DO islice = 1,nslice
656 
657  CALL deallocate_cpo(coreimpur(islice)%compositions)
658  CALL copy_cpo(compositions, coreimpur(islice)%compositions)
659 
660 
661  ALLOCATE (coreimpur(islice)%codeparam%codename(1))
662  ALLOCATE (coreimpur(islice)%codeparam%codeversion(1))
663  ALLOCATE (coreimpur(islice)%codeparam%output_diag(1))
664 
665  coreimpur(islice)%codeparam%codename = '-999999999'
666  coreimpur(islice)%codeparam%codeversion = '-999999999'
667  coreimpur(islice)%codeparam%output_diag = '-999999999'
668  coreimpur(islice)%codeparam%output_flag = -999999999
669 
670 
671  ALLOCATE (coreimpur(islice)%rho_tor(nrho))
672  ALLOCATE (coreimpur(islice)%rho_tor_norm(nrho))
673 
674  coreimpur(islice)%rho_tor(:) = 0.0_r8
675  coreimpur(islice)%rho_tor_norm(:) = 0.0_r8
676 
677  END DO
678 
679  IF(nimp.EQ.0) RETURN
680 
681  DO islice = 1,nslice
682 
683  ALLOCATE (coreimpur(islice)%impurity(nimp))
684 
685  DO iimp = 1, nimp
686 
687  ALLOCATE (coreimpur(islice)%impurity(iimp)%z(nrho,nzimp(iimp)))
688  ALLOCATE (coreimpur(islice)%impurity(iimp)%zsq(nrho,nzimp(iimp)))
689  ALLOCATE (coreimpur(islice)%impurity(iimp)%nz(nrho,nzimp(iimp)))
690  ALLOCATE (coreimpur(islice)%impurity(iimp)%tz(nrho,nzimp(iimp)))
691  ALLOCATE (coreimpur(islice)%impurity(iimp)%boundary%value(3,nzimp(iimp)))
692  ALLOCATE (coreimpur(islice)%impurity(iimp)%boundary%type(nzimp(iimp)))
693  ALLOCATE (coreimpur(islice)%impurity(iimp)%boundary%rho(nzimp(iimp)))
694  ALLOCATE (coreimpur(islice)%impurity(iimp)%transp_coef%diff(nrho,nzimp(iimp)))
695  ALLOCATE (coreimpur(islice)%impurity(iimp)%transp_coef%vconv(nrho,nzimp(iimp)))
696  ALLOCATE (coreimpur(islice)%impurity(iimp)%source_term%value(nrho,nzimp(iimp)))
697  ALLOCATE (coreimpur(islice)%impurity(iimp)%flux%flux_dv(nrho,nzimp(iimp)))
698  ALLOCATE (coreimpur(islice)%impurity(iimp)%flux%flux_interp(nrho,nzimp(iimp)))
699 
700 
701  coreimpur(islice)%impurity(iimp)%z(:,:) = 0.0_r8
702  coreimpur(islice)%impurity(iimp)%zsq(:,:) = 0.0_r8
703  coreimpur(islice)%impurity(iimp)%nz(:,:) = 0.0_r8
704  coreimpur(islice)%impurity(iimp)%tz(:,:) = 0.0_r8
705  coreimpur(islice)%impurity(iimp)%boundary%value(:,:) = 0.0_r8
706  coreimpur(islice)%impurity(iimp)%boundary%type(:) = 0
707  coreimpur(islice)%impurity(iimp)%boundary%rho(:) = 0.0_r8
708  coreimpur(islice)%impurity(iimp)%transp_coef%diff(:,:) = 0.0_r8
709  coreimpur(islice)%impurity(iimp)%transp_coef%vconv(:,:)= 0.0_r8
710  coreimpur(islice)%impurity(iimp)%source_term%value(:,:)= 0.0_r8
711  coreimpur(islice)%impurity(iimp)%flux%flux_dv(:,:) = 0.0_r8
712  coreimpur(islice)%impurity(iimp)%flux%flux_interp(:,:) = 0.0_r8
713 
714 
715  ALLOCATE (coreimpur(islice)%impurity(iimp)%diagnostic%radiation%line_rad%profile(nrho,nzimp(iimp)))
716  ALLOCATE (coreimpur(islice)%impurity(iimp)%diagnostic%radiation%line_rad%integral(nrho,nzimp(iimp)))
717  ALLOCATE (coreimpur(islice)%impurity(iimp)%diagnostic%radiation%brem_radrec%profile(nrho,nzimp(iimp)))
718  ALLOCATE (coreimpur(islice)%impurity(iimp)%diagnostic%radiation%brem_radrec%integral(nrho,nzimp(iimp)))
719  ALLOCATE (coreimpur(islice)%impurity(iimp)%diagnostic%radiation%sum%profile(nrho,nzimp(iimp)))
720  ALLOCATE (coreimpur(islice)%impurity(iimp)%diagnostic%radiation%sum%integral(nrho,nzimp(iimp)))
721 
722 
723  coreimpur(islice)%impurity(iimp)%diagnostic%radiation%line_rad%profile(:,:) = 0.0_r8
724  coreimpur(islice)%impurity(iimp)%diagnostic%radiation%line_rad%integral(:,:) = 0.0_r8
725  coreimpur(islice)%impurity(iimp)%diagnostic%radiation%brem_radrec%profile(:,:) = 0.0_r8
726  coreimpur(islice)%impurity(iimp)%diagnostic%radiation%brem_radrec%integral(:,:) = 0.0_r8
727  coreimpur(islice)%impurity(iimp)%diagnostic%radiation%sum%profile(:,:) = 0.0_r8
728  coreimpur(islice)%impurity(iimp)%diagnostic%radiation%sum%integral(:,:) = 0.0_r8
729 
730 
731  ALLOCATE (coreimpur(islice)%impurity(iimp)%diagnostic%energy%ionization%profile(nrho,nzimp(iimp)))
732  ALLOCATE (coreimpur(islice)%impurity(iimp)%diagnostic%energy%ionization%integral(nrho,nzimp(iimp)))
733  ALLOCATE (coreimpur(islice)%impurity(iimp)%diagnostic%energy%recombin%profile(nrho,nzimp(iimp)))
734  ALLOCATE (coreimpur(islice)%impurity(iimp)%diagnostic%energy%recombin%integral(nrho,nzimp(iimp)))
735  ALLOCATE (coreimpur(islice)%impurity(iimp)%diagnostic%energy%sum%profile(nrho,nzimp(iimp)))
736  ALLOCATE (coreimpur(islice)%impurity(iimp)%diagnostic%energy%sum%integral(nrho,nzimp(iimp)))
737 
738 
739  coreimpur(islice)%impurity(iimp)%diagnostic%energy%ionization%profile(:,:) = 0.0_r8
740  coreimpur(islice)%impurity(iimp)%diagnostic%energy%ionization%integral(:,:) = 0.0_r8
741  coreimpur(islice)%impurity(iimp)%diagnostic%energy%recombin%profile(:,:) = 0.0_r8
742  coreimpur(islice)%impurity(iimp)%diagnostic%energy%recombin%integral(:,:) = 0.0_r8
743  coreimpur(islice)%impurity(iimp)%diagnostic%energy%sum%profile(:,:) = 0.0_r8
744  coreimpur(islice)%impurity(iimp)%diagnostic%energy%sum%integral(:,:) = 0.0_r8
745 
746  ENDDO
747 
748  ALLOCATE (coreimpur(islice)%diagnostic%radiation%line_rad%profile(nrho,nimp))
749  ALLOCATE (coreimpur(islice)%diagnostic%radiation%line_rad%integral(nrho,nimp))
750  ALLOCATE (coreimpur(islice)%diagnostic%radiation%brem_radrec%profile(nrho,nimp))
751  ALLOCATE (coreimpur(islice)%diagnostic%radiation%brem_radrec%integral(nrho,nimp))
752  ALLOCATE (coreimpur(islice)%diagnostic%radiation%sum%profile(nrho,nimp))
753  ALLOCATE (coreimpur(islice)%diagnostic%radiation%sum%integral(nrho,nimp))
754 
755 
756  coreimpur(islice)%diagnostic%radiation%line_rad%profile(:,:) = 0.0_r8
757  coreimpur(islice)%diagnostic%radiation%line_rad%integral(:,:) = 0.0_r8
758  coreimpur(islice)%diagnostic%radiation%brem_radrec%profile(:,:) = 0.0_r8
759  coreimpur(islice)%diagnostic%radiation%brem_radrec%integral(:,:) = 0.0_r8
760  coreimpur(islice)%diagnostic%radiation%sum%profile(:,:) = 0.0_r8
761  coreimpur(islice)%diagnostic%radiation%sum%integral(:,:) = 0.0_r8
762 
763 
764  ALLOCATE (coreimpur(islice)%diagnostic%energy%ionization%profile(nrho,nimp))
765  ALLOCATE (coreimpur(islice)%diagnostic%energy%ionization%integral(nrho,nimp))
766  ALLOCATE (coreimpur(islice)%diagnostic%energy%recombin%profile(nrho,nimp))
767  ALLOCATE (coreimpur(islice)%diagnostic%energy%recombin%integral(nrho,nimp))
768  ALLOCATE (coreimpur(islice)%diagnostic%energy%sum%profile(nrho,nimp))
769  ALLOCATE (coreimpur(islice)%diagnostic%energy%sum%integral(nrho,nimp))
770 
771 
772  coreimpur(islice)%diagnostic%energy%ionization%profile(:,:) = 0.0_r8
773  coreimpur(islice)%diagnostic%energy%ionization%integral(:,:) = 0.0_r8
774  coreimpur(islice)%diagnostic%energy%recombin%profile(:,:) = 0.0_r8
775  coreimpur(islice)%diagnostic%energy%recombin%integral(:,:) = 0.0_r8
776  coreimpur(islice)%diagnostic%energy%sum%profile(:,:) = 0.0_r8
777  coreimpur(islice)%diagnostic%energy%sum%integral(:,:) = 0.0_r8
778 
779 
780  ALLOCATE (coreimpur(islice)%diagnosticsum%radiation%line_rad%profile(nrho))
781  ALLOCATE (coreimpur(islice)%diagnosticsum%radiation%line_rad%integral(nrho))
782  ALLOCATE (coreimpur(islice)%diagnosticsum%radiation%brem_radrec%profile(nrho))
783  ALLOCATE (coreimpur(islice)%diagnosticsum%radiation%brem_radrec%integral(nrho))
784  ALLOCATE (coreimpur(islice)%diagnosticsum%radiation%sum%profile(nrho))
785  ALLOCATE (coreimpur(islice)%diagnosticsum%radiation%sum%integral(nrho))
786 
787 
788  coreimpur(islice)%diagnosticsum%radiation%line_rad%profile(:) = 0.0_r8
789  coreimpur(islice)%diagnosticsum%radiation%line_rad%integral(:) = 0.0_r8
790  coreimpur(islice)%diagnosticsum%radiation%brem_radrec%profile(:) = 0.0_r8
791  coreimpur(islice)%diagnosticsum%radiation%brem_radrec%integral(:) = 0.0_r8
792  coreimpur(islice)%diagnosticsum%radiation%sum%profile(:) = 0.0_r8
793  coreimpur(islice)%diagnosticsum%radiation%sum%integral(:) = 0.0_r8
794 
795 
796  ALLOCATE (coreimpur(islice)%diagnosticsum%energy%ionization%profile(nrho))
797  ALLOCATE (coreimpur(islice)%diagnosticsum%energy%ionization%integral(nrho))
798  ALLOCATE (coreimpur(islice)%diagnosticsum%energy%recombin%profile(nrho))
799  ALLOCATE (coreimpur(islice)%diagnosticsum%energy%recombin%integral(nrho))
800  ALLOCATE (coreimpur(islice)%diagnosticsum%energy%sum%profile(nrho))
801  ALLOCATE (coreimpur(islice)%diagnosticsum%energy%sum%integral(nrho))
802 
803 
804  coreimpur(islice)%diagnosticsum%energy%ionization%profile(:) = 0.0_r8
805  coreimpur(islice)%diagnosticsum%energy%ionization%integral(:) = 0.0_r8
806  coreimpur(islice)%diagnosticsum%energy%recombin%profile(:) = 0.0_r8
807  coreimpur(islice)%diagnosticsum%energy%recombin%integral(:) = 0.0_r8
808  coreimpur(islice)%diagnosticsum%energy%sum%profile(:) = 0.0_r8
809  coreimpur(islice)%diagnosticsum%energy%sum%integral(:) = 0.0_r8
810 
811 
812 
813 
814  END DO
815 
816 
817  CALL deallocate_cpo(compositions)
818 
819 
820  RETURN
821 
822  END SUBROUTINE allocate_coreimpur_cpo
823 
824 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
825 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
826 
827 
828 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
834 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
835  SUBROUTINE allocate_corefast_cpo (NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COREFAST)
836 
837 !-------------------------------------------------------!
838 ! !
839 ! This routine allocates COREFAST_CPO !
840 ! !
841 !-------------------------------------------------------!
842 ! !
843 ! Source: --- !
844 ! Developers: D.Kalupin !
845 ! Kontacts: D.Kalupin@fz-juelich.de !
846 ! !
847 ! Comments: --- !
848 ! !
849 !-------------------------------------------------------!
850 
851 
852  USE euitm_schemas
853  USE itm_types
854  USE copy_structures
855  USE deallocate_structures
856 
857  IMPLICIT NONE
858 
859  INTEGER :: nslice, islice !number of slices and slice index
860  INTEGER :: nrho !number of radial points (input)
861  INTEGER :: nnucl, inucl !number of nuclei species
862  INTEGER :: nion, iion !number of ion species
863  INTEGER :: nimp, iimp !number of impurity species
864  INTEGER, ALLOCATABLE :: nzimp(:) !number of ionization states for each impurity
865  INTEGER :: izimp
866  INTEGER :: nneut, ineut !number of neutrals species
867  INTEGER, ALLOCATABLE :: ncomp(:) !number of components for each neutral
868  INTEGER :: icomp
869  INTEGER, ALLOCATABLE :: ntype(:) !number of types for each neutral
870  INTEGER :: itype
871 
872  TYPE (type_corefast), POINTER :: corefast(:) !CPO with internal ETS parameters profiles
873  TYPE (type_compositions_type) :: compositions
874 
875 ! write(*,*) '*** ALLOCATE_COREFAST_CPO CALLED ***'
876 
877  ALLOCATE (corefast(nslice))
878  CALL allocate_compositions(nslice, nnucl, nion, nimp, nzimp, nneut, ntype, ncomp, compositions)
879 
880 
881  DO islice = 1,nslice
882 
883  CALL deallocate_cpo(corefast(islice)%compositions)
884  CALL copy_cpo(compositions, corefast(islice)%compositions)
885 
886  ALLOCATE(corefast(islice)%values(1))
887 
888 ! +++ Codeparam:
889  ALLOCATE (corefast(islice)%codeparam%codename(1))
890  ALLOCATE (corefast(islice)%codeparam%codeversion(1))
891  ALLOCATE (corefast(islice)%codeparam%output_diag(1))
892 
893 
894 ! +++ Radial coordinate:
895  ALLOCATE (corefast(islice)%values(1)%rho_tor(nrho))
896  ALLOCATE (corefast(islice)%values(1)%rho_tor_norm(nrho))
897 
898 
899 ! +++ Radial profiles:
900  ALLOCATE (corefast(islice)%values(1)%psi(nrho))
901  ALLOCATE (corefast(islice)%values(1)%volume(nrho))
902  ALLOCATE (corefast(islice)%values(1)%area(nrho))
903  ALLOCATE (corefast(islice)%values(1)%j(nrho))
904  ALLOCATE (corefast(islice)%values(1)%sigma(nrho))
905  ALLOCATE (corefast(islice)%values(1)%ni(nrho,nion))
906  ALLOCATE (corefast(islice)%values(1)%ne(nrho))
907  if (nimp.gt.0) &
908  ALLOCATE (corefast(islice)%values(1)%nz(nrho,nimp))
909  ALLOCATE (corefast(islice)%values(1)%pi(nrho,nion))
910  ALLOCATE (corefast(islice)%values(1)%pe(nrho))
911  if (nimp.gt.0) &
912  ALLOCATE (corefast(islice)%values(1)%pz(nrho,nimp))
913  ALLOCATE (corefast(islice)%values(1)%pi_para(nrho,nion))
914  ALLOCATE (corefast(islice)%values(1)%pe_para(nrho))
915  if (nimp.gt.0) &
916  ALLOCATE (corefast(islice)%values(1)%pz_para(nrho,nimp))
917  ALLOCATE (corefast(islice)%values(1)%ui(nrho,nion))
918  if (nimp.gt.0) &
919  ALLOCATE (corefast(islice)%values(1)%uz(nrho,nimp))
920 
921 ! +++ Zero out arrays
922  corefast(islice)%codeparam%codename = '-999999999'
923  corefast(islice)%codeparam%codeversion = '-999999999'
924  corefast(islice)%codeparam%output_diag = '-999999999'
925  corefast(islice)%codeparam%output_flag = -999999999
926 
927  corefast(islice)%values(1)%rho_tor(:) = 0.0_r8
928  corefast(islice)%values(1)%rho_tor_norm(:) = 0.0_r8
929 
930  corefast(islice)%values(1)%psi(:) = 0.0_r8
931  corefast(islice)%values(1)%volume(:) = 0.0_r8
932 
933  corefast(islice)%values(1)%area(:) = 0.0_r8
934  corefast(islice)%values(1)%j(:) = 0.0_r8
935  corefast(islice)%values(1)%sigma(:) = 0.0_r8
936  corefast(islice)%values(1)%ni(:,:) = 0.0_r8
937  corefast(islice)%values(1)%ne(:) = 0.0_r8
938  if (nimp.gt.0) &
939  corefast(islice)%values(1)%nz(:,:) = 0.0_r8
940  corefast(islice)%values(1)%pi(:,:) = 0.0_r8
941  corefast(islice)%values(1)%pe(:) = 0.0_r8
942  if (nimp.gt.0) &
943  corefast(islice)%values(1)%pz(:,:) = 0.0_r8
944  corefast(islice)%values(1)%pi_para(:,:) = 0.0_r8
945  corefast(islice)%values(1)%pe_para(:) = 0.0_r8
946  if (nimp.gt.0) &
947  corefast(islice)%values(1)%pz_para(:,:) = 0.0_r8
948  corefast(islice)%values(1)%ui(:,:) = 0.0_r8
949  if (nimp.gt.0) &
950  corefast(islice)%values(1)%uz(:,:) = 0.0_r8
951 
952  END DO
953 
954 
955  CALL deallocate_cpo(compositions)
956 
957 
958  RETURN
959 
960  END SUBROUTINE allocate_corefast_cpo
961 
962 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
963 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
964 
965 
966 
967 
968 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
969 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
970 
971  SUBROUTINE allocate_coreneutrals_cpo (NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, CORENEUTRALS)
972 !-------------------------------------------------------!
973 ! !
974 ! This routine allocates CORENEUTRALS CPO !
975 ! !
976 !-------------------------------------------------------!
977 ! !
978 ! Source: --- !
979 ! Developers: I.Ivanova-Stanik,R.Stankiewicz !
980 ! D.Kalupin !
981 ! Kontacts: irena@ifpilm.waw.pl !
982 ! romsta@ifpilm.waw.pl !
983 ! denis.kalupin@efda.org !
984 ! !
985 ! Comments: --- !
986 ! !
987 !-------------------------------------------------------!
988 
989 
990  USE euitm_schemas
991  USE itm_types
992  USE copy_structures
993  USE deallocate_structures
994 
995  IMPLICIT NONE
996 
997  INTEGER :: nslice, islice !number of slices and slice index
998  INTEGER :: nrho !number of radial points (input)
999  INTEGER :: nnucl, inucl !number of nuclei species
1000  INTEGER :: nion, iion !number of ion species
1001  INTEGER :: nimp, iimp !number of impurity species
1002  INTEGER, ALLOCATABLE :: nzimp(:) !number of ionization states for each impurity
1003  INTEGER :: izimp
1004  INTEGER :: nneut, ineut !number of neutrals species
1005  INTEGER, ALLOCATABLE :: ncomp(:) !number of components for each neutral
1006  INTEGER :: icomp
1007  INTEGER, ALLOCATABLE :: ntype(:) !number of types for each neutral
1008  INTEGER :: itype
1009 
1010  TYPE (type_coreneutrals), POINTER :: coreneutrals(:) !CPO with impurities
1011  TYPE (type_compositions_type) :: compositions
1012 
1013 
1014 
1015 
1016 
1017  ALLOCATE (coreneutrals(nslice))
1018  CALL allocate_compositions(nslice, nnucl, nion, nimp, nzimp, nneut, ntype, ncomp, compositions)
1019 
1020 
1021 
1022 
1023  DO islice = 1,nslice
1024 
1025  CALL deallocate_cpo(coreneutrals(islice)%compositions)
1026  CALL copy_cpo(compositions, coreneutrals(islice)%compositions)
1027 
1028  ALLOCATE (coreneutrals(islice)%codeparam%codename(1))
1029  ALLOCATE (coreneutrals(islice)%codeparam%codeversion(1))
1030  ALLOCATE (coreneutrals(islice)%codeparam%output_diag(1))
1031 
1032  coreneutrals(islice)%codeparam%codename = '-999999999'
1033  coreneutrals(islice)%codeparam%codeversion = '-999999999'
1034  coreneutrals(islice)%codeparam%output_diag = '-999999999'
1035  coreneutrals(islice)%codeparam%output_flag = -999999999
1036 
1037 
1038  ALLOCATE (coreneutrals(islice)%rho_tor(nrho))
1039  ALLOCATE (coreneutrals(islice)%rho_tor_norm(nrho))
1040 
1041  coreneutrals(islice)%rho_tor(:) = 0.0_r8
1042  coreneutrals(islice)%rho_tor_norm(:) = 0.0_r8
1043 
1044  END DO
1045 
1046 
1047  IF(nneut.LE.0) RETURN
1048 
1049  DO islice = 1,nslice
1050 
1051  IF(nneut.GT.0) THEN
1052  ALLOCATE (coreneutrals(islice)%profiles(nneut))
1053  DO ineut = 1, nneut
1054  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(ntype(ineut)))
1055  ALLOCATE (coreneutrals(islice)%profiles(ineut)%prad0(nrho))
1056 
1057  coreneutrals(islice)%profiles(ineut)%prad0 = 0.0_r8
1058 
1059 
1060  DO itype = 1, ntype(ineut)
1061  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%n0%value(nrho))
1062  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%n0%flux(nrho))
1063  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%n0%boundary%value(3))
1064  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%t0%value(nrho))
1065  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%t0%flux(nrho))
1066  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%t0%boundary%value(3))
1067  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%toroidal%value(nrho))
1068  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%toroidal%boundary%value(3))
1069  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%poloidal%value(nrho))
1070  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%poloidal%boundary%value(3))
1071  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%radial%value(nrho))
1072  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%radial%boundary%value(3))
1073 
1074 
1075  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%n0%value(:) = 0.0_r8
1076  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%n0%flux(:) = 0.0_r8
1077  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%n0%boundary%value(:) = 0.0_r8
1078  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%n0%boundary%type = 0
1079  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%n0%boundary%rho_tor = 0.0_r8
1080  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%t0%value(:) = 0.0_r8
1081  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%t0%flux(:) = 0.0_r8
1082  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%t0%boundary%value(:) = 0.0_r8
1083  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%t0%boundary%type = 0
1084  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%t0%boundary%rho_tor = 0.0_r8
1085  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%toroidal%value(:) = 0.0_r8
1086  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%toroidal%boundary%value(:) = 0.0_r8
1087  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%toroidal%boundary%type = 0
1088  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%toroidal%boundary%rho_tor = 0.0_r8
1089  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%poloidal%value(:) = 0.0_r8
1090  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%poloidal%boundary%value(:) = 0.0_r8
1091  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%poloidal%boundary%type = 0
1092  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%poloidal%boundary%rho_tor = 0.0_r8
1093  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%radial%value(:) = 0.0_r8
1094  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%radial%boundary%value(:) = 0.0_r8
1095  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%radial%boundary%type = 0
1096  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%radial%boundary%rho_tor = 0.0_r8
1097  ENDDO
1098  ENDDO
1099  ENDIF
1100  END DO
1101 
1102  CALL deallocate_cpo(compositions)
1103 
1104  RETURN
1105 
1106  END SUBROUTINE allocate_coreneutrals_cpo
1107 
1108 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1109 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1110 
1111 
1112 
1113 
1114 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1120 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1121  SUBROUTINE allocate_coredelta_cpo (NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COREDELTA)
1122 
1123 !-------------------------------------------------------!
1124 ! !
1125 ! This routine allocates COREDELTA CPO !
1126 ! !
1127 !-------------------------------------------------------!
1128 ! !
1129 ! Source: --- !
1130 ! Developers: D.Kalupin !
1131 ! Kontacts: D.Kalupin@fz-juelich.de !
1132 ! !
1133 ! Comments: --- !
1134 ! !
1135 !-------------------------------------------------------!
1136 
1137 
1138  USE euitm_schemas
1139  USE itm_types
1140  USE copy_structures
1141  USE deallocate_structures
1142 
1143  IMPLICIT NONE
1144 
1145  INTEGER :: nslice, islice !number of slices and slice index
1146  INTEGER :: nrho !number of radial points (input)
1147  INTEGER :: nnucl, inucl !number of nuclei species
1148  INTEGER :: nion, iion !number of ion species
1149  INTEGER :: nimp, iimp !number of impurity species
1150  INTEGER, ALLOCATABLE :: nzimp(:) !number of ionization states for each impurity
1151  INTEGER :: izimp
1152  INTEGER :: nneut, ineut !number of neutrals species
1153  INTEGER, ALLOCATABLE :: ncomp(:) !number of components for each neutral
1154  INTEGER :: icomp
1155  INTEGER, ALLOCATABLE :: ntype(:) !number of types for each neutral
1156  INTEGER :: itype
1157 
1158  TYPE (type_coredelta), POINTER :: coredelta(:) !CPO with deltas
1159  TYPE (type_compositions_type) :: compositions
1160 
1161 
1162 
1163  ALLOCATE (coredelta(nslice))
1164  CALL allocate_compositions(nslice, nnucl, nion, nimp, nzimp, nneut, ntype, ncomp, compositions)
1165 
1166 
1167  DO islice = 1,nslice
1168 
1169  CALL deallocate_cpo(coredelta(islice)%compositions)
1170  CALL copy_cpo(compositions, coredelta(islice)%compositions)
1171 
1172 
1173  ALLOCATE(coredelta(islice)%VALUES(1))
1174 
1175 ! +++ Codeparam:
1176  ALLOCATE (coredelta(islice)%codeparam%codename(1))
1177  ALLOCATE (coredelta(islice)%codeparam%codeversion(1))
1178  ALLOCATE (coredelta(islice)%codeparam%output_diag(1))
1179 
1180 
1181 ! +++ Radial coordinate:
1182  ALLOCATE (coredelta(islice)%VALUES(1)%rho_tor(nrho))
1183  ALLOCATE (coredelta(islice)%VALUES(1)%rho_tor_norm(nrho))
1184 
1185  coredelta(islice)%VALUES(1)%rho_tor(:) = 0.0_r8
1186  coredelta(islice)%VALUES(1)%rho_tor_norm(:) = 0.0_r8
1187 
1188 
1189 ! +++ Profiles of deltas:
1190  ALLOCATE (coredelta(islice)%VALUES(1)%psi(nrho))
1191  ALLOCATE (coredelta(islice)%VALUES(1)%volume(nrho))
1192  ALLOCATE (coredelta(islice)%VALUES(1)%area(nrho))
1193  ALLOCATE (coredelta(islice)%VALUES(1)%delta_psi(nrho))
1194  ALLOCATE (coredelta(islice)%VALUES(1)%delta_te(nrho))
1195  ALLOCATE (coredelta(islice)%VALUES(1)%delta_ne(nrho))
1196  ALLOCATE (coredelta(islice)%VALUES(1)%delta_ti(nrho,nion))
1197  ALLOCATE (coredelta(islice)%VALUES(1)%delta_ni(nrho,nion))
1198  ALLOCATE (coredelta(islice)%VALUES(1)%delta_vtor(nrho,nion))
1199  IF (nimp.GE.1) THEN
1200  ALLOCATE (coredelta(islice)%VALUES(1)%IMPURITY(nimp))
1201  DO iimp = 1, nimp
1202  ALLOCATE (coredelta(islice)%VALUES(1)%IMPURITY(iimp)%delta_nz(nrho,nzimp(iimp)))
1203  ALLOCATE (coredelta(islice)%VALUES(1)%IMPURITY(iimp)%delta_tz(nrho,nzimp(iimp)))
1204  coredelta(islice)%VALUES(1)%IMPURITY(iimp)%delta_nz = 0.0_r8
1205  coredelta(islice)%VALUES(1)%IMPURITY(iimp)%delta_tz = 0.0_r8
1206  END DO
1207  END IF
1208 
1209 
1210  coredelta(islice)%codeparam%codename = '-999999999'
1211  coredelta(islice)%codeparam%codeversion = '-999999999'
1212  coredelta(islice)%codeparam%output_diag = '-999999999'
1213  coredelta(islice)%codeparam%output_flag = -999999999
1214 
1215  coredelta(islice)%VALUES(1)%psi = 0.0_r8
1216  coredelta(islice)%VALUES(1)%volume = 0.0_r8
1217  coredelta(islice)%VALUES(1)%area = 0.0_r8
1218  coredelta(islice)%VALUES(1)%delta_psi = 0.0_r8
1219  coredelta(islice)%VALUES(1)%delta_te = 0.0_r8
1220  coredelta(islice)%VALUES(1)%delta_ne = 0.0_r8
1221  coredelta(islice)%VALUES(1)%delta_ti = 0.0_r8
1222  coredelta(islice)%VALUES(1)%delta_ni = 0.0_r8
1223  coredelta(islice)%VALUES(1)%delta_vtor = 0.0_r8
1224 
1225 
1226  END DO
1227 
1228 
1229  CALL deallocate_cpo(compositions)
1230 
1231 
1232  RETURN
1233 
1234  END SUBROUTINE allocate_coredelta_cpo
1235 
1236 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1237 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1238 
1239 
1240 
1241 
1242 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1248 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1249  SUBROUTINE allocate_equilibrium_cpo (NSLICE, NPSI, NDIM1, NDIM2, NPOINTS, EQUILIBRIUM)
1250 
1251 !-------------------------------------------------------!
1252 ! !
1253 ! This routine allocates EQUILIBRIUM CPO !
1254 ! !
1255 !-------------------------------------------------------!
1256 ! !
1257 ! Source: --- !
1258 ! Developers: D.Kalupin !
1259 ! Kontacts: D.Kalupin@fz-juelich.de !
1260 ! !
1261 ! Comments: --- !
1262 ! !
1263 !-------------------------------------------------------!
1264 
1265 
1266  USE euitm_schemas
1267  USE itm_types
1268 
1269  IMPLICIT NONE
1270 
1271  INTEGER :: nslice, islice !number of slices and slice index
1272  INTEGER :: npsi !number of points for equilibrium 1-D arrays
1273  INTEGER :: ndim1 !number of points for equilibrium 2-D arrays, first dimension
1274  INTEGER :: ndim2 !number of points for equilibrium 2-D arrays, second dimension
1275  INTEGER :: npoints !number of points for equilibrium boundary
1276 
1277  TYPE (type_equilibrium), POINTER :: equilibrium(:) !CPO with geometry quantities
1278 
1279 
1280 
1281  ALLOCATE (equilibrium(nslice))
1282 
1283 
1284  DO islice = 1,nslice
1285 
1286 ! +++ PROFILES_1D:
1287  ALLOCATE (equilibrium(islice)%profiles_1d%rho_tor(npsi))
1288  ALLOCATE (equilibrium(islice)%profiles_1d%q(npsi))
1289  ALLOCATE (equilibrium(islice)%profiles_1d%pressure(npsi))
1290  ALLOCATE (equilibrium(islice)%profiles_1d%jparallel(npsi))
1291  ALLOCATE (equilibrium(islice)%profiles_1d%jphi(npsi))
1292 
1293  ALLOCATE (equilibrium(islice)%profiles_1d%gm1(npsi))
1294  ALLOCATE (equilibrium(islice)%profiles_1d%gm2(npsi))
1295  ALLOCATE (equilibrium(islice)%profiles_1d%gm3(npsi))
1296  ALLOCATE (equilibrium(islice)%profiles_1d%gm4(npsi))
1297  ALLOCATE (equilibrium(islice)%profiles_1d%gm5(npsi))
1298  ALLOCATE (equilibrium(islice)%profiles_1d%gm6(npsi))
1299  ALLOCATE (equilibrium(islice)%profiles_1d%gm7(npsi))
1300  ALLOCATE (equilibrium(islice)%profiles_1d%gm8(npsi))
1301  ALLOCATE (equilibrium(islice)%profiles_1d%gm9(npsi))
1302 
1303  ALLOCATE (equilibrium(islice)%profiles_1d%volume(npsi))
1304  ALLOCATE (equilibrium(islice)%profiles_1d%vprime(npsi))
1305  ALLOCATE (equilibrium(islice)%profiles_1d%area(npsi))
1306  ALLOCATE (equilibrium(islice)%profiles_1d%aprime(npsi))
1307  ALLOCATE (equilibrium(islice)%profiles_1d%F_dia(npsi))
1308  ALLOCATE (equilibrium(islice)%profiles_1d%pprime(npsi))
1309  ALLOCATE (equilibrium(islice)%profiles_1d%ffprime(npsi))
1310 
1311  ALLOCATE (equilibrium(islice)%profiles_1d%elongation(npsi))
1312  ALLOCATE (equilibrium(islice)%profiles_1d%tria_upper(npsi))
1313  ALLOCATE (equilibrium(islice)%profiles_1d%tria_lower(npsi))
1314  ALLOCATE (equilibrium(islice)%profiles_1d%r_inboard(npsi))
1315  ALLOCATE (equilibrium(islice)%profiles_1d%r_outboard(npsi))
1316  ALLOCATE (equilibrium(islice)%profiles_1d%dpsidrho_tor(npsi))
1317  ALLOCATE (equilibrium(islice)%profiles_1d%beta_pol(npsi))
1318  ALLOCATE (equilibrium(islice)%profiles_1d%li(npsi))
1319  ALLOCATE (equilibrium(islice)%profiles_1d%dvdrho(npsi))
1320  ALLOCATE (equilibrium(islice)%profiles_1d%surface(npsi))
1321  ALLOCATE (equilibrium(islice)%profiles_1d%ftrap(npsi))
1322  ALLOCATE (equilibrium(islice)%profiles_1d%b_av(npsi))
1323  ALLOCATE (equilibrium(islice)%profiles_1d%b_min(npsi))
1324  ALLOCATE (equilibrium(islice)%profiles_1d%b_max(npsi))
1325 
1326  ALLOCATE (equilibrium(islice)%profiles_1d%phi(npsi))
1327  ALLOCATE (equilibrium(islice)%profiles_1d%psi(npsi))
1328  ALLOCATE (equilibrium(islice)%profiles_1d%rho_vol(npsi))
1329 
1330 
1331  equilibrium(islice)%profiles_1d%rho_tor(:) = 0.0_r8
1332  equilibrium(islice)%profiles_1d%q(:) = 0.0_r8
1333  equilibrium(islice)%profiles_1d%pressure(:) = 0.0_r8
1334  equilibrium(islice)%profiles_1d%jparallel(:) = 0.0_r8
1335  equilibrium(islice)%profiles_1d%jphi(:) = 0.0_r8
1336 
1337  equilibrium(islice)%profiles_1d%phi(:) = 0.0_r8
1338  equilibrium(islice)%profiles_1d%psi(:) = 0.0_r8
1339  equilibrium(islice)%profiles_1d%rho_vol(:) = 0.0_r8
1340 
1341  equilibrium(islice)%profiles_1d%gm1(:) = 0.0_r8
1342  equilibrium(islice)%profiles_1d%gm2(:) = 0.0_r8
1343  equilibrium(islice)%profiles_1d%gm3(:) = 0.0_r8
1344  equilibrium(islice)%profiles_1d%gm4(:) = 0.0_r8
1345  equilibrium(islice)%profiles_1d%gm5(:) = 0.0_r8
1346  equilibrium(islice)%profiles_1d%gm6(:) = 0.0_r8
1347  equilibrium(islice)%profiles_1d%gm7(:) = 0.0_r8
1348  equilibrium(islice)%profiles_1d%gm8(:) = 0.0_r8
1349  equilibrium(islice)%profiles_1d%gm9(:) = 0.0_r8
1350 
1351  equilibrium(islice)%profiles_1d%volume(:) = 0.0_r8
1352  equilibrium(islice)%profiles_1d%vprime(:) = 0.0_r8
1353  equilibrium(islice)%profiles_1d%area(:) = 0.0_r8
1354  equilibrium(islice)%profiles_1d%aprime(:) = 0.0_r8
1355  equilibrium(islice)%profiles_1d%F_dia(:) = 0.0_r8
1356  equilibrium(islice)%profiles_1d%pprime(:) = 0.0_r8
1357  equilibrium(islice)%profiles_1d%ffprime(:) = 0.0_r8
1358 
1359  equilibrium(islice)%profiles_1d%elongation(:) = 0.0_r8
1360  equilibrium(islice)%profiles_1d%tria_upper(:) = 0.0_r8
1361  equilibrium(islice)%profiles_1d%tria_lower(:) = 0.0_r8
1362  equilibrium(islice)%profiles_1d%r_inboard(:) = 0.0_r8
1363  equilibrium(islice)%profiles_1d%r_outboard(:) = 0.0_r8
1364  equilibrium(islice)%profiles_1d%dpsidrho_tor(:) = 0.0_r8
1365  equilibrium(islice)%profiles_1d%beta_pol(:) = 0.0_r8
1366  equilibrium(islice)%profiles_1d%li(:) = 0.0_r8
1367  equilibrium(islice)%profiles_1d%dvdrho(:) = 0.0_r8
1368  equilibrium(islice)%profiles_1d%surface(:) = 0.0_r8
1369  equilibrium(islice)%profiles_1d%ftrap(:) = 0.0_r8
1370  equilibrium(islice)%profiles_1d%b_av(:) = 0.0_r8
1371  equilibrium(islice)%profiles_1d%b_min(:) = 0.0_r8
1372  equilibrium(islice)%profiles_1d%b_max(:) = 0.0_r8
1373 
1374 
1375 ! +++ PROFILES_2D:
1376  ALLOCATE(equilibrium(1)%profiles_2d(1))
1377  ALLOCATE(equilibrium(1)%profiles_2d(1)%grid%dim1(ndim1))
1378  ALLOCATE(equilibrium(1)%profiles_2d(1)%grid%dim2(ndim2))
1379  ALLOCATE(equilibrium(1)%profiles_2d(1)%r(ndim1, ndim2))
1380  ALLOCATE(equilibrium(1)%profiles_2d(1)%z(ndim1, ndim2))
1381  ALLOCATE(equilibrium(1)%profiles_2d(1)%psi(ndim1, ndim2))
1382  ALLOCATE(equilibrium(1)%profiles_2d(1)%theta(ndim1, ndim2))
1383  ALLOCATE(equilibrium(1)%profiles_2d(1)%jphi(ndim1, ndim2))
1384  ALLOCATE(equilibrium(1)%profiles_2d(1)%jpar(ndim1, ndim2))
1385  ALLOCATE(equilibrium(1)%profiles_2d(1)%br(ndim1, ndim2))
1386  ALLOCATE(equilibrium(1)%profiles_2d(1)%bz(ndim1, ndim2))
1387  ALLOCATE(equilibrium(1)%profiles_2d(1)%bphi(ndim1, ndim2))
1388  ALLOCATE(equilibrium(1)%profiles_2d(1)%vphi(ndim1, ndim2))
1389  ALLOCATE(equilibrium(1)%profiles_2d(1)%vtheta(ndim1, ndim2))
1390  ALLOCATE(equilibrium(1)%profiles_2d(1)%rho_mass(ndim1, ndim2))
1391  ALLOCATE(equilibrium(1)%profiles_2d(1)%pressure(ndim1, ndim2))
1392  ALLOCATE(equilibrium(1)%profiles_2d(1)%temperature(ndim1, ndim2))
1393 
1394  equilibrium(1)%profiles_2d(1)%grid%dim1(:) = 0.0_r8
1395  equilibrium(1)%profiles_2d(1)%grid%dim2(:) = 0.0_r8
1396  equilibrium(1)%profiles_2d(1)%r(:,:) = 0.0_r8
1397  equilibrium(1)%profiles_2d(1)%z(:,:) = 0.0_r8
1398  equilibrium(1)%profiles_2d(1)%psi(:,:) = 0.0_r8
1399  equilibrium(1)%profiles_2d(1)%theta(:,:) = 0.0_r8
1400  equilibrium(1)%profiles_2d(1)%jphi(:,:) = 0.0_r8
1401  equilibrium(1)%profiles_2d(1)%jpar(:,:) = 0.0_r8
1402  equilibrium(1)%profiles_2d(1)%br(:,:) = 0.0_r8
1403  equilibrium(1)%profiles_2d(1)%bz(:,:) = 0.0_r8
1404  equilibrium(1)%profiles_2d(1)%bphi(:,:) = 0.0_r8
1405  equilibrium(1)%profiles_2d(1)%vphi(:,:) = 0.0_r8
1406  equilibrium(1)%profiles_2d(1)%vtheta(:,:) = 0.0_r8
1407  equilibrium(1)%profiles_2d(1)%rho_mass(:,:) = 0.0_r8
1408  equilibrium(1)%profiles_2d(1)%pressure(:,:) = 0.0_r8
1409  equilibrium(1)%profiles_2d(1)%temperature(:,:) = 0.0_r8
1410 
1411 
1412 
1413 ! +++ COORD_SYS:
1414  ALLOCATE(equilibrium(1)%coord_sys%grid%dim1(ndim1))
1415  ALLOCATE(equilibrium(1)%coord_sys%grid%dim2(ndim2))
1416  ALLOCATE(equilibrium(1)%coord_sys%g_11(ndim1, ndim2))
1417  ALLOCATE(equilibrium(1)%coord_sys%g_12(ndim1, ndim2))
1418  ALLOCATE(equilibrium(1)%coord_sys%g_13(ndim1, ndim2))
1419  ALLOCATE(equilibrium(1)%coord_sys%g_22(ndim1, ndim2))
1420  ALLOCATE(equilibrium(1)%coord_sys%g_23(ndim1, ndim2))
1421  ALLOCATE(equilibrium(1)%coord_sys%g_33(ndim1, ndim2))
1422  ALLOCATE(equilibrium(1)%coord_sys%position%R(ndim1, ndim2))
1423  ALLOCATE(equilibrium(1)%coord_sys%position%Z(ndim1, ndim2))
1424 
1425  equilibrium(1)%coord_sys%grid%dim1(:) = 0.0_r8
1426  equilibrium(1)%coord_sys%grid%dim2(:) = 0.0_r8
1427  equilibrium(1)%coord_sys%g_11(:,:) = 0.0_r8
1428  equilibrium(1)%coord_sys%g_12(:,:) = 0.0_r8
1429  equilibrium(1)%coord_sys%g_13(:,:) = 0.0_r8
1430  equilibrium(1)%coord_sys%g_22(:,:) = 0.0_r8
1431  equilibrium(1)%coord_sys%g_23(:,:) = 0.0_r8
1432  equilibrium(1)%coord_sys%g_33(:,:) = 0.0_r8
1433  equilibrium(1)%coord_sys%position%R(:,:) = 0.0_r8
1434  equilibrium(1)%coord_sys%position%Z(:,:) = 0.0_r8
1435 
1436 
1437 
1438 ! +++ EQGEOMETRY:
1439  ALLOCATE(equilibrium(1)%eqgeometry%boundary(1))
1440  ALLOCATE(equilibrium(1)%eqgeometry%boundary(1)%r(npoints))
1441  ALLOCATE(equilibrium(1)%eqgeometry%boundary(1)%z(npoints))
1442 
1443  equilibrium(1)%eqgeometry%boundary(1)%r(:) = 0.0_r8
1444  equilibrium(1)%eqgeometry%boundary(1)%z(:) = 0.0_r8
1445 
1446 
1447 
1448  END DO
1449 
1450  RETURN
1451 
1452  END SUBROUTINE allocate_equilibrium_cpo
1453 
1454 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1455 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1456 
1457 
1458 
1459 
1460 
1461 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1467 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1468  SUBROUTINE allocate_toroidfield_cpo (NSLICE, TOROIDFIELD)
1469 
1470 !-------------------------------------------------------!
1471 ! !
1472 ! This routine allocates TOROIDFIELD CPO !
1473 ! !
1474 !-------------------------------------------------------!
1475 ! !
1476 ! Source: --- !
1477 ! Developers: D.Kalupin !
1478 ! Kontacts: D.Kalupin@fz-juelich.de !
1479 ! !
1480 ! Comments: --- !
1481 ! !
1482 !-------------------------------------------------------!
1483 
1484 
1485  USE euitm_schemas
1486  USE itm_types
1487 
1488  IMPLICIT NONE
1489 
1490  INTEGER :: nslice, islice !number of slices and slice index
1491 
1492  TYPE (type_toroidfield), POINTER :: toroidfield(:) !CPO with geometry quantities
1493 
1494 
1495 
1496  ALLOCATE (toroidfield(nslice))
1497 
1498 
1499 
1500  RETURN
1501 
1502  END SUBROUTINE allocate_toroidfield_cpo
1503 
1504 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1505 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1506 
1507 
1508 
1509 
1510 
1511 
1512 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1518 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1519  SUBROUTINE allocate_neoclassic_cpo (NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, NEOCLASSIC)
1520 
1521 !-------------------------------------------------------!
1522 ! !
1523 ! This routine allocates NEOCLASSIC CPO !
1524 ! !
1525 !-------------------------------------------------------!
1526 ! !
1527 ! Source: --- !
1528 ! Developers: D.Kalupin !
1529 ! Kontacts: D.Kalupin@fz-juelich.de !
1530 ! !
1531 ! Comments: --- !
1532 ! !
1533 !-------------------------------------------------------!
1534 
1535 
1536  USE euitm_schemas
1537  USE itm_types
1538  USE copy_structures
1539  USE deallocate_structures
1540 
1541  IMPLICIT NONE
1542 
1543  INTEGER :: nslice, islice !number of slices and slice index
1544  INTEGER :: nrho !number of radial points (input)
1545  INTEGER :: nnucl, inucl !number of nuclei species
1546  INTEGER :: nion, iion !number of ion species
1547  INTEGER :: nimp, iimp !number of impurity species
1548  INTEGER, ALLOCATABLE :: nzimp(:) !number of ionization states for each impurity
1549  INTEGER :: izimp
1550  INTEGER :: nneut, ineut !number of neutrals species
1551  INTEGER, ALLOCATABLE :: ncomp(:) !number of components for each neutral
1552  INTEGER :: icomp
1553  INTEGER, ALLOCATABLE :: ntype(:) !number of types for each neutral
1554  INTEGER :: itype
1555 
1556  TYPE (type_neoclassic), POINTER :: neoclassic(:) !CPO with transport coefficients
1557  TYPE (type_compositions_type) :: compositions
1558 
1559  ALLOCATE (neoclassic(nslice))
1560  CALL allocate_compositions(nslice, nnucl, nion, nimp, nzimp, nneut, ntype, ncomp, compositions)
1561 
1562 
1563 
1564  DO islice = 1,nslice
1565 
1566  CALL deallocate_cpo(neoclassic(islice)%compositions)
1567  CALL copy_cpo(compositions, neoclassic(islice)%compositions)
1568 
1569 
1570 
1571 ! +++ Codeparam:
1572  ALLOCATE (neoclassic(islice)%codeparam%codename(1))
1573  ALLOCATE (neoclassic(islice)%codeparam%codeversion(1))
1574  ALLOCATE (neoclassic(islice)%codeparam%output_diag(1))
1575 
1576 
1577 ! +++ Radial coordinate:
1578  ALLOCATE (neoclassic(islice)%rho_tor(nrho))
1579  ALLOCATE (neoclassic(islice)%rho_tor_norm(nrho))
1580 
1581  neoclassic(islice)%rho_tor(:) = 0.0_r8
1582  neoclassic(islice)%rho_tor_norm(:) = 0.0_r8
1583 
1584 
1585 
1586 
1587 ! +++ Profiles of transport coefficients:
1588  ALLOCATE (neoclassic(islice)%sigma(nrho))
1589  ALLOCATE (neoclassic(islice)%jboot(nrho))
1590  ALLOCATE (neoclassic(islice)%er(nrho))
1591  ALLOCATE (neoclassic(islice)%vpol(nrho,nion))
1592  ALLOCATE (neoclassic(islice)%ne_neo%diff_eff(nrho))
1593  ALLOCATE (neoclassic(islice)%ne_neo%vconv_eff(nrho))
1594  ALLOCATE (neoclassic(islice)%ni_neo%diff_eff(nrho,nion))
1595  ALLOCATE (neoclassic(islice)%ni_neo%vconv_eff(nrho,nion))
1596  ALLOCATE (neoclassic(islice)%ti_neo%diff_eff(nrho,nion))
1597  ALLOCATE (neoclassic(islice)%ti_neo%vconv_eff(nrho,nion))
1598  ALLOCATE (neoclassic(islice)%te_neo%diff_eff(nrho))
1599  ALLOCATE (neoclassic(islice)%te_neo%vconv_eff(nrho))
1600  ALLOCATE (neoclassic(islice)%mtor_neo%diff_eff(nrho))
1601  ALLOCATE (neoclassic(islice)%mtor_neo%vconv_eff(nrho))
1602 
1603 
1604  neoclassic(islice)%codeparam%codename = '-999999999'
1605  neoclassic(islice)%codeparam%codeversion = '-999999999'
1606  neoclassic(islice)%codeparam%output_diag = '-999999999'
1607  neoclassic(islice)%codeparam%output_flag = -999999999
1608 
1609  neoclassic(islice)%sigma(:) = 0.0_r8
1610  neoclassic(islice)%jboot(:) = 0.0_r8
1611  neoclassic(islice)%er(:) = 0.0_r8
1612  neoclassic(islice)%vpol(:,:) = 0.0_r8
1613  neoclassic(islice)%ne_neo%diff_eff(:) = 0.0_r8
1614  neoclassic(islice)%ne_neo%vconv_eff(:) = 0.0_r8
1615  neoclassic(islice)%ni_neo%diff_eff(:,:) = 0.0_r8
1616  neoclassic(islice)%ni_neo%vconv_eff(:,:) = 0.0_r8
1617  neoclassic(islice)%ti_neo%diff_eff(:,:) = 0.0_r8
1618  neoclassic(islice)%ti_neo%vconv_eff(:,:) = 0.0_r8
1619  neoclassic(islice)%te_neo%diff_eff(:) = 0.0_r8
1620  neoclassic(islice)%te_neo%vconv_eff(:) = 0.0_r8
1621  neoclassic(islice)%mtor_neo%diff_eff(:) = 0.0_r8
1622  neoclassic(islice)%mtor_neo%vconv_eff(:) = 0.0_r8
1623 
1624  IF(nimp.GT.0) THEN
1625  ALLOCATE (neoclassic(islice)%nz_neo(nimp))
1626  ALLOCATE (neoclassic(islice)%tz_neo(nimp))
1627 
1628  DO iimp=1, nimp
1629  ALLOCATE (neoclassic(islice)%nz_neo(iimp)%diff_eff(nrho,nzimp(iimp)))
1630  ALLOCATE (neoclassic(islice)%nz_neo(iimp)%vconv_eff(nrho,nzimp(iimp)))
1631  ALLOCATE (neoclassic(islice)%tz_neo(iimp)%diff_eff(nrho,nzimp(iimp)))
1632  ALLOCATE (neoclassic(islice)%tz_neo(iimp)%vconv_eff(nrho,nzimp(iimp)))
1633 
1634 
1635  neoclassic(islice)%nz_neo(iimp)%diff_eff(:,:) = 0.0_r8
1636  neoclassic(islice)%nz_neo(iimp)%vconv_eff(:,:) = 0.0_r8
1637  neoclassic(islice)%tz_neo(iimp)%diff_eff(:,:) = 0.0_r8
1638  neoclassic(islice)%tz_neo(iimp)%vconv_eff(:,:) = 0.0_r8
1639  ENDDO
1640  ENDIF
1641 
1642  END DO
1643 
1644 
1645  CALL deallocate_cpo(compositions)
1646 
1647 
1648  RETURN
1649 
1650  END SUBROUTINE allocate_neoclassic_cpo
1651 
1652 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1653 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1654 
1655 
1656 
1657 
1658 
1659 
1660 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1661 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1662 
1663  SUBROUTINE allocate_compositionc_cpo (NSLICE, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COMPOSITIONC)
1664 
1665 !-------------------------------------------------------!
1666 ! !
1667 ! This routine allocates COMPOSITIONC CPO !
1668 ! !
1669 !-------------------------------------------------------!
1670 ! !
1671 ! Source: --- !
1672 ! Developers: Denis Kalupin !
1673 ! Kontacts: Denis.Kalupin@efda.org !
1674 ! !
1675 ! Comments: --- !
1676 ! !
1677 !-------------------------------------------------------!
1678 
1679 
1680  USE euitm_schemas
1681  USE itm_types
1682  USE copy_structures
1683  USE deallocate_structures
1684 
1685  IMPLICIT NONE
1686 
1687  INTEGER :: nslice, islice !number of slices and slice index
1688  INTEGER :: nnucl !number of nuclei species
1689  INTEGER :: nion !number of ion species
1690  INTEGER :: nimp !number of impurity species
1691  INTEGER, ALLOCATABLE :: nzimp(:) !number of ionization states for each impurity
1692  INTEGER :: nneut !number of neutrals species
1693  INTEGER, ALLOCATABLE :: ncomp(:) !number of components for each neutral
1694  INTEGER, ALLOCATABLE :: ntype(:) !number of types for each neutral
1695 
1696  TYPE (type_compositionc), POINTER :: compositionc(:) !CPO with impurities
1697  TYPE (type_compositions_type) :: compositions
1698 
1699 
1700  ALLOCATE (compositionc(nslice))
1701 
1702 
1703  CALL allocate_compositions(nslice, nnucl, nion, nimp, nzimp, nneut, ntype, ncomp, compositions)
1704 
1705 
1706  DO islice = 1,nslice
1707 
1708  CALL deallocate_cpo(compositionc(islice)%compositions)
1709  CALL copy_cpo(compositions, compositionc(islice)%compositions)
1710 
1711  END DO
1712 
1713 
1714  CALL deallocate_cpo(compositions)
1715 
1716  RETURN
1717 
1718  END SUBROUTINE allocate_compositionc_cpo
1719 
1720 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1721 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1722 
1723 
1724 
1725 
1726 
1727 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1728 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1729 
1730  SUBROUTINE allocate_compositions (NSLICE, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COMPOSITIONS)
1731 
1732 !-------------------------------------------------------!
1733 ! !
1734 ! This routine allocates COMPOSITIONC CPO !
1735 ! !
1736 !-------------------------------------------------------!
1737 ! !
1738 ! Source: --- !
1739 ! Developers: Denis Kalupin !
1740 ! Kontacts: Denis.Kalupin@efda.org !
1741 ! !
1742 ! Comments: --- !
1743 ! !
1744 !-------------------------------------------------------!
1745 
1746 
1747  USE euitm_schemas
1748  USE itm_types
1749 
1750  IMPLICIT NONE
1751 
1752  INTEGER :: nslice, islice !number of slices and slice index
1753  INTEGER :: nnucl, inucl !number of nuclei species
1754  INTEGER :: nion, iion !number of ion species
1755  INTEGER :: nimp, iimp !number of impurity species
1756  INTEGER, ALLOCATABLE :: nzimp(:) !number of ionization states for each impurity
1757  INTEGER :: izimp
1758  INTEGER :: nneut, ineut !number of neutrals species
1759  INTEGER, ALLOCATABLE :: ncomp(:) !number of components for each neutral
1760  INTEGER :: icomp
1761  INTEGER, ALLOCATABLE :: ntype(:) !number of types for each neutral
1762  INTEGER :: itype
1763 
1764  TYPE (type_compositions_type) :: compositions
1765 
1766 
1767 ! +++ Nuclei:
1768  ALLOCATE (compositions%NUCLEI(nnucl))
1769  DO inucl = 1, nnucl
1770  ALLOCATE(compositions%NUCLEI(inucl)%label(1))
1771  compositions%NUCLEI(inucl)%zn = 0.0_r8
1772  compositions%NUCLEI(inucl)%amn = 0.0_r8
1773  compositions%NUCLEI(inucl)%label = " "
1774  END DO
1775 
1776 
1777 
1778 ! +++ Ions:
1779  ALLOCATE (compositions%IONS(nion))
1780  DO iion = 1, nion
1781  ALLOCATE(compositions%IONS(iion)%label(1))
1782  compositions%IONS(iion)%nucindex = 0
1783  compositions%IONS(iion)%zion = 0.0_r8
1784  compositions%IONS(iion)%imp_flag = 0
1785  compositions%IONS(iion)%label = " "
1786  END DO
1787 
1788 
1789 
1790 ! +++ Impurities:
1791  IF (nimp.GE.1) THEN
1792  ALLOCATE (compositions%IMPURITIES(nimp))
1793  DO iimp = 1, nimp
1794  compositions%IMPURITIES(iimp)%nucindex = 0
1795  compositions%IMPURITIES(iimp)%i_ion = 0
1796  compositions%IMPURITIES(iimp)%nzimp = nzimp(iimp)
1797  ALLOCATE (compositions%IMPURITIES(iimp)%zmin(nzimp(iimp)))
1798  ALLOCATE (compositions%IMPURITIES(iimp)%zmax(nzimp(iimp)))
1799  ALLOCATE (compositions%IMPURITIES(iimp)%label(nzimp(iimp)))
1800  DO izimp = 1, nzimp(iimp)
1801  compositions%IMPURITIES(iimp)%zmin(izimp) = 0.0_r8
1802  compositions%IMPURITIES(iimp)%zmax(izimp) = 0.0_r8
1803  compositions%IMPURITIES(iimp)%label(izimp) = " "
1804  END DO
1805  END DO
1806  END IF
1807 
1808 
1809 
1810 ! +++ Neutrals:
1811  IF (nneut.GE.1) THEN
1812  ALLOCATE (compositions%NEUTRALSCOMP(nneut))
1813  DO ineut = 1, nneut
1814  ALLOCATE (compositions%NEUTRALSCOMP(ineut)%NEUTCOMP(ncomp(ineut)))
1815  ALLOCATE (compositions%NEUTRALSCOMP(ineut)%TYPE(ntype(ineut)))
1816  DO icomp = 1, ncomp(ineut)
1817  compositions%NEUTRALSCOMP(ineut)%NEUTCOMP(icomp)%nucindex = 0
1818  compositions%NEUTRALSCOMP(ineut)%NEUTCOMP(icomp)%multiplicity = 0
1819  END DO
1820  DO itype = 1, ntype(ineut)
1821  ALLOCATE(compositions%NEUTRALSCOMP(ineut)%TYPE(itype)%id(1))
1822  ALLOCATE(compositions%NEUTRALSCOMP(ineut)%TYPE(itype)%description(1))
1823  compositions%NEUTRALSCOMP(ineut)%TYPE(itype)%id = " "
1824  compositions%NEUTRALSCOMP(ineut)%TYPE(itype)%flag = 0
1825  compositions%NEUTRALSCOMP(ineut)%TYPE(itype)%description = " "
1826  END DO
1827  END DO
1828  END IF
1829 
1830 
1831 
1832  RETURN
1833 
1834  END SUBROUTINE allocate_compositions
1835 
1836 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1837 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1838 
1839 
1840 
1841 
1842 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1843 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1844 
1845  SUBROUTINE get_comp_dimensions (COMPOSITIONS, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP)
1846 
1847 !-------------------------------------------------------!
1848 ! !
1849 ! This routine allocates COMPOSITIONC CPO !
1850 ! !
1851 !-------------------------------------------------------!
1852 ! !
1853 ! Source: --- !
1854 ! Developers: Denis Kalupin !
1855 ! Kontacts: Denis.Kalupin@efda.org !
1856 ! !
1857 ! Comments: --- !
1858 ! !
1859 !-------------------------------------------------------!
1860 
1861 
1862  USE euitm_schemas
1863  USE itm_types
1864 
1865  IMPLICIT NONE
1866 
1867  INTEGER, INTENT(OUT) :: nnucl !number of nuclei species
1868  INTEGER, INTENT(OUT) :: nion !number of ion species
1869  INTEGER, INTENT(OUT) :: nimp !number of impurity species
1870  INTEGER, INTENT(OUT), ALLOCATABLE :: nzimp(:) !number of ionization states for each impurity
1871  INTEGER, INTENT(OUT) :: nneut !number of neutrals species
1872  INTEGER, INTENT(OUT), ALLOCATABLE :: ncomp(:) !number of components for each neutral
1873  INTEGER, INTENT(OUT), ALLOCATABLE :: ntype(:) !number of types for each neutral
1874 
1875  INTEGER :: iimp
1876  INTEGER :: ineut
1877 
1878  TYPE (type_compositions_type) :: compositions
1879 
1880 
1881 ! +++ Nuclei:
1882  IF(ASSOCIATED(compositions%NUCLEI)) THEN
1883  nnucl = SIZE (compositions%NUCLEI)
1884  ELSE
1885  nnucl = 0
1886  ENDIF
1887 
1888 ! +++ Ions:
1889  IF(ASSOCIATED(compositions%IONS)) THEN
1890  nion = SIZE (compositions%IONS)
1891  ELSE
1892  nion = 0
1893  ENDIF
1894 
1895 ! +++ Impurities:
1896  IF(ASSOCIATED(compositions%IMPURITIES)) THEN
1897  nimp = SIZE (compositions%IMPURITIES)
1898  ALLOCATE (nzimp(nimp))
1899  nzimp = 0
1900  DO iimp = 1, nimp
1901  nzimp(iimp) = compositions%IMPURITIES(iimp)%nzimp
1902  ENDDO
1903  ELSE
1904  nimp = 0
1905  ENDIF
1906 
1907 ! +++ Neutrals:
1908  IF(ASSOCIATED(compositions%NEUTRALSCOMP)) THEN
1909  nneut = SIZE (compositions%NEUTRALSCOMP)
1910  ALLOCATE (ntype(nneut))
1911  ALLOCATE (ncomp(nneut))
1912  ntype = 0
1913  ncomp = 0
1914  DO ineut = 1, nneut
1915  ncomp(ineut) = SIZE(compositions%NEUTRALSCOMP(ineut)%NEUTCOMP)
1916  ntype(ineut) = SIZE(compositions%NEUTRALSCOMP(ineut)%TYPE)
1917  ENDDO
1918  ELSE
1919  nneut = 0
1920  ENDIF
1921 
1922  RETURN
1923 
1924  END SUBROUTINE get_comp_dimensions
1925 
1926 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1927 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1928 
1929 
1930 
1931 
1932 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1933 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1934 END MODULE allocate_deallocate
subroutine allocate_compositions(NSLICE, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COMPOSITIONS)
subroutine allocate_coreimpur_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COREIMPUR)
This routine allocates COREIMPUR CPO.
subroutine allocate_coredelta_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COREDELTA)
This routine allocates COREDELTA CPO.
subroutine allocate_coreprof_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COREPROF)
This routine allocates COREPROF CPO.
subroutine get_comp_dimensions(COMPOSITIONS, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP)
subroutine allocate_corefast_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COREFAST)
This routine allocates COREFAST CPO.
This module contains routines for allocation/deallocation if CPOs used in ETS.
subroutine allocate_coresource_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, CORESOURCE)
This routine allocates CORESOURCE CPO.
subroutine allocate_equilibrium_cpo(NSLICE, NPSI, NDIM1, NDIM2, NPOINTS, EQUILIBRIUM)
This routine allocates EQUILIBRIUM CPO.
subroutine allocate_neoclassic_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, NEOCLASSIC)
This routine allocates NEOCLASSIC CPO.
subroutine allocate_coreneutrals_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, CORENEUTRALS)
subroutine allocate_compositionc_cpo(NSLICE, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COMPOSITIONC)
subroutine allocate_toroidfield_cpo(NSLICE, TOROIDFIELD)
This routine allocates TOROIDFIELD CPO.
subroutine allocate_coretransp_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, CORETRANSP)
This routine allocates CORETRANSP CPO.