NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: [netcdfgroup] Accessing a NetCDF and HDF5 file at the same time corrupts the HDF file

  • To: Oliver Lemke <olemke@xxxxxx>
  • Subject: Re: [netcdfgroup] Accessing a NetCDF and HDF5 file at the same time corrupts the HDF file
  • From: Ed Hartnett <ed@xxxxxxxxxxxxxxxx>
  • Date: Fri, 22 Oct 2010 08:40:31 -0600
Oliver Lemke <olemke@xxxxxx> writes:

> Hi,
>
> I'm trying to write to a NetCDF file and an HDF5 file at the same time. When 
> I call nc_close() the HDF5 file identifier gets corrupted:
>
> #include <netcdf.h>
> #include <hdf5.h>
>
> #define H5_FILE "test.h5"
> #define NC_FILE "test.nc"
>
> int main (void)
> {
>   hid_t h5file;
>   int ncid;
>
>   h5file = H5Fcreate(H5_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
>
>   nc_create (NC_FILE, NC_CLOBBER, &ncid);
>   nc_close (ncid);
>
>   /** Code to write data to the HDF5 file removed for simplicity **/
>
>   H5Fclose (h5file);
>   return 0;
> }
>
> Using NetCDF 4.1.1 and HDF5 1.8.5, I get the following error when calling 
> H5Fclose and the resulting HDF file is empty:
>
> HDF5-DIAG: Error detected in HDF5 (1.8.5) thread 0:
>   #000: H5F.c line 1943 in H5Fclose(): invalid file identifier
>     major: Invalid arguments to routine
>     minor: Inappropriate type
>
> Calling H5Fclose() _before_ nc_close() makes the problem go away. The problem 
> also does not occur when linking against NetCDF 3.6.3. Is this possibly a bug 
> in nc_close()?
>
> Any help appreciated.
>
> /oliver
>

Howdy Oliver!

Can you try the latest netCDF snapshot release and tell me if this goes
away?

ftp://ftp.unidata.ucar.edu/pub/netcdf/snapshot/netcdf-4-daily.tar.gz

Thanks,

Ed
-- 
Ed Hartnett  -- ed@xxxxxxxxxxxxxxxx



  • 2010 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: