Merge branch 'master' into var_par_access

This commit is contained in:
Ward Fisher 2018-07-31 11:30:43 -06:00 committed by GitHub
commit 3b10efa26f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 2563 additions and 2521 deletions

View File

@ -71,6 +71,7 @@ may occur.
#define NC_ENOTFOUND (-90) // No such file
#define NC_ECANTREMOVE (-91) // Cannot remove file
#define NC_EINTERNAL (-92) // NetCDF Library Internal Error
#define NC_EPNETCDF (-93) // Error at PnetCDF layer
~~~~
# NetCDF-4 Error Codes {#nc4-error-codes}

View File

@ -406,6 +406,9 @@ int nc4_check_name(const char *name, char *norm_name);
int nc4_normalize_name(const char *name, char *norm_name);
int nc4_check_dup_name(NC_GRP_INFO_T *grp, char *norm_name);
/* Close the file. */
int nc4_close_netcdf4_file(NC_FILE_INFO_T *h5, int abort, int extractmem);
/* HDF5 initialization */
extern int nc4_hdf5_initialized;
extern void nc4_hdf5_initialize(void);

View File

@ -426,6 +426,7 @@ by the desired type. */
#define NC_ENOTFOUND (-90) /**< No such file */
#define NC_ECANTREMOVE (-91) /**< Can't remove file */
#define NC_EINTERNAL (-92) /**< NetCDF Library Internal Error */
#define NC_EPNETCDF (-93) /**< Error at PnetCDF layer */
/* The following was added in support of netcdf-4. Make all netcdf-4
error codes < -100 so that errors can be added to netcdf-3 if

View File

@ -196,6 +196,8 @@ const char *nc_strerror(int ncerr1)
return "NetCDF: cannot delete file";
case NC_EINTERNAL:
return "NetCDF: internal library error; Please contact Unidata support";
case NC_EPNETCDF:
return "NetCDF: PnetCDF error";
case NC_EHDFERR:
return "NetCDF: HDF error";
case NC_ECANTREAD:

View File

@ -7,7 +7,7 @@
# The source files for the HDF5 dispatch layer.
SET(libnchdf5_SOURCES nc4hdf.c nc4info.c hdf5file.c hdf5attr.c
hdf5dim.c hdf5grp.c hdf5type.c hdf5internal.c)
hdf5dim.c hdf5grp.c hdf5type.c hdf5internal.c hdf5create.c hdf5open.c)
# Build the HDF4 dispatch layer as a library that will be included in
# the netCDF library.

View File

@ -13,8 +13,8 @@ libnetcdf4_la_CPPFLAGS = ${AM_CPPFLAGS}
noinst_LTLIBRARIES = libnchdf5.la
# The source files.
libnchdf5_la_SOURCES = nc4hdf.c nc4info.c hdf5file.c hdf5attr.c \
hdf5dim.c hdf5grp.c hdf5type.c hdf5internal.c
libnchdf5_la_SOURCES = nc4hdf.c nc4info.c hdf5file.c hdf5attr.c \
hdf5dim.c hdf5grp.c hdf5type.c hdf5internal.c hdf5create.c hdf5open.c
# Package this for cmake build.
EXTRA_DIST = CMakeLists.txt

328
libhdf5/hdf5create.c Normal file
View File

@ -0,0 +1,328 @@
/* Copyright 2003-2018, University Corporation for Atmospheric
* Research. See COPYRIGHT file for copying and redistribution
* conditions. */
/**
* @file
* @internal The netCDF-4 file functions relating to file creation.
*
* @author Ed Hartnett
*/
#include "config.h"
#include "hdf5internal.h"
/* From hdf5file.c. */
extern size_t nc4_chunk_cache_size;
extern size_t nc4_chunk_cache_nelems;
extern float nc4_chunk_cache_preemption;
/** @internal These flags may not be set for create. */
static const int ILLEGAL_CREATE_FLAGS = (NC_NOWRITE|NC_MMAP|NC_64BIT_OFFSET|NC_CDF5);
/* From nc4mem.c */
extern int NC4_create_image_file(NC_FILE_INFO_T* h5, size_t);
/**
* @internal Create a netCDF-4/HDF5 file.
*
* @param path The file name of the new file.
* @param cmode The creation mode flag.
* @param initialsz The proposed initial file size (advisory)
* @param parameters extra parameter info (like MPI communicator)
* @param nc Pointer to an instance of NC.
*
* @return ::NC_NOERR No error.
* @return ::NC_EINVAL Invalid input (check cmode).
* @return ::NC_EEXIST File exists and NC_NOCLOBBER used.
* @return ::NC_EHDFERR HDF5 returned error.
* @ingroup netcdf4
* @author Ed Hartnett, Dennis Heimbigner
*/
static int
nc4_create_file(const char *path, int cmode, size_t initialsz,
void* parameters, NC *nc)
{
hid_t fcpl_id, fapl_id = -1;
unsigned flags;
FILE *fp;
int retval = NC_NOERR;
NC_FILE_INFO_T* nc4_info = NULL;
#ifdef USE_PARALLEL4
NC_MPI_INFO *mpiinfo = NULL;
MPI_Comm comm;
MPI_Info info;
int comm_duped = 0; /* Whether the MPI Communicator was duplicated */
int info_duped = 0; /* Whether the MPI Info object was duplicated */
#endif /* !USE_PARALLEL4 */
assert(nc && path);
LOG((3, "%s: path %s mode 0x%x", __func__, path, cmode));
/* Add necessary structs to hold netcdf-4 file data. */
if ((retval = nc4_nc4f_list_add(nc, path, (NC_WRITE | cmode))))
BAIL(retval);
nc4_info = NC4_DATA(nc);
assert(nc4_info && nc4_info->root_grp);
nc4_info->mem.inmemory = (cmode & NC_INMEMORY) == NC_INMEMORY;
nc4_info->mem.diskless = (cmode & NC_DISKLESS) == NC_DISKLESS;
nc4_info->mem.created = 1;
nc4_info->mem.initialsize = initialsz;
if(nc4_info->mem.inmemory && parameters)
nc4_info->mem.memio = *(NC_memio*)parameters;
#ifdef USE_PARALLEL4
else if(parameters) {
mpiinfo = (NC_MPI_INFO *)parameters;
comm = mpiinfo->comm;
info = mpiinfo->info;
}
#endif
if(nc4_info->mem.diskless)
flags = H5F_ACC_TRUNC;
else if(cmode & NC_NOCLOBBER)
flags = H5F_ACC_EXCL;
else
flags = H5F_ACC_TRUNC;
/* If this file already exists, and NC_NOCLOBBER is specified,
return an error (unless diskless|inmemory) */
if (nc4_info->mem.diskless) {
if((cmode & NC_WRITE) && (cmode & NC_NOCLOBBER) == 0)
nc4_info->mem.persist = 1;
} else if (nc4_info->mem.inmemory) {
/* ok */
} else if ((cmode & NC_NOCLOBBER) && (fp = fopen(path, "r"))) {
fclose(fp);
BAIL(NC_EEXIST);
}
/* Need this access plist to control how HDF5 handles open objects
* on file close. Setting H5F_CLOSE_SEMI will cause H5Fclose to
* fail if there are any open objects in the file. */
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
BAIL(NC_EHDFERR);
if (H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI))
BAIL(NC_EHDFERR);
#ifdef USE_PARALLEL4
/* If this is a parallel file create, set up the file creation
property list. */
if ((cmode & NC_MPIIO) || (cmode & NC_MPIPOSIX)) {
nc4_info->parallel = NC_TRUE;
if (cmode & NC_MPIIO) /* MPI/IO */
{
LOG((4, "creating parallel file with MPI/IO"));
if (H5Pset_fapl_mpio(fapl_id, comm, info) < 0)
BAIL(NC_EPARINIT);
}
#ifdef USE_PARALLEL_POSIX
else /* MPI/POSIX */
{
LOG((4, "creating parallel file with MPI/posix"));
if (H5Pset_fapl_mpiposix(fapl_id, comm, 0) < 0)
BAIL(NC_EPARINIT);
}
#else /* USE_PARALLEL_POSIX */
/* Should not happen! Code in NC4_create/NC4_open should alias
* the NC_MPIPOSIX flag to NC_MPIIO, if the MPI-POSIX VFD is not
* available in HDF5. -QAK */
else /* MPI/POSIX */
BAIL(NC_EPARINIT);
#endif /* USE_PARALLEL_POSIX */
/* Keep copies of the MPI Comm & Info objects */
if (MPI_SUCCESS != MPI_Comm_dup(comm, &nc4_info->comm))
BAIL(NC_EMPI);
comm_duped++;
if (MPI_INFO_NULL != info)
{
if (MPI_SUCCESS != MPI_Info_dup(info, &nc4_info->info))
BAIL(NC_EMPI);
info_duped++;
}
else
{
/* No dup, just copy it. */
nc4_info->info = info;
}
}
#else /* only set cache for non-parallel... */
if(cmode & NC_DISKLESS) {
if (H5Pset_fapl_core(fapl_id, 4096, nc4_info->mem.persist))
BAIL(NC_EDISKLESS);
}
if (H5Pset_cache(fapl_id, 0, nc4_chunk_cache_nelems, nc4_chunk_cache_size,
nc4_chunk_cache_preemption) < 0)
BAIL(NC_EHDFERR);
LOG((4, "%s: set HDF raw chunk cache to size %d nelems %d preemption %f",
__func__, nc4_chunk_cache_size, nc4_chunk_cache_nelems,
nc4_chunk_cache_preemption));
#endif /* USE_PARALLEL4 */
#ifdef HDF5_HAS_LIBVER_BOUNDS
#if H5_VERSION_GE(1,10,2)
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18) < 0)
#else
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST,
H5F_LIBVER_LATEST) < 0)
#endif
BAIL(NC_EHDFERR);
#endif
/* Create the property list. */
if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0)
BAIL(NC_EHDFERR);
/* RJ: this suppose to be FALSE that is defined in H5 private.h as 0 */
if (H5Pset_obj_track_times(fcpl_id,0)<0)
BAIL(NC_EHDFERR);
/* Set latest_format in access propertly list and
* H5P_CRT_ORDER_TRACKED in the creation property list. This turns
* on HDF5 creation ordering. */
if (H5Pset_link_creation_order(fcpl_id, (H5P_CRT_ORDER_TRACKED |
H5P_CRT_ORDER_INDEXED)) < 0)
BAIL(NC_EHDFERR);
if (H5Pset_attr_creation_order(fcpl_id, (H5P_CRT_ORDER_TRACKED |
H5P_CRT_ORDER_INDEXED)) < 0)
BAIL(NC_EHDFERR);
/* Create the file. */
#ifdef HDF5_HAS_COLL_METADATA_OPS
H5Pset_all_coll_metadata_ops(fapl_id, 1 );
H5Pset_coll_metadata_write(fapl_id, 1);
#endif
if(nc4_info->mem.inmemory) {
#if 0
if(nc4_info->mem.memio.size == 0)
nc4_info->memio.size = DEFAULT_CREATE_MEMSIZE; /* last ditch fix */
if(nc4_info->memio.memory == NULL) { /* last ditch fix */
nc4_info->memio.memory = malloc(nc4_info->memio.size);
if(nc4_info->memio.memory == NULL)
BAIL(NC_ENOMEM);
}
assert(nc4_info->memio.size > 0 && nc4_info->memio.memory != NULL);
#endif
retval = NC4_create_image_file(nc4_info,initialsz);
if(retval)
BAIL(retval);
} else if ((nc4_info->hdfid = H5Fcreate(path, flags, fcpl_id, fapl_id)) < 0)
/*Change the return error from NC_EFILEMETADATA to
System error EACCES because that is the more likely problem */
BAIL(EACCES);
/* Open the root group. */
if ((nc4_info->root_grp->hdf_grpid = H5Gopen2(nc4_info->hdfid, "/",
H5P_DEFAULT)) < 0)
BAIL(NC_EFILEMETA);
/* Release the property lists. */
if (H5Pclose(fapl_id) < 0 || H5Pclose(fcpl_id) < 0)
BAIL(NC_EHDFERR);
/* Define mode gets turned on automatically on create. */
nc4_info->flags |= NC_INDEF;
/* Get the HDF5 superblock and read and parse the special
* _NCProperties attribute. */
if ((retval = NC4_get_fileinfo(nc4_info, &globalpropinfo)))
BAIL(retval);
/* Write the _NCProperties attribute. */
if ((retval = NC4_put_propattr(nc4_info)))
BAIL(retval);
return NC_NOERR;
exit: /*failure exit*/
#ifdef USE_PARALLEL4
if (comm_duped) MPI_Comm_free(&nc4_info->comm);
if (info_duped) MPI_Info_free(&nc4_info->info);
#endif
if (fapl_id != H5P_DEFAULT) H5Pclose(fapl_id);
if(!nc4_info) return retval;
nc4_close_netcdf4_file(nc4_info,1,0); /* treat like abort */
return retval;
}
/**
* @internal Create a netCDF-4/HDF5 file.
*
* @param path The file name of the new file.
* @param cmode The creation mode flag.
* @param initialsz Ignored by this function.
* @param basepe Ignored by this function.
* @param chunksizehintp Ignored by this function.
* @param use_parallel 0 for sequential, non-zero for parallel I/O.
* @param parameters pointer to struct holding extra data (e.g. for
* parallel I/O) layer. Ignored if NULL.
* @param dispatch Pointer to the dispatch table for this file.
* @param nc_file Pointer to an instance of NC.
*
* @return ::NC_NOERR No error.
* @return ::NC_EINVAL Invalid input (check cmode).
* @ingroup netcdf4
* @author Ed Hartnett
*/
int
NC4_create(const char* path, int cmode, size_t initialsz, int basepe,
size_t *chunksizehintp, int use_parallel, void *parameters,
NC_Dispatch *dispatch, NC* nc_file)
{
int res;
assert(nc_file && path);
LOG((1, "%s: path %s cmode 0x%x parameters %p",
__func__, path, cmode, parameters));
/* If this is our first file, turn off HDF5 error messages. */
if (!nc4_hdf5_initialized)
nc4_hdf5_initialize();
/* Check the cmode for validity. */
if((cmode & ILLEGAL_CREATE_FLAGS) != 0)
{res = NC_EINVAL; goto done;}
/* Cannot have both */
if((cmode & (NC_MPIIO|NC_MPIPOSIX)) == (NC_MPIIO|NC_MPIPOSIX))
{res = NC_EINVAL; goto done;}
/* Currently no parallel diskless io */
if((cmode & (NC_MPIIO | NC_MPIPOSIX)) && (cmode & NC_DISKLESS))
{res = NC_EINVAL; goto done;}
#ifndef USE_PARALLEL_POSIX
/* If the HDF5 library has been compiled without the MPI-POSIX VFD, alias
* the NC_MPIPOSIX flag to NC_MPIIO. -QAK
*/
if(cmode & NC_MPIPOSIX)
{
cmode &= ~NC_MPIPOSIX;
cmode |= NC_MPIIO;
}
#endif /* USE_PARALLEL_POSIX */
cmode |= NC_NETCDF4;
/* Apply default create format. */
if (nc_get_default_format() == NC_FORMAT_CDF5)
cmode |= NC_CDF5;
else if (nc_get_default_format() == NC_FORMAT_64BIT_OFFSET)
cmode |= NC_64BIT_OFFSET;
else if (nc_get_default_format() == NC_FORMAT_NETCDF4_CLASSIC)
cmode |= NC_CLASSIC_MODEL;
LOG((2, "cmode after applying default format: 0x%x", cmode));
nc_file->int_ncid = nc_file->ext_ncid;
res = nc4_create_file(path, cmode, initialsz, parameters, nc_file);
done:
return res;
}

