# -*-Python-*-
# Created by bgrierson at 11 Apr 2017 17:21
"""
This script runs codes for 2017 TTF Transport Tools Live Demo
Grierson, Smith, Meneghini talks
"""
defaultVars(
speaker='grierson', step='1', transp_runid='0104', device='DIII-D', shot=163303, time=3500, times=np.array([3000, 5350]), avgtim=250
)
steps = SortedDict()
def check_speaker(speaker, check_speaker):
if check_speaker not in steps:
steps[check_speaker] = []
if speaker == check_speaker or speaker == 'all':
return True
else:
return False
def check_step(speaker, step, check_speaker, check_step):
step = ':'.join(step.split(':')[-1:]).strip()
if check_speaker not in steps:
steps[check_speaker] = []
if check_step not in steps[check_speaker]:
steps[check_speaker].append('%d: ' % (len(steps[check_speaker]) + 1) + check_step)
if (speaker == check_speaker or speaker == 'all') and (step == check_step or step == 'all'):
return True
else:
return False
# ====================================
if check_speaker(speaker, 'grierson'):
if check_step(speaker, step, 'grierson', 'Set shot and times'):
MainSettings['EXPERIMENT']['device'] = device
MainSettings['EXPERIMENT']['shot'] = shot
MainSettings['EXPERIMENT']['time'] = time
MainSettings['EXPERIMENT']['times'] = times
if check_step(speaker, step, 'grierson', 'View the shot history with SCOPE pubfig'):
signals = ['density,prmtan_neped,fs02f', 'pinj,betan']
printi('Importing SCOPE')
if 'SCOPE' not in OMFIT:
OMFIT.loadModule('SCOPE')
# Create PUBFIG and view profile evolution
OMFIT['SCOPE']['__scratch__']['main_opt'] = 'PUBFIG'
OMFIT['SCOPE']['INPUTS'].setdefault('PUBFIG', OMFITtree())
OMFIT['SCOPE']['INPUTS']['PUBFIG'].setdefault('active', OMFITtree())
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['shots'] = np.atleast_1d(shot)
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['signals'] = signals
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts'] = OMFITnamelist('sig_opts.nml')
for signal in signals:
for sig in signal.split(','):
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts'][sig] = NamelistName()
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts'][sig]['label'] = sig
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts'][sig]['scale'] = 1.0
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts'][sig]['resamp'] = 0.0
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts'][sig]['smooth'] = 0.0
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts'][sig]['window'] = 'gaussian'
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts'][sig]['causal'] = True
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts'][sig]['oplot_raw'] = True
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts'][sig]['color'] = 'b'
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts'][sig]['linestyle'] = np.atleast_1d('-')
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts'][sig]['linethickness'] = np.atleast_1d(3.0)
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts'][sig]['marker'] = np.atleast_1d(None)
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts']['density']['label'] = '$<n_e> (10^{19} m^{-3})$'
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts']['density']['scale'] = 1e-13
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts']['prmtan_neped']['label'] = '$n_e^{ped}$'
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts']['prmtan_neped']['scale'] = 1e-19
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts']['prmtan_neped']['color'] = 'r'
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts']['fs02f']['label'] = '$D_\\alpha$'
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts']['fs02f']['scale'] = 1e-14
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts']['fs02f']['color'] = 'g'
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts']['pinj']['label'] = '$P_{NBI} (MW)$'
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts']['pinj']['scale'] = 1e-3
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts']['pinj']['smooth'] = 200.0
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts']['pinj']['color'] = 'm'
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts']['betan']['label'] = '$\\beta_N$'
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['sig_opts']['betan']['color'] = 'c'
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['plot_opts'] = OMFITnamelist('plot_opts.nml')
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['plot_opts']['a'] = NamelistName()
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['plot_opts']['a']['ylim'] = [0.0, 7.0]
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['plot_opts']['a']['legend'] = ''
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['plot_opts']['a']['tick_locations'] = [0.0, 0.0]
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['plot_opts']['b'] = NamelistName()
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['plot_opts']['b']['ylim'] = [0.0, 8.0]
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['plot_opts']['b']['legend'] = ''
OMFIT['SCOPE']['INPUTS']['PUBFIG']['active']['plot_opts']['b']['tick_locations'] = [0.0, 0.0]
OMFIT['SCOPE']['GUIS']['pubfigGUI'].run()
# OMFIT['SCOPE']['PLOTS']['plotPubfig'].run()
if check_step(speaker, step, 'grierson', 'Load TRANSP module'):
printi('Importing TRANSP')
if 'TRANSP' not in OMFIT:
OMFIT.loadModule('TRANSP')
OMFIT['TRANSP']['SETTINGS']['EXPERIMENT']['runID'] = transp_runid
OMFIT['TRANSP']['GUIS']['TRANSPgui'].run()
OMFIT['TRANSP']['SCRIPTS']['nextRUNID'].run()
if check_step(speaker, step, 'grierson', 'Prepare TRANSP run `in the control room`'):
# Set scratch directory
OMFIT['TRANSP']['SCRIPTS']['transpScratchDir'].run(reset_to_default=True)
OMFIT['TRANSP']['SCRIPTS']['setupTRANSPmode'].run(mode='beast', run_nml=True, run_eq=True, run_profiles=True, run_device=True)
OMFIT['TRANSP']['__scratch__']['comment'] = 'Demo for TTF 2017'
if check_step(speaker, step, 'grierson', 'View TRANSP inputs `in the control room`'):
OMFIT['TRANSP']['UFILES']['CUR'].plotFigure()
OMFIT['TRANSP']['UFILES']['TIO'].plotFigure()
OMFIT['TRANSP']['PLOTS']['plot_nubeam'].run()
# OMFIT['TRANSP']['SCRIPTS']['tr_start'].run()
# OMFIT['TRANSP']['SCRIPTS']['tr_send'].run()
if check_step(speaker, step, 'grierson', 'View TRANSP analysis results'):
if 'TRANSP' not in OMFIT:
OMFIT.loadModule('TRANSP')
printi('Loading analysis run')
OMFIT['TRANSP']['SETTINGS']['EXPERIMENT']['runID'] = '0104'
OMFIT['TRANSP']['SCRIPTS']['getOUTPUT'].run()
# OMFIT['TRANSP']['PLOTS']['summaryPlot'].run()
OMFIT['TRANSP']['__scratch__']['rplot_trees'] = 'transp'
OMFIT['TRANSP']['__scratch__']['rplot_servers'] = 'atlas.gat.com'
OMFIT['TRANSP']['__scratch__']['rplot_runids'] = '163303A04'
OMFIT['TRANSP']['__scratch__']['rplot_type'] = 'TWO_D'
OMFIT['TRANSP']['__scratch__']['rplot_vars'] = ['IHEAT', 'QIE', 'PCOND', 'GAINI']
OMFIT['TRANSP']['__scratch__']['rplot_simple_labels'] = True
OMFIT['TRANSP']['__scratch__']['rplot_times'] = 3.5
OMFIT['TRANSP']['__scratch__']['rplot_avgtim'] = 0.25
OMFIT['TRANSP']['__scratch__']['rplot_radii'] = 0.7
OMFIT['TRANSP']['__scratch__']['rplot_avgradii'] = 0.1
OMFIT['TRANSP']['__scratch__']['rplot_avgrad'] = 0.1
OMFIT['TRANSP']['__scratch__']['rplot_ops'] = '{}'
OMFIT['TRANSP']['__scratch__']['rplot_statistics'] = False
OMFIT['TRANSP']['__scratch__']['rplot_volint'] = True
OMFIT['TRANSP']['__scratch__']['rplot_surint'] = False
OMFIT['TRANSP']['__scratch__']['rplot_aol'] = False
OMFIT['TRANSP']['__scratch__']['rplot_grid_2d'] = True
OMFIT['TRANSP']['__scratch__']['rplot_xlo_npts'] = 21
OMFIT['TRANSP']['__scratch__']['rplot_tlo_npts'] = 21
# OMFIT['TRANSP']['PLOTS']['rplot'].run()
# OMFIT['TRANSP']['__scratch__']['rplot_vars'] = ['CONDE','CONDI','CONDWNCD']
# OMFIT['TRANSP']['__scratch__']['rplot_volint'] = False
# OMFIT['TRANSP']['__scratch__']['rplot_grid_2d'] = False
# OMFIT['TRANSP']['PLOTS']['rplot'].run()
# # ax = gca()
# ax.set_ylim([0.0, 4e4])
if check_step(speaker, step, 'grierson', 'Re-run TRANSP in predictive mode'):
printi('Setting up TRANSP in predictive mode')
# Set PT_SOLVER and TGLF (but don't run, many CPUs)
OMFIT['TRANSP']['SETTINGS']['EXPERIMENT']['runID'] = '0105'
OMFIT['TRANSP']['SCRIPTS']['getOUTPUT'].run()
OMFIT['TRANSP']['GUIS']['TRANSPgui'].run()
if check_step(speaker, step, 'grierson', 'View ITPA validation metrics'):
printi('Loading predictive TRANSP run')
OMFIT['TRANSP']['SETTINGS']['EXPERIMENT']['runID'] = '1636'
OMFIT['TRANSP']['SCRIPTS']['getOUTPUT'].run()
OMFIT['TRANSP']['__scratch__']['rplot_runids'] = ['163303A04', '163303P35', '163303P36']
OMFIT['TRANSP']['__scratch__']['rplot_type'] = 'TRANSPORT_MODEL_VALIDATION'
OMFIT['TRANSP']['__scratch__']['rplot_tmv_bc'] = 0.8
# OMFIT['TRANSP']['PLOTS']['rplot'].run()
#
# OMFIT['TRANSP']['__scratch__']['rplot_runids'] = ['163303A04','163303P36']
# OMFIT['TRANSP']['__scratch__']['rplot_type'] = 'TWO_D'
# OMFIT['TRANSP']['__scratch__']['rplot_grid_2d'] = True
# OMFIT['TRANSP']['__scratch__']['rplot_vars'] = ['TI']
# OMFIT['TRANSP']['PLOTS']['rplot'].run()
#
if check_step(speaker, step, 'grierson', 'View TGLF stability'):
OMFIT['TRANSP']['__scratch__']['rplot_runids'] = '163303P36'
OMFIT['TRANSP']['__scratch__']['rplot_type'] = 'TGLF'
OMFIT['TRANSP']['__scratch__']['rplot_tglf_time'] = 5.0
OMFIT['TRANSP']['__scratch__']['rplot_tglf_rho'] = 0.7
OMFIT['TRANSP']['__scratch__']['rplot_tglf_ky'] = 0.3
# OMFIT['TRANSP']['PLOTS']['rplot'].run()
if check_step(speaker, step, 'grierson', 'View Designed Shot'):
printi('Loading ECH Simulation')
OMFIT['TRANSP']['__scratch__']['rplot_runids'] = ['163303P35', '163303P37']
OMFIT['TRANSP']['__scratch__']['rplot_type'] = 'TWO_D'
OMFIT['TRANSP']['__scratch__']['rplot_grid_2d'] = False
OMFIT['TRANSP']['__scratch__']['rplot_vars'] = ['TE']
OMFIT['TRANSP']['__scratch__']['rplot_times'] = 4.0
OMFIT['TRANSP']['__scratch__']['rplot_avgtim'] = 0.2
OMFIT['TRANSP']['PLOTS']['rplot'].run()
OMFIT['TRANSP']['__scratch__']['rplot_type'] = 'ONE_D'
OMFIT['TRANSP']['__scratch__']['rplot_vars'] = ['TAUEA']
OMFIT['TRANSP']['PLOTS']['rplot'].run()
ax = gca()
ax.set_ylim([0.0, 0.4])
ax.set_xlim([3.0, 5.4])
# =================================
if check_speaker(speaker, 'smith'):
if check_step(speaker, step, 'smith', 'Load TGLF module'):
if 'TGLF' not in OMFIT:
OMFIT.loadModule('TGLF_GACODE', location="OMFIT['TGLF']")
if check_step(speaker, step, 'smith', 'Run TGLF'):
TGLF = OMFIT['TGLF']
if step == '-: all':
TGLF['FILES']['input.tglf'] = OMFITgacode('%s/../samples/input.tglf.gen' % OMFITsrc)
TGLF['SCRIPTS']['runTGLF'].run()
else:
TGLF['GUIS']['TGLF_GUI'].run()
if check_step(speaker, step, 'smith', 'Load TGLF_scan module & Extract gEQDSK and statefile from TRANSP using TRXPL module'):
if 'TGLF_scan' not in OMFIT:
OMFIT.loadModule('TGLF_scan')
TGLF_scan = OMFIT['TGLF_scan']
TGLF_scan['TGYRO']['PROFILES_GEN']['TRXPL']['SETTINGS']['EXPERIMENT']['runID'] = '0104'
TGLF_scan['TGYRO']['PROFILES_GEN']['TRXPL']['SETTINGS']['REMOTE_SETUP']['serverPicker'] = 'iris'
OMFIT['TGLF_scan']['TGYRO']['PROFILES_GEN']['SETTINGS']['PHYSICS']['use_trxpl'] = True
OMFIT['TGLF_scan']['TGYRO']['PROFILES_GEN']['TRXPL']['SETTINGS']['EXPERIMENT']['avgtim'] = avgtim
OMFIT['TGLF_scan']['TGYRO']['PROFILES_GEN']['TRXPL']['SETTINGS']['EXPERIMENT']['runID'] = transp_runid
# setup module dependencies
OMFIT['TGLF_scan']['TGYRO']['PROFILES_GEN']['SETTINGS']['PHYSICS']['start_from'] = 'statefile'
OMFIT['TGLF_scan']['TGYRO']['PROFILES_GEN']['SETTINGS']['DEPENDENCIES']['gEQDSK'] = "OMFIT['TRANSP']['TRXPL']['OUTPUTS']['gEQDSK']"
OMFIT['TGLF_scan']['TGYRO']['PROFILES_GEN']['SETTINGS']['DEPENDENCIES'][
'profpowbal'
] = "OMFIT['TRANSP']['TRXPL']['OUTPUTS']['statefile']"
# Set radii
OMFIT['TGLF_scan']['SETTINGS']['PHYSICS']['rho_scan'] = list(map(float, list(map(str, arange(0.2, 0.95, 0.05)))))
if step == '-: all':
OMFIT['TRANSP']['TRXPL']['SCRIPTS']['trxpl'].run()
else:
OMFIT['TGLF_scan']['GUIS']['tglf_scan_gui'].run()
if check_step(speaker, step, 'smith', 'Run PROFILES_GEN'):
# reorder ions
OMFIT['TGLF_scan']['TGYRO']['PROFILES_GEN']['SETTINGS']['PHYSICS']['reorder_ion_names'] = ['D', 'C', 'D[fast]', 'N']
OMFIT['TGLF_scan']['TGYRO']['PROFILES_GEN']['SETTINGS']['PHYSICS']['neglect_last_ions'] = 2
# set NEO to run (to calculate omega, that is Er)
# if this is commented, we take Er from TRANSP
# OMFIT['TGYRO_GACODE']['PROFILES_GEN']['SETTINGS']['PHYSICS']['calcEr']=True
if step == '-: all':
OMFIT['TGLF_scan']['TGYRO']['PROFILES_GEN']['SCRIPTS']['run_profiles_gen'].run()
else:
OMFIT['TGLF_scan']['GUIS']['tglf_scan_gui'].run()
if check_step(speaker, step, 'smith', 'Get input.tglf files'):
if step == '-: all':
OMFIT['TGLF_scan']['SCRIPTS']['setup_tglf'].run()
else:
OMFIT['TGLF_scan']['GUIS']['tglf_scan_gui'].run()
if check_step(speaker, step, 'smith', 'Get TGLF results for radial profile'):
OMFIT['TGLF_scan']['SETTINGS']['PHYSICS']['tglf_sign_convention'] = True
OMFIT['TGLF_scan']['TGLF']['SETTINGS']['PHYSICS']['scanParameter'] = 'RLTS_5'
OMFIT['TGLF_scan']['TGLF']['SETTINGS']['PHYSICS']['scanParameter2D'] = 'VEXB_SHEAR'
OMFIT['TGLF_scan']['TGLF']['SETTINGS']['PHYSICS']['parallelScan'] = 16
if step == '-: all':
OMFIT['TGLF_scan']['SCRIPTS']['Radial_scan'].run()
else:
OMFIT['TGLF_scan']['GUIS']['tglf_scan_gui'].run()
# =====================================
if check_speaker(speaker, 'meneghini'):
if check_step(speaker, step, 'meneghini', 'Load EPED module to run EPEDNN'):
if 'EPED' not in OMFIT:
OMFIT.loadModule('EPED')
OMFIT['EPED']['TRANSP_MDS'] = OMFITmds(treename='TRANSP', shot=str(shot) + transp_runid, server='DIII-D')
OMFIT['EPED']['SETTINGS']['PHYSICS']['useEPEDNN'] = True
OMFIT['EPED']['SETTINGS']['DEPENDENCIES']['statefile'] = "OMFIT['EPED']['TRANSP_MDS']"
OMFIT['EPED']['SETTINGS']['DEPENDENCIES']['gEQDSK'] = "OMFIT['TGLF_scan']['TGYRO']['PROFILES_GEN']['TRXPL']['OUTPUTS']['gEQDSK']"
if step == '-: all':
OMFIT['EPED']['SCRIPTS']['runEPED'].run()
else:
OMFIT['EPED']['GUIS']['EPEDgui'].run()
if check_step(speaker, step, 'meneghini', 'Load TGYRO module to run it with full TGLF and NEO models'):
if 'TGYRO_GACODE' not in OMFIT:
OMFIT.loadModule('TGYRO_GACODE')
OMFIT['TGYRO_GACODE']['SETTINGS']['REMOTE_SETUP']['serverPicker'] = 'localhost' # <------only for now
if 'TGLF_scan' in OMFIT:
OMFIT['TGYRO_GACODE']['SETTINGS']['DEPENDENCIES']['PROFILES_GEN'] = "OMFIT['TGLF_scan']['TGYRO']['PROFILES_GEN']"
OMFIT['TGYRO_GACODE']['SETTINGS']['DEPENDENCIES'][
'input_gacode'
] = "OMFIT['TGLF_scan']['TGYRO']['PROFILES_GEN']['OUTPUTS']['input.gacode']"
else:
OMFIT['TGYRO_GACODE']['PROFILES_GEN']['TRXPL']['SETTINGS']['EXPERIMENT']['runID'] = '0104'
OMFIT['TGYRO_GACODE']['PROFILES_GEN']['TRXPL']['SETTINGS']['REMOTE_SETUP']['serverPicker'] = 'iris'
OMFIT['TGYRO_GACODE']['PROFILES_GEN']['SETTINGS']['PHYSICS']['use_trxpl'] = True
OMFIT['TGYRO_GACODE']['PROFILES_GEN']['TRXPL']['SETTINGS']['EXPERIMENT']['avgtim'] = avgtim
OMFIT['TGYRO_GACODE']['PROFILES_GEN']['TRXPL']['SETTINGS']['EXPERIMENT']['runID'] = transp_runid
OMFIT['TGYRO_GACODE']['PROFILES_GEN']['SETTINGS']['PHYSICS']['start_from'] = 'statefile'
# set run-id
OMFIT['TGYRO_GACODE']['SETTINGS']['EXPERIMENT']['runid'] = 'TGLF'
# do not need to run PROFILES_GEN as part of TGYRO as we already did it
OMFIT['TGYRO_GACODE']['SETTINGS']['PHYSICS']['runPROFILES_GEN'] = False
OMFIT['TGYRO_GACODE']['SETTINGS']['PHYSICS']['n_rad'] = 8
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['TGYRO_RMIN'] = 0.3 # at inversion radius
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['TGYRO_RMAX'] = 0.8
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['TGYRO_RELAX_ITERATIONS'] = 0 # can be increased, but TGLF+NEO takes a long time!
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['LOC_TE_FEEDBACK_FLAG'] = 1 # Evolve Te
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['LOC_TI_FEEDBACK_FLAG'] = 1 # Evolve Ti
OMFIT['TGYRO_GACODE']['SETTINGS']['PHYSICS']['evolve_density'] = 1 # Evolve density
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['TGYRO_DEN_METHOD0'] = 1 # electrons evolved
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['TGYRO_DEN_METHOD1'] = -1 # deuterim by quasineutrality
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['TGYRO_DEN_METHOD2'] = 0 # carbon fixed
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['LOC_ER_FEEDBACK_FLAG'] = 0 # do not evolve Er
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['LOC_DX'] = 0.1 # Jacobian step size
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['LOC_DX_MAX'] = 0.1 # Max step size
if step == '-: all':
OMFIT['TGYRO_GACODE']['SCRIPTS']['runTGYRO'].run()
else:
OMFIT['TGYRO_GACODE']['GUIS']['TGYROgui'].run()
if check_step(speaker, step, 'meneghini', 'Switch to TGLF-NN and analytic neoclassical models'):
OMFIT['TGYRO_GACODE']['SETTINGS']['EXPERIMENT']['runid'] = 'TGLFNN'
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['TGYRO_PED_MODEL'] = 1 # pedestal experimental profiles
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['TGYRO_TGLF_NN_MAX_ERROR'] = 9999999 # use TGLF-NN model
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['LOC_ER_FEEDBACK_FLAG'] = 1 # Evolve Er
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['TGYRO_ER_BC'] = 2 # w'(axis)=0
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['TGYRO_NEO_METHOD'] = 1 # do not use NEWO, but use use Hinton-Hazeltine instead
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['TGYRO_RELAX_ITERATIONS'] = 30 # NN are quick so we can do many iterations
if step == '-: all':
OMFIT['TGYRO_GACODE']['SCRIPTS']['runTGYRO'].run()
else:
# OMFIT['TGYRO_GACODE']['GUIS']['TGYROgui'].run()
pass
if check_step(speaker, step, 'meneghini', 'Include self-consistent core-pedestal prediction'):
OMFIT['TGYRO_GACODE']['SETTINGS']['EXPERIMENT']['runid'] = 'EPED1NN_TGLFNN'
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['TGYRO_PED_MODEL'] = 2 # Dynamic pedestal evolution
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['TGYRO_NEPED'] = -0.965 # radial location where density is taken from
OMFIT['TGYRO_GACODE']['INPUTS']['input.tgyro']['TGYRO_ZEFFPED'] = -0.965 # radial location where zeff is taken from
# (radial location was chosen so to match experiemntal density profile in the pedestal)
if step == '-: all':
OMFIT['TGYRO_GACODE']['SCRIPTS']['runTGYRO'].run()
else:
# OMFIT['TGYRO_GACODE']['GUIS']['TGYROgui'].run()
pass