Versions Compared

Key

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

...

Directory/file

Purpose

input

Contains all the files with timeseries and map stacks exported by Delft-FEWS

input/timeseries.xml

XML-file with (scalar) timeseries

input/map_<param>.xml

XML-file describing the map stacks with parameter "param" (see the documentation of the keywords)

stateInput

Contains all the files with the initial conditions and other static information that together constitute the "state" from which the computation must start

stateInput/export_states.xml

The XML-file describing the time of the state files.
(Export from the point of view of Delft-FEWS)

output/timeseries_<runId>.xml

XML-file with the resulting (scalar) timeseries, to be imported by Delft-FEWS

output/fewsParameter>.xml

XML-file describing the resulting map stacks with FEWS parameter "FEWS-param" (see the documentation of the keywords)

stateOutput

Contains all the files with the final results, useful as initial conditions.

stateOutput/import_states.xml

The XML-file describing the time of the final state files.
(Import from the point of view of Delft-FEWS)

2. Configuration file

The Delft3D adapter uses a fixed set of directories and files to do most of its work. Some items do have to be specified in a separate configuration file (to be placed in the root of the <rootDir>), as these may vary from application to application. This section describes the structure of the configuration file.

The configuration file consists of three sections, general, pre-adapter and post-adapter. For example:

Code Block
xml
xml

 <delft3dModel 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/delft3dModel.xsd">
 <description>DCSMV5 FLOW</description>
 <general>
    <module>FLOW</module>
    <runId>dcsm98</runId>
    <workDir>workDir</workDir>
    <modelDir>Repo_dcsmv5</modelDir>
    <auxiliaryGridFile>1953.grd</auxiliaryGridFile>
    <fieldFileFormat>new</fieldFileFormat>
    <outputTimeSeriesInOneFile>true</outputTimeSeriesInOneFile>
 </general>
 <preAdapter>
    <steeringTimeSeriesName>H.profile/dcsmv5</steeringTimeSeriesName>
 </preAdapter>
 <postAdapter>
    <timeSeriesOutput>
       <timeSeries parameter="water level" location="ABDN" layer="1" fewsParameter="H.simulated" fewsLocation="aberdeen"/>
       <timeSeries parameter="water level" location="AUKFPFM" layer="1" fewsParameter="H.simulated" fewsLocation="aukfield_platform"/>
       <timeSeries parameter="water level" location="DELFZL" layer="1" fewsParameter="H.simulated" fewsLocation="delfzijl"/>
       <timeSeries parameter="water level" location="DENHDR" layer="1" fewsParameter="H.simulated" fewsLocation="den_helder"/>
    </timeSeriesOutput>
    <mapOutput>
       <map parameter="water level" layer="1" fewsParameter="H.simulated" fewsLocation="dcsmv5"/>
    </mapOutput>
 </postAdapter>
</delft3dModel>

...

  • <general>: General information that should always be present.
  • <preAdapter>: Information for the preadapter step (in which the input files are prepared). This section is optional – for instance, if the preparation is done in another step.
  • <postAdapter>: Information for the step after the actual computation where the results are exported to Delft-FEWS. This section is also optional.

Each section will now be described in more detail.

...

Module

Template files

Purpose

FLOW

<runid>.mdf
<runid>.bcc, .bct, .dis, ...

Master definition file
Various attribute files

WAQ, ECO

<runid>.inp

couplnef.inp

Main input file, the only file that is supposed to contain keywords for this module.
Input file for the coupling program.

PART

<runid>.inp

Like WAQ

WAVE

<runid>.mdw

 

FLOW_FM

<runid>.mdu

see http://publicwiki.deltares.nl/display/MD/D-Flow+FM+model+adapter

...

  • Delft3D-FLOW requires the name of the file (*.grd) that defines the grid for the meteorological data. It is written in the header of the file with air pressure and so on.
  • Delft3D-WAQ requires the name of the LGRID and CCO files, so that the segment function files can be written properly. This information is needed by the postadapter as well, in order to export the results on a grid. To avoid duplication, the information is given in the general section.

2.2 Section: <preAdapter>

The <preAdapter> section contains one keyword only, the name of the timeseries (found in the timeseries XML file exported by Delft-FEWS) that is to be used as to determine the time frame of the simulation.

The reason for this keyword is that Delft-FEWS leaves it to the computational programs to determine what the actual period is that should be simulated. As in Delft3D the timeseries can usually span any period and the start and stop times of the computations are given independently of any timeseries, there needs to be a mechanism to connect the two philosophies.

The name of the timeseries is to be formed in this way: "external name of the parameter/external name of the location". For instance: if the external parameter name is "H" and the location is "Southern boundary", then the name for that time series is: "H/Southern boundary".

2.3 Section: <postAdapter>

The section <postAdapter> describes the actions to be taken after completion of the model run. Rather than blindly export all the results from the model run to Delft-FEWS and let it pick up the timeseries and map stacks of interest, the adapter exports only those timeseries and map stacks described in this section.

It also translates the names used by Delft3D into names known by Delft-FEWS. The names as used by Delft3D are similar to the names used in Delft3D-GPP (since the same ods.dll library is used to parse the data). See the below examples for reference. If names are not included in this overview, they can be obtained in the following way: 1) Start Delft3D-GPP, 2) Load the Delft3D data into GPP for the relevant parameter, 3) save the GPP case file, 4) open the GPP case file and use the parameter name as specified.

...

Since 2013.02 there is an option to swap north and south in the Delft3DPostAdapter for regular grids.

Code Block
xml
xml

			<executeActivity>
				<description>Delft3D Adapter</description>
				<command>
					<className>nl.wldelft.fews.adapter.delft3d.Delft3DPostAdapter</className>
				</command>
				<arguments>
					<argument>%ROOT_DIR%</argument>
					<argument>AGM.Flow.HC.xml</argument>
					<argument>-swapNorthSouth</argument>
				</arguments>
				<timeOut>10800000</timeOut>
				<overrulingDiagnosticFile>%ROOT_DIR%/diagnostics/delft3dpostadapter.xml</overrulingDiagnosticFile>
			</executeActivity>

...

Delft3D-FLOW (example):

Code Block
xml
xml

<timeSeries parameter="water level" location="ABDN" layer="1" fewsParameter="H.simulated" fewsLocation="aberdeen"/>
<timeSeries parameter="dpt. aver. cur. mag" location="STN.1" layer="1" fewsParameter="C.speed.simulated" fewsLocation="UP.STN.1"/>
<timeSeries parameter="Temperature" location="STN.1" layer="19" fewsParameter="T.simulated" fewsLocation="UP.STN.1.L19"/>
<map parameter="dpt. aver. cur. v" layer="1" fewsParameter="V.simulated.u" fewsLocation="Delft3DFLOW_UP"/>
<map parameter="dpt. aver. cur. u" layer="1" fewsParameter="V.simulated.v" fewsLocation="Delft3DFLOW_UP"/>
<map parameter="Temperature" layer="19" fewsParameter="T.simulated.L19" fewsLocation="Delft3DFLOW_UP.L19"/>
<map parameter="Temperature" layer="18" fewsParameter="T.simulated.L18" fewsLocation="Delft3DFLOW_UP.L18"/>

Delft3D-WAQ (example):

Code Block
xml
xml

