[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #OSU-306103]: can't create NETCDF4 files with 4.1.2-beta1



Hi Jeff,

Sorry to have taken so long to respond to your question.  Vacations have left
us very short-handed, and we're not able to keep up with a growing backlog of
support questions, at least temporarily.
> Has anyone had a chance to verify whether this is indeed a valid bug?

Yes, I've just verified it.  Thanks for reporting this.  We also have a fix 
for it in Dennis's latest svn branch, so it will be fixed in 4.1.2-beta2 and 
the subsequent 4.1.2 release.  If you want the fixed version earlier, please
let us know, but in that case you'll have to check it out of our svn tree.

--Russ

> I attached a simple c program in my original email that triggers the
> problem on my system, here it is again:
> 
> 
> 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 <== wrong answer when linked with netcdf-4.1.2-beta1
> 
> and
> 
> format 3 <== correct answer when linked with netcdf-4.1.1
> 
> 
> 
> -Jeff
> 
> --
> Jeffrey S. Whitaker         Phone  : (303)497-6313
> Meteorologist               FAX    : (303)497-6449
> NOAA/OAR/PSD  R/PSD1        Email  : address@hidden
> 325 Broadway                Office : Skaggs Research Cntr 1D-113
> Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg
> 
> 

Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: OSU-306103
Department: Support netCDF
Priority: High
Status: Closed