Loading...
Searching...
No Matches
derror.c
Go to the documentation of this file.
#include "config.h"
#include "ncdispatch.h"
#ifdef USE_PNETCDF
#include <pnetcdf.h> /* for ncmpi_strerror() */
#endif
static const char nc_libvers[] = PACKAGE_VERSION " of "__DATE__" "__TIME__" $";
const char *
nc_inq_libvers(void)
{
return nc_libvers;
}
const char *nc_strerror(int ncerr1)
{
/* System error? */
if(NC_ISSYSERR(ncerr1))
{
const char *cp = (const char *) strerror(ncerr1);
if(cp == NULL)
return "Unknown Error";
return cp;
}
/* If we're here, this is a netcdf error code. */
switch(ncerr1)
{
case NC_NOERR:
return "No error";
case NC_EBADID:
return "NetCDF: Not a valid ID";
case NC_ENFILE:
return "NetCDF: Too many files open";
case NC_EEXIST:
return "NetCDF: File exists && NC_NOCLOBBER";
case NC_EINVAL:
return "NetCDF: Invalid argument";
case NC_EPERM:
return "NetCDF: Write to read only";
case NC_ENOTINDEFINE:
return "NetCDF: Operation not allowed in data mode";
case NC_EINDEFINE:
return "NetCDF: Operation not allowed in define mode";
case NC_EINVALCOORDS:
return "NetCDF: Index exceeds dimension bound";
case NC_EMAXDIMS:
return "NetCDF: NC_MAX_DIMS exceeded"; /* not enforced after 4.5.0 */
case NC_ENAMEINUSE:
return "NetCDF: String match to name in use";
case NC_ENOTATT:
return "NetCDF: Attribute not found";
case NC_EMAXATTS:
return "NetCDF: NC_MAX_ATTRS exceeded"; /* not enforced after 4.5.0 */
case NC_EBADTYPE:
return "NetCDF: Not a valid data type or _FillValue type mismatch";
case NC_EBADDIM:
return "NetCDF: Invalid dimension ID or name";
case NC_EUNLIMPOS:
return "NetCDF: NC_UNLIMITED in the wrong index";
case NC_EMAXVARS: return "NetCDF: NC_MAX_VARS exceeded"; /* not enforced after 4.5.0 */
case NC_ENOTVAR:
return "NetCDF: Variable not found";
case NC_EGLOBAL:
return "NetCDF: Action prohibited on NC_GLOBAL varid";
case NC_ENOTNC:
return "NetCDF: Unknown file format";
case NC_ESTS:
return "NetCDF: In Fortran, string too short";
case NC_EMAXNAME:
return "NetCDF: NC_MAX_NAME exceeded";
case NC_EUNLIMIT:
return "NetCDF: NC_UNLIMITED size already in use";
case NC_ENORECVARS:
return "NetCDF: nc_rec op when there are no record vars";
case NC_ECHAR:
return "NetCDF: Attempt to convert between text & numbers";
case NC_EEDGE:
return "NetCDF: Start+count exceeds dimension bound";
case NC_ESTRIDE:
return "NetCDF: Illegal stride";
case NC_EBADNAME:
return "NetCDF: Name contains illegal characters";
case NC_ERANGE:
return "NetCDF: Numeric conversion not representable";
case NC_ENOMEM:
return "NetCDF: Memory allocation (malloc) failure";
case NC_EVARSIZE:
return "NetCDF: One or more variable sizes violate format constraints";
case NC_EDIMSIZE:
return "NetCDF: Invalid dimension size";
case NC_ETRUNC:
return "NetCDF: File likely truncated or possibly corrupted";
case NC_EAXISTYPE:
return "NetCDF: Illegal axis type";
case NC_EDAP:
return "NetCDF: DAP failure";
case NC_ECURL:
return "NetCDF: libcurl failure";
case NC_EIO:
return "NetCDF: I/O failure";
case NC_ENODATA:
return "NetCDF: Variable has no data";
case NC_EDAPSVC:
return "NetCDF: DAP server error";
case NC_EDAS:
return "NetCDF: Malformed or inaccessible DAP DAS";
case NC_EDDS:
return "NetCDF: Malformed or inaccessible DAP2 DDS or DAP4 DMR response";
case NC_EDATADDS:
return "NetCDF: Malformed or inaccessible DAP2 DATADDS or DAP4 DAP response";
case NC_EDAPURL:
return "NetCDF: Malformed URL";
case NC_EDAPCONSTRAINT:
return "NetCDF: Malformed or unexpected Constraint";
case NC_ETRANSLATION:
return "NetCDF: Untranslatable construct";
case NC_EACCESS:
return "NetCDF: Access failure";
case NC_EAUTH:
return "NetCDF: Authorization failure";
case NC_ENOTFOUND:
return "NetCDF: file not found";
case NC_ECANTREMOVE:
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:
return "NetCDF: Can't read file";
case NC_ECANTWRITE:
return "NetCDF: Can't write file";
case NC_ECANTCREATE:
return "NetCDF: Can't create file";
case NC_EFILEMETA:
return "NetCDF: Can't add HDF5 file metadata";
case NC_EDIMMETA:
return "NetCDF: Can't define dimensional metadata";
case NC_EATTMETA:
return "NetCDF: Can't open HDF5 attribute";
case NC_EVARMETA:
return "NetCDF: Problem with variable metadata.";
case NC_ENOCOMPOUND:
return "NetCDF: Can't create HDF5 compound type";
case NC_EATTEXISTS:
return "NetCDF: Attempt to create attribute that already exists";
case NC_ENOTNC4:
return "NetCDF: Attempting netcdf-4 operation on netcdf-3 file";
case NC_ESTRICTNC3:
return "NetCDF: Attempting netcdf-4 operation on strict nc3 netcdf-4 file";
case NC_ENOTNC3:
return "NetCDF: Attempting netcdf-3 operation on netcdf-4 file";
case NC_ENOPAR:
return "NetCDF: Parallel operation on file opened for non-parallel access";
case NC_EPARINIT:
return "NetCDF: Error initializing for parallel access";
case NC_EBADGRPID:
return "NetCDF: Bad group ID";
case NC_EBADTYPID:
return "NetCDF: Bad type ID";
case NC_ETYPDEFINED:
return "NetCDF: Type has already been defined and may not be edited";
case NC_EBADFIELD:
return "NetCDF: Bad field ID";
case NC_EBADCLASS:
return "NetCDF: Bad class";
case NC_EMAPTYPE:
return "NetCDF: Mapped access for atomic types only";
case NC_ELATEFILL:
return "NetCDF: Attempt to define fill value when data already exists.";
case NC_ELATEDEF:
return "NetCDF: Attempt to define var properties, like deflate, after enddef.";
case NC_EDIMSCALE:
return "NetCDF: Problem with HDF5 dimscales.";
case NC_ENOGRP:
return "NetCDF: No group found.";
case NC_ESTORAGE:
return "NetCDF: Cannot specify both contiguous and chunking.";
case NC_EBADCHUNK:
return "NetCDF: Bad chunk sizes.";
case NC_ENOTBUILT:
return "NetCDF: Attempt to use feature that was not turned on "
"when netCDF was built.";
case NC_EDISKLESS:
return "NetCDF: Error in using diskless access";
case NC_EFILTER:
return "NetCDF: Filter error: bad id or parameters or duplicate filter";
case NC_ENOFILTER:
return "NetCDF: Filter error: undefined filter encountered";
case NC_ECANTEXTEND:
return "NetCDF: Attempt to extend dataset during NC_INDEPENDENT I/O operation. Use nc_var_par_access to set mode NC_COLLECTIVE before extending variable.";
case NC_EMPI: return "NetCDF: MPI operation failed.";
case NC_ERCFILE:
return "NetCDF: RC File Failure.";
case NC_ENULLPAD:
return "NetCDF: File fails strict Null-Byte Header check.";
case NC_EINMEMORY:
return "NetCDF: In-memory File operation failed.";
case NC_ENCZARR:
return "NetCDF: NCZarr error";
case NC_ES3:
return "NetCDF: S3 error";
case NC_EEMPTY:
return "NetCDF: Attempt to read empty NCZarr map key";
case NC_EOBJECT:
return "NetCDF: Some object exists when it should not";
case NC_ENOOBJECT:
return "NetCDF: Some object not found";
case NC_EPLUGIN:
return "NetCDF: Unclassified failure in accessing a dynamically loaded plugin";
default:
#ifdef USE_PNETCDF
/* The behavior of ncmpi_strerror here is to return
NULL, not a string. This causes problems in (at least)
the fortran interface. */
return (ncmpi_strerror(ncerr1) ?
ncmpi_strerror(ncerr1) :
"Unknown Error");
#else
return "Unknown Error";
#endif
}
}
nc_inq_libvers
const char * nc_inq_libvers(void)
Return the library version.
Definition derror.c:27
nc_strerror
const char * nc_strerror(int ncerr1)
Given an error number, return an error message.
Definition derror.c:87
NC_EDAPURL
#define NC_EDAPURL
Malformed DAP URL.
Definition netcdf.h:475
NC_ENOTINDEFINE
#define NC_ENOTINDEFINE
Operation not allowed in data mode.
Definition netcdf.h:394
NC_ELATEDEF
#define NC_ELATEDEF
Attempt to define var properties, like deflate, after enddef.
Definition netcdf.h:513
NC_EVARSIZE
#define NC_EVARSIZE
One or more variable sizes violate format constraints.
Definition netcdf.h:459
NC_ECHAR
#define NC_ECHAR
Attempt to convert between text & numbers.
Definition netcdf.h:439
NC_EDISKLESS
#define NC_EDISKLESS
Error in using diskless access.
Definition netcdf.h:519
NC_ERCFILE
#define NC_ERCFILE
RC file failure.
Definition netcdf.h:524
NC_ENULLPAD
#define NC_ENULLPAD
Header Bytes not Null-Byte padded.
Definition netcdf.h:525
NC_EBADTYPE
#define NC_EBADTYPE
Not a netcdf data type.
Definition netcdf.h:420
NC_EDDS
#define NC_EDDS
Malformed or inaccessible DDS.
Definition netcdf.h:471
NC_EBADFIELD
#define NC_EBADFIELD
Bad field ID.
Definition netcdf.h:509
NC_ETYPDEFINED
#define NC_ETYPDEFINED
Type has already been defined and may not be edited.
Definition netcdf.h:508
NC_EUNLIMPOS
#define NC_EUNLIMPOS
NC_UNLIMITED in the wrong index.
Definition netcdf.h:422
NC_EDAS
#define NC_EDAS
Malformed or inaccessible DAS.
Definition netcdf.h:470
NC_EFILTER
#define NC_EFILTER
Filter operation failed.
Definition netcdf.h:523
NC_EBADGRPID
#define NC_EBADGRPID
Bad group ID.
Definition netcdf.h:506
NC_ENOCOMPOUND
#define NC_ENOCOMPOUND
Not a compound type.
Definition netcdf.h:499
NC_EATTEXISTS
#define NC_EATTEXISTS
Attribute already exists.
Definition netcdf.h:500
NC_ENOTNC3
#define NC_ENOTNC3
Attempting netcdf-3 operation on netcdf-4 file.
Definition netcdf.h:503
NC_ENOOBJECT
#define NC_ENOOBJECT
Some object not found.
Definition netcdf.h:532
NC_EPERM
#define NC_EPERM
Write to read only.
Definition netcdf.h:389
NC_EDIMSCALE
#define NC_EDIMSCALE
Problem with HDF5 dimscales.
Definition netcdf.h:514
NC_ENOTNC
#define NC_ENOTNC
Not a netcdf file.
Definition netcdf.h:434
NC_EPLUGIN
#define NC_EPLUGIN
Unclassified failure in accessing a dynamically loaded plugin>.
Definition netcdf.h:533
NC_ENOGRP
#define NC_ENOGRP
No group found.
Definition netcdf.h:515
NC_ENODATA
#define NC_ENODATA
Attempt to access variable with no data.
Definition netcdf.h:468
NC_EDAPCONSTRAINT
#define NC_EDAPCONSTRAINT
Malformed DAP Constraint.
Definition netcdf.h:476
NC_ENAMEINUSE
#define NC_ENAMEINUSE
String match to name in use.
Definition netcdf.h:417
NC_EEDGE
#define NC_EEDGE
Start+count exceeds dimension bound.
Definition netcdf.h:448
NC_ENOTNC4
#define NC_ENOTNC4
Attempting netcdf-4 operation on netcdf-3 file.
Definition netcdf.h:501
NC_EEMPTY
#define NC_EEMPTY
Attempt to read empty NCZarr map key.
Definition netcdf.h:530
NC_ENOMEM
#define NC_ENOMEM
Memory allocation (malloc) failure.
Definition netcdf.h:458
NC_EINMEMORY
#define NC_EINMEMORY
In-memory file error.
Definition netcdf.h:526
NC_EDIMSIZE
#define NC_EDIMSIZE
Invalid dimension size.
Definition netcdf.h:460
NC_ES3
#define NC_ES3
Generic S3 error.
Definition netcdf.h:529
NC_EDAP
#define NC_EDAP
Generic DAP error.
Definition netcdf.h:465
NC_EINTERNAL
#define NC_EINTERNAL
NetCDF Library Internal Error.
Definition netcdf.h:484
NC_EAXISTYPE
#define NC_EAXISTYPE
Unknown axis type.
Definition netcdf.h:462
NC_EINDEFINE
#define NC_EINDEFINE
Operation not allowed in define mode.
Definition netcdf.h:403
NC_EPNETCDF
#define NC_EPNETCDF
Error at PnetCDF layer.
Definition netcdf.h:485
NC_ENORECVARS
#define NC_ENORECVARS
nc_rec op when there are no record vars
Definition netcdf.h:438
NC_ENFILE
#define NC_ENFILE
Too many netcdfs open.
Definition netcdf.h:386
NC_EOBJECT
#define NC_EOBJECT
Some object exists when it should not.
Definition netcdf.h:531
NC_EINVALCOORDS
#define NC_EINVALCOORDS
Index exceeds dimension bound.
Definition netcdf.h:410
NC_ECANTREAD
#define NC_ECANTREAD
Can't read.
Definition netcdf.h:492
NC_ESTRICTNC3
#define NC_ESTRICTNC3
Attempting netcdf-4 operation on strict nc3 netcdf-4 file.
Definition netcdf.h:502
NC_ESTS
#define NC_ESTS
In Fortran, string too short.
Definition netcdf.h:435
NC_ESTORAGE
#define NC_ESTORAGE
Can't specify both contiguous and chunking.
Definition netcdf.h:516
NC_EPARINIT
#define NC_EPARINIT
Error initializing for parallel access.
Definition netcdf.h:505
NC_EATTMETA
#define NC_EATTMETA
Problem with attribute metadata.
Definition netcdf.h:497
NC_EHDFERR
#define NC_EHDFERR
Error at HDF5 layer.
Definition netcdf.h:491
NC_ETRANSLATION
#define NC_ETRANSLATION
Untranslatable construct.
Definition netcdf.h:477
NC_EMAXNAME
#define NC_EMAXNAME
NC_MAX_NAME exceeded.
Definition netcdf.h:436
NC_ENOTATT
#define NC_ENOTATT
Attribute not found.
Definition netcdf.h:418
NC_ISSYSERR
#define NC_ISSYSERR(err)
The netcdf version 3 functions all return integer error status.
Definition netcdf.h:376
NC_EMAXDIMS
#define NC_EMAXDIMS
NC_MAX_DIMS exceeded.
Definition netcdf.h:415
NC_EFILEMETA
#define NC_EFILEMETA
Problem with file metadata.
Definition netcdf.h:495
NC_ENOTFOUND
#define NC_ENOTFOUND
No such file.
Definition netcdf.h:482
NC_ENCZARR
#define NC_ENCZARR
Error at NCZarr layer.
Definition netcdf.h:528
NC_ENOTVAR
#define NC_ENOTVAR
Variable not found.
Definition netcdf.h:432
NC_EINVAL
#define NC_EINVAL
Invalid Argument.
Definition netcdf.h:388
NC_NOERR
#define NC_NOERR
No Error.
Definition netcdf.h:378
NC_EMPI
#define NC_EMPI
MPI operation failed.
Definition netcdf.h:521
NC_EDATADDS
#define NC_EDATADDS
Malformed or inaccessible DATADDS.
Definition netcdf.h:473
NC_EBADCLASS
#define NC_EBADCLASS
Bad class.
Definition netcdf.h:510
NC_ETRUNC
#define NC_ETRUNC
File likely truncated or possibly corrupted.
Definition netcdf.h:461
NC_EDIMMETA
#define NC_EDIMMETA
Problem with dimension metadata.
Definition netcdf.h:496
NC_ECURL
#define NC_ECURL
Generic libcurl error.
Definition netcdf.h:466
NC_EMAXVARS
#define NC_EMAXVARS
NC_MAX_VARS exceeded.
Definition netcdf.h:427
NC_EMAXATTS
#define NC_EMAXATTS
NC_MAX_ATTRS exceeded - not enforced after 4.5.0.
Definition netcdf.h:419
NC_ECANTEXTEND
#define NC_ECANTEXTEND
Attempt to extend dataset during ind.
Definition netcdf.h:520
NC_ECANTREMOVE
#define NC_ECANTREMOVE
Can't remove file.
Definition netcdf.h:483
NC_ENOPAR
#define NC_ENOPAR
Parallel operation on file opened for non-parallel access.
Definition netcdf.h:504
NC_EIO
#define NC_EIO
Generic IO error.
Definition netcdf.h:467
NC_ENOTBUILT
#define NC_ENOTBUILT
Attempt to use feature that was not turned on when netCDF was built.
Definition netcdf.h:518
NC_EBADNAME
#define NC_EBADNAME
Attribute or variable name contains illegal characters.
Definition netcdf.h:450
NC_EBADCHUNK
#define NC_EBADCHUNK
Bad chunksize.
Definition netcdf.h:517
NC_EEXIST
#define NC_EEXIST
netcdf file exists && NC_NOCLOBBER
Definition netcdf.h:387
NC_EAUTH
#define NC_EAUTH
Authorization Failure.
Definition netcdf.h:479
NC_EMAPTYPE
#define NC_EMAPTYPE
Mapped access for atomic types only.
Definition netcdf.h:511
NC_EBADID
#define NC_EBADID
Not a netcdf id.
Definition netcdf.h:385
NC_EGLOBAL
#define NC_EGLOBAL
Action prohibited on NC_GLOBAL varid.
Definition netcdf.h:433
NC_ENOFILTER
#define NC_ENOFILTER
Filter not defined on variable.
Definition netcdf.h:527
NC_EUNLIMIT
#define NC_EUNLIMIT
NC_UNLIMITED size already in use.
Definition netcdf.h:437
NC_ECANTCREATE
#define NC_ECANTCREATE
Can't create.
Definition netcdf.h:494
NC_ESTRIDE
#define NC_ESTRIDE
Illegal stride.
Definition netcdf.h:449
NC_EACCESS
#define NC_EACCESS
Access Failure.
Definition netcdf.h:478
NC_EBADTYPID
#define NC_EBADTYPID
Bad type ID.
Definition netcdf.h:507
NC_EDAPSVC
#define NC_EDAPSVC
DAP server error.
Definition netcdf.h:469
NC_EVARMETA
#define NC_EVARMETA
Problem with variable metadata.
Definition netcdf.h:498
NC_ERANGE
#define NC_ERANGE
Math result not representable.
Definition netcdf.h:457
NC_EBADDIM
#define NC_EBADDIM
Invalid dimension id or name.
Definition netcdf.h:421
NC_ECANTWRITE
#define NC_ECANTWRITE
Can't write.
Definition netcdf.h:493
NC_ELATEFILL
#define NC_ELATEFILL
Attempt to define fill value when data already exists.
Definition netcdf.h:512