This new version of TOQ is available on request only.

Click on this link to


Once you recieve the file toq4.0.tar.gz, decompress and un-tar it. Inside the toq4.0 directory you'll find the fortran code, a makefile, input files, some geqdsk files from EFIT and CORSICA/TEQ, and a few Matlab files for visualization.

The makefile is catered to Linux and lf95 6.1, and it is left to the user to modify the makefile to compile the code on other platforms. Any existing makefile for a previous version of TOQ should be used as a guideline for this process.

Once compiled, an executable toq.x is created.

Several example input files are included with the distribution. As is, the code is set to produce an equilibrium solution of a DIII-D ITER-like discharge from the input files in the directory.

Differences with running this version:

This code is the product of input from many people, and many changes have been made over time. But the three main differences in this version are:

1. Updown asymmetry is supported via the isym input variable.
This version presently allows for nearly equal numbers of grid points radially and poloidally. For the up-down symmetric mode, this causes higher poloidal density than for the up-down asymmetric mode for obvious reasons. Most other funcionality stays the same, and comments appear in the code and input files in various places.

2. G-EQDSK files are directly read in.
This is done via an additional namelist in the "intoq" file for which there are examples in the directory. Essentially, the EQDTOQ code has now been merged into toq and the namelist placed into intoq. An input switch ieqdtoq is included in the standard toq namelist to control this option. A dskeqdata file is created from the GEQDSK file, and the toq run proceeds from there. Once the equilbirium is read in and converted, the option can be turned off and modifications made to the equilibrium.

3. Output has changed.
A few output changes have been made, but the most important is that Matlab files have been included which visualize data from each iteration if the options to write these files are turned on. This vizualization can assist in determining the cause of problems in finding an equilibrium solution. The matlab files are fluxmovie.m, gridmovie.m and profmovie.m, and can be used to make frame-by-iteration AVI movies of the iterative equilibrium solution history found in dskflux and dskprof and controlled by the prtflux and prtprof input variables.

Obviously any up-down asymmetric solver has more to do and is therefore slower than an equivalent up-down symmetric solver. Efforts continue to increase the efficiency of this code, but it should be noted to the user that the speed of each iterative step in the asymmetric solver typically depends directly on the change in the equilibrium between iterative steps. Therefore, later iterations near the final solution will usually pass much more quickly than early iterations when the equilibrium is "settling". WE THEREFORE ENCOURAGE the use of the dskeqo->dskeqi method (see ieqdsk input variable) to save time by providing a good initial guess, even when modifications are made, and especially when higher resolution equilibria are being created. For higher resolution equilibria (129 and above) it is best to start at lower resolutions and step up using the dskeqi method.

Happy Solving!
Dylan Brennan