Tuflow and estry manual Version 3


Batching Simulations using a Batch File



Yüklə 4,62 Mb.
səhifə147/303
tarix26.12.2016
ölçüsü4,62 Mb.
#3356
1   ...   143   144   145   146   147   148   149   150   ...   303

4.5Batching Simulations using a Batch File

4.5.1Simple Example and Switches


A batch (.bat) file is the most effective method to run several or many simulations. The simplest format is to specify each simulation one after another as shown below in a .bat file.
N:\WBMSoftware\Tuflow.exe -b MR_H99_C25_Q100.tcf

N:\WBMSoftware\Tuflow.exe -b MR_H99_C25_Q050.tcf

N:\WBMSoftware\Tuflow.exe -b MR_H99_C25_Q020.tcf

pause


The .bat file is run or opened by double clicking on it in Explorer. This opens a DOS Window and then executes each line of the .bat file. Note 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. The pause at the end stops the DOS window from closing automatically after completion of the last 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.

Using the example above, the recommended approach is to first run the following batch file:
N:\WBMSoftware\Tuflow.exe -b –t MR_H99_C25_Q100.tcf

N:\WBMSoftware\Tuflow.exe -b –t MR_H99_C25_Q050.tcf

N:\WBMSoftware\Tuflow.exe -b –t MR_H99_C25_Q020.tcf

pause


This will indicate any input problems (note some WARNINGS do not require a “press return key”, but they can be located in the .tlf file). Edit the .bat file as follows:
N:\WBMSoftware\Tuflow.exe -b –x MR_H99_C25_Q100.tcf

N:\WBMSoftware\Tuflow.exe -b –x MR_H99_C25_Q050.tcf

N:\WBMSoftware\Tuflow.exe -b –x MR_H99_C25_Q020.tcf

pause


and carry out the simulations. The –x (execute) switch is optional, but is useful when editing the .bat file to quickly change between –t and –x switches.

Comment lines are specified in a .bat file using “#” in the first column. For example, if you want to re-run only the first simulation in the examples above, edit the file as follows:


N:\WBMSoftware\Tuflow.exe -b –x MR_H99_C25_Q100.tcf

#N:\WBMSoftware\Tuflow.exe -b –x MR_H99_C25_Q050.tcf

#N:\WBMSoftware\Tuflow.exe -b –x MR_H99_C25_Q020.tcf

pause


For Windows 98 users, using the following command allows the DOS Window output to be captured (Windows 98 DOS windows do not have a buffer, therefore only the last 20 to 30 lines are ever viewable). In the example below, the DOS output is redirected to a text file named dump.txt, which can be viewed using Ultraedit or other text editor.
N:\WBMSoftware\Tuflow.exe -b –x MR_H99_C25_Q100.tcf > dump.txt

Consult your Windows on-line help or manual for other features of .bat files.



Yüklə 4,62 Mb.

Dostları ilə paylaş:
1   ...   143   144   145   146   147   148   149   150   ...   303




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin