General

At this page you can post questions or start discussions on general topics related to Delft3D Flexible Mesh.

Please select a proper category below (if possible), to post your message or reply to an existing post. Please add tags to your posts to simplify searching.

 

** PLEASE TAG YOUR POST! **

 

 

 

 


Average (0Votes)
« Back to 2. OpenEarth tools

RE: OpenEarthTools in Matlab v. 2017

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
OpenEarthTools in Matlab v. 2017
dflowfm open earth tools matlab
Answer (Unmark)
8/9/17 12:05 PM
Hello everyone,

I am trying to use the OpenEarthTools with the newest Matlab version (R2017a). I downloaded the complete set of files in the /trunk/matlab directory from the deltares server. Trying to acces data within Delft FLow FM outputfiles I get confronted with the following issue:

1) launching via the MATLAB command line with oetsettings and trying to import a map.nc file with the command (I followed the procedure of the video https://www.youtube.com/watch?v=i6xiF39xn8M)
ncfile = 'map.nc';
map=dflowfm.readMap(ncfile)
returns the error

Field assignment to a non-structure array object.
Error in dflowfm.readNetOld (line 132)
G.edge.FlowLinkType.flag_values = nc_attget(ncfile, 'FlowLinkType','flag_values');
Error in dflowfm.readNet (line 128)
G = dflowfm.readNetOld(ncfile);
Error in dflowfm.readMap (line 68)
G = dflowfm.readNet(ncfile);

I also tried doing the same as before but with a history-file, which resulted in a different error

Error using netcdflib
The NetCDF library encountered an error during execution of 'inqVarID' function - 'Variable not found (NC_ENOTVAR)'.
Error in netcdf.inqVarID (line 21)
varid = netcdflib('inqVarID', ncid, varname);
Error in nc_varget_tmw>varget (line 62)
varid=netcdf.inqVarID(gid,varname);
Error in nc_varget_tmw>varget_nc (line 24)
[data,info] = varget(ncid,varname,varargin{:});
Error in nc_varget_tmw (line 5)
[data,info] = varget_nc(ncfile,varname,varargin{:});
Error in nc_vargetr (line 38)
[data,info] = nc_varget_tmw(ncfile,varname,varargin{:});
Error in nc_varget (line 35)
[data,info] = nc_vargetr(ncfile,varname,varargin{:});
Error in dflowfm.readHis (line 41)
hisdata.cross_section_discharge_int = nc_varget(filename, 'cross_section_cumulative_discharge');



I tried with several different map-output files from different runs and projects and always get the same error. Is this due to the newer version of Matlab or am i missing something? Those files definitely contain data, as they can be opened using quickplot.

Any help or advice on what to try would be appreciated,

Thank you,
Karoline
RE: OpenEarthTools in Matlab v. 2017
Answer (Unmark)
12/12/17 5:39 PMas a reply to Karoline Wischnewski.
Hello everyone!


I have the some problem. Could anyone help us, please?


Best regards,


Bruno.
RE: OpenEarthTools in Matlab v. 2017
Answer (Unmark)
1/12/18 4:53 PMas a reply to Karoline Wischnewski.
Hi Karoline,

Due to an update in the output format, some of the Matlab scripts for post-processing did not work anymore. I will try to answer both your questions:

1) I just comitted updates of the scripts 'readMap.m'. 'readNet.m', 'plotMap.m' and 'readMap.m' to Open Earth Toolbox for 2D applications. Please try to update your local copy of the repository. If you use SVN Tortoise, this can easily be done by right-clicking the folder you want to update and click 'SVN update'.

2) I did not run into any problems with the script 'readHis.m'. However, the variable names may have changed due to the update in output format. Is the variable you want to open 'cross_section_cumulative_discharge'?
As a sidenote, you can always check filenames using 'nc_dump(filename)'.

Hope this helps. Else, let me know!

Kind regards,
Bob
RE: OpenEarthTools in Matlab v. 2017
Answer (Unmark)
1/18/18 5:37 PMas a reply to Bob Smits.
Hi!


Anyone knows why I am getting this kind of error on my mesh?


Please, Look at the figures.


As you can see, I tried a simple rectangle and the same kind of thing.


Best regards,


Bruno.
Attachment

Attachment

Attachments: figure.png (248.1k), figure2.png (51.2k)