Versions Compared

Key

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

...

At the moment there is no example yet of a z layer D-Flow FM model connected to Delft-FEWS. All documentation and examples below are related to sigma layer models. Z layers are supported by the model adapter though. An example of import and display of z layers in a Delft-3D model can be found at Delft3D adapter - 4.3 Import and display 3D data (z layers)

...

Export of 3D data in

...

generalAdapter (

...

z layers)

...

- NETCDF-CF_ZLAYERS

Scalar time series at the same geo point Z but with different X,Y are considered to be a Z-layer. All available Z’s are used to create a Z-axis (layer axis) in the NetCdf file, and the time series values are written to the associated Z element. To export scalar time series as Z_layers in GA with NETCDF-CF_ZLAYERS, use option <exportZLayers>true</exportZLayers> in the exportNetcdfActivity (see config example below).

An example for float salinity(time=5, node=26, z=40);

Values of Z-axis are stored in meters. Per parameter only one Z-axis is allowed. Different parameters may have different Z-axis. Z-axis values are sorted in ascending order. The number of stations in the nc file equals to the number of unique X,Y that are available in the scalar time series. The location id’s/names associated with the first (lowest) Z are written to the nc file as station id’s/names. If there are parentLocations configured, then the IdMap can be used to write the parentLocations id’s to the nc file. By default the long_name attribute of the parameters is equal to the parameter id. This default behavior is overwritten with the configuration of a parameter description in Parameters.xml, which will be used as long_name in the nc file instead. In GA the default missing value for time series is -999. You can overwrite it in GA using <missVal>, for example <missVal>NaN</missVal>

Import of 3D data in generalAdapater (sigma layers)

In case of sigma layer data, you need to configure a locationSet linking the sigma layers (% of depth) to a layer index, see config example below. In a way, this makes the handling of sigma and z layers in Delft-FEWS similar, since both can be referred to through a layer index.

Display of 2D data for overlapping domains

A common model set-up in D-Flow FM will make use of several models for an project area. For example, you could have a large scale coarse regional model, with 1 (or more) finer model(s) zooming in on the area of interest which is (are) located within the regional model area, i.e. the model areas overlap. When you display all models in 1 gridPlot, you don't want to see the coarse grid peaking out from underneath the finer local model(s). The example in the figure has 3 different model areas, going from coarse (blue grid), through intermediate (red grid) to a fine resolution (green grid). 

Image AddedImage Added

In order to hide the coarser grids where a finer grid is available, you'll need to define a shapefile which masks the area of each model domain that you would like visualised in the gridDisplay. These shapefiles should (barely) overlap, see example in the figure on the right. All data is still available in the gridPlot, but only the data within the shapefile contour is displayed in the gridDisplay. When the user double-clicks in the gridDisplay, a timeSeriesDisplay with scalar data for all models with data for that location (in this example up to 3) is displayed, even though the data might be masked in the gridDisplay. Config example below.

Display of 3D data (sigma layers)

In GridDisplay.xml you need to configure an additional sigmaScaleReferenceTimeSeriesSet for sigma layers (see config example below). A on the fly transformation allows the user to dynamically interpolate between sigma layers in the grid display. For more information on the GridDisplay visit 01 Grid Display - sigmaScaleReferenceTimeSeriesSet

System requirements

  • This program needs Java version 8 or higher.
  • This program needs the following Java libraries:
    • commons-httpclient-3.0.1.jar
    • Delft_Util.jar (revision 60330)
    • grib-8.0.jar
    • log4j-1.2.14.jar
    • netcdf-4.2.jar
    • slf4j-api-1.5.6.jar
    • slf4j-log4j12-1.5.6.jar
    • TimeSeriesImport.jar (revision 60330)

Configuration example

Please note that for running DFlow-FM from Delft-FEWS only a pre-adapter is needed (a post-adapter is not needed).

D-Flow FM model configuration example (single domain, 2D data import)

Example of a FEWS general adapter configuration that uses the DFlow-FM adapter.

