[netcdfgroup] can't create NETCDF4 files with 4.1.2-beta1


With 4.1.2-beta1 and hdf5 1.8.5 on MacOS 10.5, I can't create netcdf-4 files. The following C program

#include<stdlib.h>
#include<stdio.h>
#include "netcdf.h"
#define ERRCODE 2
#define ERR(e) {printf("Error: %s\n", nc_strerror(e)); exit(ERRCODE);}
int
main()
{
      int ncid, varid, dimid, retval, format;

      if ((retval = nc_set_default_format(NC_FORMAT_NETCDF4,NULL)))  
ERR(retval);
      if ((retval = nc_create("test.nc", NC_CLOBBER,&ncid))) ERR(retval);
      if ((retval = nc_def_dim(ncid, "x", 1,&dimid))) ERR(retval);
      if ((retval = nc_def_var(ncid, "y", NC_FLOAT, 1,&dimid,&varid))) 
ERR(retval);
      nc_close(ncid);
      if ((retval = nc_open("test.nc", NC_NOWRITE,&ncid))) ERR(retval);
      if ((retval = nc_inq_format(ncid,&format))) ERR(retval);
      printf("format %d\n",format);
      nc_close(ncid);
}

produces

format 1

(which is NETCDF3_CLASSIC) when linked with 4.1.2-beta1, but

format 3

(which corresponds to NETCDF4, which is what I asked for with 
nc_set_default_format) when linked with 4.1.1.

I ran 'make check' before installing 4.1.2-beta1, and all tests passed.

-Jeff



--
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
NOAA/OAR/PSD  R/PSD1        Email  : Jeffrey.S.Whitaker@xxxxxxxx
325 Broadway                Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg



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