NetCDF  4.4.0-rc2
derror.c
Go to the documentation of this file.
1 
10 #include "ncdispatch.h"
11 
12 /* Tell the user the version of netCDF. */
13 static const char nc_libvers[] = PACKAGE_VERSION " of "__DATE__" "__TIME__" $";
14 
24 const char *
25 nc_inq_libvers(void)
26 {
27  return nc_libvers;
28 }
29 
85 const char *nc_strerror(int ncerr1)
86 {
87  /* System error? */
88  if(NC_ISSYSERR(ncerr1))
89  {
90  const char *cp = (const char *) strerror(ncerr1);
91  if(cp == NULL)
92  return "Unknown Error";
93  return cp;
94  }
95 
96  /* If we're here, this is a netcdf error code. */
97  switch(ncerr1)
98  {
99  case NC_NOERR:
100  return "No error";
101  case NC_EBADID:
102  return "NetCDF: Not a valid ID";
103  case NC_ENFILE:
104  return "NetCDF: Too many files open";
105  case NC_EEXIST:
106  return "NetCDF: File exists && NC_NOCLOBBER";
107  case NC_EINVAL:
108  return "NetCDF: Invalid argument";
109  case NC_EPERM:
110  return "NetCDF: Write to read only";
111  case NC_ENOTINDEFINE:
112  return "NetCDF: Operation not allowed in data mode";
113  case NC_EINDEFINE:
114  return "NetCDF: Operation not allowed in define mode";
115  case NC_EINVALCOORDS:
116  return "NetCDF: Index exceeds dimension bound";
117  case NC_EMAXDIMS:
118  return "NetCDF: NC_MAX_DIMS exceeded";
119  case NC_ENAMEINUSE:
120  return "NetCDF: String match to name in use";
121  case NC_ENOTATT:
122  return "NetCDF: Attribute not found";
123  case NC_EMAXATTS:
124  return "NetCDF: NC_MAX_ATTRS exceeded";
125  case NC_EBADTYPE:
126  return "NetCDF: Not a valid data type or _FillValue type mismatch";
127  case NC_EBADDIM:
128  return "NetCDF: Invalid dimension ID or name";
129  case NC_EUNLIMPOS:
130  return "NetCDF: NC_UNLIMITED in the wrong index";
131  case NC_EMAXVARS:
132  return "NetCDF: NC_MAX_VARS exceeded";
133  case NC_ENOTVAR:
134  return "NetCDF: Variable not found";
135  case NC_EGLOBAL:
136  return "NetCDF: Action prohibited on NC_GLOBAL varid";
137  case NC_ENOTNC:
138  return "NetCDF: Unknown file format";
139  case NC_ESTS:
140  return "NetCDF: In Fortran, string too short";
141  case NC_EMAXNAME:
142  return "NetCDF: NC_MAX_NAME exceeded";
143  case NC_EUNLIMIT:
144  return "NetCDF: NC_UNLIMITED size already in use";
145  case NC_ENORECVARS:
146  return "NetCDF: nc_rec op when there are no record vars";
147  case NC_ECHAR:
148  return "NetCDF: Attempt to convert between text & numbers";
149  case NC_EEDGE:
150  return "NetCDF: Start+count exceeds dimension bound";
151  case NC_ESTRIDE:
152  return "NetCDF: Illegal stride";
153  case NC_EBADNAME:
154  return "NetCDF: Name contains illegal characters";
155  case NC_ERANGE:
156  return "NetCDF: Numeric conversion not representable";
157  case NC_ENOMEM:
158  return "NetCDF: Memory allocation (malloc) failure";
159  case NC_EVARSIZE:
160  return "NetCDF: One or more variable sizes violate format constraints";
161  case NC_EDIMSIZE:
162  return "NetCDF: Invalid dimension size";
163  case NC_ETRUNC:
164  return "NetCDF: File likely truncated or possibly corrupted";
165  case NC_EAXISTYPE:
166  return "NetCDF: Illegal axis type";
167  case NC_EDAP:
168  return "NetCDF: DAP failure";
169  case NC_ECURL:
170  return "NetCDF: libcurl failure";
171  case NC_EIO:
172  return "NetCDF: I/O failure";
173  case NC_ENODATA:
174  return "NetCDF: Variable has no data in DAP request";
175  case NC_EDAPSVC:
176  return "NetCDF: DAP server error";
177  case NC_EDAS:
178  return "NetCDF: Malformed or inaccessible DAP DAS";
179  case NC_EDDS:
180  return "NetCDF: Malformed or inaccessible DAP DDS";
181  case NC_EDATADDS:
182  return "NetCDF: Malformed or inaccessible DAP DATADDS";
183  case NC_EDAPURL:
184  return "NetCDF: Malformed URL";
185  case NC_EDAPCONSTRAINT:
186  return "NetCDF: Malformed or unexpected Constraint";
187  case NC_ETRANSLATION:
188  return "NetCDF: Untranslatable construct";
189  case NC_EACCESS:
190  return "NetCDF: Access failure";
191  case NC_EAUTH:
192  return "NetCDF: Authorization failure";
193  case NC_ENOTFOUND:
194  return "NetCDF: file not found";
195  case NC_ECANTEXTEND:
196  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.";
197  case NC_ECANTREMOVE:
198  return "NetCDF: cannot delete file";
199  case NC_EHDFERR:
200  return "NetCDF: HDF error";
201  case NC_ECANTREAD:
202  return "NetCDF: Can't read file";
203  case NC_ECANTWRITE:
204  return "NetCDF: Can't write file";
205  case NC_ECANTCREATE:
206  return "NetCDF: Can't create file";
207  case NC_EFILEMETA:
208  return "NetCDF: Can't add HDF5 file metadata";
209  case NC_EDIMMETA:
210  return "NetCDF: Can't define dimensional metadata";
211  case NC_EATTMETA:
212  return "NetCDF: Can't open HDF5 attribute";
213  case NC_EVARMETA:
214  return "NetCDF: Problem with variable metadata.";
215  case NC_ENOCOMPOUND:
216  return "NetCDF: Can't create HDF5 compound type";
217  case NC_EATTEXISTS:
218  return "NetCDF: Attempt to create attribute that alread exists";
219  case NC_ENOTNC4:
220  return "NetCDF: Attempting netcdf-4 operation on netcdf-3 file";
221  case NC_ESTRICTNC3:
222  return "NetCDF: Attempting netcdf-4 operation on strict nc3 netcdf-4 file";
223  case NC_ENOTNC3:
224  return "NetCDF: Attempting netcdf-3 operation on netcdf-4 file";
225  case NC_ENOPAR:
226  return "NetCDF: Parallel operation on file opened for non-parallel access";
227  case NC_EPARINIT:
228  return "NetCDF: Error initializing for parallel access";
229  case NC_EBADGRPID:
230  return "NetCDF: Bad group ID";
231  case NC_EBADTYPID:
232  return "NetCDF: Bad type ID";
233  case NC_ETYPDEFINED:
234  return "NetCDF: Type has already been defined and may not be edited";
235  case NC_EBADFIELD:
236  return "NetCDF: Bad field ID";
237  case NC_EBADCLASS:
238  return "NetCDF: Bad class";
239  case NC_EMAPTYPE:
240  return "NetCDF: Mapped access for atomic types only";
241  case NC_ELATEFILL:
242  return "NetCDF: Attempt to define fill value when data already exists.";
243  case NC_ELATEDEF:
244  return "NetCDF: Attempt to define var properties, like deflate, after enddef.";
245  case NC_EDIMSCALE:
246  return "NetCDF: Probem with HDF5 dimscales.";
247  case NC_ENOGRP:
248  return "NetCDF: No group found.";
249  case NC_ESTORAGE:
250  return "NetCDF: Cannot specify both contiguous and chunking.";
251  case NC_EBADCHUNK:
252  return "NetCDF: Bad chunk sizes.";
253  case NC_ENOTBUILT:
254  return "NetCDF: Attempt to use feature that was not turned on "
255  "when netCDF was built.";
256  case NC_EDISKLESS:
257  return "NetCDF: Error in using diskless access";
258  default:
259  return "Unknown Error";
260  }
261 }
262 
#define NC_ENOMEM
Memory allocation (malloc) failure.
Definition: netcdf.h:357
#define NC_ENOTNC4
Attempting netcdf-4 operation on netcdf-3 file.
Definition: netcdf.h:398
#define NC_ECANTWRITE
Can't write.
Definition: netcdf.h:390
#define NC_ENOTNC3
Attempting netcdf-3 operation on netcdf-4 file.
Definition: netcdf.h:402
#define NC_ECANTCREATE
Can't create.
Definition: netcdf.h:391
#define NC_ENFILE
Too many netcdfs open.
Definition: netcdf.h:290
#define NC_ESTS
In Fortran, string too short.
Definition: netcdf.h:334
#define NC_EUNLIMIT
NC_UNLIMITED size already in use.
Definition: netcdf.h:336
#define NC_EMAPTYPE
Mapped access for atomic types only.
Definition: netcdf.h:410
#define NC_EDIMSCALE
Probem with HDF5 dimscales.
Definition: netcdf.h:413
#define NC_ERANGE
Math result not representable.
Definition: netcdf.h:356
#define NC_EMAXATTS
NC_MAX_ATTRS exceeded.
Definition: netcdf.h:318
#define NC_EHDFERR
Error at HDF5 layer.
Definition: netcdf.h:388
#define NC_EINVALCOORDS
Index exceeds dimension bound.
Definition: netcdf.h:314
#define NC_EMAXVARS
NC_MAX_VARS exceeded.
Definition: netcdf.h:326
#define NC_ELATEFILL
Attempt to define fill value when data already exists.
Definition: netcdf.h:411
#define NC_ENOTINDEFINE
Operation not allowed in data mode.
Definition: netcdf.h:298
#define NC_ECANTEXTEND
Attempt to extend dataset during ind.
Definition: netcdf.h:419
#define NC_EATTEXISTS
Attribute already exists.
Definition: netcdf.h:397
#define NC_EAXISTYPE
Unknown axis type.
Definition: netcdf.h:361
#define NC_EBADCLASS
Bad class.
Definition: netcdf.h:409
#define NC_EMAXDIMS
NC_MAX_DIMS exceeded.
Definition: netcdf.h:315
#define NC_EBADDIM
Invalid dimension id or name.
Definition: netcdf.h:320
#define NC_EINDEFINE
Operation not allowed in define mode.
Definition: netcdf.h:307
#define NC_EDIMSIZE
Invalid dimension size.
Definition: netcdf.h:359
#define NC_EBADFIELD
Bad field ID.
Definition: netcdf.h:408
#define NC_ENOTNC
Not a netcdf file.
Definition: netcdf.h:333
#define NC_EIO
Generic IO error.
Definition: netcdf.h:366
#define NC_ENOTBUILT
Attempt to use feature that was not turned on when netCDF was built.
Definition: netcdf.h:417
#define NC_ENAMEINUSE
String match to name in use.
Definition: netcdf.h:316
#define NC_EACCESS
Access Failure.
Definition: netcdf.h:375
#define NC_ECURL
Generic libcurl error.
Definition: netcdf.h:365
#define NC_ENOGRP
No group found.
Definition: netcdf.h:414
#define NC_ETRANSLATION
Untranslatable construct.
Definition: netcdf.h:374
#define NC_EDAPURL
Malformed DAP URL.
Definition: netcdf.h:372
#define NC_EDAPSVC
DAP server error.
Definition: netcdf.h:368
#define NC_EATTMETA
Problem with attribute metadata.
Definition: netcdf.h:394
#define NC_EDDS
Malformed or inaccessible DDS.
Definition: netcdf.h:370
#define NC_EDISKLESS
Error in using diskless access.
Definition: netcdf.h:418
#define NC_ENOCOMPOUND
Not a compound type.
Definition: netcdf.h:396
#define NC_EFILEMETA
Problem with file metadata.
Definition: netcdf.h:392
#define NC_ETYPDEFINED
Type has already been defined and may not be edited.
Definition: netcdf.h:407
#define NC_EGLOBAL
Action prohibited on NC_GLOBAL varid.
Definition: netcdf.h:332
#define NC_ETRUNC
File likely truncated or possibly corrupted.
Definition: netcdf.h:360
#define NC_EBADTYPE
Not a netcdf data type.
Definition: netcdf.h:319
#define NC_EBADNAME
Attribute or variable name contains illegal characters.
Definition: netcdf.h:349
#define NC_EEDGE
Start+count exceeds dimension bound.
Definition: netcdf.h:347
#define NC_EDIMMETA
Problem with dimension metadata.
Definition: netcdf.h:393
#define NC_ENODATA
Attempt to access variable with no data.
Definition: netcdf.h:367
#define NC_ESTRIDE
Illegal stride.
Definition: netcdf.h:348
#define NC_EINVAL
Invalid Argument.
Definition: netcdf.h:292
#define NC_ESTRICTNC3
Attempting netcdf-4 operation on strict nc3 netcdf-4 file.
Definition: netcdf.h:401
#define NC_EBADGRPID
Bad group ID.
Definition: netcdf.h:405
#define NC_ECANTREMOVE
Can't remove file.
Definition: netcdf.h:380
#define NC_EBADTYPID
Bad type ID.
Definition: netcdf.h:406
#define NC_EUNLIMPOS
NC_UNLIMITED in the wrong index.
Definition: netcdf.h:321
#define NC_ISSYSERR(err)
The netcdf version 3 functions all return integer error status.
Definition: netcdf.h:280
#define NC_EPARINIT
Error initializing for parallel access.
Definition: netcdf.h:404
#define NC_EEXIST
netcdf file exists && NC_NOCLOBBER
Definition: netcdf.h:291
#define NC_EDAP
Generic DAP error.
Definition: netcdf.h:364
#define NC_ENORECVARS
nc_rec op when there are no record vars
Definition: netcdf.h:337
#define NC_EBADID
Not a netcdf id.
Definition: netcdf.h:289
#define NC_ENOPAR
Parallel operation on file opened for non-parallel access.
Definition: netcdf.h:403
#define NC_EVARSIZE
One or more variable sizes violate format constraints.
Definition: netcdf.h:358
#define NC_EVARMETA
Problem with variable metadata.
Definition: netcdf.h:395
#define NC_ESTORAGE
Can't specify both contiguous and chunking.
Definition: netcdf.h:415
#define NC_EAUTH
Authorization Failure.
Definition: netcdf.h:376
#define NC_ENOTVAR
Variable not found.
Definition: netcdf.h:331
#define NC_ECANTREAD
Can't read.
Definition: netcdf.h:389
#define NC_EMAXNAME
NC_MAX_NAME exceeded.
Definition: netcdf.h:335
#define NC_EPERM
Write to read only.
Definition: netcdf.h:293
#define NC_EDAS
Malformed or inaccessible DAS.
Definition: netcdf.h:369
#define NC_NOERR
No Error.
Definition: netcdf.h:282
#define NC_EDAPCONSTRAINT
Malformed DAP Constraint.
Definition: netcdf.h:373
#define NC_ECHAR
Attempt to convert between text & numbers.
Definition: netcdf.h:338
#define NC_ENOTFOUND
No such file.
Definition: netcdf.h:379
const char * nc_strerror(int ncerr1)
Given an error number, return an error message.
Definition: derror.c:85
#define NC_EDATADDS
Malformed or inaccessible DATADDS.
Definition: netcdf.h:371
#define NC_ELATEDEF
Attempt to define var properties, like deflate, after enddef.
Definition: netcdf.h:412
#define NC_ENOTATT
Attribute not found.
Definition: netcdf.h:317
#define NC_EBADCHUNK
Bad chunksize.
Definition: netcdf.h:416

Return to the Main Unidata NetCDF page.
Generated on Wed Aug 19 2015 17:25:41 for NetCDF. NetCDF is a Unidata library.