ETS  \$Id: Doxyfile 2162 2020-02-26 14:16:09Z g2dpc $
 All Classes Files Functions Variables Pages
write_cpo_allocate_deallocate.f90
Go to the documentation of this file.
1 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
8 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
10 !-------------------------------------------------------!
11 ! !
12 ! This module contains routines for !
13 ! allocation/deallocation if CPOs used in ETS !
14 ! !
15 !-------------------------------------------------------!
16 ! !
17 ! Source: --- !
18 ! Developers: D.Kalupin !
19 ! Kontacts: D.Kalupin@fz-juelich.de !
20 ! !
21 ! Comments: --- !
22 ! !
23 !-------------------------------------------------------!
24 
25 CONTAINS
26 
27 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
33 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
34  SUBROUTINE allocate_coreprof_cpo (NSLICE, NRHO, NION, COREPROF)
35 
36 !-------------------------------------------------------!
37 ! !
38 ! This routine allocates COREPROF CPO !
39 ! !
40 !-------------------------------------------------------!
41 ! !
42 ! Source: --- !
43 ! Developers: D.Kalupin !
44 ! Kontacts: D.Kalupin@fz-juelich.de !
45 ! !
46 ! Comments: --- !
47 ! !
48 !-------------------------------------------------------!
49 
50 
51  USE euitm_schemas
52 
53  IMPLICIT NONE
54 
55  INTEGER :: nslice, islice !number of slices and slice index
56  INTEGER :: nrho !number of radial points (input)
57  INTEGER :: nion !number of ion species (input)
58 
59  TYPE (type_coreprof), POINTER :: coreprof(:) !CPO with internal ETS parameters profiles
60 
61 
62  ALLOCATE (coreprof(nslice))
63 
64 
65  DO islice = 1,nslice
66 
67 ! +++ Radial coordinate:
68  ALLOCATE (coreprof(islice)%rho_tor(nrho))
69 
70 
71 
72 ! +++ Plasma composition:
73  ALLOCATE (coreprof(islice)%composition%zion(nion))
74  ALLOCATE (coreprof(islice)%composition%amn(nion))
75  ALLOCATE (coreprof(islice)%composition%zn(nion))
76 
77 
78 ! +++ Boundary conditions:
79  ALLOCATE (coreprof(islice)%ni%flag(nion))
80  ALLOCATE (coreprof(islice)%ti%flag(nion))
81  ALLOCATE (coreprof(islice)%vtor%flag(nion))
82 
83  ALLOCATE (coreprof(islice)%ni%boundary%type(nion))
84  ALLOCATE (coreprof(islice)%ti%boundary%type(nion))
85  ALLOCATE (coreprof(islice)%vtor%boundary%type(nion))
86 
87  ALLOCATE (coreprof(islice)%ni%boundary%rho_tor(nion))
88  ALLOCATE (coreprof(islice)%ti%boundary%rho_tor(nion))
89  ALLOCATE (coreprof(islice)%vtor%boundary%rho_tor(nion))
90 
91  ALLOCATE (coreprof(islice)%psi%boundary%value(3))
92  ALLOCATE (coreprof(islice)%ni%boundary%value(3,nion))
93  ALLOCATE (coreprof(islice)%ne%boundary%value(3))
94  ALLOCATE (coreprof(islice)%ti%boundary%value(3,nion))
95  ALLOCATE (coreprof(islice)%te%boundary%value(3))
96  ALLOCATE (coreprof(islice)%vtor%boundary%value(3,nion))
97 
98 
99 ! +++ Plasma primary profiles:
100  ALLOCATE (coreprof(islice)%psi%value(nrho))
101  ALLOCATE (coreprof(islice)%ni%value(nrho,nion))
102  ALLOCATE (coreprof(islice)%ne%value(nrho))
103  ALLOCATE (coreprof(islice)%ti%value(nrho,nion))
104  ALLOCATE (coreprof(islice)%te%value(nrho))
105  ALLOCATE (coreprof(islice)%vtor%value(nrho,nion))
106 
107 
108 ! +++ Plasma derived profiles:
109  ALLOCATE (coreprof(islice)%profiles1d%wtor%value(nrho,nion))
110  allocate (coreprof(islice)%psi%sigma_par%value(nrho))
111  ALLOCATE (coreprof(islice)%profiles1d%q%value(nrho))
112  ALLOCATE (coreprof(islice)%profiles1d%zeff%value(nrho))
113  ALLOCATE (coreprof(islice)%profiles1d%jtot%value(nrho))
114  ALLOCATE (coreprof(islice)%profiles1d%zeff%value(nrho))
115  ALLOCATE (coreprof(islice)%profiles1d%pr_th%value(nrho))
116  ALLOCATE (coreprof(islice)%profiles1d%pr_perp%value(nrho))
117  ALLOCATE (coreprof(islice)%profiles1d%pr_parallel%value(nrho))
118  ALLOCATE (coreprof(islice)%profiles1d%pe%value(nrho))
119  ALLOCATE (coreprof(islice)%profiles1d%pi%value(nrho,nion))
120 
121 
122 
123  END DO
124 
125 
126 
127  RETURN
128 
129  END SUBROUTINE allocate_coreprof_cpo
130 
131 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
132 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
133 
134 
135 
136 
137 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
138 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
139 
140  SUBROUTINE allocate_coretransp_cpo (NSLICE, NRHO, NION, NIMP, NZIMP, CORETRANSP)
141 
142 !-------------------------------------------------------!
143 ! !
144 ! This routine allocates CORETRANSP CPO !
145 ! !
146 !-------------------------------------------------------!
147 ! !
148 ! Source: --- !
149 ! Developers: D.Kalupin !
150 ! Kontacts: D.Kalupin@fz-juelich.de !
151 ! !
152 ! Comments: --- !
153 ! !
154 !-------------------------------------------------------!
155 
156 
157  USE euitm_schemas
158  USE itm_types
159 
160  IMPLICIT NONE
161 
162  INTEGER :: nslice, islice !number of slices and slice index
163  INTEGER :: nrho !number of radial points (input)
164  INTEGER :: nion !number of ion species (input)
165  INTEGER :: nimp, iimp !number of impurity species (input)
166  INTEGER :: nzimp(:) !number of charge states for each impurity (input)
167 
168  TYPE (type_coretransp), POINTER :: coretransp(:) !CPO with transport coefficients
169 
170 
171 
172  ALLOCATE (coretransp(nslice))
173 
174 
175  DO islice = 1,nslice
176 
177  ALLOCATE (coretransp(islice)%VALUES(1))
178 
179 ! +++ Radial coordinate:
180  ALLOCATE (coretransp(islice)%VALUES(1)%rho_tor(nrho))
181 
182 
183 ! +++ Plasma composition:
184  ALLOCATE (coretransp(islice)%composition%zion(nion))
185  ALLOCATE (coretransp(islice)%composition%amn(nion))
186  ALLOCATE (coretransp(islice)%composition%zn(nion))
187 
188 
189 ! +++ Profiles of transport coefficients:
190  ALLOCATE (coretransp(islice)%VALUES(1)%sigma(nrho))
191  ALLOCATE (coretransp(islice)%VALUES(1)%ne_transp%diff_eff(nrho,3))
192  ALLOCATE (coretransp(islice)%VALUES(1)%ne_transp%vconv_eff(nrho,3))
193  ALLOCATE (coretransp(islice)%VALUES(1)%ni_transp%diff_eff(nrho,nion,3))
194  ALLOCATE (coretransp(islice)%VALUES(1)%ni_transp%vconv_eff(nrho,nion,3))
195  ALLOCATE (coretransp(islice)%VALUES(1)%ti_transp%diff_eff(nrho,nion))
196  ALLOCATE (coretransp(islice)%VALUES(1)%ti_transp%vconv_eff(nrho,nion))
197 ! ALLOCATE (CORETRANSP(ISLICE)%VALUES(1)%ti_transp%qgi(NRHO,NION))
198  ALLOCATE (coretransp(islice)%VALUES(1)%te_transp%diff_eff(nrho))
199  ALLOCATE (coretransp(islice)%VALUES(1)%te_transp%vconv_eff(nrho))
200  ALLOCATE (coretransp(islice)%VALUES(1)%vtor_transp%diff_eff(nrho,nion))
201  ALLOCATE (coretransp(islice)%VALUES(1)%vtor_transp%vconv_eff(nrho,nion))
202 
203 ! if(nimp.gt.0) then
204  ALLOCATE (coretransp(islice)%values(1)%nz_transp(nimp))
205  ALLOCATE (coretransp(islice)%values(1)%tz_transp(nimp))
206  do iimp=1, nimp
207  ALLOCATE (coretransp(islice)%values(1)%nz_transp(iimp)%diff_eff(nrho,nzimp(iimp)))
208  coretransp(islice)%values(1)%nz_transp(iimp)%diff_eff(:,:) = 0.0_r8
209  ALLOCATE (coretransp(islice)%values(1)%nz_transp(iimp)%vconv_eff(nrho,nzimp(iimp)))
210  coretransp(islice)%values(1)%nz_transp(iimp)%vconv_eff(:,:) = 0.0_r8
211  ALLOCATE (coretransp(islice)%values(1)%tz_transp(iimp)%diff_eff(nrho,nzimp(iimp)))
212  coretransp(islice)%values(1)%tz_transp(iimp)%diff_eff(:,:) = 0.0_r8
213  ALLOCATE (coretransp(islice)%values(1)%tz_transp(iimp)%vconv_eff(nrho,nzimp(iimp)))
214  coretransp(islice)%values(1)%tz_transp(iimp)%vconv_eff(:,:) = 0.0_r8
215  enddo
216 ! endif
217 
218  END DO
219 
220  RETURN
221 
222  END SUBROUTINE allocate_coretransp_cpo
223 
224 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
225 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
226 
227 
228 
229 
230 
231 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
232 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
233 
234  SUBROUTINE allocate_coresource_cpo (NSLICE, NRHO, NION, NIMP, NZIMP, CORESOURCE)
235 
236 !-------------------------------------------------------!
237 ! !
238 ! This routine allocates CORESOURCE CPO !
239 ! !
240 !-------------------------------------------------------!
241 ! !
242 ! Source: --- !
243 ! Developers: D.Kalupin !
244 ! Kontacts: D.Kalupin@fz-juelich.de !
245 ! !
246 ! Comments: --- !
247 ! !
248 !-------------------------------------------------------!
249 
250 
251  USE euitm_schemas
252 
253  IMPLICIT NONE
254 
255  INTEGER :: nslice, islice !number of slices and slice index
256  INTEGER :: nrho !number of radial points (input)
257  INTEGER :: nion !number of ion species (input)
258  INTEGER :: nimp, iimp !number of radial points (input)
259  INTEGER, allocatable :: nzimp(:) !number of ion species (input)
260 
261  TYPE (type_coresource), POINTER :: coresource(:) !CPO with sources
262 
263 
264 
265  ALLOCATE (coresource(nslice))
266 
267 
268  DO islice = 1,nslice
269 
270  ALLOCATE(coresource(islice)%VALUES(1))
271 
272 ! +++ Radial coordinate:
273  ALLOCATE (coresource(islice)%values(1)%rho_tor(nrho))
274 
275 
276 ! +++ Plasma composition:
277  ALLOCATE (coresource(islice)%composition%zion(nion))
278  ALLOCATE (coresource(islice)%composition%amn(nion))
279  ALLOCATE (coresource(islice)%composition%zn(nion))
280 
281 
282 ! +++ Profiles of sources:
283  ALLOCATE (coresource(islice)%VALUES(1)%sigma(nrho))
284  ALLOCATE (coresource(islice)%VALUES(1)%j(nrho))
285  ALLOCATE (coresource(islice)%VALUES(1)%qe%exp(nrho))
286  ALLOCATE (coresource(islice)%VALUES(1)%qe%imp(nrho))
287  ALLOCATE (coresource(islice)%VALUES(1)%si%exp(nrho,nion))
288  ALLOCATE (coresource(islice)%VALUES(1)%si%imp(nrho,nion))
289  ALLOCATE (coresource(islice)%VALUES(1)%qi%exp(nrho,nion))
290  ALLOCATE (coresource(islice)%VALUES(1)%qi%imp(nrho,nion))
291  ALLOCATE (coresource(islice)%VALUES(1)%ui%exp(nrho,nion))
292  ALLOCATE (coresource(islice)%VALUES(1)%ui%imp(nrho,nion))
293 
294  ! if(nimp.gt.0) then
295  ALLOCATE (coresource(islice)%VALUES(1)%sz(nimp))
296  ALLOCATE (coresource(islice)%VALUES(1)%qz(nimp))
297  do iimp=1, nimp
298  ALLOCATE (coresource(islice)%VALUES(1)%sz(iimp)%exp(nrho,nzimp(iimp)))
299  ALLOCATE (coresource(islice)%VALUES(1)%sz(iimp)%imp(nrho,nzimp(iimp)))
300  ALLOCATE (coresource(islice)%VALUES(1)%qz(iimp)%exp(nrho,nzimp(iimp)))
301  ALLOCATE (coresource(islice)%VALUES(1)%qz(iimp)%imp(nrho,nzimp(iimp)))
302  enddo
303 ! endif
304  END DO
305 
306 
307  RETURN
308 
309  END SUBROUTINE allocate_coresource_cpo
310 
311 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
312 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
313 
314 
315 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
316 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
317 
318  SUBROUTINE allocate_compositionc_cpo (NUCL, NNEUT, NTYPE, NCOMP, NION, NIMP, NZIMP, COMPOSITIONC)
319 
320 !-------------------------------------------------------!
321 ! !
322 ! This routine allocates COMPOSITIONC CPO !
323 ! !
324 !-------------------------------------------------------!
325 ! !
326 ! Source: --- !
327 ! Developers: I.Ivanova-Stanik !
328 ! Kontacts: irena@ifpilm.waw.pl !
329 ! !
330 ! Comments: --- !
331 ! !
332 !-------------------------------------------------------!
333 
334 
335  USE euitm_schemas
336 
337  IMPLICIT NONE
338 
339 !! INTEGER :: NSLICE, ISLICE !number of slices and slice index
340  INTEGER :: nucl, inucl !number of NUCLEI (input)
341  INTEGER :: nion,iion !number of ion species (input)
342  INTEGER :: nimp, iimp !number of radial points (input)
343  INTEGER,ALLOCATABLE :: nzimp(:)
344  INTEGER :: ncomp(:), incomp
345  INTEGER :: nneut, ineut !number of neutrals species (input)
346  INTEGER, allocatable :: ntype(:),intype !number of impurity ionization states (input)
347 
348 
349  TYPE (type_compositionc), POINTER :: compositionc !CPO with sources
350 
351 
352 
353  ALLOCATE (compositionc)
354 
355  ALLOCATE(compositionc%compositions%nuclei(nucl))
356  ALLOCATE(compositionc%compositions%IONS(nion))
357  ALLOCATE(compositionc%compositions%IMPURITIES(nimp))
358  ALLOCATE(compositionc%compositions%NEUTRALSCOMP(nneut))
359 
360 
361 ! +++ Nuclei parameters:
362  do inucl=1, nucl
363  ALLOCATE(compositionc%compositions%nuclei(inucl)%label(inucl))
364  compositionc%compositions%nuclei(inucl)%zn = 0
365  compositionc%compositions%nuclei(inucl)%amn = 0
366 
367  enddo
368 
369 
370 
371 ! +++ Ions parameters:
372  do iion=1, nion
373  compositionc%compositions%IONS(iion)%nucindex = 0
374  compositionc%compositions%IONS(iion)%zion = 0
375  compositionc%compositions%IONS(iion)%imp_flag = 0
376 
377  enddo
378 
379 ! +++ Impurity parameters:
380  do iimp=1, nimp
381  ALLOCATE(compositionc%compositions%IMPURITIES(iimp)%label(nzimp(iimp)))
382 
383  compositionc%compositions%IMPURITIES(iimp)%nucindex = 0
384  compositionc%compositions%IMPURITIES(iimp)%i_ion = 0
385  compositionc%compositions%IMPURITIES(iimp)%nzimp = 0
386  compositionc%compositions%IMPURITIES(iimp)%zmin = 0
387 
388  enddo
389 
390 ! +++ Neutrals parameters:
391  do ineut=1, nneut
392 
393  ALLOCATE(compositionc%compositions%NEUTRALSCOMP(ineut)%TYPE(ntype(ineut)))
394  ALLOCATE(compositionc%compositions%NEUTRALSCOMP(nneut)%NEUTCOMP(ncomp(ineut)))
395 
396  ! COMPOSITIONC%compositions%NEUTRALSCOMP(INEUT)%TYPE(ntype(ineut)) = 0
397  ! COMPOSITIONC%compositions%NEUTRALSCOMP(INEUT)%NEUTCOMP(NCOMP(ineut)) = 0
398  ! COMPOSITIONC%compositions%NEUTRALSCOMP(INEUT)%NEUTCOMP(NCOMP(ineut))%multiplicity = 0
399 
400  enddo
401 
402 
403  RETURN
404 
405  END SUBROUTINE allocate_compositionc_cpo
406 
407 
408 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
409 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
410 
411 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
417 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
418  SUBROUTINE allocate_coreimpur_cpo (NSLICE, NRHO, NIMP, NZIMP, COREIMPUR)
419 
420 !-------------------------------------------------------!
421 ! !
422 ! This routine allocates COREIMPUR CPO !
423 ! !
424 !-------------------------------------------------------!
425 ! !
426 ! Source: --- !
427 ! Developers: D.Kalupin !
428 ! Kontacts: D.Kalupin@fz-juelich.de !
429 ! irena@ifpilm.waw.pl !
430 ! Comments: --- !
431 ! !
432 !-------------------------------------------------------!
433 
434 
435  USE euitm_schemas
436  USE itm_types
437 
438  IMPLICIT NONE
439 
440  INTEGER :: nslice, islice !number of slices and slice index
441  INTEGER :: nrho !number of radial points (input)
442  INTEGER :: nimp, iimp !number of ion species (input)
443  INTEGER, allocatable :: nzimp(:) !number of impurity ionization states (input)
444 
445  TYPE (type_coreimpur), POINTER :: coreimpur(:) !CPO with impurities
446 
447 
448 
449  ALLOCATE (coreimpur(nslice))
450 
451 
452  DO islice = 1,nslice
453 
454  ALLOCATE (coreimpur(islice)%rho_tor(nrho))
455  coreimpur(islice)%rho_tor(:) = 0.0_r8
456  ALLOCATE (coreimpur(islice)%desc_impur%amn(nimp))
457  coreimpur(islice)%desc_impur%amn(:) = 0.0_r8
458  ALLOCATE (coreimpur(islice)%desc_impur%nzimp(nimp))
459  coreimpur(islice)%desc_impur%nzimp(:) = 0
460  ALLOCATE (coreimpur(islice)%desc_impur%zn(nimp))
461  coreimpur(islice)%desc_impur%zn(:) = 0
462  ALLOCATE (coreimpur(islice)%desc_impur%zmin(nimp,maxval(nzimp)))
463  coreimpur(islice)%desc_impur%zmin(:,:) = 0
464  ALLOCATE (coreimpur(islice)%desc_impur%zmax(nimp,maxval(nzimp)))
465  coreimpur(islice)%desc_impur%zmax(:,:) = 0
466 
467  ALLOCATE (coreimpur(islice)%IMPURITY(nimp))
468 
469  do iimp=1, nimp
470  ALLOCATE (coreimpur(islice)%IMPURITY(iimp)%nz(nrho,nzimp(iimp)))
471  coreimpur(islice)%IMPURITY(iimp)%nz = 0.0_r8
472  ALLOCATE (coreimpur(islice)%IMPURITY(iimp)%flux%flux_dv(nrho,nzimp(iimp)))
473  coreimpur(islice)%IMPURITY(iimp)%flux%flux_dv = 0.0_r8
474  ALLOCATE (coreimpur(islice)%IMPURITY(iimp)%flux%flux_interp(nrho,nzimp(iimp)))
475  coreimpur(islice)%IMPURITY(iimp)%flux%flux_interp = 0.0_r8
476  ALLOCATE (coreimpur(islice)%IMPURITY(iimp)%z(nrho,nzimp(iimp)))
477  coreimpur(islice)%IMPURITY(iimp)%z = 0.0_r8
478  ALLOCATE (coreimpur(islice)%IMPURITY(iimp)%zsq(nrho,nzimp(iimp)))
479  coreimpur(islice)%IMPURITY(iimp)%zsq = 0.0_r8
480  ALLOCATE (coreimpur(islice)%IMPURITY(iimp)%boundary%value(3,nzimp(iimp)))
481  coreimpur(islice)%IMPURITY(iimp)%boundary%value = 0.0_r8
482  ALLOCATE (coreimpur(islice)%IMPURITY(iimp)%boundary%type(nzimp(iimp)))
483  coreimpur(islice)%IMPURITY(iimp)%boundary%type = 0
484  ALLOCATE (coreimpur(islice)%IMPURITY(iimp)%boundary%rho(nzimp(iimp)))
485  coreimpur(islice)%IMPURITY(iimp)%boundary%rho = 0.0_r8
486  ALLOCATE (coreimpur(islice)%IMPURITY(iimp)%transp_coef%diff(nrho,nzimp(iimp)))
487  coreimpur(islice)%IMPURITY(iimp)%transp_coef%diff = 0.0_r8
488  ALLOCATE (coreimpur(islice)%IMPURITY(iimp)%transp_coef%vconv(nrho,nzimp(iimp)))
489  coreimpur(islice)%IMPURITY(iimp)%transp_coef%vconv = 0.0_r8
490  ALLOCATE (coreimpur(islice)%IMPURITY(iimp)%source_term%value(nrho,nzimp(iimp)))
491  coreimpur(islice)%IMPURITY(iimp)%source_term%value = 0.0_r8
492  enddo
493 
494 
495  END DO
496 
497  RETURN
498 
499  END SUBROUTINE allocate_coreimpur_cpo
500 
501 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
502 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
503 
504 ! irena the change for neutrals
505 
506 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
507 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
508 
509  SUBROUTINE allocate_coreneutrals_cpo (NSLICE, NRHO, NATM, NNEUT, NTYPE, NCOMP, CORENEUTRALS)
510 
511 !-------------------------------------------------------!
512 ! !
513 ! This routine allocates CORENEUTRALS CPO !
514 ! !
515 !-------------------------------------------------------!
516 ! !
517 ! Source: --- !
518 ! Developers: I.Ivanova-Stanik,R.Stankiewicz !
519 ! Kontacts: irena@ifpilm.waw.pl !
520 ! romsta@ifpilm.waw.pl !
521 ! !
522 ! Comments: --- !
523 ! !
524 !-------------------------------------------------------!
525 
526 
527  USE euitm_schemas
528  USE itm_types
529 
530  IMPLICIT NONE
531 
532  INTEGER :: nslice, islice !number of slices and slice index
533  INTEGER :: nrho !number of radial points (input)
534  INTEGER :: natm, iatm !number of atoms (input)
535  INTEGER :: nneut, ineut !number of neutrals species (input)
536  INTEGER, allocatable :: ntype(:) !number of impurity ionization states (input)
537  INTEGER, allocatable :: ncomp(:) !number of distinct atoms enter the composition-"1" wich is neutral
538  INTEGER :: icomp, itype
539 
540  TYPE (type_coreneutrals), POINTER :: coreneutrals(:) !CPO with impurities
541 
542 
543 
544  ALLOCATE (coreneutrals(nslice))
545 
546 
547  DO islice = 1,nslice
548 
549  ALLOCATE (coreneutrals(islice)%rho_tor(nrho))
550  coreneutrals(islice)%rho_tor(:) = 0.0_r8
551  ALLOCATE (coreneutrals(islice)%rho_tor_norm(nrho))
552  coreneutrals(islice)%rho_tor_norm(:) = 0.0_r8
553 
554  if(natm.gt.0) then
555  ALLOCATE (coreneutrals(islice)%neutcompo%atomlist(natm))
556  do iatm = 1, natm
557  coreneutrals(islice)%neutcompo%atomlist(iatm)%amn = 0.0_r8
558  coreneutrals(islice)%neutcompo%atomlist(iatm)%zn = 0.0_r8
559  enddo
560  endif
561  if(nneut.gt.0) then
562  ALLOCATE (coreneutrals(islice)%neutcompo%neutral(nneut))
563  allocate (coreneutrals(islice)%profiles(nneut))
564  do ineut = 1, nneut
565  ALLOCATE (coreneutrals(islice)%neutcompo%neutral(ineut)%neutcomp(ncomp(ineut)))
566  do icomp = 1, ncomp(ineut)
567  coreneutrals(islice)%neutcompo%neutral(ineut)%neutcomp(ineut)%nucindex = 0
568  coreneutrals(islice)%neutcompo%neutral(ineut)%neutcomp(icomp)%multiplicity = 0
569  enddo
570  ALLOCATE (coreneutrals(islice)%neutcompo%neutral(ineut)%type(ntype(ineut)))
571  allocate (coreneutrals(islice)%profiles(ineut)%neutraltype(ntype(ineut)))
572  do itype = 1, ntype(ineut)
573  coreneutrals(islice)%neutcompo%neutral(ineut)%type(itype)%flag = 0
574  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%n0%value(nrho))
575  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%n0%value(:) = 0.0_r8
576  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%n0%flux(nrho))
577  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%n0%flux(:) = 0.0_r8
578  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%n0%boundary%value(3))
579  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%n0%boundary%value(:) = 0.0_r8
580  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%n0%boundary%type = 0
581  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%n0%boundary%rho_tor = 0.0_r8
582  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%t0%value(nrho))
583  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%t0%value(:) = 0.0_r8
584  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%t0%flux(nrho))
585  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%t0%flux(:) = 0.0_r8
586  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%t0%boundary%value(3))
587  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%t0%boundary%value(:) = 0.0_r8
588  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%t0%boundary%type = 0
589  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%t0%boundary%rho_tor = 0.0_r8
590  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%toroidal%value(nrho))
591  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%toroidal%value(:) = 0.0_r8
592  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%toroidal%boundary%value(3))
593  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%toroidal%boundary%value(:) = 0.0_r8
594  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%toroidal%boundary%type = 0
595  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%toroidal%boundary%rho_tor = 0.0_r8
596  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%poloidal%value(nrho))
597  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%poloidal%value(:) = 0.0_r8
598  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%poloidal%boundary%value(3))
599  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%poloidal%boundary%value(:) = 0.0_r8
600  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%poloidal%boundary%type = 0
601  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%poloidal%boundary%rho_tor = 0.0_r8
602  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%radial%value(nrho))
603  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%radial%value(:) = 0.0_r8
604  ALLOCATE (coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%radial%boundary%value(3))
605  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%radial%boundary%value(:) = 0.0_r8
606  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%radial%boundary%type = 0
607  coreneutrals(islice)%profiles(ineut)%neutraltype(itype)%v0%radial%boundary%rho_tor = 0.0_r8
608  enddo
609  enddo
610  endif
611  END DO
612 
613  RETURN
614 
615  END SUBROUTINE allocate_coreneutrals_cpo
616 
617 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
618 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
619 
620 
621 
622 
623 
624 
625 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
626 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
627 
628  SUBROUTINE allocate_equilibrium_cpo (NSLICE, NRHO, EQUILIBRIUM)
629 
630 !-------------------------------------------------------!
631 ! !
632 ! This routine allocates EQUILIBRIUM CPO !
633 ! !
634 !-------------------------------------------------------!
635 ! !
636 ! Source: --- !
637 ! Developers: D.Kalupin !
638 ! Kontacts: D.Kalupin@fz-juelich.de !
639 ! !
640 ! Comments: --- !
641 ! !
642 !-------------------------------------------------------!
643 
644 
645  USE euitm_schemas
646 
647  IMPLICIT NONE
648 
649  INTEGER :: nslice, islice !number of slices and slice index
650  INTEGER :: nrho !number of radial points (input)
651  INTEGER :: ntheta=101 !number of poloidal points
652 
653  TYPE (type_equilibrium), POINTER :: equilibrium(:) !CPO with geometry quantities
654 
655 
656 
657  ALLOCATE (equilibrium(nslice))
658 
659 
660  DO islice = 1,nslice
661 
662 ! +++ Equilibrium quantities:
663  ALLOCATE (equilibrium(islice)%profiles_1d%rho_tor(nrho))
664  ALLOCATE (equilibrium(islice)%profiles_1d%q(nrho))
665  ALLOCATE (equilibrium(islice)%profiles_1d%pressure(nrho))
666  ALLOCATE (equilibrium(islice)%profiles_1d%jparallel(nrho))
667  ALLOCATE (equilibrium(islice)%profiles_1d%jphi(nrho))
668 
669  ALLOCATE (equilibrium(islice)%profiles_1d%gm1(nrho))
670  ALLOCATE (equilibrium(islice)%profiles_1d%gm2(nrho))
671  ALLOCATE (equilibrium(islice)%profiles_1d%gm3(nrho))
672  ALLOCATE (equilibrium(islice)%profiles_1d%gm4(nrho))
673  ALLOCATE (equilibrium(islice)%profiles_1d%gm5(nrho))
674  ALLOCATE (equilibrium(islice)%profiles_1d%gm6(nrho))
675  ALLOCATE (equilibrium(islice)%profiles_1d%gm7(nrho))
676  ALLOCATE (equilibrium(islice)%profiles_1d%gm8(nrho))
677  ALLOCATE (equilibrium(islice)%profiles_1d%gm9(nrho))
678 
679  ALLOCATE (equilibrium(islice)%profiles_1d%volume(nrho))
680  ALLOCATE (equilibrium(islice)%profiles_1d%vprime(nrho))
681  ALLOCATE (equilibrium(islice)%profiles_1d%area(nrho))
682  ALLOCATE (equilibrium(islice)%profiles_1d%aprime(nrho))
683  ALLOCATE (equilibrium(islice)%profiles_1d%F_dia(nrho))
684  ALLOCATE (equilibrium(islice)%profiles_1d%pprime(nrho))
685  ALLOCATE (equilibrium(islice)%profiles_1d%ffprime(nrho))
686 
687  ALLOCATE (equilibrium(islice)%profiles_1d%elongation(nrho))
688  ALLOCATE (equilibrium(islice)%profiles_1d%tria_upper(nrho))
689  ALLOCATE (equilibrium(islice)%profiles_1d%tria_lower(nrho))
690  ALLOCATE (equilibrium(islice)%profiles_1d%r_inboard(nrho))
691  ALLOCATE (equilibrium(islice)%profiles_1d%r_outboard(nrho))
692  ALLOCATE (equilibrium(islice)%profiles_1d%dpsidrho_tor(nrho))
693  ALLOCATE (equilibrium(islice)%profiles_1d%beta_pol(nrho))
694  ALLOCATE (equilibrium(islice)%profiles_1d%li(nrho))
695  ALLOCATE (equilibrium(islice)%profiles_1d%dvdrho(nrho))
696  ALLOCATE (equilibrium(islice)%profiles_1d%surface(nrho))
697  ALLOCATE (equilibrium(islice)%profiles_1d%ftrap(nrho))
698  ALLOCATE (equilibrium(islice)%profiles_1d%b_av(nrho))
699  ALLOCATE (equilibrium(islice)%profiles_1d%b_min(nrho))
700  ALLOCATE (equilibrium(islice)%profiles_1d%b_max(nrho))
701 
702  ALLOCATE (equilibrium(islice)%profiles_1d%phi(nrho))
703  ALLOCATE (equilibrium(islice)%profiles_1d%psi(nrho))
704  ALLOCATE (equilibrium(islice)%profiles_1d%rho_vol(nrho))
705 
706  allocate(equilibrium(1)%coord_sys%position%R(nrho, ntheta))
707  allocate(equilibrium(1)%coord_sys%position%Z(nrho, ntheta))
708 
709  allocate(equilibrium(1)%eqgeometry%boundary(1))
710  allocate(equilibrium(1)%eqgeometry%boundary(1)%r(ntheta)) ! -1 bug in helena
711  allocate(equilibrium(1)%eqgeometry%boundary(1)%z(ntheta)) ! -1 bug in helena
712 
713  END DO
714 
715  RETURN
716 
717  END SUBROUTINE allocate_equilibrium_cpo
718 
719 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
720 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
721 
722 
723 
724 
725 
726 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
727 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
728 
729  SUBROUTINE allocate_toroidfield_cpo (NSLICE, TOROIDFIELD)
730 
731 !-------------------------------------------------------!
732 ! !
733 ! This routine allocates TOROIDFIELD CPO !
734 ! !
735 !-------------------------------------------------------!
736 ! !
737 ! Source: --- !
738 ! Developers: D.Kalupin !
739 ! Kontacts: D.Kalupin@fz-juelich.de !
740 ! !
741 ! Comments: --- !
742 ! !
743 !-------------------------------------------------------!
744 
745 
746  USE euitm_schemas
747 
748  IMPLICIT NONE
749 
750  INTEGER :: nslice, islice !number of slices and slice index
751 
752  TYPE (type_toroidfield), POINTER :: toroidfield(:) !CPO with geometry quantities
753 
754 
755 
756  ALLOCATE (toroidfield(nslice))
757 
758 
759  RETURN
760 
761  END SUBROUTINE allocate_toroidfield_cpo
762 
763 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
764 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
765 
766 
767 
768 
769 
770 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
771 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
subroutine allocate_coreimpur_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COREIMPUR)
This routine allocates COREIMPUR CPO.
subroutine allocate_coreprof_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COREPROF)
This routine allocates COREPROF 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_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.