[409] | 1 | /*! \file |
---|
| 2 | |
---|
| 3 | Main header file for the C API. |
---|
| 4 | |
---|
| 5 | Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
---|
| 6 | 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 University |
---|
| 7 | Corporation for Atmospheric Research/Unidata. See \ref copyright file |
---|
| 8 | for more info. |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #ifndef _NETCDF_ |
---|
| 12 | #define _NETCDF_ |
---|
| 13 | |
---|
| 14 | #include <stddef.h> /* size_t, ptrdiff_t */ |
---|
| 15 | #include <errno.h> /* netcdf functions sometimes return system errors */ |
---|
| 16 | |
---|
| 17 | /*! The nc_type type is just an int. */ |
---|
| 18 | typedef int nc_type; |
---|
| 19 | |
---|
| 20 | #if defined(__cplusplus) |
---|
| 21 | extern "C" { |
---|
| 22 | #endif |
---|
| 23 | |
---|
| 24 | /* |
---|
| 25 | * The netcdf external data types |
---|
| 26 | */ |
---|
| 27 | #define NC_NAT 0 /**< Not A Type */ |
---|
| 28 | #define NC_BYTE 1 /**< signed 1 byte integer */ |
---|
| 29 | #define NC_CHAR 2 /**< ISO/ASCII character */ |
---|
| 30 | #define NC_SHORT 3 /**< signed 2 byte integer */ |
---|
| 31 | #define NC_INT 4 /**< signed 4 byte integer */ |
---|
| 32 | #define NC_LONG NC_INT /**< deprecated, but required for backward compatibility. */ |
---|
| 33 | #define NC_FLOAT 5 /**< single precision floating point number */ |
---|
| 34 | #define NC_DOUBLE 6 /**< double precision floating point number */ |
---|
| 35 | #define NC_UBYTE 7 /**< unsigned 1 byte int */ |
---|
| 36 | #define NC_USHORT 8 /**< unsigned 2-byte int */ |
---|
| 37 | #define NC_UINT 9 /**< unsigned 4-byte int */ |
---|
| 38 | #define NC_INT64 10 /**< signed 8-byte int */ |
---|
| 39 | #define NC_UINT64 11 /**< unsigned 8-byte int */ |
---|
| 40 | #define NC_STRING 12 /**< string */ |
---|
| 41 | |
---|
| 42 | #define NC_MAX_ATOMIC_TYPE NC_STRING |
---|
| 43 | |
---|
| 44 | /* The following are use internally in support of user-defines |
---|
| 45 | * types. They are also the class returned by nc_inq_user_type. */ |
---|
| 46 | #define NC_VLEN 13 /**< vlen types */ |
---|
| 47 | #define NC_OPAQUE 14 /**< opaque types */ |
---|
| 48 | #define NC_ENUM 15 /**< enum types */ |
---|
| 49 | #define NC_COMPOUND 16 /**< compound types */ |
---|
| 50 | |
---|
| 51 | /* Define the first user defined type id (leave some room) */ |
---|
| 52 | #define NC_FIRSTUSERTYPEID 32 |
---|
| 53 | |
---|
| 54 | /** Default fill value. This is used unless _FillValue attribute |
---|
| 55 | * is set. These values are stuffed into newly allocated space as |
---|
| 56 | * appropriate. The hope is that one might use these to notice that a |
---|
| 57 | * particular datum has not been set. */ |
---|
| 58 | /**@{*/ |
---|
| 59 | #define NC_FILL_BYTE ((signed char)-127) |
---|
| 60 | #define NC_FILL_CHAR ((char)0) |
---|
| 61 | #define NC_FILL_SHORT ((short)-32767) |
---|
| 62 | #define NC_FILL_INT (-2147483647L) |
---|
| 63 | #define NC_FILL_FLOAT (9.9692099683868690e+36f) /* near 15 * 2^119 */ |
---|
| 64 | #define NC_FILL_DOUBLE (9.9692099683868690e+36) |
---|
| 65 | #define NC_FILL_UBYTE (255) |
---|
| 66 | #define NC_FILL_USHORT (65535) |
---|
| 67 | #define NC_FILL_UINT (4294967295U) |
---|
| 68 | #define NC_FILL_INT64 ((long long)-9223372036854775806LL) |
---|
| 69 | #define NC_FILL_UINT64 ((unsigned long long)18446744073709551614ULL) |
---|
| 70 | #define NC_FILL_STRING "" |
---|
| 71 | /**@}*/ |
---|
| 72 | |
---|
| 73 | /*! Max or min values for a type. Nothing greater/smaller can be |
---|
| 74 | * stored in a netCDF file for their associated types. Recall that a C |
---|
| 75 | * compiler may define int to be any length it wants, but a NC_INT is |
---|
| 76 | * *always* a 4 byte signed int. On a platform with 64 bit ints, |
---|
| 77 | * there will be many ints which are outside the range supported by |
---|
| 78 | * NC_INT. But since NC_INT is an external format, it has to mean the |
---|
| 79 | * same thing everywhere. */ |
---|
| 80 | /**@{*/ |
---|
| 81 | #define NC_MAX_BYTE 127 |
---|
| 82 | #define NC_MIN_BYTE (-NC_MAX_BYTE-1) |
---|
| 83 | #define NC_MAX_CHAR 255 |
---|
| 84 | #define NC_MAX_SHORT 32767 |
---|
| 85 | #define NC_MIN_SHORT (-NC_MAX_SHORT - 1) |
---|
| 86 | #define NC_MAX_INT 2147483647 |
---|
| 87 | #define NC_MIN_INT (-NC_MAX_INT - 1) |
---|
| 88 | #define NC_MAX_FLOAT 3.402823466e+38f |
---|
| 89 | #define NC_MIN_FLOAT (-NC_MAX_FLOAT) |
---|
| 90 | #define NC_MAX_DOUBLE 1.7976931348623157e+308 |
---|
| 91 | #define NC_MIN_DOUBLE (-NC_MAX_DOUBLE) |
---|
| 92 | #define NC_MAX_UBYTE NC_MAX_CHAR |
---|
| 93 | #define NC_MAX_USHORT 65535U |
---|
| 94 | #define NC_MAX_UINT 4294967295U |
---|
| 95 | #define NC_MAX_INT64 (9223372036854775807LL) |
---|
| 96 | #define NC_MIN_INT64 (-9223372036854775807LL-1) |
---|
| 97 | #define NC_MAX_UINT64 (18446744073709551615ULL) |
---|
| 98 | #define X_INT64_MAX (9223372036854775807LL) |
---|
| 99 | #define X_INT64_MIN (-X_INT64_MAX - 1) |
---|
| 100 | #define X_UINT64_MAX (18446744073709551615ULL) |
---|
| 101 | /**@}*/ |
---|
| 102 | |
---|
| 103 | /** Name of fill value attribute. If you wish a variable to use a |
---|
| 104 | * different value than the above defaults, create an attribute with |
---|
| 105 | * the same type as the variable and this reserved name. The value you |
---|
| 106 | * give the attribute will be used as the fill value for that |
---|
| 107 | * variable. */ |
---|
| 108 | #define _FillValue "_FillValue" |
---|
| 109 | #define NC_FILL 0 /**< Argument to nc_set_fill() to clear NC_NOFILL */ |
---|
| 110 | #define NC_NOFILL 0x100 /**< Argument to nc_set_fill() to turn off filling of data. */ |
---|
| 111 | |
---|
| 112 | /* Define the ioflags bits for nc_create and nc_open. |
---|
| 113 | currently unused: 0x0010,0x0020,0x0040,0x0080 |
---|
| 114 | and the whole upper 16 bits |
---|
| 115 | */ |
---|
| 116 | |
---|
| 117 | #define NC_NOWRITE 0x0000 /**< Set read-only access for nc_open(). */ |
---|
| 118 | #define NC_WRITE 0x0001 /**< Set read-write access for nc_open(). */ |
---|
| 119 | /* unused: 0x0002 */ |
---|
| 120 | #define NC_CLOBBER 0x0000 /**< Destroy existing file. Mode flag for nc_create(). */ |
---|
| 121 | #define NC_NOCLOBBER 0x0004 /**< Don't destroy existing file. Mode flag for nc_create(). */ |
---|
| 122 | |
---|
| 123 | #define NC_DISKLESS 0x0008 /**< Use diskless file. Mode flag for nc_open() or nc_create(). */ |
---|
| 124 | #define NC_MMAP 0x0010 /**< Use diskless file with mmap. Mode flag for nc_open() or nc_create(). */ |
---|
| 125 | |
---|
| 126 | #define NC_CLASSIC_MODEL 0x0100 /**< Enforce classic model. Mode flag for nc_create(). */ |
---|
| 127 | #define NC_64BIT_OFFSET 0x0200 /**< Use large (64-bit) file offsets. Mode flag for nc_create(). */ |
---|
| 128 | |
---|
| 129 | /** \deprecated The following flag currently is ignored, but use in |
---|
| 130 | * nc_open() or nc_create() may someday support use of advisory |
---|
| 131 | * locking to prevent multiple writers from clobbering a file |
---|
| 132 | */ |
---|
| 133 | #define NC_LOCK 0x0400 |
---|
| 134 | |
---|
| 135 | /** Share updates, limit cacheing. |
---|
| 136 | Use this in mode flags for both nc_create() and nc_open(). */ |
---|
| 137 | #define NC_SHARE 0x0800 |
---|
| 138 | |
---|
| 139 | #define NC_NETCDF4 0x1000 /**< Use netCDF-4/HDF5 format. Mode flag for nc_create(). */ |
---|
| 140 | |
---|
| 141 | /** Turn on MPI I/O. |
---|
| 142 | Use this in mode flags for both nc_create() and nc_open(). */ |
---|
| 143 | #define NC_MPIIO 0x2000 |
---|
| 144 | /** Turn on MPI POSIX I/O. |
---|
| 145 | Use this in mode flags for both nc_create() and nc_open(). */ |
---|
| 146 | #define NC_MPIPOSIX 0x4000 |
---|
| 147 | #define NC_PNETCDF 0x8000 /**< Use parallel-netcdf library. Mode flag for nc_open(). */ |
---|
| 148 | |
---|
| 149 | /** Format specifier for nc_set_default_format(). Starting with |
---|
| 150 | * version 3.6, there are different format netCDF files. 4.0 |
---|
| 151 | * introduces the third one. \see netcdf_format |
---|
| 152 | */ |
---|
| 153 | /**@{*/ |
---|
| 154 | #define NC_FORMAT_CLASSIC (1) |
---|
| 155 | #define NC_FORMAT_64BIT (2) |
---|
| 156 | #define NC_FORMAT_NETCDF4 (3) |
---|
| 157 | #define NC_FORMAT_NETCDF4_CLASSIC (4) |
---|
| 158 | /**@}*/ |
---|
| 159 | |
---|
| 160 | /** Let nc__create() or nc__open() figure out as suitable chunk |
---|
| 161 | * size. */ |
---|
| 162 | #define NC_SIZEHINT_DEFAULT 0 |
---|
| 163 | |
---|
| 164 | /** In nc__enddef(), align to the chunk size. */ |
---|
| 165 | #define NC_ALIGN_CHUNK ((size_t)(-1)) |
---|
| 166 | |
---|
| 167 | /** Size argument to nc_def_dim() for an unlimited dimension. */ |
---|
| 168 | #define NC_UNLIMITED 0L |
---|
| 169 | |
---|
| 170 | /** Attribute id to put/get a global attribute. */ |
---|
| 171 | #define NC_GLOBAL -1 |
---|
| 172 | |
---|
| 173 | /** |
---|
| 174 | Maximum for classic library. |
---|
| 175 | |
---|
| 176 | In the classic netCDF model there are maximum values for the number of |
---|
| 177 | dimensions in the file (\ref NC_MAX_DIMS), the number of global or per |
---|
| 178 | variable attributes (\ref NC_MAX_ATTRS), the number of variables in |
---|
| 179 | the file (\ref NC_MAX_VARS), and the length of a name (\ref |
---|
| 180 | NC_MAX_NAME). |
---|
| 181 | |
---|
| 182 | This maximum is enforced by the interface, to facilitate writing |
---|
| 183 | applications and utilities. However, nothing is statically allocated |
---|
| 184 | to this size internally. |
---|
| 185 | |
---|
| 186 | This maximum is not used for netCDF-4/HDF5 files unless they were |
---|
| 187 | created with the ::NC_CLASSIC_MODEL flag. |
---|
| 188 | |
---|
| 189 | As a rule, NC_MAX_VAR_DIMS <= NC_MAX_DIMS. |
---|
| 190 | */ |
---|
| 191 | /**@{*/ |
---|
| 192 | #define NC_MAX_DIMS 1024 |
---|
| 193 | #define NC_MAX_ATTRS 8192 |
---|
| 194 | #define NC_MAX_VARS 8192 |
---|
| 195 | #define NC_MAX_NAME 256 |
---|
| 196 | #define NC_MAX_VAR_DIMS 1024 /**< max per variable dimensions */ |
---|
| 197 | /**@}*/ |
---|
| 198 | |
---|
| 199 | /** This is the max size of an SD dataset name in HDF4 (from HDF4 documentation).*/ |
---|
| 200 | #define NC_MAX_HDF4_NAME 64 |
---|
| 201 | |
---|
| 202 | /** In HDF5 files you can set the endianness of variables with |
---|
| 203 | nc_def_var_endian(). This define is used there. */ |
---|
| 204 | /**@{*/ |
---|
| 205 | #define NC_ENDIAN_NATIVE 0 |
---|
| 206 | #define NC_ENDIAN_LITTLE 1 |
---|
| 207 | #define NC_ENDIAN_BIG 2 |
---|
| 208 | /**@}*/ |
---|
| 209 | |
---|
| 210 | /** In HDF5 files you can set storage for each variable to be either |
---|
| 211 | * contiguous or chunked, with nc_def_var_chunking(). This define is |
---|
| 212 | * used there. */ |
---|
| 213 | /**@{*/ |
---|
| 214 | #define NC_CHUNKED 0 |
---|
| 215 | #define NC_CONTIGUOUS 1 |
---|
| 216 | /**@}*/ |
---|
| 217 | |
---|
| 218 | /** In HDF5 files you can set check-summing for each variable. |
---|
| 219 | Currently the only checksum available is Fletcher-32, which can be set |
---|
| 220 | with the function nc_def_var_fletcher32. These defines are used |
---|
| 221 | there. */ |
---|
| 222 | /**@{*/ |
---|
| 223 | #define NC_NOCHECKSUM 0 |
---|
| 224 | #define NC_FLETCHER32 1 |
---|
| 225 | /**@}*/ |
---|
| 226 | |
---|
| 227 | /**@{*/ |
---|
| 228 | /** Control the HDF5 shuffle filter. In HDF5 files you can specify |
---|
| 229 | * that a shuffle filter should be used on each chunk of a variable to |
---|
| 230 | * improve compression for that variable. This per-variable shuffle |
---|
| 231 | * property can be set with the function nc_def_var_deflate(). */ |
---|
| 232 | #define NC_NOSHUFFLE 0 |
---|
| 233 | #define NC_SHUFFLE 1 |
---|
| 234 | /**@}*/ |
---|
| 235 | |
---|
| 236 | /** The netcdf version 3 functions all return integer error status. |
---|
| 237 | * These are the possible values, in addition to certain values from |
---|
| 238 | * the system errno.h. |
---|
| 239 | */ |
---|
| 240 | #define NC_ISSYSERR(err) ((err) > 0) |
---|
| 241 | |
---|
| 242 | #define NC_NOERR 0 /**< No Error */ |
---|
| 243 | #define NC2_ERR (-1) /**< Returned for all errors in the v2 API. */ |
---|
| 244 | |
---|
| 245 | /** Not a netcdf id. |
---|
| 246 | |
---|
| 247 | The specified netCDF ID does not refer to an |
---|
| 248 | open netCDF dataset. */ |
---|
| 249 | #define NC_EBADID (-33) |
---|
| 250 | #define NC_ENFILE (-34) /**< Too many netcdfs open */ |
---|
| 251 | #define NC_EEXIST (-35) /**< netcdf file exists && NC_NOCLOBBER */ |
---|
| 252 | #define NC_EINVAL (-36) /**< Invalid Argument */ |
---|
| 253 | #define NC_EPERM (-37) /**< Write to read only */ |
---|
| 254 | |
---|
| 255 | /** Operation not allowed in data mode. This is returned for netCDF |
---|
| 256 | classic or 64-bit offset files, or for netCDF-4 files, when they were |
---|
| 257 | been created with ::NC_CLASSIC_MODEL flag in nc_create(). */ |
---|
| 258 | #define NC_ENOTINDEFINE (-38) |
---|
| 259 | |
---|
| 260 | /** Operation not allowed in define mode. |
---|
| 261 | |
---|
| 262 | The specified netCDF is in define mode rather than data mode. |
---|
| 263 | |
---|
| 264 | With netCDF-4/HDF5 files, this error will not occur, unless |
---|
| 265 | ::NC_CLASSIC_MODEL was used in nc_create(). |
---|
| 266 | */ |
---|
| 267 | #define NC_EINDEFINE (-39) |
---|
| 268 | |
---|
| 269 | /** Index exceeds dimension bound. |
---|
| 270 | |
---|
| 271 | The specified corner indices were out of range for the rank of the |
---|
| 272 | specified variable. For example, a negative index or an index that is |
---|
| 273 | larger than the corresponding dimension length will cause an error. */ |
---|
| 274 | #define NC_EINVALCOORDS (-40) |
---|
| 275 | #define NC_EMAXDIMS (-41) /**< NC_MAX_DIMS exceeded */ |
---|
| 276 | #define NC_ENAMEINUSE (-42) /**< String match to name in use */ |
---|
| 277 | #define NC_ENOTATT (-43) /**< Attribute not found */ |
---|
| 278 | #define NC_EMAXATTS (-44) /**< NC_MAX_ATTRS exceeded */ |
---|
| 279 | #define NC_EBADTYPE (-45) /**< Not a netcdf data type */ |
---|
| 280 | #define NC_EBADDIM (-46) /**< Invalid dimension id or name */ |
---|
| 281 | #define NC_EUNLIMPOS (-47) /**< NC_UNLIMITED in the wrong index */ |
---|
| 282 | |
---|
| 283 | /** NC_MAX_VARS exceeded. Max number of variables exceeded in a |
---|
| 284 | classic or 64-bit offset file, or an netCDF-4 file with |
---|
| 285 | ::NC_CLASSIC_MODEL on. */ |
---|
| 286 | #define NC_EMAXVARS (-48) |
---|
| 287 | |
---|
| 288 | /** Variable not found. |
---|
| 289 | |
---|
| 290 | The variable ID is invalid for the specified netCDF dataset. */ |
---|
| 291 | #define NC_ENOTVAR (-49) |
---|
| 292 | #define NC_EGLOBAL (-50) /**< Action prohibited on NC_GLOBAL varid */ |
---|
| 293 | #define NC_ENOTNC (-51) /**< Not a netcdf file */ |
---|
| 294 | #define NC_ESTS (-52) /**< In Fortran, string too short */ |
---|
| 295 | #define NC_EMAXNAME (-53) /**< NC_MAX_NAME exceeded */ |
---|
| 296 | #define NC_EUNLIMIT (-54) /**< NC_UNLIMITED size already in use */ |
---|
| 297 | #define NC_ENORECVARS (-55) /**< nc_rec op when there are no record vars */ |
---|
| 298 | #define NC_ECHAR (-56) /**< Attempt to convert between text & numbers */ |
---|
| 299 | |
---|
| 300 | /** Start+count exceeds dimension bound. |
---|
| 301 | |
---|
| 302 | The specified edge lengths added to the specified corner would have |
---|
| 303 | referenced data out of range for the rank of the specified |
---|
| 304 | variable. For example, an edge length that is larger than the |
---|
| 305 | corresponding dimension length minus the corner index will cause an |
---|
| 306 | error. */ |
---|
| 307 | #define NC_EEDGE (-57) |
---|
| 308 | #define NC_ESTRIDE (-58) /**< Illegal stride */ |
---|
| 309 | #define NC_EBADNAME (-59) /**< Attribute or variable name contains illegal characters */ |
---|
| 310 | /* N.B. following must match value in ncx.h */ |
---|
| 311 | |
---|
| 312 | /** Math result not representable. |
---|
| 313 | |
---|
| 314 | One or more of the values are out of the range of values representable |
---|
| 315 | by the desired type. */ |
---|
| 316 | #define NC_ERANGE (-60) |
---|
| 317 | #define NC_ENOMEM (-61) /**< Memory allocation (malloc) failure */ |
---|
| 318 | #define NC_EVARSIZE (-62) /**< One or more variable sizes violate format constraints */ |
---|
| 319 | #define NC_EDIMSIZE (-63) /**< Invalid dimension size */ |
---|
| 320 | #define NC_ETRUNC (-64) /**< File likely truncated or possibly corrupted */ |
---|
| 321 | #define NC_EAXISTYPE (-65) /**< Unknown axis type. */ |
---|
| 322 | |
---|
| 323 | /* Following errors are added for DAP */ |
---|
| 324 | #define NC_EDAP (-66) /**< Generic DAP error */ |
---|
| 325 | #define NC_ECURL (-67) /**< Generic libcurl error */ |
---|
| 326 | #define NC_EIO (-68) /**< Generic IO error */ |
---|
| 327 | #define NC_ENODATA (-69) /**< Attempt to access variable with no data */ |
---|
| 328 | #define NC_EDAPSVC (-70) /**< DAP server error */ |
---|
| 329 | #define NC_EDAS (-71) /**< Malformed or inaccessible DAS */ |
---|
| 330 | #define NC_EDDS (-72) /**< Malformed or inaccessible DDS */ |
---|
| 331 | #define NC_EDATADDS (-73) /**< Malformed or inaccessible DATADDS */ |
---|
| 332 | #define NC_EDAPURL (-74) /**< Malformed DAP URL */ |
---|
| 333 | #define NC_EDAPCONSTRAINT (-75) /**< Malformed DAP Constraint*/ |
---|
| 334 | #define NC_ETRANSLATION (-76) /**< Untranslatable construct */ |
---|
| 335 | |
---|
| 336 | /* The following was added in support of netcdf-4. Make all netcdf-4 |
---|
| 337 | error codes < -100 so that errors can be added to netcdf-3 if |
---|
| 338 | needed. */ |
---|
| 339 | #define NC4_FIRST_ERROR (-100) |
---|
| 340 | |
---|
| 341 | /** Error at HDF5 layer. */ |
---|
| 342 | #define NC_EHDFERR (-101) |
---|
| 343 | #define NC_ECANTREAD (-102) /**< Can't read. */ |
---|
| 344 | #define NC_ECANTWRITE (-103) /**< Can't write. */ |
---|
| 345 | #define NC_ECANTCREATE (-104) /**< Can't create. */ |
---|
| 346 | #define NC_EFILEMETA (-105) /**< Problem with file metadata. */ |
---|
| 347 | #define NC_EDIMMETA (-106) /**< Problem with dimension metadata. */ |
---|
| 348 | #define NC_EATTMETA (-107) /**< Problem with attribute metadata. */ |
---|
| 349 | #define NC_EVARMETA (-108) /**< Problem with variable metadata. */ |
---|
| 350 | #define NC_ENOCOMPOUND (-109) /**< Not a compound type. */ |
---|
| 351 | #define NC_EATTEXISTS (-110) /**< Attribute already exists. */ |
---|
| 352 | #define NC_ENOTNC4 (-111) /**< Attempting netcdf-4 operation on netcdf-3 file. */ |
---|
| 353 | |
---|
| 354 | /** Attempting netcdf-4 operation on strict nc3 netcdf-4 file. */ |
---|
| 355 | #define NC_ESTRICTNC3 (-112) |
---|
| 356 | #define NC_ENOTNC3 (-113) /**< Attempting netcdf-3 operation on netcdf-4 file. */ |
---|
| 357 | #define NC_ENOPAR (-114) /**< Parallel operation on file opened for non-parallel access. */ |
---|
| 358 | #define NC_EPARINIT (-115) /**< Error initializing for parallel access. */ |
---|
| 359 | #define NC_EBADGRPID (-116) /**< Bad group ID. */ |
---|
| 360 | #define NC_EBADTYPID (-117) /**< Bad type ID. */ |
---|
| 361 | #define NC_ETYPDEFINED (-118) /**< Type has already been defined and may not be edited. */ |
---|
| 362 | #define NC_EBADFIELD (-119) /**< Bad field ID. */ |
---|
| 363 | #define NC_EBADCLASS (-120) /**< Bad class. */ |
---|
| 364 | #define NC_EMAPTYPE (-121) /**< Mapped access for atomic types only. */ |
---|
| 365 | #define NC_ELATEFILL (-122) /**< Attempt to define fill value when data already exists. */ |
---|
| 366 | #define NC_ELATEDEF (-123) /**< Attempt to define var properties, like deflate, after enddef. */ |
---|
| 367 | #define NC_EDIMSCALE (-124) /**< Probem with HDF5 dimscales. */ |
---|
| 368 | #define NC_ENOGRP (-125) /**< No group found. */ |
---|
| 369 | #define NC_ESTORAGE (-126) /**< Can't specify both contiguous and chunking. */ |
---|
| 370 | #define NC_EBADCHUNK (-127) /**< Bad chunksize. */ |
---|
| 371 | #define NC_ENOTBUILT (-128) /**< Attempt to use feature that was not turned on when netCDF was built. */ |
---|
| 372 | #define NC_EDISKLESS (-129) /**< Error in using diskless access. */ |
---|
| 373 | |
---|
| 374 | #define NC4_LAST_ERROR (-129) |
---|
| 375 | |
---|
| 376 | /* This is used in netCDF-4 files for dimensions without coordinate |
---|
| 377 | * vars. */ |
---|
| 378 | #define DIM_WITHOUT_VARIABLE "This is a netCDF dimension but not a netCDF variable." |
---|
| 379 | |
---|
| 380 | /* This is here at the request of the NCO team to support our |
---|
| 381 | * mistake of having chunksizes be first ints, then size_t. Doh! */ |
---|
| 382 | #define NC_HAVE_NEW_CHUNKING_API 1 |
---|
| 383 | |
---|
| 384 | |
---|
| 385 | /*Errors for all remote access methods(e.g. DAP and CDMREMOTE)*/ |
---|
| 386 | #define NC_EURL (NC_EDAPURL) /* Malformed URL */ |
---|
| 387 | #define NC_ECONSTRAINT (NC_EDAPCONSTRAINT) /* Malformed Constraint*/ |
---|
| 388 | |
---|
| 389 | |
---|
| 390 | /* |
---|
| 391 | * The Interface |
---|
| 392 | */ |
---|
| 393 | |
---|
| 394 | /* Declaration modifiers for DLL support (MSC et al) */ |
---|
| 395 | |
---|
| 396 | #if defined(DLL_NETCDF) /* define when library is a DLL */ |
---|
| 397 | # if defined(DLL_EXPORT) /* define when building the library */ |
---|
| 398 | # define MSC_EXTRA __declspec(dllexport) |
---|
| 399 | # else |
---|
| 400 | # define MSC_EXTRA __declspec(dllimport) |
---|
| 401 | # endif |
---|
| 402 | #include <io.h> |
---|
| 403 | /*#define lseek _lseeki64 |
---|
| 404 | #define off_t __int64*/ |
---|
| 405 | #else |
---|
| 406 | #define MSC_EXTRA |
---|
| 407 | #endif /* defined(DLL_NETCDF) */ |
---|
| 408 | |
---|
| 409 | # define EXTERNL MSC_EXTRA extern |
---|
| 410 | |
---|
| 411 | #if defined(DLL_NETCDF) /* define when library is a DLL */ |
---|
| 412 | EXTERNL int ncerr; |
---|
| 413 | EXTERNL int ncopts; |
---|
| 414 | #endif |
---|
| 415 | |
---|
| 416 | EXTERNL const char * |
---|
| 417 | nc_inq_libvers(void); |
---|
| 418 | |
---|
| 419 | EXTERNL const char * |
---|
| 420 | nc_strerror(int ncerr); |
---|
| 421 | |
---|
| 422 | EXTERNL int |
---|
| 423 | nc__create(const char *path, int cmode, size_t initialsz, |
---|
| 424 | size_t *chunksizehintp, int *ncidp); |
---|
| 425 | |
---|
| 426 | EXTERNL int |
---|
| 427 | nc_create(const char *path, int cmode, int *ncidp); |
---|
| 428 | |
---|
| 429 | EXTERNL int |
---|
| 430 | nc__open(const char *path, int mode, |
---|
| 431 | size_t *chunksizehintp, int *ncidp); |
---|
| 432 | |
---|
| 433 | EXTERNL int |
---|
| 434 | nc_open(const char *path, int mode, int *ncidp); |
---|
| 435 | |
---|
| 436 | /* Learn the path used to open/create the file. */ |
---|
| 437 | EXTERNL int |
---|
| 438 | nc_inq_path(int ncid, size_t *pathlen, char *path); |
---|
| 439 | |
---|
| 440 | /* Use these with nc_var_par_access(). */ |
---|
| 441 | #define NC_INDEPENDENT 0 |
---|
| 442 | #define NC_COLLECTIVE 1 |
---|
| 443 | |
---|
| 444 | /* Set parallel access for a variable to independent (the default) or |
---|
| 445 | * collective. */ |
---|
| 446 | EXTERNL int |
---|
| 447 | nc_var_par_access(int ncid, int varid, int par_access); |
---|
| 448 | |
---|
| 449 | /* Given an ncid and group name (NULL gets root group), return |
---|
| 450 | * locid. */ |
---|
| 451 | EXTERNL int |
---|
| 452 | nc_inq_ncid(int ncid, const char *name, int *grp_ncid); |
---|
| 453 | |
---|
| 454 | /* Given a location id, return the number of groups it contains, and |
---|
| 455 | * an array of their locids. */ |
---|
| 456 | EXTERNL int |
---|
| 457 | nc_inq_grps(int ncid, int *numgrps, int *ncids); |
---|
| 458 | |
---|
| 459 | /* Given locid, find name of group. (Root group is named "/".) */ |
---|
| 460 | EXTERNL int |
---|
| 461 | nc_inq_grpname(int ncid, char *name); |
---|
| 462 | |
---|
| 463 | /* Given ncid, find full name and len of full name. (Root group is |
---|
| 464 | * named "/", with length 1.) */ |
---|
| 465 | EXTERNL int |
---|
| 466 | nc_inq_grpname_full(int ncid, size_t *lenp, char *full_name); |
---|
| 467 | |
---|
| 468 | /* Given ncid, find len of full name. */ |
---|
| 469 | EXTERNL int |
---|
| 470 | nc_inq_grpname_len(int ncid, size_t *lenp); |
---|
| 471 | |
---|
| 472 | /* Given an ncid, find the ncid of its parent group. */ |
---|
| 473 | EXTERNL int |
---|
| 474 | nc_inq_grp_parent(int ncid, int *parent_ncid); |
---|
| 475 | |
---|
| 476 | /* Given a name and parent ncid, find group ncid. */ |
---|
| 477 | EXTERNL int |
---|
| 478 | nc_inq_grp_ncid(int ncid, const char *grp_name, int *grp_ncid); |
---|
| 479 | |
---|
| 480 | /* Given a full name and ncid, find group ncid. */ |
---|
| 481 | EXTERNL int |
---|
| 482 | nc_inq_grp_full_ncid(int ncid, const char *full_name, int *grp_ncid); |
---|
| 483 | |
---|
| 484 | /* Get a list of ids for all the variables in a group. */ |
---|
| 485 | EXTERNL int |
---|
| 486 | nc_inq_varids(int ncid, int *nvars, int *varids); |
---|
| 487 | |
---|
| 488 | /* Find all dimids for a location. This finds all dimensions in a |
---|
| 489 | * group, or any of its parents. */ |
---|
| 490 | EXTERNL int |
---|
| 491 | nc_inq_dimids(int ncid, int *ndims, int *dimids, int include_parents); |
---|
| 492 | |
---|
| 493 | /* Find all user-defined types for a location. This finds all |
---|
| 494 | * user-defined types in a group. */ |
---|
| 495 | EXTERNL int |
---|
| 496 | nc_inq_typeids(int ncid, int *ntypes, int *typeids); |
---|
| 497 | |
---|
| 498 | /* Are two types equal? */ |
---|
| 499 | EXTERNL int |
---|
| 500 | nc_inq_type_equal(int ncid1, nc_type typeid1, int ncid2, |
---|
| 501 | nc_type typeid2, int *equal); |
---|
| 502 | |
---|
| 503 | /* Create a group. its ncid is returned in the new_ncid pointer. */ |
---|
| 504 | EXTERNL int |
---|
| 505 | nc_def_grp(int parent_ncid, const char *name, int *new_ncid); |
---|
| 506 | |
---|
| 507 | /* Here are functions for dealing with compound types. */ |
---|
| 508 | |
---|
| 509 | /* Create a compound type. */ |
---|
| 510 | EXTERNL int |
---|
| 511 | nc_def_compound(int ncid, size_t size, const char *name, nc_type *typeidp); |
---|
| 512 | |
---|
| 513 | /* Insert a named field into a compound type. */ |
---|
| 514 | EXTERNL int |
---|
| 515 | nc_insert_compound(int ncid, nc_type xtype, const char *name, |
---|
| 516 | size_t offset, nc_type field_typeid); |
---|
| 517 | |
---|
| 518 | /* Insert a named array into a compound type. */ |
---|
| 519 | EXTERNL int |
---|
| 520 | nc_insert_array_compound(int ncid, nc_type xtype, const char *name, |
---|
| 521 | size_t offset, nc_type field_typeid, |
---|
| 522 | int ndims, const int *dim_sizes); |
---|
| 523 | |
---|
| 524 | /* Get the name and size of a type. */ |
---|
| 525 | EXTERNL int |
---|
| 526 | nc_inq_type(int ncid, nc_type xtype, char *name, size_t *size); |
---|
| 527 | |
---|
| 528 | /* Get the id of a type from the name. */ |
---|
| 529 | EXTERNL int |
---|
| 530 | nc_inq_typeid(int ncid, const char *name, nc_type *typeidp); |
---|
| 531 | |
---|
| 532 | /* Get the name, size, and number of fields in a compound type. */ |
---|
| 533 | EXTERNL int |
---|
| 534 | nc_inq_compound(int ncid, nc_type xtype, char *name, size_t *sizep, |
---|
| 535 | size_t *nfieldsp); |
---|
| 536 | |
---|
| 537 | /* Get the name of a compound type. */ |
---|
| 538 | EXTERNL int |
---|
| 539 | nc_inq_compound_name(int ncid, nc_type xtype, char *name); |
---|
| 540 | |
---|
| 541 | /* Get the size of a compound type. */ |
---|
| 542 | EXTERNL int |
---|
| 543 | nc_inq_compound_size(int ncid, nc_type xtype, size_t *sizep); |
---|
| 544 | |
---|
| 545 | /* Get the number of fields in this compound type. */ |
---|
| 546 | EXTERNL int |
---|
| 547 | nc_inq_compound_nfields(int ncid, nc_type xtype, size_t *nfieldsp); |
---|
| 548 | |
---|
| 549 | /* Given the xtype and the fieldid, get all info about it. */ |
---|
| 550 | EXTERNL int |
---|
| 551 | nc_inq_compound_field(int ncid, nc_type xtype, int fieldid, char *name, |
---|
| 552 | size_t *offsetp, nc_type *field_typeidp, int *ndimsp, |
---|
| 553 | int *dim_sizesp); |
---|
| 554 | |
---|
| 555 | /* Given the typeid and the fieldid, get the name. */ |
---|
| 556 | EXTERNL int |
---|
| 557 | nc_inq_compound_fieldname(int ncid, nc_type xtype, int fieldid, |
---|
| 558 | char *name); |
---|
| 559 | |
---|
| 560 | /* Given the xtype and the name, get the fieldid. */ |
---|
| 561 | EXTERNL int |
---|
| 562 | nc_inq_compound_fieldindex(int ncid, nc_type xtype, const char *name, |
---|
| 563 | int *fieldidp); |
---|
| 564 | |
---|
| 565 | /* Given the xtype and fieldid, get the offset. */ |
---|
| 566 | EXTERNL int |
---|
| 567 | nc_inq_compound_fieldoffset(int ncid, nc_type xtype, int fieldid, |
---|
| 568 | size_t *offsetp); |
---|
| 569 | |
---|
| 570 | /* Given the xtype and the fieldid, get the type of that field. */ |
---|
| 571 | EXTERNL int |
---|
| 572 | nc_inq_compound_fieldtype(int ncid, nc_type xtype, int fieldid, |
---|
| 573 | nc_type *field_typeidp); |
---|
| 574 | |
---|
| 575 | /* Given the xtype and the fieldid, get the number of dimensions for |
---|
| 576 | * that field (scalars are 0). */ |
---|
| 577 | EXTERNL int |
---|
| 578 | nc_inq_compound_fieldndims(int ncid, nc_type xtype, int fieldid, |
---|
| 579 | int *ndimsp); |
---|
| 580 | |
---|
| 581 | /* Given the xtype and the fieldid, get the sizes of dimensions for |
---|
| 582 | * that field. User must have allocated storage for the dim_sizes. */ |
---|
| 583 | EXTERNL int |
---|
| 584 | nc_inq_compound_fielddim_sizes(int ncid, nc_type xtype, int fieldid, |
---|
| 585 | int *dim_sizes); |
---|
| 586 | |
---|
| 587 | /** This is the type of arrays of vlens. */ |
---|
| 588 | typedef struct { |
---|
| 589 | size_t len; /**< Length of VL data (in base type units) */ |
---|
| 590 | void *p; /**< Pointer to VL data */ |
---|
| 591 | } nc_vlen_t; |
---|
| 592 | |
---|
| 593 | /** Calculate an offset for creating a compound type. This calls a |
---|
| 594 | * mysterious C macro which was found carved into one of the blocks of |
---|
| 595 | * the Newgrange passage tomb in County Meath, Ireland. This code has |
---|
| 596 | * been carbon dated to 3200 B.C.E. */ |
---|
| 597 | #define NC_COMPOUND_OFFSET(S,M) (offsetof(S,M)) |
---|
| 598 | |
---|
| 599 | /* Create a variable length type. */ |
---|
| 600 | EXTERNL int |
---|
| 601 | nc_def_vlen(int ncid, const char *name, nc_type base_typeid, nc_type *xtypep); |
---|
| 602 | |
---|
| 603 | /* Find out about a vlen. */ |
---|
| 604 | EXTERNL int |
---|
| 605 | nc_inq_vlen(int ncid, nc_type xtype, char *name, size_t *datum_sizep, |
---|
| 606 | nc_type *base_nc_typep); |
---|
| 607 | |
---|
| 608 | /* When you read VLEN type the library will actually allocate the |
---|
| 609 | * storage space for the data. This storage space must be freed, so |
---|
| 610 | * pass the pointer back to this function, when you're done with the |
---|
| 611 | * data, and it will free the vlen memory. */ |
---|
| 612 | EXTERNL int |
---|
| 613 | nc_free_vlen(nc_vlen_t *vl); |
---|
| 614 | |
---|
| 615 | EXTERNL int |
---|
| 616 | nc_free_vlens(size_t len, nc_vlen_t vlens[]); |
---|
| 617 | |
---|
| 618 | /* Put or get one element in a vlen array. */ |
---|
| 619 | EXTERNL int |
---|
| 620 | nc_put_vlen_element(int ncid, int typeid1, void *vlen_element, |
---|
| 621 | size_t len, const void *data); |
---|
| 622 | |
---|
| 623 | EXTERNL int |
---|
| 624 | nc_get_vlen_element(int ncid, int typeid1, const void *vlen_element, |
---|
| 625 | size_t *len, void *data); |
---|
| 626 | |
---|
| 627 | /* When you read the string type the library will allocate the storage |
---|
| 628 | * space for the data. This storage space must be freed, so pass the |
---|
| 629 | * pointer back to this function, when you're done with the data, and |
---|
| 630 | * it will free the string memory. */ |
---|
| 631 | EXTERNL int |
---|
| 632 | nc_free_string(size_t len, char **data); |
---|
| 633 | |
---|
| 634 | /* Find out about a user defined type. */ |
---|
| 635 | EXTERNL int |
---|
| 636 | nc_inq_user_type(int ncid, nc_type xtype, char *name, size_t *size, |
---|
| 637 | nc_type *base_nc_typep, size_t *nfieldsp, int *classp); |
---|
| 638 | |
---|
| 639 | /* Write an attribute of any type. */ |
---|
| 640 | EXTERNL int |
---|
| 641 | nc_put_att(int ncid, int varid, const char *name, nc_type xtype, |
---|
| 642 | size_t len, const void *op); |
---|
| 643 | |
---|
| 644 | /* Read an attribute of any type. */ |
---|
| 645 | EXTERNL int |
---|
| 646 | nc_get_att(int ncid, int varid, const char *name, void *ip); |
---|
| 647 | |
---|
| 648 | /* Enum type. */ |
---|
| 649 | |
---|
| 650 | /* Create an enum type. Provide a base type and a name. At the moment |
---|
| 651 | * only ints are accepted as base types. */ |
---|
| 652 | EXTERNL int |
---|
| 653 | nc_def_enum(int ncid, nc_type base_typeid, const char *name, |
---|
| 654 | nc_type *typeidp); |
---|
| 655 | |
---|
| 656 | /* Insert a named value into an enum type. The value must fit within |
---|
| 657 | * the size of the enum type, the name size must be <= NC_MAX_NAME. */ |
---|
| 658 | EXTERNL int |
---|
| 659 | nc_insert_enum(int ncid, nc_type xtype, const char *name, |
---|
| 660 | const void *value); |
---|
| 661 | |
---|
| 662 | /* Get information about an enum type: its name, base type and the |
---|
| 663 | * number of members defined. */ |
---|
| 664 | EXTERNL int |
---|
| 665 | nc_inq_enum(int ncid, nc_type xtype, char *name, nc_type *base_nc_typep, |
---|
| 666 | size_t *base_sizep, size_t *num_membersp); |
---|
| 667 | |
---|
| 668 | /* Get information about an enum member: a name and value. Name size |
---|
| 669 | * will be <= NC_MAX_NAME. */ |
---|
| 670 | EXTERNL int |
---|
| 671 | nc_inq_enum_member(int ncid, nc_type xtype, int idx, char *name, |
---|
| 672 | void *value); |
---|
| 673 | |
---|
| 674 | |
---|
| 675 | /* Get enum name from enum value. Name size will be <= NC_MAX_NAME. */ |
---|
| 676 | EXTERNL int |
---|
| 677 | nc_inq_enum_ident(int ncid, nc_type xtype, long long value, char *identifier); |
---|
| 678 | |
---|
| 679 | /* Opaque type. */ |
---|
| 680 | |
---|
| 681 | /* Create an opaque type. Provide a size and a name. */ |
---|
| 682 | EXTERNL int |
---|
| 683 | nc_def_opaque(int ncid, size_t size, const char *name, nc_type *xtypep); |
---|
| 684 | |
---|
| 685 | /* Get information about an opaque type. */ |
---|
| 686 | EXTERNL int |
---|
| 687 | nc_inq_opaque(int ncid, nc_type xtype, char *name, size_t *sizep); |
---|
| 688 | |
---|
| 689 | /* Write entire var of any type. */ |
---|
| 690 | EXTERNL int |
---|
| 691 | nc_put_var(int ncid, int varid, const void *op); |
---|
| 692 | |
---|
| 693 | /* Read entire var of any type. */ |
---|
| 694 | EXTERNL int |
---|
| 695 | nc_get_var(int ncid, int varid, void *ip); |
---|
| 696 | |
---|
| 697 | /* Write one value. */ |
---|
| 698 | EXTERNL int |
---|
| 699 | nc_put_var1(int ncid, int varid, const size_t *indexp, |
---|
| 700 | const void *op); |
---|
| 701 | |
---|
| 702 | /* Read one value. */ |
---|
| 703 | EXTERNL int |
---|
| 704 | nc_get_var1(int ncid, int varid, const size_t *indexp, void *ip); |
---|
| 705 | |
---|
| 706 | /* Write an array of values. */ |
---|
| 707 | EXTERNL int |
---|
| 708 | nc_put_vara(int ncid, int varid, const size_t *startp, |
---|
| 709 | const size_t *countp, const void *op); |
---|
| 710 | |
---|
| 711 | /* Read an array of values. */ |
---|
| 712 | EXTERNL int |
---|
| 713 | nc_get_vara(int ncid, int varid, const size_t *startp, |
---|
| 714 | const size_t *countp, void *ip); |
---|
| 715 | |
---|
| 716 | /* Write slices of an array of values. */ |
---|
| 717 | EXTERNL int |
---|
| 718 | nc_put_vars(int ncid, int varid, const size_t *startp, |
---|
| 719 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 720 | const void *op); |
---|
| 721 | |
---|
| 722 | /* Read slices of an array of values. */ |
---|
| 723 | EXTERNL int |
---|
| 724 | nc_get_vars(int ncid, int varid, const size_t *startp, |
---|
| 725 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 726 | void *ip); |
---|
| 727 | |
---|
| 728 | /* Write mapped slices of an array of values. */ |
---|
| 729 | EXTERNL int |
---|
| 730 | nc_put_varm(int ncid, int varid, const size_t *startp, |
---|
| 731 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 732 | const ptrdiff_t *imapp, const void *op); |
---|
| 733 | |
---|
| 734 | /* Read mapped slices of an array of values. */ |
---|
| 735 | EXTERNL int |
---|
| 736 | nc_get_varm(int ncid, int varid, const size_t *startp, |
---|
| 737 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 738 | const ptrdiff_t *imapp, void *ip); |
---|
| 739 | |
---|
| 740 | /* Extra netcdf-4 stuff. */ |
---|
| 741 | |
---|
| 742 | /* Set compression settings for a variable. Lower is faster, higher is |
---|
| 743 | * better. Must be called after nc_def_var and before nc_enddef. */ |
---|
| 744 | EXTERNL int |
---|
| 745 | nc_def_var_deflate(int ncid, int varid, int shuffle, int deflate, |
---|
| 746 | int deflate_level); |
---|
| 747 | |
---|
| 748 | /* Find out compression settings of a var. */ |
---|
| 749 | EXTERNL int |
---|
| 750 | nc_inq_var_deflate(int ncid, int varid, int *shufflep, |
---|
| 751 | int *deflatep, int *deflate_levelp); |
---|
| 752 | |
---|
| 753 | /* Find out szip settings of a var. */ |
---|
| 754 | EXTERNL int |
---|
| 755 | nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp); |
---|
| 756 | |
---|
| 757 | /* Set fletcher32 checksum for a var. This must be done after nc_def_var |
---|
| 758 | and before nc_enddef. */ |
---|
| 759 | EXTERNL int |
---|
| 760 | nc_def_var_fletcher32(int ncid, int varid, int fletcher32); |
---|
| 761 | |
---|
| 762 | /* Inquire about fletcher32 checksum for a var. */ |
---|
| 763 | EXTERNL int |
---|
| 764 | nc_inq_var_fletcher32(int ncid, int varid, int *fletcher32p); |
---|
| 765 | |
---|
| 766 | /* Define chunking for a variable. This must be done after nc_def_var |
---|
| 767 | and before nc_enddef. */ |
---|
| 768 | EXTERNL int |
---|
| 769 | nc_def_var_chunking(int ncid, int varid, int storage, const size_t *chunksizesp); |
---|
| 770 | |
---|
| 771 | /* Inq chunking stuff for a var. */ |
---|
| 772 | EXTERNL int |
---|
| 773 | nc_inq_var_chunking(int ncid, int varid, int *storagep, size_t *chunksizesp); |
---|
| 774 | |
---|
| 775 | /* Define fill value behavior for a variable. This must be done after |
---|
| 776 | nc_def_var and before nc_enddef. */ |
---|
| 777 | EXTERNL int |
---|
| 778 | nc_def_var_fill(int ncid, int varid, int no_fill, const void *fill_value); |
---|
| 779 | |
---|
| 780 | /* Inq fill value setting for a var. */ |
---|
| 781 | EXTERNL int |
---|
| 782 | nc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep); |
---|
| 783 | |
---|
| 784 | /* Define the endianness of a variable. */ |
---|
| 785 | EXTERNL int |
---|
| 786 | nc_def_var_endian(int ncid, int varid, int endian); |
---|
| 787 | |
---|
| 788 | /* Learn about the endianness of a variable. */ |
---|
| 789 | EXTERNL int |
---|
| 790 | nc_inq_var_endian(int ncid, int varid, int *endianp); |
---|
| 791 | |
---|
| 792 | /* Set the fill mode (classic or 64-bit offset files only). */ |
---|
| 793 | EXTERNL int |
---|
| 794 | nc_set_fill(int ncid, int fillmode, int *old_modep); |
---|
| 795 | |
---|
| 796 | /* Set the default nc_create format to NC_FORMAT_CLASSIC, |
---|
| 797 | * NC_FORMAT_64BIT, NC_FORMAT_NETCDF4, NC_FORMAT_NETCDF4_CLASSIC. */ |
---|
| 798 | EXTERNL int |
---|
| 799 | nc_set_default_format(int format, int *old_formatp); |
---|
| 800 | |
---|
| 801 | /* Set the cache size, nelems, and preemption policy. */ |
---|
| 802 | EXTERNL int |
---|
| 803 | nc_set_chunk_cache(size_t size, size_t nelems, float preemption); |
---|
| 804 | |
---|
| 805 | /* Get the cache size, nelems, and preemption policy. */ |
---|
| 806 | EXTERNL int |
---|
| 807 | nc_get_chunk_cache(size_t *sizep, size_t *nelemsp, float *preemptionp); |
---|
| 808 | |
---|
| 809 | /* Set the per-variable cache size, nelems, and preemption policy. */ |
---|
| 810 | EXTERNL int |
---|
| 811 | nc_set_var_chunk_cache(int ncid, int varid, size_t size, size_t nelems, |
---|
| 812 | float preemption); |
---|
| 813 | |
---|
| 814 | /* Set the per-variable cache size, nelems, and preemption policy. */ |
---|
| 815 | EXTERNL int |
---|
| 816 | nc_get_var_chunk_cache(int ncid, int varid, size_t *sizep, size_t *nelemsp, |
---|
| 817 | float *preemptionp); |
---|
| 818 | |
---|
| 819 | EXTERNL int |
---|
| 820 | nc_redef(int ncid); |
---|
| 821 | |
---|
| 822 | EXTERNL int |
---|
| 823 | nc__enddef(int ncid, size_t h_minfree, size_t v_align, |
---|
| 824 | size_t v_minfree, size_t r_align); |
---|
| 825 | |
---|
| 826 | EXTERNL int |
---|
| 827 | nc_enddef(int ncid); |
---|
| 828 | |
---|
| 829 | EXTERNL int |
---|
| 830 | nc_sync(int ncid); |
---|
| 831 | |
---|
| 832 | EXTERNL int |
---|
| 833 | nc_abort(int ncid); |
---|
| 834 | |
---|
| 835 | EXTERNL int |
---|
| 836 | nc_close(int ncid); |
---|
| 837 | |
---|
| 838 | EXTERNL int |
---|
| 839 | nc_inq(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp); |
---|
| 840 | |
---|
| 841 | EXTERNL int |
---|
| 842 | nc_inq_ndims(int ncid, int *ndimsp); |
---|
| 843 | |
---|
| 844 | EXTERNL int |
---|
| 845 | nc_inq_nvars(int ncid, int *nvarsp); |
---|
| 846 | |
---|
| 847 | EXTERNL int |
---|
| 848 | nc_inq_natts(int ncid, int *nattsp); |
---|
| 849 | |
---|
| 850 | EXTERNL int |
---|
| 851 | nc_inq_unlimdim(int ncid, int *unlimdimidp); |
---|
| 852 | |
---|
| 853 | /* The next function is for NetCDF-4 only */ |
---|
| 854 | EXTERNL int |
---|
| 855 | nc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp); |
---|
| 856 | |
---|
| 857 | /* Added in 3.6.1 to return format of netCDF file. */ |
---|
| 858 | EXTERNL int |
---|
| 859 | nc_inq_format(int ncid, int *formatp); |
---|
| 860 | |
---|
| 861 | /* Begin _dim */ |
---|
| 862 | |
---|
| 863 | EXTERNL int |
---|
| 864 | nc_def_dim(int ncid, const char *name, size_t len, int *idp); |
---|
| 865 | |
---|
| 866 | EXTERNL int |
---|
| 867 | nc_inq_dimid(int ncid, const char *name, int *idp); |
---|
| 868 | |
---|
| 869 | EXTERNL int |
---|
| 870 | nc_inq_dim(int ncid, int dimid, char *name, size_t *lenp); |
---|
| 871 | |
---|
| 872 | EXTERNL int |
---|
| 873 | nc_inq_dimname(int ncid, int dimid, char *name); |
---|
| 874 | |
---|
| 875 | EXTERNL int |
---|
| 876 | nc_inq_dimlen(int ncid, int dimid, size_t *lenp); |
---|
| 877 | |
---|
| 878 | EXTERNL int |
---|
| 879 | nc_rename_dim(int ncid, int dimid, const char *name); |
---|
| 880 | |
---|
| 881 | /* End _dim */ |
---|
| 882 | /* Begin _att */ |
---|
| 883 | |
---|
| 884 | EXTERNL int |
---|
| 885 | nc_inq_att(int ncid, int varid, const char *name, |
---|
| 886 | nc_type *xtypep, size_t *lenp); |
---|
| 887 | |
---|
| 888 | EXTERNL int |
---|
| 889 | nc_inq_attid(int ncid, int varid, const char *name, int *idp); |
---|
| 890 | |
---|
| 891 | EXTERNL int |
---|
| 892 | nc_inq_atttype(int ncid, int varid, const char *name, nc_type *xtypep); |
---|
| 893 | |
---|
| 894 | EXTERNL int |
---|
| 895 | nc_inq_attlen(int ncid, int varid, const char *name, size_t *lenp); |
---|
| 896 | |
---|
| 897 | EXTERNL int |
---|
| 898 | nc_inq_attname(int ncid, int varid, int attnum, char *name); |
---|
| 899 | |
---|
| 900 | EXTERNL int |
---|
| 901 | nc_copy_att(int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out); |
---|
| 902 | |
---|
| 903 | EXTERNL int |
---|
| 904 | nc_rename_att(int ncid, int varid, const char *name, const char *newname); |
---|
| 905 | |
---|
| 906 | EXTERNL int |
---|
| 907 | nc_del_att(int ncid, int varid, const char *name); |
---|
| 908 | |
---|
| 909 | /* End _att */ |
---|
| 910 | /* Begin {put,get}_att */ |
---|
| 911 | |
---|
| 912 | EXTERNL int |
---|
| 913 | nc_put_att_text(int ncid, int varid, const char *name, |
---|
| 914 | size_t len, const char *op); |
---|
| 915 | |
---|
| 916 | EXTERNL int |
---|
| 917 | nc_get_att_text(int ncid, int varid, const char *name, char *ip); |
---|
| 918 | |
---|
| 919 | EXTERNL int |
---|
| 920 | nc_put_att_uchar(int ncid, int varid, const char *name, nc_type xtype, |
---|
| 921 | size_t len, const unsigned char *op); |
---|
| 922 | |
---|
| 923 | EXTERNL int |
---|
| 924 | nc_get_att_uchar(int ncid, int varid, const char *name, unsigned char *ip); |
---|
| 925 | |
---|
| 926 | EXTERNL int |
---|
| 927 | nc_put_att_schar(int ncid, int varid, const char *name, nc_type xtype, |
---|
| 928 | size_t len, const signed char *op); |
---|
| 929 | |
---|
| 930 | EXTERNL int |
---|
| 931 | nc_get_att_schar(int ncid, int varid, const char *name, signed char *ip); |
---|
| 932 | |
---|
| 933 | EXTERNL int |
---|
| 934 | nc_put_att_short(int ncid, int varid, const char *name, nc_type xtype, |
---|
| 935 | size_t len, const short *op); |
---|
| 936 | |
---|
| 937 | EXTERNL int |
---|
| 938 | nc_get_att_short(int ncid, int varid, const char *name, short *ip); |
---|
| 939 | |
---|
| 940 | EXTERNL int |
---|
| 941 | nc_put_att_int(int ncid, int varid, const char *name, nc_type xtype, |
---|
| 942 | size_t len, const int *op); |
---|
| 943 | |
---|
| 944 | EXTERNL int |
---|
| 945 | nc_get_att_int(int ncid, int varid, const char *name, int *ip); |
---|
| 946 | |
---|
| 947 | EXTERNL int |
---|
| 948 | nc_put_att_long(int ncid, int varid, const char *name, nc_type xtype, |
---|
| 949 | size_t len, const long *op); |
---|
| 950 | |
---|
| 951 | EXTERNL int |
---|
| 952 | nc_get_att_long(int ncid, int varid, const char *name, long *ip); |
---|
| 953 | |
---|
| 954 | EXTERNL int |
---|
| 955 | nc_put_att_float(int ncid, int varid, const char *name, nc_type xtype, |
---|
| 956 | size_t len, const float *op); |
---|
| 957 | |
---|
| 958 | EXTERNL int |
---|
| 959 | nc_get_att_float(int ncid, int varid, const char *name, float *ip); |
---|
| 960 | |
---|
| 961 | EXTERNL int |
---|
| 962 | nc_put_att_double(int ncid, int varid, const char *name, nc_type xtype, |
---|
| 963 | size_t len, const double *op); |
---|
| 964 | |
---|
| 965 | EXTERNL int |
---|
| 966 | nc_get_att_double(int ncid, int varid, const char *name, double *ip); |
---|
| 967 | |
---|
| 968 | EXTERNL int |
---|
| 969 | nc_put_att_ushort(int ncid, int varid, const char *name, nc_type xtype, |
---|
| 970 | size_t len, const unsigned short *op); |
---|
| 971 | |
---|
| 972 | EXTERNL int |
---|
| 973 | nc_get_att_ushort(int ncid, int varid, const char *name, unsigned short *ip); |
---|
| 974 | |
---|
| 975 | EXTERNL int |
---|
| 976 | nc_put_att_uint(int ncid, int varid, const char *name, nc_type xtype, |
---|
| 977 | size_t len, const unsigned int *op); |
---|
| 978 | |
---|
| 979 | EXTERNL int |
---|
| 980 | nc_get_att_uint(int ncid, int varid, const char *name, unsigned int *ip); |
---|
| 981 | |
---|
| 982 | EXTERNL int |
---|
| 983 | nc_put_att_longlong(int ncid, int varid, const char *name, nc_type xtype, |
---|
| 984 | size_t len, const long long *op); |
---|
| 985 | |
---|
| 986 | EXTERNL int |
---|
| 987 | nc_get_att_longlong(int ncid, int varid, const char *name, long long *ip); |
---|
| 988 | |
---|
| 989 | EXTERNL int |
---|
| 990 | nc_put_att_ulonglong(int ncid, int varid, const char *name, nc_type xtype, |
---|
| 991 | size_t len, const unsigned long long *op); |
---|
| 992 | |
---|
| 993 | EXTERNL int |
---|
| 994 | nc_get_att_ulonglong(int ncid, int varid, const char *name, |
---|
| 995 | unsigned long long *ip); |
---|
| 996 | |
---|
| 997 | EXTERNL int |
---|
| 998 | nc_put_att_string(int ncid, int varid, const char *name, |
---|
| 999 | size_t len, const char **op); |
---|
| 1000 | |
---|
| 1001 | EXTERNL int |
---|
| 1002 | nc_get_att_string(int ncid, int varid, const char *name, char **ip); |
---|
| 1003 | |
---|
| 1004 | /* End {put,get}_att */ |
---|
| 1005 | /* Begin _var */ |
---|
| 1006 | |
---|
| 1007 | EXTERNL int |
---|
| 1008 | nc_def_var(int ncid, const char *name, nc_type xtype, int ndims, |
---|
| 1009 | const int *dimidsp, int *varidp); |
---|
| 1010 | |
---|
| 1011 | EXTERNL int |
---|
| 1012 | nc_inq_var(int ncid, int varid, char *name, nc_type *xtypep, |
---|
| 1013 | int *ndimsp, int *dimidsp, int *nattsp); |
---|
| 1014 | |
---|
| 1015 | EXTERNL int |
---|
| 1016 | nc_inq_varid(int ncid, const char *name, int *varidp); |
---|
| 1017 | |
---|
| 1018 | EXTERNL int |
---|
| 1019 | nc_inq_varname(int ncid, int varid, char *name); |
---|
| 1020 | |
---|
| 1021 | EXTERNL int |
---|
| 1022 | nc_inq_vartype(int ncid, int varid, nc_type *xtypep); |
---|
| 1023 | |
---|
| 1024 | EXTERNL int |
---|
| 1025 | nc_inq_varndims(int ncid, int varid, int *ndimsp); |
---|
| 1026 | |
---|
| 1027 | EXTERNL int |
---|
| 1028 | nc_inq_vardimid(int ncid, int varid, int *dimidsp); |
---|
| 1029 | |
---|
| 1030 | EXTERNL int |
---|
| 1031 | nc_inq_varnatts(int ncid, int varid, int *nattsp); |
---|
| 1032 | |
---|
| 1033 | EXTERNL int |
---|
| 1034 | nc_rename_var(int ncid, int varid, const char *name); |
---|
| 1035 | |
---|
| 1036 | EXTERNL int |
---|
| 1037 | nc_copy_var(int ncid_in, int varid, int ncid_out); |
---|
| 1038 | |
---|
| 1039 | #ifndef ncvarcpy |
---|
| 1040 | /* support the old name for now */ |
---|
| 1041 | #define ncvarcpy(ncid_in, varid, ncid_out) ncvarcopy((ncid_in), (varid), (ncid_out)) |
---|
| 1042 | #endif |
---|
| 1043 | |
---|
| 1044 | /* End _var */ |
---|
| 1045 | /* Begin {put,get}_var1 */ |
---|
| 1046 | |
---|
| 1047 | EXTERNL int |
---|
| 1048 | nc_put_var1_text(int ncid, int varid, const size_t *indexp, const char *op); |
---|
| 1049 | |
---|
| 1050 | EXTERNL int |
---|
| 1051 | nc_get_var1_text(int ncid, int varid, const size_t *indexp, char *ip); |
---|
| 1052 | |
---|
| 1053 | EXTERNL int |
---|
| 1054 | nc_put_var1_uchar(int ncid, int varid, const size_t *indexp, |
---|
| 1055 | const unsigned char *op); |
---|
| 1056 | |
---|
| 1057 | EXTERNL int |
---|
| 1058 | nc_get_var1_uchar(int ncid, int varid, const size_t *indexp, |
---|
| 1059 | unsigned char *ip); |
---|
| 1060 | |
---|
| 1061 | EXTERNL int |
---|
| 1062 | nc_put_var1_schar(int ncid, int varid, const size_t *indexp, |
---|
| 1063 | const signed char *op); |
---|
| 1064 | |
---|
| 1065 | EXTERNL int |
---|
| 1066 | nc_get_var1_schar(int ncid, int varid, const size_t *indexp, |
---|
| 1067 | signed char *ip); |
---|
| 1068 | |
---|
| 1069 | EXTERNL int |
---|
| 1070 | nc_put_var1_short(int ncid, int varid, const size_t *indexp, |
---|
| 1071 | const short *op); |
---|
| 1072 | |
---|
| 1073 | EXTERNL int |
---|
| 1074 | nc_get_var1_short(int ncid, int varid, const size_t *indexp, |
---|
| 1075 | short *ip); |
---|
| 1076 | |
---|
| 1077 | EXTERNL int |
---|
| 1078 | nc_put_var1_int(int ncid, int varid, const size_t *indexp, const int *op); |
---|
| 1079 | |
---|
| 1080 | EXTERNL int |
---|
| 1081 | nc_get_var1_int(int ncid, int varid, const size_t *indexp, int *ip); |
---|
| 1082 | |
---|
| 1083 | EXTERNL int |
---|
| 1084 | nc_put_var1_long(int ncid, int varid, const size_t *indexp, const long *op); |
---|
| 1085 | |
---|
| 1086 | EXTERNL int |
---|
| 1087 | nc_get_var1_long(int ncid, int varid, const size_t *indexp, long *ip); |
---|
| 1088 | |
---|
| 1089 | EXTERNL int |
---|
| 1090 | nc_put_var1_float(int ncid, int varid, const size_t *indexp, const float *op); |
---|
| 1091 | |
---|
| 1092 | EXTERNL int |
---|
| 1093 | nc_get_var1_float(int ncid, int varid, const size_t *indexp, float *ip); |
---|
| 1094 | |
---|
| 1095 | EXTERNL int |
---|
| 1096 | nc_put_var1_double(int ncid, int varid, const size_t *indexp, const double *op); |
---|
| 1097 | |
---|
| 1098 | EXTERNL int |
---|
| 1099 | nc_get_var1_double(int ncid, int varid, const size_t *indexp, double *ip); |
---|
| 1100 | |
---|
| 1101 | EXTERNL int |
---|
| 1102 | nc_put_var1_ushort(int ncid, int varid, const size_t *indexp, |
---|
| 1103 | const unsigned short *op); |
---|
| 1104 | |
---|
| 1105 | EXTERNL int |
---|
| 1106 | nc_get_var1_ushort(int ncid, int varid, const size_t *indexp, |
---|
| 1107 | unsigned short *ip); |
---|
| 1108 | |
---|
| 1109 | EXTERNL int |
---|
| 1110 | nc_put_var1_uint(int ncid, int varid, const size_t *indexp, |
---|
| 1111 | const unsigned int *op); |
---|
| 1112 | |
---|
| 1113 | EXTERNL int |
---|
| 1114 | nc_get_var1_uint(int ncid, int varid, const size_t *indexp, |
---|
| 1115 | unsigned int *ip); |
---|
| 1116 | |
---|
| 1117 | EXTERNL int |
---|
| 1118 | nc_put_var1_longlong(int ncid, int varid, const size_t *indexp, |
---|
| 1119 | const long long *op); |
---|
| 1120 | |
---|
| 1121 | EXTERNL int |
---|
| 1122 | nc_get_var1_longlong(int ncid, int varid, const size_t *indexp, |
---|
| 1123 | long long *ip); |
---|
| 1124 | |
---|
| 1125 | EXTERNL int |
---|
| 1126 | nc_put_var1_ulonglong(int ncid, int varid, const size_t *indexp, |
---|
| 1127 | const unsigned long long *op); |
---|
| 1128 | |
---|
| 1129 | EXTERNL int |
---|
| 1130 | nc_get_var1_ulonglong(int ncid, int varid, const size_t *indexp, |
---|
| 1131 | unsigned long long *ip); |
---|
| 1132 | |
---|
| 1133 | EXTERNL int |
---|
| 1134 | nc_put_var1_string(int ncid, int varid, const size_t *indexp, |
---|
| 1135 | const char **op); |
---|
| 1136 | |
---|
| 1137 | EXTERNL int |
---|
| 1138 | nc_get_var1_string(int ncid, int varid, const size_t *indexp, |
---|
| 1139 | char **ip); |
---|
| 1140 | |
---|
| 1141 | /* End {put,get}_var1 */ |
---|
| 1142 | /* Begin {put,get}_vara */ |
---|
| 1143 | |
---|
| 1144 | EXTERNL int |
---|
| 1145 | nc_put_vara_text(int ncid, int varid, const size_t *startp, |
---|
| 1146 | const size_t *countp, const char *op); |
---|
| 1147 | |
---|
| 1148 | EXTERNL int |
---|
| 1149 | nc_get_vara_text(int ncid, int varid, const size_t *startp, |
---|
| 1150 | const size_t *countp, char *ip); |
---|
| 1151 | |
---|
| 1152 | EXTERNL int |
---|
| 1153 | nc_put_vara_uchar(int ncid, int varid, const size_t *startp, |
---|
| 1154 | const size_t *countp, const unsigned char *op); |
---|
| 1155 | |
---|
| 1156 | EXTERNL int |
---|
| 1157 | nc_get_vara_uchar(int ncid, int varid, const size_t *startp, |
---|
| 1158 | const size_t *countp, unsigned char *ip); |
---|
| 1159 | |
---|
| 1160 | EXTERNL int |
---|
| 1161 | nc_put_vara_schar(int ncid, int varid, const size_t *startp, |
---|
| 1162 | const size_t *countp, const signed char *op); |
---|
| 1163 | |
---|
| 1164 | EXTERNL int |
---|
| 1165 | nc_get_vara_schar(int ncid, int varid, const size_t *startp, |
---|
| 1166 | const size_t *countp, signed char *ip); |
---|
| 1167 | |
---|
| 1168 | EXTERNL int |
---|
| 1169 | nc_put_vara_short(int ncid, int varid, const size_t *startp, |
---|
| 1170 | const size_t *countp, const short *op); |
---|
| 1171 | |
---|
| 1172 | EXTERNL int |
---|
| 1173 | nc_get_vara_short(int ncid, int varid, const size_t *startp, |
---|
| 1174 | const size_t *countp, short *ip); |
---|
| 1175 | |
---|
| 1176 | EXTERNL int |
---|
| 1177 | nc_put_vara_int(int ncid, int varid, const size_t *startp, |
---|
| 1178 | const size_t *countp, const int *op); |
---|
| 1179 | |
---|
| 1180 | EXTERNL int |
---|
| 1181 | nc_get_vara_int(int ncid, int varid, const size_t *startp, |
---|
| 1182 | const size_t *countp, int *ip); |
---|
| 1183 | |
---|
| 1184 | EXTERNL int |
---|
| 1185 | nc_put_vara_long(int ncid, int varid, const size_t *startp, |
---|
| 1186 | const size_t *countp, const long *op); |
---|
| 1187 | |
---|
| 1188 | EXTERNL int |
---|
| 1189 | nc_get_vara_long(int ncid, int varid, |
---|
| 1190 | const size_t *startp, const size_t *countp, long *ip); |
---|
| 1191 | |
---|
| 1192 | EXTERNL int |
---|
| 1193 | nc_put_vara_float(int ncid, int varid, |
---|
| 1194 | const size_t *startp, const size_t *countp, const float *op); |
---|
| 1195 | |
---|
| 1196 | EXTERNL int |
---|
| 1197 | nc_get_vara_float(int ncid, int varid, |
---|
| 1198 | const size_t *startp, const size_t *countp, float *ip); |
---|
| 1199 | |
---|
| 1200 | EXTERNL int |
---|
| 1201 | nc_put_vara_double(int ncid, int varid, const size_t *startp, |
---|
| 1202 | const size_t *countp, const double *op); |
---|
| 1203 | |
---|
| 1204 | EXTERNL int |
---|
| 1205 | nc_get_vara_double(int ncid, int varid, const size_t *startp, |
---|
| 1206 | const size_t *countp, double *ip); |
---|
| 1207 | |
---|
| 1208 | EXTERNL int |
---|
| 1209 | nc_put_vara_ushort(int ncid, int varid, const size_t *startp, |
---|
| 1210 | const size_t *countp, const unsigned short *op); |
---|
| 1211 | |
---|
| 1212 | EXTERNL int |
---|
| 1213 | nc_get_vara_ushort(int ncid, int varid, const size_t *startp, |
---|
| 1214 | const size_t *countp, unsigned short *ip); |
---|
| 1215 | |
---|
| 1216 | EXTERNL int |
---|
| 1217 | nc_put_vara_uint(int ncid, int varid, const size_t *startp, |
---|
| 1218 | const size_t *countp, const unsigned int *op); |
---|
| 1219 | |
---|
| 1220 | EXTERNL int |
---|
| 1221 | nc_get_vara_uint(int ncid, int varid, const size_t *startp, |
---|
| 1222 | const size_t *countp, unsigned int *ip); |
---|
| 1223 | |
---|
| 1224 | EXTERNL int |
---|
| 1225 | nc_put_vara_longlong(int ncid, int varid, const size_t *startp, |
---|
| 1226 | const size_t *countp, const long long *op); |
---|
| 1227 | |
---|
| 1228 | EXTERNL int |
---|
| 1229 | nc_get_vara_longlong(int ncid, int varid, const size_t *startp, |
---|
| 1230 | const size_t *countp, long long *ip); |
---|
| 1231 | |
---|
| 1232 | EXTERNL int |
---|
| 1233 | nc_put_vara_ulonglong(int ncid, int varid, const size_t *startp, |
---|
| 1234 | const size_t *countp, const unsigned long long *op); |
---|
| 1235 | |
---|
| 1236 | EXTERNL int |
---|
| 1237 | nc_get_vara_ulonglong(int ncid, int varid, const size_t *startp, |
---|
| 1238 | const size_t *countp, unsigned long long *ip); |
---|
| 1239 | |
---|
| 1240 | EXTERNL int |
---|
| 1241 | nc_put_vara_string(int ncid, int varid, const size_t *startp, |
---|
| 1242 | const size_t *countp, const char **op); |
---|
| 1243 | |
---|
| 1244 | EXTERNL int |
---|
| 1245 | nc_get_vara_string(int ncid, int varid, const size_t *startp, |
---|
| 1246 | const size_t *countp, char **ip); |
---|
| 1247 | |
---|
| 1248 | /* End {put,get}_vara */ |
---|
| 1249 | /* Begin {put,get}_vars */ |
---|
| 1250 | |
---|
| 1251 | EXTERNL int |
---|
| 1252 | nc_put_vars_text(int ncid, int varid, |
---|
| 1253 | const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1254 | const char *op); |
---|
| 1255 | |
---|
| 1256 | EXTERNL int |
---|
| 1257 | nc_get_vars_text(int ncid, int varid, |
---|
| 1258 | const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1259 | char *ip); |
---|
| 1260 | |
---|
| 1261 | EXTERNL int |
---|
| 1262 | nc_put_vars_uchar(int ncid, int varid, |
---|
| 1263 | const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1264 | const unsigned char *op); |
---|
| 1265 | |
---|
| 1266 | EXTERNL int |
---|
| 1267 | nc_get_vars_uchar(int ncid, int varid, |
---|
| 1268 | const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1269 | unsigned char *ip); |
---|
| 1270 | |
---|
| 1271 | EXTERNL int |
---|
| 1272 | nc_put_vars_schar(int ncid, int varid, |
---|
| 1273 | const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1274 | const signed char *op); |
---|
| 1275 | |
---|
| 1276 | EXTERNL int |
---|
| 1277 | nc_get_vars_schar(int ncid, int varid, |
---|
| 1278 | const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1279 | signed char *ip); |
---|
| 1280 | |
---|
| 1281 | EXTERNL int |
---|
| 1282 | nc_put_vars_short(int ncid, int varid, |
---|
| 1283 | const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1284 | const short *op); |
---|
| 1285 | |
---|
| 1286 | EXTERNL int |
---|
| 1287 | nc_get_vars_short(int ncid, int varid, const size_t *startp, |
---|
| 1288 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1289 | short *ip); |
---|
| 1290 | |
---|
| 1291 | EXTERNL int |
---|
| 1292 | nc_put_vars_int(int ncid, int varid, |
---|
| 1293 | const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1294 | const int *op); |
---|
| 1295 | |
---|
| 1296 | EXTERNL int |
---|
| 1297 | nc_get_vars_int(int ncid, int varid, |
---|
| 1298 | const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1299 | int *ip); |
---|
| 1300 | |
---|
| 1301 | EXTERNL int |
---|
| 1302 | nc_put_vars_long(int ncid, int varid, |
---|
| 1303 | const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1304 | const long *op); |
---|
| 1305 | |
---|
| 1306 | EXTERNL int |
---|
| 1307 | nc_get_vars_long(int ncid, int varid, |
---|
| 1308 | const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1309 | long *ip); |
---|
| 1310 | |
---|
| 1311 | EXTERNL int |
---|
| 1312 | nc_put_vars_float(int ncid, int varid, |
---|
| 1313 | const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1314 | const float *op); |
---|
| 1315 | |
---|
| 1316 | EXTERNL int |
---|
| 1317 | nc_get_vars_float(int ncid, int varid, |
---|
| 1318 | const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1319 | float *ip); |
---|
| 1320 | |
---|
| 1321 | EXTERNL int |
---|
| 1322 | nc_put_vars_double(int ncid, int varid, |
---|
| 1323 | const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1324 | const double *op); |
---|
| 1325 | |
---|
| 1326 | EXTERNL int |
---|
| 1327 | nc_get_vars_double(int ncid, int varid, const size_t *startp, |
---|
| 1328 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1329 | double *ip); |
---|
| 1330 | |
---|
| 1331 | EXTERNL int |
---|
| 1332 | nc_put_vars_ushort(int ncid, int varid, const size_t *startp, |
---|
| 1333 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1334 | const unsigned short *op); |
---|
| 1335 | |
---|
| 1336 | EXTERNL int |
---|
| 1337 | nc_get_vars_ushort(int ncid, int varid, const size_t *startp, |
---|
| 1338 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1339 | unsigned short *ip); |
---|
| 1340 | |
---|
| 1341 | EXTERNL int |
---|
| 1342 | nc_put_vars_uint(int ncid, int varid, const size_t *startp, |
---|
| 1343 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1344 | const unsigned int *op); |
---|
| 1345 | |
---|
| 1346 | EXTERNL int |
---|
| 1347 | nc_get_vars_uint(int ncid, int varid, const size_t *startp, |
---|
| 1348 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1349 | unsigned int *ip); |
---|
| 1350 | |
---|
| 1351 | EXTERNL int |
---|
| 1352 | nc_put_vars_longlong(int ncid, int varid, const size_t *startp, |
---|
| 1353 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1354 | const long long *op); |
---|
| 1355 | |
---|
| 1356 | EXTERNL int |
---|
| 1357 | nc_get_vars_longlong(int ncid, int varid, const size_t *startp, |
---|
| 1358 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1359 | long long *ip); |
---|
| 1360 | |
---|
| 1361 | EXTERNL int |
---|
| 1362 | nc_put_vars_ulonglong(int ncid, int varid, const size_t *startp, |
---|
| 1363 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1364 | const unsigned long long *op); |
---|
| 1365 | |
---|
| 1366 | EXTERNL int |
---|
| 1367 | nc_get_vars_ulonglong(int ncid, int varid, const size_t *startp, |
---|
| 1368 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1369 | unsigned long long *ip); |
---|
| 1370 | |
---|
| 1371 | EXTERNL int |
---|
| 1372 | nc_put_vars_string(int ncid, int varid, const size_t *startp, |
---|
| 1373 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1374 | const char **op); |
---|
| 1375 | |
---|
| 1376 | EXTERNL int |
---|
| 1377 | nc_get_vars_string(int ncid, int varid, const size_t *startp, |
---|
| 1378 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1379 | char **ip); |
---|
| 1380 | |
---|
| 1381 | /* End {put,get}_vars */ |
---|
| 1382 | /* Begin {put,get}_varm */ |
---|
| 1383 | |
---|
| 1384 | EXTERNL int |
---|
| 1385 | nc_put_varm_text(int ncid, int varid, const size_t *startp, |
---|
| 1386 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1387 | const ptrdiff_t *imapp, const char *op); |
---|
| 1388 | |
---|
| 1389 | EXTERNL int |
---|
| 1390 | nc_get_varm_text(int ncid, int varid, const size_t *startp, |
---|
| 1391 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1392 | const ptrdiff_t *imapp, char *ip); |
---|
| 1393 | |
---|
| 1394 | EXTERNL int |
---|
| 1395 | nc_put_varm_uchar(int ncid, int varid, const size_t *startp, |
---|
| 1396 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1397 | const ptrdiff_t *imapp, const unsigned char *op); |
---|
| 1398 | |
---|
| 1399 | EXTERNL int |
---|
| 1400 | nc_get_varm_uchar(int ncid, int varid, const size_t *startp, |
---|
| 1401 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1402 | const ptrdiff_t *imapp, unsigned char *ip); |
---|
| 1403 | |
---|
| 1404 | EXTERNL int |
---|
| 1405 | nc_put_varm_schar(int ncid, int varid, const size_t *startp, |
---|
| 1406 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1407 | const ptrdiff_t *imapp, const signed char *op); |
---|
| 1408 | |
---|
| 1409 | EXTERNL int |
---|
| 1410 | nc_get_varm_schar(int ncid, int varid, const size_t *startp, |
---|
| 1411 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1412 | const ptrdiff_t *imapp, signed char *ip); |
---|
| 1413 | |
---|
| 1414 | EXTERNL int |
---|
| 1415 | nc_put_varm_short(int ncid, int varid, const size_t *startp, |
---|
| 1416 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1417 | const ptrdiff_t *imapp, const short *op); |
---|
| 1418 | |
---|
| 1419 | EXTERNL int |
---|
| 1420 | nc_get_varm_short(int ncid, int varid, const size_t *startp, |
---|
| 1421 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1422 | const ptrdiff_t *imapp, short *ip); |
---|
| 1423 | |
---|
| 1424 | EXTERNL int |
---|
| 1425 | nc_put_varm_int(int ncid, int varid, const size_t *startp, |
---|
| 1426 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1427 | const ptrdiff_t *imapp, const int *op); |
---|
| 1428 | |
---|
| 1429 | EXTERNL int |
---|
| 1430 | nc_get_varm_int(int ncid, int varid, const size_t *startp, |
---|
| 1431 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1432 | const ptrdiff_t *imapp, int *ip); |
---|
| 1433 | |
---|
| 1434 | EXTERNL int |
---|
| 1435 | nc_put_varm_long(int ncid, int varid, const size_t *startp, |
---|
| 1436 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1437 | const ptrdiff_t *imapp, const long *op); |
---|
| 1438 | |
---|
| 1439 | EXTERNL int |
---|
| 1440 | nc_get_varm_long(int ncid, int varid, const size_t *startp, |
---|
| 1441 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1442 | const ptrdiff_t *imapp, long *ip); |
---|
| 1443 | |
---|
| 1444 | EXTERNL int |
---|
| 1445 | nc_put_varm_float(int ncid, int varid,const size_t *startp, |
---|
| 1446 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1447 | const ptrdiff_t *imapp, const float *op); |
---|
| 1448 | |
---|
| 1449 | EXTERNL int |
---|
| 1450 | nc_get_varm_float(int ncid, int varid,const size_t *startp, |
---|
| 1451 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1452 | const ptrdiff_t *imapp, float *ip); |
---|
| 1453 | |
---|
| 1454 | EXTERNL int |
---|
| 1455 | nc_put_varm_double(int ncid, int varid, const size_t *startp, |
---|
| 1456 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1457 | const ptrdiff_t *imapp, const double *op); |
---|
| 1458 | |
---|
| 1459 | EXTERNL int |
---|
| 1460 | nc_get_varm_double(int ncid, int varid, const size_t *startp, |
---|
| 1461 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1462 | const ptrdiff_t * imapp, double *ip); |
---|
| 1463 | |
---|
| 1464 | EXTERNL int |
---|
| 1465 | nc_put_varm_ushort(int ncid, int varid, const size_t *startp, |
---|
| 1466 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1467 | const ptrdiff_t * imapp, const unsigned short *op); |
---|
| 1468 | |
---|
| 1469 | EXTERNL int |
---|
| 1470 | nc_get_varm_ushort(int ncid, int varid, const size_t *startp, |
---|
| 1471 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1472 | const ptrdiff_t * imapp, unsigned short *ip); |
---|
| 1473 | |
---|
| 1474 | EXTERNL int |
---|
| 1475 | nc_put_varm_uint(int ncid, int varid, const size_t *startp, |
---|
| 1476 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1477 | const ptrdiff_t * imapp, const unsigned int *op); |
---|
| 1478 | |
---|
| 1479 | EXTERNL int |
---|
| 1480 | nc_get_varm_uint(int ncid, int varid, const size_t *startp, |
---|
| 1481 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1482 | const ptrdiff_t * imapp, unsigned int *ip); |
---|
| 1483 | |
---|
| 1484 | EXTERNL int |
---|
| 1485 | nc_put_varm_longlong(int ncid, int varid, const size_t *startp, |
---|
| 1486 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1487 | const ptrdiff_t * imapp, const long long *op); |
---|
| 1488 | |
---|
| 1489 | EXTERNL int |
---|
| 1490 | nc_get_varm_longlong(int ncid, int varid, const size_t *startp, |
---|
| 1491 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1492 | const ptrdiff_t * imapp, long long *ip); |
---|
| 1493 | |
---|
| 1494 | EXTERNL int |
---|
| 1495 | nc_put_varm_ulonglong(int ncid, int varid, const size_t *startp, |
---|
| 1496 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1497 | const ptrdiff_t * imapp, const unsigned long long *op); |
---|
| 1498 | |
---|
| 1499 | EXTERNL int |
---|
| 1500 | nc_get_varm_ulonglong(int ncid, int varid, const size_t *startp, |
---|
| 1501 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1502 | const ptrdiff_t * imapp, unsigned long long *ip); |
---|
| 1503 | |
---|
| 1504 | EXTERNL int |
---|
| 1505 | nc_put_varm_string(int ncid, int varid, const size_t *startp, |
---|
| 1506 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1507 | const ptrdiff_t * imapp, const char **op); |
---|
| 1508 | |
---|
| 1509 | EXTERNL int |
---|
| 1510 | nc_get_varm_string(int ncid, int varid, const size_t *startp, |
---|
| 1511 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1512 | const ptrdiff_t * imapp, char **ip); |
---|
| 1513 | |
---|
| 1514 | /* End {put,get}_varm */ |
---|
| 1515 | /* Begin {put,get}_var */ |
---|
| 1516 | |
---|
| 1517 | EXTERNL int |
---|
| 1518 | nc_put_var_text(int ncid, int varid, const char *op); |
---|
| 1519 | |
---|
| 1520 | EXTERNL int |
---|
| 1521 | nc_get_var_text(int ncid, int varid, char *ip); |
---|
| 1522 | |
---|
| 1523 | EXTERNL int |
---|
| 1524 | nc_put_var_uchar(int ncid, int varid, const unsigned char *op); |
---|
| 1525 | |
---|
| 1526 | EXTERNL int |
---|
| 1527 | nc_get_var_uchar(int ncid, int varid, unsigned char *ip); |
---|
| 1528 | |
---|
| 1529 | EXTERNL int |
---|
| 1530 | nc_put_var_schar(int ncid, int varid, const signed char *op); |
---|
| 1531 | |
---|
| 1532 | EXTERNL int |
---|
| 1533 | nc_get_var_schar(int ncid, int varid, signed char *ip); |
---|
| 1534 | |
---|
| 1535 | EXTERNL int |
---|
| 1536 | nc_put_var_short(int ncid, int varid, const short *op); |
---|
| 1537 | |
---|
| 1538 | EXTERNL int |
---|
| 1539 | nc_get_var_short(int ncid, int varid, short *ip); |
---|
| 1540 | |
---|
| 1541 | EXTERNL int |
---|
| 1542 | nc_put_var_int(int ncid, int varid, const int *op); |
---|
| 1543 | |
---|
| 1544 | EXTERNL int |
---|
| 1545 | nc_get_var_int(int ncid, int varid, int *ip); |
---|
| 1546 | |
---|
| 1547 | EXTERNL int |
---|
| 1548 | nc_put_var_long(int ncid, int varid, const long *op); |
---|
| 1549 | |
---|
| 1550 | EXTERNL int |
---|
| 1551 | nc_get_var_long(int ncid, int varid, long *ip); |
---|
| 1552 | |
---|
| 1553 | EXTERNL int |
---|
| 1554 | nc_put_var_float(int ncid, int varid, const float *op); |
---|
| 1555 | |
---|
| 1556 | EXTERNL int |
---|
| 1557 | nc_get_var_float(int ncid, int varid, float *ip); |
---|
| 1558 | |
---|
| 1559 | EXTERNL int |
---|
| 1560 | nc_put_var_double(int ncid, int varid, const double *op); |
---|
| 1561 | |
---|
| 1562 | EXTERNL int |
---|
| 1563 | nc_get_var_double(int ncid, int varid, double *ip); |
---|
| 1564 | |
---|
| 1565 | EXTERNL int |
---|
| 1566 | nc_put_var_ushort(int ncid, int varid, const unsigned short *op); |
---|
| 1567 | |
---|
| 1568 | EXTERNL int |
---|
| 1569 | nc_get_var_ushort(int ncid, int varid, unsigned short *ip); |
---|
| 1570 | |
---|
| 1571 | EXTERNL int |
---|
| 1572 | nc_put_var_uint(int ncid, int varid, const unsigned int *op); |
---|
| 1573 | |
---|
| 1574 | EXTERNL int |
---|
| 1575 | nc_get_var_uint(int ncid, int varid, unsigned int *ip); |
---|
| 1576 | |
---|
| 1577 | EXTERNL int |
---|
| 1578 | nc_put_var_longlong(int ncid, int varid, const long long *op); |
---|
| 1579 | |
---|
| 1580 | EXTERNL int |
---|
| 1581 | nc_get_var_longlong(int ncid, int varid, long long *ip); |
---|
| 1582 | |
---|
| 1583 | EXTERNL int |
---|
| 1584 | nc_put_var_ulonglong(int ncid, int varid, const unsigned long long *op); |
---|
| 1585 | |
---|
| 1586 | EXTERNL int |
---|
| 1587 | nc_get_var_ulonglong(int ncid, int varid, unsigned long long *ip); |
---|
| 1588 | |
---|
| 1589 | EXTERNL int |
---|
| 1590 | nc_put_var_string(int ncid, int varid, const char **op); |
---|
| 1591 | |
---|
| 1592 | EXTERNL int |
---|
| 1593 | nc_get_var_string(int ncid, int varid, char **ip); |
---|
| 1594 | |
---|
| 1595 | /* Begin Deprecated, same as functions with "_ubyte" replaced by "_uchar" */ |
---|
| 1596 | EXTERNL int |
---|
| 1597 | nc_put_att_ubyte(int ncid, int varid, const char *name, nc_type xtype, |
---|
| 1598 | size_t len, const unsigned char *op); |
---|
| 1599 | EXTERNL int |
---|
| 1600 | nc_get_att_ubyte(int ncid, int varid, const char *name, |
---|
| 1601 | unsigned char *ip); |
---|
| 1602 | EXTERNL int |
---|
| 1603 | nc_put_var1_ubyte(int ncid, int varid, const size_t *indexp, |
---|
| 1604 | const unsigned char *op); |
---|
| 1605 | EXTERNL int |
---|
| 1606 | nc_get_var1_ubyte(int ncid, int varid, const size_t *indexp, |
---|
| 1607 | unsigned char *ip); |
---|
| 1608 | EXTERNL int |
---|
| 1609 | nc_put_vara_ubyte(int ncid, int varid, const size_t *startp, |
---|
| 1610 | const size_t *countp, const unsigned char *op); |
---|
| 1611 | EXTERNL int |
---|
| 1612 | nc_get_vara_ubyte(int ncid, int varid, const size_t *startp, |
---|
| 1613 | const size_t *countp, unsigned char *ip); |
---|
| 1614 | EXTERNL int |
---|
| 1615 | nc_put_vars_ubyte(int ncid, int varid, const size_t *startp, |
---|
| 1616 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1617 | const unsigned char *op); |
---|
| 1618 | EXTERNL int |
---|
| 1619 | nc_get_vars_ubyte(int ncid, int varid, const size_t *startp, |
---|
| 1620 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1621 | unsigned char *ip); |
---|
| 1622 | EXTERNL int |
---|
| 1623 | nc_put_varm_ubyte(int ncid, int varid, const size_t *startp, |
---|
| 1624 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1625 | const ptrdiff_t * imapp, const unsigned char *op); |
---|
| 1626 | EXTERNL int |
---|
| 1627 | nc_get_varm_ubyte(int ncid, int varid, const size_t *startp, |
---|
| 1628 | const size_t *countp, const ptrdiff_t *stridep, |
---|
| 1629 | const ptrdiff_t * imapp, unsigned char *ip); |
---|
| 1630 | EXTERNL int |
---|
| 1631 | nc_put_var_ubyte(int ncid, int varid, const unsigned char *op); |
---|
| 1632 | EXTERNL int |
---|
| 1633 | nc_get_var_ubyte(int ncid, int varid, unsigned char *ip); |
---|
| 1634 | /* End Deprecated */ |
---|
| 1635 | |
---|
| 1636 | #ifdef LOGGING |
---|
| 1637 | |
---|
| 1638 | /* Set the log level. 0 shows only errors, 1 only major messages, |
---|
| 1639 | * etc., to 5, which shows way too much information. */ |
---|
| 1640 | EXTERNL int |
---|
| 1641 | nc_set_log_level(int new_level); |
---|
| 1642 | |
---|
| 1643 | /* Use this to turn off logging by calling |
---|
| 1644 | nc_log_level(NC_TURN_OFF_LOGGING) */ |
---|
| 1645 | #define NC_TURN_OFF_LOGGING (-1) |
---|
| 1646 | |
---|
| 1647 | #else /* not LOGGING */ |
---|
| 1648 | |
---|
| 1649 | #define nc_set_log_level(e) |
---|
| 1650 | |
---|
| 1651 | #endif /* LOGGING */ |
---|
| 1652 | |
---|
| 1653 | /* Show the netCDF library's in-memory metadata for a file. */ |
---|
| 1654 | EXTERNL int |
---|
| 1655 | nc_show_metadata(int ncid); |
---|
| 1656 | |
---|
| 1657 | /* End {put,get}_var */ |
---|
| 1658 | |
---|
| 1659 | /* #ifdef _CRAYMPP */ |
---|
| 1660 | /* |
---|
| 1661 | * Public interfaces to better support |
---|
| 1662 | * CRAY multi-processor systems like T3E. |
---|
| 1663 | * A tip of the hat to NERSC. |
---|
| 1664 | */ |
---|
| 1665 | /* |
---|
| 1666 | * It turns out we need to declare and define |
---|
| 1667 | * these public interfaces on all platforms |
---|
| 1668 | * or things get ugly working out the |
---|
| 1669 | * FORTRAN interface. On !_CRAYMPP platforms, |
---|
| 1670 | * these functions work as advertised, but you |
---|
| 1671 | * can only use "processor element" 0. |
---|
| 1672 | */ |
---|
| 1673 | |
---|
| 1674 | EXTERNL int |
---|
| 1675 | nc__create_mp(const char *path, int cmode, size_t initialsz, int basepe, |
---|
| 1676 | size_t *chunksizehintp, int *ncidp); |
---|
| 1677 | |
---|
| 1678 | EXTERNL int |
---|
| 1679 | nc__open_mp(const char *path, int mode, int basepe, |
---|
| 1680 | size_t *chunksizehintp, int *ncidp); |
---|
| 1681 | |
---|
| 1682 | EXTERNL int |
---|
| 1683 | nc_delete(const char *path); |
---|
| 1684 | |
---|
| 1685 | EXTERNL int |
---|
| 1686 | nc_delete_mp(const char *path, int basepe); |
---|
| 1687 | |
---|
| 1688 | EXTERNL int |
---|
| 1689 | nc_set_base_pe(int ncid, int pe); |
---|
| 1690 | |
---|
| 1691 | EXTERNL int |
---|
| 1692 | nc_inq_base_pe(int ncid, int *pe); |
---|
| 1693 | |
---|
| 1694 | /* #endif _CRAYMPP */ |
---|
| 1695 | |
---|
| 1696 | /* This v2 function is used in the nc_test program. */ |
---|
| 1697 | EXTERNL int |
---|
| 1698 | nctypelen(nc_type datatype); |
---|
| 1699 | |
---|
| 1700 | /* Begin v2.4 backward compatiblity */ |
---|
| 1701 | /* |
---|
| 1702 | * defining NO_NETCDF_2 to the preprocessor |
---|
| 1703 | * turns off backward compatiblity declarations. |
---|
| 1704 | */ |
---|
| 1705 | #ifndef NO_NETCDF_2 |
---|
| 1706 | |
---|
| 1707 | /** Backward compatible alias. */ |
---|
| 1708 | /**@{*/ |
---|
| 1709 | #define FILL_BYTE NC_FILL_BYTE |
---|
| 1710 | #define FILL_CHAR NC_FILL_CHAR |
---|
| 1711 | #define FILL_SHORT NC_FILL_SHORT |
---|
| 1712 | #define FILL_LONG NC_FILL_INT |
---|
| 1713 | #define FILL_FLOAT NC_FILL_FLOAT |
---|
| 1714 | #define FILL_DOUBLE NC_FILL_DOUBLE |
---|
| 1715 | |
---|
| 1716 | #define MAX_NC_DIMS NC_MAX_DIMS |
---|
| 1717 | #define MAX_NC_ATTRS NC_MAX_ATTRS |
---|
| 1718 | #define MAX_NC_VARS NC_MAX_VARS |
---|
| 1719 | #define MAX_NC_NAME NC_MAX_NAME |
---|
| 1720 | #define MAX_VAR_DIMS NC_MAX_VAR_DIMS |
---|
| 1721 | /**@}*/ |
---|
| 1722 | |
---|
| 1723 | |
---|
| 1724 | /* |
---|
| 1725 | * Global error status |
---|
| 1726 | */ |
---|
| 1727 | EXTERNL int ncerr; |
---|
| 1728 | |
---|
| 1729 | #define NC_ENTOOL NC_EMAXNAME /* Backward compatibility */ |
---|
| 1730 | #define NC_EXDR (-32) /* */ |
---|
| 1731 | #define NC_SYSERR (-31) |
---|
| 1732 | |
---|
| 1733 | /* |
---|
| 1734 | * Global options variable. |
---|
| 1735 | * Used to determine behavior of error handler. |
---|
| 1736 | */ |
---|
| 1737 | #define NC_FATAL 1 |
---|
| 1738 | #define NC_VERBOSE 2 |
---|
| 1739 | |
---|
| 1740 | EXTERNL int ncopts; /* default is (NC_FATAL | NC_VERBOSE) */ |
---|
| 1741 | |
---|
| 1742 | EXTERNL void |
---|
| 1743 | nc_advise(const char *cdf_routine_name, int err, const char *fmt,...); |
---|
| 1744 | |
---|
| 1745 | /* |
---|
| 1746 | * C data type corresponding to a netCDF NC_LONG argument, |
---|
| 1747 | * a signed 32 bit object. |
---|
| 1748 | * |
---|
| 1749 | * This is the only thing in this file which architecture dependent. |
---|
| 1750 | */ |
---|
| 1751 | typedef int nclong; |
---|
| 1752 | |
---|
| 1753 | EXTERNL int |
---|
| 1754 | nccreate(const char* path, int cmode); |
---|
| 1755 | |
---|
| 1756 | EXTERNL int |
---|
| 1757 | ncopen(const char* path, int mode); |
---|
| 1758 | |
---|
| 1759 | EXTERNL int |
---|
| 1760 | ncsetfill(int ncid, int fillmode); |
---|
| 1761 | |
---|
| 1762 | EXTERNL int |
---|
| 1763 | ncredef(int ncid); |
---|
| 1764 | |
---|
| 1765 | EXTERNL int |
---|
| 1766 | ncendef(int ncid); |
---|
| 1767 | |
---|
| 1768 | EXTERNL int |
---|
| 1769 | ncsync(int ncid); |
---|
| 1770 | |
---|
| 1771 | EXTERNL int |
---|
| 1772 | ncabort(int ncid); |
---|
| 1773 | |
---|
| 1774 | EXTERNL int |
---|
| 1775 | ncclose(int ncid); |
---|
| 1776 | |
---|
| 1777 | EXTERNL int |
---|
| 1778 | ncinquire(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimp); |
---|
| 1779 | |
---|
| 1780 | EXTERNL int |
---|
| 1781 | ncdimdef(int ncid, const char *name, long len); |
---|
| 1782 | |
---|
| 1783 | EXTERNL int |
---|
| 1784 | ncdimid(int ncid, const char *name); |
---|
| 1785 | |
---|
| 1786 | EXTERNL int |
---|
| 1787 | ncdiminq(int ncid, int dimid, char *name, long *lenp); |
---|
| 1788 | |
---|
| 1789 | EXTERNL int |
---|
| 1790 | ncdimrename(int ncid, int dimid, const char *name); |
---|
| 1791 | |
---|
| 1792 | EXTERNL int |
---|
| 1793 | ncattput(int ncid, int varid, const char *name, nc_type xtype, |
---|
| 1794 | int len, const void *op); |
---|
| 1795 | |
---|
| 1796 | EXTERNL int |
---|
| 1797 | ncattinq(int ncid, int varid, const char *name, nc_type *xtypep, int *lenp); |
---|
| 1798 | |
---|
| 1799 | EXTERNL int |
---|
| 1800 | ncattget(int ncid, int varid, const char *name, void *ip); |
---|
| 1801 | |
---|
| 1802 | EXTERNL int |
---|
| 1803 | ncattcopy(int ncid_in, int varid_in, const char *name, int ncid_out, |
---|
| 1804 | int varid_out); |
---|
| 1805 | |
---|
| 1806 | EXTERNL int |
---|
| 1807 | ncattname(int ncid, int varid, int attnum, char *name); |
---|
| 1808 | |
---|
| 1809 | EXTERNL int |
---|
| 1810 | ncattrename(int ncid, int varid, const char *name, const char *newname); |
---|
| 1811 | |
---|
| 1812 | EXTERNL int |
---|
| 1813 | ncattdel(int ncid, int varid, const char *name); |
---|
| 1814 | |
---|
| 1815 | EXTERNL int |
---|
| 1816 | ncvardef(int ncid, const char *name, nc_type xtype, |
---|
| 1817 | int ndims, const int *dimidsp); |
---|
| 1818 | |
---|
| 1819 | EXTERNL int |
---|
| 1820 | ncvarid(int ncid, const char *name); |
---|
| 1821 | |
---|
| 1822 | EXTERNL int |
---|
| 1823 | ncvarinq(int ncid, int varid, char *name, nc_type *xtypep, |
---|
| 1824 | int *ndimsp, int *dimidsp, int *nattsp); |
---|
| 1825 | |
---|
| 1826 | EXTERNL int |
---|
| 1827 | ncvarput1(int ncid, int varid, const long *indexp, const void *op); |
---|
| 1828 | |
---|
| 1829 | EXTERNL int |
---|
| 1830 | ncvarget1(int ncid, int varid, const long *indexp, void *ip); |
---|
| 1831 | |
---|
| 1832 | EXTERNL int |
---|
| 1833 | ncvarput(int ncid, int varid, const long *startp, const long *countp, |
---|
| 1834 | const void *op); |
---|
| 1835 | |
---|
| 1836 | EXTERNL int |
---|
| 1837 | ncvarget(int ncid, int varid, const long *startp, const long *countp, |
---|
| 1838 | void *ip); |
---|
| 1839 | |
---|
| 1840 | EXTERNL int |
---|
| 1841 | ncvarputs(int ncid, int varid, const long *startp, const long *countp, |
---|
| 1842 | const long *stridep, const void *op); |
---|
| 1843 | |
---|
| 1844 | EXTERNL int |
---|
| 1845 | ncvargets(int ncid, int varid, const long *startp, const long *countp, |
---|
| 1846 | const long *stridep, void *ip); |
---|
| 1847 | |
---|
| 1848 | EXTERNL int |
---|
| 1849 | ncvarputg(int ncid, int varid, const long *startp, const long *countp, |
---|
| 1850 | const long *stridep, const long *imapp, const void *op); |
---|
| 1851 | |
---|
| 1852 | EXTERNL int |
---|
| 1853 | ncvargetg(int ncid, int varid, const long *startp, const long *countp, |
---|
| 1854 | const long *stridep, const long *imapp, void *ip); |
---|
| 1855 | |
---|
| 1856 | EXTERNL int |
---|
| 1857 | ncvarrename(int ncid, int varid, const char *name); |
---|
| 1858 | |
---|
| 1859 | EXTERNL int |
---|
| 1860 | ncrecinq(int ncid, int *nrecvarsp, int *recvaridsp, long *recsizesp); |
---|
| 1861 | |
---|
| 1862 | EXTERNL int |
---|
| 1863 | ncrecget(int ncid, long recnum, void **datap); |
---|
| 1864 | |
---|
| 1865 | EXTERNL int |
---|
| 1866 | ncrecput(int ncid, long recnum, void *const *datap); |
---|
| 1867 | |
---|
| 1868 | /* End v2.4 backward compatiblity */ |
---|
| 1869 | #endif /*!NO_NETCDF_2*/ |
---|
| 1870 | |
---|
| 1871 | #if defined(__cplusplus) |
---|
| 1872 | } |
---|
| 1873 | #endif |
---|
| 1874 | |
---|
| 1875 | /* Temporary hack to shut up warnings */ |
---|
| 1876 | #ifndef __MINGW32_VERSION |
---|
| 1877 | #define END_OF_MAIN() |
---|
| 1878 | #endif |
---|
| 1879 | |
---|
| 1880 | #endif /* _NETCDF_ */ |
---|
| 1881 | |
---|
| 1882 | |
---|
| 1883 | |
---|