SPEC 3.20
Stepped Pressure Equilibrium Code
allglobal Module Reference

global variable storage used as "workspace" throughout the code More...

Functions/Subroutines

subroutine build_vector_potential (lvol, iocons, aderiv, tderiv)
 
subroutine set_mpi_comm (comm)
 
subroutine read_inputlists_from_file ()
 
subroutine write_spec_namelist ()
 
subroutine check_inputs ()
 
subroutine broadcast_inputs
 
subroutine wrtend
 The restart file is written.
 
subroutine ismyvolume (vvol)
 Check if volume vvol is associated to the corresponding MPI node. More...
 
subroutine whichcpuid (vvol, cpu_id)
 Returns which MPI node is associated to a given volume.
 

Variables

integer myid
 MPI rank of current CPU.
 
integer ncpu
 number of MPI tasks
 
integer ismyvolumevalue
 flag to indicate if a CPU is operating on its assigned volume
 
real cpus
 initial time
 
integer mpi_comm_spec
 SPEC MPI communicator.
 
logical skip_write = .false.
 
real pi2nfp
 
real pi2pi2nfp
 
real pi2pi2nfphalf
 
real pi2pi2nfpquart
 
character(len=1000) ext
 
real forceerr
 total force-imbalance
 
real energy
 MHD energy.
 
real bnserr
 (in freeboundary) error in self-consistency of field on plasma boundary (Picard iteration)
 
real, dimension(:), allocatable ipdt
 
real, dimension(:,:), allocatable ipdtdpf
 Toroidal pressure-driven current.
 
integer mvol
 
logical yesstellsym
 internal shorthand copies of Istellsym, which is an integer input;
 
logical notstellsym
 internal shorthand copies of Istellsym, which is an integer input;
 
logical yesmatrixfree
 
logical notmatrixfree
 to use matrix-free method or not
 
real, dimension(:,:), allocatable cheby
 local workspace for evaluation of Chebychev polynomials
 
real, dimension(:,:,:), allocatable zernike
 local workspace for evaluation of Zernike polynomials
 
real, dimension(:,:,:), allocatable tt
 derivatives of Chebyshev polynomials at the inner and outer interfaces;
 
real, dimension(:,:,:,:), allocatable rtt
 derivatives of Zernike polynomials at the inner and outer interfaces;
 
real, dimension(:,:), allocatable rtm
 \(r^m\) term of Zernike polynomials at the origin
 
real, dimension(:), allocatable zernikedof
 Zernike degree of freedom for each \(m\).
 
integer mne
 enhanced resolution for metric elements
 
integer, dimension(:), allocatable ime
 enhanced poloidal mode numbers for metric elements
 
integer, dimension(:), allocatable ine
 enhanced toroidal mode numbers for metric elements
 
integer mns
 enhanced resolution for straight field line transformation
 
integer, dimension(:), allocatable ims
 enhanced poloidal mode numbers for straight field line transformation
 
integer, dimension(:), allocatable ins
 enhanced toroidal mode numbers for straight field line transformation
 
integer lmpol
 what is this?
 
integer lntor
 what is this?
 
integer smpol
 what is this?
 
integer sntor
 what is this?
 
real xoffset = 1.0
 used to normalize NAG routines (which ones exacly where?)
 
logical, dimension(:), allocatable imagneticok
 used to indicate if Beltrami fields have been correctly constructed;
 
logical iconstraintok
 Used to break iteration loops of slaves in the global constraint minimization.
 
real, dimension(:,:), allocatable beltramierror
 to store the integral of |curlB-mu*B| computed by jo00aa;
 
integer mn
 total number of Fourier harmonics for coordinates/fields; calculated from Mpol, Ntor in readin()
 
integer, dimension(:), allocatable im
 poloidal mode numbers for Fourier representation
 
integer, dimension(:), allocatable in
 toroidal mode numbers for Fourier representation
 
real, dimension(:), allocatable halfmm
 I saw this already somewhere...
 
real, dimension(:), allocatable regumm
 I saw this already somewhere...
 
real rscale
 no idea
 
real, dimension(:,:), allocatable psifactor
 no idea
 
