How to make HDF5 files with Matlab

MOHID Water forum. Questions and discussion around MOHID Water
toderascurobert@yahoo.com
MOHID Beginner
Posts: 5
Joined: Thu Jan 01, 1970 00:00

How to make HDF5 files with Matlab

Postby toderascurobert@yahoo.com » Thu Jun 30, 2011 17:27

Hi Mohid users,

I have made my own script to make HDF5 files for temperature and salinity in Matlab and the resulting file is identical with the example file, but:

1. The simulation does not work giving me this error:

GetHDF5GroupNumberOfItems - ModuleHDF5 - ERR03

2. When I load the file in GIS I can see only the Grid, Results and Time groups but they are empty for GIS.

Probably 1 and 2 are related, but I can't imagine the problem since the files are identical and the example file works for both (1 and 2) and mine doesn't.

There is a special command that has to be included in HDF5 file, or a special field, something like this?

P.S. The simulation works fine if I don't include the water properties and is not the problem with the empty space in folder names, since there is none.

Cheers,

Robert Toderascu.

leonardo-karv@hotmail.com
MOHID Beginner
Posts: 11
Joined: Thu Jan 01, 1970 00:00

Re: How to make HDF5 files with Matlab

Postby leonardo-karv@hotmail.com » Sat Aug 13, 2011 20:35

Hi Robert, this occurs 'cause the hdf5 library version used on your matlab to write the hdf files. The MOHID accept only the version (I'm not sure) 1.6.8 or lower.
The version 1.6.8 is used on matlab 2008 or lower.

Then, the solutions are:
-Run your matlab script in a matlab 2008 or lower, or
-Download the newest hdf5 library version, install it on your computer and compile your MOHID to generate a new executable.

P.S.:You don't need to attach hdf5 attributes to your hierarchies and the names of the hierarchies should be the same as MOHID write.

Best regards,

Leonardo Carvalho

toderascurobert@yahoo.com
MOHID Beginner
Posts: 5
Joined: Thu Jan 01, 1970 00:00

Re: How to make HDF5 files with Matlab

Postby toderascurobert@yahoo.com » Tue Aug 23, 2011 16:09

Thank you, Leonardo.

Actually that happened because I didn't use a GZIP level 6 archiving method. I've downloaded repack.exe (1.6.8 version) from hdf5 utilities and now they load into GIS and all.
Still your intuition could not me more correct since now I am getting the following error:

HDF5-DIAG: Error detected in HDF5 library version: 1.6.4 thread 0. Back trace f
ollows.
#000: \hdf5-product\hdf5-164release\hdf5\src\H5G.c line 297 in H5Gopen(): grou
p not found
major(10): Symbol table layer
minor(48): Object not found

and I suspect is because of the hdf5 libraries. I will try the methods suggested by you and repost about how I fixed it (not sure how to compile it yet, but I will read the mohidwiki instructions).

Best regards,
Robert Toderascu

leonardo-karv@hotmail.com
MOHID Beginner
Posts: 11
Joined: Thu Jan 01, 1970 00:00

Re: How to make HDF5 files with Matlab

Postby leonardo-karv@hotmail.com » Thu Aug 25, 2011 20:40

OK, but I think the best way is to re-run your matlab code in a matlab 2008.

I never tried to install the newest hdf5 library or compile the MOHID to generate a new executable,
but I think it is a quite difficult to do, and you will need the Intel Visual Fortran 2008 to compile the
MOHID.

Best regards,

Leonardo Carvalho

toderascurobert@yahoo.com
MOHID Beginner
Posts: 5
Joined: Thu Jan 01, 1970 00:00

Re: How to make HDF5 files with Matlab

Postby toderascurobert@yahoo.com » Sat May 12, 2012 10:32

I fixed it by recompiling the Mohid executable to accept the new libraries.

erodriguezrubio@yahoo.com.ar
MOHID Beginner
Posts: 5
Joined: Fri Sep 30, 2011 20:59

Re: How to make HDF5 files with Matlab

Postby erodriguezrubio@yahoo.com.ar » Tue May 22, 2012 02:43

HI MOHID users

I would like to know if any body you can give me a copy of matlab code to convert my files (ascii or netcdf) to HDF5 files

Best regards

Efrain


Return to “MOHID Water”

Who is online

Users browsing this forum: No registered users and 2 guests