Versions Compared

Key

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

...

Class name: nl.deltares.dflowfm.DFlowFMPreAdapter

Properties

model_id(required)

Identifier of the model. This should be the first part of the .mdu file name. This is used to find the relevant .mdu file(s) and restart .nc file(s), as described below.

mdu_file

Deprecated. Do not use.

Pathname of the mdu file to update. This should be either an absolute path or a path relative to the workDir specified in the netcdf run file.

input_grid_files_to_convert(optional) Deprecated. The latest version of D-Flow FM can directly read grid NetCDF files that are exported from Delft-FEWS. This works for the parameters wind, pressure, rainfall, radiation, temperature and humidity. Therefore converting grid files is not needed anymore.

One or more pathnames of netcdf files with input grid data that should be converted. The pathnames should be separated by semi-colons (;). Each pathname should be either an absolute path or a path relative to the workDir specified in the netcdf run file.

Notes for users

  • 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.
  • The pre-adapter uses the information in the specified netcdf run file as input for its activities (see below).

...

In the found mdu file(s) the following entries will be updated automatically (no tags needed):

 


TStart

Start time of the model run, in units of Tunit relative to RefDate.
Uses the Tunit and RefDate that are specified in the mdu file.

TStop

End time of the model run, in units of Tunit relative to RefDate.
Uses the Tunit and RefDate that are specified in the mdu file.

RestartFile

Either

* pathname of the input state file relative to the MDU file if the input state file is not empty (warm state start) or

* empty string if the input state file is an empty dummy file of 0 bytes length (cold state start) or

* empty string if there is no input state file at all (cold state start).

RestartDateTime

The restart time, this is set equal to the start time of the model run.
Note: It seems that in D-Flow FM this RestartDateTime is overruled by the timestamp in the filename of the restart file. If this causes problems, then make sure that the filename of the restart file does not contain a timestamp.

RstInterval

Interval (in seconds) for writing *_rst.nc restart files.
RstInterval is set equal to the model run duration, so that only one output restart file is written, exactly at the end of the model run.

RstInterval can be overwritten by a property in the run info file called "restartIntervalForFm"

MDU file name format

The mdu file(s) to update should be in the workDir specified in the netcdf run file. This program only supports:

...

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.

grid typeauxiliary grid (.grd) file neededtype of created file
regularnoarcinfo file of type meteo_on_equidistant_grid
rectangularyescurvi file of type meteo_on_curvilinear_grid
curvilinearyescurvi file of type meteo_on_curvilinear_grid
Order of grid cells written

...

Code Block
titleRegionConfigFiles/Grids.xml
<exportTimeSeriesActivity>
    <exportFile>timeseries.xml</exportFile>
    <timeSeriesSets>
        <timeSeriesSet>
            <moduleInstanceSetId>URBS_Forecast</moduleInstanceSetId>
            <valueType>scalar</valueType>
            <parameterId>Q.sim.fcst</parameterId>
            <locationSetId>DFLOWFM_river.$CATCHMENT$_$SUBCATCHMENT$</locationSetId>
            <timeSeriesType>simulated forecasting</timeSeriesType>
            <timeStep unit="minute" multiplier="15"/>
            <relativeViewPeriod unit="day" start="0" end="3"/>
            <readWriteMode>read only</readWriteMode>
        </timeSeriesSet>
        <timeSeriesSet>
            <moduleInstanceId>ImportROMS</moduleInstanceId>
            <valueType>scalar</valueType>
            <parameterId>H.tidal.fcst</parameterId>
            <locationSetId>DFLOWFM_coastal.$CATCHMENT$_$SUBCATCHMENT$</locationSetId>
            <timeSeriesType>external forecasting</timeSeriesType>
            <timeStep unit="minute" multiplier="30"/>
            <readWriteMode>read complete forecast</readWriteMode>
        </timeSeriesSet>
    </timeSeriesSets>
</exportTimeSeriesActivity>

...


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

...

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>

Sigma layers - import D-Flow FM 3D results

...

Example of changes to the config when dealing with a D-Flow FM model with multiple domains, using sigma layers.

Code Block
titleRegionConfigFiles/Grids.xml
<irregular locationId="sigma_0000">
    <netcdfFile>
        <file>$TEMP_DIR$/3d_flowgeom_0000.nc</file>
        <meshTopologyVariableName>mesh2d</meshTopologyVariableName>
        <staggerLocation>face</staggerLocation>
    </netcdfFile>
</irregular>

...

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>
			<uTimeSeriesSet>
				<moduleInstanceId>DFlowFM_HC</moduleInstanceId>
				<valueType>grid</valueType>
				<parameterId>parameter</parameterId>
				<locationSetId>SigmaLayer_0_####</locationSetId>		<!-- Configure only the top layer (index = 0). The sibling locations (i.e. other sigma layers) are resolved through the parent of the top layer. -->
				<timeSeriesType>simulated historical</timeSeriesType>
				<timeStep unit="nonequidistant"/>
				<readWriteMode>read complete forecast</readWriteMode>
			</uTimeSeriesSet>
			<vTimeSeriesSet>
				<moduleInstanceId>DFlowFM_HC</moduleInstanceId>
				<valueType>grid</valueType>
				<parameterId>parameter</parameterId>
				<locationSetId>SigmaLayer_0_####</locationSetId>		<!-- Configure only the top layer (index = 0). The sibling locations (i.e. other sigma layers) are resolved through the parent of the top layer. -->
				<timeSeriesType>simulated historical</timeSeriesType>
				<timeStep unit="nonequidistant"/>
				<readWriteMode>read complete forecast</readWriteMode>
			</vTimeSeriesSet>
			<sigmaScaleReferenceTimeSeriesSet>							<!-- when this is configured, a vertical slider becomes automatically visible in GridDisplay to slide through the water column -->
				<moduleInstanceId>DFlowFM_HC</moduleInstanceId>
				<valueType>grid</valueType>
				<parameterId>parameter</parameterId>
				<locationSetId>sigma.merged</locationSetId> 			<!-- parentLocations for all domains, linking to all sigma layers -->
				<timeSeriesType>simulated historical</timeSeriesType>
				<timeStep unit="nonequidistant"/>
				<readWriteMode>read complete forecast</readWriteMode>
			</sigmaScaleReferenceTimeSeriesSet>
		</dataLayer>
		<verticalSliderRange start="0" end="100"/>						<!-- limit the min and max water depth used in the vertical slider in the GridDisplay -->
																			<!-- if not configured the range of slider is automatically set to cover all available water depths in the grid for the entire period displayed -->
  </gridPlot>
</gridPlotGroup> 

...


Masking  - display D-Flow FM 3D results in GridDisplay (multiple overlapping models)

...