You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Introduction

This page describes how you can use OpenDA in combination with Delft-FEWS. OpenDA is an open interface standard for (and free implementation of) a set of tools to quickly implement data assimilation and calibration for arbitrary numerical models. If you want to make a workflow in Delft-FEWS to either use data assimilation or calibrate a model automatically, then you can use OpenDA for this. In order to use OpenDA in combination with Delft-FEWS, knowledge of both Delft-FEWS and OpenDA is required. For more information about OpenDA see the OpenDA website.

Setting-up the link between Delft-FEWS and OpenDA

The adapter between Delft-FEWS and OpenDA is called OpenDaInFews. OpenDaInFews is a separate Java program. When running OpenDaInFews it may first do some preprocessing, e.g. converting data to a different format. After the preprocessing step, it will call OpenDA. At this point OpenDA will do a filtering or calibration run, depending on the configuration. After OpenDA has finished, some final postprocessing may take place before OpenDaInFews returns control to Delft-FEWS. Currently OpenDaInFews can be used in three ways:

  • run an algorithm in OpenDA ("application run"). For this a full OpenDA configuration is needed (including an .oda file). In this context an algorithm means either a filtering algorithm for data assimilation (e.g. ensemble Kalman filter) or an optimization algorithm for calibration (e.g. simplex algorithm).
  • run a model using the OpenDA black box stoch model wrapper ("single stoch model run"). For this only an OpenDA black box stoch model configuration is needed.
  • run a model using the OpenDA black box model wrapper ("single model run"). For this only an OpenDA black box model configuration is needed.

The recommended way to run OpenDaInFews is to use a batch script to setup the Java classpath and invoke the OpenDaInFews main method. It is also possible to invoke the OpenDaInFews main method directly from another Java program. However, it is highly recommended to use the batch script approach, in order to avoid problems with loading of dependencies like e.g. jar and dll files from models. Since revision 3640 the OpenDaInFews binary files include a batch script called run_openda_in_fews.bat that can be readily used to start OpenDaInFews. This batch script can be run either from a command prompt or from a Delft-FEWS workflow. This batch script passes all its runtime arguments directly to OpenDaInFews.

Runtime arguments for OpenDaInFews

Usage for OpenDA application run:

run_openda_in_fews -f <FEWS pi run file path relative to working dir> -a <OpenDA application config file (.oda file) path relative to working dir>

Example:

run_openda_in_fews -f run_info.xml -a enkf_run.oda
Usage for single (stoch) model run:

run_openda_in_fews -f <FEWS pi run file path relative to working dir> -m <modelFactory or stochModelFactory full className> <modelFactory or stochModelFactory config file path relative to pi run file dir>

Example:

run_openda_in_fews -f run_info.xml -m org.openda.blackbox.wrapper.BBStochModelFactory stochModelConfig.xml

Delft-FEWS configuration

If you want to make a workflow in Delft-FEWS that uses OpenDA, then you need to configure the Delft-FEWS general adapter so that it runs OpenDaInFews and you also need to supply an OpenDA configuration to run. To do this, please use the following approach:

  1. First create the OpenDA configuration. For documentation about OpenDA configuration files see http://www.openda.org/docu/openda_2.0/doc/xmlSchemasHTML/index.html. For more information about OpenDA and examples of OpenDA configuration files see http://www.openda.org/joomla/index.php?option=com_content&view=article&id=66&Itemid=82
  2. Test your OpenDA configuration by running it from OpenDA (without Delft-FEWS). For this you will probably also need to supply a configured model and some input data for the run. Only if that works, then you are ready for the next step.
  3. Put your OpenDA configuration, including the configured model and the OpenDA binaries, in a place that Delft-FEWS can access. Usually this is somewhere in the ModuleDataSetFiles.
  4. Finally configure an executeActivity element in a Delft-FEWS general adapter configuration file that runs OpenDaInFews. For example:
    TODO

Note for testing and debugging. If an error occurs during the run, then, after the workflow has finished, you can copy the folder that contains the OpenDA configuration and the configured model to a separate directory. From there you can do the run again (without Delft-FEWS) by calling OpenDaInFews directly from a command prompt using the runtime arguments from the general adapter configuration. This can be useful when trying to pin down the cause of the error or for debugging.

  • No labels