NetCDF
4.3.2
|
00001 00010 #include "ncdispatch.h" 00011 00012 /* Tell the user the version of netCDF. */ 00013 static const char nc_libvers[] = PACKAGE_VERSION " of "__DATE__" "__TIME__" $"; 00014 00022 const char * 00023 nc_inq_libvers(void) 00024 { 00025 return nc_libvers; 00026 } 00027 00082 const char * 00083 nc_strerror(int ncerr1) 00084 { 00085 /* System error? */ 00086 if(NC_ISSYSERR(ncerr1)) 00087 { 00088 const char *cp = (const char *) strerror(ncerr1); 00089 if(cp == NULL) 00090 return "Unknown Error"; 00091 return cp; 00092 } 00093 00094 /* If we're here, this is a netcdf error code. */ 00095 switch(ncerr1) 00096 { 00097 case NC_NOERR: 00098 return "No error"; 00099 case NC_EBADID: 00100 return "NetCDF: Not a valid ID"; 00101 case NC_ENFILE: 00102 return "NetCDF: Too many files open"; 00103 case NC_EEXIST: 00104 return "NetCDF: File exists && NC_NOCLOBBER"; 00105 case NC_EINVAL: 00106 return "NetCDF: Invalid argument"; 00107 case NC_EPERM: 00108 return "NetCDF: Write to read only"; 00109 case NC_ENOTINDEFINE: 00110 return "NetCDF: Operation not allowed in data mode"; 00111 case NC_EINDEFINE: 00112 return "NetCDF: Operation not allowed in define mode"; 00113 case NC_EINVALCOORDS: 00114 return "NetCDF: Index exceeds dimension bound"; 00115 case NC_EMAXDIMS: 00116 return "NetCDF: NC_MAX_DIMS exceeded"; 00117 case NC_ENAMEINUSE: 00118 return "NetCDF: String match to name in use"; 00119 case NC_ENOTATT: 00120 return "NetCDF: Attribute not found"; 00121 case NC_EMAXATTS: 00122 return "NetCDF: NC_MAX_ATTRS exceeded"; 00123 case NC_EBADTYPE: 00124 return "NetCDF: Not a valid data type or _FillValue type mismatch"; 00125 case NC_EBADDIM: 00126 return "NetCDF: Invalid dimension ID or name"; 00127 case NC_EUNLIMPOS: 00128 return "NetCDF: NC_UNLIMITED in the wrong index"; 00129 case NC_EMAXVARS: 00130 return "NetCDF: NC_MAX_VARS exceeded"; 00131 case NC_ENOTVAR: 00132 return "NetCDF: Variable not found"; 00133 case NC_EGLOBAL: 00134 return "NetCDF: Action prohibited on NC_GLOBAL varid"; 00135 case NC_ENOTNC: 00136 return "NetCDF: Unknown file format"; 00137 case NC_ESTS: 00138 return "NetCDF: In Fortran, string too short"; 00139 case NC_EMAXNAME: 00140 return "NetCDF: NC_MAX_NAME exceeded"; 00141 case NC_EUNLIMIT: 00142 return "NetCDF: NC_UNLIMITED size already in use"; 00143 case NC_ENORECVARS: 00144 return "NetCDF: nc_rec op when there are no record vars"; 00145 case NC_ECHAR: 00146 return "NetCDF: Attempt to convert between text & numbers"; 00147 case NC_EEDGE: 00148 return "NetCDF: Start+count exceeds dimension bound"; 00149 case NC_ESTRIDE: 00150 return "NetCDF: Illegal stride"; 00151 case NC_EBADNAME: 00152 return "NetCDF: Name contains illegal characters"; 00153 case NC_ERANGE: 00154 return "NetCDF: Numeric conversion not representable"; 00155 case NC_ENOMEM: 00156 return "NetCDF: Memory allocation (malloc) failure"; 00157 case NC_EVARSIZE: 00158 return "NetCDF: One or more variable sizes violate format constraints"; 00159 case NC_EDIMSIZE: 00160 return "NetCDF: Invalid dimension size"; 00161 case NC_ETRUNC: 00162 return "NetCDF: File likely truncated or possibly corrupted"; 00163 case NC_EAXISTYPE: 00164 return "NetCDF: Illegal axis type"; 00165 case NC_EDAP: 00166 return "NetCDF: DAP failure"; 00167 case NC_ECURL: 00168 return "NetCDF: libcurl failure"; 00169 case NC_EIO: 00170 return "NetCDF: I/O failure"; 00171 case NC_ENODATA: 00172 return "NetCDF: Variable has no data in DAP request"; 00173 case NC_EDAPSVC: 00174 return "NetCDF: DAP server error"; 00175 case NC_EDAS: 00176 return "NetCDF: Malformed or inaccessible DAP DAS"; 00177 case NC_EDDS: 00178 return "NetCDF: Malformed or inaccessible DAP DDS"; 00179 case NC_EDATADDS: 00180 return "NetCDF: Malformed or inaccessible DAP DATADDS"; 00181 case NC_EDAPURL: 00182 return "NetCDF: Malformed URL"; 00183 case NC_EDAPCONSTRAINT: 00184 return "NetCDF: Malformed or unexpected Constraint"; 00185 case NC_ETRANSLATION: 00186 return "NetCDF: Untranslatable construct"; 00187 case NC_EACCESS: 00188 return "NetCDF: Access failure"; 00189 case NC_EAUTH: 00190 return "NetCDF: Authorization failure"; 00191 case NC_ENOTFOUND: 00192 return "NetCDF: file not found"; 00193 case NC_ECANTREMOVE: 00194 return "NetCDF: cannot delete file"; 00195 case NC_EHDFERR: 00196 return "NetCDF: HDF error"; 00197 case NC_ECANTREAD: 00198 return "NetCDF: Can't read file"; 00199 case NC_ECANTWRITE: 00200 return "NetCDF: Can't write file"; 00201 case NC_ECANTCREATE: 00202 return "NetCDF: Can't create file"; 00203 case NC_EFILEMETA: 00204 return "NetCDF: Can't add HDF5 file metadata"; 00205 case NC_EDIMMETA: 00206 return "NetCDF: Can't define dimensional metadata"; 00207 case NC_EATTMETA: 00208 return "NetCDF: Can't open HDF5 attribute"; 00209 case NC_EVARMETA: 00210 return "NetCDF: Problem with variable metadata."; 00211 case NC_ENOCOMPOUND: 00212 return "NetCDF: Can't create HDF5 compound type"; 00213 case NC_EATTEXISTS: 00214 return "NetCDF: Attempt to create attribute that alread exists"; 00215 case NC_ENOTNC4: 00216 return "NetCDF: Attempting netcdf-4 operation on netcdf-3 file"; 00217 case NC_ESTRICTNC3: 00218 return "NetCDF: Attempting netcdf-4 operation on strict nc3 netcdf-4 file"; 00219 case NC_ENOTNC3: 00220 return "NetCDF: Attempting netcdf-3 operation on netcdf-4 file"; 00221 case NC_ENOPAR: 00222 return "NetCDF: Parallel operation on file opened for non-parallel access"; 00223 case NC_EPARINIT: 00224 return "NetCDF: Error initializing for parallel access"; 00225 case NC_EBADGRPID: 00226 return "NetCDF: Bad group ID"; 00227 case NC_EBADTYPID: 00228 return "NetCDF: Bad type ID"; 00229 case NC_ETYPDEFINED: 00230 return "NetCDF: Type has already been defined and may not be edited"; 00231 case NC_EBADFIELD: 00232 return "NetCDF: Bad field ID"; 00233 case NC_EBADCLASS: 00234 return "NetCDF: Bad class"; 00235 case NC_EMAPTYPE: 00236 return "NetCDF: Mapped access for atomic types only"; 00237 case NC_ELATEFILL: 00238 return "NetCDF: Attempt to define fill value when data already exists."; 00239 case NC_ELATEDEF: 00240 return "NetCDF: Attempt to define var properties, like deflate, after enddef."; 00241 case NC_EDIMSCALE: 00242 return "NetCDF: Probem with HDF5 dimscales."; 00243 case NC_ENOGRP: 00244 return "NetCDF: No group found."; 00245 case NC_ESTORAGE: 00246 return "NetCDF: Cannot specify both contiguous and chunking."; 00247 case NC_EBADCHUNK: 00248 return "NetCDF: Bad chunk sizes."; 00249 case NC_ENOTBUILT: 00250 return "NetCDF: Attempt to use feature that was not turned on " 00251 "when netCDF was built."; 00252 case NC_EDISKLESS: 00253 return "NetCDF: Error in using diskless access"; 00254 default: 00255 return "Unknown Error"; 00256 } 00257 } 00258 00259