Run TUFLOW From a Batch-file: Difference between revisions
Content deleted Content added
Anne.Kolega (talk | contribs) |
|||
| (4 intermediate revisions by 3 users not shown) | |||
Line 23:
===Pause===
A second line with the text "pause" can be added, this will prompt the user to press a key at the end of the batch file. This is useful if the
<pre>"C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe" "M01_5m_001.tcf"
pause</pre>
Line 62:
==No Console Option==
Using the -nc switch will run a simulation without opening a
<pre>Start "TUFLOW" /wait /min "C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe" -nc M01_5m_001.tcf
Line 84:
===Automatically Create Folders in a TUFLOW model===
The use of the -acf (automatically create folders) switch prevents the dialog prompt from appearing when encountering non-existent folders (
An example is:<br>
<pre>start "TUFLOW" "C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe" -acf "C:\TUFLOW\Tutorial_Wiki\TUFLOW\runs\M01_5m_001.tcf"</pre>
Line 100:
Additional optional flags can be added to the base '''-c''' switch, in any combination, including:<br>
;* “a” (all);<br>
: The addition of the “a” flag (e.g. -ca) copies all files of the same name for all input files (
;*“L” (list);<br>
: The addition of the “L” flag will output the files used by TUFLOW into a .tcl (TUFLOW Copy List) file but not copy the files to a destination folder. This can be useful if scripting the copying of models. To run the copy list the character “L” needs to be specified after the -c input argument. This works for all copy options, for example, the following are all valid; -cL, -caL, -capL. The .tcl file produced is output in the same directory as the .tcf and takes the simulation name.
;* “p” (path); and<br>
: The addition of the “p” flag (e.g. -cp) allows the user to specify an alternate path in which to copy the model. Without this flag, the location defaults to the .tcf’s location. For example, specifying the following, will place a copy of the model into a folder C:\put_model_here:<br>
;* “ncf” (no check files)<br>
: The addition of the “ncf” flag (e.g. -cncf) copies the essential input files and excludes all check files.<br>
Line 125:
<li>The Check MI Save Date will need to be set to WARNING or OFF in the .tcf file if the –ca option has not been used as the .tab and other files will not have been copied.
<li>There is a limit of 1,000 characters (including spaces) on pathnames. As very long pathnames can result due to the above approach, if the number of characters exceeds 1,000, problems may occur.
<li>The -c switch automatically invokes the -t (
<li>The -b option still applies if several models wish to be copied using a batch (.bat) file.
</ol><br>
Line 148:
: The addition of the “L” flag (e.g. -pmL) list the files to be copied into an output file, but don’t copy.<br>
;* “ini” (file.ini)<br>
: The addition of the “ini” flag (e.g. -pmini) provides a .ini file with user defined options. A .ini file can be used to overwrite the default base and destination folders, and specify events/scenarios for models with events/scenarios in filenames.
Combinations of the above are also valid, with the order of the optional switches not being important (-pmAllL would be treated the same as -pmLAll).<br>
Line 167:
An example of package model that copies all files with specified .ini file (-pmAllini) is:<br>
<pre>start "TUFLOW" "C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe" -pmAllini package.ini "C:\TUFLOW\Tutorial_Wiki\TUFLOW\runs\M01_5m_001.tcf"</pre>
An example of .ini file to overwrite the default base and destination folders, and specify events/scenarios for models with events/scenarios in filenames:<br>▼
====INI files with Events and Scenarios====
▲An example of .ini file to overwrite the default base and destination folders, and specify events/scenarios for models with events/scenarios in filenames
The model scenario and event options are required only if there are files that use the event or scenario variables in file names. This option does not limit the files that TUFLOW will package by scenario or event.
E.g. you may have the following command to read in either a base or development TIF grid:
<pre>
Read GRID Zpts == ..\model\grid\DEM_<<~s1~>>.tif
</pre>
In this example, we can assume that the <tt><<~s1~>></tt> variable could be replaced with either <tt>"Base"</tt> or <tt>"Dev"</tt>. The example ini file below shows how to ensure that TUFLOW will package both the "Base" and "Dev" files correctly. The same concept applies for event variables, noting that events defined in the event file (TEF) and their associated boundary files are not required to use this. It is only required if the event variable is used i.e. <tt><<~e1~>></tt>.
<pre>
Base Folder ==
Copy Destination ==
Model Scenario ~
Model Event ~
</pre>
Line 313 ⟶ 321:
With the following line:<br>
<tt><u>echo</u> start "TUFLOW" /wait "C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe" -b -e1 %%a -e2 %%b filename.tcf</tt><br>
By using the echo in the command line, rather than starting the simulations the command line will be displayed in the
[[File:DOS nested batch output.png|frame|none]]
| |||