27 equilibrium,coreprof_analytic,coretransp,coresource,coreimpur, code_parameters)
54 use deallocate_structures
60 INTEGER,
SAVE :: shot_no
61 INTEGER,
SAVE :: run_no
64 INTEGER,
SAVE :: nnucl
65 INTEGER,
SAVE :: nneut
68 INTEGER,
ALLOCATABLE,
SAVE :: nzimp(:)
69 INTEGER,
ALLOCATABLE,
SAVE :: ncomp(:)
70 INTEGER,
ALLOCATABLE,
SAVE :: ntype(:)
71 INTEGER,
SAVE :: npoints
72 INTEGER,
SAVE :: ntime
73 INTEGER,
PARAMETER :: nocur = 1
80 INTEGER,
SAVE :: solver_type
82 INTEGER,
SAVE :: sigma_source
85 REAL (R8),
SAVE :: convrec
87 REAL (R8),
SAVE :: tau
88 REAL (R8),
SAVE :: amix
90 INTEGER,
PARAMETER :: maxiter=1000
92 INTEGER,
SAVE :: psi_bnd_type
93 INTEGER,
SAVE :: ni_bnd_type
94 INTEGER,
SAVE :: ti_bnd_type
95 INTEGER,
SAVE :: te_bnd_type
96 INTEGER,
SAVE :: vtor_bnd_type
104 TYPE (type_equilibrium
),
POINTER :: equilibrium(:)
105 TYPE (type_coreprof
),
POINTER :: coreprof_in(:)
106 TYPE (type_coreprof
),
POINTER :: coreprof_analytic(:)
107 TYPE (type_coretransp
),
POINTER :: coretransp(:)
108 TYPE (type_coresource
),
POINTER :: coresource(:)
109 TYPE (type_coreimpur
),
POINTER :: coreimpur(:)
110 TYPE (type_param
) :: code_parameters
120 CHARACTER (len=32) :: database_format
122 LOGICAL,
SAVE :: first=.true.
131 IF (.NOT.
ASSOCIATED(code_parameters%parameters))
THEN
132 WRITE(6, *)
'ERROR: code parameters not associated!'
135 CALL
process_xml(solver_type,sigma_source,tau,amix,convrec,nrho,nion,nimp,nzimp,ntime,nsol, &
136 psi_bnd_type,ni_bnd_type,ti_bnd_type,te_bnd_type,vtor_bnd_type, &
137 shot_no, run_no, code_parameters, database_format)
144 if(.not.
allocated(ntype))
ALLOCATE (ntype(nneut))
145 if(.not.
allocated(ncomp))
ALLOCATE (ncomp(nneut))
151 CALL
allocate_coreprof_cpo(nocur, nrho, nnucl, nion, nimp, nzimp, nneut, ntype, ncomp, coreprof_analytic )
159 CALL
copy_codeparam(coreprof_in(1)%codeparam, coreprof_analytic(1)%codeparam)
160 call deallocate_cpo(coreprof_analytic(1)%COMPOSITIONS)
161 CALL copy_cpo(coreprof_in(1)%COMPOSITIONS, coreprof_analytic(1)%COMPOSITIONS)
162 call deallocate_cpo(coretransp(1)%COMPOSITIONS)
163 CALL copy_cpo(coreprof_in(1)%COMPOSITIONS, coretransp(1)%COMPOSITIONS)
164 call deallocate_cpo(coresource(1)%COMPOSITIONS)
165 CALL copy_cpo(coreprof_in(1)%COMPOSITIONS, coresource(1)%COMPOSITIONS)
169 CALL
set_cpo(nrho,nion,nimp,nzimp,ntime,nsol, &
170 psi_bnd_type,ni_bnd_type,ti_bnd_type,te_bnd_type,vtor_bnd_type, &
171 equilibrium, coreprof_in, coretransp)
190 CALL
analytics_full(time, geometry1, profiles1, transport1, sources1)
196 equilibrium, coreprof_analytic, coretransp, coresource)
206 WRITE(6,*)
'EQUILIBRIUM'
207 IF(.NOT.
ASSOCIATED(equilibrium(1)%codeparam%codename))
THEN
208 ALLOCATE(equilibrium(1)%codeparam%codename(1))
209 equilibrium(1)%codeparam%codename(1) =
'ANALYTIC_SOLVER_TEST'
211 IF(.NOT.
ASSOCIATED(equilibrium(1)%codeparam%codeversion))
THEN
212 ALLOCATE(equilibrium(1)%codeparam%codeversion(1))
213 equilibrium(1)%codeparam%codeversion(1) =
'?'
215 IF(.NOT.
ASSOCIATED(equilibrium(1)%codeparam%parameters))
THEN
216 ALLOCATE(equilibrium(1)%codeparam%parameters(1))
217 equilibrium(1)%codeparam%parameters(1) =
'my_code_specific_parameters'
219 IF(.NOT.
ASSOCIATED(equilibrium(1)%codeparam%output_diag))
THEN
220 ALLOCATE(equilibrium(1)%codeparam%output_diag(1))
221 equilibrium(1)%codeparam%output_diag(1) =
'my_output_diag'
223 equilibrium(1)%codeparam%output_flag = 0
224 equilibrium(1)%time=time
226 WRITE(6,*)
'COREPROF_ANALYTIC'
227 IF(.NOT.
ASSOCIATED(coreprof_analytic(1)%codeparam%codename))
THEN
228 ALLOCATE(coreprof_analytic(1)%codeparam%codename(1))
229 coreprof_analytic(1)%codeparam%codename(1) =
'ANALYTIC_SOLVER_TEST'
231 IF(.NOT.
ASSOCIATED(coreprof_analytic(1)%codeparam%codeversion))
THEN
232 ALLOCATE(coreprof_analytic(1)%codeparam%codeversion(1))
233 coreprof_analytic(1)%codeparam%codeversion(1) =
'?'
235 IF(.NOT.
ASSOCIATED(coreprof_analytic(1)%codeparam%parameters))
THEN
236 ALLOCATE(coreprof_analytic(1)%codeparam%parameters(1))
237 coreprof_analytic(1)%codeparam%parameters(1) =
'my_code_specific_parameters'
239 IF(.NOT.
ASSOCIATED(coreprof_analytic(1)%codeparam%output_diag))
THEN
240 ALLOCATE(coreprof_analytic(1)%codeparam%output_diag(1))
241 coreprof_analytic(1)%codeparam%output_diag(1) =
'my_output_diag'
243 coreprof_analytic(1)%codeparam%output_flag = 0
244 coreprof_analytic(1)%time=time
246 WRITE(6,*)
'CORETRANSP'
247 IF(.NOT.
ASSOCIATED(coretransp(1)%codeparam%codename))
THEN
248 ALLOCATE(coretransp(1)%codeparam%codename(1))
249 coretransp(1)%codeparam%codename(1) =
'ANALYTIC_SOLVER_TEST'
251 IF(.NOT.
ASSOCIATED(coretransp(1)%codeparam%codeversion))
THEN
252 ALLOCATE(coretransp(1)%codeparam%codeversion(1))
253 coretransp(1)%codeparam%codeversion(1) =
'?'
255 IF(.NOT.
ASSOCIATED(coretransp(1)%codeparam%parameters))
THEN
256 ALLOCATE(coretransp(1)%codeparam%parameters(1))
257 coretransp(1)%codeparam%parameters(1) =
'my_code_specific_parameters'
259 IF(.NOT.
ASSOCIATED(coretransp(1)%codeparam%output_diag))
THEN
260 ALLOCATE(coretransp(1)%codeparam%output_diag(1))
261 coretransp(1)%codeparam%output_diag(1) =
'my_output_diag'
263 coretransp(1)%codeparam%output_flag = 0
264 coretransp(1)%time=time
266 WRITE(6,*)
'CORESOURCE'
267 IF(.NOT.
ASSOCIATED(coresource(1)%codeparam%codename))
THEN
268 ALLOCATE(coresource(1)%codeparam%codename(1))
269 coresource(1)%codeparam%codename(1) =
'ANALYTIC_SOLVER_TEST'
271 IF(.NOT.
ASSOCIATED(coresource(1)%codeparam%codeversion))
THEN
272 ALLOCATE(coresource(1)%codeparam%codeversion(1))
273 coresource(1)%codeparam%codeversion(1) =
'?'
275 IF(.NOT.
ASSOCIATED(coresource(1)%codeparam%parameters))
THEN
276 ALLOCATE(coresource(1)%codeparam%parameters(1))
277 coresource(1)%codeparam%parameters(1) =
'my_code_specific_parameters'
279 IF(.NOT.
ASSOCIATED(coresource(1)%codeparam%output_diag))
THEN
280 ALLOCATE(coresource(1)%codeparam%output_diag(1))
281 coresource(1)%codeparam%output_diag(1) =
'my_output_diag'
283 coresource(1)%codeparam%output_flag = 0
284 coresource(1)%time=time
287 WRITE(6,*)
'COREIMPUR'
288 IF(.NOT.
ASSOCIATED(coreimpur(1)%codeparam%codename))
THEN
289 ALLOCATE(coreimpur(1)%codeparam%codename(1))
290 coreimpur(1)%codeparam%codename(1) =
'ANALYTIC_SOLVER_TEST'
292 IF(.NOT.
ASSOCIATED(coreimpur(1)%codeparam%codeversion))
THEN
293 ALLOCATE(coreimpur(1)%codeparam%codeversion(1))
294 coreimpur(1)%codeparam%codeversion(1) =
'?'
296 IF(.NOT.
ASSOCIATED(coreimpur(1)%codeparam%parameters))
THEN
297 ALLOCATE(coreimpur(1)%codeparam%parameters(1))
298 coreimpur(1)%codeparam%parameters(1) =
'my_code_specific_parameters'
300 IF(.NOT.
ASSOCIATED(coreimpur(1)%codeparam%output_diag))
THEN
301 ALLOCATE(coreimpur(1)%codeparam%output_diag(1))
302 coreimpur(1)%codeparam%output_diag(1) =
'my_output_diag'
304 coreimpur(1)%codeparam%output_flag = 0
305 coreimpur(1)%time=time
308 WRITE(6,*)
'Finished in ANALYTICAL_PLASMA'
352 INTEGER :: iion, nion
355 TYPE (type_coreprof
),
POINTER :: coreprof(:)
363 nion =
size(coreprof(1)%compositions%ions)
365 profiles1%ZION(iion) = coreprof(1)%compositions%ions(iion)%zion
366 profiles1%ZION2(iion) = coreprof(1)%compositions%ions(iion)%zion**2
367 profiles1%MION(iion) = coreprof(1)%compositions%nuclei(coreprof(1)%compositions%ions(iion)%nucindex)%amn
370 profiles1%PSI_BND_TYPE = coreprof(1)%psi%boundary%type
372 profiles1%NI_BND_TYPE = coreprof(1)%ni%boundary%type
374 profiles1%TI_BND_TYPE = coreprof(1)%ti%boundary%type
376 profiles1%TE_BND_TYPE = coreprof(1)%te%boundary%type
378 profiles1%VTOR_BND_TYPE = coreprof(1)%vtor%boundary%type
383 transport1%C1(1) = 0.0e0_r8
384 transport1%C1(2) = 1.5e0_r8
385 transport1%C1(3) = 2.5e0_r8
410 equilibrium, coreprof, coretransp, coresource)
440 TYPE (type_equilibrium
),
POINTER :: equilibrium(:)
441 TYPE (type_coreprof
),
POINTER :: coreprof(:)
442 TYPE (type_coretransp
),
POINTER :: coretransp(:)
443 TYPE (type_coresource
),
POINTER :: coresource(:)
448 equilibrium(1)%profiles_1d%rho_tor = geometry1%RHO
450 equilibrium(1)%profiles_1d%vprime = geometry1%VPR
451 equilibrium(1)%profiles_1d%gm3 = geometry1%G1
452 equilibrium(1)%profiles_1d%gm8 = geometry1%G2
453 equilibrium(1)%profiles_1d%gm2 = geometry1%G3
454 equilibrium(1)%profiles_1d%F_dia = geometry1%FDIA
456 coreprof(1)%rho_tor = geometry1%RHO
457 coreprof(1)%toroid_field%r0 = geometry1%RGEO
458 coreprof(1)%toroid_field%b0 = geometry1%BGEO
460 coretransp(1)%values(1)%rho_tor = geometry1%RHO
461 coresource(1)%values(1)%rho_tor = geometry1%RHO
472 coreprof(1)%psi%value = profiles1%PSI
473 coreprof(1)%profiles1d%q%value = profiles1%QSF
474 coreprof(1)%psi%boundary%value = profiles1%PSI_BND
475 coreprof(1)%psi%boundary%type = profiles1%PSI_BND_TYPE
477 coreprof(1)%ni%value = profiles1%NI
478 coreprof(1)%ni%boundary%value = profiles1%NI_BND
479 coreprof(1)%ni%boundary%type = profiles1%NI_BND_TYPE
485 coreprof(1)%ne%value = profiles1%NE
491 coreprof(1)%ti%value = profiles1%TI
492 coreprof(1)%ti%boundary%value = profiles1%TI_BND
493 coreprof(1)%ti%boundary%type = profiles1%TI_BND_TYPE
495 coreprof(1)%ti%transp_coef%diff = transport1%DIFF_TI
496 coreprof(1)%ti%transp_coef%vconv = transport1%VCONV_TI
499 coreprof(1)%te%value = profiles1%TE
500 coreprof(1)%te%boundary%value = profiles1%TE_BND
501 coreprof(1)%te%boundary%type = profiles1%TE_BND_TYPE
503 coreprof(1)%te%transp_coef%diff = transport1%DIFF_TE
504 coreprof(1)%te%transp_coef%vconv = transport1%VCONV_TE
507 coreprof(1)%vtor%value = profiles1%VTOR
508 coreprof(1)%vtor%boundary%value = profiles1%VTOR_BND
509 coreprof(1)%vtor%boundary%type = profiles1%VTOR_BND_TYPE
511 coreprof(1)%vtor%transp_coef%diff = transport1%DIFF_VTOR
512 coreprof(1)%vtor%transp_coef%vconv = transport1%VCONV_VTOR
516 coreprof(1)%ni%flux%flux_dv = 0.0_r8
517 coreprof(1)%ne%flux%flux_dv = 0.0_r8
518 coreprof(1)%ti%flux%flux_dv = 0.0_r8
519 coreprof(1)%te%flux%flux_dv = 0.0_r8
520 coreprof(1)%vtor%flux%flux_dv = 0.0_r8
524 coretransp(1)%values(1)%sigma = transport1%SIGMA
526 coretransp(1)%values(1)%te_transp%diff_eff = transport1%DIFF_TE
527 coretransp(1)%values(1)%te_transp%vconv_eff = transport1%VCONV_TE
529 coretransp(1)%values(1)%ni_transp%diff_eff = transport1%DIFF_NI
530 coretransp(1)%values(1)%ni_transp%vconv_eff = transport1%VCONV_NI
532 coretransp(1)%values(1)%ti_transp%diff_eff = transport1%DIFF_TI
533 coretransp(1)%values(1)%ti_transp%vconv_eff = transport1%VCONV_TI
535 coretransp(1)%values(1)%vtor_transp%diff_eff = transport1%DIFF_VTOR
536 coretransp(1)%values(1)%vtor_transp%vconv_eff = transport1%VCONV_VTOR
541 coresource(1)%VALUES(1)%j = sources1%CURR_EXP
543 coresource(1)%VALUES(1)%qe%exp = sources1%QE_EXP * itm_ev
544 coresource(1)%VALUES(1)%qe%imp = sources1%QE_IMP
546 coresource(1)%VALUES(1)%si%exp = sources1%SI_EXP
547 coresource(1)%VALUES(1)%si%imp = sources1%SI_IMP
549 coresource(1)%VALUES(1)%qi%exp = sources1%QI_EXP * itm_ev
550 coresource(1)%VALUES(1)%qi%imp = sources1%QI_IMP
552 coresource(1)%VALUES(1)%ui%exp = sources1%UI_EXP
553 coresource(1)%VALUES(1)%ui%imp = sources1%UI_IMP
610 INTEGER :: nrho, irho
611 INTEGER :: nion, iion
612 INTEGER :: sigma_source
626 REAL (R8) :: rho(profiles1%nrho), hrho(profiles1%nrho)
627 REAL (R8) ::
fdia(profiles1%nrho), vpr(profiles1%nrho)
628 REAL (R8) :: g1(profiles1%nrho), g2(profiles1%nrho)
629 REAL (R8) :: g3(profiles1%nrho)
632 REAL (R8) :: mion(profiles1%nion), zion(profiles1%nion)
635 REAL (R8) :: psi(profiles1%nrho)
636 REAL (R8) :: ne(profiles1%nrho)
637 REAL (R8) :: ni(profiles1%nrho,profiles1%nion)
638 REAL (R8) :: te(profiles1%nrho)
639 REAL (R8) :: ti(profiles1%nrho,profiles1%nion)
640 REAL (R8) :: vtor(profiles1%nrho,profiles1%nion)
643 REAL (R8) :: sigma(profiles1%nrho)
644 REAL (R8) :: diff_ni(profiles1%nrho,profiles1%nion)
645 REAL (R8) :: vconv_ni(profiles1%nrho,profiles1%nion)
646 REAL (R8) :: diff_ti(profiles1%nrho,profiles1%nion)
647 REAL (R8) :: vconv_ti(profiles1%nrho,profiles1%nion)
648 REAL (R8) :: diff_te(profiles1%nrho)
649 REAL (R8) :: vconv_te(profiles1%nrho)
650 REAL (R8) :: diff_vtor(profiles1%nrho,profiles1%nion)
651 REAL (R8) :: vconv_vtor(profiles1%nrho,profiles1%nion)
654 REAL (R8) :: vie(profiles1%nrho), vei(profiles1%nrho)
655 REAL (R8) :: qie(profiles1%nrho), qei(profiles1%nrho)
656 REAL (R8) :: vzi(profiles1%nrho), uzi(profiles1%nrho)
657 REAL (R8) :: qzi(profiles1%nrho), wzi(profiles1%nrho)
660 REAL (R8) :: dne(profiles1%nrho), dtne(profiles1%nrho)
667 REAL (R8) :: aval1, aval2, aval3, aval4, aval5, aval6, aval7
668 REAL (R8) :: gamma(profiles1%nion,profiles1%nrho)
669 REAL (R8) :: dgamma(profiles1%nion,profiles1%nrho)
670 REAL (R8) :: gammae(profiles1%nrho)
671 REAL (R8) :: dgammae(profiles1%nrho)
675 nrho =
SIZE(profiles1%NI)
676 nion =
SIZE(profiles1%MION)
677 c1 = transport1%C1(1)
701 vpr(irho) =
avpr(x,t)
707 geometry1%RHO(irho) = x
708 geometry1%VPR(irho) = vpr(irho)
709 geometry1%G1(irho) = g1(irho)
710 geometry1%G2(irho) = g2(irho)
711 geometry1%G3(irho) = g3(irho)
712 geometry1%FDIA(irho) =
fdia(irho)
733 zion(iion) = profiles1%ZION(iion)
734 mion(iion) = profiles1%MION(iion)
741 psi(irho) =
apsi(x,t)
743 profiles1%TE(irho) = te(irho)
744 profiles1%PSI(irho) = psi(irho)
745 profiles1%NE(irho) = 0.e0_r8
748 ti(irho,iion) =
ati(iion,x,t)
749 ni(irho,iion) =
ani(iion,x,t)
750 vtor(irho,iion) =
avtor(iion,x,t)
752 profiles1%NE(irho) = profiles1%NE(irho)+profiles1%ZION(iion)*ni(irho,iion)
753 profiles1%NI(irho,iion) = ni(irho,iion)
754 profiles1%TI(irho,iion) = ti(irho,iion)
755 profiles1%VTOR(irho,iion) = vtor(irho,iion)
785 IF(sigma_source.EQ.1)
THEN
788 transport1%SIGMA(irho) = sigma(irho)
792 IF(sigma_source.EQ.0)
THEN
793 sigma(irho) = collisions1%SIGMA(irho)
794 transport1%SIGMA(irho) = sigma(irho)
804 diff_te(irho) =
akate(x,t)
805 vconv_te(irho) =
avte(x,t)
807 transport1%DIFF_TE(irho) = diff_te(irho)
808 transport1%VCONV_TE(irho) = vconv_te(irho)
812 diff_ni(irho,iion) =
ad(iion,x,t)
813 vconv_ni(irho,iion) =
av(iion,x,t)
814 diff_ti(irho,iion) =
akappae(iion,x,t)
815 vconv_ti(irho,iion) =
avti(iion,x,t)
816 diff_vtor(irho,iion) =
advtor(iion,x,t)
817 vconv_vtor(irho,iion) =
aconvtor(iion,x,t)
820 IF(c1.EQ.0.0e0_r8)
THEN
821 transport1%DIFF_NI(irho,iion,1) = diff_ni(irho,iion)
822 transport1%VCONV_NI(irho,iion,1)= vconv_ni(irho,iion)
823 ELSE IF(c1.EQ.1.5e0_r8)
THEN
824 transport1%DIFF_NI(irho,iion,2) = diff_ni(irho,iion)
825 transport1%VCONV_NI(irho,iion,2)= vconv_ni(irho,iion)
826 ELSE IF(c1.EQ.2.5e0_r8)
THEN
827 transport1%DIFF_NI(irho,iion,3) = diff_ni(irho,iion)
828 transport1%VCONV_NI(irho,iion,3)= vconv_ni(irho,iion)
830 transport1%DIFF_TI(irho,iion) = diff_ti(irho,iion)
831 transport1%VCONV_TI(irho,iion) = vconv_ti(irho,iion)
832 transport1%DIFF_VTOR(irho,iion) = diff_vtor(irho,iion)
833 transport1%VCONV_VTOR(irho,iion) = vconv_vtor(irho,iion)
858 aval1 = sigma(irho)*
dtapsi(x,t)
861 aval3 =
fdia(irho)**2/itm_mu0/
abt(t)/x
863 aval4 = vpr(irho)/(4.0e0_r8*itm_pi**2)*g3(irho)/
fdia(irho)
864 aval5 =
davpr(x,t)/(4.0e0_r8*itm_pi**2)*g3(irho)/
fdia(irho)
865 aval5 = aval5+
avpr(x,t)/(4.0e0_r8*itm_pi**2)*
dag3(x,t)/
fdia(irho)
866 aval5 = aval5-
avpr(x,t)/(4.0e0_r8*itm_pi**2)*g3(irho)/
fdia(irho)**2*
dafdia(x,t)
867 aval1 = aval1+aval2-aval3*aval4*
ddapsi(x,t)-aval3*aval5*
dapsi(x,t)
870 aval1 = aval1*(2.e0_r8*itm_pi*x)/vpr(irho)+
acurr_imp(x,t)*psi(irho)
873 sources1%CURR_EXP(irho)= -aval1
880 sources1%CURR_EXP(1) = sources1%CURR_EXP(2)
881 sources1%CURR_IMP(1) =
acurr_imp(0.e0_r8,t)
886 IF(profiles1%PSI_BND_TYPE.EQ.0)
THEN
888 profiles1%QSF(irho) = 2.e0_r8*itm_pi*rho(irho)*
abt(t)/
dapsi(rho(irho),t)
891 profiles1%QSF(1) = 2.e0_r8*itm_pi*
abt(t)/
ddapsi(rho(1),t)
895 IF(profiles1%PSI_BND_TYPE.EQ.1)
THEN
896 profiles1%PSI_BND(1) = psi(nrho)
899 IF(profiles1%PSI_BND_TYPE.EQ.2)
THEN
900 profiles1%PSI_BND(1) = vpr(nrho)*g3(nrho)*
dapsi(rho(nrho),t)/4.e0_r8/itm_pi**2/itm_mu0
903 IF(profiles1%PSI_BND_TYPE.EQ.3)
THEN
904 profiles1%PSI_BND(1) =
dtapsi(rho(nrho),t)
916 gamma(iion,1) = 0.0e0_r8
917 dgamma(iion,1) = 0.0e0_r8
923 gamma(iion,irho) =
avpr(x,t)*
ag1(x,t)*(-
ad(iion,x,t)*
dani(iion,x,t)+
ani(iion,x,t)*
av(iion,x,t))
924 dgamma(iion,irho) =
avpr(x,t)*
ag1(x,t)*(-
ad(iion,x,t)*
ddani(iion,x,t)+
dani(iion,x,t)*
av(iion,x,t))
926 dgamma(iion,irho) = dgamma(iion,irho)+ &
927 davpr(x,t)*
ag1(x,t)*(-
ad(iion,x,t)*
dani(iion,x,t)+
av(iion,x,t)*
ani(iion,x,t))
928 dgamma(iion,irho) = dgamma(iion,irho)+ &
929 avpr(x,t)*
dag1(x,t)*(-
ad(iion,x,t)*
dani(iion,x,t)+
av(iion,x,t)*
ani(iion,x,t))
930 dgamma(iion,irho) = dgamma(iion,irho)+ &
931 avpr(x,t)*
ag1(x,t)*(-
dad(iion,x,t)*
dani(iion,x,t)+
dav(iion,x,t)*
ani(iion,x,t))
933 aval1 = aval1+aval2+dgamma(iion,irho)+
avpr(x,t)*
ani(iion,x,t)*
asi_imp(iion,x,t)
934 sources1%SI_EXP(irho,iion) = aval1/
avpr(x,t)
935 sources1%SI_IMP(irho,iion) =
asi_imp(iion,x,t)
939 sources1%SI_EXP(1,iion) = sources1%SI_EXP(2,iion)
940 sources1%SI_IMP(1,iion) =
asi_imp(iion,0.e0_r8,t)
944 IF (profiles1%NI_BND_TYPE(iion).EQ.1)
THEN
945 profiles1%NI_BND(1,iion) =
ani(iion,rho(nrho),t)
948 IF (profiles1%NI_BND_TYPE(iion).EQ.2)
THEN
949 profiles1%NI_BND(1,iion) = -
dani(iion,rho(nrho),t)
952 IF (profiles1%NI_BND_TYPE(iion).EQ.3)
THEN
953 profiles1%NI_BND(1,iion) = -
ani(iion,rho(nrho),t)/
dani(iion,rho(nrho),t)
956 IF (profiles1%NI_BND_TYPE(iion).EQ.4)
THEN
957 profiles1%NI_BND(1,iion) = gamma(iion,nrho)
973 gammae(irho) = 0.e0_r8
974 dgammae(irho) = 0.e0_r8
977 ne(irho) = ne(irho) + zion(iion)*ni(irho,iion)
978 dtne(irho) = dtne(irho) + zion(iion)*
dtani(iion,x,t)
979 dne(irho) = dne(irho) + zion(iion)*
dani(iion,x,t)
980 gammae(irho) = gammae(irho) + gamma(iion,irho)*zion(iion)
981 dgammae(irho) = dgammae(irho) + dgamma(iion,irho)*zion(iion)
997 aval1 =
dtavpr(x,t)*
avpr(x,t)**(2.e0_r8/3.e0_r8)*
ani(iion,x,t)*
ati(iion,x,t)*5.e0_r8/3.e0_r8
998 aval1 = aval1+
avpr(x,t)**(5.e0_r8/3.e0_r8)*
dtani(iion,x,t)*
ati(iion,x,t)
999 aval1 = aval1+
avpr(x,t)**(5.e0_r8/3.e0_r8)*
ani(iion,x,t)*
dtati(iion,x,t)
1003 aval3 =
ani(iion,x,t)*
ati(iion,x,t)*
avpr(x,t)**(5.e0_r8/3.e0_r8)
1004 aval3 = aval3+ x*
dani(iion,x,t)*
ati(iion,x,t)*
avpr(x,t)**(5.e0_r8/3.e0_r8)
1005 aval3 = aval3+ x*
ani(iion,x,t)*
dati(iion,x,t)*
avpr(x,t)**(5.e0_r8/3.e0_r8)
1006 aval3 = aval3+ x*
ani(iion,x,t)*
ati(iion,x,t)*
avpr(x,t)**(2.e0_r8/3.e0_r8)*
davpr(x,t)*5.e0_r8/3.e0_r8
1008 aval1 = aval1+aval2*aval3
1009 aval1 = aval1*3.e0_r8/2.e0_r8
1021 aval6 = aval2*aval5+aval4*aval3
1023 aval1 = aval1+aval6*
avpr(x,t)**(2.e0_r8/3.e0_r8)
1026 aval2 =
dati(iion,x,t)*gamma(iion,irho)+
ati(iion,x,t)*dgamma(iion,irho)
1028 aval1 = aval1+c1*aval2*
avpr(x,t)**(2.e0_r8/3.e0_r8)
1029 aval1 = aval1/
avpr(x,t)**(5.e0_r8/3.e0_r8)
1031 vei(irho) = collisions1%VEI(irho,iion)
1032 qei(irho) = collisions1%QEI(irho,iion)
1033 vzi(irho) = collisions1%VZI(irho,iion)
1034 qzi(irho) = collisions1%QZI(irho,iion)
1036 aval2 = (
aqi_imp(iion,x,t) + vei(irho) + vzi(irho) )
1038 sources1%QI_EXP(irho,iion) = aval1- qei(irho) - qzi(irho) +aval2*
ati(iion,x,t)
1039 sources1%QI_IMP(irho,iion) =
aqi_imp(iion,x,t)
1042 sources1%QI_EXP(1,iion) = sources1%QI_EXP(2,iion)
1043 sources1%QI_IMP(1,iion) =
aqi_imp(iion,0.e0_r8,t)
1051 IF (profiles1%TI_BND_TYPE(iion).EQ.1)
THEN
1052 profiles1%TI_BND(1,iion) =
ati(iion,rho(nrho),t)
1055 IF (profiles1%TI_BND_TYPE(iion).EQ.2)
THEN
1056 profiles1%TI_BND(1,iion) = -
dati(iion,rho(nrho),t)
1059 IF (profiles1%TI_BND_TYPE(iion).EQ.3)
THEN
1060 profiles1%TI_BND(1,iion) = -
ati(iion,rho(nrho),t)/
dati(iion,rho(nrho),t)
1063 IF (profiles1%TI_BND_TYPE(iion).EQ.4)
THEN
1067 aval2+c1*
ati(iion,x,t)*gamma(iion,nrho)
1068 profiles1%TI_BND(1,iion) = aval3
1085 aval1 =
dtavpr(x,t)*
avpr(x,t)**(2.e0_r8/3.e0_r8)*ne(irho)*
ate(x,t)*5.e0_r8/3.e0_r8
1086 aval1 = aval1+
avpr(x,t)**(5.e0_r8/3.e0_r8)*dtne(irho)*
ate(x,t)
1087 aval1 = aval1+
avpr(x,t)**(5.e0_r8/3.e0_r8)*ne(irho)*
dtate(x,t)
1089 aval3 = ne(irho)*
ate(x,t)*
avpr(x,t)**(5.e0_r8/3.e0_r8)
1090 aval3 = aval3+ x*dne(irho)*
ate(x,t)*
avpr(x,t)**(5.e0_r8/3.e0_r8)
1091 aval3 = aval3+ x*ne(irho)*
date(x,t)*
avpr(x,t)**(5.e0_r8/3.e0_r8)
1092 aval3 = aval3+ x*ne(irho)*
ate(x,t)*
avpr(x,t)**(2.e0_r8/3.e0_r8)*
davpr(x,t)*5.e0_r8/3.e0_r8
1093 aval1 = aval1+aval2*aval3
1094 aval1 = aval1*3.e0_r8/2.e0_r8
1095 aval2 =
avpr(x,t)*
ag1(x,t)*ne(irho)
1100 aval6 = aval2*aval5+aval4*aval3
1101 aval1 = aval1+aval6*
avpr(x,t)**(2.e0_r8/3.e0_r8)
1103 aval2 = c1*(
avpr(x,t)**(2.e0_r8/3.e0_r8)*(
date(x,t)*gammae(irho)+
ate(x,t)*dgammae(irho)))
1105 aval1 = aval1/
avpr(x,t)**(5.e0_r8/3.e0_r8)
1106 vie(irho) = collisions1%VIE(irho)
1107 qie(irho) = collisions1%QIE(irho)
1108 aval2 = (
aqe_imp(x,t) + vie(irho) )
1109 sources1%QE_EXP(irho) = aval1 +aval2*
ate(x,t)-qie(irho)
1110 sources1%QE_IMP(irho) =
aqe_imp(x,t)
1113 sources1%QE_EXP(1) = sources1%QE_EXP(2)
1114 sources1%QE_IMP(1) = sources1%QE_IMP(2)
1119 IF (profiles1%TE_BND_TYPE.EQ.1)
THEN
1120 profiles1%TE_BND(1) = te(nrho)
1123 IF (profiles1%TE_BND_TYPE.EQ.2)
THEN
1124 profiles1%TE_BND(1) = -
date(rho(nrho),t)
1127 IF (profiles1%TE_BND_TYPE.EQ.3)
THEN
1128 profiles1%TE_BND(1) = -te(nrho)/
date(rho(nrho),t)
1131 IF (profiles1%TE_BND_TYPE.EQ.4)
THEN
1133 aval2 =
avpr(x,t)*
ag1(x,t)*ne(nrho)
1135 profiles1%TE_BND(1) = aval2*aval3+c1*
ate(rho(nrho),t)*gammae(nrho)
1162 aval1 = aval1+aval2*aval3
1175 aval6 = aval2*aval5+aval4*aval3 +
dag2(x,t)*gamma(iion,irho)*
avtor(iion,x,t)
1176 aval6 = aval6+(
ag2(x,t)*dgamma(iion,irho)*
avtor(iion,x,t)+ &
1177 ag2(x,t)*gamma(iion,irho)*
davtor(iion,x,t))
1180 aval1 = aval1*profiles1%MION(iion)/
avpr(x,t)
1184 uzi(irho) = collisions1%UZI(irho,iion)
1185 wzi(irho) = collisions1%WZI(irho,iion)
1186 aval2 =
aui_imp(iion,x,t) + wzi(irho)
1188 sources1%UI_EXP(irho,iion) = aval1 +aval2*
avtor(iion,x,t) - uzi(irho)
1189 sources1%UI_IMP(irho,iion) =
aui_imp(iion,x,t)
1192 sources1%UI_EXP(1,iion) = sources1%UI_EXP(2,iion)
1193 sources1%UI_EXP(1,iion) =
aui_imp(iion,0.e0_r8,t)
1194 sources1%UI_IMP(1,iion) =
aui_imp(iion,0.e0_r8,t)
1202 IF (profiles1%VTOR_BND_TYPE(iion).EQ.1)
THEN
1203 profiles1%VTOR_BND(1,iion) =
avtor(iion,rho(nrho),t)
1206 IF (profiles1%VTOR_BND_TYPE(iion).EQ.2)
THEN
1207 profiles1%VTOR_BND(1,iion) = -
davtor(iion,rho(nrho),t)
1210 IF (profiles1%VTOR_BND_TYPE(iion).EQ.3)
THEN
1211 profiles1%VTOR_BND(1,iion) = -
avtor(iion,rho(nrho),t)/
davtor(iion,rho(nrho),t)
1214 IF (profiles1%VTOR_BND_TYPE(iion).EQ.4)
THEN
1218 profiles1%VTOR_BND(1,iion) = aval2*aval3 +
avtor(iion,rho(nrho),t)*
ag2(x,t)*gamma(iion,nrho)
1219 profiles1%VTOR_BND(1,iion) = profiles1%VTOR_BND(1,iion)*mion(iion)
subroutine copy_codeparam(CODEPARAM_IN, CODEPARAM_OUT)
COPY CODEPARAM.
REAL(R8) function avpr(X, T)
Module provides routines for testing.
subroutine process_xml(SOLVER_TYPE, SIGMA_SOURCE, TAU, AMIX, CONVREC, NRHO, NION, NIMP, NZIMP, NTIME, NSOL, PSI_BND_TYPE, NI_BND_TYPE, TI_BND_TYPE, TE_BND_TYPE, VTOR_BND_TYPE, shot_no, run_no, codeparam, database_format)
process the xml version of the input file from codeparam
REAL(R8) function dakate(X, T)
Module provides routines for copying parts of CPOs (COREPROF and EQUILIBRIUM)
REAL(R8) function dadvtor(IION, X, T)
subroutine allocate_magnetic_geometry(NRHO, GEOMETRY, ifail)
REAL(R8) function date(X, T)
subroutine allocate_coreimpur_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COREIMPUR)
This routine allocates COREIMPUR CPO.
REAL(R8) function dtati(IION, X, T)
REAL(R8) function ddati(IION, X, T)
REAL(R8) function davte(X, T)
subroutine convert_cpo_to_local_types(COREPROF, PROFILES1, TRANSPORT1)
This routine converts CPOs into the local derived types.
REAL(R8) function aui_imp(IION, X, T)
REAL(R8) function ag3(X, T)
REAL(R8) function dtag2(X, T)
REAL(R8) function dakappae(IION, X, T)
REAL(R8) function dad(IION, X, T)
REAL(R8) function advtor(IION, X, T)
REAL(R8) function ag1(X, T)
subroutine allocate_coreprof_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COREPROF)
This routine allocates COREPROF CPO.
REAL(R8) function apsi(X, T)
subroutine allocate_global_param(GLOBAL, ifail)
subroutine allocate_plasma_profiles(NRHO, NION, PROFILES, ifail)
subroutine set_cpo(NRHO, NION, NIMP, NZIMP, NTIME, NSOL, PSI_BND_TYPE, NI_BND_TYPE, TI_BND_TYPE, TE_BND_TYPE, VTOR_BND_TYPE, EQUILIBRIUM, COREPROF, CORETRANSP)
REAL(R8) function aconvtor(IION, X, T)
subroutine convert_local_to_cpo_types(GEOMETRY1, PROFILES1, TRANSPORT1, SOURCES1, EQUILIBRIUM, COREPROF, CORETRANSP, CORESOURCE)
This routine converts local into the CPOs derived types.
REAL(R8) function asigma(X, T)
REAL(R8) function av(IION, X, T)
REAL(R8) function davti(IION, X, T)
REAL(R8) function dtate(X, T)
subroutine allocate_sources_and_sinks(NRHO, NION, SOURCES, ifail)
Allocate profiles of sources needed by the transport solver.
REAL(R8) function ate(X, T)
REAL(R8) function arho(I, NRHO)
REAL(R8) function dav(IION, X, T)
REAL(R8) function dtapsi(X, T)
REAL(R8) function akate(X, T)
REAL(R8) function ddani(IION, X, T)
subroutine analytics_full(TIME, GEOMETRY1, PROFILES1, TRANSPORT1, SOURCES1)
This routine manufactures the solution for the set of transport equations describing the main plasma...
REAL(R8) function ad(IION, X, T)
This routine calculates the collision frquencies and various exchange terms determined by collisions...
REAL(R8) function dapsi(X, T)
REAL(R8) function daconvtor(IION, X, T)
REAL(R8) function ati(IION, X, T)
This module contains routines for allocation/deallocation if CPOs used in ETS.
REAL(R8) function dtavtor(IION, X, T)
subroutine allocate_coresource_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, CORESOURCE)
This routine allocates CORESOURCE CPO.
REAL(R8) function avtor(IION, X, T)
subroutine allocate_equilibrium_cpo(NSLICE, NPSI, NDIM1, NDIM2, NPOINTS, EQUILIBRIUM)
This routine allocates EQUILIBRIUM CPO.
real(r8) function fdia(psi_n)
REAL(R8) function dtavpr(X, T)
subroutine allocate_transport_coefficients(NRHO, NION, TRANSPORT, ifail)
Allocate profiles of transport coefficients needed by the transport solver.
subroutine deallocate_magnetic_geometry(GEOMETRY, ifail)
subroutine deallocate_transport_coefficients(TRANSPORT, ifail)
Deallocate plasma profiles needed by the transport solver.
REAL(R8) function dafdia(X, T)
REAL(R8) function dag3(X, T)
REAL(R8) function ddate(X, T)
REAL(R8) function avti(IION, X, T)
REAL(R8) function ag2(X, T)
REAL(R8) function davtor(IION, X, T)
REAL(R8) function akappae(IION, X, T)
subroutine plasma_collisions(GEOMETRY, PROFILES, COLLISIONS, ifail)
REAL(R8) function ddavtor(IION, X, T)
REAL(R8) function acurr_imp(X, T)
REAL(R8) function avte(X, T)
REAL(R8) function afdia(X, T)
subroutine deallocate_sources_and_sinks(SOURCES, ifail)
Deallocate plasma profiles needed by the transport solver.
subroutine deallocate_collisionality(COLLISIONS, ifail)
Deallocate plasma profiles needed by the transport solver.
REAL(R8) function dag2(X, T)
subroutine allocate_collisionality(NRHO, NION, COLLISIONS, ifail)
Allocate profiles of sources needed by the transport solver???
REAL(R8) function asi_imp(IION, X, T)
The module declares types of variables used in ETS (transport code)
REAL(R8) function dtabt(T)
Analytical functions for the calculation of the "analytic" solution.
REAL(R8) function ddapsi(X, T)
subroutine analytical_plasma(TIME, COREPROF_in, EQUILIBRIUM, COREPROF_ANALYTIC, CORETRANSP, CORESOURCE, COREIMPUR, code_parameters)
This routine manufactures the solution for the set of transport equations describing the main plasma...
subroutine deallocate_plasma_profiles(PROFILES, ifail)
Deallocate plasma profiles needed by the transport solver.
REAL(R8) function dag1(X, T)
REAL(R8) function davpr(X, T)
REAL(R8) function aqe_imp(X, T)
REAL(R8) function dani(IION, X, T)
REAL(R8) function dtani(IION, X, T)
subroutine allocate_coretransp_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, CORETRANSP)
This routine allocates CORETRANSP CPO.
REAL(R8) function aqi_imp(IION, X, T)
REAL(R8) function ani(IION, X, T)
Module for manufacture of a test case for the ETS.