LION
 All Classes Files Functions Variables Pages
List and description of input variables

Lists and description of input variables required for running LION

Author
L. Villard
Date
03/2018

Introduction

The LION code needs the following inputs:

  • A namelist NEWRUN in std input
  • A namelist NEWRUN as produced by the CHEASE code (NSAVE, TAPE8)
  • Tables of equilibrium coefficients (MEQ, TAPE4)
  • Tables of boundary quantities (NVAC, TAPE17)
  • Tables of (r,z) quantities (NDES, TAPE16)

In the so-called 'stand-alone' mode of running LION, in other words the 'legacy' mode, LION actually needs the CHEASE code to be run to produce the files NSAVE, MEQ, NVAC and NDES. These files should be renamed TAPE8, TAPE4, TAPE17 and TAPE16 for inputting LION.

In ITM and IMAS modes of running LION, these quantities are obtained from the corresponding database. [More explanation required here?]

LION namelist NEWRUN

Real variables and arrays

Name Description Default value
acharg(1:mdspec)Atomic charges of ion species [atomic units] 1.0
ad(1:mdad) Coeffs of polynomial for mass density profile, case ndens=-1 (see function densit) 0.0
aheigt Height of plots [not used, obsolete] 22.0
alarg Width of plots [not used, obsolete] 20.0
amass(1:mdspec) Atomic masses of ion species [atomic units] 2.0
amasse Atomic mass of electrons [atomic units] 5.446e-4
anglet(1:16) Toroidal angle for plots [not used, obsolete] 0
antrad Distance antenna-magnetic axis [equatorial minor radius] 1.1
antradmax In case of multiple sheets of antenna (nantsheet>1) 1.15
antup Poloidal angle of upper corner of top/bottom antenna (nantyp=3) [degrees] 70.0
anu phenomenological damping nu/omega (cold model only, nlcold=.t.) 1e-2
arsize arrow size of plots [not used, obsolete] 0.8
aspct inverse aspect ratio [not used, obsolete] 0.333
asymb symbol size of plots [not used, obsolete] 1.2
ate(1:mdad) coeffs of polynomial for Te profile, case ntemp=-1 (see function tempel) 0.0
ati(1:mdad) coeffs of polynomial for Ti_// profile, case ntemp=-1 (see function tempi) 0.0
atip(1:mdad) coeffs of polynomial for Ti_perp profile, case ntemp=-1 (see function temprp) 0.0
bnot magnetic field on magnetic axis [Tesla] 3.4
cen0(1:8) density on axis (for diagnostics only, see subroutine landau) [m^-3] .6..9.0e19
cenden(1:mdspec)number density of ions on magnetic axis [m^-3] 4.0e19
cente Te on axis [eV] 2.0e3
centi(1:mdspec) Ti_// on axis [eV] 2.0e3
centip(1:mdspec)Ti_perp on axis [eV] 2.0e3
ceomci(1:mdspec)Omega_ci on magnetic axis [LION units][not needed as input] ?
cpsrf Poloidal flux at plasma surface [LION units][status unclear]
curasy(1:mdpant)Coeff of sin(m*theta) antenna current for nantyp=+1 or-1 [LION units] 1.0
cursym(1:mdpant)Coeff of cos(m*theta) antenna current for nantyp=+1 or-1[LION units] 1.0
delta Phenomenological damping 0.0
deltaf Frequency increment for frequency scans [Hz] 1000.0
ellipt Ellipticity^2 of Solovev equilibrium [not used, obsolete] 1.0
epsmac Tolerance for LDU matrix decomposition 1e-12
eqalfd Parameter for normalized mass density profile, ndens=2 (see function densit)0.0
eqdens Parameter for normalized mass density profile (see function densit) 0.9
eqfast Parameter for fast ion density profile (see subroutine landau) 0.9
eqkapd Parameter for normalized mass density profile (see function densit) 1.0
eqkapf(1:mdfaka)Parameter for fast ion density profile (see subroutine landau) float(1:mdfaka)
eqkapt(1:mdspec)Parameter for Ti_// and Ti_perp profiles (see functions tempi and temprp) 1.0
eqkpte Parameter for Te profile (see function tempel) 1.0
eqte Parameter for Te profile (see function tempel) 0.9
eqti(1:mdspec) Parameter for Ti_// and Ti_perp profiles (see functions tempi and temprp) 0.9
feedup Poloidal angle of upper feeder of top/bottom antenna (nantyp=3) [degrees] 40.0
frac(1:mdspec) Mass fraction of ion species [not needed as input] ?
frcen(1:mdspec) [obsolete] 0.0
frdel(1:mdspec) [obsolete] 0.0
freqcy Antenna frequency [Hz] 33.0e6
omega Antenna frequency [LION units] [not needed as input] ?
qiaxe 1/q on magnetic axis [should NOT be here - obtained from CHEASE] 1.0?
rmajor Major radius of magnetic axis [m] 3.0
samin Inner edge radial position s of volume 'antenna' inside the plasma 0.1
samax Outer edge radial position s of volume 'antenna' inside the plasma 0.3
sigma Factor for v_thi, see NRL formulary but SI units [not needed as input]?
thant(1:4) LFS/HFS or saddle coil antenna & feeders poloidal angles, nantyp=2,4 [degrees] 68,111,249,292
thantw Poloidal width of saddle coil toroidal conductor, nantyp=4 [degrees] 20.0
time_itm(2) Time slices in [time_itm(1) time_itm(2)] on which to run LION [for nitmopt=1,10,11 only]-1e40
vbirth Birth velocity of fast ions [m/s] 1.3e7
walrad Distance wall-magnetic axis [equatorial minor radius] 1.2
wntdel Stride for toroidal mode number scan 1.0
wntoro Toroidal mode number -1.0
 &   ACHARG,   AD,       AHEIGT,   ALARG,    AMASS,    AMASSE, &
 &   ANGLET,   ANTRAD,   ANTRADMAX,ANTUP,    ANU,      ARSIZE, &
 &   ASPCT,    ASYMB,    ATE,      ATI,      ATIP,     BNOT, &
 &   CEN0,     CENDEN,   CENTE,    CENTI,    CENTIP, &
 &   CEOMCI,   COCOS_IN, COCOS_OUT,CPSRF,    CURASY,   CURSYM,   DELTA,    DELTAF, &
 &   ELLIPT,   EPSMAC,   EQALFD,   EQDENS,   EQFAST,   EQKAPD, &
 &   EQKAPF,   EQKAPT,   EQKPTE,   EQTE,     EQTI,     FEEDUP, &
 &   FRAC,     FRCEN,    FRDEL,    FREQCY,   OMEGA,    QIAXE, &
 &   RMAJOR,   SAMIN,    SAMAX,    SIGMA,    THANT,    THANTW,   TIME_ITM, &
 &   VBIRTH,   WALRAD,   WNTDEL,   WNTORO, &

