&domain_parameters
  
  toroidaln=29
  partialtorus=1
 /

&input_parameters

! control parameters
  irun=1        	    ! 0 for initial run, any non-zero value for restart
  mstep=15000		    ! # of ion and field time steps
  msnap=15		    ! # of snapshots and restarts
  ndiag=25	  	    ! do diagnosis when mod(istep,ndiag)=0
  nonlinear=0		    ! 1: nonlinear run; 
                            ! 0: linear run
  nfilter=1                 ! 0: keep all modes; 
                            ! 1: select n-mode in setup.F90; 
                            ! 2: select n & m mode;
                            ! >2: select n & m and k_para<<k_perp 
  tstep=0.01		    ! time step size, unit=R_0/c_s (c_s^2=T_e/m_i: main ion species)
  paranl=0.0		    ! 0: no parallel nonlinearity;
                            ! 1: keep parallel nonlinearity
  track_particles=0	    ! 0: no tracking;
                            ! 1: track particles 
  ndata3D=0		    ! 0: no 3D data;
                            ! 1: write out 3D field data 
  magnetic=0		    ! 0: electrostatic;
                            ! 1: electromagnetic
  nbound=0		    ! # of radial subjected to boundary condition
  numereq=-104		    ! <=0: numerical equilibrium;
                            ! >0: choice of analytic equilibrium

! diagnostics and filtering specifics
  n_modes= 1 1 1 1 1 1 1 1  ! for frc case, use single n for now
  m_modes= 1 2 3 4 5 6 7 8  ! 
  i_flux=0.5                 ! use mpsi/2 for default since interesting mode structure is likely at center of domain

! field grids
  mpsi=2 		    ! # of radial grid points
  mthetamax=96	            ! # poloidal grid points (in fieldline following coordinate)
  mtoroidal=96		    ! # of toroidal grids=MPI DD, 64 needed for ITG linear dispersion
  psi0=0.7		    ! inner boundary, psi_inner/psiw
  psi1=0.8		    ! outer boundary, psi_outer/psiw
  neop=16		    ! radial grids for collision
  neot=16	            ! poloidal grids for collision (in magnetic coordiante)
  neoz=2		    ! toroidal grids. 1 or >9: normal;
                            ! 2: w/o rotation;
                            ! 3: w/o rotation & E_r
		
! thermal (main) ion
  micell=25		    ! particle per cell for ion
  aion=1.0		    ! ion mass, unit=proton mass
  qion=1.0		    ! ion charge, unit=proton charge
  ngyroi=1		    ! N-point gyro-averaging, N=1, 4, or 8
  iload=1		    ! 0: ideal MHD; 
                            ! 1: uniform marker & MHD, 
                            ! >1: non-uniform marker & MHD
  icoll=0		    ! 0: no collisions; 
                            ! >0: collisions when mod(istep,ndiag)=0

! fast ion
  mfcell=20		    ! particle per cell for fast ion
  afast=5.44618e-4	    ! fast ion mass, unit=proton mass
  qfast=-1.0		    ! fast ion charge, unit=proton charge
  ngyrof=1		    ! N-point gyro-averaging, N=1, 4, or 8
  fload=0		    ! 0: no fast ion;
                            ! 1: uniform marker temperature;
                            ! 2: non-uniform marker

! electron
  mecell=25		    ! particle per cell for electron
  nhybrid=1		    ! fluid-kinetic hybrid electron model, 0: no kinetic electron
  ncycle=20		    ! # of electron subcycle
  qelectron=-1.0 	    ! ion charge, unit=proton charge
  aelectron=5.44618e-4	    ! electron mass, unit=proton mass
  eload=1		    ! 1: uniform marker temperature, 
                            ! >1: non-uniform marker
  etrap=2                   ! 1: load trapped electrons; 
                            ! 2: load all electrons
  ecoll=0		    ! 0: no collisions; 
                            ! >0: collisions when mod(istep,ndiag)=0

!Newly added parameters
  ilaplacian=1   
  eqcurrent=0   	    ! eqcurrent=0: drop curl B terms; 
                            ! eqcurrent=1: keep curl B terms
  fieldmodel=1  	    ! Analytic eq field model: 0: s-alpha like (cyclone) model;
                            ! 1: first order (in r/R_0) model with parallel current
  bcond=0       	    ! 0: fixed zero boundary; 
                            ! 1:linear inner boundary in r 
  ifullk=0     	 	    ! 0: gyrokinetic;  
                            ! 1: fully kinetic run 
  fielddir=0    	    ! Equilibrium magnetic field and current direction
  hypr1=0.05E-2		    ! Parallel hyperviscosity
  hypr2=0.0E-2     	    ! Perpendicular hyperviscosity 
  alp=0.0 		    ! Magnetic island perturbation strength. If there is no island, alp=0.0
  antenna=0
  izonal=2
  iconfig=3                 ! 1:Cylinder
                            ! 2:Tokamak
                            ! 3:FRC

! physical unit for analytic equilibrium; Overwritten by profile.dat in numerical equilibrium
  r0=25.37                  ! major radius, unit=cm
  b0=799.0                  ! on-axis magnetic field, unit=gauss
  etemp0=80.00              ! on-axis electron temperature, unit=ev
  eden0=0.65e14             ! on-axis electron number density, unit=1/cm^3
  ti_over_te=5.0            ! on-axis Ti/Te 
 /

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

&equilibrium_parameters

! example numerical/analytical equilibrium using variables from numereq=1 
  
psiw_numereq= 0.0375         ! poloidal flux at wall
ped_numereq=  0.0375         ! poloidal flux at separatrix

! q and zeff profile is parabolic: q=q1+q2*psi/psiw+q3*(psi/psiw)^2
q_numereq=  0.82  1.1  1.0   ! cyclone case
ze_numereq=  1.0  0.0  0.0   !
er_numereq=  0.0  0.0  0.0   !
                             
itemp0_numereq= 1.0          ! on-axis thermal ion temperature, unit=T_e0
ftemp0_numereq= 2.0          ! on-axis fast ion temperature, unit=T_e0
fden0_numereq=  1.0e-5       ! on-axis fast ion density, unit=n_e0
                             
! density and temperature profiles are hyperbolic: ne=1.0+ne1*(tanh(ne2-(psi/psiw)/ne3)-1.0)
ne_numereq= 0.205  0.30  0.4 ! Cyclone base case, ni determined by quasi-neutrality
te_numereq= 0.415  0.18  0.4 ! 
ti_numereq= 0.415  0.18  0.4 ! ITG
tf_numereq= 0.415  0.18  0.4 ! fast ion temperature profile
nf_numereq= 0.205  0.30  0.4 ! fast ion density profile

/

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! GTC unit: R_0=1, Omega_proton=1, B_0=1, m_p=1, e=1.
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! IMPORTANT: make sure that multiple OpenMP threads produce identical output in 
! gtc.out as with a single Openmp thread (up to 6 digits in single precision).
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! repeatibility in linear runs:
! 1) Random # generator in loading is the only source for different output in gtc.out.
! 2) Particle decomposition # leads to difference in ~3 digits due to random # generator.
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Non-perturbative (full-f) simulation steps:
! 1) Initial linear run for a few bounce times with irun=0, nonlinear=0.0, iload>99
! 2) Continue linear run for a few bounce times with irun=1
! 3) Continue nonlinear run with nonlinear=1.0 and reduce tstep
! 4) If needed, continue nonlienar run with irun>9
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
