19 REAL(rprec) :: Itor, si, tf, pedge, vpnorm, torflux_edge, polflux_edge
21 REAL(rprec),
EXTERNAL :: pcurr, pmass, piota, &
22 torflux, torflux_deriv, polflux, polflux_deriv
28 torflux_edge =
signgs * phiedge / twopi
30 IF (si .ne. zero) torflux_edge = torflux_edge/si
32 polflux_edge = torflux_edge
34 IF (si .ne. zero) polflux_edge = polflux_edge/si
47 tf = min(one, torflux(si))
48 phips(i) = torflux_edge * torflux_deriv(si)
49 chips(i) = torflux_edge * polflux_deriv(si)
57 IF (
lamscale .EQ. 0.0_dp) stop
'PHIP == 0: ERROR!'
67 tf = min(one, torflux(si))
68 phipf(i) = torflux_edge * torflux_deriv(si)
69 chipf(i) = torflux_edge * polflux_deriv(si)
81 IF (abs(pedge) .gt. abs(epsilon(pedge)*curtor))
then
87 spres_ped = abs(spres_ped)
92 tf = min(one, torflux(si))
93 vpnorm = torflux_edge * torflux_deriv(si)
99 IF (si .gt. spres_ped)
THEN
100 pedge = pmass(spres_ped)
104 mass(i) = pedge*(abs(vpnorm)*
r00)**gamma
112 si =
hs*abs(i-1.5_dp)
113 shalf(i:nrzt:ns) = sqrt(si)
117 sqrts(i:nrzt:ns) = sqrt(si)
127 sqrts(ns:nrzt:ns) = 1.0_dp
128 shalf(nrzt+1) = 1.0_dp
129 sqrts(nrzt+1) = 1.0_dp
143 call add_real(
"torflux_edge", torflux_edge)
144 call add_real(
"polflux_edge", polflux_edge)
145 call add_real(
"r00",
r00)
147 call add_real(
"currv",
currv)
148 call add_real(
"Itor", itor)
150 call add_real_1d(
"shalf", ns+1,
shalf(:ns+1))
151 call add_real_1d(
"phips", ns,
phips(2:ns+1))
152 call add_real_1d(
"chips", ns-1,
chips(2:ns))
153 call add_real_1d(
"iotas", ns-1,
iotas(2:ns))
154 call add_real_1d(
"icurv", ns-1,
icurv(2:ns))
155 call add_real_1d(
"mass", ns-1,
mass(2:ns))
157 call add_real_1d(
"sqrts", ns,
sqrts(:ns))
158 call add_real_1d(
"phipf", ns,
phipf)
159 call add_real_1d(
"chipf", ns,
chipf)
160 call add_real_1d(
"iotaf", ns,
iotaf)
161 call add_real_1d(
"bdamp", ns,
bdamp)
163 call add_real_1d(
"sm", ns,
sm)
164 call add_real_1d(
"sp", ns+1,
sp)
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 sqrts
sqrt(s), two-dimensional array on full-grid
real(rprec), dimension(:), allocatable shalf
sqrt(s) ,two-dimensional array on half-grid
real(rprec), dimension(:), allocatable sp
shalf(i+1)/sfull(i)
real(rprec) hs
radial mesh size increment
real(rprec), dimension(:), allocatable chips
poloidal flux (same as chip), one-dimensional array
real(rprec), dimension(:), allocatable bdamp
radial mesh-blending factor
real(rprec), dimension(:), allocatable sm
shalf(i)/sfull(i)
real(rprec), dimension(:), allocatable iotaf
rotational transform (full grid)
real(rprec), dimension(:), allocatable pres
pressure profile
real(rprec), dimension(:), allocatable chipf
radial derivative of poloidal magnetic flux (full grid)
real(rprec), dimension(:,:,:), allocatable, target rmn_bdy
integer num_eqsolve_retries
real(rprec) currv
toroidal current (?)
real(rprec), dimension(:), allocatable phips
toroidal flux (same as phip), one-dimensional array
real(rprec), dimension(:), allocatable mass
mass profile on half-grid
logical lflip
from init_geometry
real(rprec), dimension(:), allocatable iotas
rotational transform , on half radial mesh
real(rprec), dimension(:), allocatable phipf
radial derivative of toroidal magnetic flux (full grid)
real(rprec), dimension(:), allocatable icurv
(-)toroidal current inside flux surface (vanishes like s)
real(rprec) signgs
sign of Jacobian : must be =1 (right-handed) or =-1 (left-handed)
real(rprec), parameter pdamp
subroutine profil1d()
Compute phip and iota profiles on full grid.