11SUBROUTINE evolve(time_step, ier_flag, liter_flag)
21 REAL(rprec),
intent(in) :: time_step
22 INTEGER,
INTENT(inout) :: ier_flag
23 LOGICAL,
INTENT(inout) :: liter_flag
26 CHARACTER(LEN=*),
PARAMETER :: fcn_message =
"External calls to FUNCT3D: "
27 REAL(rprec) :: fsq1, dtau, b1, fac
62 IF (
iter2 .gt.
iter1 .and. fsq1 .ne. zero)
then
67 dtau = min(abs(log(fsq1/
fsq)), cp15)
84 dtau = time_step*
otav/2.0_dp
87 fac = one/(one + dtau)
92 call add_real_5d(
"xc_before", 3,
ntmax, ns, ntor1, mpol,
xc, order=(/ 3, 4, 5, 2, 1 /) )
93 call add_real_5d(
"xcdot_before", 3,
ntmax, ns, ntor1, mpol,
xcdot, order=(/ 3, 4, 5, 2, 1 /) )
94 call add_real_5d(
"gc", 3,
ntmax, ns, ntor1, mpol,
gc, order=(/ 3, 4, 5, 2, 1 /) )
104 call add_real_5d(
"xc_after", 3,
ntmax, ns, ntor1, mpol,
xc, order=(/ 3, 4, 5, 2, 1 /) )
105 call add_real_5d(
"xcdot_after", 3,
ntmax, ns, ntor1, mpol,
xcdot, order=(/ 3, 4, 5, 2, 1 /) )
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 funct3d(ier_flag)
Evaluate the three-dimensional MHD energy functional. Think of this as the "forward model" that tells...
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...
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...
real(rprec), dimension(ndamp) otau
real(rprec) otav
time-step algorithm
integer num_eqsolve_retries
integer iter2
total number of iterations
integer, parameter bad_jacobian_flag
integer, parameter successful_term_flag
integer ntmax
number of contributing Fourier basis function (can be 1, 2 or 4); assigned in read_indata()
integer, parameter norm_term_flag
integer, parameter ndamp
number of iterations over which damping is averaged
real(rprec), dimension(:), allocatable gc
stacked array of R, Z, Lambda Spectral force coefficients (see above for stack order)
real(rprec), dimension(:), allocatable, target xc
stacked array of scaled R, Z, Lambda Fourier coefficients (see above for stack order)
real(rprec), dimension(:), allocatable xcdot
"velocity": change of Fourier coefficients per time step