GENIE BFG Files

Example BFG metadata files

Example Definition file
The example definition file below shows definition data for model "arg1". Note that this is a "scientific" model rather than a "transformation" model. There are two initialisation entry points, "init1" and "init2", an update entry point "ts" and a deinitialisation entry point "finalise". A constraint is specified: init1 must be called before init2. Fields are mostly "argpass" - passed in and out of models through arguments to the entry point subroutines, however one field of init2 is "inplace" - a put that happens under the init2 entry point within the model source code itself. Note that inplace fields will be associated with an entry point even in the case of "minimally compliant" models that contain their own control code (see section 1.1) - at least one entry point must be supplied to BFG so that it can start the model running. The model timestep is 10 framework timesteps, meaning that the "ts" subroutine will only run on every 10th iteration of the framework update loop.

Example Composition file
The example composition file below shows different methods of priming for the initialisation entry points "init1" and "init2" of model "simpleMixed1": from a namelist, NetCDF file, constant, another entry point (argument ID 1 of init2 is primed from argument ID 3 of init1), and internally (priming by the model itself). The composition file also demonstrates connections between coupling fields made using set notation (for "argpass" coupling) and point-to-point notation (for "inplace" coupling):


 * The timestep subroutines for models "simpleMixed1" and "simpleMixed2" share a field through argpass coupling (argument ID 1 for both timestep subroutines). Whether the field is input or output from the respective models is determined by the data "direction" attributes for the ID 1 arguments in the definition file (examples of which are shown in section 5.1).  Note that the order entry point subroutines are called in (the schedule, found in the deployment file) also affects where arguments go from and to, as discussed in section 3.2.2.
 * A second field is shared between models "simpleMixed1" and "simpleMixed2" through inplace coupling. The field is sent by put ID 2 (which occurs under the "simpleMixed1" timestep subroutine), and is received by get ID 3 (which occurs under the "simpleMixed2" timestep subroutine).

Example Deployment file
The example deployment file below represents a concurrent framework deployed as a single executable (deployment unit). The deployment unit contains two sequence units: the first sequence unit is run by two threads (MPI processes), and consists of models "single" and "single2"; the second sequence unit consists of just one model ("multiple") run by three threads. An alternative implementation would be to place each sequence unit in a separate deployment unit (executable). The schedule in the second half of the file provides the order for the framework control code. In a sequential implementation of the framework, this would also be the order of execution for the model entry points, but in the concurrent implementation given below the "multiple" timestep entry point may not necessarily run after the "single2" and "single" subroutines, as the multiple model is part of a different sequence unit. In contrast, the threads running the "single" and "single2" models are guaranteed to run those models in the order indicated by the schedule because they both belong to the same sequence unit. The schedule also shows that 100 iterations of the framework timestep loop will be carried out. This doesn ' t necessarily mean that the models will be called every iteration: each model has its own timestep, set in the definition data for that model - for instance, model "single2" may only be run every 10th iteration.