Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The adapter consists of separate pre- and post adapters that can be used to import and export timeseries data to/from the MGB-SA model and control the simulation period. The FEWS general adapter is used to configure both the pre- and post adapter and execute the MGB-SA simulation using the MGB command line executable. This model adapter is written in java. The main functionality of the adapter is to read / write the binary files of MGB-SA in order to input precipitation data from FEWS into the MGB-SA model and to transfer output flow data from MGB-SA back to FEWS. The adapter currently does not provide state handling so the model can only run with a cold start.

Note: there is an earlier version adapter developed by the company LACTEC in 2013 for an earlier version of the MGB model, but there have been various changes to the model file structure of MGB-SA 1.0 so it was decided to create a new adapter which makes more efficient use of Delft-FEWS support libraries and supports the NetCdf file format for more efficient transfer of large datasets.

...

  • For all files that are written by this adapter, if the file to be written already exists, then it will be overwritten.
  • This program assumes that the MGB-SA model configuration uses the same time zone as given in the PI XML run file.
  • The working directory (workDir) defined in the PI XML run file is the directory where the MGB-SA model will be run, the MGB input and output files will be stored in this directory.
  • The default file names and location of the MGB input and output files can be altered using (optional) properties in the PI XML run file
  • This program writes log messages to a PI-XML diagnostics file specified in the PI XML run file. This will be picked up by FEWS general adapter automatically.
  • This program uses the information in the specified same PI XML run file as input the pre adapter and uses this information to perform the following actions:
    1. Read the infoMGB.sim file, to determine the actual run period and timestep used by the model, and checks that this is compatible with the information in the run info file.
      The default path and file name of the infoMGB.sim input file (*.inp) file can be specified in the (optional) property "infoMgb" in the PI XML run file. 
    2. Convert the MGB binary output file to NetCDF (or PI XML) timeseries files, currently this is used only for flow data, so only one OutputTimeSeries field should be specified in the run info file.
      please note that the binary inputs of MGB contain only raw data without any location indexing. The resulting input for FEWS will contain location-id's numbered from 1 to N

...

  • This program needs Java version 11 or higher.
  • The native libraries included will work on Windows but not on Linux
  • This program needs the following Java/native libraries:
    • castor-0.9.5p.jar
    • Delft_NetCDF_Util.jar
    • Delft_PI.jar
    • Delft_PI_castor.jar
    • Delft_Util.jar
    • FastInfoset-1.2.6.jarjna-5.7.0.jar (question)
    • joda-time-2.10.jar
    • log4j-1.2-api-2.17.1.jar
    • log4j-api-2.17.1.jar
    • log4j-core-2.17.1.jar
    • log4j-slf4j-impl-2.17.1.jar
    • netcdf-4.6.3p.jarplatform-5.7.0.jar (question)
    • slf4j-api-1.7.13.jar
    • xercesImpl.jar
    • crl_x64.dll
    • hhl_x64.dll
    • hx64.dll
    • ms120x64.dll
    • nc_x64.dll
    • z_x64.dll
    • jnidispatch.dll (question)

GeneralAdapterRun Example Configuration

...

In this section the data to be exported from FEWS as input to the module is specified. Data to export to MGB generally includes:

  • Input timeseries data (i.e. rainfall, flow, water levels, evaporationcurrently only precipitation)
  • Run file (i.e start and end time for simulation)

...