19 INTEGER,
intent(inout) :: ier_flag
21 REAL(rprec),
PARAMETER :: p98 = 0.98_dp
22 REAL(rprec),
PARAMETER :: p96 = 0.96_dp
28 LOGICAL :: lreset_internal
33 lreset_internal = .false.
35 liter_flag =
iter2 .eq. 1
48 IF (
first .EQ. 2)
THEN
68 iter_loop:
DO WHILE (liter_flag)
79 print *,
' INITIAL JACOBIAN CHANGED SIGN!'
82 print *,
' TRYING TO IMPROVE INITIAL MAGNETIC AXIS GUESS'
88 lreset_internal = .true.
99 w0 =
wb +
wp/(gamma - one)
118 ELSE IF (
ijacob .eq. 50)
THEN
126 ELSE IF (
ijacob .ge. 75)
THEN
135 120
FORMAT(2x,
'HAVING A CONVERGENCE PROBLEM: RESETTING DELT TO ',f8.3,&
136 /,2x,
'If this does NOT resolve the problem, try changing ', &
137 '(decrease OR increase) the value of DELT')
178 IF (
first .ne. 1)
THEN
191 IF (mod(
iter2, nstep) .eq. 0 .or. &
193 .not.liter_flag)
then
210 IF (
ivac .eq. 1)
THEN
213 WRITE (nthreed, 110)
iter2
214110
FORMAT(/,2x,
'VACUUM PRESSURE TURNED ON AT ',i4,
' ITERATIONS'/)
223 WRITE (nthreed, 60) w0*twopi**2.0_dp
22460
FORMAT(/,
' MHD Energy = ',1p,e12.6)
subroutine eqsolve(ier_flag)
Iteratively evolve the Fourier coefficients that specify the equilibrium.
subroutine evolve(time_step, ier_flag, liter_flag)
Take a single time step in Fourier space to evolve the Fourier coefficients describing the equilibriu...
subroutine guess_axis(r1, z1, ru0, zu0)
Computes guess for magnetic axis if user guess leads to initial sign change of Jacobian.
logical skip_dbgout_collison
real(rprec), dimension(:), allocatable zu0
, even-m and odd-m added together appropriately
real(rprec), dimension(:), allocatable ru0
, even-m and odd-m added together appropriately
real(rprec), dimension(:,:), allocatable, target z1
real(rprec), dimension(:,:), allocatable r1
integer irzloff
offset in xc array between R,Z,L components
real(rprec) wp
kinetic/thermal energy (from pressure)
integer iter1
number of iterations at which the currently active evolution was branched off from
integer first
"counter" monitoring sign of jacobian; resets R, Z, and Lambda when jacobian changes sign and decreas...
integer ivac
counts number of free-boundary iterations
integer niterv
max iterations for current multi-grid iteration
integer ijacob
counter for number of times jacobian changes sign
real(rprec) wb
magnetic energy: volume integral over B^2/2
integer num_eqsolve_retries
integer iter2
total number of iterations
integer, parameter bad_jacobian_flag
integer, parameter jac75_flag
integer, parameter successful_term_flag
integer, parameter norm_term_flag
real(rprec), dimension(:), allocatable, target xc
stacked array of scaled R, Z, Lambda Fourier coefficients (see above for stack order)
subroutine printout(i0, delt0, w0)
Print iteration progress to screen and threed1 output file.
subroutine profil3d(rmn, zmn, lreset)
Compute three-dimensional profiles of flux-surface geometry etc.
subroutine restart_iter(time_step)
Save current or restore previous good state vector and reduce time step.