read_gfile.m
USAGE: >>read_gfile
PURPOSE: Script to read efit ASCII g-eqdsk file w/ flag iecurr=2 set
INPUTS: [default]
filename = ['g083750.04838']; g0-eqdsk filename - Can contain directory
nfcoil = [18]; # of F-coils; must be specified for non-D3D (Optional)
defaults to D3D values of nfcoil=18
nesum = [6]; # of E-coils; must be specified for non-D3D (Optional)
defaults to D3D value of nesum=6 (for > 6seg case)
old_efit=[0]; For iecurr=2 several different flavors of efit output
exists. (Optional) For old versions of efit (i.e. NSTX)
you want old_efit=1 since they use older efit version.
OUTPUTS:
(Produces large set of data objects from g0-file in Matlab environment.)
ireadok = flag to report good read of gfile (0=bad, 1=good)
jphi=current density on grid MA/m^2
psizr = true total flux on grid in Wb
psimag = axis flux in true Wb
psibnd = boundary flux in true Wb (psibry also defined same)
cc = E/F coil currents in MA-turns
cc2 = E/F coil currents in MA-turns (for 2-segment E-coil)
CAUTION: cc2 has min(2,nesum) E-coil elements (could be 1 vs std: 2)
RESTRICTIONS:
g0 file must be produced by EFIT run with flag iecurr=2 in order to
write current density distribution on grid.
Must set nesum to correct number of e-coil segments at top of file.
May overwrite some data objects in D3D environment from load_d3denv.
METHOD:
Follows write/read format of EFIT file weqdskx.for, reads usual g-file data,
reads coil current and jphi data (if iecurr was set =2 in EFIT run),
defines some flux variables and converts some variables to D3D Matlab
data environment standards.
Dependencies