Run TUFLOW From a Batch-file: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 14:
Open this file in a text editor and add the following line.
 
<pre>"C:\TUFLOW\Releases\2011-09\w32\TUFLOW_iSP_w32.exe" "M01_5m_001.tcf"</pre>
This is the simplest command line for starting TUFLOW, the line above contains only two arguments, the first is the path to the TUFLOW executable and the second argument "M01_5m_001.tcf" is the simulation file name. Depending on the location of the executable the above command line will need to be modified. The quotations around the TUFLOW executable and the .tcf file name are only required if there are spaces in the file names. However, it is recommended to include these to avoid problems.
 
'''TIP:'''<br>
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 DOS window disappears from the screen, before you can read the output, the pause command will keep the window open.
<pre>"C:\TUFLOW\Releases\2011-09\w32\TUFLOW_iSP_w32.exe" "M01_5m_001.tcf"
pause</pre>
 
Line 50:
 
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>
'''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==
Line 57:
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>
Line 67:
-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==
This section is yet to be finalised.