read_gfile_tok.m
USAGE:
gfile_data = ...
read_gfile_tok(filename,tokamak,nfcoil,nesum,nves,old_efit,cc_file)
gfile_data = read_gfile_tok(filename); default DIII-D read
PURPOSE: Read efit ASCII g-eqdsk file for specific tokamak.
INPUTS: <default>
filename= g0-eqdsk filename (printed with iecurr=2 or iplcout=1)
Note: filename= gShot.Time name is parced to get shot number
tokamak = one of 'DIII-D','d3d','NSTX','EAST','KSTAR','ITER','CTF'
PEGASUS, (Not CASE sensitive so DIII-D <=> diii-d)
if not one of above then need nfcoil,nesum,...
<'DIII-D'>)
nfcoil = number of F-coils <default specific to each machine - below>
nesum = number of E-coils <default specific to each machine - below>
nves = number of vessel elements included in efit data <defaults below>
old_efit= For iecurr=2 several different flavors of efit output
exists. (Optional, default=0) For old versions of efit
(e.g. NSTX) use old_efit=1 since it uses older efit version.
cc_file= coil current file name [cc=load(cc_file)] or coil current vector
use when coil currents not available from efit (or to override)
(units = MA-turns)
Current Machine Defaults: (Default tokamak is DIII-D)
Tokamak nfcoil nesum nves old_efit Size(cc) Note
DIII-D 18 6 0 0 18+6=24 6-seg E-coil
NSTX 11 1 30 1 41+1=42 1E+11F+30VV
after shot 115265, April 2 2005 set old_efit=0 or shot#>=115265
NSTX 17 1 35 1 1+17+35=42 1E+17F+35VV
NSTX internally switches on shot # determined from gfile name
ex: /g120423.00533 => shot= 120423 => old_efit=0
KSTAR 14 1 0 0 14+4=18 no E; 4IC's
sab10 14 1 60+24 0 14+4=18 12 VV Groups
rtefit 18 1 60+10 0 18 ic included 33x33 14VCefit
EAST 12 1 0 0 14 no E; IC's?
CTF 14 1 24 0 14 NO E;
FDF 14 0 24 0 14 NO E; FDF2009?
22 0 24 0 22 FDF2011
PEGASUS 17 1 0 0 17
ITER 12 1 113 0 12 NO E
HL2M 16 1 24 0 16 1E
other nfcoil nesum 0 0 nfcoil+nesum need coil #'s
Note: Including nfcoil, nesum ... in argument list with a particular
machine overrides the machine default numbers
Note: filename= "..../gShot.Time" format is parced to get shot number
if needed to differentiate between machine configurations (i.e. NSTX)
OUTPUTS:
gfile_data = structure containing data read directly from g-file and
variables derived from this original data.
RESTRICTIONS:
g0 file must be produced by EFIT run with flag iecurr=2 or iplcout=1
in order to write current density distribution on grid and coil cc's
Dependencies