1 SUBROUTINE fc2k_imp4dv(EQUILIBRIUM, COREPROF, CORETRANSP_IN, CORETRANSP_OUT)
8 USE deallocate_structures
13 TYPE (type_equilibrium
),
POINTER :: equilibrium(:)
14 TYPE (type_coreprof
),
POINTER :: coreprof(:)
15 TYPE (type_coretransp
),
POINTER :: coretransp_in(:)
16 TYPE (type_coretransp
),
POINTER :: coretransp_out(:)
19 INTEGER :: npsi, nrho_prof
21 INTEGER,
PARAMETER :: nslice = 1
26 INTEGER,
ALLOCATABLE :: nzimp(:)
28 INTEGER,
ALLOCATABLE :: ncomp(:)
29 INTEGER,
ALLOCATABLE :: ntype(:)
36 REAL(R8) :: a00,b00,r00,rho_tor_max
38 REAL(R8) :: nni,tti,rlni,rlti,llni,llti
39 REAL(R8) :: ffi,ggi,diffi,chii,vconvi,yconvi
41 REAL(R8) :: nne,tte,rlne,rlte,llne,llte
42 REAL(R8) :: ffe,gge,diffe,chie,vconve,yconve
44 REAL(R8),
ALLOCATABLE :: gm3(:),gm7(:)
46 REAL(R8),
ALLOCATABLE :: rltix(:,:),ffix(:,:), ggix(:,:)
47 REAL(R8),
ALLOCATABLE :: nnix(:,:), ttix(:,:), rlnix(:,:)
49 REAL(R8),
ALLOCATABLE :: rltex(:), ffex(:), ggex(:)
50 REAL(R8),
ALLOCATABLE :: nnex(:), ttex(:), rlnex(:)
52 REAL(R8),
ALLOCATABLE :: rho_prof(:), rho_transp(:)
58 npsi =
SIZE(equilibrium(1)%profiles_1d%rho_tor)
59 nrho_prof =
SIZE(coreprof(1)%rho_tor)
60 nrho =
SIZE(coretransp_in(1)%VALUES(1)%rho_tor)
64 CALL
get_comp_dimensions(coretransp_in(1)%COMPOSITIONS, nnucl, nion, nimp, nzimp, nneut, ntype, ncomp)
66 call deallocate_cpo(coretransp_out(1)%COMPOSITIONS)
67 CALL copy_cpo(coretransp_in(1)%COMPOSITIONS, coretransp_out(1)%COMPOSITIONS)
74 ALLOCATE (rho_prof(nrho_prof))
75 ALLOCATE (rho_transp(nrho))
77 ALLOCATE ( nnix(nrho,nion))
78 ALLOCATE ( ttix(nrho,nion))
79 ALLOCATE (rlnix(nrho,nion))
80 ALLOCATE (rltix(nrho,nion))
81 ALLOCATE ( ffix(nrho,nion))
82 ALLOCATE ( ggix(nrho,nion))
84 ALLOCATE ( nnex(nrho))
85 ALLOCATE ( ttex(nrho))
86 ALLOCATE (rlnex(nrho))
87 ALLOCATE (rltex(nrho))
88 ALLOCATE ( ffex(nrho))
89 ALLOCATE ( ggex(nrho))
92 rho_prof = coreprof(1)%rho_tor
93 rho_transp = coretransp_in(1)%VALUES(1)%rho_tor
114 r00 = equilibrium(1)%global_param%toroid_field%r0
116 IF (
ASSOCIATED(equilibrium(1)%profiles_1d%gm3))
THEN
117 CALL
l3interp( equilibrium(1)%profiles_1d%gm3, equilibrium(1)%profiles_1d%rho_tor, npsi, &
118 gm3, rho_transp, nrho)
123 IF (
ASSOCIATED(equilibrium(1)%profiles_1d%gm7))
THEN
124 CALL
l3interp( equilibrium(1)%profiles_1d%gm7, equilibrium(1)%profiles_1d%rho_tor, npsi, &
125 gm7, rho_transp, nrho)
133 CALL
l3interp( coreprof(1)%ne%value, rho_prof, nrho_prof, &
134 nnex, rho_transp, nrho)
135 CALL
l3interp( coreprof(1)%te%value, rho_prof, nrho_prof, &
136 ttex, rho_transp, nrho)
137 CALL
l3deriv( coreprof(1)%ne%value, rho_prof, nrho_prof, &
138 rlnex, rho_transp, nrho)
139 CALL
l3deriv( coreprof(1)%te%value, rho_prof, nrho_prof, &
140 rltex, rho_transp, nrho)
142 ffex = coretransp_in(1)%VALUES(1)%ne_transp%flux
143 ggex = coretransp_in(1)%VALUES(1)%te_transp%flux
148 CALL
l3interp( coreprof(1)%ni%value(:,ion), rho_prof, nrho_prof, &
149 nnix(:,ion), rho_transp, nrho)
150 CALL
l3interp( coreprof(1)%ti%value(:,ion), rho_prof, nrho_prof, &
151 ttix(:,ion), rho_transp, nrho)
152 CALL
l3deriv( coreprof(1)%ni%value(:,ion), rho_prof, nrho_prof, &
153 rlnix(:,ion), rho_transp, nrho)
154 CALL
l3deriv( coreprof(1)%ti%value(:,ion), rho_prof, nrho_prof, &
155 rltix(:,ion), rho_transp, nrho)
157 ffix(:,ion) = coretransp_in(1)%VALUES(1)%ni_transp%flux(:,ion)
158 ggix(:,ion) = coretransp_in(1)%VALUES(1)%ti_transp%flux(:,ion)
173 gge = ggex(i)/(nne*itm_ev*tte)
175 llne = 1./max(1./r00, abs(rlne))
176 llte = 1./max(1./r00, abs(rlte))
178 diffe = abs(ffe)*llne
181 diffe = max(diffe, 0.2_r8*chie)
182 chie = max(chie, 0.2_r8*diffe)
184 vconve = ffe - diffe*rlne
185 yconve = gge - chie*rlte
190 vconve = vconve/gm7(i)
191 yconve = yconve/gm7(i)
193 coretransp_out(1)%VALUES(1)%ne_transp%diff_eff(i,2) = diffe
194 coretransp_out(1)%VALUES(1)%te_transp%diff_eff(i) = chie
195 coretransp_out(1)%VALUES(1)%ne_transp%vconv_eff(i,2) = vconve
196 coretransp_out(1)%VALUES(1)%te_transp%vconv_eff(i) = yconve
203 rlni =-rlnix(i,ion)/nni
204 rlti =-rltix(i,ion)/tti
205 ffi = ffix(i,ion)/nni
206 ggi = ggix(i,ion)/(nni*itm_ev*tti)
208 llni = 1./max(1./r00, abs(rlni))
209 llti = 1./max(1./r00, abs(rlti))
211 diffi = abs(ffi)*llni
214 diffi = max(diffi, 0.2_r8*chii)
215 chii = max(chii, 0.2_r8*diffi)
217 vconvi = ffi - diffi*rlni
218 yconvi = ggi - chii*rlti
223 vconvi = vconvi/gm7(i)
224 yconvi = yconvi/gm7(i)
226 coretransp_out(1)%VALUES(1)%ni_transp%diff_eff(i,ion,2) = diffi
227 coretransp_out(1)%VALUES(1)%ti_transp%diff_eff(i,ion) = chii
228 coretransp_out(1)%VALUES(1)%ni_transp%vconv_eff(i,ion,2) = vconvi
229 coretransp_out(1)%VALUES(1)%ti_transp%vconv_eff(i,ion) = yconvi
239 coretransp_out(1)%time = coretransp_in(1)%time
240 coretransp_out(1)%VALUES(1)%rho_tor = rho_transp
241 coretransp_out(1)%VALUES(1)%rho_tor_norm = rho_transp/rho_transp(nrho)
264 DEALLOCATE(rho_transp)
subroutine l3deriv(y_in, x_in, nr_in, dydx_out, x_out, nr_out)
subroutine get_comp_dimensions(COMPOSITIONS, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP)
subroutine l3interp(y_in, x_in, nr_in, y_out, x_out, nr_out)
This module contains routines for allocation/deallocation if CPOs used in ETS.
subroutine fc2k_imp4dv(EQUILIBRIUM, COREPROF, CORETRANSP_IN, CORETRANSP_OUT)
subroutine allocate_coretransp_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, CORETRANSP)
This routine allocates CORETRANSP CPO.