Run TUFLOW From a Batch-file: Difference between revisions

Content deleted Content added
No edit summary
 
(3 intermediate revisions by 2 users not shown)
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 (iei.e. results folders), and creates these folders automatically. If for any reason the folder can't be created, a dialog will appear. This feature was first introduced for Build 2012-05-AE and is not available for TUFLOW builds prior to this. For models simulated with Build 2013-12-AA or later, non-existent folders are now automatically created. If you would prefer to have the create folder query dialog to appear, you can specify the –qcf run time option (stands for query create folders).<br>
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 (iei.e. same name, but different extensions). This option is particularly useful if the .tab and other associated files of a GIS layer need to be archived or delivered.<br>
;*“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>
REM <ttpre> start "TUFLOW" "C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe" -cp "C:\put_model_here" "C:\TUFLOW\runs\M01_5m_001.tcf" </ttpre><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 (iei.e. the simulation does not commence, only the input data is tested/checked).
<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. ValidNote, optionsscenarios shouldand beevents separatedare byspecified ato verticalhelp barthe package model utility find files that use scenario or event variable names in file names and does not limit the package to specific event and scenarios. To limit the scenarios and events, please use the [[#Copy_a_TUFLOW_model | copy model functionality]]. See the example below for more information.<br>
 
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:.<br>
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 == <folder>C:\TUFLOW\Model_to_Package
Copy Destination == <folder>C:\TUFLOW\Packaged_Model
Model Scenario ~s<number>s1~ == <scenario A> | <scenario B>Base | Dev
Model Event ~e<number>e1~ == <event A> | <event B>60m | 90m
</pre>