Code Block
titleSingle domain example config General Adapter
<?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>
		<rootDir>$REGION_HOME$\Modules\dflowfm</rootDir>
		<workDir>%ROOT_DIR%</workDir>
		<exportDir>%ROOT_DIR%\dflowfm_curacao\input</exportDir>
		<exportDataSetDir>$REGION_HOME$\Modules</exportDataSetDir>
		<exportIdMap>IdExport_DFlowFM</exportIdMap>
		<importDir>%ROOT_DIR%\dflowfm_curacao\output</importDir>
		<importIdMap>IdImport_DFlowFM</importIdMap>
		<dumpFileDir>$GA_DUMPFILEDIR$</dumpFileDir>
		<dumpDir>%ROOT_DIR%\dflowfm_curacao\dump</dumpDir>
		<diagnosticFile>%ROOT_DIR%\dummy.xml</diagnosticFile>
		<missVal>-999.</missVal>
		<!-- Take care this should be the timezone the computer is running in -->
		<timeZone>
			<timeZoneOffset>-04:00</timeZoneOffset>
		</timeZone>
		<endDateTimeFormat>yyyyMMdd_HHmmss</endDateTimeFormat>
	</general>
	<activities>
		<startUpActivities>
			<purgeActivity>
				<filter>%ROOT_DIR%\dflowfm_curacao\output\*.*</filter>
			</purgeActivity>
			<purgeActivity>
				<filter>%ROOT_DIR%\dflowfm_curacao\input\*.*</filter>
			</purgeActivity>
		</startUpActivities>
		<exportActivities>
			<exportStateActivity>
				<moduleInstanceId>DFlowFM_curacao_Historical</moduleInstanceId>
				<stateExportDir>%ROOT_DIR%\dflowfm_curacao\instate</stateExportDir>
				<stateSelection>
					<warmState>
						<stateSearchPeriod unit="hour" start="-23" end="-2"/>
					</warmState>
				</stateSelection>
			</exportStateActivity>
			<exportNetcdfActivity>
				<exportFile>air_pressure.nc</exportFile>
				<timeSeriesSets>
					<timeSeriesSet>
						<moduleInstanceId>WFLOW_curacao_GA_Historical</moduleInstanceId>
						<valueType>grid</valueType>
						<parameterId>P.specific</parameterId>
						<locationId>wflow_curacao</locationId>
						<timeSeriesType>simulated historical</timeSeriesType>
						<timeStep unit="hour" multiplier="1"/>
						<relativeViewPeriod unit="hour" end="0"/>
						<readWriteMode>add originals</readWriteMode>
					</timeSeriesSet>
				</timeSeriesSets>
			</exportNetcdfActivity>
			<exportNetcdfRunFileActivity>
				<description>This run file is passed as argument to DFLOWFM pre adapter</description>
				<exportFile>%WORK_DIR%\run_info.nc</exportFile>
				<properties>
					<string key="model_id" value="dflowfm_curacao\curacao"/>
					<string key="input_grid_files_to_convert" value="%ROOT_DIR%\dflowfm_curacao\input\x_wind.nc;%ROOT_DIR%\dflowfm_curacao\input\air_pressure.nc"/>
				</properties>
			</exportNetcdfRunFileActivity>
		</exportActivities>
		<executeActivities>
			<executeActivity>
				<description>DFlowFM pre adapter</description>
				<command>
					<className>nl.deltares.dflowfm.DFlowFMPreAdapter</className>
					<binDir>adapter</binDir>
				</command>
				<arguments>
					<argument>%WORK_DIR%\run_info.nc</argument>
				</arguments>
				<logFile>
					<file>%WORK_DIR%\dflowfm_pre_adapter_log.txt</file>
					<errorLinePattern>*ERROR*</errorLinePattern>
					<warningLinePattern>*WARN*</warningLinePattern>
					<infoLinePattern>*INFO*</infoLinePattern>
					<debugLinePattern>*DEBUG*</debugLinePattern>
				</logFile>
				<timeOut>99999999</timeOut>
				<ignoreDiagnostics>true</ignoreDiagnostics>
			</executeActivity>
			<executeActivity>
				<description>Run DFLOWFM</description>
				<command>
					<executable>bin\unstruc.exe</executable>
				</command>
				<arguments>
					<argument>--autostartstop</argument>
					<argument>dflowfm_curacao\curacao.mdu</argument>
				</arguments>
				<logFile>
					<file>%WORK_DIR%\dflowfm_curacao\curacao.dia</file>
					<errorLinePattern>*ERROR*</errorLinePattern>
					<warningLinePattern>*WARNING*</warningLinePattern>
					<debugLinePattern>*INFO*</debugLinePattern>
					<debugLinePattern>*DEBUG*</debugLinePattern>
				</logFile>
				<timeOut>44200000</timeOut>
				<ignoreDiagnostics>true</ignoreDiagnostics>
			</executeActivity>
		</executeActivities>
		<importActivities>
			<importStateActivity>
				<stateFile>
					<importFile>%WORK_DIR%\dflowfm_curacao\output\curacao_%END_DATE_TIME%_rst.nc</importFile>
					<relativeExportFile>curacao_%END_DATE_TIME%_rst.nc</relativeExportFile>
				</stateFile>
			</importStateActivity>
			<importNetcdfActivity>
				<importFile>%WORK_DIR%\dflowfm_curacao\output\curacao_map.nc</importFile>
				<timeSeriesSets>
					<timeSeriesSet>
						<moduleInstanceId>DFlowFM_curacao_Historical</moduleInstanceId>
						<valueType>grid</valueType>
						<parameterId>H.sim</parameterId>
						<locationId>DFlowFM_Curacao</locationId>
						<timeSeriesType>simulated historical</timeSeriesType>
						<timeStep unit="nonequidistant"/>
						<readWriteMode>add originals</readWriteMode>
					</timeSeriesSet>
				</timeSeriesSets>
			</importNetcdfActivity>
		</importActivities>
	</activities>
