RIBASIM (River Basin Simulation Model) is a generic model package for analyzing the behavior of river basins under various hydrological conditions. The RIBASIM adapter in FEWS can be used to transfer of hydrological data from FEWS to RIBASIM input timeseries (TMS files) and to transfer RIBASIM calculation results (HIS files) back to FEWS. 

Specific features

Time step definitions

A RIBASIM model can run simulations for predefined time steps of one day ("day"), one week ("week"), ten days ("decade"), half a month ("halfmonth") or one month ("month").

This means that the output of the module which is provided in HIS files is defined in terms of one of these time steps using year/timestep indices. The post-adapter will translate these to FEWS date-time values using the "nonequidistant" timestep unit where the time given reflects the start of each simulation step interval. 

Time series value units

RIBASIM assumes a fixed unit for it's inputs which is given in the runinfo.xml configuration file, the unit defined in the input PI-XML time series is ignored so you need to check that this is equivalent.

RIBASIM adapter binary folder

The following files are part of the binary folder for the Wanda adapter and are provided in the fews-wanda-adapter-bin.<version>.zip artifact of the "install adapters" teamcity builds:

General Adapter Configuration

General section

The image below shows an example of the configuration of the general section. The following settings are of specific importance for RIBASIM:

ExportActivities Section

Important for the RIBASIM model and the RIBASIM adapter are the properties of the exportRunFileActivity. These properties provide specific RIBASIM adapter model settings.

As an example General Adapter configuration is not available yet at this time, an example PI runInfo XML file from one of the adapter unit tests is given here:

<?xml version="1.0" encoding="UTF-8"?>
<Run xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.wldelft.nl/fews/PI"
xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_run.xsd" version="1.24">
<logLevel>info</logLevel>
<timeZone>0.0</timeZone>
<startDateTime date="1990-10-01" time="00:00:00"/>
<endDateTime date="1991-07-31" time="00:00:00"/>
<time0 date="1990-10-01" time="00:00:00"/>
<workDir>$WORKDIR$</workDir>
<inputStateDescriptionFile>$WORKDIR$/state/states.xml</inputStateDescriptionFile>
<inputTimeSeriesFile>$WORKDIR$/input/actinflw.xml</inputTimeSeriesFile>
<outputDiagnosticFile>$WORKDIR$/diag.xml</outputDiagnosticFile>
<outputTimeSeriesFile>$WORKDIR$/output/ribres.xml</outputTimeSeriesFile>
<properties>
<int key="ribasimVersion" value="7"/>
<int key="tmsUnit" value="1"/>
<string key="simulationTimestep" value="day"/>
<string key="stateExportDir" value="$WORKDIR$/input"/>
<string key="stateFile" value="$WORKDIR$/output/state_out.ini"/>
<string key="runsimpFile" value="$WORKDIR$/input/runsimp.dat"/>
<string key="runsimpTemplate" value="$WORKDIR$/input/runsimp_template.dat"/>
</properties>
</Run>
ExecuteActivities Section

As the RIBASIM model consists of several executable programs that need to be executed in a specific sequence, several executa activities nee3d to be configured, including the executation of the Pre- and/or Post Adapter. An example GeneralAdapter config to illustrate this was not yate available at the time of writing this page.

ImportActivities Section

The import activities as configured will be reflected in the RunInfo xml file eported by the General Adapter as input for the Post-Adapter, see the above example.

TMS file versions

Hydrological timeseries are input in RBASIM using the TMS file format, for which 2 versions have been implemented:

For RIBASIM 7 and later, an exception is for timeseries marked as non-equidistant, these will be converted to TMS 1.01 format, where all "regular" time series use the 1.04 format. Please note that you can have full control over the TMS format version used by using the tmsHeader option, providing your own header (first line of the file). More information is available in the RIBASIM documentation.



Example configuration

Example general adapter configuration file is to be attached