[netcdfgroup] dimension bug


This simple program triggers a problem with the latest netcdf snapshot and hdf5 1.8.5 patch1

#include <stdio.h>
#include <string.h>
#include <netcdf.h>
int
main()
{
   int varid,ncid, x_dimid, y_dimid, retval;
   retval = nc_create("test.nc", NC_NETCDF4 | NC_CLOBBER, &ncid);
   retval = nc_def_dim(ncid, "x", 5, &x_dimid);
   retval = nc_def_dim(ncid, "y", 2, &y_dimid);
   const int dims[2] = {x_dimid, y_dimid};
   retval = nc_def_var(ncid, "y", NC_FLOAT, 2, dims, &varid);
   retval = nc_close(ncid);
   return 0;
}

ncdump'ing the resulting file gives

ncdump test.nc

netcdf test {
dimensions:
        x = 5 ;
        y = 5 ;
variables:
        float y(x, y) ;
data:

 y =
ncdump: NetCDF: Start+count exceeds dimension bound

The program works if the output format is set to NETCDF3.

-Jeff



  • 2010 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: