...
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. |
---|---|
TStop | End time of the model run, in units of Tunit relative to RefDate. |
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. |
RstInterval | Interval (in seconds) for writing *_rst.nc restart files. 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 name | extension |
---|---|
x_wind | .amu |
y_wind | .amv |
air_pressure | .amp |
precipitation | not supported by DFlowFM (for rainfall DFlowFM can use the netcdf file directly) |
any other name | not 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 type | auxiliary grid (.grd) file needed | type of created file |
---|---|---|
regular | no | arcinfo file of type meteo_on_equidistant_grid |
rectangular | yes | curvi file of type meteo_on_curvilinear_grid |
curvilinear | yes | curvi file of type meteo_on_curvilinear_grid |
Order of grid cells written
...
Code Block | ||
---|---|---|
| ||
<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 | ||
---|---|---|
| ||
<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 | ||
---|---|---|
| ||
<irregular locationId="sigma_0000"> <netcdfFile> <file>$TEMP_DIR$/3d_flowgeom_0000.nc</file> <meshTopologyVariableName>mesh2d</meshTopologyVariableName> <staggerLocation>face</staggerLocation> </netcdfFile> </irregular> |
...
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> <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>%WORK_DIR%/DFM_OUTPUT/model_0000_map.nc</importFile> <timeSeriesSets> <timeSeriesSet> <moduleInstanceId>model_DFlowFM_FC</moduleInstanceId> <valueType>grid</valueType> <parameterId>H.simulated</parameterId> <locationId>sigmaLayers.0000</locationId> <!-- parentLocation for domain 0000 --> <timeSeriesType>simulated forecasting</timeSeriesType> <timeStep unit="nonequidistant"/> <readWriteMode>add originals</readWriteMode> <expiryTime unit="day" multiplier="$EXPIRY_DAYS_SIMULATED_FORECAST_GRID$"/> </timeSeriesSet> <timeSeriesSet> <moduleInstanceId>model_DFlowFM_FC</moduleInstanceId> <valueType>grid</valueType> <parameterId>T.simulated.v</parameterId> <locationSetId>sigmaLayers_0000</locationSetId> <!-- locationSet off all sigmaLayers linked to above used parentLocation --> <timeSeriesType>simulated forecasting</timeSeriesType> <timeStep unit="nonequidistant"/> <readWriteMode>add originals</readWriteMode> <expiryTime unit="day" multiplier="$EXPIRY_DAYS_SIMULATED_FORECAST_GRID$"/> </timeSeriesSet> </timeSeriesSets> <mapLocationsByLayerSigmaCoordinate>true</mapLocationsByLayerSigmaCoordinate> </importNetcdfActivity> <importNetcdfActivity> <!-- repeat for output files of all domains --> <importFile>%WORK_DIR%/DFM_OUTPUT/model_0001_map.nc</importFile> <timeSeriesSets> <timeSeriesSet> <moduleInstanceId>model_DFlowFM_FC</moduleInstanceId> <valueType>grid</valueType> <parameterId>H.simulated</parameterId> <locationId>sigmaLayers.0001</locationId> <timeSeriesType>simulated forecasting</timeSeriesType> <timeStep unit="nonequidistant"/> <readWriteMode>add originals</readWriteMode> <expiryTime unit="day" multiplier="$EXPIRY_DAYS_SIMULATED_FORECAST_GRID$"/> </timeSeriesSet> ... </timeSeriesSets> <mapLocationsByLayerSigmaCoordinate>true</mapLocationsByLayerSigmaCoordinate> </importNetcdfActivity> </importActivities> </activities> </generalAdapterRun> |
Sigma layers - display D-Flow FM 3D results in GridDisplay
...
This example builds on the grid, location and locationSet defined in the example above. It assumes sigma layers for a multi domain model.
Code Block | ||
---|---|---|
| ||
<locationSet id="SigmaLayer_0_####"> <!-- SigmaLayer with index 0 for all domains --> <locationId>SigmaLayer_0_0000</locationId> <locationId>SigmaLayer_0_0001</locationId> <locationId>SigmaLayer_0_0002</locationId> ... </locationSet> <locationSet id="sigma.merged"> <!-- parentLocations for all domains --> <locationId>sigma.0000</locationId> <!-- parentLocationId for domain 0000 --> <locationId>sigma.0001</locationId> <locationId>sigma.0002</locationId> ... </locationSet> |
...
Code Block | ||
---|---|---|
| ||
<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)
...