Run time parameters are set in an input file, usually given the name athinput.problem-name, where problem-name is a string identifier. Often this string is the same as the name of the problem-generator, i.e. the function in athena1.0/src/prob which is used to initialize the data. In some cases, a name which is more specific to the problem at hand is used (since some problem-generators can be used to initialize more than one problem).
As an example of an athena1.0 input file, the file /athena1.0/tst/1D-mhd/athinput.brio+wu is reproduced below. Other examples can be found in this and the /athena1.0/tst/1D-hydro directory.
<job> problem_id = Brio_Wu # problem ID: basename of output filenames restart_flag = 0 # 0 for new job, 1 for restart restart_file = res000aa # name of restart file <time> cour_no = 0.8 # The Courant, Friedrichs, & Lewy (CFL) Number dt_res = 1.0 # time increment between restart dumps nlim = 1000 # cycle limit tlim = 1.0 # time limit dt_hst = 0.01 # time increment between history dumps dt_bin = 0.01 # time increment between binary dumps dt_hdf = 0.1 # time increment between HDF-SDS dumps dt_tab = 0.01 # time increment between tabular dumps <grid> nxzones = 800 # Number of zones in X-direction x1min = 0.0 # minimum value of X x1max = 1.0 # maximum value of X ibc_x1 = 2 # inner-I (X) boundary flag obc_x1 = 2 # outer-I (X) boundary flag <problem> gamma = 2.0 # gamma = C_p/C_v dl = 1.0 # density on left half of grid pl = 1.0 # pressure v1l = 0.0 # X-velocity v2l = 0.0 # Y-velocity v3l = 0.0 # Z-velocity b1l = 0.75 # X-magnetic field b2l = 1.0 # Y-magnetic field b3l = 0.0 # Z-magnetic field dr = 0.125 # density on right half of grid pr = 0.1 # pressure v1r = 0.0 # X-velocity v2r = 0.0 # Y-velocity v3r = 0.0 # Z-velocity b1r = 0.75 # X-magnetic field b2r = -1.0 # Y-magnetic field b3r = 0.0 # Z-magnetic field
Note the syntax of the parameter specification used in this file. Parameters are grouped into named blocks, with the name of each block appearing on a single line within angle brackets. Block names must always appear in angle brackets on a seperate line (although the blank lines above and below the block names are not required)4.
Below each block name is a list of parameters, with syntax
The input file is read by a very flexible parser written for athena1.0 (athena1.0/src/par.c). The entire input file is read at the very beginning of the main program, and the parameter names and their values stored in memory. Thereafter, these values can be accessed as necessary by any function at any time during execution. The parser allows the parameter names to appear in any order within a named block, extra (or misspelled) parameter names will be parsed and never used. There are no default values for any of the run-time parameters in the input file; each parameter must be supplied a value through the input file. If a value is requested from the parser but its name does not exist, the parser will print an error message and terminate the execution of the program. In this way, both missing or misspelled parameter names will be detected at run time. The parameters may be integers, floating point numbers, or strings. The parser will do automatic type conversion, for example converting floating point numbers to double precision if necessary (though the user is expected to know the basic difference between real, integer, and string data types). Parameter values can also be set at run time through the command line, which provides a very flexible way of testing the code and running parameter searches, see §5.2.
Below we describe each of the parameters in the input file and their function.