real, dimension(:,:), allocatable inifactor
 no idea
 
real, dimension(:), allocatable bbweight
 weight on force-imbalance harmonics; used in dforce()
 
real, dimension(:), allocatable mmpp
 spectral condensation factors
 
real, dimension(:,:), allocatable irbc
 cosine R harmonics of interface surface geometry; stellarator symmetric
 
real, dimension(:,:), allocatable izbs
 sine Z harmonics of interface surface geometry; stellarator symmetric
 
real, dimension(:,:), allocatable irbs
 sine R harmonics of interface surface geometry; non-stellarator symmetric
 
real, dimension(:,:), allocatable izbc
 cosine Z harmonics of interface surface geometry; non-stellarator symmetric
 
real, dimension(:,:), allocatable drbc
 cosine R harmonics of interface surface geometry; stellarator symmetric; linear deformation
 
real, dimension(:,:), allocatable dzbs
 sine Z harmonics of interface surface geometry; stellarator symmetric; linear deformation
 
real, dimension(:,:), allocatable drbs
 sine R harmonics of interface surface geometry; non-stellarator symmetric; linear deformation
 
real, dimension(:,:), allocatable dzbc
 cosine Z harmonics of interface surface geometry; non-stellarator symmetric; linear deformation
 
real, dimension(:,:), allocatable irij
 interface surface geometry; real space
 
real, dimension(:,:), allocatable izij
 interface surface geometry; real space
 
real, dimension(:,:), allocatable drij
 interface surface geometry; real space
 
real, dimension(:,:), allocatable dzij
 interface surface geometry; real space
 
real, dimension(:,:), allocatable trij
 interface surface geometry; real space
 
real, dimension(:,:), allocatable tzij
 interface surface geometry; real space
 
real, dimension(:), allocatable ivns
 sine harmonics of vacuum normal magnetic field on interfaces; stellarator symmetric
 
real, dimension(:), allocatable ibns
 sine harmonics of plasma normal magnetic field on interfaces; stellarator symmetric
 
real, dimension(:), allocatable ivnc
 cosine harmonics of vacuum normal magnetic field on interfaces; non-stellarator symmetric
 
real, dimension(:), allocatable ibnc
 cosine harmonics of plasma normal magnetic field on interfaces; non-stellarator symmetric
 
real, dimension(:), allocatable lrbc
 local workspace
 
real, dimension(:), allocatable lzbs
 local workspace
 
real, dimension(:), allocatable lrbs
 local workspace
 
real, dimension(:), allocatable lzbc
 local workspace
 
integer num_modes
 
integer, dimension(:), allocatable mmrzrz
 
integer, dimension(:), allocatable nnrzrz
 
real, dimension(:,:,:), allocatable allrzrz
 
integer nt
 discrete resolution along \(\theta\) of grid in real space
 
integer nz
 discrete resolution along \(\zeta\) of grid in real space
 
integer ntz
 discrete resolution; Ntz=Nt*Nz shorthand
 
integer hnt
 discrete resolution; Ntz=Nt*Nz shorthand
 
integer hnz
 discrete resolution; Ntz=Nt*Nz shorthand
 
real sontz
 one / sqrt (one*Ntz); shorthand
 
real, dimension(:,:,:), allocatable rij
 real-space grid; R
 
real, dimension(:,:,:), allocatable zij
 real-space grid; Z
 
real, dimension(:,:,:), allocatable xij
 what is this?
 
real, dimension(:,:,:), allocatable yij
 what is this?
 
real, dimension(:,:), allocatable sg
 real-space grid; jacobian and its derivatives
 
real, dimension(:,:,:,:), allocatable guvij
 real-space grid; metric elements
 
real, dimension(:,:,:), allocatable gvuij
 real-space grid; metric elements (?); 10 Dec 15;
 
real, dimension(:,:,:,:), allocatable guvijsave
 what is this?
 
integer, dimension(:,:), allocatable ki
 identification of Fourier modes
 
integer, dimension(:,:,:), allocatable kijs
 identification of Fourier modes
 
integer, dimension(:,:,:), allocatable kija
 identification of Fourier modes
 
