User Manual of CURRAY by T.K. Mau and S.C. Chiu Brief Description: This is a stand-alone version of CURRAY, a 3-D ray tracing code for RF waves ranging in frequencies from ICRF to LHRF. It runs mainly in a tokamak magnetic geometry with the toroidal angle being an ignorable coordinate. The ray equations are based primarily on the cold plasma dispersion relation, with relevant thermal electron corrections in the LHRF regime. Solution of the ray equations gives rise to the ray trajectories and the evolution of wave characteristics (N_par, N_perp, etc.) along the rays. Absorption along the rays is calculated by the use of Poynting's theorem, where local wave dissipation is expressed in terms of the anti-Hermitian part of the hot dielectric tensor. Furthermore, hot electron and ion correction terms are included in the electric field polarization factors in the absorption calculations. Absorption mechanisms modeled include electron Landau and TTMP, ion cyclotron resonances at the fundamental and higher harmonics for thermal and isotropic slowing-down distributions. At present, beam energetic ion absorption is modeled by an equivalent Maxwellian distribution with a characteristic temperature and anisotropy. The rays can be started anywhere in the plasma where the wave is propagating. An antenna spectrum is modeled by summing up results from an array of rays with specified starting locations and wavenumbers. Both the fast and slow branches can be followed; the ion-Bernstein wave is presently not implemented in the code. Note that mode conversion to the ion-Bernstein branch is not modeled in this code, but conversion between the fast and slow branches in the LHRF is modeled. The present version of CURRAY is an extension of the RAYLH/RAYIC code by Marco Brambilla, performed over the years at GA by S.C. Chiu, Bob Harvey and T.K. Mau. The code is now coupled to Shafranov equilibria described by EQDSK (EFIT/ONETWO) and DSKBAL (TOQ). The user is adviced to use only EQDSK for now until further notice. Provisions are also present to link the code to ONETWO and CQL3D; however, these latter linkages still need to be updated for the present verson of CURRAY. Input to CURRAY: There are basically three input files to CURRAY, namely, 'curray.in', 'specfl.in', and 'eqdsk.hb' or 'dskbal'. (1) 'curray.in' involves input data about the plasma parameters and profiles, numerics, and other control parameters. (2) 'specfl.in' involces input data on the wave parameters, such as frequency, mode, ray initial parameters, absorption and current drive calculational models, etc. (3) 'eqdsk.hb' or 'dskbal' is a text file that specifies the equilibrium geometry. Details of the first two input files are given in a separate writeup called 'curray_input'. Details of 'eqdsk.hb' can be obtained from subroutine FITEQDSK in the file 'magfld.f'. Information on 'dskbal' resides in subroutine MHDEBM in 'magfld.f'. Actually, the file 'zf1r.ou' is also needed to run CURRAY. This file contains tabulated values of the Fried-Conte dispersion function over a large range of the argument. Output of CURRAY: There are two output files from CURRAY, namely, 'currayout' and 'rayop'. (1) 'currayout' is a text file that gives global results from the code run, such as plasma parameters (geometry, beta value, etc.), density and temperature profiles, abbreviated wave parameters along rays, absorption and current drive results for each ray and summed up for all rays. (2) 'rayop' is a text data file used mainly for graphics display of results and for coupling to other codes, such as ONETWO and CQL3D. Details of the content of 'rayop' can be obtained by going into text fo subroutine RAYINOUT in the 'inoutdat.f' file. Graphical Display of CURRAY results: Presently, the PGPLOT graphics package is used to display the code results. Details of implementing PGPLOT on the local workstations can be obtained from the GA website. The graphics output file is called 'pgplot.ps' that displays the plasma density and temperature profiles, the elevation and top views of all calculated rays, total absorption and current drive profiles. Then for each ray, it displays the evolution of the power flux and parallel refractive index (N_par) along the trajectory, and the absorption and current drive profiles. The display can be modified by making changes inside the file 'curplot.f' and recompiling. Running CURRAY on Hydra: Presently, CURRAY can be run on the Hydra workstation. The executable file is called 'xcurray1' and is located in the directory /d/hp/codes. The files needed to run CURRAY, 'eqdsk.hb', 'curray.in', 'specfl.in', and 'zf1r.ou', are located in /d/hp/curray/latest. Make sure they are present in your directory before executing the program. To display the results, one should make use of the executable 'curplot', which is also located in /d/hp/codes. It reads a file called 'rayop' produced by 'xcurray1'. Before running, make sure that 'rayop' is present in the same directory. The output file 'pgplot.ps' is in the Postscript format, which can be displayed using the utility 'gs' in the X-window environment. To alter the plot file and its format, you need to make the desired changes in the source code 'curplot.f', and type make to recompile. The needed files are located in the tar file 'curplot.tar' in /d/hp/curray/latest. Support for CURRAY: This is the first official release of CURRAY to the GA Group. The present version is reasonably friendly that initial runs can be made by simply following the instructions above. CURRAY is still undergoing modifications and improvements in physics models and user applications. It will be updated whenever a new phase of upgrade has been completed. For any questions and suggestions for future improvements, please send e-mail to T.K. Mau at mau@fusion.ucsd.edu.