next up previous
Next: The <job> block Up: Running athena1.0 Previous: Running athena1.0

Editing the input file

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

parameter-name = value [# comments]
White space after the parameter name, after the `=', and before the `#' character is ignored. Everything after (and including) the `#' character is also ignored. Only one parameter value can appear per line. Comment lines (i.e. a line beginning with `#') are allowed for documentation purposes. A maximum number of 256 characters is permitted per line in the input file. Both block names and parameter names are case sensitive.

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.



Subsections
next up previous
Next: The <job> block Up: Running athena1.0 Previous: Running athena1.0
2003-03-05