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