9 TYPE (type_equilibrium
),
pointer ::
eq(:)
10 TYPE (type_coreprof
),
pointer :: coreprof(:)
11 TYPE (type_coretransp
),
pointer :: coretransp(:)
14 subroutine etaigb(eq, coreprof, coretransp)
16 type (type_equilibrium
),
pointer ::
eq(:)
17 type (type_coreprof
),
pointer :: coreprof(:)
18 type (type_coretransp
),
pointer :: coretransp(:)
23 INTEGER(ITM_I4) :: nrho_prof = 20, nion = 1, npsi_eq = 32, neta_eq = 64
26 REAL(r8) :: tpi=2.0_r8*itm_pi
28 REAL(r8) :: mu_0 = itm_mu0
31 REAL(r8) :: cc=1.0_r8, lcoul=14.0_r8
34 REAL(r8) ::
md=(1875.612793_r8/0.510998910_r8)*itm_me
36 REAL(R8),
DIMENSION(:),
POINTER :: eta,ra,psi,qq,jphi
45 ALLOCATE(coreprof(1)%rho_tor_norm(nrho_prof))
46 ALLOCATE(coreprof(1)%rho_tor(nrho_prof))
47 ALLOCATE(coreprof(1)%psi%value(nrho_prof))
48 ALLOCATE(coreprof(1)%drho_dt(nrho_prof))
50 ALLOCATE(coreprof(1)%ne%value(nrho_prof))
51 ALLOCATE(coreprof(1)%te%value(nrho_prof))
52 ALLOCATE(coreprof(1)%ni%value(nrho_prof,nion))
53 ALLOCATE(coreprof(1)%ti%value(nrho_prof,nion))
55 ALLOCATE(coreprof(1)%profiles1d%q%value(nrho_prof))
56 ALLOCATE(coreprof(1)%profiles1d%zeff%value(nrho_prof))
57 ALLOCATE(coreprof(1)%profiles1d%wtor%value(nrho_prof,nion))
58 ALLOCATE(coreprof(1)%profiles1d%pe%value(nrho_prof))
59 ALLOCATE(coreprof(1)%profiles1d%pi%value(nrho_prof,nion))
60 ALLOCATE(coreprof(1)%profiles1d%pr_th%value(nrho_prof))
61 ALLOCATE(coreprof(1)%profiles1d%jtot%value(nrho_prof))
62 ALLOCATE(coreprof(1)%profiles1d%jni%value(nrho_prof))
63 ALLOCATE(coreprof(1)%profiles1d%joh%value(nrho_prof))
64 ALLOCATE(coreprof(1)%profiles1d%qoh%value(nrho_prof))
65 ALLOCATE(coreprof(1)%profiles1d%sigmapar%value(nrho_prof))
69 coreprof(1)%toroid_field%b0 = 2.0_r8
70 coreprof(1)%toroid_field%r0 = 1.65_r8
72 eq(1)%global_param%toroid_field%b0 = coreprof(1)%toroid_field%b0
73 eq(1)%global_param%toroid_field%r0 = coreprof(1)%toroid_field%r0
75 eq(1)%eqgeometry%geom_axis%r = coreprof(1)%toroid_field%r0
76 eq(1)%eqgeometry%geom_axis%z = 0._r8
77 eq(1)%eqgeometry%a_minor = 0.5_r8
78 eq(1)%eqgeometry%elongation = 1.0_r8
79 eq(1)%eqgeometry%tria_upper = 0._r8
80 eq(1)%eqgeometry%tria_lower = 0._r8
82 coreprof(1)%globalparam%vloop = 0._r8
86 ALLOCATE(
eq(1)%coord_sys%grid%dim1(npsi_eq))
87 eq(1)%coord_sys%grid%dim1 = &
88 (/ ((1.0_r8/npsi_eq)*
REAL(i-1),i=1,npsi_eq) /)
90 ALLOCATE(
eq(1)%profiles_1d%psi(npsi_eq))
91 ALLOCATE(
eq(1)%profiles_1d%rho_tor(npsi_eq))
92 ALLOCATE(
eq(1)%profiles_1d%rho_vol(npsi_eq))
93 ALLOCATE(
eq(1)%profiles_1d%pressure(npsi_eq))
94 ALLOCATE(
eq(1)%profiles_1d%jparallel(npsi_eq))
95 ALLOCATE(
eq(1)%profiles_1d%jphi(npsi_eq))
96 ALLOCATE(
eq(1)%profiles_1d%pprime(npsi_eq))
97 ALLOCATE(
eq(1)%profiles_1d%ffprime(npsi_eq))
98 ALLOCATE(
eq(1)%profiles_1d%F_dia(npsi_eq))
99 ALLOCATE(
eq(1)%profiles_1d%q(npsi_eq))
101 eq(1)%profiles_1d%psi=0._r8
102 eq(1)%profiles_1d%rho_tor=0._r8
103 eq(1)%profiles_1d%rho_vol=0._r8
104 eq(1)%profiles_1d%jphi=0._r8
105 eq(1)%profiles_1d%jparallel=0._r8
106 eq(1)%profiles_1d%pressure=0._r8
107 eq(1)%profiles_1d%q=0._r8
108 eq(1)%profiles_1d%pprime=0._r8
109 eq(1)%profiles_1d%ffprime=0._r8
110 eq(1)%profiles_1d%F_dia=0._r8
114 ALLOCATE(
eq(1)%coord_sys%grid%dim2(neta_eq))
115 ALLOCATE(
eq(1)%eqgeometry%boundary(1))
116 ALLOCATE(
eq(1)%eqgeometry%boundary(1)%r(neta_eq))
117 ALLOCATE(
eq(1)%eqgeometry%boundary(1)%z(neta_eq))
119 eta =>
eq(1)%coord_sys%grid%dim2
121 eta=(/ ((2.0_r8*pi/neta_eq)*
REAL(i-1),i=1,neta_eq) /)
123 eq(1)%eqgeometry%boundary(1)%r = &
124 eq(1)%eqgeometry%geom_axis%r + &
125 eq(1)%eqgeometry%a_minor*cos(eta)
126 eq(1)%eqgeometry%boundary(1)%z = &
127 eq(1)%eqgeometry%geom_axis%z + &
128 eq(1)%eqgeometry%a_minor*sin(eta)
132 coreprof(1)%rho_tor_norm=(/ ((1.0_r8/nrho_prof)*(i-0.5),i=1,nrho_prof) /)
133 coreprof(1)%rho_tor=coreprof(1)%rho_tor_norm*
eq(1)%eqgeometry%a_minor
135 ra => coreprof(1)%rho_tor_norm
136 psi => coreprof(1)%psi%value
137 qq => coreprof(1)%profiles1d%q%value
138 jphi => coreprof(1)%profiles1d%jtot%value
140 coreprof(1)%ne%value=6.0e19_r8*exp(-3.0_r8*ra*ra/3.3_r8)
141 coreprof(1)%te%value=5.0e3_r8*exp(-8.0_r8*ra*ra/3.3_r8)
142 coreprof(1)%ni%value(:,1)=coreprof(1)%ne%value
143 coreprof(1)%ti%value(:,1)=coreprof(1)%te%value
144 coreprof(1)%profiles1d%zeff%value = 2.0_r8
145 coreprof(1)%profiles1d%q%value = 1.5_r8+2.5_r8*ra*ra
146 coreprof(1)%profiles1d%wtor%value=0.0_r8
147 coreprof(1)%time=0.0_r8
149 coreprof(1)%profiles1d%pe%value=coreprof(1)%ne%value*kb*coreprof(1)%te%value
150 coreprof(1)%profiles1d%pi%value=coreprof(1)%ni%value*kb*coreprof(1)%ti%value
151 coreprof(1)%profiles1d%pr_th%value=coreprof(1)%profiles1d%pe%value &
152 + coreprof(1)%profiles1d%pi%value(:,1)
156 jphi = (2._r8*coreprof(1)%toroid_field%b0/ &
157 (mu_0*coreprof(1)%toroid_field%r0))*1.5_r8/(qq*qq)
159 psi = (pi*coreprof(1)%toroid_field%b0* &
160 eq(1)%eqgeometry%a_minor*
eq(1)%eqgeometry%a_minor/ &
161 (4.0_r8-1.5_r8)) * log(qq/1.5_r8)
163 coreprof(1)%profiles1d%jni%value=0.0_r8
164 coreprof(1)%profiles1d%joh%value=coreprof(1)%profiles1d%jtot%value
168 CALL
etaigb(
eq, coreprof, coretransp)
172 OPEN (10, file =
'prof.dat', form =
'formatted')
173 WRITE(10,*)
' i rho_tor ne Te Ti D chi_e chi_i'
177 coreprof(1)%rho_tor(i), &
178 coreprof(1)%ne%value(i), &
179 coreprof(1)%te%value(i), &
180 coreprof(1)%ti%value(i,1), &
181 coretransp(1)%ne_transp%diff_eff(i,3), &
182 coretransp(1)%te_transp%diff_eff(i), &
183 coretransp(1)%ti_transp%diff_eff(i,1)
187 100
FORMAT (i3,7g11.3)
subroutine eq(pcequi, psicon, ncequi, nstep, ngrid,
subroutine etaigb(eq, coreprof, coretransp, code_parameters)