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.
Hi Kent, Thanks for reporting this bug! I can reproduce it with the file you referenced. I've also created a Jira ticket you can subscribe to, if you want to follow progress on the fix: https://bugtracking.unidata.ucar.edu/browse/NCF-305 --Russ > I happen to use ncdump to check an HDF5 file that follows the netcdf4 > extended model. > The file includes a variable with a user-defined datatype(HDF5 compound > datatype). The base datatype is HDF5 string. > Ncdump -h can dump the header but just maps the string to char. However, when > I try to dump the data of the user-defined datatype, only the first character > appears. > > The compound data type displayed by h5dump is something like: > > DATATYPE "CERES_metadata_t" H5T_COMPOUND { > H5T_STRING { > STRSIZE 32; > STRPAD H5T_STR_SPACEPAD; > CSET H5T_CSET_ASCII; > CTYPE H5T_C_S1; > } "SHORTNAME"; > H5T_STRING { > STRSIZE 32; > STRPAD H5T_STR_SPACEPAD; > CSET H5T_CSET_ASCII; > CTYPE H5T_C_S1; > } "RANGEBEGINNINGDATE"; > ....... > } > And the data is: > DATASET "/CERES_metadata" { > DATATYPE "/CERES_metadata_t" > DATASPACE SIMPLE { ( 1 ) / ( H5S_UNLIMITED ) } > DATA { > (0): { > "CMSFC_AB ", > "2004-07-01 ", > "00:00:00.000000 ", > "2004-07-31 ", > "00:59:59.999999 ", > "Passed ", > "QA flag explanation > > > ", > "unknown ", > "unknown ", > "CER_SSF1deg-Hour_Terra-MODIS_TestSuite_000000.200407D01 > ", > "Clib-20140204 TK5.2.18 HDF-4.2r6 HDFEOS- 2.18v SW\000\000\000 > ANC\000\000\000 ", > "2014-05-28T13:21:07 ", > 64800, > "NASA Langley Research Center, HOST - bf107.cluster.net OS - Linux > > > " > } > } > > In ncdump, it becomes: > > compound CERES_metadata_t { > char SHORTNAME ; > char RANGEBEGINNINGDATE ; > char RANGEBEGINNINGTIME ; > char RANGEENDINGDATE ; > char RANGEENDINGTIME ; > char AUTOMATICQUALITYFLAG ; > char AUTOMATICQUALITYFLAGEXPLANATION ; > char ASSOCIATEDPLATFORMSHORTNAME ; > char ASSOCIATEDINSTRUMENTSHORTNAME ; > char LOCALGRANULEID ; > char LOCALVERSIONID ; > char CERPRODUCTIONDATETIME ; > int NUMBEROFRECORDS ; > char PRODUCTGENERATIONLOC ; > }; // CERES_metadata_t > > And the data is: > CERES_metadata = > {"C", "2", "0", "2", "0", "P", "Q", "u", "u", "C", "C", "2", 64800, "N"} ; > The file can be found under > ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/ymuqun/ceres-converted/edition_4/CER_SSF1deg-Hour_Terra-MODIS_TestSuite_000000.200407D01-v1.h5 > > Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: JFK-776789 Department: Support netCDF Priority: Normal Status: Closed