integer, dimension(:), allocatable iotakkii
 identification of Fourier modes
 
integer, dimension(:,:), allocatable iotaksub
 identification of Fourier modes
 
integer, dimension(:,:), allocatable iotakadd
 identification of Fourier modes
 
integer, dimension(:,:), allocatable iotaksgn
 identification of Fourier modes
 
real, dimension(:), allocatable efmn
 Fourier harmonics; dummy workspace.
 
real, dimension(:), allocatable ofmn
 Fourier harmonics; dummy workspace.
 
real, dimension(:), allocatable cfmn
 Fourier harmonics; dummy workspace.
 
real, dimension(:), allocatable sfmn
 Fourier harmonics; dummy workspace.
 
real, dimension(:), allocatable evmn
 Fourier harmonics; dummy workspace.
 
real, dimension(:), allocatable odmn
 Fourier harmonics; dummy workspace.
 
real, dimension(:), allocatable comn
 Fourier harmonics; dummy workspace.
 
real, dimension(:), allocatable simn
 Fourier harmonics; dummy workspace.
 
real, dimension(:), allocatable ijreal
 what is this ?
 
real, dimension(:), allocatable ijimag
 what is this ?
 
real, dimension(:), allocatable jireal
 what is this ?
 
real, dimension(:), allocatable jiimag
 what is this ?
 
real, dimension(:), allocatable jkreal
 what is this ?
 
real, dimension(:), allocatable jkimag
 what is this ?
 
real, dimension(:), allocatable kjreal
 what is this ?
 
real, dimension(:), allocatable kjimag
 what is this ?
 
real, dimension(:,:,:), allocatable bsupumn
 tangential field on interfaces; \(\theta\)-component; required for virtual casing construction of field; 11 Oct 12
 
real, dimension(:,:,:), allocatable bsupvmn
 tangential field on interfaces; \(\zeta\) -component; required for virtual casing construction of field; 11 Oct 12
 
real, dimension(:,:), allocatable goomne
 described in preset()
 
real, dimension(:,:), allocatable goomno
 described in preset()
 
real, dimension(:,:), allocatable gssmne
 described in preset()
 
real, dimension(:,:), allocatable gssmno
 described in preset()
 
real, dimension(:,:), allocatable gstmne
 described in preset()
 
real, dimension(:,:), allocatable gstmno
 described in preset()
 
real, dimension(:,:), allocatable gszmne
 described in preset()
 
real, dimension(:,:), allocatable gszmno
 described in preset()
 
real, dimension(:,:), allocatable gttmne
 described in preset()
 
real, dimension(:,:), allocatable gttmno
 described in preset()
 
real, dimension(:,:), allocatable gtzmne
 described in preset()
 
real, dimension(:,:), allocatable gtzmno
 described in preset()
 
real, dimension(:,:), allocatable gzzmne
 described in preset()
 
real, dimension(:,:), allocatable gzzmno
 described in preset()
 
real, dimension(:,:,:,:), allocatable dtoocc
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable dtoocs
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable dtoosc
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable dtooss
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable ttsscc
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable ttsscs
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable ttsssc
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable ttssss
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable tdstcc
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable tdstcs
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable tdstsc
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable tdstss
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable tdszcc
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable tdszcs
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable tdszsc
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable tdszss
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable ddttcc
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable ddttcs
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable ddttsc
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable ddttss
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable ddtzcc
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable ddtzcs
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable ddtzsc
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable ddtzss
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable ddzzcc
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable ddzzcs
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable ddzzsc
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:,:,:), allocatable ddzzss
 volume-integrated Chebychev-metrics; see matrix()
 
real, dimension(:,:), allocatable tsc
 what is this?
 
real, dimension(:,:), allocatable tss
 what is this?
 
real, dimension(:,:), allocatable dtc
 what is this?
 
real, dimension(:,:), allocatable dts
 what is this?
 
real, dimension(:,:), allocatable dzc
 what is this?
 
real, dimension(:,:), allocatable dzs
 what is this?
 
real, dimension(:,:), allocatable ttc
 what is this?
 
real, dimension(:,:), allocatable tzc
 what is this?
 
