Versions Compared

Key

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

...

  • 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 model always runs in time zone GMT.
  • This program writes log messages to a log file called dflowfm_pre_adapter_log.txt in the workDir specified in the netcdf run file.

D-Flow FM

...

pre-adapter activities

The pre-adapter uses the information in the specified netcdf run file as input for its actions.

...

In case of a warm state start, there should be exactly one input state file (restart file) for each mdu file. This program only supports a single input state file with file name format

 

 

 

 

In case of domain decomposition there should be one input state file for each partition with file name format  

...

The netcdf file(s) specified in the property "input_grid_files_to_convert" will be converted to files in arcinfo/curvi format. Each netcdf file will be converted to a file with the same path and name as the netcdf file but with a different extension (.amu, .amv or .amp). If the property "input_grid_files_to_convert" is not specified, then this step does nothing.

...

Conversion from variable to file extension

...


Each netcdf file should contain only one variable with grid data. A netcdf file with multiple variables with grid data results in an error. The extension of the created file depends on the name of the variable in the netcdf file. For example the original file input/x_wind.nc is converted to input/x_wind.amu

netcdf variable nameextension
x_wind.amu
y_wind.amv
air_pressure.amp
precipitationnot supported by DFlowFM (for rainfall DFlowFM can use the netcdf file directly)
any other namenot supported by DFlowFM
Auxiliary grid file

...

 

The format (meteo_on_equidistant_grid/meteo_on_curvilinear_grid) of each of the created files depends on whether there is an auxiliary grid file present for that file. To use an auxiliary grid file for a given netcdf file, it must have the same path and name as the netcdf file, but a different extension (.grd). If an auxiliary grid file is present, then the netcdf file will be converted to a curvi file of type meteo_on_curvilinear_grid that refers to the auxiliary grid file. Otherwise it will be converted to an arcinfo file of type meteo_on_equidistant_grid. For rectangular and curvilinear grids there must always be an auxiliary grid file present, otherwise an error is given. For regular grids no auxiliary grid file is needed.

...

The coordinate system for the coordinates in an arcinfo meteo_on_equidistant_grid file created by this adapter depends on the coordinate system used in the netcdf file, which depends in turn on the coordinate system (geodatum) in the corresponding grid definition in Delft-FEWS (if the file was exported from Delft-FEWS). Need to manually make sure that this is the same coordinate system as the coordinate system used by the model.

System requirements

D-Flow FM 3D data: sigma layer vs Z layer

Import of 3D data in generalAdapater

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 3D data

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

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
  • 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

    • 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-Please note that for running DFlow-FM from Delft-FEWS only a pre-adapter is needed (a post-adapter is not needed).

...

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>
		/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

Code Block
titleRegionConfigFiles/Grids.xml
<irregular locationId="sigma">
    <netcdfFile>
        <file>$TEMP_DIR$/nz3d_flowgeom.nc</file>
        <meshTopologyVariableName>mesh2d</meshTopologyVariableName>
        <staggerLocation>face</staggerLocation>
    </netcdfFile>
</irregular>
Code Block
titleRegionConfigFiles/Locations.xml
<location id="sigma">
    <x>0</x>
    <y>0</y>
</location>
Code Block
titleRegionConfigFiles/LocationSets.xml
<locationSet id="sigmaLayers">
    <csvFile>
        <file>sigma_layers.csv</file>
        <id>SigmaLayer_%INDEX%</id>
        <parentLocationId>sigma</parentLocationId>
        <x>0</x>
        <y>0</y>
        <layerSigmaCoordinate>%SIGMA%</layerSigmaCoordinate>
    </csvFile>
