netCDF 4.2.1.1
|
00001 00011 #ifndef _NETCDF_ 00012 #define _NETCDF_ 00013 00014 #include <stddef.h> /* size_t, ptrdiff_t */ 00015 #include <errno.h> /* netcdf functions sometimes return system errors */ 00016 00018 typedef int nc_type; 00019 00020 #if defined(__cplusplus) 00021 extern "C" { 00022 #endif 00023 00024 /* 00025 * The netcdf external data types 00026 */ 00027 #define NC_NAT 0 00028 #define NC_BYTE 1 00029 #define NC_CHAR 2 00030 #define NC_SHORT 3 00031 #define NC_INT 4 00032 #define NC_LONG NC_INT 00033 #define NC_FLOAT 5 00034 #define NC_DOUBLE 6 00035 #define NC_UBYTE 7 00036 #define NC_USHORT 8 00037 #define NC_UINT 9 00038 #define NC_INT64 10 00039 #define NC_UINT64 11 00040 #define NC_STRING 12 00042 #define NC_MAX_ATOMIC_TYPE NC_STRING 00043 00044 /* The following are use internally in support of user-defines 00045 * types. They are also the class returned by nc_inq_user_type. */ 00046 #define NC_VLEN 13 00047 #define NC_OPAQUE 14 00048 #define NC_ENUM 15 00049 #define NC_COMPOUND 16 00051 /* Define the first user defined type id (leave some room) */ 00052 #define NC_FIRSTUSERTYPEID 32 00053 00059 #define NC_FILL_BYTE ((signed char)-127) 00060 #define NC_FILL_CHAR ((char)0) 00061 #define NC_FILL_SHORT ((short)-32767) 00062 #define NC_FILL_INT (-2147483647L) 00063 #define NC_FILL_FLOAT (9.9692099683868690e+36f) /* near 15 * 2^119 */ 00064 #define NC_FILL_DOUBLE (9.9692099683868690e+36) 00065 #define NC_FILL_UBYTE (255) 00066 #define NC_FILL_USHORT (65535) 00067 #define NC_FILL_UINT (4294967295U) 00068 #define NC_FILL_INT64 ((long long)-9223372036854775806LL) 00069 #define NC_FILL_UINT64 ((unsigned long long)18446744073709551614ULL) 00070 #define NC_FILL_STRING "" 00071 00081 #define NC_MAX_BYTE 127 00082 #define NC_MIN_BYTE (-NC_MAX_BYTE-1) 00083 #define NC_MAX_CHAR 255 00084 #define NC_MAX_SHORT 32767 00085 #define NC_MIN_SHORT (-NC_MAX_SHORT - 1) 00086 #define NC_MAX_INT 2147483647 00087 #define NC_MIN_INT (-NC_MAX_INT - 1) 00088 #define NC_MAX_FLOAT 3.402823466e+38f 00089 #define NC_MIN_FLOAT (-NC_MAX_FLOAT) 00090 #define NC_MAX_DOUBLE 1.7976931348623157e+308 00091 #define NC_MIN_DOUBLE (-NC_MAX_DOUBLE) 00092 #define NC_MAX_UBYTE NC_MAX_CHAR 00093 #define NC_MAX_USHORT 65535U 00094 #define NC_MAX_UINT 4294967295U 00095 #define NC_MAX_INT64 (9223372036854775807LL) 00096 #define NC_MIN_INT64 (-9223372036854775807LL-1) 00097 #define NC_MAX_UINT64 (18446744073709551615ULL) 00098 #define X_INT64_MAX (9223372036854775807LL) 00099 #define X_INT64_MIN (-X_INT64_MAX - 1) 00100 #define X_UINT64_MAX (18446744073709551615ULL) 00101 00108 #define _FillValue "_FillValue" 00109 #define NC_FILL 0 00110 #define NC_NOFILL 0x100 00112 /* Define the ioflags bits for nc_create and nc_open. 00113 currently unused: 0x0010,0x0020,0x0040,0x0080 00114 and the whole upper 16 bits 00115 */ 00116 00117 #define NC_NOWRITE 0x0000 00118 #define NC_WRITE 0x0001 00119 /* unused: 0x0002 */ 00120 #define NC_CLOBBER 0x0000 00121 #define NC_NOCLOBBER 0x0004 00123 #define NC_DISKLESS 0x0008 00124 #define NC_MMAP 0x0010 00126 #define NC_CLASSIC_MODEL 0x0100 00127 #define NC_64BIT_OFFSET 0x0200 00133 #define NC_LOCK 0x0400 00134 00137 #define NC_SHARE 0x0800 00138 00139 #define NC_NETCDF4 0x1000 00143 #define NC_MPIIO 0x2000 00144 00146 #define NC_MPIPOSIX 0x4000 00147 #define NC_PNETCDF 0x8000 00154 #define NC_FORMAT_CLASSIC (1) 00155 #define NC_FORMAT_64BIT (2) 00156 #define NC_FORMAT_NETCDF4 (3) 00157 #define NC_FORMAT_NETCDF4_CLASSIC (4) 00158 00162 #define NC_SIZEHINT_DEFAULT 0 00163 00165 #define NC_ALIGN_CHUNK ((size_t)(-1)) 00166 00168 #define NC_UNLIMITED 0L 00169 00171 #define NC_GLOBAL -1 00172 00192 #define NC_MAX_DIMS 65536 00193 #define NC_MAX_ATTRS 8192 00194 #define NC_MAX_VARS 524288 00195 #define NC_MAX_NAME 256 00196 #define NC_MAX_VAR_DIMS 1024 00200 #define NC_MAX_HDF4_NAME 64 00201 00205 #define NC_ENDIAN_NATIVE 0 00206 #define NC_ENDIAN_LITTLE 1 00207 #define NC_ENDIAN_BIG 2 00208 00214 #define NC_CHUNKED 0 00215 #define NC_CONTIGUOUS 1 00216 00223 #define NC_NOCHECKSUM 0 00224 #define NC_FLETCHER32 1 00225 00232 #define NC_NOSHUFFLE 0 00233 #define NC_SHUFFLE 1 00234 00240 #define NC_ISSYSERR(err) ((err) > 0) 00241 00242 #define NC_NOERR 0 00243 #define NC2_ERR (-1) 00249 #define NC_EBADID (-33) 00250 #define NC_ENFILE (-34) 00251 #define NC_EEXIST (-35) 00252 #define NC_EINVAL (-36) 00253 #define NC_EPERM (-37) 00258 #define NC_ENOTINDEFINE (-38) 00259 00267 #define NC_EINDEFINE (-39) 00268 00274 #define NC_EINVALCOORDS (-40) 00275 #define NC_EMAXDIMS (-41) 00276 #define NC_ENAMEINUSE (-42) 00277 #define NC_ENOTATT (-43) 00278 #define NC_EMAXATTS (-44) 00279 #define NC_EBADTYPE (-45) 00280 #define NC_EBADDIM (-46) 00281 #define NC_EUNLIMPOS (-47) 00286 #define NC_EMAXVARS (-48) 00287 00291 #define NC_ENOTVAR (-49) 00292 #define NC_EGLOBAL (-50) 00293 #define NC_ENOTNC (-51) 00294 #define NC_ESTS (-52) 00295 #define NC_EMAXNAME (-53) 00296 #define NC_EUNLIMIT (-54) 00297 #define NC_ENORECVARS (-55) 00298 #define NC_ECHAR (-56) 00307 #define NC_EEDGE (-57) 00308 #define NC_ESTRIDE (-58) 00309 #define NC_EBADNAME (-59) 00310 /* N.B. following must match value in ncx.h */ 00311 00316 #define NC_ERANGE (-60) 00317 #define NC_ENOMEM (-61) 00318 #define NC_EVARSIZE (-62) 00319 #define NC_EDIMSIZE (-63) 00320 #define NC_ETRUNC (-64) 00321 #define NC_EAXISTYPE (-65) 00323 /* Following errors are added for DAP */ 00324 #define NC_EDAP (-66) 00325 #define NC_ECURL (-67) 00326 #define NC_EIO (-68) 00327 #define NC_ENODATA (-69) 00328 #define NC_EDAPSVC (-70) 00329 #define NC_EDAS (-71) 00330 #define NC_EDDS (-72) 00331 #define NC_EDATADDS (-73) 00332 #define NC_EDAPURL (-74) 00333 #define NC_EDAPCONSTRAINT (-75) 00334 #define NC_ETRANSLATION (-76) 00336 /* The following was added in support of netcdf-4. Make all netcdf-4 00337 error codes < -100 so that errors can be added to netcdf-3 if 00338 needed. */ 00339 #define NC4_FIRST_ERROR (-100) 00340 00342 #define NC_EHDFERR (-101) 00343 #define NC_ECANTREAD (-102) 00344 #define NC_ECANTWRITE (-103) 00345 #define NC_ECANTCREATE (-104) 00346 #define NC_EFILEMETA (-105) 00347 #define NC_EDIMMETA (-106) 00348 #define NC_EATTMETA (-107) 00349 #define NC_EVARMETA (-108) 00350 #define NC_ENOCOMPOUND (-109) 00351 #define NC_EATTEXISTS (-110) 00352 #define NC_ENOTNC4 (-111) 00355 #define NC_ESTRICTNC3 (-112) 00356 #define NC_ENOTNC3 (-113) 00357 #define NC_ENOPAR (-114) 00358 #define NC_EPARINIT (-115) 00359 #define NC_EBADGRPID (-116) 00360 #define NC_EBADTYPID (-117) 00361 #define NC_ETYPDEFINED (-118) 00362 #define NC_EBADFIELD (-119) 00363 #define NC_EBADCLASS (-120) 00364 #define NC_EMAPTYPE (-121) 00365 #define NC_ELATEFILL (-122) 00366 #define NC_ELATEDEF (-123) 00367 #define NC_EDIMSCALE (-124) 00368 #define NC_ENOGRP (-125) 00369 #define NC_ESTORAGE (-126) 00370 #define NC_EBADCHUNK (-127) 00371 #define NC_ENOTBUILT (-128) 00372 #define NC_EDISKLESS (-129) 00374 #define NC4_LAST_ERROR (-129) 00375 00376 /* This is used in netCDF-4 files for dimensions without coordinate 00377 * vars. */ 00378 #define DIM_WITHOUT_VARIABLE "This is a netCDF dimension but not a netCDF variable." 00379 00380 /* This is here at the request of the NCO team to support our 00381 * mistake of having chunksizes be first ints, then size_t. Doh! */ 00382 #define NC_HAVE_NEW_CHUNKING_API 1 00383 00384 00385 /*Errors for all remote access methods(e.g. DAP and CDMREMOTE)*/ 00386 #define NC_EURL (NC_EDAPURL) /* Malformed URL */ 00387 #define NC_ECONSTRAINT (NC_EDAPCONSTRAINT) /* Malformed Constraint*/ 00388 00389 00390 /* 00391 * The Interface 00392 */ 00393 00394 /* Declaration modifiers for DLL support (MSC et al) */ 00395 00396 #if defined(DLL_NETCDF) /* define when library is a DLL */ 00397 # if defined(DLL_EXPORT) /* define when building the library */ 00398 # define MSC_EXTRA __declspec(dllexport) 00399 # else 00400 # define MSC_EXTRA __declspec(dllimport) 00401 # endif 00402 #include <io.h> 00403 /*#define lseek _lseeki64 00404 #define off_t __int64*/ 00405 #else 00406 #define MSC_EXTRA 00407 #endif /* defined(DLL_NETCDF) */ 00408 00409 # define EXTERNL MSC_EXTRA extern 00410 00411 #if defined(DLL_NETCDF) /* define when library is a DLL */ 00412 EXTERNL int ncerr; 00413 EXTERNL int ncopts; 00414 #endif 00415 00416 EXTERNL const char * 00417 nc_inq_libvers(void); 00418 00419 EXTERNL const char * 00420 nc_strerror(int ncerr); 00421 00422 EXTERNL int 00423 nc__create(const char *path, int cmode, size_t initialsz, 00424 size_t *chunksizehintp, int *ncidp); 00425 00426 EXTERNL int 00427 nc_create(const char *path, int cmode, int *ncidp); 00428 00429 EXTERNL int 00430 nc__open(const char *path, int mode, 00431 size_t *chunksizehintp, int *ncidp); 00432 00433 EXTERNL int 00434 nc_open(const char *path, int mode, int *ncidp); 00435 00436 /* Learn the path used to open/create the file. */ 00437 EXTERNL int 00438 nc_inq_path(int ncid, size_t *pathlen, char *path); 00439 00440 /* Use these with nc_var_par_access(). */ 00441 #define NC_INDEPENDENT 0 00442 #define NC_COLLECTIVE 1 00443 00444 /* Set parallel access for a variable to independent (the default) or 00445 * collective. */ 00446 EXTERNL int 00447 nc_var_par_access(int ncid, int varid, int par_access); 00448 00449 /* Given an ncid and group name (NULL gets root group), return 00450 * locid. */ 00451 EXTERNL int 00452 nc_inq_ncid(int ncid, const char *name, int *grp_ncid); 00453 00454 /* Given a location id, return the number of groups it contains, and 00455 * an array of their locids. */ 00456 EXTERNL int 00457 nc_inq_grps(int ncid, int *numgrps, int *ncids); 00458 00459 /* Given locid, find name of group. (Root group is named "/".) */ 00460 EXTERNL int 00461 nc_inq_grpname(int ncid, char *name); 00462 00463 /* Given ncid, find full name and len of full name. (Root group is 00464 * named "/", with length 1.) */ 00465 EXTERNL int 00466 nc_inq_grpname_full(int ncid, size_t *lenp, char *full_name); 00467 00468 /* Given ncid, find len of full name. */ 00469 EXTERNL int 00470 nc_inq_grpname_len(int ncid, size_t *lenp); 00471 00472 /* Given an ncid, find the ncid of its parent group. */ 00473 EXTERNL int 00474 nc_inq_grp_parent(int ncid, int *parent_ncid); 00475 00476 /* Given a name and parent ncid, find group ncid. */ 00477 EXTERNL int 00478 nc_inq_grp_ncid(int ncid, const char *grp_name, int *grp_ncid); 00479 00480 /* Given a full name and ncid, find group ncid. */ 00481 EXTERNL int 00482 nc_inq_grp_full_ncid(int ncid, const char *full_name, int *grp_ncid); 00483 00484 /* Get a list of ids for all the variables in a group. */ 00485 EXTERNL int 00486 nc_inq_varids(int ncid, int *nvars, int *varids); 00487 00488 /* Find all dimids for a location. This finds all dimensions in a 00489 * group, or any of its parents. */ 00490 EXTERNL int 00491 nc_inq_dimids(int ncid, int *ndims, int *dimids, int include_parents); 00492 00493 /* Find all user-defined types for a location. This finds all 00494 * user-defined types in a group. */ 00495 EXTERNL int 00496 nc_inq_typeids(int ncid, int *ntypes, int *typeids); 00497 00498 /* Are two types equal? */ 00499 EXTERNL int 00500 nc_inq_type_equal(int ncid1, nc_type typeid1, int ncid2, 00501 nc_type typeid2, int *equal); 00502 00503 /* Create a group. its ncid is returned in the new_ncid pointer. */ 00504 EXTERNL int 00505 nc_def_grp(int parent_ncid, const char *name, int *new_ncid); 00506 00507 /* Here are functions for dealing with compound types. */ 00508 00509 /* Create a compound type. */ 00510 EXTERNL int 00511 nc_def_compound(int ncid, size_t size, const char *name, nc_type *typeidp); 00512 00513 /* Insert a named field into a compound type. */ 00514 EXTERNL int 00515 nc_insert_compound(int ncid, nc_type xtype, const char *name, 00516 size_t offset, nc_type field_typeid); 00517 00518 /* Insert a named array into a compound type. */ 00519 EXTERNL int 00520 nc_insert_array_compound(int ncid, nc_type xtype, const char *name, 00521 size_t offset, nc_type field_typeid, 00522 int ndims, const int *dim_sizes); 00523 00524 /* Get the name and size of a type. */ 00525 EXTERNL int 00526 nc_inq_type(int ncid, nc_type xtype, char *name, size_t *size); 00527 00528 /* Get the id of a type from the name. */ 00529 EXTERNL int 00530 nc_inq_typeid(int ncid, const char *name, nc_type *typeidp); 00531 00532 /* Get the name, size, and number of fields in a compound type. */ 00533 EXTERNL int 00534 nc_inq_compound(int ncid, nc_type xtype, char *name, size_t *sizep, 00535 size_t *nfieldsp); 00536 00537 /* Get the name of a compound type. */ 00538 EXTERNL int 00539 nc_inq_compound_name(int ncid, nc_type xtype, char *name); 00540 00541 /* Get the size of a compound type. */ 00542 EXTERNL int 00543 nc_inq_compound_size(int ncid, nc_type xtype, size_t *sizep); 00544 00545 /* Get the number of fields in this compound type. */ 00546 EXTERNL int 00547 nc_inq_compound_nfields(int ncid, nc_type xtype, size_t *nfieldsp); 00548 00549 /* Given the xtype and the fieldid, get all info about it. */ 00550 EXTERNL int 00551 nc_inq_compound_field(int ncid, nc_type xtype, int fieldid, char *name, 00552 size_t *offsetp, nc_type *field_typeidp, int *ndimsp, 00553 int *dim_sizesp); 00554 00555 /* Given the typeid and the fieldid, get the name. */ 00556 EXTERNL int 00557 nc_inq_compound_fieldname(int ncid, nc_type xtype, int fieldid, 00558 char *name); 00559 00560 /* Given the xtype and the name, get the fieldid. */ 00561 EXTERNL int 00562 nc_inq_compound_fieldindex(int ncid, nc_type xtype, const char *name, 00563 int *fieldidp); 00564 00565 /* Given the xtype and fieldid, get the offset. */ 00566 EXTERNL int 00567 nc_inq_compound_fieldoffset(int ncid, nc_type xtype, int fieldid, 00568 size_t *offsetp); 00569 00570 /* Given the xtype and the fieldid, get the type of that field. */ 00571 EXTERNL int 00572 nc_inq_compound_fieldtype(int ncid, nc_type xtype, int fieldid, 00573 nc_type *field_typeidp); 00574 00575 /* Given the xtype and the fieldid, get the number of dimensions for 00576 * that field (scalars are 0). */ 00577 EXTERNL int 00578 nc_inq_compound_fieldndims(int ncid, nc_type xtype, int fieldid, 00579 int *ndimsp); 00580 00581 /* Given the xtype and the fieldid, get the sizes of dimensions for 00582 * that field. User must have allocated storage for the dim_sizes. */ 00583 EXTERNL int 00584 nc_inq_compound_fielddim_sizes(int ncid, nc_type xtype, int fieldid, 00585 int *dim_sizes); 00586 00588 typedef struct { 00589 size_t len; 00590 void *p; 00591 } nc_vlen_t; 00592 00597 #define NC_COMPOUND_OFFSET(S,M) (offsetof(S,M)) 00598 00599 /* Create a variable length type. */ 00600 EXTERNL int 00601 nc_def_vlen(int ncid, const char *name, nc_type base_typeid, nc_type *xtypep); 00602 00603 /* Find out about a vlen. */ 00604 EXTERNL int 00605 nc_inq_vlen(int ncid, nc_type xtype, char *name, size_t *datum_sizep, 00606 nc_type *base_nc_typep); 00607 00608 /* When you read VLEN type the library will actually allocate the 00609 * storage space for the data. This storage space must be freed, so 00610 * pass the pointer back to this function, when you're done with the 00611 * data, and it will free the vlen memory. */ 00612 EXTERNL int 00613 nc_free_vlen(nc_vlen_t *vl); 00614 00615 EXTERNL int 00616 nc_free_vlens(size_t len, nc_vlen_t vlens[]); 00617 00618 /* Put or get one element in a vlen array. */ 00619 EXTERNL int 00620 nc_put_vlen_element(int ncid, int typeid1, void *vlen_element, 00621 size_t len, const void *data); 00622 00623 EXTERNL int 00624 nc_get_vlen_element(int ncid, int typeid1, const void *vlen_element, 00625 size_t *len, void *data); 00626 00627 /* When you read the string type the library will allocate the storage 00628 * space for the data. This storage space must be freed, so pass the 00629 * pointer back to this function, when you're done with the data, and 00630 * it will free the string memory. */ 00631 EXTERNL int 00632 nc_free_string(size_t len, char **data); 00633 00634 /* Find out about a user defined type. */ 00635 EXTERNL int 00636 nc_inq_user_type(int ncid, nc_type xtype, char *name, size_t *size, 00637 nc_type *base_nc_typep, size_t *nfieldsp, int *classp); 00638 00639 /* Write an attribute of any type. */ 00640 EXTERNL int 00641 nc_put_att(int ncid, int varid, const char *name, nc_type xtype, 00642 size_t len, const void *op); 00643 00644 /* Read an attribute of any type. */ 00645 EXTERNL int 00646 nc_get_att(int ncid, int varid, const char *name, void *ip); 00647 00648 /* Enum type. */ 00649 00650 /* Create an enum type. Provide a base type and a name. At the moment 00651 * only ints are accepted as base types. */ 00652 EXTERNL int 00653 nc_def_enum(int ncid, nc_type base_typeid, const char *name, 00654 nc_type *typeidp); 00655 00656 /* Insert a named value into an enum type. The value must fit within 00657 * the size of the enum type, the name size must be <= NC_MAX_NAME. */ 00658 EXTERNL int 00659 nc_insert_enum(int ncid, nc_type xtype, const char *name, 00660 const void *value); 00661 00662 /* Get information about an enum type: its name, base type and the 00663 * number of members defined. */ 00664 EXTERNL int 00665 nc_inq_enum(int ncid, nc_type xtype, char *name, nc_type *base_nc_typep, 00666 size_t *base_sizep, size_t *num_membersp); 00667 00668 /* Get information about an enum member: a name and value. Name size 00669 * will be <= NC_MAX_NAME. */ 00670 EXTERNL int 00671 nc_inq_enum_member(int ncid, nc_type xtype, int idx, char *name, 00672 void *value); 00673 00674 00675 /* Get enum name from enum value. Name size will be <= NC_MAX_NAME. */ 00676 EXTERNL int 00677 nc_inq_enum_ident(int ncid, nc_type xtype, long long value, char *identifier); 00678 00679 /* Opaque type. */ 00680 00681 /* Create an opaque type. Provide a size and a name. */ 00682 EXTERNL int 00683 nc_def_opaque(int ncid, size_t size, const char *name, nc_type *xtypep); 00684 00685 /* Get information about an opaque type. */ 00686 EXTERNL int 00687 nc_inq_opaque(int ncid, nc_type xtype, char *name, size_t *sizep); 00688 00689 /* Write entire var of any type. */ 00690 EXTERNL int 00691 nc_put_var(int ncid, int varid, const void *op); 00692 00693 /* Read entire var of any type. */ 00694 EXTERNL int 00695 nc_get_var(int ncid, int varid, void *ip); 00696 00697 /* Write one value. */ 00698 EXTERNL int 00699 nc_put_var1(int ncid, int varid, const size_t *indexp, 00700 const void *op); 00701 00702 /* Read one value. */ 00703 EXTERNL int 00704 nc_get_var1(int ncid, int varid, const size_t *indexp, void *ip); 00705 00706 /* Write an array of values. */ 00707 EXTERNL int 00708 nc_put_vara(int ncid, int varid, const size_t *startp, 00709 const size_t *countp, const void *op); 00710 00711 /* Read an array of values. */ 00712 EXTERNL int 00713 nc_get_vara(int ncid, int varid, const size_t *startp, 00714 const size_t *countp, void *ip); 00715 00716 /* Write slices of an array of values. */ 00717 EXTERNL int 00718 nc_put_vars(int ncid, int varid, const size_t *startp, 00719 const size_t *countp, const ptrdiff_t *stridep, 00720 const void *op); 00721 00722 /* Read slices of an array of values. */ 00723 EXTERNL int 00724 nc_get_vars(int ncid, int varid, const size_t *startp, 00725 const size_t *countp, const ptrdiff_t *stridep, 00726 void *ip); 00727 00728 /* Write mapped slices of an array of values. */ 00729 EXTERNL int 00730 nc_put_varm(int ncid, int varid, const size_t *startp, 00731 const size_t *countp, const ptrdiff_t *stridep, 00732 const ptrdiff_t *imapp, const void *op); 00733 00734 /* Read mapped slices of an array of values. */ 00735 EXTERNL int 00736 nc_get_varm(int ncid, int varid, const size_t *startp, 00737 const size_t *countp, const ptrdiff_t *stridep, 00738 const ptrdiff_t *imapp, void *ip); 00739 00740 /* Extra netcdf-4 stuff. */ 00741 00742 /* Set compression settings for a variable. Lower is faster, higher is 00743 * better. Must be called after nc_def_var and before nc_enddef. */ 00744 EXTERNL int 00745 nc_def_var_deflate(int ncid, int varid, int shuffle, int deflate, 00746 int deflate_level); 00747 00748 /* Find out compression settings of a var. */ 00749 EXTERNL int 00750 nc_inq_var_deflate(int ncid, int varid, int *shufflep, 00751 int *deflatep, int *deflate_levelp); 00752 00753 /* Find out szip settings of a var. */ 00754 EXTERNL int 00755 nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp); 00756 00757 /* Set fletcher32 checksum for a var. This must be done after nc_def_var 00758 and before nc_enddef. */ 00759 EXTERNL int 00760 nc_def_var_fletcher32(int ncid, int varid, int fletcher32); 00761 00762 /* Inquire about fletcher32 checksum for a var. */ 00763 EXTERNL int 00764 nc_inq_var_fletcher32(int ncid, int varid, int *fletcher32p); 00765 00766 /* Define chunking for a variable. This must be done after nc_def_var 00767 and before nc_enddef. */ 00768 EXTERNL int 00769 nc_def_var_chunking(int ncid, int varid, int storage, const size_t *chunksizesp); 00770 00771 /* Inq chunking stuff for a var. */ 00772 EXTERNL int 00773 nc_inq_var_chunking(int ncid, int varid, int *storagep, size_t *chunksizesp); 00774 00775 /* Define fill value behavior for a variable. This must be done after 00776 nc_def_var and before nc_enddef. */ 00777 EXTERNL int 00778 nc_def_var_fill(int ncid, int varid, int no_fill, const void *fill_value); 00779 00780 /* Inq fill value setting for a var. */ 00781 EXTERNL int 00782 nc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep); 00783 00784 /* Define the endianness of a variable. */ 00785 EXTERNL int 00786 nc_def_var_endian(int ncid, int varid, int endian); 00787 00788 /* Learn about the endianness of a variable. */ 00789 EXTERNL int 00790 nc_inq_var_endian(int ncid, int varid, int *endianp); 00791 00792 /* Set the fill mode (classic or 64-bit offset files only). */ 00793 EXTERNL int 00794 nc_set_fill(int ncid, int fillmode, int *old_modep); 00795 00796 /* Set the default nc_create format to NC_FORMAT_CLASSIC, 00797 * NC_FORMAT_64BIT, NC_FORMAT_NETCDF4, NC_FORMAT_NETCDF4_CLASSIC. */ 00798 EXTERNL int 00799 nc_set_default_format(int format, int *old_formatp); 00800 00801 /* Set the cache size, nelems, and preemption policy. */ 00802 EXTERNL int 00803 nc_set_chunk_cache(size_t size, size_t nelems, float preemption); 00804 00805 /* Get the cache size, nelems, and preemption policy. */ 00806 EXTERNL int 00807 nc_get_chunk_cache(size_t *sizep, size_t *nelemsp, float *preemptionp); 00808 00809 /* Set the per-variable cache size, nelems, and preemption policy. */ 00810 EXTERNL int 00811 nc_set_var_chunk_cache(int ncid, int varid, size_t size, size_t nelems, 00812 float preemption); 00813 00814 /* Set the per-variable cache size, nelems, and preemption policy. */ 00815 EXTERNL int 00816 nc_get_var_chunk_cache(int ncid, int varid, size_t *sizep, size_t *nelemsp, 00817 float *preemptionp); 00818 00819 EXTERNL int 00820 nc_redef(int ncid); 00821 00822 EXTERNL int 00823 nc__enddef(int ncid, size_t h_minfree, size_t v_align, 00824 size_t v_minfree, size_t r_align); 00825 00826 EXTERNL int 00827 nc_enddef(int ncid); 00828 00829 EXTERNL int 00830 nc_sync(int ncid); 00831 00832 EXTERNL int 00833 nc_abort(int ncid); 00834 00835 EXTERNL int 00836 nc_close(int ncid); 00837 00838 EXTERNL int 00839 nc_inq(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp); 00840 00841 EXTERNL int 00842 nc_inq_ndims(int ncid, int *ndimsp); 00843 00844 EXTERNL int 00845 nc_inq_nvars(int ncid, int *nvarsp); 00846 00847 EXTERNL int 00848 nc_inq_natts(int ncid, int *nattsp); 00849 00850 EXTERNL int 00851 nc_inq_unlimdim(int ncid, int *unlimdimidp); 00852 00853 /* The next function is for NetCDF-4 only */ 00854 EXTERNL int 00855 nc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp); 00856 00857 /* Added in 3.6.1 to return format of netCDF file. */ 00858 EXTERNL int 00859 nc_inq_format(int ncid, int *formatp); 00860 00861 /* Begin _dim */ 00862 00863 EXTERNL int 00864 nc_def_dim(int ncid, const char *name, size_t len, int *idp); 00865 00866 EXTERNL int 00867 nc_inq_dimid(int ncid, const char *name, int *idp); 00868 00869 EXTERNL int 00870 nc_inq_dim(int ncid, int dimid, char *name, size_t *lenp); 00871 00872 EXTERNL int 00873 nc_inq_dimname(int ncid, int dimid, char *name); 00874 00875 EXTERNL int 00876 nc_inq_dimlen(int ncid, int dimid, size_t *lenp); 00877 00878 EXTERNL int 00879 nc_rename_dim(int ncid, int dimid, const char *name); 00880 00881 /* End _dim */ 00882 /* Begin _att */ 00883 00884 EXTERNL int 00885 nc_inq_att(int ncid, int varid, const char *name, 00886 nc_type *xtypep, size_t *lenp); 00887 00888 EXTERNL int 00889 nc_inq_attid(int ncid, int varid, const char *name, int *idp); 00890 00891 EXTERNL int 00892 nc_inq_atttype(int ncid, int varid, const char *name, nc_type *xtypep); 00893 00894 EXTERNL int 00895 nc_inq_attlen(int ncid, int varid, const char *name, size_t *lenp); 00896 00897 EXTERNL int 00898 nc_inq_attname(int ncid, int varid, int attnum, char *name); 00899 00900 EXTERNL int 00901 nc_copy_att(int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out); 00902 00903 EXTERNL int 00904 nc_rename_att(int ncid, int varid, const char *name, const char *newname); 00905 00906 EXTERNL int 00907 nc_del_att(int ncid, int varid, const char *name); 00908 00909 /* End _att */ 00910 /* Begin {put,get}_att */ 00911 00912 EXTERNL int 00913 nc_put_att_text(int ncid, int varid, const char *name, 00914 size_t len, const char *op); 00915 00916 EXTERNL int 00917 nc_get_att_text(int ncid, int varid, const char *name, char *ip); 00918 00919 EXTERNL int 00920 nc_put_att_uchar(int ncid, int varid, const char *name, nc_type xtype, 00921 size_t len, const unsigned char *op); 00922 00923 EXTERNL int 00924 nc_get_att_uchar(int ncid, int varid, const char *name, unsigned char *ip); 00925 00926 EXTERNL int 00927 nc_put_att_schar(int ncid, int varid, const char *name, nc_type xtype, 00928 size_t len, const signed char *op); 00929 00930 EXTERNL int 00931 nc_get_att_schar(int ncid, int varid, const char *name, signed char *ip); 00932 00933 EXTERNL int 00934 nc_put_att_short(int ncid, int varid, const char *name, nc_type xtype, 00935 size_t len, const short *op); 00936 00937 EXTERNL int 00938 nc_get_att_short(int ncid, int varid, const char *name, short *ip); 00939 00940 EXTERNL int 00941 nc_put_att_int(int ncid, int varid, const char *name, nc_type xtype, 00942 size_t len, const int *op); 00943 00944 EXTERNL int 00945 nc_get_att_int(int ncid, int varid, const char *name, int *ip); 00946 00947 EXTERNL int 00948 nc_put_att_long(int ncid, int varid, const char *name, nc_type xtype, 00949 size_t len, const long *op); 00950 00951 EXTERNL int 00952 nc_get_att_long(int ncid, int varid, const char *name, long *ip); 00953 00954 EXTERNL int 00955 nc_put_att_float(int ncid, int varid, const char *name, nc_type xtype, 00956 size_t len, const float *op); 00957 00958 EXTERNL int 00959 nc_get_att_float(int ncid, int varid, const char *name, float *ip); 00960 00961 EXTERNL int 00962 nc_put_att_double(int ncid, int varid, const char *name, nc_type xtype, 00963 size_t len, const double *op); 00964 00965 EXTERNL int 00966 nc_get_att_double(int ncid, int varid, const char *name, double *ip); 00967 00968 EXTERNL int 00969 nc_put_att_ushort(int ncid, int varid, const char *name, nc_type xtype, 00970 size_t len, const unsigned short *op); 00971 00972 EXTERNL int 00973 nc_get_att_ushort(int ncid, int varid, const char *name, unsigned short *ip); 00974 00975 EXTERNL int 00976 nc_put_att_uint(int ncid, int varid, const char *name, nc_type xtype, 00977 size_t len, const unsigned int *op); 00978 00979 EXTERNL int 00980 nc_get_att_uint(int ncid, int varid, const char *name, unsigned int *ip); 00981 00982 EXTERNL int 00983 nc_put_att_longlong(int ncid, int varid, const char *name, nc_type xtype, 00984 size_t len, const long long *op); 00985 00986 EXTERNL int 00987 nc_get_att_longlong(int ncid, int varid, const char *name, long long *ip); 00988 00989 EXTERNL int 00990 nc_put_att_ulonglong(int ncid, int varid, const char *name, nc_type xtype, 00991 size_t len, const unsigned long long *op); 00992 00993 EXTERNL int 00994 nc_get_att_ulonglong(int ncid, int varid, const char *name, 00995 unsigned long long *ip); 00996 00997 EXTERNL int 00998 nc_put_att_string(int ncid, int varid, const char *name, 00999 size_t len, const char **op); 01000 01001 EXTERNL int 01002 nc_get_att_string(int ncid, int varid, const char *name, char **ip); 01003 01004 /* End {put,get}_att */ 01005 /* Begin _var */ 01006 01007 EXTERNL int 01008 nc_def_var(int ncid, const char *name, nc_type xtype, int ndims, 01009 const int *dimidsp, int *varidp); 01010 01011 EXTERNL int 01012 nc_inq_var(int ncid, int varid, char *name, nc_type *xtypep, 01013 int *ndimsp, int *dimidsp, int *nattsp); 01014 01015 EXTERNL int 01016 nc_inq_varid(int ncid, const char *name, int *varidp); 01017 01018 EXTERNL int 01019 nc_inq_varname(int ncid, int varid, char *name); 01020 01021 EXTERNL int 01022 nc_inq_vartype(int ncid, int varid, nc_type *xtypep); 01023 01024 EXTERNL int 01025 nc_inq_varndims(int ncid, int varid, int *ndimsp); 01026 01027 EXTERNL int 01028 nc_inq_vardimid(int ncid, int varid, int *dimidsp); 01029 01030 EXTERNL int 01031 nc_inq_varnatts(int ncid, int varid, int *nattsp); 01032 01033 EXTERNL int 01034 nc_rename_var(int ncid, int varid, const char *name); 01035 01036 EXTERNL int 01037 nc_copy_var(int ncid_in, int varid, int ncid_out); 01038 01039 #ifndef ncvarcpy 01040 /* support the old name for now */ 01041 #define ncvarcpy(ncid_in, varid, ncid_out) ncvarcopy((ncid_in), (varid), (ncid_out)) 01042 #endif 01043 01044 /* End _var */ 01045 /* Begin {put,get}_var1 */ 01046 01047 EXTERNL int 01048 nc_put_var1_text(int ncid, int varid, const size_t *indexp, const char *op); 01049 01050 EXTERNL int 01051 nc_get_var1_text(int ncid, int varid, const size_t *indexp, char *ip); 01052 01053 EXTERNL int 01054 nc_put_var1_uchar(int ncid, int varid, const size_t *indexp, 01055 const unsigned char *op); 01056 01057 EXTERNL int 01058 nc_get_var1_uchar(int ncid, int varid, const size_t *indexp, 01059 unsigned char *ip); 01060 01061 EXTERNL int 01062 nc_put_var1_schar(int ncid, int varid, const size_t *indexp, 01063 const signed char *op); 01064 01065 EXTERNL int 01066 nc_get_var1_schar(int ncid, int varid, const size_t *indexp, 01067 signed char *ip); 01068 01069 EXTERNL int 01070 nc_put_var1_short(int ncid, int varid, const size_t *indexp, 01071 const short *op); 01072 01073 EXTERNL int 01074 nc_get_var1_short(int ncid, int varid, const size_t *indexp, 01075 short *ip); 01076 01077 EXTERNL int 01078 nc_put_var1_int(int ncid, int varid, const size_t *indexp, const int *op); 01079 01080 EXTERNL int 01081 nc_get_var1_int(int ncid, int varid, const size_t *indexp, int *ip); 01082 01083 EXTERNL int 01084 nc_put_var1_long(int ncid, int varid, const size_t *indexp, const long *op); 01085 01086 EXTERNL int 01087 nc_get_var1_long(int ncid, int varid, const size_t *indexp, long *ip); 01088 01089 EXTERNL int 01090 nc_put_var1_float(int ncid, int varid, const size_t *indexp, const float *op); 01091 01092 EXTERNL int 01093 nc_get_var1_float(int ncid, int varid, const size_t *indexp, float *ip); 01094 01095 EXTERNL int 01096 nc_put_var1_double(int ncid, int varid, const size_t *indexp, const double *op); 01097 01098 EXTERNL int 01099 nc_get_var1_double(int ncid, int varid, const size_t *indexp, double *ip); 01100 01101 EXTERNL int 01102 nc_put_var1_ushort(int ncid, int varid, const size_t *indexp, 01103 const unsigned short *op); 01104 01105 EXTERNL int 01106 nc_get_var1_ushort(int ncid, int varid, const size_t *indexp, 01107 unsigned short *ip); 01108 01109 EXTERNL int 01110 nc_put_var1_uint(int ncid, int varid, const size_t *indexp, 01111 const unsigned int *op); 01112 01113 EXTERNL int 01114 nc_get_var1_uint(int ncid, int varid, const size_t *indexp, 01115 unsigned int *ip); 01116 01117 EXTERNL int 01118 nc_put_var1_longlong(int ncid, int varid, const size_t *indexp, 01119 const long long *op); 01120 01121 EXTERNL int 01122 nc_get_var1_longlong(int ncid, int varid, const size_t *indexp, 01123 long long *ip); 01124 01125 EXTERNL int 01126 nc_put_var1_ulonglong(int ncid, int varid, const size_t *indexp, 01127 const unsigned long long *op); 01128 01129 EXTERNL int 01130 nc_get_var1_ulonglong(int ncid, int varid, const size_t *indexp, 01131 unsigned long long *ip); 01132 01133 EXTERNL int 01134 nc_put_var1_string(int ncid, int varid, const size_t *indexp, 01135 const char **op); 01136 01137 EXTERNL int 01138 nc_get_var1_string(int ncid, int varid, const size_t *indexp, 01139 char **ip); 01140 01141 /* End {put,get}_var1 */ 01142 /* Begin {put,get}_vara */ 01143 01144 EXTERNL int 01145 nc_put_vara_text(int ncid, int varid, const size_t *startp, 01146 const size_t *countp, const char *op); 01147 01148 EXTERNL int 01149 nc_get_vara_text(int ncid, int varid, const size_t *startp, 01150 const size_t *countp, char *ip); 01151 01152 EXTERNL int 01153 nc_put_vara_uchar(int ncid, int varid, const size_t *startp, 01154 const size_t *countp, const unsigned char *op); 01155 01156 EXTERNL int 01157 nc_get_vara_uchar(int ncid, int varid, const size_t *startp, 01158 const size_t *countp, unsigned char *ip); 01159 01160 EXTERNL int 01161 nc_put_vara_schar(int ncid, int varid, const size_t *startp, 01162 const size_t *countp, const signed char *op); 01163 01164 EXTERNL int 01165 nc_get_vara_schar(int ncid, int varid, const size_t *startp, 01166 const size_t *countp, signed char *ip); 01167 01168 EXTERNL int 01169 nc_put_vara_short(int ncid, int varid, const size_t *startp, 01170 const size_t *countp, const short *op); 01171 01172 EXTERNL int 01173 nc_get_vara_short(int ncid, int varid, const size_t *startp, 01174 const size_t *countp, short *ip); 01175 01176 EXTERNL int 01177 nc_put_vara_int(int ncid, int varid, const size_t *startp, 01178 const size_t *countp, const int *op); 01179 01180 EXTERNL int 01181 nc_get_vara_int(int ncid, int varid, const size_t *startp, 01182 const size_t *countp, int *ip); 01183 01184 EXTERNL int 01185 nc_put_vara_long(int ncid, int varid, const size_t *startp, 01186 const size_t *countp, const long *op); 01187 01188 EXTERNL int 01189 nc_get_vara_long(int ncid, int varid, 01190 const size_t *startp, const size_t *countp, long *ip); 01191 01192 EXTERNL int 01193 nc_put_vara_float(int ncid, int varid, 01194 const size_t *startp, const size_t *countp, const float *op); 01195 01196 EXTERNL int 01197 nc_get_vara_float(int ncid, int varid, 01198 const size_t *startp, const size_t *countp, float *ip); 01199 01200 EXTERNL int 01201 nc_put_vara_double(int ncid, int varid, const size_t *startp, 01202 const size_t *countp, const double *op); 01203 01204 EXTERNL int 01205 nc_get_vara_double(int ncid, int varid, const size_t *startp, 01206 const size_t *countp, double *ip); 01207 01208 EXTERNL int 01209 nc_put_vara_ushort(int ncid, int varid, const size_t *startp, 01210 const size_t *countp, const unsigned short *op); 01211 01212 EXTERNL int 01213 nc_get_vara_ushort(int ncid, int varid, const size_t *startp, 01214 const size_t *countp, unsigned short *ip); 01215 01216 EXTERNL int 01217 nc_put_vara_uint(int ncid, int varid, const size_t *startp, 01218 const size_t *countp, const unsigned int *op); 01219 01220 EXTERNL int 01221 nc_get_vara_uint(int ncid, int varid, const size_t *startp, 01222 const size_t *countp, unsigned int *ip); 01223 01224 EXTERNL int 01225 nc_put_vara_longlong(int ncid, int varid, const size_t *startp, 01226 const size_t *countp, const long long *op); 01227 01228 EXTERNL int 01229 nc_get_vara_longlong(int ncid, int varid, const size_t *startp, 01230 const size_t *countp, long long *ip); 01231 01232 EXTERNL int 01233 nc_put_vara_ulonglong(int ncid, int varid, const size_t *startp, 01234 const size_t *countp, const unsigned long long *op); 01235 01236 EXTERNL int 01237 nc_get_vara_ulonglong(int ncid, int varid, const size_t *startp, 01238 const size_t *countp, unsigned long long *ip); 01239 01240 EXTERNL int 01241 nc_put_vara_string(int ncid, int varid, const size_t *startp, 01242 const size_t *countp, const char **op); 01243 01244 EXTERNL int 01245 nc_get_vara_string(int ncid, int varid, const size_t *startp, 01246 const size_t *countp, char **ip); 01247 01248 /* End {put,get}_vara */ 01249 /* Begin {put,get}_vars */ 01250 01251 EXTERNL int 01252 nc_put_vars_text(int ncid, int varid, 01253 const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, 01254 const char *op); 01255 01256 EXTERNL int 01257 nc_get_vars_text(int ncid, int varid, 01258 const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, 01259 char *ip); 01260 01261 EXTERNL int 01262 nc_put_vars_uchar(int ncid, int varid, 01263 const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, 01264 const unsigned char *op); 01265 01266 EXTERNL int 01267 nc_get_vars_uchar(int ncid, int varid, 01268 const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, 01269 unsigned char *ip); 01270 01271 EXTERNL int 01272 nc_put_vars_schar(int ncid, int varid, 01273 const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, 01274 const signed char *op); 01275 01276 EXTERNL int 01277 nc_get_vars_schar(int ncid, int varid, 01278 const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, 01279 signed char *ip); 01280 01281 EXTERNL int 01282 nc_put_vars_short(int ncid, int varid, 01283 const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, 01284 const short *op); 01285 01286 EXTERNL int 01287 nc_get_vars_short(int ncid, int varid, const size_t *startp, 01288 const size_t *countp, const ptrdiff_t *stridep, 01289 short *ip); 01290 01291 EXTERNL int 01292 nc_put_vars_int(int ncid, int varid, 01293 const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, 01294 const int *op); 01295 01296 EXTERNL int 01297 nc_get_vars_int(int ncid, int varid, 01298 const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, 01299 int *ip); 01300 01301 EXTERNL int 01302 nc_put_vars_long(int ncid, int varid, 01303 const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, 01304 const long *op); 01305 01306 EXTERNL int 01307 nc_get_vars_long(int ncid, int varid, 01308 const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, 01309 long *ip); 01310 01311 EXTERNL int 01312 nc_put_vars_float(int ncid, int varid, 01313 const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, 01314 const float *op); 01315 01316 EXTERNL int 01317 nc_get_vars_float(int ncid, int varid, 01318 const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, 01319 float *ip); 01320 01321 EXTERNL int 01322 nc_put_vars_double(int ncid, int varid, 01323 const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, 01324 const double *op); 01325 01326 EXTERNL int 01327 nc_get_vars_double(int ncid, int varid, const size_t *startp, 01328 const size_t *countp, const ptrdiff_t *stridep, 01329 double *ip); 01330 01331 EXTERNL int 01332 nc_put_vars_ushort(int ncid, int varid, const size_t *startp, 01333 const size_t *countp, const ptrdiff_t *stridep, 01334 const unsigned short *op); 01335 01336 EXTERNL int 01337 nc_get_vars_ushort(int ncid, int varid, const size_t *startp, 01338 const size_t *countp, const ptrdiff_t *stridep, 01339 unsigned short *ip); 01340 01341 EXTERNL int 01342 nc_put_vars_uint(int ncid, int varid, const size_t *startp, 01343 const size_t *countp, const ptrdiff_t *stridep, 01344 const unsigned int *op); 01345 01346 EXTERNL int 01347 nc_get_vars_uint(int ncid, int varid, const size_t *startp, 01348 const size_t *countp, const ptrdiff_t *stridep, 01349 unsigned int *ip); 01350 01351 EXTERNL int 01352 nc_put_vars_longlong(int ncid, int varid, const size_t *startp, 01353 const size_t *countp, const ptrdiff_t *stridep, 01354 const long long *op); 01355 01356 EXTERNL int 01357 nc_get_vars_longlong(int ncid, int varid, const size_t *startp, 01358 const size_t *countp, const ptrdiff_t *stridep, 01359 long long *ip); 01360 01361 EXTERNL int 01362 nc_put_vars_ulonglong(int ncid, int varid, const size_t *startp, 01363 const size_t *countp, const ptrdiff_t *stridep, 01364 const unsigned long long *op); 01365 01366 EXTERNL int 01367 nc_get_vars_ulonglong(int ncid, int varid, const size_t *startp, 01368 const size_t *countp, const ptrdiff_t *stridep, 01369 unsigned long long *ip); 01370 01371 EXTERNL int 01372 nc_put_vars_string(int ncid, int varid, const size_t *startp, 01373 const size_t *countp, const ptrdiff_t *stridep, 01374 const char **op); 01375 01376 EXTERNL int 01377 nc_get_vars_string(int ncid, int varid, const size_t *startp, 01378 const size_t *countp, const ptrdiff_t *stridep, 01379 char **ip); 01380 01381 /* End {put,get}_vars */ 01382 /* Begin {put,get}_varm */ 01383 01384 EXTERNL int 01385 nc_put_varm_text(int ncid, int varid, const size_t *startp, 01386 const size_t *countp, const ptrdiff_t *stridep, 01387 const ptrdiff_t *imapp, const char *op); 01388 01389 EXTERNL int 01390 nc_get_varm_text(int ncid, int varid, const size_t *startp, 01391 const size_t *countp, const ptrdiff_t *stridep, 01392 const ptrdiff_t *imapp, char *ip); 01393 01394 EXTERNL int 01395 nc_put_varm_uchar(int ncid, int varid, const size_t *startp, 01396 const size_t *countp, const ptrdiff_t *stridep, 01397 const ptrdiff_t *imapp, const unsigned char *op); 01398 01399 EXTERNL int 01400 nc_get_varm_uchar(int ncid, int varid, const size_t *startp, 01401 const size_t *countp, const ptrdiff_t *stridep, 01402 const ptrdiff_t *imapp, unsigned char *ip); 01403 01404 EXTERNL int 01405 nc_put_varm_schar(int ncid, int varid, const size_t *startp, 01406 const size_t *countp, const ptrdiff_t *stridep, 01407 const ptrdiff_t *imapp, const signed char *op); 01408 01409 EXTERNL int 01410 nc_get_varm_schar(int ncid, int varid, const size_t *startp, 01411 const size_t *countp, const ptrdiff_t *stridep, 01412 const ptrdiff_t *imapp, signed char *ip); 01413 01414 EXTERNL int 01415 nc_put_varm_short(int ncid, int varid, const size_t *startp, 01416 const size_t *countp, const ptrdiff_t *stridep, 01417 const ptrdiff_t *imapp, const short *op); 01418 01419 EXTERNL int 01420 nc_get_varm_short(int ncid, int varid, const size_t *startp, 01421 const size_t *countp, const ptrdiff_t *stridep, 01422 const ptrdiff_t *imapp, short *ip); 01423 01424 EXTERNL int 01425 nc_put_varm_int(int ncid, int varid, const size_t *startp, 01426 const size_t *countp, const ptrdiff_t *stridep, 01427 const ptrdiff_t *imapp, const int *op); 01428 01429 EXTERNL int 01430 nc_get_varm_int(int ncid, int varid, const size_t *startp, 01431 const size_t *countp, const ptrdiff_t *stridep, 01432 const ptrdiff_t *imapp, int *ip); 01433 01434 EXTERNL int 01435 nc_put_varm_long(int ncid, int varid, const size_t *startp, 01436 const size_t *countp, const ptrdiff_t *stridep, 01437 const ptrdiff_t *imapp, const long *op); 01438 01439 EXTERNL int 01440 nc_get_varm_long(int ncid, int varid, const size_t *startp, 01441 const size_t *countp, const ptrdiff_t *stridep, 01442 const ptrdiff_t *imapp, long *ip); 01443 01444 EXTERNL int 01445 nc_put_varm_float(int ncid, int varid,const size_t *startp, 01446 const size_t *countp, const ptrdiff_t *stridep, 01447 const ptrdiff_t *imapp, const float *op); 01448 01449 EXTERNL int 01450 nc_get_varm_float(int ncid, int varid,const size_t *startp, 01451 const size_t *countp, const ptrdiff_t *stridep, 01452 const ptrdiff_t *imapp, float *ip); 01453 01454 EXTERNL int 01455 nc_put_varm_double(int ncid, int varid, const size_t *startp, 01456 const size_t *countp, const ptrdiff_t *stridep, 01457 const ptrdiff_t *imapp, const double *op); 01458 01459 EXTERNL int 01460 nc_get_varm_double(int ncid, int varid, const size_t *startp, 01461 const size_t *countp, const ptrdiff_t *stridep, 01462 const ptrdiff_t * imapp, double *ip); 01463 01464 EXTERNL int 01465 nc_put_varm_ushort(int ncid, int varid, const size_t *startp, 01466 const size_t *countp, const ptrdiff_t *stridep, 01467 const ptrdiff_t * imapp, const unsigned short *op); 01468 01469 EXTERNL int 01470 nc_get_varm_ushort(int ncid, int varid, const size_t *startp, 01471 const size_t *countp, const ptrdiff_t *stridep, 01472 const ptrdiff_t * imapp, unsigned short *ip); 01473 01474 EXTERNL int 01475 nc_put_varm_uint(int ncid, int varid, const size_t *startp, 01476 const size_t *countp, const ptrdiff_t *stridep, 01477 const ptrdiff_t * imapp, const unsigned int *op); 01478 01479 EXTERNL int 01480 nc_get_varm_uint(int ncid, int varid, const size_t *startp, 01481 const size_t *countp, const ptrdiff_t *stridep, 01482 const ptrdiff_t * imapp, unsigned int *ip); 01483 01484 EXTERNL int 01485 nc_put_varm_longlong(int ncid, int varid, const size_t *startp, 01486 const size_t *countp, const ptrdiff_t *stridep, 01487 const ptrdiff_t * imapp, const long long *op); 01488 01489 EXTERNL int 01490 nc_get_varm_longlong(int ncid, int varid, const size_t *startp, 01491 const size_t *countp, const ptrdiff_t *stridep, 01492 const ptrdiff_t * imapp, long long *ip); 01493 01494 EXTERNL int 01495 nc_put_varm_ulonglong(int ncid, int varid, const size_t *startp, 01496 const size_t *countp, const ptrdiff_t *stridep, 01497 const ptrdiff_t * imapp, const unsigned long long *op); 01498 01499 EXTERNL int 01500 nc_get_varm_ulonglong(int ncid, int varid, const size_t *startp, 01501 const size_t *countp, const ptrdiff_t *stridep, 01502 const ptrdiff_t * imapp, unsigned long long *ip); 01503 01504 EXTERNL int 01505 nc_put_varm_string(int ncid, int varid, const size_t *startp, 01506 const size_t *countp, const ptrdiff_t *stridep, 01507 const ptrdiff_t * imapp, const char **op); 01508 01509 EXTERNL int 01510 nc_get_varm_string(int ncid, int varid, const size_t *startp, 01511 const size_t *countp, const ptrdiff_t *stridep, 01512 const ptrdiff_t * imapp, char **ip); 01513 01514 /* End {put,get}_varm */ 01515 /* Begin {put,get}_var */ 01516 01517 EXTERNL int 01518 nc_put_var_text(int ncid, int varid, const char *op); 01519 01520 EXTERNL int 01521 nc_get_var_text(int ncid, int varid, char *ip); 01522 01523 EXTERNL int 01524 nc_put_var_uchar(int ncid, int varid, const unsigned char *op); 01525 01526 EXTERNL int 01527 nc_get_var_uchar(int ncid, int varid, unsigned char *ip); 01528 01529 EXTERNL int 01530 nc_put_var_schar(int ncid, int varid, const signed char *op); 01531 01532 EXTERNL int 01533 nc_get_var_schar(int ncid, int varid, signed char *ip); 01534 01535 EXTERNL int 01536 nc_put_var_short(int ncid, int varid, const short *op); 01537 01538 EXTERNL int 01539 nc_get_var_short(int ncid, int varid, short *ip); 01540 01541 EXTERNL int 01542 nc_put_var_int(int ncid, int varid, const int *op); 01543 01544 EXTERNL int 01545 nc_get_var_int(int ncid, int varid, int *ip); 01546 01547 EXTERNL int 01548 nc_put_var_long(int ncid, int varid, const long *op); 01549 01550 EXTERNL int 01551 nc_get_var_long(int ncid, int varid, long *ip); 01552 01553 EXTERNL int 01554 nc_put_var_float(int ncid, int varid, const float *op); 01555 01556 EXTERNL int 01557 nc_get_var_float(int ncid, int varid, float *ip); 01558 01559 EXTERNL int 01560 nc_put_var_double(int ncid, int varid, const double *op); 01561 01562 EXTERNL int 01563 nc_get_var_double(int ncid, int varid, double *ip); 01564 01565 EXTERNL int 01566 nc_put_var_ushort(int ncid, int varid, const unsigned short *op); 01567 01568 EXTERNL int 01569 nc_get_var_ushort(int ncid, int varid, unsigned short *ip); 01570 01571 EXTERNL int 01572 nc_put_var_uint(int ncid, int varid, const unsigned int *op); 01573 01574 EXTERNL int 01575 nc_get_var_uint(int ncid, int varid, unsigned int *ip); 01576 01577 EXTERNL int 01578 nc_put_var_longlong(int ncid, int varid, const long long *op); 01579 01580 EXTERNL int 01581 nc_get_var_longlong(int ncid, int varid, long long *ip); 01582 01583 EXTERNL int 01584 nc_put_var_ulonglong(int ncid, int varid, const unsigned long long *op); 01585 01586 EXTERNL int 01587 nc_get_var_ulonglong(int ncid, int varid, unsigned long long *ip); 01588 01589 EXTERNL int 01590 nc_put_var_string(int ncid, int varid, const char **op); 01591 01592 EXTERNL int 01593 nc_get_var_string(int ncid, int varid, char **ip); 01594 01595 /* Begin Deprecated, same as functions with "_ubyte" replaced by "_uchar" */ 01596 EXTERNL int 01597 nc_put_att_ubyte(int ncid, int varid, const char *name, nc_type xtype, 01598 size_t len, const unsigned char *op); 01599 EXTERNL int 01600 nc_get_att_ubyte(int ncid, int varid, const char *name, 01601 unsigned char *ip); 01602 EXTERNL int 01603 nc_put_var1_ubyte(int ncid, int varid, const size_t *indexp, 01604 const unsigned char *op); 01605 EXTERNL int 01606 nc_get_var1_ubyte(int ncid, int varid, const size_t *indexp, 01607 unsigned char *ip); 01608 EXTERNL int 01609 nc_put_vara_ubyte(int ncid, int varid, const size_t *startp, 01610 const size_t *countp, const unsigned char *op); 01611 EXTERNL int 01612 nc_get_vara_ubyte(int ncid, int varid, const size_t *startp, 01613 const size_t *countp, unsigned char *ip); 01614 EXTERNL int 01615 nc_put_vars_ubyte(int ncid, int varid, const size_t *startp, 01616 const size_t *countp, const ptrdiff_t *stridep, 01617 const unsigned char *op); 01618 EXTERNL int 01619 nc_get_vars_ubyte(int ncid, int varid, const size_t *startp, 01620 const size_t *countp, const ptrdiff_t *stridep, 01621 unsigned char *ip); 01622 EXTERNL int 01623 nc_put_varm_ubyte(int ncid, int varid, const size_t *startp, 01624 const size_t *countp, const ptrdiff_t *stridep, 01625 const ptrdiff_t * imapp, const unsigned char *op); 01626 EXTERNL int 01627 nc_get_varm_ubyte(int ncid, int varid, const size_t *startp, 01628 const size_t *countp, const ptrdiff_t *stridep, 01629 const ptrdiff_t * imapp, unsigned char *ip); 01630 EXTERNL int 01631 nc_put_var_ubyte(int ncid, int varid, const unsigned char *op); 01632 EXTERNL int 01633 nc_get_var_ubyte(int ncid, int varid, unsigned char *ip); 01634 /* End Deprecated */ 01635 01636 #ifdef LOGGING 01637 01638 /* Set the log level. 0 shows only errors, 1 only major messages, 01639 * etc., to 5, which shows way too much information. */ 01640 EXTERNL int 01641 nc_set_log_level(int new_level); 01642 01643 /* Use this to turn off logging by calling 01644 nc_log_level(NC_TURN_OFF_LOGGING) */ 01645 #define NC_TURN_OFF_LOGGING (-1) 01646 01647 #else /* not LOGGING */ 01648 01649 #define nc_set_log_level(e) 01650 01651 #endif /* LOGGING */ 01652 01653 /* Show the netCDF library's in-memory metadata for a file. */ 01654 EXTERNL int 01655 nc_show_metadata(int ncid); 01656 01657 /* End {put,get}_var */ 01658 01659 /* #ifdef _CRAYMPP */ 01660 /* 01661 * Public interfaces to better support 01662 * CRAY multi-processor systems like T3E. 01663 * A tip of the hat to NERSC. 01664 */ 01665 /* 01666 * It turns out we need to declare and define 01667 * these public interfaces on all platforms 01668 * or things get ugly working out the 01669 * FORTRAN interface. On !_CRAYMPP platforms, 01670 * these functions work as advertised, but you 01671 * can only use "processor element" 0. 01672 */ 01673 01674 EXTERNL int 01675 nc__create_mp(const char *path, int cmode, size_t initialsz, int basepe, 01676 size_t *chunksizehintp, int *ncidp); 01677 01678 EXTERNL int 01679 nc__open_mp(const char *path, int mode, int basepe, 01680 size_t *chunksizehintp, int *ncidp); 01681 01682 EXTERNL int 01683 nc_delete(const char *path); 01684 01685 EXTERNL int 01686 nc_delete_mp(const char *path, int basepe); 01687 01688 EXTERNL int 01689 nc_set_base_pe(int ncid, int pe); 01690 01691 EXTERNL int 01692 nc_inq_base_pe(int ncid, int *pe); 01693 01694 /* #endif _CRAYMPP */ 01695 01696 /* This v2 function is used in the nc_test program. */ 01697 EXTERNL int 01698 nctypelen(nc_type datatype); 01699 01700 /* Begin v2.4 backward compatiblity */ 01701 /* 01702 * defining NO_NETCDF_2 to the preprocessor 01703 * turns off backward compatiblity declarations. 01704 */ 01705 #ifndef NO_NETCDF_2 01706 01709 #define FILL_BYTE NC_FILL_BYTE 01710 #define FILL_CHAR NC_FILL_CHAR 01711 #define FILL_SHORT NC_FILL_SHORT 01712 #define FILL_LONG NC_FILL_INT 01713 #define FILL_FLOAT NC_FILL_FLOAT 01714 #define FILL_DOUBLE NC_FILL_DOUBLE 01715 01716 #define MAX_NC_DIMS NC_MAX_DIMS 01717 #define MAX_NC_ATTRS NC_MAX_ATTRS 01718 #define MAX_NC_VARS NC_MAX_VARS 01719 #define MAX_NC_NAME NC_MAX_NAME 01720 #define MAX_VAR_DIMS NC_MAX_VAR_DIMS 01721 01724 /* 01725 * Global error status 01726 */ 01727 EXTERNL int ncerr; 01728 01729 #define NC_ENTOOL NC_EMAXNAME /* Backward compatibility */ 01730 #define NC_EXDR (-32) /* */ 01731 #define NC_SYSERR (-31) 01732 01733 /* 01734 * Global options variable. 01735 * Used to determine behavior of error handler. 01736 */ 01737 #define NC_FATAL 1 01738 #define NC_VERBOSE 2 01739 01740 EXTERNL int ncopts; /* default is (NC_FATAL | NC_VERBOSE) */ 01741 01742 EXTERNL void 01743 nc_advise(const char *cdf_routine_name, int err, const char *fmt,...); 01744 01745 /* 01746 * C data type corresponding to a netCDF NC_LONG argument, 01747 * a signed 32 bit object. 01748 * 01749 * This is the only thing in this file which architecture dependent. 01750 */ 01751 typedef int nclong; 01752 01753 EXTERNL int 01754 nccreate(const char* path, int cmode); 01755 01756 EXTERNL int 01757 ncopen(const char* path, int mode); 01758 01759 EXTERNL int 01760 ncsetfill(int ncid, int fillmode); 01761 01762 EXTERNL int 01763 ncredef(int ncid); 01764 01765 EXTERNL int 01766 ncendef(int ncid); 01767 01768 EXTERNL int 01769 ncsync(int ncid); 01770 01771 EXTERNL int 01772 ncabort(int ncid); 01773 01774 EXTERNL int 01775 ncclose(int ncid); 01776 01777 EXTERNL int 01778 ncinquire(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimp); 01779 01780 EXTERNL int 01781 ncdimdef(int ncid, const char *name, long len); 01782 01783 EXTERNL int 01784 ncdimid(int ncid, const char *name); 01785 01786 EXTERNL int 01787 ncdiminq(int ncid, int dimid, char *name, long *lenp); 01788 01789 EXTERNL int 01790 ncdimrename(int ncid, int dimid, const char *name); 01791 01792 EXTERNL int 01793 ncattput(int ncid, int varid, const char *name, nc_type xtype, 01794 int len, const void *op); 01795 01796 EXTERNL int 01797 ncattinq(int ncid, int varid, const char *name, nc_type *xtypep, int *lenp); 01798 01799 EXTERNL int 01800 ncattget(int ncid, int varid, const char *name, void *ip); 01801 01802 EXTERNL int 01803 ncattcopy(int ncid_in, int varid_in, const char *name, int ncid_out, 01804 int varid_out); 01805 01806 EXTERNL int 01807 ncattname(int ncid, int varid, int attnum, char *name); 01808 01809 EXTERNL int 01810 ncattrename(int ncid, int varid, const char *name, const char *newname); 01811 01812 EXTERNL int 01813 ncattdel(int ncid, int varid, const char *name); 01814 01815 EXTERNL int 01816 ncvardef(int ncid, const char *name, nc_type xtype, 01817 int ndims, const int *dimidsp); 01818 01819 EXTERNL int 01820 ncvarid(int ncid, const char *name); 01821 01822 EXTERNL int 01823 ncvarinq(int ncid, int varid, char *name, nc_type *xtypep, 01824 int *ndimsp, int *dimidsp, int *nattsp); 01825 01826 EXTERNL int 01827 ncvarput1(int ncid, int varid, const long *indexp, const void *op); 01828 01829 EXTERNL int 01830 ncvarget1(int ncid, int varid, const long *indexp, void *ip); 01831 01832 EXTERNL int 01833 ncvarput(int ncid, int varid, const long *startp, const long *countp, 01834 const void *op); 01835 01836 EXTERNL int 01837 ncvarget(int ncid, int varid, const long *startp, const long *countp, 01838 void *ip); 01839 01840 EXTERNL int 01841 ncvarputs(int ncid, int varid, const long *startp, const long *countp, 01842 const long *stridep, const void *op); 01843 01844 EXTERNL int 01845 ncvargets(int ncid, int varid, const long *startp, const long *countp, 01846 const long *stridep, void *ip); 01847 01848 EXTERNL int 01849 ncvarputg(int ncid, int varid, const long *startp, const long *countp, 01850 const long *stridep, const long *imapp, const void *op); 01851 01852 EXTERNL int 01853 ncvargetg(int ncid, int varid, const long *startp, const long *countp, 01854 const long *stridep, const long *imapp, void *ip); 01855 01856 EXTERNL int 01857 ncvarrename(int ncid, int varid, const char *name); 01858 01859 EXTERNL int 01860 ncrecinq(int ncid, int *nrecvarsp, int *recvaridsp, long *recsizesp); 01861 01862 EXTERNL int 01863 ncrecget(int ncid, long recnum, void **datap); 01864 01865 EXTERNL int 01866 ncrecput(int ncid, long recnum, void *const *datap); 01867 01868 /* End v2.4 backward compatiblity */ 01869 #endif 01871 #if defined(__cplusplus) 01872 } 01873 #endif 01874 01875 /* Temporary hack to shut up warnings */ 01876 #ifndef __MINGW32_VERSION 01877 #define END_OF_MAIN() 01878 #endif 01879 01880 #endif /* _NETCDF_ */ 01881 01882 01883