real, dimension(:,:), allocatable tts
 what is this?
 
real, dimension(:,:), allocatable tzs
 what is this?
 
real, dimension(:), allocatable dtflux
 \(\delta \psi_{toroidal}\) in each annulus
 
real, dimension(:), allocatable dpflux
 \(\delta \psi_{poloidal}\) in each annulus
 
real, dimension(:), allocatable sweight
 minimum poloidal length constraint weight
 
integer, dimension(:), allocatable nadof
 degrees of freedom in Beltrami fields in each annulus
 
integer, dimension(:), allocatable nfielddof
 degrees of freedom in Beltrami fields in each annulus, field only, no Lagrange multipliers
 
type(subgrid), dimension(:,:,:), allocatable ate
 magnetic vector potential cosine Fourier harmonics; stellarator-symmetric
 
type(subgrid), dimension(:,:,:), allocatable aze
 magnetic vector potential cosine Fourier harmonics; stellarator-symmetric
 
type(subgrid), dimension(:,:,:), allocatable ato
 magnetic vector potential sine Fourier harmonics; non-stellarator-symmetric
 
type(subgrid), dimension(:,:,:), allocatable azo
 magnetic vector potential sine Fourier harmonics; non-stellarator-symmetric
 
integer, dimension(:,:), allocatable lma
 Lagrange multipliers (?)
 
integer, dimension(:,:), allocatable lmb
 Lagrange multipliers (?)
 
integer, dimension(:,:), allocatable lmc
 Lagrange multipliers (?)
 
integer, dimension(:,:), allocatable lmd
 Lagrange multipliers (?)
 
integer, dimension(:,:), allocatable lme
 Lagrange multipliers (?)
 
integer, dimension(:,:), allocatable lmf
 Lagrange multipliers (?)
 
integer, dimension(:,:), allocatable lmg
 Lagrange multipliers (?)
 
integer, dimension(:,:), allocatable lmh
 Lagrange multipliers (?)
 
real, dimension(:,:), allocatable lmavalue
 what is this?
 
real, dimension(:,:), allocatable lmbvalue
 what is this?
 
real, dimension(:,:), allocatable lmcvalue
 what is this?
 
real, dimension(:,:), allocatable lmdvalue
 what is this?
 
real, dimension(:,:), allocatable lmevalue
 what is this?
 
real, dimension(:,:), allocatable lmfvalue
 what is this?
 
real, dimension(:,:), allocatable lmgvalue
 what is this?
 
real, dimension(:,:), allocatable lmhvalue
 what is this?
 
integer, dimension(:,:), allocatable fso
 what is this?
 
integer, dimension(:,:), allocatable fse
 what is this?
 
logical lcoordinatesingularity
 set by LREGION macro; true if inside the innermost volume
 
logical lplasmaregion
 set by LREGION macro; true if inside the plasma region
 
logical lvacuumregion
 set by LREGION macro; true if inside the vacuum region
 
logical lsavedguvij
 flag used in matrix free
 
logical localconstraint
 what is this?
 
real, dimension(:,:), allocatable dma
 energy and helicity matrices; quadratic forms
 
real, dimension(:,:), allocatable dmb
 energy and helicity matrices; quadratic forms
 
real, dimension(:,:), allocatable dmd
 energy and helicity matrices; quadratic forms
 
real, dimension(:), allocatable dmas
 sparse version of dMA, data
 
real, dimension(:), allocatable dmds
 sparse version of dMD, data
 
integer, dimension(:), allocatable idmas
 sparse version of dMA and dMD, indices
 
integer, dimension(:), allocatable jdmas
 sparse version of dMA and dMD, indices
 
integer, dimension(:), allocatable ndmasmax
 number of elements for sparse matrices
 
integer, dimension(:), allocatable ndmas
 number of elements for sparse matrices
 
real, dimension(:), allocatable dmg
 what is this?
 
real, dimension(:), allocatable adotx
 the matrix-vector product
 
real, dimension(:), allocatable ddotx
 the matrix-vector product
 
real, dimension(:,:), allocatable solution
 this is allocated in dforce; used in mp00ac and ma02aa; and is passed to packab
 
