Coast / Estuary

Coastal systems are among the most dynamic physical systems on earth and are subject to a large variety of forces. The morphodynamic changes occurring to coastlines worldwide are of great interest and importance. These changes occur as a result of the erosion of sediments, its subsequent transport as bed load or suspended load, and eventual deposition. 
Estuaries are partly enclosed water bodies that have an open connection to the coast. Estuaries generally have one or more branching channels, intertidal mudflats and/or salt marshes. Intertidal areas are of high ecological importance and trap sediments (sands, silts, clays and organic matter).
Within the Delft3D modelling package a large variation of coastal and estuarine physical and chemical processes can be simulated. These include waves, tidal propagation, wind- or wave-induced water level setup, flow induced by salinity or temperature gradients, sand and mud transport, water quality and changing bathymetry (morphology). Delft3D can also be used operationally e.g. storm, surge and algal bloom forecasting. 
On this discussion page you can post questions, research discussions or just share your experience about modelling coastal and/or estuarine systems with Delft3D FM. 




Sub groups
D-Flow Flexible Mesh
Cohesive sediments & muddy systems


« Back to General

RE: Delft 2 NetCDF

Combination View Flat View Tree View
Threads [ Previous | Next ]
Delft 2 NetCDF
Answer (Unmark)
4/6/11 1:13 PM

Some of you have a code to convert the outputs of Delft in NetCDF ?

Thanks in advanced,

RE: Delft 2 NetCDF
netcdf nefis snctools
Answer (Unmark)
4/13/11 7:41 AMas a reply to Hemerson Tonin.
There are 2 options. Note: the netcdf files from both methods differ, although both are CF compliant.

1) OpenEarthTools has two matlab functions that can do the job: vs_trim2nc() for the map results and vs_trih2nc() for the history file. Please request a password at to access these open source functions (or click OET logo at

FYI: the netcdf history file generated by vs_trih2nc is identical to the one written by the computational core of delft3d-fm (flexible mesh) that is currently in development ( The OpenEarthTool delft3dfm.analyseHis is available for this netCDF format file for automatic validation against waterlevels on an OPeNDAP timeseries database (e.g.

The two functions vs_trim2nc and vs_trih2nc are wrappers for lower level functions from:
(i) the NEFIS delft3d output format library (vs_*). These are shipped with delft3d:
>> addpath('C:\Delft3D\w32\matlab\')
(ii) the open source netcdf library snctools ( that is shipped as part of OpenearthTools distribution. snctools works for all matlab releases since R14, even through Matlab did not introduce native netcdf support until R2008b.

2) you can also request a windows exectuble (written c/fortran) from delft3d support that can rewrite a delft3d nefis file as a netcdf file.
RE: Delft 2 NetCDF
Answer (Unmark)
7/11/12 4:05 PMas a reply to Gerben de Boer.
vs_trim2nc has been updated to generate a CF compliant netCDF version of the trim file:

The resulting netcdf file is de facto identical to the one generated with the fortran exectuble that is provided at request from delft3d support.

vs_trim2nc is part of OpenEarthTools. The most-op-to-date vs_* matlab libraries required for trim2nc are now linked into OpenEarthTools.
This means that all required libraries are available when making an svn checkout of the OpenEarthTools Matlab root:

An unit test cq. example is availble in the test folder of OpenEarth:
RE: Delft 2 NetCDF
Answer (Unmark)
7/31/12 1:33 PMas a reply to Gerben de Boer.
Please note, the Matlab tool vs_trim2nc.m does not yet work for bed sediments and sediment transports.
It does work for both sigma-layers and z-layers.
RE: Delft 2 NetCDF
Answer (Unmark)
10/22/12 10:20 PMas a reply to Gerben de Boer.
the vs_trim2nc script is working for both vertical coordinate system (sigma and Z) as well as for both spatial horizontal coordinate system (UTM and geographical).
RE: Delft 2 NetCDF
Answer (Unmark)
7/22/13 11:07 AMas a reply to Hemerson Tonin.
vs_trih2nc for the NEFIS history file has been updated last week, and delivers now fully QuickPlot compliant netCDF-CF files, incl. now drop-down menu for the observation points (*.obs) or cross sections (*.crs) .
RE: Delft 2 NetCDF
netcdf delft 3d flow visualisation
Answer (Unmark)
11/14/17 5:40 AMas a reply to Gerben de Boer.
I have tried the vs_trim2nc() script with a simple and straightforward conversion from a trim*.dat file to a NetCDF file (i.e. without giving any other argument), but it fails.
Below is exact command message and error as displayed.

1>> vs_trim2nc('E:\Hohai\Delft3DWD\delft3d-course\introduction_hydrodynamics\exercises\05_curvedbend\practice1\trim-cb2a.dat')
2Undefined function or variable 'filenameext'.
4Error in vs_trim2nc (line 121)
5   OPT.title          = ['NetCDF created from NEFIS-file ',filenameext(vsfile)];

Furthermore, I get the same error when I try to get a trih to NetCDF conversion using vs_trih2nc().
Please note that below is my system properties (if that matters)
  1. Windows 10 (64bit)
  2. Matlab 2015b
  3. Delft3D 4.01.01.rc.03

I greatly appreciate any help or suggestion regarding this or any other workaround to get a NetCDF file to be visualized in Para View or VisIt.

Thank you in advance.
Attachments: vs_trih2nc.m (84.0k), vs_trim2nc.m (127.0k)