File diff suppressed because it is too large Load Diff

2115
libhdf5/hdf5open.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -19,14 +19,9 @@
typedef struct NCP_INFO
{
/* pnetcdf_file will be true if the file is created/opened with the
* parallel-netcdf library. pnetcdf_access_mode keeps track of
* whether independpent or collective mode is
* desired. pnetcdf_ndims keeps track of how many dims each var
* has, which I need to know to convert start, count, and stride
* arrays from size_t to MPI_Offset. (I can't use an inq function
* to find out the number of dims, because these are collective in
* pnetcdf.) */
/* pnetcdf_access_mode keeps track of whether independpent or collective
* mode is set currently.
*/
int pnetcdf_access_mode;
} NCP_INFO;
@ -50,8 +45,8 @@ NCP_create(const char *path, int cmode,
{
int res, default_format;
NCP_INFO* nc5;
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
MPI_Comm comm;
MPI_Info info;
/* Check the cmode for only valid flags*/
if(cmode & ~LEGAL_CREATE_FLAGS)
@ -92,26 +87,14 @@ NCP_create(const char *path, int cmode,
/* Link nc5 and nc */
NCP_DATA_SET(nc,nc5);
/* Fix up the cmode by keeping only essential flags;
these are the flags that are the same in netcf.h and pnetcdf.h
*/
/* It turns out that pnetcdf.h defines a flag called
NC_64BIT_DATA (not to be confused with NC_64BIT_OFFSET).
This flag is essential to getting ncmpi_create to create
a proper pnetcdf format file.
We have set the value of NC_64BIT_DATA to be the same as in pnetcdf.h
(as of pnetcdf version 1.6.0) to avoid conflicts.
In any case, this flag must be set.
*/
/* PnetCDF recognizes the flags below for create and ignores NC_LOCK and NC_SHARE */
cmode &= (NC_WRITE | NC_NOCLOBBER | NC_SHARE | NC_64BIT_OFFSET | NC_64BIT_DATA);
res = ncmpi_create(comm, path, cmode, info, &(nc->int_ncid));
/* Default to independent access, like netCDF-4/HDF5 files. */
fSet(nc5->pnetcdf_access_mode, NCP_MODE_INDEP);
if(res && nc5 != NULL) free(nc5); /* reclaim allocated space */
done:
return res;
}
@ -124,36 +107,19 @@ NCP_open(const char *path, int cmode,
{
int res;
NCP_INFO* nc5;
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
MPI_Comm comm;
MPI_Info info;
/* Check the cmode for only valid flags*/
if(cmode & ~LEGAL_OPEN_FLAGS)
{res = NC_EINVAL; goto done;}
/* Cannot have both MPIO flags */
if((cmode & (NC_MPIIO|NC_MPIPOSIX)) == (NC_MPIIO|NC_MPIPOSIX))
{res = NC_EINVAL; goto done;}
/* No MPI environment initialized */
if (mpidata == NULL)
{res = NC_ENOPAR; goto done;}
/* Appears that this comment is wrong; allow 64 bit offset*/
/* Cannot have 64 bit offset flag */
/* if(cmode & (NC_64BIT_OFFSET)) {res = NC_EINVAL; goto done;} */
if(mpidata != NULL) {
comm = ((NC_MPI_INFO *)mpidata)->comm;
info = ((NC_MPI_INFO *)mpidata)->info;
} else {
comm = MPI_COMM_WORLD;
info = MPI_INFO_NULL;
}
/* PnetCDF recognizes the flags NC_WRITE and NC_NOCLOBBER for file open
* and ignores NC_LOCK, NC_SHARE, NC_64BIT_OFFSET, and NC_64BIT_DATA.
* Ignoring the NC_64BIT_OFFSET and NC_64BIT_DATA flags is because the
* file is already in one of the CDF-formats, and setting these 2 flags
* will not change the format of that file.
*/
cmode &= (NC_WRITE | NC_NOCLOBBER);
comm = ((NC_MPI_INFO *)mpidata)->comm;
info = ((NC_MPI_INFO *)mpidata)->info;
/* Create our specific NCP_INFO instance */
nc5 = (NCP_INFO*)calloc(1,sizeof(NCP_INFO));
@ -168,7 +134,7 @@ NCP_open(const char *path, int cmode,
res = ncmpi_open(comm, path, cmode, info, &(nc->int_ncid));
/* Default to independent access, like netCDF-4/HDF5 files. */
if(!res) {
if (res == NC_NOERR) {
res = ncmpi_begin_indep_data(nc->int_ncid);
fSet(nc5->pnetcdf_access_mode, NCP_MODE_INDEP);
}
@ -209,9 +175,8 @@ NCP__enddef(int ncid, size_t h_minfree, size_t v_align, size_t v_minfree, size_t
nc5 = NCP_DATA(nc);
assert(nc5);
/* causes implicitly defined warning; may be because of old installed pnetcdf? */
#if 1
/* In PnetCDF ncmpi__enddef() is only implemented in v1.5.0 and later */
#if (PNETCDF_VERSION_MAJOR*10000 + PNETCDF_VERSION_MINOR*100 + PNETCDF_VERSION_SUB >= 10500)
/* ncmpi__enddef() was first implemented in PnetCDF v1.5.0 */
status = ncmpi__enddef(nc->int_ncid, mpi_h_minfree, mpi_v_align,
mpi_v_minfree, mpi_r_align);
#else
@ -274,7 +239,12 @@ NCP_set_fill(int ncid, int fillmode, int *old_mode_ptr)
NC* nc;
int status = NC_check_id(ncid, &nc);
if(status != NC_NOERR) return status;
#if (PNETCDF_VERSION_MAJOR*10000 + PNETCDF_VERSION_MINOR*100 + PNETCDF_VERSION_SUB >= 10601)
/* ncmpi_set_fill was first implemented in PnetCDF 1.6.1 */
return ncmpi_set_fill(nc->int_ncid,fillmode,old_mode_ptr);
#else
return NC_EPNETCDF;
#endif
}
static int
@ -331,7 +301,7 @@ NCP_inq_type(int ncid, nc_type typeid, char* name, size_t* size)
{
/* Assert mode & NC_FORMAT_CDF5 */
if (typeid < NC_BYTE || typeid >= NC_STRING)
return NC_EBADTYPE;
return NC_EBADTYPE;
if(name)
strcpy(name, NC_atomictypename(typeid));
if(size)
@ -457,15 +427,14 @@ NCP_get_att(
{
NC* nc;
int status;
nc_type xtype;
status = NC_check_id(ncid, &nc);
if(status != NC_NOERR) return status;
status = NCP_inq_att(ncid,varid,name,&xtype,NULL);
if(status != NC_NOERR) return status;
if(memtype == NC_NAT) memtype = xtype;
if (memtype == NC_NAT) {
status = NCP_inq_att(ncid,varid,name,&memtype,NULL);
if (status != NC_NOERR) return status;
}
switch (memtype) {
case NC_CHAR:
@ -1188,7 +1157,13 @@ NCP_inq_var_all(int ncid, int varid, char *name, nc_type *xtypep,
if(deflatep) *deflatep = 0;
if(fletcher32p) *fletcher32p = 0;
if(contiguousp) *contiguousp = NC_CONTIGUOUS;
#if (PNETCDF_VERSION_MAJOR*10000 + PNETCDF_VERSION_MINOR*100 + PNETCDF_VERSION_SUB >= 10601)
/* ncmpi_inq_var_fill was first implemented in PnetCDF 1.6.1 */
if(no_fill) ncmpi_inq_var_fill(nc->int_ncid, varid, no_fill, fill_valuep);
#else
/* PnetCDF 1.6.0 and priors support NC_NOFILL only */
if(no_fill) *no_fill = 1;
#endif
if(endiannessp) return NC_ENOTNC4;
if(idp) return NC_ENOTNC4;
if(nparamsp) return NC_ENOTNC4;
@ -1202,7 +1177,12 @@ NCP_def_var_fill(int ncid, int varid, int no_fill, const void *fill_value)
NC* nc;
int status = NC_check_id(ncid, &nc);
if(status != NC_NOERR) return status;
#if (PNETCDF_VERSION_MAJOR*10000 + PNETCDF_VERSION_MINOR*100 + PNETCDF_VERSION_SUB >= 10601)
/* ncmpi_def_var_fill was first implemented in PnetCDF 1.6.1 */
return ncmpi_def_var_fill(nc->int_ncid, varid, no_fill, fill_value);
#else
return NC_EPNETCDF;
#endif
}
static int

View File

@ -1278,6 +1278,8 @@ char* nc_err_code_name(int err)
case (NC_EAUTH): return "NC_EAUTH";
case (NC_ENOTFOUND): return "NC_ENOTFOUND";
case (NC_ECANTREMOVE): return "NC_ECANTREMOVE";
case (NC_EINTERNAL): return "NC_EINTERNAL";
case (NC_EPNETCDF): return "NC_EPNETCDF";
case (NC_EHDFERR): return "NC_EHDFERR";
case (NC_ECANTREAD): return "NC_ECANTREAD";
case (NC_ECANTWRITE): return "NC_ECANTWRITE";
@ -1309,8 +1311,9 @@ char* nc_err_code_name(int err)
case (NC_EDISKLESS): return "NC_EDISKLESS";
case (NC_ECANTEXTEND): return "NC_ECANTEXTEND";
case (NC_EMPI): return "NC_EMPI";
case (NC_ENULLPAD): return "NC_NULLPAD";
// case (NC_EURL): return "NC_EURL";
case (NC_ENULLPAD): return "NC_NULLPAD";
case (NC_EINMEMORY): return "NC_EINMEMORY";
// case (NC_EURL): return "NC_EURL";
// case (NC_ECONSTRAINT): return "NC_ECONSTRAINT";
#ifdef USE_PNETCDF
case (NC_ESMALL): return "NC_ESMALL";