real, dimension(:,:,:), allocatable gmreslastsolution
 used to store the last solution for restarting GMRES
 
real, dimension(:), allocatable mbpsi
 matrix vector products
 
logical liluprecond
 whether to use ILU preconditioner for GMRES
 
real, dimension(:,:), allocatable beltramiinverse
 Beltrami inverse matrix.
 
real, dimension(:,:,:), allocatable diotadxup
 measured rotational transform on inner/outer interfaces for each volume; d(transform)/dx; (see dforce)
 
real, dimension(:,:,:), allocatable ditgpdxtp
 measured toroidal and poloidal current on inner/outer interfaces for each volume; d(Itor,Gpol)/dx; (see dforce)
 
real, dimension(:,:,:,:), allocatable glambda
 save initial guesses for iterative calculation of rotational-transform
 
integer lmns
 number of independent degrees of freedom in angle transformation;
 
real, dimension(:,:,:), allocatable dlambdaout
 
real, dimension(:,:,:), allocatable bemn
 force vector; stellarator-symmetric (?)
 
real, dimension(:,:), allocatable iomn
 force vector; stellarator-symmetric (?)
 
real, dimension(:,:,:), allocatable somn
 force vector; non-stellarator-symmetric (?)
 
real, dimension(:,:,:), allocatable pomn
 force vector; non-stellarator-symmetric (?)
 
real, dimension(:,:,:), allocatable bomn
 force vector; stellarator-symmetric (?)
 
real, dimension(:,:), allocatable iemn
 force vector; stellarator-symmetric (?)
 
real, dimension(:,:,:), allocatable semn
 force vector; non-stellarator-symmetric (?)
 
real, dimension(:,:,:), allocatable pemn
 force vector; non-stellarator-symmetric (?)
 
real, dimension(:), allocatable bbe
 force vector (?); stellarator-symmetric (?)
 
real, dimension(:), allocatable iio
 force vector (?); stellarator-symmetric (?)
 
real, dimension(:), allocatable bbo
 force vector (?); non-stellarator-symmetric (?)
 
real, dimension(:), allocatable iie
 force vector (?); non-stellarator-symmetric (?)
 
real, dimension(:,:,:), allocatable btemn
 covariant \(\theta\) cosine component of the tangential field on interfaces; stellarator-symmetric
 
real, dimension(:,:,:), allocatable bzemn
 covariant \(\zeta\) cosine component of the tangential field on interfaces; stellarator-symmetric
 
real, dimension(:,:,:), allocatable btomn
 covariant \(\theta\) sine component of the tangential field on interfaces; non-stellarator-symmetric
 
real, dimension(:,:,:), allocatable bzomn
 covariant \(\zeta\) sine component of the tangential field on interfaces; non-stellarator-symmetric
 
real, dimension(:,:), allocatable bloweremn
 covariant field for Hessian computation
 
real, dimension(:,:), allocatable bloweromn
 covariant field for Hessian computation
 
integer lgdof
 geometrical degrees of freedom associated with each interface
 
integer ngdof
 total geometrical degrees of freedom
 
real, dimension(:,:,:), allocatable dbbdrz
 derivative of magnetic field w.r.t. geometry (?)
 
real, dimension(:,:), allocatable diidrz
 derivative of spectral constraints w.r.t. geometry (?)
 
real, dimension(:,:,:,:,:), allocatable dffdrz
 derivatives of B^2 at the interfaces wrt geometry
 
real, dimension(:,:,:,:), allocatable dbbdmp
 derivatives of B^2 at the interfaces wrt mu and dpflux
 
real, dimension(:,:,:,:,:), allocatable hdffdrz
 derivatives of B^2 at the interfaces wrt geometry 2D Hessian;
 
real, dimension(:,:,:,:,:), allocatable denergydrr
 derivatives of energy at the interfaces wrt geometry 3D Hessian;
 
real, dimension(:,:,:,:,:), allocatable denergydrz
 derivatives of energy at the interfaces wrt geometry 3D Hessian;
 
