Table of Contents |
---|
How to import longitudinal time series from SOBEK-CF models
...
- Keelung.ids: File with the branch information, generated by Netter
- Calcdim.his and Calcdim.hia: File Files with static information from cross-sections that can be found in the SOBEK work folder. Information on bottom level and street level will be extracted from this file.
- Reachdim.his and Reachdim.hia: File Files with static information from reaches that can be found in the SObEK work folder. Information on the length of the reaches will be extracted from this file.
- Calcpnt.his: SOBEK File with computed water levels on all calculation nodes.
- Reachseg.his: SOBEK File with computed discharges and velocities.
...
- Open the "FEWS Longitudinal profiles.xls" file in EXCEL, this file has 4 worksheets named;
- Calcdim: information that will be copied from the Calcdim.his file.
- Rechdim: information that will be copied from the Rechdim.his file.
- Gridpoints: branch information for levels that will be computed within the EXCEL sheet.
- Segments: branch information for flows that will be computed within the EXCEL sheet.
- Delete all information from these 4 worksheets.
- Open the "Calcdim.his" file in ODS_View.exe (this is a viewer for HIS files installed on all machines that have SOBEK installed). Make sure the corresponding "Calcdim.hia" file is in the same directory.
- Select all data in ODS_View and export the data to a CSV file "Calcdim.csv" by pressing the "<Export data> button.
- Open the "Calcdim.csv" file in EXCEL and convert the column with data from "data to columns", can be found under the "Data" menu item.
- Copy the data for all cells to the Calcdim worksheet in the "FEWS Longitudinal profiles.xls" file.
- Select all data in ODS_View and export the data to a CSV file "Calcdim.csv" by pressing the "<Export data> button.
- Open the "Reachdim.his" file in ODS_View.exe (this is a viewer for HIS files installed on all machines that have SOBEK installed). Make sure the corresponding "Reachdim.hia" file is in the same directory.
- Select all data in ODS_View and export the data to a CSV file "Rechdim.csv" by pressing the "<Export data> button.
- Open the "Rechdim.csv" file in EXCEL and convert the column with data from "data to columns", can be found under the "Data" menu item.
- Copy the data for all cells to the Rechdim worksheet in the "FEWS Longitudinal profiles.xls" file.
- Open the "Visual Basic Editor" in EXCEL by pressing ALT+F11. In the top part of the procedure you need to change the filename of the SOBEK Ids file (i.e. "d:\Test\Hsintien.ids").
- Then press F5 from the Visual Basic Editor. The procedure will now run and fill the Gridpoints and Segments worksheets.
- In XML-Spy you can now create two new branches with ids for the Level and Flow branches; "Hsientien_Level" and "Hsientien_Flow".
- Copy the first 5 columns of the EXCEL sheet Gridpoints to the "Hsientien_Level" pt elements.
- Enter also the startChainage and endChainage values in the corresponding elements.
- Copy the first 2 columns of the EXCEL sheet Segments to the "Hsientien_Flow" pt elements.
- Enter also the startChainage and endChainage values in the corresponding elements.
- Copy the first 5 columns of the EXCEL sheet Gridpoints to the "Hsientien_Level" pt elements.
The Branches file is now complete, you can add additional information for the description elements, left bank elements, etc..
Note: The Flow branch has no z or z_rb levels, these are not useful for flows.
Note: The distance from the start of the branch is different for levels and flows. Because SOBEK-CF uses a staggered grid, the first calculation point where levels are computed starts with 0. The first pt in the chainage for Flows is halfway the first branch.
Importing Longitudinal time series from SOBEK-CF computations
In FEWS the General Adapter is used to run external models. As mentioned before the "SbkBatch.exe" module is used as model adapter for SOBEK-CF and the "PostSobekModelAdapter" is used to import longitudinal time series. An example of a General Adapter configuration that runs the "PostSobekModelAdapter" is shown below.
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="UTF-8"?>
<generalAdapterRun xmlns="http://www.wldelft.nl/fews"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/generalAdapterRun.xsd">
<!-- General information for General Adapter run -->
<general>
<description>SOBEK Model Forecast run for Tanshui with Keelung tunnel</description>
<rootDir>%REGION_HOME%/Modules/TanshuiRRCFKT</rootDir>
<workDir>%ROOT_DIR%</workDir>
<exportDir>%ROOT_DIR%</exportDir>
<exportIdMap>SobekTanshui_RR_CF_Export</exportIdMap>
<importDir>%ROOT_DIR%/Update_output</importDir>
<importIdMap>SobekTanshui_RR_CF_Import</importIdMap>
<dumpFileDir>%REGION_HOME%/DumpFiles</dumpFileDir>
<dumpDir>%ROOT_DIR%</dumpDir>
<diagnosticFile>%ROOT_DIR%/diagnostics/postsobekmodeladapter.xml</diagnosticFile>
<convertDatum>false</convertDatum>
<timeZone>
<timeZoneOffset>+00:00</timeZoneOffset>
</timeZone>
</general>
<activities>
<executeActivities>
<!-- Longitudinal display Level -->
<executeActivity>
<command>
<className>nl.wldelft.fews.adapter.sobek.PostSobekModelAdapter</className>
</command>
<arguments>
<argument>%ROOT_DIR%</argument>
<argument>Config/Level_Profile_Config.xml</argument>
</arguments>
<timeOut>800000</timeOut>
</executeActivity>
<!-- Longitudinal display flow -->
<executeActivity>
<command>
<className>nl.wldelft.fews.adapter.sobek.PostSobekModelAdapter</className>
</command>
<arguments>
<argument>%ROOT_DIR%</argument>
<argument>Config/Flow_Profile_Config.xml</argument>
</arguments>
<timeOut>800000</timeOut>
</executeActivity>
</executeActivities>
<importActivities>
<!-- Import SBK results -->
<importTimeSeriesActivity>
<description>Import XML file</description>
<importFile>Calcpnt.xml</importFile>
<timeSeriesSets>
<timeSeriesSet>
<moduleInstanceId>Tanshui_Sobek_Profile_KeelungTunnel</moduleInstanceId>
<valueType>longitudinalprofile</valueType>
<parameterId>H.simulated</parameterId>
<locationId>Keelung_Level</locationId>
<timeSeriesType>simulated forecasting</timeSeriesType>
<timeStep unit="minute" multiplier="15" />
<readWriteMode>add originals</readWriteMode>
<expiryTime unit="day" multiplier="2" />
</timeSeriesSet>
</timeSeriesSets>
</importTimeSeriesActivity>
<importTimeSeriesActivity>
<description>Import XML file</description>
<importFile>Reachseg.xml</importFile>
<timeSeriesSets>
<timeSeriesSet>
<moduleInstanceId>Tanshui_Sobek_Profile_KeelungTunnel</moduleInstanceId>
<valueType>longitudinalprofile</valueType>
<parameterId>Q.simulated</parameterId>
<locationId>Keelung_Flow</locationId>
<timeSeriesType>simulated forecasting</timeSeriesType>
<timeStep unit="minute" multiplier="15" />
<readWriteMode>add originals</readWriteMode>
<expiryTime unit="day" multiplier="2" />
</timeSeriesSet>
</timeSeriesSets>
</importTimeSeriesActivity>
</importActivities>
</activities>
</generalAdapterRun>
|
This configuration can be executed as a separate Module Instance or included in the Module instance that runs the SOBEK model with the "SbkBatch.exe" module.
Note: Do not forget to add the branch location to the IdMapping configuration.
Configuration of the "PostSobekModelAdapter" is done with a separate configuration file. For importing the Flows as longitudinal time series, the following configuration file can be used.
Note: The hisfile element "Reachseg.his" is added as a dummy, if you do not enter a hisfile element in the adapter configuration, the adapter will read all *.his that are located in the workDir folder and return an error if one of those files is incorrect.
In this example the "PostSobekModelAdapter" will read the mapfile element "Reachseg.his" file from the workDir folder "TANS2004.lit/work". It will try to map all data points from this "Reachseg.his" file with pt locations from the brachFile "Flow_Tanshui_Branch.xml". The result file will be named "Reachseg.xml" and stored in the exportDir "Update_output".
One file that need to be located in the configDir element "Config" is the "Flow_Tanshui_Branch.xml" file. This is partly a copy from the Branches XML file from the FEWS Regionalconfigfiles folder. This file is required by the "PostSobekModelAdapter" and has the following layout.