18 LOGICAL,
INTENT(in) :: linterp
19 INTEGER,
INTENT(in) :: neqs_old
21 INTEGER :: ndim, nsp1, istat1
22 REAL(rprec),
DIMENSION(:),
ALLOCATABLE :: xc_old, scalxc_old
27 IF (neqs_old .gt. 0 .and.
ALLOCATED(
scalxc) .and. linterp)
THEN
29 ALLOCATE(xc_old(neqs_old), scalxc_old(neqs_old), stat=istat1)
30 IF (istat1.ne.0) stop
'allocation error #1 in allocate_ns'
31 xc_old(:neqs_old) =
xc(:neqs_old)
32 scalxc_old(:neqs_old) =
scalxc(:neqs_old)
40 IF (istat1.ne.0) stop
'allocation error #2 in allocate_ns'
43 ALLOCATE(
ireflect(ns*nzeta), stat=istat1)
44 IF (istat1.ne.0) stop
'allocation error #3 in allocate_ns'
46 ALLOCATE(
ard(nsp1,2),
arm(nsp1,2),
brd(nsp1,2),
brm(nsp1,2), &
48 sm(ns),
sp(0:ns),
bmin(ntheta2,ns),
bmax(ntheta2,ns), stat=istat1)
49 IF (istat1.ne.0) stop
'allocation error #6 in allocate_ns'
62 IF (istat1.ne.0) stop
'allocation error #7 in allocate_ns'
67 IF (istat1.ne.0) stop
'allocation error #9 in allocate_ns'
70 IF (.not.
ALLOCATED(
xc))
THEN
72 IF (istat1.ne.0) stop
'allocation error #10 in allocate_ns'
77 IF (
ALLOCATED(xc_old))
THEN
78 xstore(1:neqs_old) = xc_old(1:neqs_old)
79 scalxc(1:neqs_old) = scalxc_old(1:neqs_old)
80 DEALLOCATE (xc_old, scalxc_old)
subroutine allocate_funct3d
allocate arrays required in funct3d()
subroutine allocate_ns(linterp, neqs_old)
allocate arrays depending on the number of flux surfaces ns
subroutine free_mem_ns
Free memory depending on the number of flux surfaces ns.
real(rprec), dimension(:), allocatable wint
two-dimensional array for normalizing angle integrations
real(rprec), dimension(:), allocatable sqrts
sqrt(s), two-dimensional array on full-grid
real(rprec), dimension(:), allocatable chip
radial derivative of chi/(2*pi) on half-grid
real(rprec), dimension(:), allocatable shalf
sqrt(s) ,two-dimensional array on half-grid
real(rprec), dimension(:), allocatable phip
radial derivative of phi/(2*pi) on half-grid
real(rprec), dimension(:), allocatable dlam
real(rprec), dimension(:), allocatable equif
radial force balance error: grad(p) - <j x B>
real(rprec), dimension(:,:), allocatable ygeo
real(rprec), dimension(:), allocatable vp
radial derivative of enclosed volume
real(rprec), dimension(:), allocatable bvco
enclosed poloidal current profile
real(rprec), dimension(:), allocatable buco
enclosed toroidal current profile
real(rprec), dimension(:), allocatable crd
real(rprec), dimension(:), allocatable sp
shalf(i+1)/sfull(i)
real(rprec), dimension(:,:), allocatable brd
real(rprec), dimension(:), allocatable jcuru
poloidal current density
real(rprec), dimension(:,:), allocatable azd
real(rprec), dimension(:,:), allocatable ytrian
real(rprec), dimension(:,:,:,:), allocatable faclam
real(rprec), dimension(:,:), allocatable bmax
real(rprec), dimension(:), allocatable chips
poloidal flux (same as chip), one-dimensional array
real(rprec), dimension(:), allocatable presf
pressure profile on full-grid, mass/phip**gamma
real(rprec), dimension(:), allocatable bdamp
radial mesh-blending factor
real(rprec), dimension(:), allocatable phi
toroidal magnetic flux
integer neqs
total number of equations to evolve (size of xc)
real(rprec), dimension(:), allocatable overr
real(rprec), dimension(:), allocatable sm
shalf(i)/sfull(i)
real(rprec), dimension(:,:), allocatable bmin
real(rprec), dimension(:,:), allocatable brm
real(rprec), dimension(:), allocatable jdotb
real(rprec), dimension(:,:), allocatable bzd
real(rprec), dimension(:,:), allocatable bzm
real(rprec), dimension(:,:), allocatable yinden
real(rprec), dimension(:), allocatable bdotgradv
real(rprec), dimension(:), allocatable clam
real(rprec), dimension(:), allocatable specw
spectral width (diagnostic)
real(rprec), dimension(:), allocatable iotaf
rotational transform (full grid)
real(rprec), dimension(:,:), allocatable yshift
real(rprec), dimension(:), allocatable psi
real(rprec), dimension(:,:), allocatable ard
real(rprec), dimension(:), allocatable pres
pressure profile
real(rprec), dimension(:), allocatable chipf
radial derivative of poloidal magnetic flux (full grid)
real(rprec), dimension(:), allocatable jpar2
real(rprec), dimension(:), allocatable presgrad
pressure gradient: dp/ds
integer, dimension(:), allocatable ireflect
two-dimensional array for computing 2pi-v angle
real(rprec), dimension(:,:), allocatable arm
real(rprec), dimension(:), allocatable bvcof
real(rprec), dimension(:), allocatable blam
real(rprec), dimension(:), allocatable chi
poloidal magnetic flux
real(rprec), dimension(:), allocatable phips
toroidal flux (same as phip), one-dimensional array
real(rprec), dimension(:), allocatable mass
mass profile on half-grid
real(rprec), dimension(:), allocatable bdotb
real(rprec), dimension(:), allocatable bucof
real(rprec), dimension(:), allocatable beta_vol
real(rprec), dimension(:), allocatable iotas
rotational transform , on half radial mesh
real(rprec), dimension(:,:), allocatable azm
real(rprec), dimension(:), allocatable jperp2
real(rprec), dimension(:), allocatable phipf
radial derivative of toroidal magnetic flux (full grid)
real(rprec), dimension(:), allocatable tcon
constraint-force multiplier
real(rprec), dimension(:,:), allocatable yellip
real(rprec), dimension(:), allocatable icurv
(-)toroidal current inside flux surface (vanishes like s)
real(rprec), dimension(:), allocatable vpphi
real(rprec), dimension(:), allocatable jcurv
toroidal current density
integer ntmax
number of contributing Fourier basis function (can be 1, 2 or 4); assigned in read_indata()
real(rprec), dimension(:), allocatable gc_mhd
real(rprec), dimension(:), allocatable gc_con
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
real(rprec), dimension(:), allocatable scalxc
real(rprec), dimension(:), allocatable xcdot
"velocity": change of Fourier coefficients per time step
real(rprec), dimension(:), allocatable xstore
backup copy of last-known-good xc