null

Message Boards

DELWAQ Conversion NEFIS to NetCDF

SZ
Stephanie Zeunert, modified 4 Years ago.

DELWAQ Conversion NEFIS to NetCDF

Youngling Posts: 14 Join Date: 6/2/14 Recent Posts
Hi everyone,

At the moment I’m trying to convert NEFIS files to NetCDF. For this task I’m using the Matlab script vs_trim2nc.m, which is available in OpenEarthTools. But I think this script is only meant for files created by Delft3D-FLOW. Is there a possibility to convert NEFIS files created by Delft3D-WAQ to NetCDF format?

Thanks for the help
Stephanie
AM
Arjen Markus, modified 4 Years ago.

RE: DELWAQ Conversion NEFIS to NetCDF (Answer)

Jedi Knight Posts: 222 Join Date: 1/26/11 Recent Posts
We are currently working on a standard-conforming facility to produce NetCDF files within Delft3D-WAQ directly. It will be some while before that is available. The standard I am referring to is the UGRID standard - an extension to NetCDF's CF standard.

A short-term solution could be to use a small auxiliary program that converts the (binary) map files to NetCDF-files. The problem, however, is that Delft3D-WAQ has no explicit knowledge of the grid layout, merely of the connectivity between the grid cells. This makes it necessary to provide the grid layout separately, so if you want to use these NetCDF files in a graphical presentation, that may not be enough.

Can you explain what you want to do that requires NetCDF files?
SZ
Stephanie Zeunert, modified 4 Years ago.

RE: DELWAQ Conversion NEFIS to NetCDF

Youngling Posts: 14 Join Date: 6/2/14 Recent Posts
Hi Arjen,

Thanks for your quick reply. I have to convert the NEFIS files into NetCDF format, because one of my project partners needs them for further processing in a GIS.

Regards
Stephanie
AM
Arjen Markus, modified 4 Years ago.

RE: DELWAQ Conversion NEFIS to NetCDF

Jedi Knight Posts: 222 Join Date: 1/26/11 Recent Posts
Well, I just checked the auxiliary program we have. It uses the LGA/CCO files that describe the grid and it writes the information in the map file for a selected substance and a selected layer to a NetCDF file. I can send the program to you, but there is no documentation available beyond the source code.
SZ
Stephanie Zeunert, modified 4 Years ago.

RE: DELWAQ Conversion NEFIS to NetCDF

Youngling Posts: 14 Join Date: 6/2/14 Recent Posts
That would be great.
Thanks a lot for your help!
AM
Arjen Markus, modified 4 Years ago.

RE: DELWAQ Conversion NEFIS to NetCDF

Jedi Knight Posts: 222 Join Date: 1/26/11 Recent Posts
Here is a zip-file with the program and the NetCDF DLL it requires. I have added the source code as a minimal means to document what input file it expects (an INI-file with the right keywords). I could not actually test it, but let me know in case of problems.
SZ
Stephanie Zeunert, modified 4 Years ago.

RE: DELWAQ Conversion NEFIS to NetCDF

Youngling Posts: 14 Join Date: 6/2/14 Recent Posts
Hi Arjen,

thanks a lot for the program, though I wasn't able to run it yet. I wasn't sure about the format of the INI-file. Do you have by any chance an example of the INI-file I could adept?

Regards
Stephanie
AM
Arjen Markus, modified 4 Years ago.

RE: DELWAQ Conversion NEFIS to NetCDF

Jedi Knight Posts: 222 Join Date: 1/26/11 Recent Posts
I do not have an example ready, but I will create one for you.
AM
Arjen Markus, modified 4 Years ago.

RE: DELWAQ Conversion NEFIS to NetCDF

Jedi Knight Posts: 222 Join Date: 1/26/11 Recent Posts
Here is an example of the required ini-file:

[General]
report-file = example.out
map-file = example.map
grid-indices-file = com-xxx.lga
grid-coordinates-file = com-xxx.cco
_FillValue_cco = 999.999
netcdf-file = example.nc
delwaq_layer = 1
delwaq_name = Continuity
standard_name = Continuity
long_name = Continuity as a check of the volume balance
t_unit = seconds since 2014-02-01 00:00:00
unit = g/m3
Conventions = none in particular
title = Just an example
institution = Deltares
source = sample computation
references = none
coordinate_system = xy
_FillValue = -999.0