</generalAdapterRun>

Z layers - export D-Flow FM 3D results (NETCDF-CF_ZLAYERS)

Code Block
titleSigma layer example config General Adapter import activity
    <activities>
        <exportActivities>
            <exportNetcdfActivity>
                <exportFile>hycom_boundary.nc</exportFile>
                <exportZLayers>true</exportZLayers>
                <timeSeriesSets>
                    <timeSeriesSet>
                        <moduleInstanceId>Interpolate_Boundaries_HYCOM_forecast</moduleInstanceId>
                        <valueType>scalar</valueType>
                        <parameterId>S.simulated</parameterId>
                        <locationSetId>HYCOM.Boundaries_AllLayers</locationSetId>
                        <timeSeriesType>simulated forecasting</timeSeriesType>
                        <timeStep unit="hour" multiplier="3"/>
                        <relativeViewPeriod unit="day" start="0" end="1" endOverrulable="true"/>
                        <readWriteMode>read only</readWriteMode>
                    </timeSeriesSet>
                </timeSeriesSets>
                <timeSeriesSets>
                    <timeSeriesSet>
                        <moduleInstanceId>Interpolate_Boundaries_HYCOM_forecast</moduleInstanceId>
                        <valueType>scalar</valueType>
                        <parameterId>T.simulated</parameterId>
                        <locationSetId>HYCOM.Boundaries_AllLayers</locationSetId>
                        <timeSeriesType>simulated forecasting</timeSeriesType>
                        <timeStep unit="hour" multiplier="3"/>
                        <relativeViewPeriod unit="day" start="0" end="1" endOverrulable="true"/>
                        <readWriteMode>read only</readWriteMode>
                    </timeSeriesSet>
                </timeSeriesSets>
            </exportNetcdfActivity>
        </exportActivities>
	</activities>

In case of sigma layer data, you need to configure a locationSet linking the sigma layers (% of depth) to a layer index, see config example below. In a way, this makes the handling of sigma and z layers in Delft-FEWS similar, since both can be referred to through a layer index.

Display of 2D data for overlapping domains