<timeSeries parameter="APHANIZO" location="Stn_1 (1)" layer="1" fewsParameter="APHANIZO.simulated" fewsLocation="UP.STN.1.L1.WQ"/>
<timeSeries parameter="Chlfa" location="Stn_1 (1)" layer="1" fewsParameter="Chlorophyll.simulated" fewsLocation="UP.STN.1.L1.WQ"/>
<timeSeries parameter="EColi" location="Stn_1 (1)" layer="1" fewsParameter="E Coli.simulated" fewsLocation="UP.STN.1.L1.WQ"/>
<timeSeries parameter="EnCoc" location="Stn_5 (1)" layer="1" fewsParameter="Entero.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="FColi" location="Stn_5 (1)" layer="1" fewsParameter="F Coli.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="FDIATOMS" location="Stn_5 (1)" layer="1" fewsParameter="FDIATOMS.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="GREENS" location="Stn_5 (1)" layer="1" fewsParameter="Greens.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="IM1" location="Stn_5 (1)" layer="1" fewsParameter="IM1.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="IM2" location="Stn_5 (1)" layer="1" fewsParameter="IM2.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="MICROCYS" location="Stn_5 (1)" layer="1" fewsParameter="MICROCYS.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="NH3" location="Stn_5 (1)" layer="1" fewsParameter="NH3.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="NH4" location="Stn_5 (1)" layer="1" fewsParameter="NH4.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="NO3" location="Stn_5 (1)" layer="1" fewsParameter="NO3.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="OSCILAT" location="Stn_5 (1)" layer="1" fewsParameter="OSCILAT.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="OXY" location="Stn_5 (1)" layer="1" fewsParameter="OXY.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="PO4" location="Stn_5 (1)" layer="1" fewsParameter="PO4.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="POC" location="Stn_5 (1)" layer="1" fewsParameter="POC.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="Phyt" location="Stn_5 (1)" layer="1" fewsParameter="Phyt.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="SO4" location="Stn_5 (1)" layer="1" fewsParameter="SO4.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="SS" location="Stn_5 (1)" layer="1" fewsParameter="SS.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="SUD" location="Stn_5 (1)" layer="1" fewsParameter="SUD.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="Salinity" location="Stn_5 (1)" layer="1" fewsParameter="Salinity.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="SecchiDept" location="Stn_5 (1)" layer="1" fewsParameter="SecchiDept.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="Si" location="Stn_5 (1)" layer="1" fewsParameter="Si.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="TOC" location="Stn_5 (1)" layer="1" fewsParameter="TOC.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="Temp" location="Stn_5 (1)" layer="1" fewsParameter="T.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="TotN" location="Stn_5 (1)" layer="1" fewsParameter="TNitrogen.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="TotP" location="Stn_5 (1)" layer="1" fewsParameter="TPhosphate.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="TotalDepth" location="Stn_5 (1)" layer="1" fewsParameter="TotalDepth.simulated" fewsLocation="UP.STN.5.L1.WQ"/>
<timeSeries parameter="pH" location="Stn_5 (1)" layer="1" fewsParameter="PH.simulated" fewsLocation="UP.STN.5.L1.WQ"/>

Delft3D-WAVE (example):

Code Block
xml
xml

<map parameter="Mean wave direction" layer="1" fewsParameter="Wave.direction.mean.ext" fewsLocation="Guanabara.wave.ext"/>
<map parameter="Mean wave period" layer="1" fewsParameter="Wave.period.mean.ext" fewsLocation="Guanabara.wave.ext"/>
<map parameter="Peak wave direction" layer="1" fewsParameter="Wave.direction.peak.ext" fewsLocation="Guanabara.wave.ext"/>
<map parameter="Peak wave period" layer="1" fewsParameter="Wave.period.peak.ext" fewsLocation="Guanabara.wave.ext"/>
<map parameter="Sign.wave height" layer="1" fewsParameter="Wave.sign.height.ext" fewsLocation="Guanabara.wave.ext"/>

...

$(keyword: argument1, argument2, ...)

or, if there are no arguments:

$(keyword)

(Technical note: the entire text from the opening "$(" to the trailing ")" is replaced, without a trailing new line, by whatever the contents should be. The arguments should not contain commas parenthesis and there should be at least one space after the comma. This syntax makes it easy to implement the template mechanism.)

Keyword

Description

FLOW_TIME_START

Start of the simulation (format in accordance with Delft3D-FLOW).
(This is actually the time in minutes since the reference time, found in the mdf-file)

FLOW_TIME_STOP

Stop of the simulation (format in accordance with Delft3D-FLOW)
(Ditto as the start time)

FLOW_TIME_RST

Duration of the simulation – useful for setting the time interval of writing the restart files so that only one restart file is written at the end of the simulation.

FLOW_TIMESERIES

Placeholder to fill in the timeseries in the so-called tim format (only the time and data, not the header).
The keyword should be followed by the names of all timeseries that should be filled in there, separated by a comma and one or more spaces:

$(FLOW_TIMESERIES: h/bound-1 salinity/bound-1, temperature/bound-1)

(Despite the fact that the "tim" format is used more widely than just FLOW, there are some specifics involved.)

FLOW_MAPSTACK

Placeholder for the name of the file that will hold the scalar field data (as found in the map stack files). It should be followed by the name of the parameter:

$(FLOW_MAPSTACK: pressure)

Then:

  • The string "FLOW_MAPSTACK pressure" is replaced by "pressure.dat"
  • The file "pressure.dat" contains the map stacks in the format proper to Delft3D-FLOW
  • The XML-file "map_pressure.xml" in the input directory contains the details: which ASCII files and so on.
WAVE_TIMEFRAME

  Placeholder to fill values for TimePoint from start time to end time with specified increment.  Example:

$(WAVE_TIMEFRAME: 60, USE_WATERLEVEL_FLOW, USE_CURRENTS_FLOW)

  • TimeStep in this case is 60
  • (optional):  USE_WATERLEVEL_FLOW: use water levels from (offline) FLOW simulation
  • (optional):  USE_CURRENTS_FLOW:  use current information from (offline) FLOW simulation

WAQ_TIME_START

Start of the simulation (format in accordance with Delft3D-WAQ/ECO: yyyy/mm/dd-hh:mm:ss)

WAQ_TIME_STOP

Stop of the simulation (format in accordance with Delft3D-WAQ/ECO: yyyy/mm/dd-hh:mm:ss)

WAQ_TIMESERIES

Placeholder to fill in the timeseries in the WAQ /ECO format (only the time and data, not the header).
The keyword should be followed by the names of all timeseries that should be filled in there, separated by spaces:

$(WAQ_TIMESERIES: salinity/bound-1, temperature/bound-1)

WAQ_MAPSTACK

Placeholder for the name of the file that will hold the scalar field data (as found in the map stack files). It should be followed by the name of the parameter:

$(WAQ_MAPSTACK: windvel)

Then:

  • The string "WAQ_MAPSTACK windvel" is replaced by "windvel.dat"
  • The file "windvel.dat" contains the map stacks in the format proper to Delft3D-WAQ/ECO
  • The XML-file "map_windvel.xml" in the input directory contains the details: which ASCII files and so on.

PART_RUNID

The run ID for the Delft3D-PART computation (used in the filename.dat file)

PART_TIMESERIES

Placeholder to fill in the timeseries in the PART format, similar to the WAQ and FLOW timeseries keywords.

COUP_TIME_START

Start time of coupling (in seconds; time frame is that of Delft3D-FLOW)

COUP_TIME_STOP

Stop time of coupling (in seconds; ditto)

P.M.

Keywords specific to Delft3D-WAVE

...

The Delft3D model adapter and executable can be executed from FEWS in the following way:

Code Block
xml
xml

 <executeActivities>
    <executeActivity>
       <description>Delft3D Adapter</description>
       <command>
          <className>nl.wldelft.fews.adapter.delft3d.Delft3DPreAdapter</className>
       </command>
       <arguments>
          <argument>%ROOT_DIR%</argument>
          <argument><adapter configuration file></argument>
       </arguments>
       <timeOut>10800000</timeOut>
       <overrulingDiagnosticFile>%ROOT_DIR%\diagnostics\delft3dpreadapter.xml</overrulingDiagnosticFile>
    </executeActivity>
    <executeActivity>
       <description>Run delftflow</description>
       <command>
          <executable>bin/deltares_hydro.exe</executable>
       </command>
       <arguments>
          <argument>config-flow2d3d.ini</argument>
       </arguments>
       <timeOut>90000000</timeOut>
       <overrulingDiagnosticFile>%ROOT_DIR%/dcsmv5_Diagnostic_Placeholder.xml</overrulingDiagnosticFile>
    </executeActivity>
    <executeActivity>
       <description>Delft3D Adapter</description>
       <command>
          <className>nl.wldelft.fews.adapter.delft3d.Delft3DPostAdapter</className>
       </command>
       <arguments>
          <argument>%ROOT_DIR%</argument>
          <argument><adapter configuration file></argument>
       </arguments>
       <timeOut>10800000</timeOut>
       <overrulingDiagnosticFile>%ROOT_DIR%\diagnostics\delft3dpostadapter.xml</overrulingDiagnosticFile>
    </executeActivity>
</executeActivities>

...

The below configuration shows an example of the exportStateActivity to export a Delft3D model state from the FEWS generalAdapter.

Code Block
xml
xml

<exportStateActivity>
   <moduleInstanceId>DCSM_Historical</moduleInstanceId>
   <stateExportDir>%ROOT_DIR%/stateInput</stateExportDir>
   <stateConfigFile>%ROOT_DIR%/stateInput/export_states.xml</stateConfigFile>
   <stateLocations type="file">
      <stateLocation>
         <readLocation>dcsm98.res</readLocation>
         <writeLocation>dcsm98.res</writeLocation>
      </stateLocation>
   </stateLocations>
   <stateSelection>
      <warmState>
         <stateSearchPeriod unit="hour" start="-48" end="-1"/>
      </warmState>
   </stateSelection>
</exportStateActivity>

From the Delft3D-FLOW file this initial state file is subsequently called in the following way:

Code Block

Commnt=
Restid= #dcsm98.rst#
Commnt=

The warmState search period should be sufficiently long to spin-up the model in case of a cold start.

Attachments