Several of these lines are not essential to the working of the program, they are mainly there for conforming to the convention.

Regards,

Arjen
SZ
Stephanie Zeunert, modified 4 Years ago.

RE: DELWAQ Conversion NEFIS to NetCDF

Youngling Posts: 14 Join Date: 6/2/14 Recent Posts
Thank you so much for your help. I'm now able to create the NetCDF file.
AA
Amelia Araujo, modified 1 Year ago.

RE: DELWAQ Conversion NEFIS to NetCDF

Youngling Posts: 13 Join Date: 7/7/15 Recent Posts

Hi, I am running my Delwaq simulations in Linux and since my NEFIS file (ada) is too big to bring it into my computer to use quickplot in Windows for the post-processing, I was wondering the possibility in converting those NEFIS files into netcdf files, in Linux. Then I can write python scripts for reading those netcdf files and do all the post-processing in Linux.

Can you please let me know which tools/procedures exist at the moment to convert Delwaq NEFIS files into netcdf files, in Linux?

Thank you.

Amelia

AM
Arjen Markus, modified 1 Year ago.

RE: DELWAQ Conversion NEFIS to NetCDF

Jedi Knight Posts: 222 Join Date: 1/26/11 Recent Posts

As far as I know there are none. Your best option is to Delwaq create NetCDF files directly if you specify the UGRID keyword in the input. The keyword must be followed by the name of the geometry file - produced by recent versions of Delft3D-FLOW, check the file "xxxx_unstructed.hyd" for the name of that NetCDF file. The keyword should be inserted before the number of segments in the input file, like:

 

;###############################################################################
; Third input block
UGRID 'new_waqgeom.nc'

54600 ; number of segments ; From UI: Nr of segments (multiply number-water-quality-segments-per-layer and number-water-quality-layers from HYD)
 2                                                  ; Structure matrix not used

 

The program I sent previously converts the binary map file. When I tried to assemble all the pieces, it turned out to be not quite standard-compliant, so that requires some work to run on Linux. At this moment I do not have the time to do that, I could do it some time next week.

An alternative that I can think of is using a command-line tool we have for examining NEFIS file. It is called "vs" - viewer-selector - but I do not whether it is incorporated in the ordinary distribution.

AA
Amelia Araujo, modified 1 Year ago.

RE: DELWAQ Conversion NEFIS to NetCDF

Youngling Posts: 13 Join Date: 7/7/15 Recent Posts

Hi Arjen, thanks your your quick reply!

Because I have run Delft3d FLOW with 4 processors, I have 4 of those files, one for each processor, e.g. com-Long_run_discharge_60_year2012_adjusted_BC2-001_unstructured.hyd. When I open this file, I can see there the geometry file:  waqgeom-file             'com-Long_run_discharge_60_year2012_adjusted_BC2-001_waqgeom.nc'. Then I have used ddcouple and have obtained 1 .hyd file only: com-Long_run_discharge_60_year2012_adjusted_BC2.hyd. However, this file does not mention the geometry. How can I provide the geometry nc file file in this case?

Many thanks,

Amelia

Michelle Jeuken, modified 1 Year ago.

RE: DELWAQ Conversion NEFIS to NetCDF

Jedi Knight Posts: 156 Join Date: 1/21/13 Recent Posts

Hi Amelia,

 

The easiest way to realise that is to do a short FLOW run on a single domain/processor, which will create a single waqgeom for the full domain. When you have a recent enough ddcouple verison (1.02.00.45383 or higher), the numbering of the segments, and thus the grid definition should be the same.

 

greetings,

Michelle

AA
Amelia Araujo, modified 1 Year ago.

RE: DELWAQ Conversion NEFIS to NetCDF

Youngling Posts: 13 Join Date: 7/7/15 Recent Posts

Hi Michelle,

I have followed your suggestions and have managed to create the nc file for the map.

Thank you very much!!

Regards,

 

Amelia