Integer variables and arrays

Name Description Default value
cocos_in Coordinate Convention for input equilibrium ?
cocos_out Coordinate Convention for output equilibrium ?
length Number of elements in a matrix block [Not needed as an input] -
mancmp Number of poloidal harmonics of the helical antenna current, nantyp=+-1 1
meq I/O channel number for CHEASE equil coeffs eq(i,jchi,js) [should NOT be here - obtained from CHEASE]4
mfl Lower poloidal Fourier mode number for diagnostics -7
mpolwn(mdpant) Poloidal mode numbers of helical and top/bottom antennas, nantyp =+-1,3 1
nantsheet Number of antenna 'coil turns' (sheets), equally spaced btw antrad and antradmax 1
nantyp Selector for type of antenna 2
nant_itm Selector to type of antenna for ITM specifications (?) 0
nbcase Number of cases for beta_bulk=const scan in fast particle studies (see subroutine landau) 1
nbtype Type of scan in fast particle studies (see subroutine landau) 1
nchi npol/2+1 [should NOT be here - obtained from CHEASE] mdchi
ncolmn 3*npol [Not needed as an input] -
ncontr Number of contours for plots [not used, obsolete] 9
ncut Number of toroidal cuts for plots [not used, obsolete] 1
nda I/O channel number for matrix [not used, obsolete] 7
ndarg Selector for type of argument, density and temperature profiles (densit, tempi, temprp, tempel) 1
nddeg Degree of polynomial for profile specification (densit, tempi, temprp, tempel) 1
ndens Selector of type of density profile (densit, frshap) 0
ndes I/O channel number for input of (r,z) quantities (subr iodsk5) [should NOT be here - obtained from CHEASE] 16
ndlt I/O channel number for LDU-decomposed matrix (ndlt, ndlt+10, +20, +30 are used) 10
nds I/O channel number for solution vector 14
neldttmp Selector for modeling e- Landau + TTMP damping (O:none, 1: perturbative, 2: consistent)1
neldttmpcor Switch for e- Landau damping + TTMP perturbative correction (used only if neldttmp=1) 0
nfakap Number of fast ion profiles in scan (see subroutine Landau) 1
nharm Number of ion cyclotron harmonics in warm dielectric tensor (see subroutine quaequ) 1
nitmopt 0: do not use ITM database; 1: read from ITM; 10: writes on ITM, 11: read&write on ITM; 22: within Kepler0
nitmrun(2) ITM run number for reading data (nitmrun(1)) and writing data (nitmrun(2)) [for nitmopt=1,10,11 only]0
nitmshot(2) ITM shot number for reading data (nitmrun(1)) and writing data (nitmrun(2)) [for nitmopt=1,10,11 only]0
npltyp Selector for output of field components [probably broken] 1
npol Number of poloidal intervals [should NOT be here - obtained from CHEASE] -
nprnt I/O channel for std output [should NOT be here - obtained from CHEASE] 6
npsi Number of radial intervals [should NOT be here - obtained from CHEASE] -
nread I/O channel for std input 5
nrspec Number of ion species 1
nrun Number of cases in frequency scan 1
nsaddl Selector for type of saddle coil (see subroutine curent) 2
nsave I/O channel for CHEASE namelist and auxiliary arrays input (see subroutine auxval) 8
nsourc I/O channel for various rhs, antenna and vacuum quantities 15
ntemp Selector of type of temperature profile (tempi, temprp, tempel) 0
ntorsp Number of cases in toroidal mode number scan 1
number ? [not used, obsolete) 0
nverbose Selector for level of detail in std output ?
nvac I/O channel for CHEASE surface quantities (subr iodsk2)[should not be here - obtained from CHEASE]17
 &   LENGTH,   MANCMP,   MEQ,      MFL,      MPOLWN,   NANTSHEET, &
 &   NANTYP,   NANT_ITM, NBCASE,   NBTYPE, &
 &   NCHI,     NCOLMN,   NCONTR,   NCUT,     NDA,      NDARG, &
 &   NDDEG,    NDENS,    NDES,     NDLT,     NDS,      NELDTTMP, NELDTTMPCOR, &
 &   NFAKAP,   NHARM,    NPLTYP,   NPOL,     NPRNT,    NPSI, &
 &   NREAD,    NRSPEC,   NRUN,     NSADDL,   NSAVE, &
 &   NSOURC,   NTEMP,    NTORSP,   NUMBER,   NVERBOSE, &
 &   NVAC,  

