10.3 Routine Descriptions

The Runtime Parameters unit is included by default in all of the provided FLASH simulation examples, through a dependence within the Driver unit. The main FLASH initialization routine (Driver_initFlash) and the initialization code created by setup handles the creation and initialization of the runtime parameters, so users will mainly be interested in querying parameter values. Because the RuntimeParameters routines are overloaded functions which can handle character, real, integer, or logical arguments, the user must make sure to use the interface file RuntimeParameters_Interfaces in the calling routines.

The user will typically only have to use one routine from the Runtime Parameters API,
RuntimeParameters_get. This routine retrieves the value of a parameter stored in the linked list in the RuntimeParameters_data module. In FLASH4 the value of runtime parameters for a given unit are stored in that unit's Unit_data Fortran module and they are typically initialized in the unit's Unit_init routine. Each unit's 'init' routine is only called once at the beginning of the simulation by Driver_initFlash. For more documentation on the FLASH code architecture please see Chp:Architecture. It is important to note that even though runtime parameters are declared in a specific unit's Config file, the runtime parameters linked list is a global space and so any unit can fetch a parameter, even if that unit did not declare it. For example, the Driver unit declares the logical parameter restart, however, many units, including the IO unit get restart parameter with the RuntimeParameters_get interface. If a section of the code asks for a runtime parameter that was not declared in a Config file and thus is not in the runtime parameters linked list, the FLASH code will call Driver_abortFlash and stamp an error to the logfile. The other RuntimeParameter routines in the API are not generally called by user routines. They exist because various other units within FLASH need to access parts of the RuntimeParameters interface. For example, the input/output unit IO needs RuntimeParameters_set. There are no user-defined parameters which affect the RuntimeParameters unit.

FLASH3 Transition: FLASH no longer distinguishes between contexts as in FLASH2. All runtime parameters are stored in the same context, so there is no need to pass a `context' argument.