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.
>To: netCDF support <address@hidden> >From: Roy Britten <address@hidden> >Subject: ncdump issue >Organization: UCAR/Unidata >Keywords: 200201091915.g09JFqN02114 Roy, A fix for the extra quote on char arrays in ncdump output when using the -fc or -ff options is also included in the latest netcdf-3.5.1-beta3 release. Thanks for the bug report. --Russ You wrote: > I have encountered another problem with character array handling while > using the netCDF utilities, this time with ncdump. An extra quote is > appended to character arrays when the -f switch is used. For example, > with the file: > > ---------------------------------------- > netcdf problem { > dimensions: > strlen = 10; > numstrings = 2; > variables: > char strings (numstrings, strlen); > data: > strings = > "foo", > "bar"; > } > ---------------------------------------- > > we execute the following commands: > > $ ncgen -b problem.cdl > $ ncdump -fc problem.nc > > giving the output: > > ---------------------------------------- > netcdf problem { > dimensions: > strlen = 10 ; > numstrings = 2 ; > variables: > char strings(numstrings, strlen) ; > data: > > strings = > "foo"", // strings(0,0) > "bar""; // strings(1,0) > } > ---------------------------------------- > > In addition to the extra " mark in the data lines, there is a (less > significant) alignment problem in the data section. A similarly > incorrect output is generated if the -ff option is used instead of -fc. > > Version and platform information is: > > ncgen: > ncgen: -: netcdf library version 3.4 of Oct 28 1999 20:27:24 $ > ncdump: > netcdf library version 3.4 of Oct 28 1999 20:27:24 $ > platform: > IRIX64 6.5 > > > This issue does not affect us at all; I just thought you might like to > be made aware of it (if you aren't already).