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