real, dimension(:,:,:,:,:), allocatable denergydzr
 derivatives of energy at the interfaces wrt geometry 3D Hessian;
 
real, dimension(:,:,:,:,:), allocatable denergydzz
 derivatives of energy at the interfaces wrt geometry 3D Hessian;
 
real, dimension(:,:,:,:,:), allocatable dmupfdx
 derivatives of mu and dpflux wrt geometry at constant interface transform
 
logical lhessianallocated
 flag to indicate that force gradient matrix is allocated (?)
 
real, dimension(:,:), allocatable hessian
 force gradient matrix (?)
 
real, dimension(:,:), allocatable dessian
 derivative of force gradient matrix (?)
 
logical lhessian2dallocated
 flag to indicate that 2D Hessian matrix is allocated (?)
 
real, dimension(:,:), allocatable hessian2d
 Hessian 2D.
 
real, dimension(:,:), allocatable dessian2d
 derivative Hessian 2D
 
logical lhessian3dallocated
 flag to indicate that 2D Hessian matrix is allocated (?)
 
real, dimension(:,:), allocatable hessian3d
 Hessian 3D.
 
real, dimension(:,:), allocatable dessian3d
 derivative Hessian 3D
 
real, dimension(:,:), allocatable cosi
 some precomputed cosines
 
real, dimension(:,:), allocatable sini
 some precomputed sines
 
real, dimension(:), allocatable gteta
 something related to \(\sqrt g\) and \(\theta\) ?
 
real, dimension(:), allocatable gzeta
 something related to \(\sqrt g\) and \(\zeta\) ?
 
real, dimension(:), allocatable ajk
 definition of coordinate axis
 
real, dimension(:,:,:,:), allocatable dradr
 derivatives of coordinate axis
 
real, dimension(:,:,:,:), allocatable dradz
 derivatives of coordinate axis
 
real, dimension(:,:,:,:), allocatable dzadr
 derivatives of coordinate axis
 
real, dimension(:,:,:,:), allocatable dzadz
 derivatives of coordinate axis
 
real, dimension(:,:,:), allocatable drodr
 derivatives of coordinate axis
 
real, dimension(:,:,:), allocatable drodz
 derivatives of coordinate axis
 
real, dimension(:,:,:), allocatable dzodr
 derivatives of coordinate axis
 
real, dimension(:,:,:), allocatable dzodz
 derivatives of coordinate axis
 
integer, dimension(:,:), allocatable djkp
 for calculating cylindrical volume
 
integer, dimension(:,:), allocatable djkm
 for calculating cylindrical volume
 
real, dimension(:), allocatable lbbintegral
 B.B integral.
 
real, dimension(:), allocatable labintegral
 A.B integral.
 
real, dimension(:), allocatable vvolume
 volume integral of \(\sqrt g\); computed in volume
 
real dvolume
 derivative of volume w.r.t. interface geometry
 
integer ivol
 labels volume; some subroutines (called by NAG) are fixed argument list but require the volume label
 
real gbzeta
 toroidal (contravariant) field; calculated in bfield; required to convert \(\dot \theta\) to \(B^\theta\), \(\dot s\) to \(B^s\)
 
integer, dimension(:), allocatable iquad
 internal copy of Nquad
 
real, dimension(:,:), allocatable gaussianweight
 weights for Gaussian quadrature
 
real, dimension(:,:), allocatable gaussianabscissae
 abscissae for Gaussian quadrature
 
logical lblinear
 controls selection of Beltrami field solver; depends on LBeltrami
 
logical lbnewton
 controls selection of Beltrami field solver; depends on LBeltrami
 
logical lbsequad
 controls selection of Beltrami field solver; depends on LBeltrami
 
real, dimension(1:3) orzp
 used in mg00aa() to determine \((s,\theta,\zeta)\) given \((R,Z,\varphi)\)
 
