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.
Doug, > From: Doug Cripe <address@hidden> > Organization: CSU > Keywords: 199508071638.AA16186 netCDF CRAY In the above message you wrote: > I have written a program to read ARM data in NetCDF format, and > when I run it on Shavano, a curious thing happens. Only half of the > double-precision 'time-offset' values in the file are returned > using a call to ncvgt. > > The files have only 1 dimension (time), which is size 24 > (observations taken every half hour, 12 hours per file). I have no > problem with the real (float) defined variables being fully returned > (i.e. all 24 data points) by ncvgt. Moreover, the program runs > fine on our HP work stations. But, with Shavano, the 'time-offset' > values returned correspond to odd-numbered indicies. For example, > using ncdump, the first 6 time-offset values are: > > 1800, 3600, 5400, 7200, 9000, 10800, ... > > What gets returned with ncvgt is 12 (odd-numbered) values: > > 1800, 5400, 9000, ... > > with the remaining 12 values being junk. > > Obviously, Shavano handles double-precision in a way dissimilar to > other computers. What do I do to compensate for this? I think there must be a bug in your program -- possibly in the way you're using the netCDF API. The reason I think this is because I just created a CDL description of a netCDF dataset: 19-shavano% cat a.cdl netcdf a { dimensions: time = 24; variables: double time_off(time); data: time_off = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24; } and used it to create the binary netCDF dataset: 24-shavano% ncgen -b a.cdl As you can see from the following ncdump(1), it worked just fine: 25-shavano% ncdump a.nc netcdf a { dimensions: time = 24 ; variables: double time_off(time) ; data: time_off = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 ; } -------- Steve Emmerson <address@hidden>