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.  Two input files are required for each model run:

  • Anaqsim model file (.anaq) - this is the file which describes the model setup and is created by Anaqsim.
  • Run control file (.txt) - a text file which describes what type of outputs the model should create and where these will be saved. This is created by the user with a text editor, like the Notepad accessory that comes with Windows operating systems. See the following sections for a description and examples.

To run an automated model in the Command Prompt, the command syntax is:

<path_to_Anaqsim>   <path_to_input_file>   <path_to_run_control_file>

The command prompt is accessed in Windows 11 by clicking Start Button and searching for 'Command Prompt'.

Within the command prompt it is necessary to put quotes around the path when the path contains names with spaces such as "program files" or "my documents".

To avoid typing out the full file path it is possible to change the current directory within the command prompt to the location that files are saved, then just type in the file names (no path needed) for every input/output file.

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 

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 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.

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

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

Output Log File

Command: outputfile filename.out
Required: Yes
Explanation:  Tells Anaqsim to write text outputs from the automated run to a new text file named filename.out (replace with your own filename). As written with no path, filename.out will be written to the command  prompt current directory.  If you want it written elsewhere, you must enter the entire path+filename here. The two parameters on this line must be separated by any combination of spaces and/or tab characters 
Output options: N/A
Examples: outputfile run23.out

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 run23_head_wells.csv
  • headspecifiedwells graph
Discharge Specified Wells

Command: dischargespecifiedwells
Required: No
Explanation: Directs Anaqsim to write the heads at discharge-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>_qspecWells_<well_label>.png

Examples:

  • dischargespecifiedwells log
  • dischargespecifiedwells csv run23_discharge_wells.csv
  • dischargespecifiedwells graph
Discharge Specified Multilayer Wells

Command: dischargespecifiedmultilayerwells
Required: No
Explanation: Directs Anaqsim to write multi-level discharge-specified wells in the model.  For these the breakdown of discharges by domain will be written 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>_qspecMultiWells_<well_label>.png

Examples:

  • dischargespecifiedmultilayerwells log
  • dischargespecifiedmultilayerwells csv run23_discharge_multilayer_wells.csv
  • dischargespecifiedmultilayerwells graph
Head Specified Lines

Command: headspecifiedlines
Required: No
Explanation: Directs Anaqsim to write the discharges of internal head-specified line boundaries 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>_HspecLines_<line_label>.png

Examples:

  • headspecifiedlines log
  • headspecifiedlines csv run23_HspecLines.csv
  • headspecifiedlines graph
Rivers

Command: rivers
Required: No
Explanation: Directs Anaqsim to write the discharges of river line boundaries 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>_RiverDischarge_<river_label>.png

Examples:

  • rivers log
  • rivers csv run23_Rivers.csv
  • rivers graph
River Groups

Command: rivergroups
Required: No
Explanation: Directs Anaqsim to write the cumulative discharge of grouped rivers 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>_RiverDsicharge_<river_group_label>.png

Examples:

  • rivergroups log
  • rivergroups csv run23_RiverGroups.csv
  • rivergroups graph
External Boundaries

Command: externalboundaries
Required: No
Explanation: Directs Anaqsim to write the discharges across external boundaries 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
    • Head Boundaries: <name>_ExternalHeadBoundaries_<line_label>.png
    • Normal Flux Boundaries: <name>_ExternalNormalFluxBoundaries_<line_label>.png
    • Head Normal Flux Boundaries: <name>_ExternalHeadNormalFluxBoundaries_<line_label>.png

Examples:

  • externalboundaries log
  • externalboundaries csv run23_ExternalBoundaries.csv
  • externalboundaries graph
Vertical Leakage

Command: verticalleakage
Required: No
Explanation: Directs Anaqsim to write the vertical leakages over polygon areas 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>_VerticalLeakage_<polygon_label>.png

Examples:

  • verticalleakage log
  • verticalleakage csv run23_Vertical_Leakage.csv
  • verticalleakage graph
Conditions along a Line

