Merge branch 'master' into ejh_configure_fix

This commit is contained in:
Ed Hartnett 2017-10-27 05:12:26 -06:00 committed by GitHub
commit d8ffc9e55d
21 changed files with 111 additions and 120 deletions

View File

@ -1176,7 +1176,7 @@ if test "x$enable_pnetcdf" = xyes; then
erange_fill_pnetcdf=no
else
erange_fill_pnetcdf=`echo ${erange_fill_pnetcdf} | cut -d' ' -f3`
if test "x$coord_bound_pnetcdf" = x0; then
if test "x$erange_fill_pnetcdf" = x0; then
enable_erange_fill_pnetcdf=no
else
enable_erange_fill_pnetcdf=yes

View File

@ -1926,8 +1926,12 @@ NC_open(const char *path0, int cmode,
cmode |= NC_64BIT_DATA;
}
if((cmode & NC_MPIIO && cmode & NC_MPIPOSIX))
return NC_EINVAL;
/* Invalid to use both NC_MPIIO and NC_MPIPOSIX. Make up your damn
* mind! */
if((cmode & NC_MPIIO && cmode & NC_MPIPOSIX)) {
nullfree(path);
return NC_EINVAL;
}
/* override any other table choice */
if(dispatcher != NULL) goto havetable;

View File

