Scripts and templates for automatically running M3D-C1
The fundamental python function is autoC1() which has the following call pattern
autoC1(task='all',machine='DIII-D')
Tasks proceed in the following order.
You can skip to a step by setting this keyword to the desired value.
Folder in which a given step occurs is given with parentheses.
- 'all' [DEFAULT]
- Starts from the beginning with 'setup'
- 'setup'
- Preprocess the g-, p-, and a-files into readable formats ('efit/')
- Allows user to extend the profiles beyond the separatrix.
- 'efit'
- Perform an igs=0 run to get the EFIT equilibrium ('uni_efit/')
- 'uni_equil'
- Perform equilibrium calcalutions on a uniform mesh ('uni_equil/')
- User can iterate on current.dat.out in this step to improvethe equilibrium match to the EFIT
- Can launch IDL within this step to check the equilibrium match
- 'adapt'
- Adapt the mesh to the equilibrium ('rw1_adapt/')
- 'calculation'
-
Perform linear calculations with adapted mesh
-
User will select from four options
- Calculate equilibrium ('rw1_equil/')
- Linear stability analysis ('n=<ntor>/eb1_1f_stab/')
User selects desired toroidal mode number <ntor>
Currently uses ExB rotation and single-fluid only - Time-independent, linear response ('n=<ntor>/eb1_1f_<coil>/')
User selects desired toroidal mode number <ntor>
<coil> values are defined by the machine
Currently uses ExB rotation and single-fluid only - Open IDL to examine the results
-
Name of device to be modeled, so appropriate templates can be found.
Machines currently supported:
- 'DIII-D' [DEFAULT]
- 'NSTX-U'
- Create a base directory to store the autoC1 scripts and templates.
- Set the AUTOC1_HOME environmental variable to this base directory.
- Make sure the M3DC1_ARCH enviornmental variable is set properly
- On portalr6, M3DC1_ARCH = sunfire.r6
- On saturn/iris, M3DC1_ARCH = saturn
- cd to $AUTOC1_HOME
- Download autoC1 from github
- On portalr6, clone with SSH: 'git clone git@github.com:bclyons12/autoC1.git'
- On saturn/iris, clone with HTTPS: 'git clone https://github.com/bclyons12/autoC1.git'
- Import the appropriate python module on your system. I use:
- On portalr6, 'module load anaconda'
- On saturn/iris, 'module load python'
- Add $AUTOC1_HOME/python/ to your PYTHONPATH environmental variable
- Create a new working directory for the current runs
- Create a folder called 'efit/' within this working directory
- Populate 'efit/' with the g-, p-, and a- files for this shot & time (format should be like g*.*)
- From the base working directory, run 'python'
- Within python, import the autoC1 function from the autoC1 module.
For example: from autoC1 import autoC1 - Run the autoC1 function (see above for keyword details)
- The script should walk you through it's steps in a self-explanatory way.
It will ask for user input when required, as well as prompt you to check certain things about the runs along the way.