It turns out that when I converted the code

to keep the NC structure pure and independent
of any file format, I neglected to check with
--enable-hdf4. These changes appear to fix that
problem.
This commit is contained in:
Dennis Heimbigner 2012-12-13 18:22:11 +00:00
parent 068b35cb4d
commit 635a03f2f7
3 changed files with 17 additions and 8 deletions

11
cf
View File

@ -8,7 +8,7 @@ cmds=$@
fi
HDF5=1
DAP=1
#DAP=1
#CDMR=1
#RPC=1
#PGI=1
@ -33,11 +33,12 @@ CC=gcc
fi
# Default cases
stddir="/share/ed/local/${HOST}"
if test "x$STD" != x ; then
stddir="/share/ed/local/${HOST}"
PREFIX="/share/ed/local/${HOST}"
else
PREFIX="/tmp/install/${HOST}"
stddir="/tmp/local/${HOST}"
PREFIX="/tmp/local/${HOST}"
fi
MALLOC_CHECK=""
@ -148,6 +149,10 @@ FLAGS="$FLAGS --enable-logging"
#FLAGS="$FLAGS --with-libcf"
#valgrind => not shared
#FLAGS="$FLAGS --enable-valgrind-tests"
# hdf4 requires adding to paths
#FLAGS="$FLAGS --enable-hdf4 --enable-hdf4-file-tests"
#CPPFLAGS="$CPPFLAGS -I/machine/local/include"
#LDFLAGS="$LDFLAGS -L/machine/local/lib -L/usr/local/lib"
FLAGS="$FLAGS --disable-shared"
#FLAGS="$FLAGS --enable-shared"

View File

@ -2404,6 +2404,7 @@ nc4_open_hdf4_file(const char *path, int mode, NC *nc)
int32 rank;
int v, d, a;
int retval;
NC_HDF5_FILE_INFO_T* nc4_info = NULL;
LOG((3, "nc4_open_hdf4_file: path %s mode %d", path, mode));
assert(path && nc);
@ -2415,6 +2416,7 @@ nc4_open_hdf4_file(const char *path, int mode, NC *nc)
/* Add necessary structs to hold netcdf-4 file data. */
if ((retval = nc4_nc4f_list_add(nc, path, mode)))
return retval;
nc4_info = NC4_DATA(nc);
assert(nc4_info && nc4_info->root_grp);
h5 = nc4_info;
h5->hdf4++;
@ -2604,7 +2606,7 @@ nc4_open_hdf4_file(const char *path, int mode, NC *nc)
#ifdef LOGGING
/* This will print out the names, types, lens, etc of the vars and
atts in the file, if the logging level is 2 or greater. */
log_metadata_nc(h5->root_grp->file);
log_metadata_nc(h5->root_grp->nc4_info->controller);
#endif
return NC_NOERR;
#endif /* USE_HDF4 */

View File

@ -1328,18 +1328,20 @@ nc4_get_hdf4_vara(NC *nc, int ncid, int varid, const size_t *startp,
const size_t *countp, nc_type mem_nc_type, int is_long, void *data)
{
#ifdef USE_HDF4
NC_GRP_INFO_T *grp, *g;
NC_GRP_INFO_T *grp;
NC_HDF5_FILE_INFO_T *h5;
NC_VAR_INFO_T *var;
NC_DIM_INFO_T *dim;
int32 start32[NC_MAX_VAR_DIMS], edge32[NC_MAX_VAR_DIMS];
int retval, d;
#if 0
NC_GRP_INFO_T *g;
NC_DIM_INFO_T *dim;
#endif
/* Find our metadata for this file, group, and var. */
assert(nc);
if ((retval = nc4_find_g_var_nc(nc, ncid, varid, &grp, &var)))
return retval;
h5 = nc->nc4_info;
h5 = NC4_DATA(nc);
assert(grp && h5 && var && var->name);
for (d = 0; d < var->ndims; d++)