15SUBROUTINE scalfor(gcx, axm, bxm, axd, bxd, cx, iflag, skip_scalfor_dbg)
25 INTEGER,
INTENT(in) :: iflag
26 REAL(rprec),
DIMENSION(ns,0:ntor,0:mpol1,ntmax),
INTENT(inout) :: gcx
27 REAL(rprec),
DIMENSION(ns+1,2),
INTENT(in) :: axm, bxm, axd, bxd
28 REAL(rprec),
DIMENSION(ns),
INTENT(in) :: cx
29 logical,
intent(in) :: skip_scalfor_dbg
31 REAL(rprec),
PARAMETER :: ftol_edge = 1.e-9_dp
32 REAL(rprec),
PARAMETER :: fac=0.25_dp
33 REAL(rprec),
PARAMETER :: edge_pedestal= 0.05_dp
34 INTEGER :: m , mp, n, js, jmax
35 REAL(rprec),
DIMENSION(:,:,:),
ALLOCATABLE :: ax, bx, dx
36 REAL(rprec) :: mult_fac
46 if (iflag.ne.0 .and. iflag.ne.1)
then
47 stop
"unknown iflag in dump_scalfor"
68 DO js =
jmin2(m), jmax
69 ax(js,n,m) = -(axm(js+1,mp) + bxm(js+1,mp)*m**2.0_dp)
70 bx(js,n,m) = -(axm(js,mp) + bxm(js,mp)*m**2.0_dp)
71 dx(js,n,m) = -(axd(js,mp) + bxd(js,mp)*m**2.0_dp + cx(js)*(n*nfp)**2.0_dp)
75 dx(2,n,m) = dx(2,n,m) + bx(2,n,m)
86 IF (jmax .ge.
ns)
THEN
91 dx(
ns,:,0:1) = (1.0_dp+ edge_pedestal)*dx(
ns,:,0:1)
99 mult_fac = min(fac, fac*
hs*15.0_dp)
101 IF (iflag .eq. 1)
THEN
103 dx(
ns,0,0) = dx(
ns,0,0)*(1.0_dp-mult_fac)/(1.0_dp+edge_pedestal)
123 if (.not. skip_scalfor_dbg)
then
134 stop
"how can dbg_open be true here ?"
140 call add_real_3d(
"ax",
ns,
ntor1, mpol, ax)
141 call add_real_3d(
"bx",
ns,
ntor1, mpol, bx)
142 call add_real_3d(
"dx",
ns,
ntor1, mpol, dx)
151 DEALLOCATE (ax, bx, dx)
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) hs
radial mesh size increment
integer ivac
counts number of free-boundary iterations
integer num_eqsolve_retries
subroutine scalfor(gcx, axm, bxm, axd, bxd, cx, iflag, skip_scalfor_dbg)
Build forces from different contributions.
subroutine tridslv(a, d, b, c, jmin, jmax, mnd1, ns, nrhs)
Solve a tridiagonal system of equations.