Logical variables and arrays

Name Description Default value
nlcold Selects cold ion plasma model .true.
nlcole Selects cold electron model .true.
nldip Selects dipole antenna currents [not implemented] .false.
nldiso Diagnoses the solution inside the plasma .true.
nlotp0 General switch for std output; overrides all nlotp1:5 .true.
nlotp1(1:4) Switches for equilibrium quantities output ?
nlotp2(1:5) Switches for antenna and vacuum quantities output ?
nlotp3(1:2) Switches for matrix quantities [not used] ?
nlotp4(1:5) Switches for various test printouts ?
nlotp5(1:40) Switches for output quantities [many are not used!] ?
nlttmp Switch to include Landau+TTMP in fast ion analysis (subroutine Landau) .true.
 &   NLCOLD,   NLCOLE,   NLDIP,    NLDISO,   NLPHAS, &
 &   NLFAST,   NLOTP0,   NLOTP1,   NLOTP2,   NLOTP3,   NLOTP4, &
 &   NLOTP5,   NLPLO5,   NLTTMP,   nitmopt,nitmrun, nitmshot, comments

Strings

Name Description Default value
comments(4) array of strings of characters ?
Deprecated:
This is the legacy 4-liner labels

Important Notice

It is enough to specify nrspec values for all arrays dimensioned to mdspec. Whereas nrspec is the effective number of ion species given in input, mdspec is the maximum allowed number of ion species (mdspec=10 in the actual LION code).

It is enough to specify nddeg values for all arrays dimensioned to mdad. Whereas nddeg is the effective number of polynomial terms used, mdad is the maximum allowed order of such polynomials (mdad=10 in the actual LION code).

It is enough to specify mancmp values for all arrays dimensioned to mdpant. Whereas mancmp is the effective number of poloidal harmonics for the antenna current, mdpant is the maximum allowed number of such poloidal components (mdpant=10 in the actual LION code).

It is enough to specify nfakap values for all arrays dimensioned to mdfaka. Whereas nfakap is the effective number of fast ion profile parameters used in the scan, mdfaka is the maximum allowed number of such values (mdfaka=20 in the actual LION code).

