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.
Delft-FEWS and OpenDA are two separate computer programs. Delft-FEWS can call OpenDA as part of a workflow, but there is no direct link between Delft-FEWS and OpenDA. This means that using OpenDA from Delft-FEWS is a two step approach. First you need an OpenDA configuration that works with only OpenDA (without Delft-FEWS). Secondly you need to configure Delft-FEWS to run OpenDA using your existing OpenDA configuration. If your OpenDA configuration does not work with OpenDA only, then it won't work with OpenDA and Delft-FEWS. |
The adapter between Delft-FEWS and OpenDA is called OpenDaInFews. OpenDaInFews is a separate Java program. The OpenDaInFews binaries consist of the following files:
OpenDaInFews depends on OpenDA and on the following additional files:
OpenDaInFews also needs the OpenDA binaries. In order to use OpenDaInFews all OpenDaInFews binary files and dependencies must be present in the OpenDA bin folder.
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:
Runtime arguments for OpenDaInFews:
For an algorithm run: | -f <FEWS pi run file path relative to working dir> -a <OpenDA application config file (.oda file) path relative to working dir> |
---|---|
Example: | -f run_info.xml -a enkf_run.oda |
For a single stoch model run: | -f <FEWS pi run file path relative to working dir> -m <stochModelFactory full className> <stochModelFactory config file path relative to pi run file dir> |
---|---|
Example: | -f run_info.xml -m org.openda.blackbox.wrapper.BBStochModelFactory stochModelConfig.xml |
For a single model run: | -f <FEWS pi run file path relative to working dir> -m <modelFactory full className> <modelFactory config file path relative to pi run file dir> |
---|---|
Example: | -f run_info.xml -mĀ org.openda.blackbox.wrapper.BBModelFactory modelConfig.xml |
The recommended way to run OpenDaInFews is to use a batch script to setup the Java classpath and invoke the OpenDaInFews main method. Such a batch script can be started from a command prompt or directly from a Delft-FEWS workflow. 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. While it is possible to make such a batch script yourself, it is also possible to use the batch script called run_openda_in_fews.bat. This batch script is included in the OpenDaInFews binaries since 2012-11-15 (revision 3640), and will be part of future OpenDaInFews releases. This batch script passes its runtime arguments to OpenDaInFews, so the batch script needs the same runtime arguments that are listed in the table above.
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:
Below are two different examples of configuration that can be added to a Delft-FEWS general adapter file to run OpenDaInFews.
Using a batch script (recommended):
<exportActivities> <exportRunFileActivity> <exportFile>%REGION_HOME%/Models/OpenDaConfig/run_info.xml</exportFile> </exportRunFileActivity> </exportActivities> <executeActivities> <executeActivity> <description>OpenDa in Fews adapter</description> <command> <executable>%REGION_HOME%/Models/OpenDA/bin/run_openda_in_fews.bat</executable> </command> <arguments> <argument>-f</argument> <argument>%REGION_HOME%/Models/OpenDaConfig/run_info.xml</argument> <argument>-a</argument> <argument>%REGION_HOME%/Models/OpenDaConfig/enkf_run.oda</argument> </arguments> <timeOut>100000000</timeOut> <overrulingDiagnosticFile>%REGION_HOME%/Models/OpenDaConfig/diagnostics/diagnostics.xml</overrulingDiagnosticFile> </executeActivity> </executeActivities> |
Calling OpenDaInFews directly from Delft-FEWS:
<exportActivities> <exportRunFileActivity> <exportFile>%REGION_HOME%/Models/OpenDaConfig/run_info.xml</exportFile> </exportRunFileActivity> </exportActivities> <executeActivities> <executeActivity> <description>OpenDa in Fews adapter</description> <command> <className>nl.deltares.openda.fews.OpenDaInFews</className> <binDir>%REGION_HOME%/Models/OpenDA/bin/</binDir> </command> <arguments> <argument>-f</argument> <argument>%REGION_HOME%/Models/OpenDaConfig/run_info.xml</argument> <argument>-a</argument> <argument>%REGION_HOME%/Models/OpenDaConfig/enkf_run.oda</argument> </arguments> <timeOut>100000000</timeOut> <overrulingDiagnosticFile>%REGION_HOME%/Models/OpenDaConfig/diagnostics/diagnostics.xml</overrulingDiagnosticFile> </executeActivity> </executeActivities> |
Following is a short description of the steps that are usually involved in a workflow that runs OpenDA from Delft-FEWS using OpenDaInFews:
Note: 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 folder. 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 Delft-FEWS general adapter configuration. This can be useful when trying to pin down the cause of the error or for debugging purposes. |