Batch Operation

Top  Previous  Next

You can also run REBEKA 2 in batch mode. The command is as follows:

 

>Rebeka [project name] [rainfall file] [number of runs]

 

e.g. the command:

 

>Rebeka "C:\Data\GEP 1\version3" zuer8695.kmd 200

 

causes that REBEKA loads the project "version3" in folder "C:\Data\GEP1" with the rainfall data file "zuer8695.kmd" (rainfalls of Zurich from 1986 until 1995) and executes a stochastic simulation with 200 runs.

A deterministic simulation is carried out if 1 is chosen for the number of runs. For the above example, system data must be saved in the file "version3.in" and variation data in the file "version3.csv". If these two files do not exist then the command cannot be executed. If a project named "version3" was interactively created before then these two files exist automatically. As the example shows a path for the project can be used. If the path contains spaces then it must be enclosed with double quotes. Warning: parameters should not contain any umlauts! The program and the rainfall data file are searched in the active directory. It is therefore important that you change directory where REBEKA is installed (normally c:\Program Files\REBEKA2).

 

Multiple commands can be saved in a so-called batch file (extension must be *.bat). If this batch file is called then all commands in the file are executed line by line. That may look as follows:

 

batch file example1.bat:

 

rem change to the right drive

c:

rem change to the right folder

cd \Program Files\Rebeka2

rem now the commands follow

echo project1 is executed

Rebeka project1 zuer8695.kmd 200

echo project2 is executed

Rebeka project2 zuer8695.kmd 200

echo project3 is executed

Rebeka project3 zuer8695.kmd 200

echo project4 is executed

Rebeka project4 zuer8695.kmd 200

 

Bold words are batch commands (see Windows help for details) which can be used in batch files to control the execution.

 

In version 2.1 and later you can use another form of the batch call to merge to inflow data files to one outflow data file:

 

 >Rebeka [project path] [inflow file 1] [inflow file 2] [new outflow file]

 

The following command looks in folder "C:\data\example Goldach\" for the two files vog_out.txt and A0_out.txt, calculates the sum of the two files and saves the result in the file m15_in.txt:

 

 >Rebeka "c:\data\example Goldach\" vog_out A0_out m15_in

 

Important: the path must be ended with a backslash \ , the file name must be indicated without extensions .txt.