27 TYPE (type_coreprof
),
POINTER :: coreprof(:)
28 TYPE (type_coreimpur
),
POINTER :: coreimpur(:)
29 TYPE (type_compositionc
),
POINTER :: compositionc(:)
33 REAL (R8),
ALLOCATABLE :: amn(:)
34 REAL (R8),
ALLOCATABLE :: zn(:)
35 INTEGER,
ALLOCATABLE :: nucindex(:)
36 INTEGER,
ALLOCATABLE :: nzimp(:)
37 INTEGER,
ALLOCATABLE :: ncomp(:)
38 INTEGER,
ALLOCATABLE :: ntype(:)
43 INTEGER :: iimp, izimp
45 ALLOCATE (amn(param%NIMP))
46 ALLOCATE (zn(param%NIMP))
47 ALLOCATE (nucindex(param%NIMP))
48 ALLOCATE (nzimp(param%NIMP))
51 DO iimp = 1,param%NIMP
52 IF (param%AMN_IMP(iimp).GT.0._r8.AND.param%ZN_IMP(iimp).GT.0._r8)
THEN
55 IF (abs(amn(inucl)-param%AMN_IMP(iimp)) .LE. 0.25 .AND. &
56 abs(zn(inucl)-param%ZN_IMP(iimp)) .LE. 0.25)
THEN
57 nucindex(iimp) = inucl
63 amn(nnucl) = param%AMN_IMP(iimp)
64 zn(nnucl) = param%ZN_IMP(iimp)
65 nucindex(iimp) = nnucl
68 IF (trim(adjustl(param%ISTATE(iimp))).EQ.
"all")
THEN
69 nzimp(iimp) = maxval(param%Z_IMP(iimp,:))
75 nrho =
SIZE(coreprof(1)%rho_tor)
81 coreimpur(1)%compositions%NUCLEI(inucl)%zn = zn(inucl)
82 coreimpur(1)%compositions%NUCLEI(inucl)%amn = amn(inucl)
83 coreimpur(1)%compositions%NUCLEI(inucl)%label =
" "
88 DO iimp = 1, param%NIMP
89 coreimpur(1)%compositions%IMPURITIES(iimp)%nucindex = nucindex(iimp)
90 coreimpur(1)%compositions%IMPURITIES(iimp)%nzimp = nzimp(iimp)
91 IF (trim(adjustl(param%ISTATE(iimp))).EQ.
"all")
THEN
92 DO izimp = 1, nzimp(iimp)
93 coreimpur(1)%compositions%IMPURITIES(iimp)%zmin(izimp) = izimp
94 coreimpur(1)%compositions%IMPURITIES(iimp)%zmax(izimp) = izimp
95 coreimpur(1)%IMPURITY(iimp)%z(:,izimp) = izimp
96 coreimpur(1)%IMPURITY(iimp)%zsq(:,izimp) = izimp**2
97 coreimpur(1)%compositions%IMPURITIES(iimp)%label(izimp) =
" "
100 coreimpur(1)%compositions%IMPURITIES(iimp)%zmin(:) = maxval(param%Z_IMP(iimp,:))
101 coreimpur(1)%compositions%IMPURITIES(iimp)%zmax(:) = maxval(param%Z_IMP(iimp,:))
102 coreimpur(1)%IMPURITY(iimp)%z(:,:) = maxval(param%Z_IMP(iimp,:))
103 coreimpur(1)%IMPURITY(iimp)%zsq(:,:) = maxval(param%Z_IMP(iimp,:))**2
104 coreimpur(1)%compositions%IMPURITIES(iimp)%label(:) =
" "
110 coreimpur(1)%rho_tor = coreprof(1)%rho_tor
111 coreimpur(1)%rho_tor_norm = coreprof(1)%rho_tor_norm
131 TYPE (type_coreimpur
),
POINTER :: coreimpur(:)
135 INTEGER :: iimp, izimp
137 DO izimp = 1,
SIZE(coreimpur(1)%IMPURITY(iimp)%nz, dim=2)
138 coreimpur(1)%IMPURITY(iimp)%nz(:,izimp) = param%DENS(iimp,izimp)
140 coreimpur(1)%IMPURITY(iimp)%boundary%type(izimp) = 0
142 coreimpur(1)%IMPURITY(iimp)%boundary%value(1,izimp) = param%DENS(iimp,izimp)
143 coreimpur(1)%IMPURITY(iimp)%boundary%value(2,izimp) = 0.0_r8
144 coreimpur(1)%IMPURITY(iimp)%boundary%value(3,izimp) = 0.0_r8
146 IF (param%DENS(iimp,izimp).LE.0.0_r8.OR.param%DENS(iimp,izimp).GT.1.e30_r8)
THEN
147 diag%ERROR_MESSAGE = trim(adjustl(diag%ERROR_MESSAGE))//
" your settings for density might be wrong."
148 diag%IERR = diag%IERR+1
170 TYPE (type_coreprof
),
POINTER :: coreprof(:)
171 TYPE (type_coreimpur
),
POINTER :: coreimpur(:)
175 INTEGER :: iimp, izimp, iion, inucl
177 REAL (R8),
ALLOCATABLE :: prof(:)
179 ALLOCATE (prof(
SIZE(coreprof(1)%rho_tor)))
183 IF (param%PROF_SOURCE(iimp).EQ.
"electrons")
THEN
184 prof = coreprof(1)%ne%value
186 ELSE IF (param%PROF_SOURCE(iimp).EQ.
"selected_ion")
THEN
187 DO iion = 1,
SIZE(coreprof(1)%ni%value, dim=2)
188 inucl= coreprof(1)%COMPOSITIONS%IONS(iion)%nucindex
189 IF (inucl.LE.0 .OR. inucl.GT.
SIZE(coreprof(1)%COMPOSITIONS%NUCLEI)) goto 5
192 (abs(coreprof(1)%COMPOSITIONS%NUCLEI(inucl)%amn - param%AMN_ION(iimp)) .LE. 0.25_r8 .AND. &
193 abs(coreprof(1)%COMPOSITIONS%NUCLEI(inucl)%zn - param%ZN_ION(iimp) ) .LE. 0.25_r8 .AND. &
194 abs(coreprof(1)%COMPOSITIONS%IONS(iion)%zion - param%Z_ION(iimp)) .LE. 0.25_r8)
THEN
195 prof(:) = coreprof(1)%ni%value(:,iion)
201 ELSE IF (param%PROF_SOURCE(iimp).EQ.
"ions_total")
THEN
202 DO iion = 1,
SIZE(coreprof(1)%ni%value, dim=2)
203 prof(:) = prof(:)+coreprof(1)%ni%value(:,iion)
207 DO izimp = 1,
SIZE(coreimpur(1)%IMPURITY(iimp)%nz, dim=2)
208 coreimpur(1)%IMPURITY(iimp)%nz(:,izimp) = prof(:)*param%FRA(iimp,izimp)
210 coreimpur(1)%IMPURITY(iimp)%boundary%type(izimp) = 0
212 coreimpur(1)%IMPURITY(iimp)%boundary%value(1,izimp) = prof(
SIZE(prof))*param%FRA(iimp,izimp)
213 coreimpur(1)%IMPURITY(iimp)%boundary%value(2,izimp) = 0.0_r8
214 coreimpur(1)%IMPURITY(iimp)%boundary%value(3,izimp) = 0.0_r8
216 IF (param%FRA(iimp,izimp).LE.0.0_r8.OR.param%FRA(iimp,izimp).GT.1000_r8)
THEN
217 diag%ERROR_MESSAGE = trim(adjustl(diag%ERROR_MESSAGE))//
" your settings for fractions might be wrong."
218 diag%IERR = diag%IERR+1
242 TYPE (type_coreprof
),
POINTER :: coreprof(:)
243 TYPE (type_coreimpur
),
POINTER :: coreimpur(:)
247 INTEGER :: iimp, izimp, nzimp, irho, nrho
248 REAL (R8),
ALLOCATABLE :: ne(:), te(:), n_impurity(:,:)
250 nrho =
SIZE(coreimpur(1)%rho_tor)
251 nzimp= int(param%ZN_IMP(iimp))
254 ALLOCATE (n_impurity(nrho,nzimp))
256 ne = coreprof(1)%ne%value
257 te = coreprof(1)%te%value
259 CALL
coronal_distribution(nrho, ne, te, param%AMN_IMP(iimp), param%ZN_IMP(iimp), nzimp, n_impurity)
263 IF (n_impurity(nrho,izimp).LE.1.0d-200) n_impurity(nrho,izimp) = 0._r8
268 coreimpur(1)%IMPURITY(iimp)%nz(:,izimp) = n_impurity(:,izimp)*param%DENS(iimp,1)
270 coreimpur(1)%IMPURITY(iimp)%boundary%type(izimp) = 0
272 coreimpur(1)%IMPURITY(iimp)%boundary%value(1,izimp) = n_impurity(nrho,izimp)*param%DENS(iimp,1)
273 coreimpur(1)%IMPURITY(iimp)%boundary%value(2,izimp) = 0.0_r8
274 coreimpur(1)%IMPURITY(iimp)%boundary%value(3,izimp) = 0.0_r8
280 DEALLOCATE (n_impurity)
subroutine allocate_coreimpur_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COREIMPUR)
This routine allocates COREIMPUR CPO.
subroutine coronal_distribution(NRHO, NE, TE, AMN, ZN, NZIMP1, N_IMPURITY)
This module contains routines for allocation/deallocation if CPOs used in ETS.
The module declares types of variables used in ETS (transport code)