</locationSet>
Code Block
titleMapLayerFiles/sigma_layers.csv
INDEX,SIGMA
0,0.025
1,0.075
2,0.125
3,0.175
4,0.225
5,0.275
6,0.325
7,0.375
8,0.425
9,0.475
10,0.525
11,0.575
12,0.625
13,0.675
14,0.725
15,0.775
16,0.825
17,0.875
18,0.925
19,0.975
Code Block
titleSigma layer example config General Adapter import activity
<?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>$TEMP_DIR$</rootDir>
        <workDir>$TEMP_DIR$</workDir>
        <exportDir>$TEMP_DIR$</exportDir>
        <importDir>$TEMP_DIR$</importDir>
        <dumpFileDir>$TEMP_DIR$</dumpFileDir>
        <dumpDir>$TEMP_DIR$</dumpDir>
        <diagnosticFile>$TEMP_DIR$/diagnostic.xml</diagnosticFile>
    </general>
    <activities>
        <importActivities>
            <importNetcdfActivity>
                <importFile>noordzee_3d_map.nc</importFile>
                <timeSeriesSets>
                    <timeSeriesSet>
                        <moduleInstanceId>GeneralAdapterRun</moduleInstanceId>
                        <valueType>grid</valueType>
                        <parameterId>sa1</parameterId>
                        <locationSetId>sigmaLayers</locationSetId>
                        <timeSeriesType>external historical</timeSeriesType>
                        <timeStep unit="nonequidistant"/>
                        <readWriteMode>add originals</readWriteMode>
                    </timeSeriesSet>
                </timeSeriesSets>
                <mapLocationsByLayerSigmaCoordinate>true</mapLocationsByLayerSigmaCoordinate>
            </importNetcdfActivity>
        </importActivities>
    </activities>
</generalAdapterRun>

Sigma layers - display D-Flow FM 3D results in GridDisplay

In addition to the grid, location and locationSet defined in the example above:

Code Block
titleSigma layer example config GridDisplay
<gridDisplay 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/gridDisplay.xsd">
<title>title</title>
<gridPlotGroup id="gridPlotGroupId" name="gridPlotGroupName">
	<gridPlot id="gridPlotId" name="gridPlotName">
		<dataLayer>
			<arrowColor>white</arrowColor>
			<arrowSymbol>flow</arrowSymbol>
			<multipleArrowsPerValue>false</multipleArrowsPerValue>
			<uTimeSeriesSet>
				<moduleInstanceId>DFlowFM_HC</moduleInstanceId>
				<valueType>grid</valueType>
				<parameterId>C.simulated.u</parameterId>
				<locationSetId>DFlowFM_0_####</locationSetId>
				<timeSeriesType>simulated historical</timeSeriesType>
				<timeStep unit="nonequidistant"/>
				<readWriteMode>read complete forecast</readWriteMode>
			</uTimeSeriesSet>
			<vTimeSeriesSet>
				<moduleInstanceId>DFlowFM_HC</moduleInstanceId>
				<valueType>grid</valueType>
				<parameterId>C.simulated.v</parameterId>
				<locationSetId>DFlowFM_0_####</locationSetId>
				<timeSeriesType>simulated historical</timeSeriesType>
				<timeStep unit="nonequidistant"/>
				<readWriteMode>read complete forecast</readWriteMode>
			</vTimeSeriesSet>
			<uvAmplitudeParameterId>C.simulated.speed</uvAmplitudeParameterId>
			<uvDirectionParameterId>C.simulated.dir</uvDirectionParameterId>
			<sigmaScaleReferenceTimeSeriesSet>
				<moduleInstanceId>DFlowFM_HC</moduleInstanceId>
				<valueType>grid</valueType>
				<parameterId>WD.simulated</parameterId>
				<parameterId>H<locationSetId>DFlowFM.sim<merged</parameterId>locationSetId>
				<timeSeriesType>simulated historical</timeSeriesType>
				<locationId>DFlowFM_Curacao</locationId><timeStep unit="nonequidistant"/>
				<readWriteMode>read complete forecast</readWriteMode>
			</sigmaScaleReferenceTimeSeriesSet>
		<timeSeriesType>simulated historical<</timeSeriesType>dataLayer>
		<barLegend>
				<timeStep unit="nonequidistant"/><position>right</position>
			<width>50</width>
			<readWriteMode>add originals<<length>400</readWriteMode>length>
			<labelsInside>true</labelsInside>
		</timeSeriesSet>barLegend>
				</timeSeriesSets><classBreaksId>Class.Currents</classBreaksId>
			</importNetcdfActivity><contourLinesColor>antique white</contourLinesColor>
		</importActivities><verticalSliderRange start="0" end="100"/>
	</activities>gridPlot>
</generalAdapterRun>
gridPlotGroup> 

Multi domain D-Flow FM model

...