Loading...
Searching...
No Matches
netcdf.h
Go to the documentation of this file.
#ifndef _NETCDF_
#define _NETCDF_
#include <stddef.h> /* size_t, ptrdiff_t */
#include <errno.h> /* netcdf functions sometimes return system errors */
/* Required for alloca on Windows */
#if defined(_WIN32) || defined(_WIN64)
#include <malloc.h>
#endif
typedef int nc_type;
#if defined(__cplusplus)
extern "C" {
#endif
/*
* The netcdf external data types
*/
#define NC_NAT 0
#define NC_BYTE 1
#define NC_CHAR 2
#define NC_SHORT 3
#define NC_INT 4
#define NC_LONG NC_INT
#define NC_FLOAT 5
#define NC_DOUBLE 6
#define NC_UBYTE 7
#define NC_USHORT 8
#define NC_UINT 9
#define NC_INT64 10
#define NC_UINT64 11
#define NC_STRING 12
#define NC_MAX_ATOMIC_TYPE NC_STRING
/* The following are use internally in support of user-defines
* types. They are also the class returned by nc_inq_user_type. */
#define NC_VLEN 13
#define NC_OPAQUE 14
#define NC_ENUM 15
#define NC_COMPOUND 16
#define NC_FIRSTUSERTYPEID 32
#define NC_FILL_BYTE ((signed char)-127)
#define NC_FILL_CHAR ((char)0)
#define NC_FILL_SHORT ((short)-32767)
#define NC_FILL_INT (-2147483647)
#define NC_FILL_FLOAT (9.9692099683868690e+36f) /* near 15 * 2^119 */
#define NC_FILL_DOUBLE (9.9692099683868690e+36)
#define NC_FILL_UBYTE (255)
#define NC_FILL_USHORT (65535)
#define NC_FILL_UINT (4294967295U)
#define NC_FILL_INT64 ((long long)-9223372036854775806LL)
#define NC_FILL_UINT64 ((unsigned long long)18446744073709551614ULL)
#define NC_FILL_STRING ((char *)"")
#define NC_MAX_BYTE 127
#define NC_MIN_BYTE (-NC_MAX_BYTE-1)
#define NC_MAX_CHAR 255
#define NC_MAX_SHORT 32767
#define NC_MIN_SHORT (-NC_MAX_SHORT - 1)
#define NC_MAX_INT 2147483647
#define NC_MIN_INT (-NC_MAX_INT - 1)
#define NC_MAX_FLOAT 3.402823466e+38f
#define NC_MIN_FLOAT (-NC_MAX_FLOAT)
#define NC_MAX_DOUBLE 1.7976931348623157e+308
#define NC_MIN_DOUBLE (-NC_MAX_DOUBLE)
#define NC_MAX_UBYTE NC_MAX_CHAR
#define NC_MAX_USHORT 65535U
#define NC_MAX_UINT 4294967295U
#define NC_MAX_INT64 (9223372036854775807LL)
#define NC_MIN_INT64 (-9223372036854775807LL-1)
#define NC_MAX_UINT64 (18446744073709551615ULL)
#ifdef NETCDF_ENABLE_LEGACY_MACROS
#define _FillValue "_FillValue"
#endif
#define NC_FillValue "_FillValue"
#define NC_FILL 0
#define NC_NOFILL 0x100
/* Define the ioflags bits for nc_create and nc_open.
Currently unused in lower 16 bits:
0x0002
All upper 16 bits are unused except
0x20000
0x40000
*/
/* Lower 16 bits */
#define NC_NOWRITE 0x0000
#define NC_WRITE 0x0001
#define NC_CLOBBER 0x0000
#define NC_NOCLOBBER 0x0004
#define NC_DISKLESS 0x0008
#define NC_MMAP 0x0010
#define NC_64BIT_DATA 0x0020
#define NC_CDF5 NC_64BIT_DATA
#define NC_UDF0 0x0040
#define NC_UDF1 0x0080
#define NC_CLASSIC_MODEL 0x0100
#define NC_64BIT_OFFSET 0x0200
#define NC_LOCK 0x0400
#define NC_SHARE 0x0800
#define NC_NETCDF4 0x1000
#define NC_MPIIO 0x2000
#define NC_MPIPOSIX NC_MPIIO
#define NC_PNETCDF (NC_MPIIO)
#define NC_PERSIST 0x4000
#define NC_INMEMORY 0x8000
/* Upper 16 bits */
#define NC_NOATTCREORD 0x20000
#define NC_NODIMSCALE_ATTACH 0x40000
#define NC_MAX_MAGIC_NUMBER_LEN 8
#define NC_FORMAT_CLASSIC (1)
/* After adding CDF5 support, the NC_FORMAT_64BIT
flag is somewhat confusing. So, it is renamed.
Note that the name in the contributed code
NC_FORMAT_64BIT was renamed to NC_FORMAT_CDF2
*/
#define NC_FORMAT_64BIT_OFFSET (2)
#define NC_FORMAT_64BIT (NC_FORMAT_64BIT_OFFSET)
#define NC_FORMAT_NETCDF4 (3)
#define NC_FORMAT_NETCDF4_CLASSIC (4)
#define NC_FORMAT_64BIT_DATA (5)
/* Alias */
#define NC_FORMAT_CDF5 NC_FORMAT_64BIT_DATA
/* Define a mask covering format flags only */
#define NC_FORMAT_ALL (NC_64BIT_OFFSET|NC_64BIT_DATA|NC_CLASSIC_MODEL|NC_NETCDF4|NC_UDF0|NC_UDF1)
#define NC_FORMATX_NC3 (1)
#define NC_FORMATX_NC_HDF5 (2)
#define NC_FORMATX_NC4 NC_FORMATX_NC_HDF5
#define NC_FORMATX_NC_HDF4 (3)
#define NC_FORMATX_PNETCDF (4)
#define NC_FORMATX_DAP2 (5)
#define NC_FORMATX_DAP4 (6)
#define NC_FORMATX_UDF0 (8)
#define NC_FORMATX_UDF1 (9)
#define NC_FORMATX_NCZARR (10)
#define NC_FORMATX_UNDEFINED (0)
/* To avoid breaking compatibility (such as in the python library),
we need to retain the NC_FORMAT_xxx format as well. This may come
out eventually, as the NC_FORMATX is more clear that it's an extended
format specifier.*/
#define NC_FORMAT_NC3 NC_FORMATX_NC3
#define NC_FORMAT_NC_HDF5 NC_FORMATX_NC_HDF5
#define NC_FORMAT_NC4 NC_FORMATX_NC4
#define NC_FORMAT_NC_HDF4 NC_FORMATX_NC_HDF4
#define NC_FORMAT_PNETCDF NC_FORMATX_PNETCDF
#define NC_FORMAT_DAP2 NC_FORMATX_DAP2
#define NC_FORMAT_DAP4 NC_FORMATX_DAP4
#define NC_FORMAT_UNDEFINED NC_FORMATX_UNDEFINED
#define NC_FORMATX_ZARR NC_FORMATX_NCZARR
#define NC_SIZEHINT_DEFAULT 0
#define NC_ALIGN_CHUNK ((size_t)(-1))
#define NC_UNLIMITED 0L
#define NC_GLOBAL -1
#define NC_MAX_DIMS 1024 /* not enforced after 4.5.0 */
#define NC_MAX_ATTRS 8192 /* not enforced after 4.5.0 */
#define NC_MAX_VARS 8192 /* not enforced after 4.5.0 */
#define NC_MAX_NAME 256
#define NC_MAX_VAR_DIMS 1024
#define NC_MAX_HDF4_NAME NC_MAX_NAME
#define NC_ENDIAN_NATIVE 0
#define NC_ENDIAN_LITTLE 1
#define NC_ENDIAN_BIG 2
#define NC_CHUNKED 0
#define NC_CONTIGUOUS 1
#define NC_COMPACT 2
#define NC_UNKNOWN_STORAGE 3
#define NC_VIRTUAL 4
#define NC_NOCHECKSUM 0
#define NC_FLETCHER32 1
#define NC_NOSHUFFLE 0
#define NC_SHUFFLE 1
#define NC_MIN_DEFLATE_LEVEL 0
#define NC_MAX_DEFLATE_LEVEL 9
#define NC_SZIP_NN 32
#define NC_SZIP_EC 4
#define NC_NOQUANTIZE 0
#define NC_QUANTIZE_BITGROOM 1
#define NC_QUANTIZE_GRANULARBR 2
#define NC_QUANTIZE_BITROUND 3
#define NC_QUANTIZE_BITGROOM_ATT_NAME "_QuantizeBitGroomNumberOfSignificantDigits"
#define NC_QUANTIZE_GRANULARBR_ATT_NAME "_QuantizeGranularBitRoundNumberOfSignificantDigits"
#define NC_QUANTIZE_BITROUND_ATT_NAME "_QuantizeBitRoundNumberOfSignificantBits"
#define NC_QUANTIZE_MAX_FLOAT_NSD (7)
#define NC_QUANTIZE_MAX_FLOAT_NSB (23)
#define NC_QUANTIZE_MAX_DOUBLE_NSD (15)
#define NC_QUANTIZE_MAX_DOUBLE_NSB (52)
#define NC_ISSYSERR(err) ((err) > 0)
#define NC_NOERR 0
#define NC2_ERR (-1)
#define NC_EBADID (-33)
#define NC_ENFILE (-34)
#define NC_EEXIST (-35)
#define NC_EINVAL (-36)
#define NC_EPERM (-37)
#define NC_ENOTINDEFINE (-38)
#define NC_EINDEFINE (-39)
#define NC_EINVALCOORDS (-40)
#define NC_EMAXDIMS (-41) /* not enforced after 4.5.0 */
#define NC_ENAMEINUSE (-42)
#define NC_ENOTATT (-43)
#define NC_EMAXATTS (-44)
#define NC_EBADTYPE (-45)
#define NC_EBADDIM (-46)
#define NC_EUNLIMPOS (-47)
#define NC_EMAXVARS (-48) /* not enforced after 4.5.0 */
#define NC_ENOTVAR (-49)
#define NC_EGLOBAL (-50)
#define NC_ENOTNC (-51)
#define NC_ESTS (-52)
#define NC_EMAXNAME (-53)
#define NC_EUNLIMIT (-54)
#define NC_ENORECVARS (-55)
#define NC_ECHAR (-56)
#define NC_EEDGE (-57)
#define NC_ESTRIDE (-58)
#define NC_EBADNAME (-59)
/* N.B. following must match value in ncx.h */
#define NC_ERANGE (-60)
#define NC_ENOMEM (-61)
#define NC_EVARSIZE (-62)
#define NC_EDIMSIZE (-63)
#define NC_ETRUNC (-64)
#define NC_EAXISTYPE (-65)
/* Following errors are added for DAP */
#define NC_EDAP (-66)
#define NC_ECURL (-67)
#define NC_EIO (-68)
#define NC_ENODATA (-69)
#define NC_EDAPSVC (-70)
#define NC_EDAS (-71)
#define NC_EDDS (-72)
#define NC_EDMR NC_EDDS
#define NC_EDATADDS (-73)
#define NC_EDATADAP NC_EDATADDS
#define NC_EDAPURL (-74)
#define NC_EDAPCONSTRAINT (-75)
#define NC_ETRANSLATION (-76)
#define NC_EACCESS (-77)
#define NC_EAUTH (-78)
/* Misc. additional errors */
#define NC_ENOTFOUND (-90)
#define NC_ECANTREMOVE (-91)
#define NC_EINTERNAL (-92)
#define NC_EPNETCDF (-93)
/* The following was added in support of netcdf-4. Make all netcdf-4
error codes < -100 so that errors can be added to netcdf-3 if
needed. */
#define NC4_FIRST_ERROR (-100)
#define NC_EHDFERR (-101)
#define NC_ECANTREAD (-102)
#define NC_ECANTWRITE (-103)
#define NC_ECANTCREATE (-104)
#define NC_EFILEMETA (-105)
#define NC_EDIMMETA (-106)
#define NC_EATTMETA (-107)
#define NC_EVARMETA (-108)
#define NC_ENOCOMPOUND (-109)
#define NC_EATTEXISTS (-110)
#define NC_ENOTNC4 (-111)
#define NC_ESTRICTNC3 (-112)
#define NC_ENOTNC3 (-113)
#define NC_ENOPAR (-114)
#define NC_EPARINIT (-115)
#define NC_EBADGRPID (-116)
#define NC_EBADTYPID (-117)
#define NC_ETYPDEFINED (-118)
#define NC_EBADFIELD (-119)
#define NC_EBADCLASS (-120)
#define NC_EMAPTYPE (-121)
#define NC_ELATEFILL (-122)
#define NC_ELATEDEF (-123)
#define NC_EDIMSCALE (-124)
#define NC_ENOGRP (-125)
#define NC_ESTORAGE (-126)
#define NC_EBADCHUNK (-127)
#define NC_ENOTBUILT (-128)
#define NC_EDISKLESS (-129)
#define NC_ECANTEXTEND (-130)
#define NC_EMPI (-131)
#define NC_EFILTER (-132)
#define NC_ERCFILE (-133)
#define NC_ENULLPAD (-134)
#define NC_EINMEMORY (-135)
#define NC_ENOFILTER (-136)
#define NC_ENCZARR (-137)
#define NC_ES3 (-138)
#define NC_EEMPTY (-139)
#define NC_EOBJECT (-140)
#define NC_ENOOBJECT (-141)
#define NC_EPLUGIN (-142)
#define NC4_LAST_ERROR (-142)
/*
* Don't forget to update docs/all-error-codes.md if adding new error codes here!
*
*/
/* Errors for all remote access methods(e.g. DAP and CDMREMOTE)*/
#define NC_EURL (NC_EDAPURL)
#define NC_ECONSTRAINT (NC_EDAPCONSTRAINT)
#define DIM_WITHOUT_VARIABLE "This is a netCDF dimension but not a netCDF variable."
#define NC_HAVE_NEW_CHUNKING_API 1
/*
* The Interface
*/
/* Declaration modifiers for DLL support (MSC et al) */
#if defined(DLL_NETCDF) /* define when library is a DLL */
# if defined(DLL_EXPORT) /* define when building the library */
# define MSC_EXTRA __declspec(dllexport)
# else
# define MSC_EXTRA __declspec(dllimport)
# endif
# include <io.h>
#else
#define MSC_EXTRA
#endif /* defined(DLL_NETCDF) */
#define EXTERNL MSC_EXTRA extern
#if defined(DLL_NETCDF) /* define when library is a DLL */
EXTERNL int ncerr;
EXTERNL int ncopts;
#endif
EXTERNL const char *
nc_inq_libvers(void);
EXTERNL const char *
nc_strerror(int ncerr);
/* Set up user-defined format. */
typedef struct NC_Dispatch NC_Dispatch;
EXTERNL int
nc_def_user_format(int mode_flag, NC_Dispatch *dispatch_table, char *magic_number);
EXTERNL int
nc_inq_user_format(int mode_flag, NC_Dispatch **dispatch_table, char *magic_number);
/* Set the global alignment property */
EXTERNL int
nc_set_alignment(int threshold, int alignment);
/* Get the global alignment property */
EXTERNL int
nc_get_alignment(int* thresholdp, int* alignmentp);
EXTERNL int
nc__create(const char *path, int cmode, size_t initialsz,
size_t *chunksizehintp, int *ncidp);
EXTERNL int
nc_create(const char *path, int cmode, int *ncidp);
EXTERNL int
nc__open(const char *path, int mode,
size_t *chunksizehintp, int *ncidp);
EXTERNL int
nc_open(const char *path, int mode, int *ncidp);
/* Learn the path used to open/create the file. */
EXTERNL int
nc_inq_path(int ncid, size_t *pathlen, char *path);
/* Given an ncid and group name (NULL gets root group), return
* locid. */
EXTERNL int
nc_inq_ncid(int ncid, const char *name, int *grp_ncid);
/* Given a location id, return the number of groups it contains, and
* an array of their locids. */
EXTERNL int
nc_inq_grps(int ncid, int *numgrps, int *ncids);
/* Given locid, find name of group. (Root group is named "/".) */
EXTERNL int
nc_inq_grpname(int ncid, char *name);
/* Given ncid, find full name and len of full name. (Root group is
* named "/", with length 1.) */
EXTERNL int
nc_inq_grpname_full(int ncid, size_t *lenp, char *full_name);
/* Given ncid, find len of full name. */
EXTERNL int
nc_inq_grpname_len(int ncid, size_t *lenp);
/* Given an ncid, find the ncid of its parent group. */
EXTERNL int
nc_inq_grp_parent(int ncid, int *parent_ncid);
/* Given a name and parent ncid, find group ncid. */
EXTERNL int
nc_inq_grp_ncid(int ncid, const char *grp_name, int *grp_ncid);
/* Given a full name and ncid, find group ncid. */
EXTERNL int
nc_inq_grp_full_ncid(int ncid, const char *full_name, int *grp_ncid);
/* Get a list of ids for all the variables in a group. */
EXTERNL int
nc_inq_varids(int ncid, int *nvars, int *varids);
/* Find all dimids for a location. This finds all dimensions in a
* group, or any of its parents. */
EXTERNL int
nc_inq_dimids(int ncid, int *ndims, int *dimids, int include_parents);
/* Find all user-defined types for a location. This finds all
* user-defined types in a group. */
EXTERNL int
nc_inq_typeids(int ncid, int *ntypes, int *typeids);
/* Are two types equal? */
EXTERNL int
nc_inq_type_equal(int ncid1, nc_type typeid1, int ncid2,
nc_type typeid2, int *equal);
/* Create a group. its ncid is returned in the new_ncid pointer. */
EXTERNL int
nc_def_grp(int parent_ncid, const char *name, int *new_ncid);
/* Rename a group */
EXTERNL int
nc_rename_grp(int grpid, const char *name);
/* Here are functions for dealing with compound types. */
/* Create a compound type. */
EXTERNL int
nc_def_compound(int ncid, size_t size, const char *name, nc_type *typeidp);
/* Insert a named field into a compound type. */
EXTERNL int
nc_insert_compound(int ncid, nc_type xtype, const char *name,
size_t offset, nc_type field_typeid);
/* Insert a named array into a compound type. */
EXTERNL int
nc_insert_array_compound(int ncid, nc_type xtype, const char *name,
size_t offset, nc_type field_typeid,
int ndims, const int *dim_sizes);
/* Get the name and size of a type. */
EXTERNL int
nc_inq_type(int ncid, nc_type xtype, char *name, size_t *size);
/* Get the id of a type from the name, which might be a fully qualified name */
EXTERNL int
nc_inq_typeid(int ncid, const char *name, nc_type *typeidp);
/* Get the name, size, and number of fields in a compound type. */
EXTERNL int
nc_inq_compound(int ncid, nc_type xtype, char *name, size_t *sizep,
size_t *nfieldsp);
/* Get the name of a compound type. */
EXTERNL int
nc_inq_compound_name(int ncid, nc_type xtype, char *name);
/* Get the size of a compound type. */
EXTERNL int
nc_inq_compound_size(int ncid, nc_type xtype, size_t *sizep);
/* Get the number of fields in this compound type. */
EXTERNL int
nc_inq_compound_nfields(int ncid, nc_type xtype, size_t *nfieldsp);
/* Given the xtype and the fieldid, get all info about it. */
EXTERNL int
nc_inq_compound_field(int ncid, nc_type xtype, int fieldid, char *name,
size_t *offsetp, nc_type *field_typeidp, int *ndimsp,
int *dim_sizesp);
/* Given the typeid and the fieldid, get the name. */
EXTERNL int
nc_inq_compound_fieldname(int ncid, nc_type xtype, int fieldid,
char *name);
/* Given the xtype and the name, get the fieldid. */
EXTERNL int
nc_inq_compound_fieldindex(int ncid, nc_type xtype, const char *name,
int *fieldidp);
/* Given the xtype and fieldid, get the offset. */
EXTERNL int
nc_inq_compound_fieldoffset(int ncid, nc_type xtype, int fieldid,
size_t *offsetp);
/* Given the xtype and the fieldid, get the type of that field. */
EXTERNL int
nc_inq_compound_fieldtype(int ncid, nc_type xtype, int fieldid,
nc_type *field_typeidp);
/* Given the xtype and the fieldid, get the number of dimensions for
* that field (scalars are 0). */
EXTERNL int
nc_inq_compound_fieldndims(int ncid, nc_type xtype, int fieldid,
int *ndimsp);
/* Given the xtype and the fieldid, get the sizes of dimensions for
* that field. User must have allocated storage for the dim_sizes. */
EXTERNL int
nc_inq_compound_fielddim_sizes(int ncid, nc_type xtype, int fieldid,
int *dim_sizes);
typedef struct {
size_t len;
void *p;
} nc_vlen_t;
#define NC_COMPOUND_OFFSET(S,M) (offsetof(S,M))
/* Create a variable length type. */
EXTERNL int
nc_def_vlen(int ncid, const char *name, nc_type base_typeid, nc_type *xtypep);
/* Find out about a vlen. */
EXTERNL int
nc_inq_vlen(int ncid, nc_type xtype, char *name, size_t *datum_sizep,
nc_type *base_nc_typep);
/* Put or get one element in a vlen array. */
EXTERNL int
nc_put_vlen_element(int ncid, int typeid1, void *vlen_element,
size_t len, const void *data);
EXTERNL int
nc_get_vlen_element(int ncid, int typeid1, const void *vlen_element,
size_t *len, void *data);
/* Find out about a user defined type. */
EXTERNL int
nc_inq_user_type(int ncid, nc_type xtype, char *name, size_t *size,
nc_type *base_nc_typep, size_t *nfieldsp, int *classp);
/* Write an attribute of any type. */
EXTERNL int
nc_put_att(int ncid, int varid, const char *name, nc_type xtype,
size_t len, const void *op);
/* Read an attribute of any type. */
EXTERNL int
nc_get_att(int ncid, int varid, const char *name, void *ip);
/* Enum type. */
/* Create an enum type. Provide a base type and a name. At the moment
* only ints are accepted as base types. */
EXTERNL int
nc_def_enum(int ncid, nc_type base_typeid, const char *name,
nc_type *typeidp);
/* Insert a named value into an enum type. The value must fit within
* the size of the enum type, the name size must be <= NC_MAX_NAME. */
EXTERNL int
nc_insert_enum(int ncid, nc_type xtype, const char *name,
const void *value);
/* Get information about an enum type: its name, base type and the
* number of members defined. */
EXTERNL int
nc_inq_enum(int ncid, nc_type xtype, char *name, nc_type *base_nc_typep,
size_t *base_sizep, size_t *num_membersp);
/* Get information about an enum member: a name and value. Name size
* will be <= NC_MAX_NAME. */
EXTERNL int
nc_inq_enum_member(int ncid, nc_type xtype, int idx, char *name,
void *value);
/* Get enum name from enum value. Name size will be <= NC_MAX_NAME. */
/* If value is zero and there is no matching ident, then return _UNDEFINED */
#define NC_UNDEFINED_ENUM_IDENT "_UNDEFINED"
EXTERNL int
nc_inq_enum_ident(int ncid, nc_type xtype, long long value, char *identifier);
/* Opaque type. */
/* Create an opaque type. Provide a size and a name. */
EXTERNL int
nc_def_opaque(int ncid, size_t size, const char *name, nc_type *xtypep);
/* Get information about an opaque type. */
EXTERNL int
nc_inq_opaque(int ncid, nc_type xtype, char *name, size_t *sizep);
/* Write entire var of any type. */
EXTERNL int
nc_put_var(int ncid, int varid, const void *op);
/* Read entire var of any type. */
EXTERNL int
nc_get_var(int ncid, int varid, void *ip);
/* Write one value. */
EXTERNL int
nc_put_var1(int ncid, int varid, const size_t *indexp,
const void *op);
/* Read one value. */
EXTERNL int
nc_get_var1(int ncid, int varid, const size_t *indexp, void *ip);
/* Write an array of values. */
EXTERNL int
nc_put_vara(int ncid, int varid, const size_t *startp,
const size_t *countp, const void *op);
/* Read an array of values. */
EXTERNL int
nc_get_vara(int ncid, int varid, const size_t *startp,
const size_t *countp, void *ip);
/* Write slices of an array of values. */
EXTERNL int
nc_put_vars(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const void *op);
/* Read slices of an array of values. */
EXTERNL int
nc_get_vars(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
void *ip);
/* Write mapped slices of an array of values. */
EXTERNL int
nc_put_varm(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t *imapp, const void *op);
/* Read mapped slices of an array of values. */
EXTERNL int
nc_get_varm(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t *imapp, void *ip);
/* Extra netcdf-4 stuff. */
/* Set quantization settings for a variable. Quantizing data improves
* later compression. Must be called after nc_def_var and before
* nc_enddef. */
EXTERNL int
nc_def_var_quantize(int ncid, int varid, int quantize_mode, int nsd);
/* Find out quantization settings of a var. */
EXTERNL int
nc_inq_var_quantize(int ncid, int varid, int *quantize_modep, int *nsdp);
/* Set compression settings for a variable. Lower is faster, higher is
* better. Must be called after nc_def_var and before nc_enddef. */
EXTERNL int
nc_def_var_deflate(int ncid, int varid, int shuffle, int deflate,
int deflate_level);
/* Find out compression settings of a var. */
EXTERNL int
nc_inq_var_deflate(int ncid, int varid, int *shufflep,
int *deflatep, int *deflate_levelp);
/* Set szip compression for a variable. */
EXTERNL int nc_def_var_szip(int ncid, int varid, int options_mask,
int pixels_per_block);
/* Find out szip settings of a var. */
EXTERNL int
nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp);
/* Set fletcher32 checksum for a var. This must be done after nc_def_var
and before nc_enddef. */
EXTERNL int
nc_def_var_fletcher32(int ncid, int varid, int fletcher32);
/* Inquire about fletcher32 checksum for a var. */
EXTERNL int
nc_inq_var_fletcher32(int ncid, int varid, int *fletcher32p);
/* Define chunking for a variable. This must be done after nc_def_var
and before nc_enddef. */
EXTERNL int
nc_def_var_chunking(int ncid, int varid, int storage, const size_t *chunksizesp);
/* Inq chunking stuff for a var. */
EXTERNL int
nc_inq_var_chunking(int ncid, int varid, int *storagep, size_t *chunksizesp);
/* Define fill value behavior for a variable. This must be done after
nc_def_var and before nc_enddef. */
EXTERNL int
nc_def_var_fill(int ncid, int varid, int no_fill, const void *fill_value);
/* Inq fill value setting for a var. */
EXTERNL int
nc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep);
/* Define the endianness of a variable. */
EXTERNL int
nc_def_var_endian(int ncid, int varid, int endian);
/* Learn about the endianness of a variable. */
EXTERNL int
nc_inq_var_endian(int ncid, int varid, int *endianp);
/* Define a filter for a variable */
EXTERNL int
nc_def_var_filter(int ncid, int varid, unsigned int id, size_t nparams, const unsigned int* parms);
/* Learn about the first filter on a variable */
EXTERNL int
nc_inq_var_filter(int ncid, int varid, unsigned int* idp, size_t* nparams, unsigned int* params);
/* Set the fill mode (classic or 64-bit offset files only). */
EXTERNL int
nc_set_fill(int ncid, int fillmode, int *old_modep);
/* Set the default nc_create format to NC_FORMAT_CLASSIC, NC_FORMAT_64BIT,
* NC_FORMAT_CDF5, NC_FORMAT_NETCDF4, or NC_FORMAT_NETCDF4_CLASSIC */
EXTERNL int
nc_set_default_format(int format, int *old_formatp);
/* Set the cache size, nelems, and preemption policy. */
EXTERNL int
nc_set_chunk_cache(size_t size, size_t nelems, float preemption);
/* Get the cache size, nelems, and preemption policy. */
EXTERNL int
nc_get_chunk_cache(size_t *sizep, size_t *nelemsp, float *preemptionp);
/* Set the per-variable cache size, nelems, and preemption policy. */
EXTERNL int
nc_set_var_chunk_cache(int ncid, int varid, size_t size, size_t nelems,
float preemption);
/* Get the per-variable cache size, nelems, and preemption policy. */
EXTERNL int
nc_get_var_chunk_cache(int ncid, int varid, size_t *sizep, size_t *nelemsp,
float *preemptionp);
EXTERNL int
nc_redef(int ncid);
/* Is this ever used? Convert to parameter form */
EXTERNL int
nc__enddef(int ncid, size_t h_minfree, size_t v_align,
size_t v_minfree, size_t r_align);
EXTERNL int
nc_enddef(int ncid);
EXTERNL int
nc_sync(int ncid);
EXTERNL int
nc_abort(int ncid);
EXTERNL int
nc_close(int ncid);
EXTERNL int
nc_inq(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp);
EXTERNL int
nc_inq_ndims(int ncid, int *ndimsp);
EXTERNL int
nc_inq_nvars(int ncid, int *nvarsp);
EXTERNL int
nc_inq_natts(int ncid, int *nattsp);
EXTERNL int
nc_inq_unlimdim(int ncid, int *unlimdimidp);
/* The next function is for NetCDF-4 only */
EXTERNL int
nc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp);
/* Added in 3.6.1 to return format of netCDF file. */
EXTERNL int
nc_inq_format(int ncid, int *formatp);
/* Added in 4.3.1 to return additional format info */
EXTERNL int
nc_inq_format_extended(int ncid, int *formatp, int* modep);
/* Begin _dim */
EXTERNL int
nc_def_dim(int ncid, const char *name, size_t len, int *idp);
EXTERNL int
nc_inq_dimid(int ncid, const char *name, int *idp);
EXTERNL int
nc_inq_dim(int ncid, int dimid, char *name, size_t *lenp);
EXTERNL int
nc_inq_dimname(int ncid, int dimid, char *name);
EXTERNL int
nc_inq_dimlen(int ncid, int dimid, size_t *lenp);
EXTERNL int
nc_rename_dim(int ncid, int dimid, const char *name);
/* End _dim */
/* Begin _att */
EXTERNL int
nc_inq_att(int ncid, int varid, const char *name,
nc_type *xtypep, size_t *lenp);
EXTERNL int
nc_inq_attid(int ncid, int varid, const char *name, int *idp);
EXTERNL int
nc_inq_atttype(int ncid, int varid, const char *name, nc_type *xtypep);
EXTERNL int
nc_inq_attlen(int ncid, int varid, const char *name, size_t *lenp);
EXTERNL int
nc_inq_attname(int ncid, int varid, int attnum, char *name);
EXTERNL int
nc_copy_att(int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out);
EXTERNL int
nc_rename_att(int ncid, int varid, const char *name, const char *newname);
EXTERNL int
nc_del_att(int ncid, int varid, const char *name);
/* End _att */
/* Begin {put,get}_att */
EXTERNL int
nc_put_att_text(int ncid, int varid, const char *name,
size_t len, const char *op);
EXTERNL int
nc_get_att_text(int ncid, int varid, const char *name, char *ip);
EXTERNL int
nc_put_att_string(int ncid, int varid, const char *name,
size_t len, const char **op);
EXTERNL int
nc_get_att_string(int ncid, int varid, const char *name, char **ip);
EXTERNL int
nc_put_att_uchar(int ncid, int varid, const char *name, nc_type xtype,
size_t len, const unsigned char *op);
EXTERNL int
nc_get_att_uchar(int ncid, int varid, const char *name, unsigned char *ip);
EXTERNL int
nc_put_att_schar(int ncid, int varid, const char *name, nc_type xtype,
size_t len, const signed char *op);
EXTERNL int
nc_get_att_schar(int ncid, int varid, const char *name, signed char *ip);
EXTERNL int
nc_put_att_short(int ncid, int varid, const char *name, nc_type xtype,
size_t len, const short *op);
EXTERNL int
nc_get_att_short(int ncid, int varid, const char *name, short *ip);
EXTERNL int
nc_put_att_int(int ncid, int varid, const char *name, nc_type xtype,
size_t len, const int *op);
EXTERNL int
nc_get_att_int(int ncid, int varid, const char *name, int *ip);
EXTERNL int
nc_put_att_long(int ncid, int varid, const char *name, nc_type xtype,
size_t len, const long *op);
EXTERNL int
nc_get_att_long(int ncid, int varid, const char *name, long *ip);
EXTERNL int
nc_put_att_float(int ncid, int varid, const char *name, nc_type xtype,
size_t len, const float *op);
EXTERNL int
nc_get_att_float(int ncid, int varid, const char *name, float *ip);
EXTERNL int
nc_put_att_double(int ncid, int varid, const char *name, nc_type xtype,
size_t len, const double *op);
EXTERNL int
nc_get_att_double(int ncid, int varid, const char *name, double *ip);
EXTERNL int
nc_put_att_ushort(int ncid, int varid, const char *name, nc_type xtype,
size_t len, const unsigned short *op);
EXTERNL int
nc_get_att_ushort(int ncid, int varid, const char *name, unsigned short *ip);
EXTERNL int
nc_put_att_uint(int ncid, int varid, const char *name, nc_type xtype,
size_t len, const unsigned int *op);
EXTERNL int
nc_get_att_uint(int ncid, int varid, const char *name, unsigned int *ip);
EXTERNL int
nc_put_att_longlong(int ncid, int varid, const char *name, nc_type xtype,
size_t len, const long long *op);
EXTERNL int
nc_get_att_longlong(int ncid, int varid, const char *name, long long *ip);
EXTERNL int
nc_put_att_ulonglong(int ncid, int varid, const char *name, nc_type xtype,
size_t len, const unsigned long long *op);
EXTERNL int
nc_get_att_ulonglong(int ncid, int varid, const char *name,
unsigned long long *ip);
/* End {put,get}_att */
/* Begin _var */
EXTERNL int
nc_def_var(int ncid, const char *name, nc_type xtype, int ndims,
const int *dimidsp, int *varidp);
EXTERNL int
nc_inq_var(int ncid, int varid, char *name, nc_type *xtypep,
int *ndimsp, int *dimidsp, int *nattsp);
EXTERNL int
nc_inq_varid(int ncid, const char *name, int *varidp);
EXTERNL int
nc_inq_varname(int ncid, int varid, char *name);
EXTERNL int
nc_inq_vartype(int ncid, int varid, nc_type *xtypep);
EXTERNL int
nc_inq_varndims(int ncid, int varid, int *ndimsp);
EXTERNL int
nc_inq_vardimid(int ncid, int varid, int *dimidsp);
EXTERNL int
nc_inq_varnatts(int ncid, int varid, int *nattsp);
EXTERNL int
nc_rename_var(int ncid, int varid, const char *name);
EXTERNL int
nc_copy_var(int ncid_in, int varid, int ncid_out);
#ifndef ncvarcpy
/* support the old name for now */
#define ncvarcpy(ncid_in, varid, ncid_out) ncvarcopy((ncid_in), (varid), (ncid_out))
#endif
/* End _var */
/* Begin {put,get}_var1 */
EXTERNL int
nc_put_var1_text(int ncid, int varid, const size_t *indexp, const char *op);
EXTERNL int
nc_get_var1_text(int ncid, int varid, const size_t *indexp, char *ip);
EXTERNL int
nc_put_var1_uchar(int ncid, int varid, const size_t *indexp,
const unsigned char *op);
EXTERNL int
nc_get_var1_uchar(int ncid, int varid, const size_t *indexp,
unsigned char *ip);
EXTERNL int
nc_put_var1_schar(int ncid, int varid, const size_t *indexp,
const signed char *op);
EXTERNL int
nc_get_var1_schar(int ncid, int varid, const size_t *indexp,
signed char *ip);
EXTERNL int
nc_put_var1_short(int ncid, int varid, const size_t *indexp,
const short *op);
EXTERNL int
nc_get_var1_short(int ncid, int varid, const size_t *indexp,
short *ip);
EXTERNL int
nc_put_var1_int(int ncid, int varid, const size_t *indexp, const int *op);
EXTERNL int
nc_get_var1_int(int ncid, int varid, const size_t *indexp, int *ip);
EXTERNL int
nc_put_var1_long(int ncid, int varid, const size_t *indexp, const long *op);
EXTERNL int
nc_get_var1_long(int ncid, int varid, const size_t *indexp, long *ip);
EXTERNL int
nc_put_var1_float(int ncid, int varid, const size_t *indexp, const float *op);
EXTERNL int
nc_get_var1_float(int ncid, int varid, const size_t *indexp, float *ip);
EXTERNL int
nc_put_var1_double(int ncid, int varid, const size_t *indexp, const double *op);
EXTERNL int
nc_get_var1_double(int ncid, int varid, const size_t *indexp, double *ip);
EXTERNL int
nc_put_var1_ushort(int ncid, int varid, const size_t *indexp,
const unsigned short *op);
EXTERNL int
nc_get_var1_ushort(int ncid, int varid, const size_t *indexp,
unsigned short *ip);
EXTERNL int
nc_put_var1_uint(int ncid, int varid, const size_t *indexp,
const unsigned int *op);
EXTERNL int
nc_get_var1_uint(int ncid, int varid, const size_t *indexp,
unsigned int *ip);
EXTERNL int
nc_put_var1_longlong(int ncid, int varid, const size_t *indexp,
const long long *op);
EXTERNL int
nc_get_var1_longlong(int ncid, int varid, const size_t *indexp,
long long *ip);
EXTERNL int
nc_put_var1_ulonglong(int ncid, int varid, const size_t *indexp,
const unsigned long long *op);
EXTERNL int
nc_get_var1_ulonglong(int ncid, int varid, const size_t *indexp,
unsigned long long *ip);
EXTERNL int
nc_put_var1_string(int ncid, int varid, const size_t *indexp,
const char **op);
EXTERNL int
nc_get_var1_string(int ncid, int varid, const size_t *indexp,
char **ip);
/* End {put,get}_var1 */
/* Begin {put,get}_vara */
EXTERNL int
nc_put_vara_text(int ncid, int varid, const size_t *startp,
const size_t *countp, const char *op);
EXTERNL int
nc_get_vara_text(int ncid, int varid, const size_t *startp,
const size_t *countp, char *ip);
EXTERNL int
nc_put_vara_uchar(int ncid, int varid, const size_t *startp,
const size_t *countp, const unsigned char *op);
EXTERNL int
nc_get_vara_uchar(int ncid, int varid, const size_t *startp,
const size_t *countp, unsigned char *ip);
EXTERNL int
nc_put_vara_schar(int ncid, int varid, const size_t *startp,
const size_t *countp, const signed char *op);
EXTERNL int
nc_get_vara_schar(int ncid, int varid, const size_t *startp,
const size_t *countp, signed char *ip);
EXTERNL int
nc_put_vara_short(int ncid, int varid, const size_t *startp,
const size_t *countp, const short *op);
EXTERNL int
nc_get_vara_short(int ncid, int varid, const size_t *startp,
const size_t *countp, short *ip);
EXTERNL int
nc_put_vara_int(int ncid, int varid, const size_t *startp,
const size_t *countp, const int *op);
EXTERNL int
nc_get_vara_int(int ncid, int varid, const size_t *startp,
const size_t *countp, int *ip);
EXTERNL int
nc_put_vara_long(int ncid, int varid, const size_t *startp,
const size_t *countp, const long *op);
EXTERNL int
nc_get_vara_long(int ncid, int varid,
const size_t *startp, const size_t *countp, long *ip);
EXTERNL int
nc_put_vara_float(int ncid, int varid,
const size_t *startp, const size_t *countp, const float *op);
EXTERNL int
nc_get_vara_float(int ncid, int varid,
const size_t *startp, const size_t *countp, float *ip);
EXTERNL int
nc_put_vara_double(int ncid, int varid, const size_t *startp,
const size_t *countp, const double *op);
EXTERNL int
nc_get_vara_double(int ncid, int varid, const size_t *startp,
const size_t *countp, double *ip);
EXTERNL int
nc_put_vara_ushort(int ncid, int varid, const size_t *startp,
const size_t *countp, const unsigned short *op);
EXTERNL int
nc_get_vara_ushort(int ncid, int varid, const size_t *startp,
const size_t *countp, unsigned short *ip);
EXTERNL int
nc_put_vara_uint(int ncid, int varid, const size_t *startp,
const size_t *countp, const unsigned int *op);
EXTERNL int
nc_get_vara_uint(int ncid, int varid, const size_t *startp,
const size_t *countp, unsigned int *ip);
EXTERNL int
nc_put_vara_longlong(int ncid, int varid, const size_t *startp,
const size_t *countp, const long long *op);
EXTERNL int
nc_get_vara_longlong(int ncid, int varid, const size_t *startp,
const size_t *countp, long long *ip);
EXTERNL int
nc_put_vara_ulonglong(int ncid, int varid, const size_t *startp,
const size_t *countp, const unsigned long long *op);
EXTERNL int
nc_get_vara_ulonglong(int ncid, int varid, const size_t *startp,
const size_t *countp, unsigned long long *ip);
EXTERNL int
nc_put_vara_string(int ncid, int varid, const size_t *startp,
const size_t *countp, const char **op);
EXTERNL int
nc_get_vara_string(int ncid, int varid, const size_t *startp,
const size_t *countp, char **ip);
/* End {put,get}_vara */
/* Begin {put,get}_vars */
EXTERNL int
nc_put_vars_text(int ncid, int varid,
const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
const char *op);
EXTERNL int
nc_get_vars_text(int ncid, int varid,
const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
char *ip);
EXTERNL int
nc_put_vars_uchar(int ncid, int varid,
const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
const unsigned char *op);
EXTERNL int
nc_get_vars_uchar(int ncid, int varid,
const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
unsigned char *ip);
EXTERNL int
nc_put_vars_schar(int ncid, int varid,
const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
const signed char *op);
EXTERNL int
nc_get_vars_schar(int ncid, int varid,
const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
signed char *ip);
EXTERNL int
nc_put_vars_short(int ncid, int varid,
const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
const short *op);
EXTERNL int
nc_get_vars_short(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
short *ip);
EXTERNL int
nc_put_vars_int(int ncid, int varid,
const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
const int *op);
EXTERNL int
nc_get_vars_int(int ncid, int varid,
const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
int *ip);
EXTERNL int
nc_put_vars_long(int ncid, int varid,
const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
const long *op);
EXTERNL int
nc_get_vars_long(int ncid, int varid,
const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
long *ip);
EXTERNL int
nc_put_vars_float(int ncid, int varid,
const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
const float *op);
EXTERNL int
nc_get_vars_float(int ncid, int varid,
const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
float *ip);
EXTERNL int
nc_put_vars_double(int ncid, int varid,
const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
const double *op);
EXTERNL int
nc_get_vars_double(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
double *ip);
EXTERNL int
nc_put_vars_ushort(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const unsigned short *op);
EXTERNL int
nc_get_vars_ushort(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
unsigned short *ip);
EXTERNL int
nc_put_vars_uint(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const unsigned int *op);
EXTERNL int
nc_get_vars_uint(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
unsigned int *ip);
EXTERNL int
nc_put_vars_longlong(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const long long *op);
EXTERNL int
nc_get_vars_longlong(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
long long *ip);
EXTERNL int
nc_put_vars_ulonglong(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const unsigned long long *op);
EXTERNL int
nc_get_vars_ulonglong(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
unsigned long long *ip);
EXTERNL int
nc_put_vars_string(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const char **op);
EXTERNL int
nc_get_vars_string(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
char **ip);
/* End {put,get}_vars */
/* Begin {put,get}_varm */
EXTERNL int
nc_put_varm_text(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t *imapp, const char *op);
EXTERNL int
nc_get_varm_text(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t *imapp, char *ip);
EXTERNL int
nc_put_varm_uchar(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t *imapp, const unsigned char *op);
EXTERNL int
nc_get_varm_uchar(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t *imapp, unsigned char *ip);
EXTERNL int
nc_put_varm_schar(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t *imapp, const signed char *op);
EXTERNL int
nc_get_varm_schar(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t *imapp, signed char *ip);
EXTERNL int
nc_put_varm_short(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t *imapp, const short *op);
EXTERNL int
nc_get_varm_short(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t *imapp, short *ip);
EXTERNL int
nc_put_varm_int(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t *imapp, const int *op);
EXTERNL int
nc_get_varm_int(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t *imapp, int *ip);
EXTERNL int
nc_put_varm_long(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t *imapp, const long *op);
EXTERNL int
nc_get_varm_long(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t *imapp, long *ip);
EXTERNL int
nc_put_varm_float(int ncid, int varid,const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t *imapp, const float *op);
EXTERNL int
nc_get_varm_float(int ncid, int varid,const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t *imapp, float *ip);
EXTERNL int
nc_put_varm_double(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t *imapp, const double *op);
EXTERNL int
nc_get_varm_double(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t * imapp, double *ip);
EXTERNL int
nc_put_varm_ushort(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t * imapp, const unsigned short *op);
EXTERNL int
nc_get_varm_ushort(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t * imapp, unsigned short *ip);
EXTERNL int
nc_put_varm_uint(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t * imapp, const unsigned int *op);
EXTERNL int
nc_get_varm_uint(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t * imapp, unsigned int *ip);
EXTERNL int
nc_put_varm_longlong(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t * imapp, const long long *op);
EXTERNL int
nc_get_varm_longlong(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t * imapp, long long *ip);
EXTERNL int
nc_put_varm_ulonglong(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t * imapp, const unsigned long long *op);
EXTERNL int
nc_get_varm_ulonglong(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t * imapp, unsigned long long *ip);
EXTERNL int
nc_put_varm_string(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t * imapp, const char **op);
EXTERNL int
nc_get_varm_string(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t * imapp, char **ip);
/* End {put,get}_varm */
/* Begin {put,get}_var */
EXTERNL int
nc_put_var_text(int ncid, int varid, const char *op);
EXTERNL int
nc_get_var_text(int ncid, int varid, char *ip);
EXTERNL int
nc_put_var_uchar(int ncid, int varid, const unsigned char *op);
EXTERNL int
nc_get_var_uchar(int ncid, int varid, unsigned char *ip);
EXTERNL int
nc_put_var_schar(int ncid, int varid, const signed char *op);
EXTERNL int
nc_get_var_schar(int ncid, int varid, signed char *ip);
EXTERNL int
nc_put_var_short(int ncid, int varid, const short *op);
EXTERNL int
nc_get_var_short(int ncid, int varid, short *ip);
EXTERNL int
nc_put_var_int(int ncid, int varid, const int *op);
EXTERNL int
nc_get_var_int(int ncid, int varid, int *ip);
EXTERNL int
nc_put_var_long(int ncid, int varid, const long *op);
EXTERNL int
nc_get_var_long(int ncid, int varid, long *ip);
EXTERNL int
nc_put_var_float(int ncid, int varid, const float *op);
EXTERNL int
nc_get_var_float(int ncid, int varid, float *ip);
EXTERNL int
nc_put_var_double(int ncid, int varid, const double *op);
EXTERNL int
nc_get_var_double(int ncid, int varid, double *ip);
EXTERNL int
nc_put_var_ushort(int ncid, int varid, const unsigned short *op);
EXTERNL int
nc_get_var_ushort(int ncid, int varid, unsigned short *ip);
EXTERNL int
nc_put_var_uint(int ncid, int varid, const unsigned int *op);
EXTERNL int
nc_get_var_uint(int ncid, int varid, unsigned int *ip);
EXTERNL int
nc_put_var_longlong(int ncid, int varid, const long long *op);
EXTERNL int
nc_get_var_longlong(int ncid, int varid, long long *ip);
EXTERNL int
nc_put_var_ulonglong(int ncid, int varid, const unsigned long long *op);
EXTERNL int
nc_get_var_ulonglong(int ncid, int varid, unsigned long long *ip);
EXTERNL int
nc_put_var_string(int ncid, int varid, const char **op);
EXTERNL int
nc_get_var_string(int ncid, int varid, char **ip);
/* Begin instance walking functions */
/* When you read an array of string typed instances, the library will allocate
* the storage space for the strings in the array (but not the array itself).
* The strings must be freed eventually, so pass the pointer to the array plus
* the number of elements in the array to this function when you're done with
* the data, and it will free the all the string instances.
* The caller is still responsible for free'ing the array itself,
* if it was dynamically allocated.
*/
EXTERNL int
nc_free_string(size_t nelems, char **data);
/* When you read an array of VLEN typed instances, the library will allocate
* the storage space for the data in each VLEN in the array (but not the array itself).
* That VLEN data must be freed eventually, so pass the pointer to the array plus
* the number of elements in the array to this function when you're done with
* the data, and it will free the all the VLEN instances.
* The caller is still responsible for free'ing the array itself,
* if it was dynamically allocated.
*
* WARNING: this function only works if the basetype of the vlen type
* is fixed size. This means it is an atomic type except NC_STRING,
* or an NC_ENUM, or and NC_OPAQUE, or an NC_COMPOUND where all
* the fields of the compound type are themselves fixed size.
*/
EXTERNL int
nc_free_vlens(size_t nelems, nc_vlen_t vlens[]);
/* This function is a special case of "nc_free_vlens" where nelem == 1 */
EXTERNL int
nc_free_vlen(nc_vlen_t *vl);
EXTERNL int nc_reclaim_data(int ncid, nc_type xtypeid, void* memory, size_t nelems);
EXTERNL int nc_reclaim_data_all(int ncid, nc_type xtypeid, void* memory, size_t nelems);
EXTERNL int nc_copy_data(int ncid, nc_type xtypeid, const void* memory, size_t count, void* copy);
EXTERNL int nc_copy_data_all(int ncid, nc_type xtypeid, const void* memory, size_t count, void** copyp);
/* end recursive instance walking functions */
/* Begin Deprecated, same as functions with "_ubyte" replaced by "_uchar" */
EXTERNL int
nc_put_att_ubyte(int ncid, int varid, const char *name, nc_type xtype,
size_t len, const unsigned char *op);
EXTERNL int
nc_get_att_ubyte(int ncid, int varid, const char *name,
unsigned char *ip);
EXTERNL int
nc_put_var1_ubyte(int ncid, int varid, const size_t *indexp,
const unsigned char *op);
EXTERNL int
nc_get_var1_ubyte(int ncid, int varid, const size_t *indexp,
unsigned char *ip);
EXTERNL int
nc_put_vara_ubyte(int ncid, int varid, const size_t *startp,
const size_t *countp, const unsigned char *op);
EXTERNL int
nc_get_vara_ubyte(int ncid, int varid, const size_t *startp,
const size_t *countp, unsigned char *ip);
EXTERNL int
nc_put_vars_ubyte(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const unsigned char *op);
EXTERNL int
nc_get_vars_ubyte(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
unsigned char *ip);
EXTERNL int
nc_put_varm_ubyte(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t * imapp, const unsigned char *op);
EXTERNL int
nc_get_varm_ubyte(int ncid, int varid, const size_t *startp,
const size_t *countp, const ptrdiff_t *stridep,
const ptrdiff_t * imapp, unsigned char *ip);
EXTERNL int
nc_put_var_ubyte(int ncid, int varid, const unsigned char *op);
EXTERNL int
nc_get_var_ubyte(int ncid, int varid, unsigned char *ip);
/* End Deprecated */
/* Set the log level. 0 shows only errors, 1 only major messages,
* etc., to 5, which shows way too much information. */
EXTERNL int
nc_set_log_level(int new_level);
/* Use this to turn off logging by calling
nc_log_level(NC_TURN_OFF_LOGGING) */
#define NC_TURN_OFF_LOGGING (-1)
/* Show the netCDF library's in-memory metadata for a file. */
EXTERNL int
nc_show_metadata(int ncid);
/* End {put,get}_var */
/* Delete a file. */
EXTERNL int
nc_delete(const char *path);
/*
* The following functions were written to accommodate the old Cray
* systems. Modern HPC systems do not use these functions any more,
* but use the nc_open_par()/nc_create_par() functions instead. These
* functions are retained for backward compatibibility. These
* functions work as advertised, but you can only use "processor
* element" 0.
*/
EXTERNL int
nc__create_mp(const char *path, int cmode, size_t initialsz, int basepe,
size_t *chunksizehintp, int *ncidp);
EXTERNL int
nc__open_mp(const char *path, int mode, int basepe,
size_t *chunksizehintp, int *ncidp);
EXTERNL int
nc_delete_mp(const char *path, int basepe);
EXTERNL int
nc_set_base_pe(int ncid, int pe);
EXTERNL int
nc_inq_base_pe(int ncid, int *pe);
/* This v2 function is used in the nc_test program. */
EXTERNL int
nctypelen(nc_type datatype);
/* Begin v2.4 backward compatibility */
#define FILL_BYTE NC_FILL_BYTE
#define FILL_CHAR NC_FILL_CHAR
#define FILL_SHORT NC_FILL_SHORT
#define FILL_LONG NC_FILL_INT
#define FILL_FLOAT NC_FILL_FLOAT
#define FILL_DOUBLE NC_FILL_DOUBLE
#define MAX_NC_DIMS NC_MAX_DIMS
#define MAX_NC_ATTRS NC_MAX_ATTRS
#define MAX_NC_VARS NC_MAX_VARS
#define MAX_NC_NAME NC_MAX_NAME
#define MAX_VAR_DIMS NC_MAX_VAR_DIMS
/*
* Global error status
*/
EXTERNL int ncerr;
#define NC_ENTOOL NC_EMAXNAME
#define NC_EXDR (-32)
#define NC_SYSERR (-31)
/*
* Global options variable.
* Used to determine behavior of error handler.
*/
#define NC_FATAL 1
#define NC_VERBOSE 2
EXTERNL int ncopts;
EXTERNL void
nc_advise(const char *cdf_routine_name, int err, const char *fmt,...);
typedef int nclong;
EXTERNL int
nccreate(const char* path, int cmode);
EXTERNL int
ncopen(const char* path, int mode);
EXTERNL int
ncsetfill(int ncid, int fillmode);
EXTERNL int
ncredef(int ncid);
EXTERNL int
ncendef(int ncid);
EXTERNL int
ncsync(int ncid);
EXTERNL int
ncabort(int ncid);
EXTERNL int
ncclose(int ncid);
EXTERNL int
ncinquire(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimp);
EXTERNL int
ncdimdef(int ncid, const char *name, long len);
EXTERNL int
ncdimid(int ncid, const char *name);
EXTERNL int
ncdiminq(int ncid, int dimid, char *name, long *lenp);
EXTERNL int
ncdimrename(int ncid, int dimid, const char *name);
EXTERNL int
ncattput(int ncid, int varid, const char *name, nc_type xtype,
int len, const void *op);
EXTERNL int
ncattinq(int ncid, int varid, const char *name, nc_type *xtypep, int *lenp);
EXTERNL int
ncattget(int ncid, int varid, const char *name, void *ip);
EXTERNL int
ncattcopy(int ncid_in, int varid_in, const char *name, int ncid_out,
int varid_out);
EXTERNL int
ncattname(int ncid, int varid, int attnum, char *name);
EXTERNL int
ncattrename(int ncid, int varid, const char *name, const char *newname);
EXTERNL int
ncattdel(int ncid, int varid, const char *name);
EXTERNL int
ncvardef(int ncid, const char *name, nc_type xtype,
int ndims, const int *dimidsp);
EXTERNL int
ncvarid(int ncid, const char *name);
EXTERNL int
ncvarinq(int ncid, int varid, char *name, nc_type *xtypep,
int *ndimsp, int *dimidsp, int *nattsp);
EXTERNL int
ncvarput1(int ncid, int varid, const long *indexp, const void *op);
EXTERNL int
ncvarget1(int ncid, int varid, const long *indexp, void *ip);
EXTERNL int
ncvarput(int ncid, int varid, const long *startp, const long *countp,
const void *op);
EXTERNL int
ncvarget(int ncid, int varid, const long *startp, const long *countp,
void *ip);
EXTERNL int
ncvarputs(int ncid, int varid, const long *startp, const long *countp,
const long *stridep, const void *op);
EXTERNL int
ncvargets(int ncid, int varid, const long *startp, const long *countp,
const long *stridep, void *ip);
EXTERNL int
ncvarputg(int ncid, int varid, const long *startp, const long *countp,
const long *stridep, const long *imapp, const void *op);
EXTERNL int
ncvargetg(int ncid, int varid, const long *startp, const long *countp,
const long *stridep, const long *imapp, void *ip);
EXTERNL int
ncvarrename(int ncid, int varid, const char *name);
EXTERNL int
ncrecinq(int ncid, int *nrecvarsp, int *recvaridsp, long *recsizesp);
EXTERNL int
ncrecget(int ncid, long recnum, void **datap);
EXTERNL int
ncrecput(int ncid, long recnum, void *const *datap);
/* This function may be called to force the library to
initialize itself. It is not required, however.
*/
EXTERNL int nc_initialize(void);
/* This function may be called to force the library to
cleanup global memory so that memory checkers will not
report errors. It is not required, however.
*/
EXTERNL int nc_finalize(void);
/* Programmatic access to the internal .rc table */
/* Get the value corresponding to key | return NULL; caller frees result */
EXTERNL char* nc_rc_get(const char* key);
/* Set/overwrite the value corresponding to key */
EXTERNL int nc_rc_set(const char* key, const char* value);
#if defined(__cplusplus)
}
#endif
/* Define two hard-coded functionality-related
(as requested by community developers) macros.
This is not going to be standard practice.
Don't remove without an in-place replacement of some sort,
the are now (for better or worse) used by downstream
software external to Unidata. */
#ifndef NC_HAVE_RENAME_GRP
#define NC_HAVE_RENAME_GRP
#endif
#ifndef NC_HAVE_INQ_FORMAT_EXTENDED
#define NC_HAVE_INQ_FORMAT_EXTENDED
#endif
#define NC_HAVE_META_H
#endif /* _NETCDF_ */
nc_get_att_int
EXTERNL int nc_get_att_int(int ncid, int varid, const char *name, int *ip)
Get an attribute array of type int.
Definition dattget.c:354
nc_get_att_string
EXTERNL int nc_get_att_string(int ncid, int varid, const char *name, char **ip)
Get an attribute array of type string.
Definition dattget.c:711
nc_put_att
EXTERNL int nc_put_att(int ncid, int varid, const char *name, nc_type xtype, size_t len, const void *op)
Write an attribute of any type.
Definition dattput.c:222
nc_get_att
EXTERNL int nc_get_att(int ncid, int varid, const char *name, void *ip)
Get an attribute of any type.
Definition dattget.c:133
nc_get_att_float
EXTERNL int nc_get_att_float(int ncid, int varid, const char *name, float *ip)
Get an attribute array of type float.
Definition dattget.c:420
nc_get_att_long
EXTERNL int nc_get_att_long(int ncid, int varid, const char *name, long *ip)
Get an attribute array of type long.
Definition dattget.c:387
nc_get_att_uchar
EXTERNL int nc_get_att_uchar(int ncid, int varid, const char *name, unsigned char *ip)
Get an attribute of an signed char type.
Definition dattget.c:288
nc_inq_attid
EXTERNL int nc_inq_attid(int ncid, int varid, const char *name, int *idp)
Find an attribute ID.
Definition dattinq.c:164
nc_get_att_longlong
EXTERNL int nc_get_att_longlong(int ncid, int varid, const char *name, long long *ip)
Get an attribute array of type long long.
Definition dattget.c:585
nc_put_att_uint
EXTERNL int nc_put_att_uint(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned int *op)
Write an attribute of type unsigned int.
Definition dattput.c:562
nc_get_att_ubyte
EXTERNL int nc_get_att_ubyte(int ncid, int varid, const char *name, unsigned char *ip)
Get an attribute array of type unsigned char.
Definition dattget.c:486
nc_put_att_string
EXTERNL int nc_put_att_string(int ncid, int varid, const char *name, size_t len, const char **op)
Write a string attribute.
Definition dattput.c:75
nc_inq_natts
EXTERNL int nc_inq_natts(int ncid, int *nattsp)
Find number of global or group attributes.
Definition dattinq.c:300
nc_put_att_ubyte
EXTERNL int nc_put_att_ubyte(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned char *op)
Write an attribute of type unsigned char.
Definition dattput.c:494
nc_put_att_text
EXTERNL int nc_put_att_text(int ncid, int varid, const char *name, size_t len, const char *op)
Write a text attribute.
Definition dattput.c:153
nc_put_att_schar
EXTERNL int nc_put_att_schar(int ncid, int varid, const char *name, nc_type xtype, size_t len, const signed char *op)
Write an attribute of type signed char.
Definition dattput.c:256
nc_put_att_ushort
EXTERNL int nc_put_att_ushort(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned short *op)
Write an attribute of type unsigned short.
Definition dattput.c:528
nc_put_att_long
EXTERNL int nc_put_att_long(int ncid, int varid, const char *name, nc_type xtype, size_t len, const long *op)
Write an attribute of type long.
Definition dattput.c:392
nc_put_att_float
EXTERNL int nc_put_att_float(int ncid, int varid, const char *name, nc_type xtype, size_t len, const float *op)
Write an attribute of type float.
Definition dattput.c:426
nc_put_att_uchar
EXTERNL int nc_put_att_uchar(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned char *op)
Write an attribute of type unsigned char.
Definition dattput.c:290
nc_get_att_ulonglong
EXTERNL int nc_get_att_ulonglong(int ncid, int varid, const char *name, unsigned long long *ip)
Get an attribute array of type unsigned long long.
Definition dattget.c:618
nc_get_att_text
EXTERNL int nc_get_att_text(int ncid, int varid, const char *name, char *ip)
Get a text attribute.
Definition dattget.c:222
nc_get_att_short
EXTERNL int nc_get_att_short(int ncid, int varid, const char *name, short *ip)
Get an attribute array of type short.
Definition dattget.c:321
nc_inq_att
EXTERNL int nc_inq_att(int ncid, int varid, const char *name, nc_type *xtypep, size_t *lenp)
Return information about a netCDF attribute.
Definition dattinq.c:86
nc_get_att_schar
EXTERNL int nc_get_att_schar(int ncid, int varid, const char *name, signed char *ip)
Get an attribute of an signed char type.
Definition dattget.c:255
nc_put_att_longlong
EXTERNL int nc_put_att_longlong(int ncid, int varid, const char *name, nc_type xtype, size_t len, const long long *op)
Write an attribute of type long long.
Definition dattput.c:596
nc_get_att_double
EXTERNL int nc_get_att_double(int ncid, int varid, const char *name, double *ip)
Get an attribute array of type double.
Definition dattget.c:453
nc_inq_atttype
EXTERNL int nc_inq_atttype(int ncid, int varid, const char *name, nc_type *xtypep)
Find the type of an attribute.
Definition dattinq.c:358
nc_put_att_ulonglong
EXTERNL int nc_put_att_ulonglong(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned long long *op)
Write an attribute of type unsigned long long.
Definition dattput.c:631
nc_put_att_int
EXTERNL int nc_put_att_int(int ncid, int varid, const char *name, nc_type xtype, size_t len, const int *op)
Write an attribute of type int.
Definition dattput.c:358
nc_del_att
EXTERNL int nc_del_att(int ncid, int varid, const char *name)
Delete an attribute.
Definition datt.c:177
nc_rename_att
EXTERNL int nc_rename_att(int ncid, int varid, const char *name, const char *newname)
Rename an attribute.
Definition datt.c:113
nc_get_att_ushort
EXTERNL int nc_get_att_ushort(int ncid, int varid, const char *name, unsigned short *ip)
Get an attribute array of type unsigned short.
Definition dattget.c:519
nc_put_att_short
EXTERNL int nc_put_att_short(int ncid, int varid, const char *name, nc_type xtype, size_t len, const short *op)
Write an attribute of type short.
Definition dattput.c:324
nc_inq_attname
EXTERNL int nc_inq_attname(int ncid, int varid, int attnum, char *name)
Find the name of an attribute.
Definition dattinq.c:255
nc_inq_attlen
EXTERNL int nc_inq_attlen(int ncid, int varid, const char *name, size_t *lenp)
Find the length of an attribute.
Definition dattinq.c:424
nc_get_att_uint
EXTERNL int nc_get_att_uint(int ncid, int varid, const char *name, unsigned int *ip)
Get an attribute array of type unsigned int.
Definition dattget.c:552
nc_put_att_double
EXTERNL int nc_put_att_double(int ncid, int varid, const char *name, nc_type xtype, size_t len, const double *op)
Write an attribute of type double.
Definition dattput.c:460
nc_inq_user_format
EXTERNL int nc_inq_user_format(int mode_flag, NC_Dispatch **dispatch_table, char *magic_number)
Inquire about user-defined format.
Definition dfile.c:179
nc__create
EXTERNL int nc__create(const char *path, int cmode, size_t initialsz, size_t *chunksizehintp, int *ncidp)
Create a netCDF file with some extra parameters controlling classic file caching.
Definition dfile.c:470
nc_close
EXTERNL int nc_close(int ncid)
Close an open netCDF dataset.
Definition dfile.c:1300
nc_abort
EXTERNL int nc_abort(int ncid)
No longer necessary for user to invoke manually.
Definition dfile.c:1247
nc_create
EXTERNL int nc_create(const char *path, int cmode, int *ncidp)
Create a new netCDF file.
Definition dfile.c:398
nc_inq
EXTERNL int nc_inq(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp)
Inquire about a file or group.
Definition dfile.c:1635
nc_inq_format_extended
EXTERNL int nc_inq_format_extended(int ncid, int *formatp, int *modep)
Obtain more detailed (vis-a-vis nc_inq_format) format information about an open dataset.
Definition dfile.c:1582
nc__enddef
EXTERNL int nc__enddef(int ncid, size_t h_minfree, size_t v_align, size_t v_minfree, size_t r_align)
Leave define mode with performance tuning.
Definition dfile.c:1118
nc_set_fill
EXTERNL int nc_set_fill(int ncid, int fillmode, int *old_modep)
Change the fill-value mode to improve write performance.
Definition dfile.c:1474
nc__open
EXTERNL int nc__open(const char *path, int mode, size_t *chunksizehintp, int *ncidp)
Open a netCDF file with extra performance parameters for the classic library.
Definition dfile.c:721
nc_inq_path
EXTERNL int nc_inq_path(int ncid, size_t *pathlen, char *path)
Get the file pathname (or the opendap URL) which was used to open/create the ncid's file.
Definition dfile.c:898
nc_def_user_format
EXTERNL int nc_def_user_format(int mode_flag, NC_Dispatch *dispatch_table, char *magic_number)
Add handling of user-defined format.
Definition dfile.c:123
nc_get_chunk_cache
EXTERNL int nc_get_chunk_cache(size_t *sizep, size_t *nelemsp, float *preemptionp)
Get current netCDF chunk cache settings.
Definition nc4cache.c:95
nc_inq_type
EXTERNL int nc_inq_type(int ncid, nc_type xtype, char *name, size_t *size)
Inquire about a type.
Definition dfile.c:1728
nc_enddef
EXTERNL int nc_enddef(int ncid)
Leave define mode.
Definition dfile.c:1027
nc_redef
EXTERNL int nc_redef(int ncid)
Put open netcdf dataset into define mode.
Definition dfile.c:963
nc_open
EXTERNL int nc_open(const char *path, int mode, int *ncidp)
Open an existing netCDF file.
Definition dfile.c:664
nc_set_chunk_cache
EXTERNL int nc_set_chunk_cache(size_t size, size_t nelems, float preemption)
Set chunk cache size.
Definition nc4cache.c:66
nc_inq_format
EXTERNL int nc_inq_format(int ncid, int *formatp)
Inquire about the binary format of a netCDF file as presented by the API.
Definition dfile.c:1547
nc_sync
EXTERNL int nc_sync(int ncid)
Synchronize an open netcdf dataset to disk.
Definition dfile.c:1195
nc_inq_ndims
EXTERNL int nc_inq_ndims(int ncid, int *ndimsp)
Find the number of dimensions.
Definition ddim.c:317
nc_inq_dimlen
EXTERNL int nc_inq_dimlen(int ncid, int dimid, size_t *lenp)
Find the length of a dimension.
Definition ddim.c:467
nc_inq_dimname
EXTERNL int nc_inq_dimname(int ncid, int dimid, char *name)
Find out the name of a dimension.
Definition ddim.c:409
nc_def_dim
EXTERNL int nc_def_dim(int ncid, const char *name, size_t len, int *idp)
Define a new dimension.
Definition ddim.c:121
nc_rename_dim
EXTERNL int nc_rename_dim(int ncid, int dimid, const char *name)
Rename a dimension.
Definition ddim.c:285
nc_inq_dim
EXTERNL int nc_inq_dim(int ncid, int dimid, char *name, size_t *lenp)
Find the name and length of a dimension.
Definition ddim.c:216
nc_inq_unlimdim
EXTERNL int nc_inq_unlimdim(int ncid, int *unlimdimidp)
Find the ID of the unlimited dimension.
Definition ddim.c:350
nc_inq_dimid
EXTERNL int nc_inq_dimid(int ncid, const char *name, int *idp)
Find the ID of a dimension from the name.
Definition ddim.c:152
nc_strerror
EXTERNL const char * nc_strerror(int ncerr)
Given an error number, return an error message.
Definition derror.c:87
nc_inq_typeids
EXTERNL int nc_inq_typeids(int ncid, int *ntypes, int *typeids)
Retrieve a list of types associated with a group.
Definition dgroup.c:223
nc_inq_dimids
EXTERNL int nc_inq_dimids(int ncid, int *ndims, int *dimids, int include_parents)
Retrieve a list of dimension ids associated with a group.
Definition dgroup.c:205
nc_inq_grps
EXTERNL int nc_inq_grps(int ncid, int *numgrps, int *ncids)
Get a list of groups or subgroups from a file or groupID.
Definition dgroup.c:73
nc_show_metadata
EXTERNL int nc_show_metadata(int ncid)
Print the metadata for a file.
Definition dgroup.c:299
nc_inq_grp_full_ncid
EXTERNL int nc_inq_grp_full_ncid(int ncid, const char *full_name, int *grp_ncid)
Get the full ncid given a group name.
Definition dgroup.c:169
nc_inq_grpname
EXTERNL int nc_inq_grpname(int ncid, char *name)
Get the name of a group given an ID.
Definition dgroup.c:88
nc_inq_ncid
EXTERNL int nc_inq_ncid(int ncid, const char *name, int *grp_ncid)
Return the group ID for a group given the name.
Definition dgroup.c:56
nc_inq_varids
EXTERNL int nc_inq_varids(int ncid, int *nvars, int *varids)
Get a list of varids associated with a group given a group ID.
Definition dgroup.c:187
nc_inq_grp_parent
EXTERNL int nc_inq_grp_parent(int ncid, int *parent_ncid)
Get the ID of the parent based on a group ID.
Definition dgroup.c:136
nc_inq_grpname_len
EXTERNL int nc_inq_grpname_len(int ncid, size_t *lenp)
Get the length of a group name given an ID.
Definition dgroup.c:122
nc_inq_grpname_full
EXTERNL int nc_inq_grpname_full(int ncid, size_t *lenp, char *full_name)
Get the full path/groupname of a group/subgroup given an ID.
Definition dgroup.c:106
nc_def_grp
EXTERNL int nc_def_grp(int parent_ncid, const char *name, int *new_ncid)
Define a new group.
Definition dgroup.c:268
nc_rename_grp
EXTERNL int nc_rename_grp(int grpid, const char *name)
Rename a group.
Definition dgroup.c:284
nc_inq_grp_ncid
EXTERNL int nc_inq_grp_ncid(int ncid, const char *grp_name, int *grp_ncid)
Get a group ncid given the group name.
Definition dgroup.c:155
nc_def_enum
EXTERNL int nc_def_enum(int ncid, nc_type base_typeid, const char *name, nc_type *typeidp)
Create an enum type.
Definition denum.c:43
nc_inq_compound_fieldtype
EXTERNL int nc_inq_compound_fieldtype(int ncid, nc_type xtype, int fieldid, nc_type *field_typeidp)
Get information about one of the fields of a compound type.
Definition dcompound.c:383
nc_inq_type_equal
EXTERNL int nc_inq_type_equal(int ncid1, nc_type typeid1, int ncid2, nc_type typeid2, int *equal)
Learn if two types are equal.
Definition dtype.c:69
nc_inq_compound
EXTERNL int nc_inq_compound(int ncid, nc_type xtype, char *name, size_t *sizep, size_t *nfieldsp)
Learn about a compound type.
Definition dcompound.c:175
nc_inq_enum_member
EXTERNL int nc_inq_enum_member(int ncid, nc_type xtype, int idx, char *name, void *value)
Learn about a about a member of an enum type.
Definition denum.c:140
nc_insert_compound
EXTERNL int nc_insert_compound(int ncid, nc_type xtype, const char *name, size_t offset, nc_type field_typeid)
Insert a named field into a compound type.
Definition dcompound.c:99
nc_def_opaque
EXTERNL int nc_def_opaque(int ncid, size_t size, const char *name, nc_type *xtypep)
Create an opaque type.
Definition dopaque.c:33
nc_inq_compound_name
EXTERNL int nc_inq_compound_name(int ncid, nc_type xtype, char *name)
Learn the name of a compound type.
Definition dcompound.c:203
nc_inq_compound_field
EXTERNL int nc_inq_compound_field(int ncid, nc_type xtype, int fieldid, char *name, size_t *offsetp, nc_type *field_typeidp, int *ndimsp, int *dim_sizesp)
Get information about one of the fields of a compound type.
Definition dcompound.c:287
nc_def_vlen
EXTERNL int nc_def_vlen(int ncid, const char *name, nc_type base_typeid, nc_type *xtypep)
Use this function to define a variable length array type.
Definition dvlen.c:93
nc_inq_compound_fielddim_sizes
EXTERNL int nc_inq_compound_fielddim_sizes(int ncid, nc_type xtype, int fieldid, int *dim_sizes)
Get information about one of the fields of a compound type.
Definition dcompound.c:443
nc_free_vlen
EXTERNL int nc_free_vlen(nc_vlen_t *vl)
Free memory in a single VLEN object.
Definition dvlen.c:61
nc_inq_vlen
EXTERNL int nc_inq_vlen(int ncid, nc_type xtype, char *name, size_t *datum_sizep, nc_type *base_nc_typep)
Learn about a VLEN type.
Definition dvlen.c:121
nc_inq_opaque
EXTERNL int nc_inq_opaque(int ncid, nc_type xtype, char *name, size_t *sizep)
Learn about an opaque type.
Definition dopaque.c:61
nc_free_vlens
EXTERNL int nc_free_vlens(size_t nelems, nc_vlen_t vlens[])
Free an array of vlens given the number of elements and an array.
Definition dvlen.c:40
nc_def_compound
EXTERNL int nc_def_compound(int ncid, size_t size, const char *name, nc_type *typeidp)
Create a compound type.
Definition dcompound.c:63
nc_inq_compound_fieldindex
EXTERNL int nc_inq_compound_fieldindex(int ncid, nc_type xtype, const char *name, int *fieldidp)
Learn the Index of a Named Field in a Compound Type.
Definition dcompound.c:475
nc_inq_compound_fieldndims
EXTERNL int nc_inq_compound_fieldndims(int ncid, nc_type xtype, int fieldid, int *ndimsp)
Get information about one of the fields of a compound type.
Definition dcompound.c:413
nc_inq_compound_nfields
EXTERNL int nc_inq_compound_nfields(int ncid, nc_type xtype, size_t *nfieldsp)
Learn the number of fields in a compound type.
Definition dcompound.c:249
nc_insert_enum
EXTERNL int nc_insert_enum(int ncid, nc_type xtype, const char *name, const void *value)
Insert a named member into a enum type.
Definition denum.c:71
nc_inq_typeid
EXTERNL int nc_inq_typeid(int ncid, const char *name, nc_type *typeidp)
Find a type by name.
Definition dtype.c:102
nc_insert_array_compound
EXTERNL int nc_insert_array_compound(int ncid, nc_type xtype, const char *name, size_t offset, nc_type field_typeid, int ndims, const int *dim_sizes)
Insert a named array field into a compound type.
Definition dcompound.c:141
nc_inq_enum
EXTERNL int nc_inq_enum(int ncid, nc_type xtype, char *name, nc_type *base_nc_typep, size_t *base_sizep, size_t *num_membersp)
Learn about a user-define enumeration type.
Definition denum.c:107
nc_inq_enum_ident
EXTERNL int nc_inq_enum_ident(int ncid, nc_type xtype, long long value, char *identifier)
Get the name which is associated with an enum member value.
Definition denum.c:164
nc_inq_compound_fieldoffset
EXTERNL int nc_inq_compound_fieldoffset(int ncid, nc_type xtype, int fieldid, size_t *offsetp)
Get information about one of the fields of a compound type.
Definition dcompound.c:353
nc_inq_compound_fieldname
EXTERNL int nc_inq_compound_fieldname(int ncid, nc_type xtype, int fieldid, char *name)
Get information about one of the fields of a compound type.
Definition dcompound.c:321
nc_inq_compound_size
EXTERNL int nc_inq_compound_size(int ncid, nc_type xtype, size_t *sizep)
Learn the size of a compound type.
Definition dcompound.c:226
nc_inq_user_type
EXTERNL int nc_inq_user_type(int ncid, nc_type xtype, char *name, size_t *size, nc_type *base_nc_typep, size_t *nfieldsp, int *classp)
Learn about a user defined type.
Definition dtype.c:146
ncvardef
EXTERNL int ncvardef(int ncid, const char *name, nc_type xtype, int ndims, const int *dimidsp)
Define a variable.
Definition dv2i.c:856
ncclose
EXTERNL int ncclose(int ncid)
Close a file.
Definition dv2i.c:606
ncvarputg
EXTERNL int ncvarputg(int ncid, int varid, const long *startp, const long *countp, const long *stridep, const long *imapp, const void *op)
Write mapped data.
Definition dv2i.c:1231
ncattget
EXTERNL int ncattget(int ncid, int varid, const char *name, void *ip)
Read an attribute.
Definition dv2i.c:1479
ncattinq
EXTERNL int ncattinq(int ncid, int varid, const char *name, nc_type *xtypep, int *lenp)
Learn about an attribute.
Definition dv2i.c:1440
ncattrename
EXTERNL int ncattrename(int ncid, int varid, const char *name, const char *newname)
Rename an attribute.
Definition dv2i.c:1574
ncattname
EXTERNL int ncattname(int ncid, int varid, int attnum, char *name)
Learn attribute name from its number.
Definition dv2i.c:1543
ncvarput1
EXTERNL int ncvarput1(int ncid, int varid, const long *indexp, const void *op)
Write 1 data value.
Definition dv2i.c:965
ncvarid
EXTERNL int ncvarid(int ncid, const char *name)
Learn a variable ID from the name.
Definition dv2i.c:887
nccreate
EXTERNL int nccreate(const char *path, int cmode)
Create a netCDF file.
Definition dv2i.c:511
ncendef
EXTERNL int ncendef(int ncid)
End define mode for file.
Definition dv2i.c:583
ncopen
EXTERNL int ncopen(const char *path, int mode)
Open a netCDF file.
Definition dv2i.c:536
ncrecput
EXTERNL int ncrecput(int ncid, long recnum, void *const *datap)
Write one record's worth of data, except don't write to variables for which the address of the data t...
Definition dv2i.c:1754
ncattcopy
EXTERNL int ncattcopy(int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out)
Copy an attribute.
Definition dv2i.c:1511
ncdimrename
EXTERNL int ncdimrename(int ncid, int dimid, const char *name)
Rename a dimension.
Definition dv2i.c:825
ncattdel
EXTERNL int ncattdel(int ncid, int varid, const char *name)
Delete an attribute.
Definition dv2i.c:1604
ncvarputs
EXTERNL int ncvarputs(int ncid, int varid, const long *startp, const long *countp, const long *stridep, const void *op)
Write strided data.
Definition dv2i.c:1125
ncvarput
EXTERNL int ncvarput(int ncid, int varid, const long *startp, const long *countp, const void *op)
Write some data.
Definition dv2i.c:1040
ncdiminq
EXTERNL int ncdiminq(int ncid, int dimid, char *name, long *lenp)
Learn about a dimension.
Definition dv2i.c:788
ncvarget1
EXTERNL int ncvarget1(int ncid, int varid, const long *indexp, void *ip)
Read 1 data value.
Definition dv2i.c:1002
ncvargetg
EXTERNL int ncvargetg(int ncid, int varid, const long *startp, const long *countp, const long *stridep, const long *imapp, void *ip)
Read mapped data.
Definition dv2i.c:1304
ncinquire
EXTERNL int ncinquire(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimp)
Learn about a file.
Definition dv2i.c:635
ncvarinq
EXTERNL int ncvarinq(int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp)
Learn about a variable.
Definition dv2i.c:920
ncattput
EXTERNL int ncattput(int ncid, int varid, const char *name, nc_type xtype, int len, const void *op)
Write an attribute.
Definition dv2i.c:1405
nc_advise
EXTERNL void nc_advise(const char *cdf_routine_name, int err, const char *fmt,...)
Show an error message and exit (based on ncopts).
Definition dv2i.c:466
ncabort
EXTERNL int ncabort(int ncid)
Abort defining a file.
Definition dv2i.c:700
ncsync
EXTERNL int ncsync(int ncid)
Sync a file.
Definition dv2i.c:677
ncrecinq
EXTERNL int ncrecinq(int ncid, int *nrecvarsp, int *recvaridsp, long *recsizesp)
Learn record variables and the lengths of the record dimension.
Definition dv2i.c:1666
ncrecget
EXTERNL int ncrecget(int ncid, long recnum, void **datap)
Read one record's worth of data, except don't read from variables for which the address of the data t...
Definition dv2i.c:1723
ncsetfill
EXTERNL int ncsetfill(int ncid, int fillmode)
Set the fill mode.
Definition dv2i.c:1636
ncdimdef
EXTERNL int ncdimdef(int ncid, const char *name, long len)
Define a dimension.
Definition dv2i.c:726
ncvarget
EXTERNL int ncvarget(int ncid, int varid, const long *startp, const long *countp, void *ip)
Read some data.
Definition dv2i.c:1082
ncvargets
EXTERNL int ncvargets(int ncid, int varid, const long *startp, const long *countp, const long *stridep, void *ip)
Read strided data.
Definition dv2i.c:1178
ncredef
EXTERNL int ncredef(int ncid)
Put file in define mode.
Definition dv2i.c:560
ncvarrename
EXTERNL int ncvarrename(int ncid, int varid, const char *name)
Rename a variable.
Definition dv2i.c:1373
ncdimid
EXTERNL int ncdimid(int ncid, const char *name)
Find dimension ID from name.
Definition dv2i.c:761
nc_inq_var_endian
EXTERNL int nc_inq_var_endian(int ncid, int varid, int *endianp)
Find the endianness of a variable.
Definition dvarinq.c:582
nc_inq_varndims
EXTERNL int nc_inq_varndims(int ncid, int varid, int *ndimsp)
Learn how many dimensions are associated with a variable.
Definition dvarinq.c:202
nc_def_var_endian
EXTERNL int nc_def_var_endian(int ncid, int varid, int endian)
Define endianness of a variable.
Definition dvar.c:807
nc_inq_varname
EXTERNL int nc_inq_varname(int ncid, int varid, char *name)
Learn the name of a variable.
Definition dvarinq.c:156
nc_free_string
EXTERNL int nc_free_string(size_t nelems, char **data)
Free string space allocated by the library.
Definition dvar.c:1316
nc_inq_var_quantize
EXTERNL int nc_inq_var_quantize(int ncid, int varid, int *quantize_modep, int *nsdp)
Learn whether quantization is on for a variable, and, if so, the NSD setting.
Definition dvarinq.c:545
nc_def_var_szip
EXTERNL int nc_def_var_szip(int ncid, int varid, int options_mask, int pixels_per_block)
Set szip compression settings on a variable.
Definition dvar.c:864
nc_inq_var_deflate
EXTERNL int nc_inq_var_deflate(int ncid, int varid, int *shufflep, int *deflatep, int *deflate_levelp)
Learn the shuffle and deflate settings for a variable.
Definition dvarinq.c:295
nc_get_vars
EXTERNL int nc_get_vars(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, void *ip)
Read a strided array from a variable.
Definition dvarget.c:1173
nc_set_var_chunk_cache
EXTERNL int nc_set_var_chunk_cache(int ncid, int varid, size_t size, size_t nelems, float preemption)
Change the cache settings for a chunked variable.
Definition dvar.c:1394
nc_inq_vartype
EXTERNL int nc_inq_vartype(int ncid, int varid, nc_type *xtypep)
Learn the type of a variable.
Definition dvarinq.c:178
nc_inq_var_fletcher32
EXTERNL int nc_inq_var_fletcher32(int ncid, int varid, int *fletcher32p)
Learn the checksum settings for a variable.
Definition dvarinq.c:378
nc_inq_varid
EXTERNL int nc_inq_varid(int ncid, const char *name, int *varidp)
Find the ID of a variable, from the name.
Definition dvarinq.c:60
nc_put_varm
EXTERNL int nc_put_varm(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const void *op)
Write a mapped array of values to a variable.
Definition dvarput.c:1243
nc_inq_varnatts
EXTERNL int nc_inq_varnatts(int ncid, int varid, int *nattsp)
Learn how many attributes are associated with a variable.
Definition dvarinq.c:249
nc_put_var
EXTERNL int nc_put_var(int ncid, int varid, const void *op)
Write an entire variable with one call.
Definition dvarput.c:922
nc_get_vara
EXTERNL int nc_get_vara(int ncid, int varid, const size_t *startp, const size_t *countp, void *ip)
Read an array of values from a variable.
Definition dvarget.c:746
nc_def_var_deflate
EXTERNL int nc_def_var_deflate(int ncid, int varid, int shuffle, int deflate, int deflate_level)
Set the zlib compression and shuffle settings for a variable in an netCDF/HDF5 file.
Definition dvar.c:461
nc_put_vars
EXTERNL int nc_put_vars(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const void *op)
Write a strided array of values to a variable.
Definition dvarput.c:1048
nc_def_var_fletcher32
EXTERNL int nc_def_var_fletcher32(int ncid, int varid, int fletcher32)
Set checksum for a var.
Definition dvar.c:609
nc_def_var_quantize
EXTERNL int nc_def_var_quantize(int ncid, int varid, int quantize_mode, int nsd)
Turn on quantization for a variable.
Definition dvar.c:560
nc_get_var
EXTERNL int nc_get_var(int ncid, int varid, void *ip)
Read an entire variable in one call.
Definition dvarget.c:1038
nc_get_varm
EXTERNL int nc_get_varm(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, void *ip)
Read a mapped array from a variable.
Definition dvarget.c:1370
nc_inq_var
EXTERNL int nc_inq_var(int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp)
Learn about a variable.
Definition dvarinq.c:124
nc_inq_var_szip
EXTERNL int nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp)
Learn the szip settings of a variable.
Definition dvarinq.c:732
nc_inq_var_filter
EXTERNL int nc_inq_var_filter(int ncid, int varid, unsigned int *idp, size_t *nparams, unsigned int *params)
Find the first filter (if any) associated with a variable.
Definition dfilter.c:170
nc_inq_vardimid
EXTERNL int nc_inq_vardimid(int ncid, int varid, int *dimidsp)
Learn the dimension IDs associated with a variable.
Definition dvarinq.c:225
nc_get_var1
EXTERNL int nc_get_var1(int ncid, int varid, const size_t *indexp, void *ip)
Read a single datum from a variable.
Definition dvarget.c:894
nc_def_var_fill
EXTERNL int nc_def_var_fill(int ncid, int varid, int no_fill, const void *fill_value)
Set the fill value for a variable.
Definition dvar.c:309
nc_inq_var_chunking
EXTERNL int nc_inq_var_chunking(int ncid, int varid, int *storagep, size_t *chunksizesp)
Get the storage and (for chunked variables) the chunksizes of a variable.
Definition dvarinq.c:466
nc_def_var
EXTERNL int nc_def_var(int ncid, const char *name, nc_type xtype, int ndims, const int *dimidsp, int *varidp)
Define a new variable.
Definition dvar.c:214
nc_rename_var
EXTERNL int nc_rename_var(int ncid, int varid, const char *name)
Rename a variable.
Definition dvar.c:944
nc_put_var1
EXTERNL int nc_put_var1(int ncid, int varid, const size_t *indexp, const void *op)
Write one datum.
Definition dvarput.c:783
nc_put_vara
EXTERNL int nc_put_vara(int ncid, int varid, const size_t *startp, const size_t *countp, const void *op)
Write an array of values to a variable.
Definition dvarput.c:633
nc_def_var_chunking
EXTERNL int nc_def_var_chunking(int ncid, int varid, int storage, const size_t *chunksizesp)
Define storage and, if chunked storage is used, chunking parameters for a variable.
Definition dvar.c:729
nc_get_var_chunk_cache
EXTERNL int nc_get_var_chunk_cache(int ncid, int varid, size_t *sizep, size_t *nelemsp, float *preemptionp)
Get the per-variable chunk cache settings from the HDF5 layer.
Definition dvar.c:1435
nc_inq_var_fill
EXTERNL int nc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep)
Learn the fill mode of a variable.
Definition dvarinq.c:502
nc_inq_nvars
EXTERNL int nc_inq_nvars(int ncid, int *nvarsp)
Learn the number of variables in a file or group.
Definition dfile.c:1654
nc_inq_libvers
EXTERNL const char * nc_inq_libvers(void)
Return the library version.
Definition derror.c:27
nc_vlen_t::p
void * p
Pointer to VL data.
Definition netcdf.h:763
nc_reclaim_data
EXTERNL int nc_reclaim_data(int ncid, nc_type xtypeid, void *memory, size_t nelems)
Reclaim an array of instances of an arbitrary type.
nc_vlen_t::len
size_t len
Length of VL data (in base type units).
Definition netcdf.h:762
nc_inq_unlimdims
EXTERNL int nc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp)
Return number and list of unlimited dimensions.
Definition dvarinq.c:672
EXTERNL
#define EXTERNL
Needed for DLL build.
Definition netcdf.h:571
ncopts
EXTERNL int ncopts
V2 API error handling.
Definition netcdf.h:1981
nc_copy_data
EXTERNL int nc_copy_data(int ncid, nc_type xtypeid, const void *memory, size_t count, void *copy)
Copy vector of arbitrary type instances.
nclong
int nclong
C data type corresponding to a netCDF NC_LONG argument, a signed 32 bit object.
Definition netcdf.h:1991
nc_copy_att
EXTERNL int nc_copy_att(int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out)
Copy an attribute from one open file to another.
Definition dcopy.c:587
nc_copy_var
EXTERNL int nc_copy_var(int ncid_in, int varid, int ncid_out)
This will copy a variable that is an array of primitive type and its attributes from one file to anot...
Definition dcopy.c:282
nc_def_var_filter
EXTERNL int nc_def_var_filter(int ncid, int varid, unsigned int id, size_t nparams, const unsigned int *parms)
Define a new variable filter Assumes HDF5 format using unsigned ints.
Definition dfilter.c:129
nc_type
int nc_type
The nc_type type is just an int.
Definition netcdf.h:25
nc_vlen_t
This is the type of arrays of vlens.
Definition netcdf.h:761