Run TUFLOW From a Batch-file: Difference between revisions

Content deleted Content added
No edit summary
Line 22:
 
==Other Batch File Switches==
These switches are available in all batch files, they are not specific to TUFLOW.
===Starting process in new window===
In order to run multiple simulations at the same time, each simulation needs be started in a new console window. To do this begin the batch file line with the "Start" command, a for the window is then added. For example, to start the simulation above in a new window titled "TUFLOW" the following would be used.
 
<pre>Start "TUFLOW" "C:\TUFLOW\Releases\2011-09\w32\TUFLOW_iSP_w32.exe" "M01_5m_003.tcf"</pre>
===Wait===
If multiple simulations are to be run, it is often desirable to run these in series, i.e. the second simulation starts after the first has finished. a /wait switch can be added which makes the batch file wait until the process is finished before moving onto the next command.<br>
An example of this is:<br>
<pre>Start "TUFLOW" /wait "C:\TUFLOW\Releases\2011-09\w32\TUFLOW_iSP_w32.exe" M01_5m_003.tcf
Start "TUFLOW" /wait "C:\TUFLOW\Releases\2011-09\w32\TUFLOW_iSP_w32.exe" M01_2p5m_005.tcf</pre>
Without the wait command, both simulations would start at the same time.<br>
'''Note:''' Unless there is a third simulation in the batch file the /wait command in the second line is not required, this prevents the batchfile from moving onto the third line.
===Setting a priority===
The priority of a process (such a TUFLOW simulation) can be specified within a batch file. This can be useful for a number of reasons:
Line 36 ⟶ 48:
*/REALTIME
 
An example of a low priority simulation is:<br>
<pre>start "TUFLOW" /low C:\TUFLOW\Releases\2011-09\w32\TUFLOW_iSP_w32.exe" "M01_5m_003.tcf"</pre>
<pre>Start /low
'''TIP:''' The priority of a TUFLOW simulation can be changed at a later stage by using the '''Windows Task Manager''', navigate to the '''Processes''' tab and right click on the TUFLOW process (e.g. TUFLOW_iSP_w64.exe) and select the set priority option.
 
== TUFLOW switches in a batch file==
These switches are specific to TUFLOW simulations.
===Testing a simulation===
The -t (test) switch is very useful for testing the data input without running the simulation. It is good practice to use this switch before carrying out the simulations, as this will tell you whether there are any data input problems. The -t switch runs TUFLOW to just before it starts the hydrodynamic computations.
An example is:<br>
<pre>start "TUFLOW" C:\TUFLOW\Releases\2011-09\w32\TUFLOW_iSP_w32.exe" -t "M01_5m_003.tcf"</pre>
===Batch mode in TUFLOW===
The use of the –b (batch) switch which suppresses the need to press the return key at the end of a simulation. This ensures that one simulation proceeds on to the next without any need for user input. This is required for running multiple simulations in series (one after the other).
An example is:<br>
<pre>start "TUFLOW" C:\TUFLOW\Releases\2011-09\w32\TUFLOW_iSP_w32.exe" -b "M01_5m_003.tcf"</pre>
===Copy a TUFLOW model===
TUFLOW can be run in copy mode. This copies all TUFLOW inputs for the simulation into a subdirectory where the .tcf is located (generally TUFLOW\runs\). There are two copy options: -c and -ca.<br>
 
-c copies only the files read by TUFLOW, for example the .mif and . mid files are read by TUFLOW, but the MapInfo format files (.tab, .id, .dat and .map) are not read by TUFLOW and these files will not be copied.<br>
-ca copies all files with the same name (regardless of extension), if the 2d_code_M01_003.MIF and 2d_code_M01_003.MID files are copied all of the MapInfo files (2d_code_M01_003.DAT, 2d_code_M01_003.ID, 2d_code_M01_003.MAP and 2d_code_M01_003.TAB), will all be copied.<br>
An example that copies all files is:<br>
<pre>start "TUFLOW" C:\TUFLOW\Releases\2011-09\w32\TUFLOW_iSP_w32.exe" -ca "C:\TUFLOW\Tutorial_Wiki\TUFLOW\runs\M01_5m_003.tcf"</pre>
==Advanced Batch Files==
===Creating a waitdelay===