Page tree
Skip to end of metadata
Go to start of metadata

Setting up scheduled forecasts

When using a live forecasting system, a scheduled forecast can be established simply through using the Manual Forecast display in the Operator Client.

DELFT-FEWS will, however, not allow a manually submitted forecast to be set as the "current" forecast. Scheduling of Current forecast should be only done by suitably authorised users, and follow a carefully defined scheduling plan. These users must have access to the admin interface tool (see Admin Interface manual).

The procedure for establishing a schedule current forecast is;

  • Start an Operator Client. Select the workflow to be scheduled. Select the option "Scheduled Forecasting". Set the Start Time and End Time properties as required, set the repeat time and the ShiftT0.
  • Submit the forecast to the Master Controller by clicking on run.
  • Go to the Administrator Interface. Select the tab Forecast Tasks and the Scheduled Tasks item. The forecast run just scheduled should be available in the list.
  • Click on Details. This will open a new web page with relevant details on the forecast run.
  • Select "Download Properties". Save the XML file to a suitable location/name.
  • Open the XML file. Change the attribute
    <makeForcastCurrent>false</makeForcastCurrent>
    to
    <makeForcastCurrent>true</makeForcastCurrent>
  • Save the XML file.
  • Cancel the forecast just submitted.
  • Return to the list of scheduled forecasts in the Admin Interface
  • Select "Schedule new Forecast"
    • Enter a relevant description (this will appear as a description of the run).
    • Enter a tag if this forecast is to be enhanced (see next section)
    • Select workflowId. This should be the same as the original forecast submitted.
    • Specify Failover behaviour. This is only relevant when two master controllers are available running in Duty/Standby. If this workflow is to run on one Master Controller only, and should be replicated on the other then this item should be set to true. It should then not be scheduled on the other Master Controller. If it is set to False, then the run should be scheduled on both Master Controllers separately.
  • Enter details on TaskDue time and TaskRepeat time
  • Select the file to upload and use the browse button to load the XML file just defined.
  • Select Submit.
  • Confirm results in the Scheduled Forecasts list.

Setting up scheduled forecasts (Windows Stand Alone)

Some simpler forecasting systems use a single computer and a Windows Stand Alone client. It is also possible to schedule tasks for these systems. 

  1. Add a folder to your trunk called "WindowsTaskScheduling"
  2. For each task you plan to schedule, you'll need to add a taskProperties file and a batch file to this folder. Examples of each of these files are given below. Test the batch file before commencing with step 3 (simply double clicking it). If the FEWS client is already open, then you should see some logging. If FEWS is not already open, it should open the SA client and log messages should appear, inidicating that the workflow ran.  (This was tested and implemented in 2017.02. In 2017.01.1 it does not create a new task, but instead gives an error message regarding multiple Delft-FEWS instances.)
  3. Once the .bat file is working, schedule the task in Windows Task Scheduler:
    1. Open Windows Task Scheduler (Search for Task Scheduler in the start menu)
    2. Make a new folder under Task Scheduler Library to organize your FEWS tasks
    3. Click "Create Task..." in the right hand panel
    4. Give the task a logical name (e.g. same as Workflow)
    5. Select "Run whether user is logged on or not" (and do not store password)
    6. Under "Triggers," click "New..." and schedule the task (e.g. One time with "Start:" at the correct start time in the computer's time zone. Repeat task every 6 hours for a duration of: Indefinitely) Make sure the trigger is enabled!
    7. Under "Actions," click "New..." and select "Start a program" and browse to/open the correct batch file. Click "OK". Under "Start in (optional):" paste the path to the .bat file. 
    8. No need to change anything in the Conditions or Settings. 
    9. Click OK

Some additional comments:

  • Workflows that don't contain a time tag (e.g. import modules with time in filestamp) will need a forecastLengthEstimator moduleinstance to set the T0 and forecast length.
  • Be aware of the different time zones. Tasks should be scheduled in the computer time zone, but import modules are still run in the FEWS time zone, and scheduling should consider availability of data (e.g. 0, 6, 12, 18 GMT). 
  • The tasks should run regardless of whether the FEWS SA is open or closed. to be confirmed!

Example taskProperties file: TaskRun_Import_NOAAGFS.xml. Note: %TIME0%, below, will pass the current FEWS system time to the module instance.

<?xml version="1.0" encoding="UTF-8"?>
<taskProperties xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/taskProperties.xsd" xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<description>ImportNOAAGFSdata_scheduled</description>
	<userId>fews</userId>
	<workflowId>Import_GFS_0.25_Schedule</workflowId>
	<taskSelection>
		<singleTask>
			<time0>%TIME0%</time0>
		</singleTask>
	</taskSelection>
	<forecastPriority>Normal</forecastPriority>
	<makeForcastCurrent>true</makeForcastCurrent>
</taskProperties>

Example batch file (corresponding to taskProperties file above): run_Import_NOAA_GFS.bat

# %1: path to region home
# %2: task properties file

cd c:\FEWS-MOZ_new\
c:\FEWS-MOZ_new\bin\_MOZ_SA_x64.exe "runTask=c:\FEWS-MOZ_new\FEWS-MOZ\WindowsTaskScheduling\TaskRun_Import_NOAAGFS.xml"

 

 

  • No labels