A common model set-up in D-Flow FM will make use of several models for an project area. For example, you could have a large scale coarse regional model, with 1 (or more) finer model(s) zooming in on the area of interest which is (are) located within the regional model area, i.e. the model areas overlap. When you display all models in 1 gridPlot, you don't want to see the coarse grid peaking out from underneath the finer local model(s). The example in the figure has 3 different model areas, going from coarse (blue grid), through intermediate (red grid) to a fine resolution (green grid). 

Image RemovedImage Removed

In order to hide the coarser grids where a finer grid is available, you'll need to define a shapefile which masks the area of each model domain that you would like visualised in the gridDisplay. These shapefiles should (barely) overlap, see example in the figure on the right. All data is still available in the gridPlot, but only the data within the shapefile contour is displayed in the gridDisplay. When the user double-clicks in the gridDisplay, a timeSeriesDisplay with scalar data for all models with data for that location (in this example up to 3) is displayed, even though the data might be masked in the gridDisplay. Config example below.

Display of 3D data (sigma layers)

In GridDisplay.xml you need to configure an additional sigmaScaleReferenceTimeSeriesSet for sigma layers (see config example below). A on the fly transformation allows the user to dynamically interpolate between sigma layers in the grid display. For more information on the GridDisplay visit 01 Grid Display - sigmaScaleReferenceTimeSeriesSet

System requirements

  • This program needs Java version 8 or higher.
  • This program needs the following Java libraries:
    • commons-httpclient-3.0.1.jar
    • Delft_Util.jar (revision 60330)
    • grib-8.0.jar
    • log4j-1.2.14.jar
    • netcdf-4.2.jar
    • slf4j-api-1.5.6.jar
    • slf4j-log4j12-1.5.6.jar
    • TimeSeriesImport.jar (revision 60330)

Configuration example

Please note that for running DFlow-FM from Delft-FEWS only a pre-adapter is needed (a post-adapter is not needed).

D-Flow FM model configuration example (single domain, 2D data import)

Example of a FEWS general adapter configuration that uses the DFlow-FM adapter.