Command: conditionsalongline
Required: No
Explanation: Directs Anaqsim to write steady and/or transient conditions along a line to the output file.  All variables are output for all preset lines.
Output options:

  • csv - csv files will be saved to <name>_TransientLine_<line_label>_<variable>.csv where <variable> is either:
    • Head
    • DischargeTangent
    • DischargeNormal
    • ExtractionModel
    • ExtractionHBased
    • LeakageTop
    • LeakageBottom
    • StorageFlux

Unlike other csv options, you do not specify a filename following the csv key word

  • graph - graphs will be saved to <name>_TransientLine_<line_label>_<variable>.png

Examples:

  • conditionsalongline csv 
  • conditionsalongline graph
Head Hydrographs

Command: headhydrographs
Required: No
Explanation: Directs Anaqsim to write head hydrographs for preset hydrograph points to the output file.
Output options:

  • csv - a filename must be provided after csv key word
  • graph - graphs will be saved to <name>_HeadHydrograph_<point_label>.png

Examples:

  • headhydrographs csv run23_Head_Hydrographs.csv
  • headhydrographs graph
Drawdown Hydrographs

Command: drawdownhydrographs
Required: No
Explanation: Directs Anaqsim to write drawdown hydrographs for preset hydrograph points to the output file.
Output options:

  • csv - a filename must be provided after csv key word
  • graph - graphs will be saved to <name>_DrawdownHydrograph_<point_label>.png

Examples:

  • drawdownhydrographs csv run23_Drawdown_Hydrographs.csv
  • drawdownhydrographs graph
Captured Pathlines

Command: capturedpathlines
Required: No
Explanation: If no csv key word provided, directs Anaqsim to write the number of captured pathlines to the output file.  This is useful for running parameter optimization problems where you want to maximize or minimize the number of pathlines captured by specified wells or line boundaries.   Use this with capture constrain in pathline settings.
If csv is specified and a filename is provided, then the x,y,z vertices of all pathlines (whether captured or not) are saved to a file.  
Output options:

  • No keyword - captured pathlines written to output file (specified by outputfile command)
  • csv - a filename must be provided after csv key word

Examples:

  • capturedpathlines 
  • capturedpathlines csv run23_Pathlines.csv
Head Output File

Command: headoutputfile
Required: No
Explanation: Directs Anaqsim to evaluate heads according to the current plot settings (Plot Input / What to Plot / Window and Plot Input / Contours Settings / Points_Evaluate) in each model level and at each time step if it is a transient simulation.  
Output options:

  • xyz - A filename must be provided where the outputs will be written.  x, y locations and head levels are written to a csv file for each level, time period, and time step
  • binary - A filename prefix should be specified.  Outputs will be named: <prefix>_t<time>_L<level>.cgd
  • surfer - A filename prefix should be specified.  Outputs will be named: <prefix>_t<time>_L<level>.GRD

Examples:

  • headoutputfile xyz run23_Head_Output.csv
  • headoutputfile binary run23
  • headoutputfile surfer run23
Calibration

Command: calibration
Required: No
Explanation: Directs Anaqsim to write the calibration to the output file.  All types of calibration information is written.
Output options:

  • log - outputs saved to log file
  • graph - graphs will be saved to <name>_HeadCalibration.png

Examples:

  • calibration log
  • calibration graph
Check Boundary Conditions

Command: checkboundaryconditions
Required: No
Explanation: Directs Anaqsim to write boundary checks to the log file. 
Output options: N/A
Examples: checkboundaryconditions

Save

Command: save
Required: No
Explanation: Directs Anaqsim to save the solution file to the specified location.
Output options: A filename must be provided with extension .solu after the save key word. The solution file will be saved to this file.
Examples: save run23.solu

Exit

Command: exit
Required: No
Explanation: Directs Anaqsim to close after having solved and written the specified outputs.  If a line with "exit" is not in the control file, Anaqsim will remain open so that the user could continue with other ways of analyzing the solution or making plots.
Output options: N/A
Examples: exit

Example Run Control File

An example file for a transient model that uses initial head levels from file run23.hds, writes text outputs to file run23.out, outputs head levels at discharge specified wells to a csv file, outputs discharge from grouped river reaches to graphs, and then saves the solution before exiting is as follows:

initialheadsfile run23.hds
outputfile run23.out
dischargespecifiedwells csv run23_Discharge_Wells.csv
rivergroups graph
save run23.solu
exit