6.4 Scratch Vars

In FLASH4 the user is allowed to declare `scratch' space for grid scope variables which resemble cell-centered or face-centered in shape and are dimensioned accordingly, but are not advected or transformed by the usual evolution steps. They do not participate in the guard-cell filling or regridding processes. For example a user could declare a scratch variable to store the temperature change on the grid from one timestep to another.They can be requested using keyword SCRATCHCENTERVAR for cell-centered scratch variables, or SCRATCHFACEVAR for face-centered scratch variables. A special case is SCRATCHVAR, which has one extra cell than the cell-centered variables along every dimension. We have provided this data structure to enable the reuse of the same scratch space by both cell-centered and each of the face-centered variables. Similar to the mesh variables used in the evolution, the scratch data structures are 4-dimensional arrays per block, where the first dimension enumerates the variables and the next three dimensions are the spatial dimensions. Scratch variables are indexed by postpending one of _SCRATCH_GRID_VAR, _SCRATCH_CENTER_VAR or _SCRATCH_FACEX/Y/Z_VAR to the capitalized four letter variable defined in the Config file. Similarly to property variables, NSCRATCH_CENTER_VARS, SCRATCH_CENTER_VARS_BEGIN, and SCRATCH_CENTER_VARS_END are defined to hold the number and endpoints of the cell-centered scratch variables. For face-centered scratch variables the CENTER is in the above terms is replaced with FACEX/Y/Z while for SCRATCHVARS, the CENTER is replace with GRID.