@ -561,7 +561,9 @@ nc4_put_vara(NC *nc, int ncid, int varid, const size_t *startp,
hsize_t start[NC_MAX_VAR_DIMS], count[NC_MAX_VAR_DIMS];
char *name_to_use;
int need_to_extend = 0;
#ifdef USE_PARALLEL4
int extend_possible = 0;
#endif
int retval = NC_NOERR, range_error = 0, i, d2;
void *bufr = NULL;
#ifndef HDF5_CONVERT
@ -743,7 +745,9 @@ nc4_put_vara(NC *nc, int ncid, int varid, const size_t *startp,
assert(dim && dim->dimid == var->dimids[d2]);
if (dim->unlimited)
{
extend_possible = 1;
#ifdef USE_PARALLEL4
extend_possible = 1;
#endif
if (start[d2] + count[d2] > fdims[d2])
{
xtend_size[d2] = (long long unsigned)(start[d2] + count[d2]);
@ -3984,7 +3988,7 @@ reportobject(int log, hid_t id, unsigned int type)
LOG((0,"Type = %s(%8u) name='%s'",typename,id,name));
#endif
} else {
fprintf(stderr,"Type = %s(%8u) name='%s'",typename,id,name);
fprintf(stderr,"Type = %s(%8u) name='%s'",typename,(unsigned int)id,name);
}
}
@ -4003,7 +4007,7 @@ reportopenobjectsT(int log, hid_t fid, int ntypes, unsigned int* otypes)
LOG((0,"\nReport: open objects on %d\n",fid));
#endif
} else {
fprintf(stdout,"\nReport: open objects on %d\n",fid);
fprintf(stdout,"\nReport: open objects on %d\n",(int)fid);
}
maxobjs = H5Fget_obj_count(fid,H5F_OBJ_ALL);
if(idlist != NULL) free(idlist);

View File

@ -104,7 +104,6 @@ NC4_get_propattr(NC_HDF5_FILE_INFO_T* h5)
hid_t aspace = -1;
hid_t atype = -1;
hid_t ntype = -1;
herr_t herr = 0;
char* text = NULL;
/* Get root group */
@ -112,7 +111,6 @@ NC4_get_propattr(NC_HDF5_FILE_INFO_T* h5)
/* Try to extract the NCPROPS attribute */
if(H5Aexists(grp,NCPROPS) > 0) { /* Does exist */
attid = H5Aopen_name(grp, NCPROPS);
herr = -1;
aspace = H5Aget_space(attid); /* dimensions of attribute data */
atype = H5Aget_type(attid);
/* Verify that atype and size */
@ -129,7 +127,6 @@ NC4_get_propattr(NC_HDF5_FILE_INFO_T* h5)
text[size] = '\0';
/* Try to parse text */
ncstat = NC4_properties_parse(&h5->fileinfo->propattr,text);
herr = 0;
}
done:
if(attid >= 0) HCHECK((H5Aclose(attid)));
@ -148,7 +145,6 @@ NC4_put_propattr(NC_HDF5_FILE_INFO_T* h5)
hid_t attid = -1;
hid_t aspace = -1;
hid_t atype = -1;
herr_t herr = 0;
char* text = NULL;
/* Get root group */
@ -159,7 +155,6 @@ NC4_put_propattr(NC_HDF5_FILE_INFO_T* h5)
if(text == NULL || ncstat != NC_NOERR) {
goto done;
}
herr = -1;
/* Create a datatype to refer to. */
HCHECK((atype = H5Tcopy(H5T_C_S1)));
HCHECK((H5Tset_cset(atype, H5T_CSET_ASCII)));
@ -167,7 +162,6 @@ NC4_put_propattr(NC_HDF5_FILE_INFO_T* h5)
HCHECK((aspace = H5Screate(H5S_SCALAR)));
HCHECK((attid = H5Acreate(grp, NCPROPS, atype, aspace, H5P_DEFAULT)));
HCHECK((H5Awrite(attid, atype, text)));
herr = 0;
}
done:
if(text != NULL) {

View File

@ -1434,17 +1434,3 @@ NC4_get_vara(int ncid, int varid, const size_t *startp,
{
return nc4_get_vara_tc(ncid, varid, memtype, 0, startp, countp, ip);
}
void
nc4verify(int ncid, char* name)
{
NC_GRP_INFO_T *grp;
NC_HDF5_FILE_INFO_T *h5;
int retval;
/* Find info for this file and group, and set pointer to each. */
retval = nc4_find_grp_h5(ncid, &grp, &h5);
assert(grp && h5);
retval = nc4_check_dup_name(grp, name);
return;
}

View File

@ -140,14 +140,6 @@ main(int argc, char **argv)
float float_in[ATT_LEN], float_out[ATT_LEN] = {-0.5, 0.25, 0.125};
double double_in[ATT_LEN], double_out[ATT_LEN] = {-0.25, .5, 0.125};
long long longlong_in[ATT_LEN] = {-1LL, -1LL, -1LL};
#ifdef USE_NETCDF4
long long_in[ATT_LEN];
unsigned short ushort_in[ATT_LEN], ushort_out[ATT_LEN] = {0, 128, NC_MAX_USHORT};
unsigned int uint_in[ATT_LEN], uint_out[ATT_LEN] = {0, 128, NC_MAX_UINT};
long long longlong_out[ATT_LEN] = {-3123456789LL, 128LL, 3123456789LL};
unsigned long long ulonglong_in[ATT_LEN] = {NC_MAX_UINT64, NC_MAX_UINT64, NC_MAX_UINT64};
unsigned long long ulonglong_out[ATT_LEN] = {0LL, 128LL, 3123456789LL};
#endif
#ifdef TEST_PNETCDF
MPI_Init(&argc, &argv);

View File

@ -14,7 +14,6 @@
#include "config.h"
#include <nc_tests.h>
#include "err_macros.h"
#include <stdio.h>
#include <netcdf.h>
@ -26,7 +25,7 @@ int
main(int argc, char **argv)
{
int ncid, dimid, varid, err;
int no_fill, fillv, buf[10];
int fillv;
err = nc_create(FILE_NAME, NC_NETCDF4, &ncid); ERR_CHK;
err = nc_def_dim(ncid, "dim", 10, &dimid); ERR_CHK;

View File

@ -7,7 +7,6 @@
#include <config.h>
#include <stdlib.h>
#include <nc_tests.h>
#include "err_macros.h"
#include <netcdf.h>
#include <string.h>
@ -280,7 +279,7 @@ static int
test(const struct Test* tests, const char* title)
{
int status = NC_NOERR;
int i,failures = 0;
int failures = 0;
const struct Test* p;
fprintf(stderr,"Testing %s...\n",title);
@ -328,9 +327,7 @@ fail:
int
main(int argc, char** argv)
{
int i, status;
int failures = 0;
int tstcnt = 0;
printf("\n Testing UTF-8 sequences.\n");
failures += test(utf8currency,"Currencies");

Binary file not shown.

View File

@ -38,7 +38,7 @@ check(int status)
int
main(int argc, char **argv)
{
int i,stat;
int stat;
int ncid, grpid;
char* filename;
char* oldname;

View File

@ -109,8 +109,8 @@ nc_set_log_level(0);
printf("*** testing defining dimensions and coord variables in different orders in root group...");
{
int ncid, grpid, grp2id;
int time_dimid, lev_dimid, vrt_dimid, g2lev_dimid, g2vrt_dimid;
int time_dimid_in, lev_dimid_in, vrt_dimid_in, g2lev_dimid_in, g2vrt_dimid_in;
int time_dimid, lev_dimid, g2lev_dimid, g2vrt_dimid;
int time_dimid_in, lev_dimid_in, g2lev_dimid_in, g2vrt_dimid_in;
int time_varid, lev_varid, gvar2_varid, g2lev_varid, g2vrt_varid;
int var2_dims[VAR2_RANK];
/* Create test for fix of bug that resulted in two dimensions
@ -156,8 +156,8 @@ nc_set_log_level(0);
printf("*** testing defining dimensions and coord variables in different orders in subgroup...");
{
int ncid, grpid, grp2id;
int time_dimid, lev_dimid, vrt_dimid, g2lev_dimid, g2vrt_dimid;
int time_dimid_in, lev_dimid_in, vrt_dimid_in, g2lev_dimid_in, g2vrt_dimid_in;
int time_dimid, lev_dimid, g2lev_dimid, g2vrt_dimid;
int time_dimid_in, lev_dimid_in, g2lev_dimid_in, g2vrt_dimid_in;
int time_varid, lev_varid, gvar2_varid, g2lev_varid, g2vrt_varid;
int var2_dims[VAR2_RANK];
/* Create test for fix of bug inside a subgroup that results in two dimensions

View File

@ -82,6 +82,7 @@ int main() {
printf("\t* Puting data in secondary variable:\tnc_put_vara().\n");
if (nc_put_vara(ncid,varid2,startp2,countp2,data2)) ERR;
free(data2);
/***********/
/* Actually unnecessary to recreate the issue. */
@ -112,18 +113,17 @@ int main() {
data[2].p = dat2;
data[2].len = VLEN2;
//printf("\t* Puting data in VLEN variable:\tnc_put_vara().\n");
//stat = nc_put_vara(ncid,varid,&startp,&countp,data);
//stat = nc_put_var(ncid,varid,&data);
//if(stat) ERR;
printf("\t* Puting data in VLEN variable:\tnc_put_vara().\n");
stat = nc_put_vara(ncid,varid,startp,countp,data);
if(stat) ERR;
/* Close File. */
printf("\t* Closing file:\tnc_close().\n");
if ((stat = nc_close(ncid))) ERR;
free(dat0);
free(dat1);
free(dat2);
}
printf("Testing access to unset entries in VLEN variable, unlimit dimension\n");
@ -174,6 +174,7 @@ int main() {
printf("\t* Puting data in secondary variable:\tnc_put_vara().\n");
if (nc_put_vara(ncid,varid2,startp2,countp2,data2)) ERR;
free(data2);
/***********/
/* Actually unnecessary to recreate the issue. */
@ -204,21 +205,18 @@ int main() {
data[2].p = dat2;
data[2].len = VLEN2;
//printf("\t* Puting data in VLEN variable:\tnc_put_vara().\n");
//stat = nc_put_vara(ncid,varid,&startp,&countp,data);
//stat = nc_put_var(ncid,varid,&data);
//if(stat) ERR;
printf("\t* Puting data in VLEN variable:\tnc_put_vara().\n");
stat = nc_put_vara(ncid,varid,startp,countp,data);
if(stat) ERR;
/* Close File. */
printf("\t* Closing file:\tnc_close().\n");
if ((stat = nc_close(ncid))) ERR;
free(dat0);
free(dat1);
free(dat2);
}
SUMMARIZE_ERR;
FINAL_RESULTS;

View File

@ -34,20 +34,11 @@
int main()
{
int ncid, dimids[RANK_P], time_id, p_id, test_id, status;
int ndims, dimids_in[RANK_P];
int test_data[1] = {1};
size_t test_start[1] = {0}, test_count[1] = {1};
int test_fill_val[] = {5};
double data[1] = {3.14159};
size_t start[1] = {0}, count[1] = {1};
float ddata[1][4][3];
static float P_data[LEN];
size_t cor[RANK_P] = {0, 1, 0};
size_t edg[RANK_P] = {1, 1, LEN};
float pfills[] = {3};
printf("\n*** Testing for a netCDF-4 fill-value bug.\n");
printf("*** Creating a file with no _FillValue defined. ***\n");

View File

@ -38,7 +38,7 @@ int main() {
int be_dbl_varid;
int ed;
int failures = 0;
int retval = 0;
int retval;
printf("* Checking that endianness is properly read from file.\n");
printf("** Generating test files.\n");
@ -48,36 +48,51 @@ int main() {
{
printf("*** Creating a file via netcdf API: %s.\n",FILE_NAME_NC);
retval = nc_create(FILE_NAME_NC, NC_NETCDF4 | NC_CLOBBER, &ncid);
if ((retval = nc_create(FILE_NAME_NC, NC_NETCDF4 | NC_CLOBBER, &ncid)))
return retval;
retval = nc_def_dim(ncid, DIM_NAME, NDIM, &dimid);
if ((retval = nc_def_dim(ncid, DIM_NAME, NDIM, &dimid)))
return retval;
/* Little-Endian Float */
retval = nc_def_var(ncid, LE_FLOAT_VARNAME, NC_FLOAT, 1, &dimid, &le_float_varid);
retval = nc_def_var_endian(ncid, le_float_varid, NC_ENDIAN_LITTLE);
if ((retval = nc_def_var(ncid, LE_FLOAT_VARNAME, NC_FLOAT, 1, &dimid, &le_float_varid)))
return retval;
if ((retval = nc_def_var_endian(ncid, le_float_varid, NC_ENDIAN_LITTLE)))
return retval;
/* Big-Endian Float */
retval = nc_def_var(ncid, BE_FLOAT_VARNAME, NC_FLOAT, 1, &dimid, &be_float_varid);
retval = nc_def_var_endian(ncid, be_float_varid, NC_ENDIAN_BIG);
if ((retval = nc_def_var(ncid, BE_FLOAT_VARNAME, NC_FLOAT, 1, &dimid, &be_float_varid)))
return retval;
if ((retval = nc_def_var_endian(ncid, be_float_varid, NC_ENDIAN_BIG)))
return retval;
/* Little-Endian Int */
retval = nc_def_var(ncid, LE_INT_VARNAME, NC_INT, 1, &dimid, &le_int_varid);
retval = nc_def_var_endian(ncid, le_int_varid, NC_ENDIAN_LITTLE);
if ((retval = nc_def_var(ncid, LE_INT_VARNAME, NC_INT, 1, &dimid, &le_int_varid)))
return retval;
if ((retval = nc_def_var_endian(ncid, le_int_varid, NC_ENDIAN_LITTLE)))
return retval;
/* Big-Endian Int */
retval = nc_def_var(ncid, BE_INT_VARNAME, NC_INT, 1, &dimid, &be_int_varid);
retval = nc_def_var_endian(ncid, be_int_varid, NC_ENDIAN_BIG);
if ((retval = nc_def_var(ncid, BE_INT_VARNAME, NC_INT, 1, &dimid, &be_int_varid)))
return retval;
if ((retval = nc_def_var_endian(ncid, be_int_varid, NC_ENDIAN_BIG)))
return retval;
/* Little-Endian Double */
retval = nc_def_var(ncid, LE_DBL_VARNAME, NC_DOUBLE, 1, &dimid, &le_dbl_varid);
retval = nc_def_var_endian(ncid, le_dbl_varid, NC_ENDIAN_LITTLE);
if ((retval = nc_def_var(ncid, LE_DBL_VARNAME, NC_DOUBLE, 1, &dimid, &le_dbl_varid)))
return retval;
if ((retval = nc_def_var_endian(ncid, le_dbl_varid, NC_ENDIAN_LITTLE)))
return retval;
/* Big-Endian Double */
retval = nc_def_var(ncid, BE_DBL_VARNAME, NC_DOUBLE, 1, &dimid, &be_dbl_varid);
retval = nc_def_var_endian(ncid, be_dbl_varid, NC_ENDIAN_BIG);
if ((retval = nc_def_var(ncid, BE_DBL_VARNAME, NC_DOUBLE, 1, &dimid, &be_dbl_varid)))
return retval;
if ((retval = nc_def_var_endian(ncid, be_dbl_varid, NC_ENDIAN_BIG)))
return retval;
retval = nc_close(ncid);
if ((retval = nc_close(ncid)))
return retval;
}
/*
@ -95,40 +110,54 @@ int main() {
be_dbl_varid = 0;
printf("*** %s\n",FILE_NAME_NC);
retval = nc_open(FILE_NAME_NC, NC_NETCDF4 | NC_NOWRITE, &ncid);
if ((retval = nc_open(FILE_NAME_NC, NC_NETCDF4 | NC_NOWRITE, &ncid)))
return retval;
retval = nc_inq_varid(ncid,LE_FLOAT_VARNAME,&le_float_varid);
retval = nc_inq_varid(ncid,BE_FLOAT_VARNAME,&be_float_varid);
retval = nc_inq_varid(ncid,LE_INT_VARNAME,&le_int_varid);
retval = nc_inq_varid(ncid,BE_INT_VARNAME,&be_int_varid);
retval = nc_inq_varid(ncid,LE_DBL_VARNAME,&le_dbl_varid);
retval = nc_inq_varid(ncid,BE_DBL_VARNAME,&be_dbl_varid);
if ((retval = nc_inq_varid(ncid,LE_FLOAT_VARNAME,&le_float_varid)))
return retval;
if ((retval = nc_inq_varid(ncid,BE_FLOAT_VARNAME,&be_float_varid)))
return retval;
if ((retval = nc_inq_varid(ncid,LE_INT_VARNAME,&le_int_varid)))
return retval;
if ((retval = nc_inq_varid(ncid,BE_INT_VARNAME,&be_int_varid)))
return retval;
if ((retval = nc_inq_varid(ncid,LE_DBL_VARNAME,&le_dbl_varid)))
return retval;
if ((retval = nc_inq_varid(ncid,BE_DBL_VARNAME,&be_dbl_varid)))
return retval;
printf("\tLittle-Endian Float...\t");
retval = nc_inq_var_endian(ncid,le_float_varid,&ed);
if ((retval = nc_inq_var_endian(ncid,le_float_varid,&ed)))
return retval;
if(ed == NC_ENDIAN_LITTLE) printf("passed\n"); else {printf("failed\n"); failures++;}
printf("\tBig-Endian Float...\t");
retval = nc_inq_var_endian(ncid,be_float_varid,&ed);
if ((retval = nc_inq_var_endian(ncid,be_float_varid,&ed)))
return retval;
if(ed == NC_ENDIAN_BIG) printf("passed\n"); else {printf("failed\n"); failures++;}
printf("\tLittle-Endian Int...\t");
retval = nc_inq_var_endian(ncid,le_int_varid,&ed);
if ((retval = nc_inq_var_endian(ncid,le_int_varid,&ed)))
return retval;
if(ed == NC_ENDIAN_LITTLE) printf("passed\n"); else {printf("failed\n"); failures++;}
printf("\tBig-Endian Int...\t");
retval = nc_inq_var_endian(ncid,be_int_varid,&ed);
if ((retval = nc_inq_var_endian(ncid,be_int_varid,&ed)))
return retval;
if(ed == NC_ENDIAN_BIG) printf("passed\n"); else {printf("failed\n"); failures++;}
printf("\tLittle-Endian Double...\t");
retval = nc_inq_var_endian(ncid,le_dbl_varid,&ed);
if ((retval = nc_inq_var_endian(ncid,le_dbl_varid,&ed)))
return retval;
if(ed == NC_ENDIAN_LITTLE) printf("passed\n"); else {printf("failed\n"); failures++;}
printf("\tBig-Endian Double...\t");
retval = nc_inq_var_endian(ncid,be_dbl_varid,&ed);
if ((retval = nc_inq_var_endian(ncid,be_dbl_varid,&ed)))
return retval;
if(ed == NC_ENDIAN_BIG) printf("passed\n"); else {printf("failed\n"); failures++;}
retval = nc_close(ncid);
if ((retval = nc_close(ncid)))
return retval;
}
printf("** Failures Returned: [%d]\n",failures);

View File

@ -185,7 +185,6 @@ main()
hid_t dcplid;
hid_t scalar_spaceid;
hid_t vlstr_typeid, fixstr_typeid;
hid_t attid;
/* Create scalar dataspace */
if ((scalar_spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
@ -265,7 +264,6 @@ main()
printf("*** Checking accessing file through netCDF-4 API...");
{
int ncid, varid;
size_t len;
nc_type type;
int ndims;
char *vlstr;

View File

@ -32,14 +32,12 @@ main()
char fsdata[] = "fixed-length string";
char *v1ddata[DIM1] = {"strings","of","variable","length"};
int i;
char ch;
printf("\n*** Creating file for checking fix to bugs in accessing strings from HDF5 non-netcdf-4 file.\n");
{
hid_t fileid, scalar_spaceid, vstypeid, fstypeid, vsattid, fsattid, vsdsetid, fsdsetid;
hid_t class;
size_t type_size = FSTR_LEN;
hid_t v1dattid, v1ddsetid;
hid_t v1ddsetid;
hid_t v1dspaceid;
hsize_t dims[1] = {DIM1};
@ -128,7 +126,7 @@ main()
printf("*** Checking reading variable-length HDF5 string att through netCDF-4 API...");
{
int ncid, varid, ndims;
int ncid;
nc_type type;
size_t len;
char *data_in;
@ -145,7 +143,7 @@ main()
printf("*** Checking reading fixed-length HDF5 string att through netCDF-4 API...");
{
int ncid, varid, ndims;
int ncid;
nc_type type;
size_t len;
char *data_in;

View File

@ -33,7 +33,6 @@
int main(int argc, char **argv) {
int res = 0;
int ncid = 0;
printf("\n*** Testing libhdf5 file compatibility (open files generated by hdf5 1.10).\n");

View File

@ -16,16 +16,19 @@ int main()
{
int status;
int id;
int rh_id, varid, v1, v2, v3, v4;
int v1, v2, v3, v4;
int dimids[2];
nc_create(FILENAME, NC_CLOBBER, &id);
nc_redef(id);
status = nc_def_dim(id, "dim1", 10, &dimids[0]);
status = nc_def_var(id, "dim1", NC_FLOAT, 1, dimids, &v1);
status = nc_def_var(id, "var1", NC_FLOAT, 1, dimids, &v2);
if ((status = nc_def_dim(id, "dim1", 10, &dimids[0])))
return status;
if ((status = nc_def_var(id, "dim1", NC_FLOAT, 1, dimids, &v1)))
return status;
if ((status = nc_def_var(id, "var1", NC_FLOAT, 1, dimids, &v2)))
return status;
nc_close(id);
@ -35,7 +38,8 @@ int main()
nc_rename_var(id, v1,"dim_new1");
nc_rename_dim(id, dimids[0], "dim_new1");
status = nc_def_dim(id, "dim2", 20, &dimids[1]);
if ((status = nc_def_dim(id, "dim2", 20, &dimids[1])))
return status;
nc_def_var(id, "dim2", NC_FLOAT, 1, &dimids[1], &v3);
nc_def_var(id, "var2", NC_FLOAT, 2, dimids, &v4);

View File

@ -173,7 +173,7 @@ main(int argc, char **argv)
#define RANK_g1_lon 1
/* IDs of file, groups, dimensions, variables, attributes */
int ncid, g1_grp, lon_dim, lon_var, g1_lon_var, units_att;
int ncid, g1_grp, lon_dim, lon_var, g1_lon_var;
size_t lon_len = 4;
char *data_in;
@ -222,8 +222,6 @@ main(int argc, char **argv)
/* reopen the file again and see if renamed attribute exists and
has expected value */
{
nc_type att_type;
size_t att_len;
if (nc_open(file_names[format], NC_NOWRITE, &ncid)) ERR;
if (nc_inq_grp_ncid(ncid, GRP_NAME, &g1_grp)) ERR;

View File

@ -1124,6 +1124,7 @@ main(int argc, char **argv)
printf("*** testing fill values for 2D unlimited dimension variable...");
{
#define D1_NAME "unlimited"
#define D1_LEN 4
#define D1_TARGET 3
#define D2_NAME "fixed"
#define D2_LEN 3
@ -1136,7 +1137,7 @@ main(int argc, char **argv)
size_t index[ND1];
int varid;
int no_fill;
int data = TARGET_VALUE, data_in[D1_TARGET][D2_LEN], fill_value_in;
int data = TARGET_VALUE, data_in[D1_LEN][D2_LEN], fill_value_in;
int i, j;
/* Create a netcdf-4 file with one dim and 1 NC_USHORT var. */

View File

@ -330,7 +330,7 @@ main(int argc, char **argv)
int dimid[NDIMS_1], var_dimids[VAR_DIMS] = {2, 0, 1};
float fill_value = -9999.0f;
char long_name[] = PRES_MAX_WIND;
int i, attid[NUM_ATTS];
int i;
ncid = nccreate(FILE_NAME, NC_NETCDF4);
@ -364,8 +364,7 @@ main(int argc, char **argv)
/* Now add a fill value. This will acutually cause HDF5 to
* destroy the dataset and recreate it, recreating also the
* three attributes that are attached to it. */
attid[3] = ncattput(ncid, varid, _FillValue, NC_FLOAT,
1, &fill_value);
ncattput(ncid, varid, _FillValue, NC_FLOAT, 1, &fill_value);
/* Check to ensure the atts have their expected attnums. */
if (nc_inq_attid(ncid, 0, LONG_NAME, &attnum_in)) ERR;