type(derivativedbdx
 \({\rm d}\mathbf{B}/{\rm d}\mathbf{X}\) (?)
 
integer globaljk
 labels position
 
real, dimension(:,:), allocatable dxyz
 computational boundary; position
 
real, dimension(:,:), allocatable nxyz
 computational boundary; normal
 
real, dimension(:,:), allocatable jxyz
 plasma boundary; surface current
 
real, dimension(1:2) tetazeta
 what is this?
 
real virtualcasingfactor = -one / (four*pi)
 this agrees with diagno
 
integer iberror
 for computing error in magnetic field
 
integer nfreeboundaryiterations
 number of free-boundary iterations already performed
 
integer, parameter node = 2
 best to make this global for consistency between calling and called routines
 
logical first_free_bound = .false.
 flag to indicate that this is the first free-boundary iteration
 

Detailed Description

global variable storage used as "workspace" throughout the code

Function/Subroutine Documentation

◆ check_inputs()

subroutine allglobal::check_inputs

reading of physicslist

  • The internal variable, Mvol=Nvol+Lfreebound , gives the number of computational domains.
  • The input value for the fluxes enclosed within each interface, tflux(1:Mvol) and tflux(1:Mvol), are immediately normalized:

    tflux(1:Mvol) \(\rightarrow\) tflux(1:Mvol)/tflux(Nvol).

    pflux(1:Mvol) \(\rightarrow\) pflux(1:Mvol)/tflux(Nvol).

    The input \(\Phi_{edge} \equiv \) phiedge will provide the total toroidal flux; see preset().

  • The input value for the toroidal current constraint (Isurf(1:Mvol) and Ivolume(1:Mvol) ) are also immediately normalized, using curtor . \(Ivolume \rightarrow Ivolume \cdot \frac{curtor}{\sum_i Isurf_i + Ivolume_i}\) \(Isurf \rightarrow Isurf \cdot \frac{curtor}{\sum_i Isurf_i + Ivolume_i}\)

Current profiles normalization

In case of a free boundary calculation (Lfreebound=1) and using a current constraint (Lconstraint=3), the current profiles are renormalized in order to match the linking current curtor. More specifically,

\begin{eqnarray} Isurf_i & \rightarrow\ Isurf_i \cdot \frac{curtor}{\sum_{i=1}^{Mvol-1} Isurf_i+Ivol_i} Ivol_i & \rightarrow\ Ivol_i \cdot \frac{curtor}{\sum_{i=1}^{Mvol-1} Isurf_i+Ivol_i} \end{eqnarray}

Finally, the volume current in the vacuum region is set to \(0\).

reading of numericlist

reading of locallist

reading of globallist

reading of diagnosticslist

reading of screenlist

References inputlist::bnc, inputlist::c05factor, inputlist::c05xmax, inputlist::c05xtol, cpus, inputlist::curpol, inputlist::curtor, dforce(), inputlist::dpp, inputlist::dqq, inputlist::drz, inputlist::epsgmres, inputlist::epsilon, inputlist::epsilu, inputlist::escale, inputlist::forcetol, inputlist::gamma, inputlist::gbnbld, inputlist::gbntol, inputlist::helicity, inputlist::igeometry, inputlist::imethod, inputlist::impol, in, inputlist::intor, inputlist::iorder, inputlist::iotatol, inputlist::iprecon, inputlist::istellsym, inputlist::isurf, inputlist::ivolume, inputlist::ladiabatic, inputlist::lautoinitbn, inputlist::lbeltrami, inputlist::lcheck, inputlist::lconstraint, inputlist::lextrap, inputlist::lfindzero, inputlist::lfreebound, inputlist::lgmresprec, inputlist::lhevalues, inputlist::lhevectors, inputlist::lhmatrix, inputlist::linitgues, inputlist::linitialize, inputlist::lmatsolver, inputlist::lperturbed, inputlist::lrad, inputlist::lreadgf, inputlist::lreflect, inputlist::lrzaxis, inputlist::lsparse, inputlist::lsvdiota, inputlist::ltiming, inputlist::lzerovac, numerical::machprec, inputlist::mfreeits, inputlist::mmpol, inputlist::mntor, inputlist::mnvol, inputlist::mpol, inputlist::mregular, inputlist::mu, inputlist::mupfits, inputlist::mupftol, inputlist::ndiscrete, inputlist::nfp, inputlist::nitergmres, inputlist::nppts, inputlist::nquad, inputlist::ntor, inputlist::ntoraxis, inputlist::nvol, inputlist::odetol, constants::one, inputlist::opsilon, fileunits::ounit, inputlist::pcondense, inputlist::pflux, inputlist::phiedge, inputlist::pressure, inputlist::pscale, inputlist::rbs, inputlist::rpol, inputlist::rtor, inputlist::rws, numerical::small, inputlist::tflux, inputlist::upsilon, inputlist::vcasingeps, inputlist::vcasingits, inputlist::vcasingper, inputlist::vcasingtol, inputlist::vnc, numerical::vsmall, inputlist::wpoloidal, inputlist::wreadin, inputlist::zbc, constants::zero, and inputlist::zwc.

Referenced by xspech().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ broadcast_inputs()

subroutine allglobal::broadcast_inputs

broadcast physicslist

broadcast numericlist

broadcast globallist

broadcast locallist

broadcast diagnosticslist

broadcast screenlist

References inputlist::adiabatic, inputlist::c05factor, inputlist::c05xmax, inputlist::c05xtol, cpus, inputlist::curpol, inputlist::curtor, inputlist::dpp, inputlist::dqq, inputlist::drz, inputlist::epsgmres, inputlist::epsilon, inputlist::epsilu, inputlist::escale, inputlist::forcetol, inputlist::gamma, inputlist::gbnbld, inputlist::gbntol, inputlist::helicity, inputlist::igeometry, inputlist::imethod, inputlist::impol, inputlist::intor, inputlist::iorder, inputlist::iota, inputlist::iotatol, inputlist::iprecon, inputlist::istellsym, inputlist::isurf, inputlist::ivolume, inputlist::ladiabatic, inputlist::lautoinitbn, inputlist::lbeltrami, inputlist::lcheck, inputlist::lconstraint, inputlist::lerrortype, inputlist::lextrap, inputlist::lfindzero, inputlist::lfreebound, inputlist::lgmresprec, inputlist::lhevalues, inputlist::lhevectors, inputlist::lhmatrix, inputlist::linitgues, inputlist::linitialize, inputlist::lmatsolver, inputlist::lp, inputlist::lperturbed, inputlist::lq, inputlist::lrad, inputlist::lreadgf, inputlist::lreflect, inputlist::lrzaxis, inputlist::lsparse, inputlist::lsvdiota, inputlist::ltiming, inputlist::ltransform, inputlist::lzerovac, inputlist::maxrndgues, inputlist::mfreeits, inputlist::mnvol, inputlist::mpol, inputlist::mregular, inputlist::mu, inputlist::mupfits, inputlist::mupftol, inputlist::ndiscrete, inputlist::nfp, inputlist::ngrid, inputlist::nitergmres, inputlist::nppts, inputlist::nptrj, inputlist::nquad, inputlist::ntor, inputlist::ntoraxis, inputlist::nvol, inputlist::odetol, inputlist::oita, inputlist::opsilon, fileunits::ounit, inputlist::pcondense, inputlist::pflux, inputlist::phiedge, inputlist::pl, inputlist::ppts, inputlist::pr, inputlist::pressure, inputlist::pscale, inputlist::ql, inputlist::qr, inputlist::rp, inputlist::rpol, inputlist::rq, inputlist::rtor, inputlist::tflux, inputlist::upsilon, inputlist::vcasingeps, inputlist::vcasingits, inputlist::vcasingper, inputlist::vcasingtol, inputlist::wmacros, inputlist::wpoloidal, inputlist::wreadin, and inputlist::wwrtend.

Referenced by xspech().

Here is the caller graph for this function:

◆ ismyvolume()

subroutine allglobal::ismyvolume ( integer, intent(in vvol)

Check if volume vvol is associated to the corresponding MPI node.

The global variable IsMyVolumeValue is updated to 0 or 1, depending on vvol . A value of -1 is set if an error occured.

Parameters
vvolvolume to check

References ismyvolumevalue, myid, and ncpu.

Referenced by brcast(), dforce(), dfp100(), dfp200(), evaluate_dmupfdx(), and final_diagnostics().

Here is the caller graph for this function: