22 REAL(rprec),
PARAMETER :: p25 = p5*p5
23 REAL(rprec),
PARAMETER :: dshalfds=p25
25 INTEGER :: l, js, lk, ku
27 REAL(rprec),
DIMENSION(:),
POINTER :: bsqr
28 REAL(rprec),
DIMENSION(:),
POINTER :: gvvs
29 REAL(rprec),
DIMENSION(:),
POINTER :: guvs
30 REAL(rprec),
DIMENSION(:),
POINTER :: guus
34 character(len=255) :: dump_filename2
67 call add_real_3d(
"lu_e", ns, nzeta, ntheta3, lu_e )
68 call add_real_3d(
"lv_e_in", ns, nzeta, ntheta3, lv_e )
69 call add_real_3d(
"guu_in", ns, nzeta, ntheta3,
guu )
70 call add_real_3d(
"guv_in", ns, nzeta, ntheta3,
guv )
71 call add_real_3d(
"gvv_in", ns, nzeta, ntheta3,
gvv )
72 call add_real_3d(
"ru12", ns, nzeta, ntheta3, ru12 )
73 call add_real_3d(
"zu12", ns, nzeta, ntheta3, zu12 )
74 call add_real_3d(
"brmn_e_in", ns, nzeta, ntheta3,
brmn_e )
75 call add_real_3d(
"bzmn_e_in", ns, nzeta, ntheta3,
bzmn_e )
76 call add_real_3d(
"ru0", ns, nzeta, ntheta3,
ru0 )
77 call add_real_3d(
"zu0", ns, nzeta, ntheta3,
zu0 )
78 call add_real_3d(
"rcon0", ns, nzeta, ntheta3,
rcon0 )
79 call add_real_3d(
"zcon0", ns, nzeta, ntheta3,
zcon0 )
80 call add_real_3d(
"gcon", ns, nzeta, ntheta3,
gcon )
82 call add_real_4d(
"r1", ns, 2, nzeta, ntheta3,
r1, order=(/ 1, 3, 4, 2 /) )
83 call add_real_4d(
"z1", ns, 2, nzeta, ntheta3,
z1, order=(/ 1, 3, 4, 2 /) )
84 call add_real_4d(
"ru", ns, 2, nzeta, ntheta3,
ru, order=(/ 1, 3, 4, 2 /) )
85 call add_real_4d(
"zu", ns, 2, nzeta, ntheta3,
zu, order=(/ 1, 3, 4, 2 /) )
86 call add_real_4d(
"rcon_in", ns, 2, nzeta, ntheta3,
rcon, order=(/ 1, 3, 4, 2 /) )
87 call add_real_4d(
"zcon_in", ns, 2, nzeta, ntheta3,
zcon, order=(/ 1, 3, 4, 2 /) )
90 call add_real_4d(
"rv", ns, 2, nzeta, ntheta3,
rv, order=(/ 1, 3, 4, 2 /) )
91 call add_real_4d(
"zv", ns, 2, nzeta, ntheta3,
zv, order=(/ 1, 3, 4, 2 /) )
107 lu_e(1:ndim:ns) = 0.0_dp
108 lv_e(1:ndim:ns) = 0.0_dp
109 guu(1:ndim:ns) = 0.0_dp
110 guv(1:ndim:ns) = 0.0_dp
111 gvv(1:ndim:ns) = 0.0_dp
121 bsqr = dshalfds*lu_e/
shalf
133 bsqr(l) = bsqr(l) + bsqr(l+1)
134 guus(l) = p5*(guus(l) + guus(l+1))
135 gvvs(l) = p5*(gvvs(l) + gvvs(l+1))
143 brmn_e(:nrzt) =
brmn_e(:nrzt) + bsqr(:nrzt)*
z1(:nrzt,1) - (guus(:nrzt)*
ru(:nrzt,1) +
guu(:nrzt)*
ru(:nrzt,0))
144 bzmn_e(:nrzt) =
bzmn_e(:nrzt) - (bsqr(:nrzt)*
r1(:nrzt,1) + guus(:nrzt)*
zu(:nrzt,1) +
guu(:nrzt)*
zu(:nrzt,0))
145 lv_e(1:ndim) = lv_e(1:ndim)*
shalf(1:ndim)
146 lu_o(1:ndim) = dshalfds*lu_e(1:ndim)
153 lu_o(l) = lu_o(l) + lu_o(l+1)
160 call add_real_3d(
"lu_o", ns, nzeta, ntheta3, lu_o )
161 call add_real_3d(
"lv_e_out", ns, nzeta, ntheta3, lv_e )
165 bsqr(1:nrzt) =
gvv(1:nrzt) *
sqrts(1:nrzt)**2
167 armn_o(:nrzt) =
armn_o(:nrzt) - (
zu(:nrzt,1)*lu_o(:nrzt) + bsqr(:nrzt)*
r1(:nrzt,1) + gvvs(:nrzt)*
r1(:nrzt,0))
169 brmn_o(:nrzt) =
brmn_o(:nrzt) +
z1(:nrzt,1)*lu_o(:nrzt) - (
guu(:nrzt)*
ru(:nrzt,1) + guus(:nrzt)*
ru(:nrzt,0))
170 bzmn_o(:nrzt) =
bzmn_o(:nrzt) - (
r1(:nrzt,1)*lu_o(:nrzt) +
guu(:nrzt)*
zu(:nrzt,1) + guus(:nrzt)*
zu(:nrzt,0))
175 guvs(l) = p5*(guvs(l) + guvs(l+1))
180 crmn_e(:nrzt) =
guv(:nrzt) *
ru(:nrzt,0) +
gvv(:nrzt) *
rv(:nrzt,0) + gvvs(:nrzt)*
rv(:nrzt,1) + guvs(:nrzt)*
ru(:nrzt,1)
181 czmn_e(:nrzt) =
guv(:nrzt) *
zu(:nrzt,0) +
gvv(:nrzt) *
zv(:nrzt,0) + gvvs(:nrzt)*
zv(:nrzt,1) + guvs(:nrzt)*
zu(:nrzt,1)
187 crmn_o(:nrzt) = guvs(:nrzt)*
ru(:nrzt,0) + gvvs(:nrzt)*
rv(:nrzt,0) + bsqr(:nrzt)*
rv(:nrzt,1) +
guv(:nrzt) *
ru(:nrzt,1)
188 czmn_o(:nrzt) = guvs(:nrzt)*
zu(:nrzt,0) + gvvs(:nrzt)*
zv(:nrzt,0) + bsqr(:nrzt)*
zv(:nrzt,1) +
guv(:nrzt) *
zu(:nrzt,1)
192 IF (
ivac .ge. 1)
THEN
259 call add_real_3d(
"armn_e", ns, nzeta, ntheta3,
armn_e)
260 call add_real_3d(
"armn_o", ns, nzeta, ntheta3,
armn_o)
261 call add_real_3d(
"brmn_e", ns, nzeta, ntheta3,
brmn_e)
262 call add_real_3d(
"brmn_o", ns, nzeta, ntheta3,
brmn_o)
263 call add_real_3d(
"azmn_e", ns, nzeta, ntheta3,
azmn_e)
264 call add_real_3d(
"azmn_o", ns, nzeta, ntheta3,
azmn_o)
265 call add_real_3d(
"bzmn_e", ns, nzeta, ntheta3,
bzmn_e)
266 call add_real_3d(
"bzmn_o", ns, nzeta, ntheta3,
bzmn_o)
268 call add_real_3d(
"crmn_e", ns, nzeta, ntheta3,
crmn_e)
269 call add_real_3d(
"crmn_o", ns, nzeta, ntheta3,
crmn_o)
270 call add_real_3d(
"czmn_e", ns, nzeta, ntheta3,
czmn_e)
271 call add_real_3d(
"czmn_o", ns, nzeta, ntheta3,
czmn_o)
273 call add_null(
"crmn_e")
274 call add_null(
"crmn_o")
275 call add_null(
"czmn_e")
276 call add_null(
"czmn_o")
279 call add_real_3d(
"guu_out", ns, nzeta, ntheta3,
guu )
280 call add_real_3d(
"guus", ns, nzeta, ntheta3, guus )
281 call add_real_3d(
"guv_out", ns, nzeta, ntheta3,
guv )
282 call add_real_3d(
"guvs", ns, nzeta, ntheta3, guvs )
283 call add_real_3d(
"gvv_out", ns, nzeta, ntheta3,
gvv )
284 call add_real_3d(
"gvvs", ns, nzeta, ntheta3, gvvs )
285 call add_real_3d(
"bsqr", ns, nzeta, ntheta3, bsqr )
287 call add_real_4d(
"rcon_out", ns, 2, nzeta, ntheta3,
rcon, order=(/ 1, 3, 4, 2 /) )
288 call add_real_4d(
"zcon_out", ns, 2, nzeta, ntheta3,
zcon, order=(/ 1, 3, 4, 2 /) )
subroutine forces
Compute the real-space MHD forces.
logical function open_dbg_context(context_name, repetition, id)
check if any output is desired for the current iteration check if the given context should be openend...
real(rprec), dimension(:,:), allocatable rv
real(rprec), dimension(:), allocatable zu0
, even-m and odd-m added together appropriately
real(rprec), dimension(:,:), allocatable zv
real(rprec), dimension(:,:), allocatable zcon
spectral condensation term in
real(rprec), dimension(:,:), allocatable ru
real(rprec), dimension(:), allocatable gvv
metric element
real(rprec), dimension(:), allocatable sqrts
sqrt(s), two-dimensional array on full-grid
real(rprec), dimension(:,:), allocatable, target extra3
real(rprec), dimension(:), allocatable guv
metric element
real(rprec), dimension(:,:), allocatable, target extra4
real(rprec), dimension(:,:), allocatable, target extra1
real(rprec), dimension(:), allocatable shalf
sqrt(s) ,two-dimensional array on half-grid
real(rprec), dimension(:), allocatable ru0
, even-m and odd-m added together appropriately
real(rprec), dimension(:), allocatable gcon
spectral condensation force; "alias force"
real(rprec), dimension(:,:), allocatable, target z1
real(rprec), dimension(:,:), allocatable rcon
spectral condensation term in
real(rprec), dimension(:), allocatable rcon0
spectral condensation term in at start of current multi-grid iteration
real(rprec), dimension(:,:), allocatable r1
real(rprec), dimension(:), allocatable guu
metric element
real(rprec), dimension(:,:), allocatable, target extra2
real(rprec), dimension(:), allocatable zcon0
spectral condensation term in at start of current multi-grid iteration
real(rprec), dimension(:,:), allocatable zu
real(rprec), dimension(:), pointer bzmn_e_con
real(rprec), dimension(:), pointer azmn_o
real(rprec), dimension(:), pointer bzmn_e
real(rprec), dimension(:), pointer bzmn_o_con
real(rprec), dimension(:), pointer brmn_e
real(rprec), dimension(:), pointer brmn_e_con
real(rprec), dimension(:), pointer azmn_e
real(rprec), dimension(:), pointer czmn_e
real(rprec), dimension(:), pointer brmn_o_con
real(rprec), dimension(:), pointer brmn_o
real(rprec), dimension(:), pointer bzmn_o
real(rprec), dimension(:), pointer crmn_e
real(rprec), dimension(:), pointer czmn_o
real(rprec), dimension(:), pointer armn_o
real(rprec), dimension(:), pointer crmn_o
real(rprec), dimension(:), pointer armn_e
real(rprec), dimension(:), allocatable rbsq
integer ivac
counts number of free-boundary iterations
integer num_eqsolve_retries