19 REAL(rprec),
DIMENSION(ns,0:ntor,0:mpol1,ntmax),
INTENT(inout) :: rmn, zmn
20 LOGICAL,
INTENT(in) :: lreset
22 INTEGER :: js, l, lk, lt, lz, ntype, m, n, mn
23 REAL(rprec),
DIMENSION(0:ntor,ntmax) :: rold, zold
24 REAL(rprec) :: sm0, t1, facj, si, rax1, zax1
25 INTEGER :: jcount, jk, k
37 wint(1:nrzt:ns) = 0.0_dp
109 l = js + ns*mn + (ntype - 1)*mns
110 IF (mod(m,2) .eq. 0)
THEN
130 IF (.not.lreset .and. lfreeb) cycle
138 IF (.not.lreset) cycle
147 if (abs(rmn(js,n,m,ntype)) .ne. zero)
then
148 print *,
"spurious remnant in rmn: ", rmn(js,n,m,ntype)
153 if (abs(zmn(js,n,m,ntype)) .ne. zero)
then
154 print *,
"spurious remnant in zmn: ", zmn(js,n,m,ntype)
161 rmn(js,n,m,ntype) = si *
rmn_bdy(n,m,ntype)*t1
162 zmn(js,n,m,ntype) = si *
zmn_bdy(n,m,ntype)*t1
187 IF (ntype .eq.
rcc) rax1 = raxis_cc(n)
188 IF (ntype .eq.
rcs) rax1 =-raxis_cs(n)
189 IF (ntype.eq.
rcc .or. ntype.eq.
rcs)
THEN
191 rmn(js,n,m,ntype) = rmn(js,n,m,ntype) + sm0 * rax1*t1
194 IF (ntype .eq.
zcs) zax1 =-zaxis_cs(n)
195 IF (ntype .eq.
zcc) zax1 = zaxis_cc(n)
196 IF (ntype.eq.
zcs .or. ntype.eq.
zcc)
THEN
198 zmn(js,n,m,ntype) = zmn(js,n,m,ntype) + sm0 * zax1*t1
215 if (abs(rmn(js,n,m,ntype)) .ne. zero)
then
216 print *,
"spurious remnant in rmn: ", rmn(js,n,m,ntype)
221 if (abs(zmn(js,n,m,ntype)) .ne. zero)
then
222 print *,
"spurious remnant in zmn: ", zmn(js,n,m,ntype)
228 rmn(js,n,m,ntype) = facj *
rmn_bdy(n,m,ntype)*t1
229 zmn(js,n,m,ntype) = facj *
zmn_bdy(n,m,ntype)*t1
248 call add_real_3d(
"scalxc", ns, ntor1, mpol,
scalxc(:
irzloff))
249 call add_real_4d(
"rmn",
ntmax, ns, ntor1, mpol, rmn, order=(/ 2, 3, 4, 1 /) )
250 call add_real_4d(
"zmn",
ntmax, ns, ntor1, mpol, zmn, order=(/ 2, 3, 4, 1 /) )
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 wint
two-dimensional array for normalizing angle integrations
real(rprec), dimension(:), allocatable sqrts
sqrt(s), two-dimensional array on full-grid
real(rprec), dimension(:), allocatable chip
radial derivative of chi/(2*pi) on half-grid
real(rprec), dimension(:), allocatable phip
radial derivative of phi/(2*pi) on half-grid
integer irzloff
offset in xc array between R,Z,L components
real(rprec), dimension(:,:,:,:), allocatable faclam
real(rprec), dimension(:), allocatable chips
poloidal flux (same as chip), one-dimensional array
real(rprec), dimension(:,:,:), allocatable, target zmn_bdy
real(rprec), dimension(:,:,:), allocatable, target rmn_bdy
integer num_eqsolve_retries
integer, dimension(:), allocatable ireflect
two-dimensional array for computing 2pi-v angle
real(rprec), dimension(:), allocatable phips
toroidal flux (same as phip), one-dimensional array
real(rprec), dimension(:), allocatable mscale
array for norming theta-trig functions (internal use only) so that the discrete SUM[cos(mu)*cos(m'u)]...
integer, dimension(:), allocatable uminus
real(rprec), dimension(:), allocatable nscale
array for norming zeta -trig functions (internal use only)
integer ntmax
number of contributing Fourier basis function (can be 1, 2 or 4); assigned in read_indata()
real(rprec), dimension(:), allocatable scalxc
subroutine profil3d(rmn, zmn, lreset)
Compute three-dimensional profiles of flux-surface geometry etc.