If the desired number of values exceeds these limits, then these values should be changed in globals_ITM.f90, respectively globals_IMAS.f90, and the code should be recompiled.

CHEASE namelist NEWRUN

Variables that are indispensable to run LION are marked with (*) and a description is given.

For some variables, marked with (!) the CHEASE-namelist values will override the LION-preset and LION-namelist values. Some cleanup would be in order...

The CHEASE namelist NEWRUN is read in subroutine auxval. Look in there for more details.

Real variables

Name Description Default value
al0 ? ?
angle ? ?
arrow ? ?
beta (*) Plasma volume-averaged beta ?
betap Plasma poloidal beta ?
cpsrf (*)(!) Poloidal flux at the plasma-vacuum surface ?
epscon ? ?
epsmac ? ?
qiaxe (*)(!) 1/q on magnetic axis ?
qsurf ? ?
rext ? ?
ritot ? ?
tsurf ? ?
wntore ? ?
wall ? ?
rinor ? ?
qcyl ? ?
p0 ? ?
 &   AL0,      ANGLE,    ARROW,    BETA,     BETAP,    CPSRF, &
 &   EPSCON,   EPSMAC,   QIAXE,    QSURF,    REXT,     RITOT, &
 &   TSURF,    WNTORE,   WALL,     RINOR,    QCYL,     P0, &

Integer variables

Name Description Default value
nalauto ? ?
ner ? ?
negp ? ?
itest ? ?
meq (*)(!) I/O channel number for input of CHEASE equilibrium coefficients eq(i,jchi,js) 4
nchi (*) Number of poloidal grid points (! in LION this is npol, see subroutine auxval) ?
ndes (*)(!) I/O channel number for input of (r,z) quantities (subr iodsk5) 16
nfig ? ?
nitmax ? ?
nprnt (*)(!) I/O channel for std output 6
npsi (*) (!) Number of radial intervals ?
nsave (*)(!) I/O channel number for CHEASE namelist (! MUST be the same as in LION namelist) 8
nua1 ? ?
nua2 ? ?
nub1 ? ?
nub2 ? ?
nux ? ?
nupl ? ?
nusg ? ?
nv ? ?
nuwa ? ?
nvac (*)(!) I/O channel for CHEASE surface quantities (subr iodsk2)17
nvit ? ?
nwall ? ?
 &   NAL0AUTO, &
 &   NER,      NEGP,     ITEST,    MEQ,      NCHI,     NDES, &
 &   NFIG,     NITMAX,   NPRNT,    NPSI,     NSAVE,    NUA1, &
 &   NUA2,     NUB1,     NUB2,     NUX,      NUPL,     NUSG, &
 &   NV,       NUWA,     NVAC,     NVIT,     NWALL, &

Logical variables

Name Description Default value
nldiag ? ?
nleinq ? ?
nlgren ? ?
nlsym (*?) Is the equilibrium up/down symmetric? ?

Note: nlsym is not really useful, only a comment is written. Could be cleaned up.

 &   NLDIAG,   NLEINQ,   NLGREN,   NLSYM

Equilibrium quantities

This file is read as follows, with mdeq=29 (parameter defined in globals_ITM.f90, resp. globals_IMAS.f90):

  open (unit=meq,file='TAPE4',status='old', &
       &         form='unformatted')
  do js=1,npsi+1
    read (meq)((eq(i,jchi,js),i=1,mdeq),jchi=1,npol)
  end do
  close (meq)

The definition of the \(eq(i,j_\chi,j_s)\) coefficients is given below. All are given at the center of grid cells, unless specified otherwise, and for js=npsi+1 where quantities are defined at the plasma boundary.