Code Block
titleSingle domain example config General Adapter
<?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>
		<rootDir>$REGION_HOME$\Modules\dflowfm</rootDir>
		<workDir>%ROOT_DIR%</workDir>
		<exportDir>%ROOT_DIR%\dflowfm_curacao\input</exportDir>
		<exportDataSetDir>$REGION_HOME$\Modules</exportDataSetDir>
		<exportIdMap>IdExport_DFlowFM</exportIdMap>
		<importDir>%ROOT_DIR%\dflowfm_curacao\output</importDir>
		<importIdMap>IdImport_DFlowFM</importIdMap>
		<dumpFileDir>$GA_DUMPFILEDIR$</dumpFileDir>
		<dumpDir>%ROOT_DIR%\dflowfm_curacao\dump</dumpDir>
		<diagnosticFile>%ROOT_DIR%\dummy.xml</diagnosticFile>
		<missVal>-999.</missVal>
		<!-- Take care this should be the timezone the computer is running in -->
		<timeZone>
			<timeZoneOffset>-04:00</timeZoneOffset>
		</timeZone>
		<endDateTimeFormat>yyyyMMdd_HHmmss</endDateTimeFormat>
	</general>
	<activities>
		<startUpActivities>
			<purgeActivity>
				<filter>%ROOT_DIR%\dflowfm_curacao\output\*.*</filter>
			</purgeActivity>
			<purgeActivity>
				<filter>%ROOT_DIR%\dflowfm_curacao\input\*.*</filter>
			</purgeActivity>
		</startUpActivities>
		<exportActivities>
			<exportStateActivity>
				<moduleInstanceId>DFlowFM_curacao_Historical</moduleInstanceId>
				<stateExportDir>%ROOT_DIR%\dflowfm_curacao\instate</stateExportDir>
				<stateSelection>
					<warmState>
						<stateSearchPeriod unit="hour" start="-23" end="-2"/>
					</warmState>
				</stateSelection>
			</exportStateActivity>
			<exportNetcdfActivity>
				<exportFile>air_pressure.nc</exportFile>
				<timeSeriesSets>
					<timeSeriesSet>
						<moduleInstanceId>WFLOW_curacao_GA_Historical</moduleInstanceId>
						<valueType>grid</valueType>
						<parameterId>P.specific</parameterId>
						<locationId>wflow_curacao</locationId>
						<timeSeriesType>simulated historical</timeSeriesType>
						<timeStep unit="hour" multiplier="1"/>
						<relativeViewPeriod unit="hour" end="0"/>
						<readWriteMode>add originals</readWriteMode>
					</timeSeriesSet>
				</timeSeriesSets>
			</exportNetcdfActivity>
			<exportNetcdfRunFileActivity>
				<description>This run file is passed as argument to DFLOWFM pre adapter</description>
				<exportFile>%WORK_DIR%\run_info.nc</exportFile>
				<properties>
					<string key="model_id" value="dflowfm_curacao\curacao"/>
					<string key="input_grid_files_to_convert" value="%ROOT_DIR%\dflowfm_curacao\input\x_wind.nc;%ROOT_DIR%\dflowfm_curacao\input\air_pressure.nc"/>
				</properties>
			</exportNetcdfRunFileActivity>
		</exportActivities>
		<executeActivities>
			<executeActivity>
				<description>DFlowFM pre adapter</description>
				<command>
					<className>nl.deltares.dflowfm.DFlowFMPreAdapter</className>
					<binDir>adapter</binDir>
				</command>
				<arguments>
					<argument>%WORK_DIR%\run_info.nc</argument>
				</arguments>
				<logFile>
					<file>%WORK_DIR%\dflowfm_pre_adapter_log.txt</file>
					<errorLinePattern>*ERROR*</errorLinePattern>
					<warningLinePattern>*WARN*</warningLinePattern>
					<infoLinePattern>*INFO*</infoLinePattern>
					<debugLinePattern>*DEBUG*</debugLinePattern>
				</logFile>
				<timeOut>99999999</timeOut>
				<ignoreDiagnostics>true</ignoreDiagnostics>
			</executeActivity>
			<executeActivity>
				<description>Run DFLOWFM</description>
				<command>
					<executable>bin\unstruc.exe</executable>
				</command>
				<arguments>
					<argument>--autostartstop</argument>
					<argument>dflowfm_curacao\curacao.mdu</argument>
				</arguments>
				<logFile>
					<file>%WORK_DIR%\dflowfm_curacao\curacao.dia</file>
					<errorLinePattern>*ERROR*</errorLinePattern>
					<warningLinePattern>*WARNING*</warningLinePattern>
					<debugLinePattern>*INFO*</debugLinePattern>
					<debugLinePattern>*DEBUG*</debugLinePattern>
				</logFile>
				<timeOut>44200000</timeOut>
				<ignoreDiagnostics>true</ignoreDiagnostics>
			</executeActivity>
		</executeActivities>
		<importActivities>
			<importStateActivity>
				<stateFile>
					<importFile>%WORK_DIR%\dflowfm_curacao\output\curacao_%END_DATE_TIME%_rst.nc</importFile>
					<relativeExportFile>curacao_%END_DATE_TIME%_rst.nc</relativeExportFile>
				</stateFile>
			</importStateActivity>
			<importNetcdfActivity>
				<importFile>%WORK_DIR%\dflowfm_curacao\output\curacao_map.nc</importFile>
				<timeSeriesSets>
					<timeSeriesSet>
						<moduleInstanceId>DFlowFM_curacao_Historical</moduleInstanceId>
						<valueType>grid</valueType>
						<parameterId>H.sim</parameterId>
						<locationId>DFlowFM_Curacao</locationId>
						<timeSeriesType>simulated historical</timeSeriesType>
						<timeStep unit="nonequidistant"/>
						<readWriteMode>add originals</readWriteMode>
					</timeSeriesSet>
				</timeSeriesSets>
			</importNetcdfActivity>
		</importActivities>
	</activities>
</generalAdapterRun>

Sigma layers - import D-Flow FM 3D results (multi domain model)

...