Skip to main content

Automating Runs

In addition to running Anaqsim interactively through the graphic user interface, you can make automated runs using the Windows command prompt.  This may be useful for running parameter estimation software such as PEST or for executing a batch of unattended runs.  The command prompt is accessed in Windows 11 by clicking Start Button and searching for 'Command Prompt'. Once in the Command Prompt, the command syntax is:

path_to_Anaqsim   path_to_input_file   path_to_run_control_file

There are two ways to approach this:

  • Type in the full path for every input/output file; or
  • Change the current directory of the command prompt at the start, then just type in the file names (no path needed) for every input/output file, which should be in the current directory.

The second approach is a bit cleaner and simpler.  

Assuming you've changed the current directory in the command prompt to the directory with all input/output files, the following is an example command that would execute a run of Anaqsim:

"c:\program files\yellow sub hydro\Anaqsim\Anaqsim.exe" run23.anaq run23.txt 

It is necessary to put quotes around the path when the path contains names with spaces such as "program files" or "my documents".  In the above example, Anaqsim is launched, run23.anaq is opened from the command prompt current directory, then execution and outputs are controlled by lines in the run control file run23.txt, also in the command prompt current directory.  
An optional 'batch' command can be added to the command which will force Anaqsim to work in the background and not open a user-interface.  An example command that would execute a run of Anaqsim in the background is:

"c:\program files\yellow sub hydro\Anaqsim\Anaqsim.exe" run23.anaq run23.txt batch

The run control file is a text file that you create with a text editor like the Notepad accessory that comes with Windows operating systems.  

Starting from version 2023-1 additional outputs and output options are available.

The section below shows all the possible commands that can be included in the run control file, their output options, and examples of each.  Some output files are dynamically named based on the input file name, and labels of elements in the model.  Where <name> is specified this relates to the filename of the .anaq input file. Where <well_label> is specified, it relates to the label associated with each well in the model. Similar syntax is used for lines, rivers, etc which have labels within the model.

Run Control File Commands

All of the commands listed in the run control file are lower case (case sensitive).  The lines may appear in any order.

Initial Heads File

Command: initialheadsfile filename.hds
Required: required for transient runs
Explanation: Tells Anaqsim to use file filename.hds (replace with your own filename) as the initial heads for a transient run.  As written with no path, the file must be located in the command  prompt current directory.  If it's located elsewhere, you must write the entire path+filename here instead of just the filename.  The two parameters on this line must be separated by any combination of spaces and/or tab characters.  This line is only needed for transient runs where the starting heads are to be read from a file.
Output options: N/A
Examples: initialheadsfile run23.hds

Head specified wells

Command: headspecifiedwells
Required: No
Explanation: Directs Anaqsim to write the discharges of head-specified wells to the output file.
Output options:

  • log - outputs saved to log file
  • csv - a filename must be provided after csv key word
  • graph - graphs will be saved to <name>_hspecWells_<well_label>.png

Examples:

  • headspecifiedwells log
  • headspecifiedwells csv run23head_wells.csv
  • headspecifiedwells graph