i \(eq(i,j_\chi,j_s)\) description
1 \(s\) at lower edge of cell
2 \(\chi\) at left edge of cell
3 \(s\) at upper edge of cell (not defined for \(j_s=npsi+1\))
4 \(\chi\) at right edge of cell
5 \(s\)
6 \(\chi\)
7 mass density \(\rho\) (not used in LION)
8 \(\frac{\gamma P}{q_0|\psi_a|}\), \(P\): plasma pressure, \(\gamma\)=adiab index
9 toroidal flux function \(F(\psi)=RB_\varphi\)
10 free (not used in LION)
11 \(q/q_0\)
12 \(\frac{\psi R^2}{q_0 |\nabla\psi|^2}\)
13 \(\frac{\nabla s \cdot \nabla\chi}{|\nabla s|^2}\)
14 \(R^2\)
15 \(\frac{\partial\ln R^2}{\partial s}\)
16 \(\frac{\partial\ln R^2}{\partial \chi}\)
17 \(-2s|\psi_a|\left( \frac{R j_\varphi}{\nabla\psi|^2} - \frac{\partial\ln(R^2/J)}{\partial\psi} \right) \)
18 \(\frac{2\psi}{q_0}\left(\frac{j_\varphi^2}{|\nabla\psi|^2} - \frac{j_\varphi}{R}\left[\frac{\partial\ln|\nabla\psi|}{\partial\psi}\right]_n - P^\prime\left[\frac{\partial\ln R}{\partial\psi}\right]_n \right) \)
19 \(R^2/J\)
20 \(\frac{\partial\ln (R^2/J)}{\partial \chi}\)
21 \(\frac{\partial}{\partial s} \left[ \int_0^\chi \frac{FJ}{R^2} d\chi^\prime \right] \) = \(\frac{\partial}{\partial s}(q\theta_\ast) \)
22 \(\frac{\nabla s \cdot \nabla\theta_\ast}{|\nabla s|^2}\)
23 \(\frac{\partial|\nabla\psi|^2}{\partial \chi}\)
24 \(\theta_\ast\)
25 free (not used in LION)
26 \(F^\prime\)
27 \(j_\varphi\)
28 \(\left[ \frac{\partial\ln|\nabla\psi|}{\partial\psi} \right]_n \)
29 \(\frac{\partial\ln (R^2/J)}{\partial \psi}\)

Where \(J\) is the Jacobian of the \((\psi,\chi,\varphi)\) coordinates, \(j_\varphi=-RP^\prime-FF^\prime/R\) is the toroidal current density, \(P^\prime=\mathrm{d}P/\mathrm{d}\psi \), \(F^\prime=\mathrm{d}F/\mathrm{d}\psi \), the subscript \(._n\) indicates the component normal to the magnetic surface and \(\theta_\ast\) is the straight-field-line poloidal coordinate.

Additional equilibrium quantities at the plasma boundary

The file is read as follows:

  open (unit=nvac,file='TAPE17',status='old', &
       &              form='unformatted')
  rewind nvac
  read (nvac) (sr(i),i=1,npol),(sz(i),i=1,npol) &
       &              ,(chi(i),i=1,ipol1)
  read (nvac) qb,tb
  !
  read (nvac) (z(j),j=1,npol),(z2(j),j=1,npol)
  read (nvac) (r2j(j),j=1,npol)
  read (nvac) (dcr2j(j),j=1,npol)
  read (nvac) (chiold(j),j=1,ipol1)
  !
  read (nvac) (th(j),j=1,ipol1)
  read (nvac) (roedge(j), j=1,ipol1)
  read (nvac) (t(j),j=1,ipol1)
  read (nvac) (romid(j), j=1,ipol1)
  !
  do jint=1,3
    read (nvac) (thint(j,jint),j=1,npol)
  end do
  do jint=1,3
    read (nvac) (roint(j,jint),j=1,npol)
  end do
  do jint=1,3
    read(nvac) (droint(j,jint),j=1,npol)
  end do

With the following definitions, all taken on the plasma surface:

Name Description
sr \(R\) coordinate
sz \(Z\) coordinate
chi \(\chi\) at middle of interval
qb \(q\)
tb \(F\)
z dummy
z2 dummy
r2j \(R^2/J\)
dcr2j \(\frac{\partial\ln(R^2/J)}{\partial\chi}\)
chiold \(\theta_\ast\)
th \(\theta\) at grid points
roedge \(\rho\) at grid points
t \(\theta\) at midpoints
romid \(\rho\) at midpoints
thint \(\theta\) at Gauss points
roint \(\rho\) at Gauss points
droint \( \mathrm{d}\rho/\mathrm{d}\theta\) at Gauss points

There are 3 Gauss points per interval. See subroutine roteta.

Equilibrium (R,Z) quantities

The file is read as follows:

  if (nitmopt.le.0 .or. mod(nitmopt,10) .eq. 0) then  
    open (unit=ndes,file='TAPE16',status='old', &
      &              form='unformatted')
    do js=1,npsi+1
      read (ndes) (ccr2(js,jc),jc=1,npol)
      read (ndes) (ccz2(js,jc),jc=1,npol)
      read (ndes) (cnr2(js,jc),jc=1,npol)
      read (ndes) (cnz2(js,jc),jc=1,npol)
    end do
    read (ndes) nrzsur
    read (ndes) (xs(j),j=1,nrzsur),(ys(j),j=1,nrzsur)    
  end if