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 Srikalyan, It sounds like you are using the version 2 C interface ncvarget(). Are you trying to read all the values in one call, or one record at a time? It would help to see the output of "ncdump -h" or at least the part that has the declarations of dimensions and variables for your XYZ.nc files. It would also help to see the declarations in your C program for the start and count vectors, what you set these to, and the actual ncvarget() call. Example programs that use the corresponding version 3 API, nc_get_var_TYPE(), and start and count vectors to write and read record data is here: http://www.unidata.ucar.edu/software/netcdf/examples/programs/pres_temp_4D_wr.c http://www.unidata.ucar.edu/software/netcdf/examples/programs/pres_temp_4D_rd.c but the differences between your version 2 interface ncvarget() an the version 3 interface nc_get_vara() are minor, and you should be able to follow this example with the appropriate name changes. If you send in the requested intformation, we'll try to see if we can figure out the problem. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: ZKM-468316 Department: Support netCDF Priority: Normal Status: Closed