Control File Generator (CFG)
The Control File Generator generates mass Apsim run files in a factorial combination of various scenario factors with differing levels.

The CFG works by substituting the strings from the 'Replacement Grid' into a template file.
The Replacement Grid is set up by entering the scenario Factor names on the left hand side of the grid, in the column named 'Search String'. These names are then followed by a dollar sign to distinguish them as substitution strings.
On the right side of the grid the Factors levels are entered as a space delimited list.
For further information load 'c:\Program Files\contfilegen\demo.txt' into the grid.
The template file is a shell of the control file that you want to create. It is basically a normal control file but with the names of the scenario factors in the parts that are to be replaced.
When the replacement is performed the factor names are replaced by a factorial combination of all of the level names.
N.B. The strings in the Templte file are case sensitive.
There are two predefined macros use in the CFG and the are 'sim_number$' and 'Session$'.
'sim_number$' is an auto-incrementing variable that has the initial value of the "Start Number" input box. For each of the factorial combinations of levels created, a new simulation is created and 'sim_number$' increments with each one.
'Session$' has the value of the "Enter a Session Name" input box. Session names are used because in this version of the CFG it is possible to create several files in the one session and 'Session$' is a means to link those files.
To create more than one file use the following syntax:
#file filename
.........
.........
.........
#endfile
For further example see 'c:\Program Files\contfilegen\demo\demo.tem'
To run the demo simulation firstly launch the control file generator and open the template file 'c:\Program Files\contfilegen\demo\demo.tem', then type any session name and choose the path 'c:\Program Files\demo' (it needs to be here to access met and manager files).
Next choose the Replacement Strings file 'c:\Program Files\contfilegen\demo\demo.txt', then hit 'OK'.
The control file generated will have the name of session.con and should be ready to be run by Apsim.
Included in the installation of the CFG is a complete working demo of an Apsim mass simulation. This section will be referring to the Apsim manager in the file 'c:\Program Files\contfilegen\demo\ini\demo.man'
The way this file is setup is that most of the levels are initialise in a [levelname.Manager.Init] module. It is done this way so that only one manager body is needed and it is passed variables that are initialise for a specific scenario.
To set up a manger file this way the template file needs to be setup to accommodate. Inside the template file, in the manager line, place manager modules of the factor names.
e.g. module = manager ini\demo.man[Skip$] ini\demo.man[Sow$] ini\demo.man[Cultivar$].
When the CFG generates the Apsim files for each scenario these factor names will be replaced by unique combinations of levels and will point to init modules inside the manager.
It is fairly common that the output files be used with Apsim Outlook.
For your files to be compatible with Apsim Outlook they must contain a 'Title' line.
The title is created in the 'con' file and has the form:
Title = Region=Met$; PAWC=PAWC$; Row Spacing=RowSpace$; Skip=Skip$; Sow Date=Sow$; Cultivar=Cultivar$ etc.
Adding this line will give each output file a unique and identifiable title to compare results against.