This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Huaiyu, > BTW, do you have any idea why netCDF 4.1 can generate an invalid HDF 5 > file sometimes? I have encountered this problem in my code, but I > cannot reproduce it using simpler codes. So I didn't formerly report > the bug. (My code checks the return status in every netCDF call, and > there is no complain from netCDF at all.) In the end, I get around the > problem by changing the order of defining variables. The only ways I can think of that an invalid or corrupt HDF5 file could be generated through the netCDF-4 interface are - not calling nc_close() on the file before exiting, which means nc_close() doesn't get a chance to flush HDF5 buffers and properly close the HDF5 file - interrupting the netCDF-4 program before it can call nc_close() or before nc_close() returns successfully - using the parallel interfaces improperly, so that two threads or processes are writing the same HDF5 file at the same time without following the discipline required to make sure the file isn't clobbered. If none of these apply in your case, we would be very interested if you can duplicate the bug consistently, so we could diagnose the cause. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: RUF-772159 Department: Support netCDF Priority: High Status: Closed