16 INTEGER,
INTENT(inout) :: ier_flag
19 INTEGER :: loc_ier_flag
24 REAL(rprec),
ALLOCATABLE :: br_out(:), bz_out(:)
26 CHARACTER(LEN=*),
PARAMETER,
DIMENSION(0:10) :: werror = (/ &
27 'EXECUTION TERMINATED NORMALLY ', &
28 'INITIAL JACOBIAN CHANGED SIGN (IMPROVE INITIAL GUESS) ', &
29 'FORCE RESIDUALS EXCEED FTOL: MORE ITERATIONS REQUIRED ', &
30 .ne..ne.
'VMEC INDATA ERROR: NCURR1 but BLOAT1. ', &
31 'MORE THAN 75 JACOBIAN ITERATIONS (DECREASE DELT) ', &
32 'ERROR READING INPUT FILE OR NAMELIST ', &
33 'NEW AXIS GUESS STILL FAILED TO GIVE GOOD JACOBIAN ', &
34 'PHIEDGE HAS WRONG SIGN IN VACUUM SUBROUTINE ', &
35 'NS ARRAY MUST NOT BE ALL ZEROES ', &
36 'ERROR READING MGRID FILE ', &
37 'VAC-VMEC I_TOR MISMATCH : BOUNDARY MAY ENCLOSE EXT. COIL ' /)
45 loc_ier_flag = ier_flag
65 ALLOCATE(br_out(nrzt), bz_out(nrzt), stat=istat)
73 IF (
ASSOCIATED(
bzmn_o))
THEN
84 print 120, trim(werror(loc_ier_flag))
85 IF (lterm) print 10, trim(input_extension),
ijacob
86 IF (nthreed .gt. 0)
THEN
87 WRITE (nthreed,120) trim(werror(loc_ier_flag))
89 WRITE (nthreed, 10) trim(input_extension),
ijacob
95 10
FORMAT(
' FILE : ',a,/,
' NUMBER OF JACOBIAN RESETS = ',i4,/)
98 IF (
ALLOCATED(br_out))
THEN
99 DEALLOCATE (br_out, bz_out)
subroutine eqfor(br, bz, bsubu, bsubv, tau, rzl_array, ier_flag)
Basis physics analysis and evaluaton of force balance. This is where most of the contents of the thre...
subroutine fileout(ier_flag)
Write the output files.
subroutine funct3d(ier_flag)
Evaluate the three-dimensional MHD energy functional. Think of this as the "forward model" that tells...
real(rprec), dimension(:,:), allocatable rcon
spectral condensation term in
real(rprec), dimension(:), allocatable phip
radial derivative of phi/(2*pi) on half-grid
real(rprec), dimension(:), allocatable, target clmn
real(rprec), dimension(:), pointer azmn_o
real(rprec), dimension(:), allocatable, target blmn
real(rprec), dimension(:), pointer czmn_e
real(rprec), dimension(:), pointer bzmn_o
real(rprec), dimension(:), pointer crmn_e
real(rprec), dimension(:), pointer crmn_o
real(rprec) hs
radial mesh size increment
real(rprec), dimension(:), allocatable phi
toroidal magnetic flux
integer iequi
counter used to call -EQFOR- at end of run
integer first
"counter" monitoring sign of jacobian; resets R, Z, and Lambda when jacobian changes sign and decreas...
integer ijacob
counter for number of times jacobian changes sign
real(rprec) signgs
sign of Jacobian : must be =1 (right-handed) or =-1 (left-handed)
integer, parameter successful_term_flag
integer, parameter norm_term_flag
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 xsave
subroutine wrout(bsq, gsqrt, bsubu, bsubv, bsubs, bsupv, bsupu, rzl_array, gc_array, ier_flag)
Write the output files of VMEC.