logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

netcdf - Unidata's Network Common Data Form (netCDF) library interface

Attributes

intnc_put_att_text(intncid,intvarid,constcharname[],nc_typextype,size_tlen,constcharout[])intnc_put_att_uchar(intncid,intvarid,constcharname[],nc_typextype,size_tlen,constunsignedcharout[])intnc_put_att_schar(intncid,intvarid,constcharname[],nc_typextype,size_tlen,constsignedcharout[])intnc_put_att_short(intncid,intvarid,constcharname[],nc_typextype,size_tlen,constshortout[])intnc_put_att_int(intncid,intvarid,constcharname[],nc_typextype,size_tlen,constintout[])intnc_put_att_long(intncid,intvarid,constcharname[],nc_typextype,size_tlen,constlongout[])intnc_put_att_float(intncid,intvarid,constcharname[],nc_typextype,size_tlen,constfloatout[])intnc_put_att_double(intncid,intvarid,constcharname[],nc_typextype,size_tlen,constdoubleout[])intnc_put_att_ubyte(intncid,intvarid,constcharname[],nc_typextype,size_tlen,constunsignedcharout[])intnc_put_att_ushort(intncid,intvarid,constcharname[],nc_typextype,size_tlen,constunsignedshortout[])intnc_put_att_uint(intncid,intvarid,constcharname[],nc_typextype,size_tlen,constunsignedintout[])intnc_put_att_int64(intncid,intvarid,constcharname[],nc_typextype,size_tlen,constlonglongout[])intnc_put_att_uint64(intncid,intvarid,constcharname[],nc_typextype,size_tlen,constunsignedlonglongout[])intnc_put_att_string(intncid,intvarid,constcharname[],nc_typextype,size_tlen,constchar*out[])intnc_put_att(intncid,intvarid,constcharname[],nc_typextype,size_tlen,void*ip)intnc_get_att(intncid,intvarid,constcharname[],void**ip)

              Unlike variables, attributes do not have separate functions for defining and writing values.  This
              family  of  functions defines a new attribute with a value or changes the value of an existing at‐
              tribute.  If the attribute is new, or if the space  required  to  store  the  attribute  value  is
              greater  than  before, the netCDF dataset must be in define mode.  The parameter len is the number
              of values from out to transfer.  It is often one, except that for nc_put_att_text() it will usual‐
              ly be strlen(out).

              For these functions, the type component of the function name refers to the in-memory type  of  the
              value, whereas the xtype argument refers to the external type for storing the value.  An NC_ERANGE
              error results if a conversion between these types is not possible.  In this case the value is rep‐
              resented with the appropriate fill-value for the associated external type.

       intnc_inq_attname(intncid,intvarid,intattnum,charname[])

              Gets  the name of an attribute, given its variable ID and attribute number.  This function is use‐
              ful in generic applications that need to get the names of all the  attributes  associated  with  a
              variable,  since  attributes  are accessed by name rather than number in all other attribute func‐
              tions.  The number of an attribute is more volatile than the name, since it can change when  other
              attributes of the same variable are deleted.  The attributes for each variable are numbered from 0
              (the  first  attribute) to nvatts-1, where nvatts is the number of attributes for the variable, as
              returned from a call to nc_inq_varnatts().  If the name parameter is a NULL pointer, no name  will
              be returned and no space need be allocated.

       intnc_inq_att(intncid,intvarid,constcharname[],nc_type*xtype,size_t*len)intnc_inq_attid(intncid,intvarid,constcharname[],int*attnum)intnc_inq_atttype(intncid,intvarid,constcharname[],nc_type*xtype)intnc_inq_attlen(intncid,intvarid,constcharname[],size_t*len)

              These  functions return information about a netCDF attribute, given its variable ID and name.  The
              information returned is the external type in xtype and the number of elements in the attribute  as
              len.   If any of the return arguments is a NULL pointer, the specified information will not be re‐
              turned.

       intnc_copy_att(intncid,intvarid_in,constcharname[],intncid_out,intvarid_out)

              Copies an attribute from one netCDF dataset to another.  It can also be used to copy an  attribute
              from  one variable to another within the same netCDF.  ncid_in is the netCDF ID of an input netCDF
              dataset from which the attribute will be copied.  varid_in is the ID of the variable in the  input
              netCDF dataset from which the attribute will be copied, or NC_GLOBAL for a global attribute.  name
              is  the name of the attribute in the input netCDF dataset to be copied.  ncid_out is the netCDF ID
              of the output netCDF dataset to which the attribute will be copied.  It is permissible for the in‐
              put and output netCDF ID's to be the same.  The output netCDF dataset should be in define mode  if
              the attribute to be copied does not already exist for the target variable, or if it would cause an
              existing  target  attribute  to  grow.   varid_out  is the ID of the variable in the output netCDF
              dataset to which the attribute will be copied, or NC_GLOBAL to copy to a global attribute.

       intnc_rename_att(intncid,intvarid,constcharname[],constcharnewname[])

              Changes the name of an attribute.  If the new name is longer than the original  name,  the  netCDF
              must be in define mode.  You cannot rename an attribute to have the same name as another attribute
              of  the  same  variable.   name is the original attribute name.  newname is the new name to be as‐
              signed to the specified attribute.  If the new name is  longer  than  the  old  name,  the  netCDF
              dataset must be in define mode.

       intnc_del_att(intncid,intvarid,constcharname[])

              Deletes an attribute from a netCDF dataset.  The dataset must be in define mode.

       intnc_get_att_text(intncid,intvarid,constcharname[],charin[])intnc_get_att_uchar(intncid,intvarid,constcharname[],unsignedcharin[])intnc_get_att_schar(intncid,intvarid,constcharname[],signedcharin[])intnc_get_att_short(intncid,intvarid,constcharname[],shortin[])intnc_get_att_int(intncid,intvarid,constcharname[],intin[])intnc_get_att_long(intncid,intvarid,constcharname[],longin[])intnc_get_att_float(intncid,intvarid,constcharname[],floatin[])intnc_get_att_double(intncid,intvarid,constcharname[],doublein[])intnc_get_att_ubyte(intncid,intvarid,constcharname[],unsignedcharin[])intnc_get_att_ushort(intncid,intvarid,constcharname[],unsignedshortin[])intnc_get_att_uint(intncid,intvarid,constcharname[],unsignedintin[])intnc_get_att_int64(intncid,intvarid,constcharname[],longlongin[])intnc_get_att_uint64(intncid,intvarid,constcharname[],unsignedlonglongin[])intnc_get_att_string(intncid,intvarid,constcharname[],char*in[])

              Gets the value(s) of a netCDF attribute, given its variable ID and name.  Converts from the exter‐
              nal  type  to the type specified in the function name, if possible, otherwise returns an NC_ERANGE
              error.  All elements of the vector of attribute values are returned, so you must  allocate  enough
              space  to  hold  them.  If you don't know how much space to reserve, call nc_inq_attlen() first to
              find out the length of the attribute.

Common Argument Descriptions

       In this section we define some common arguments which are used in the "FUNCTION DESCRIPTIONS" section.

       int ncid
              is the netCDF ID returned from a previous, successful call to nc_open() or nc_create()

       char name[]
              is the name of a dimension, variable, or attribute. The names of dimensions, variables and attrib‐
              utes consist of arbitrary sequences of alphanumeric characters (as well as underscore '_',  period
              '.'  and hyphen '-'), beginning with a letter or underscore. (However names commencing with under‐
              score are reserved for system use.) Case is significant in netCDF names. A zero-length name is not
              allowed.  As an input argument, it shall be a pointer to a 0-terminated string; as an output argu‐
              ment, it shall be the address of a buffer in which to hold such a string.  The  maximum  allowable
              number of characters (excluding the terminating 0) is NC_MAX_NAME.

       nc_type xtype
              specifies  the  external  data type of a netCDF variable or attribute and is one of the following:
              NC_BYTE, NC_CHAR, NC_SHORT, NC_INT, NC_FLOAT, or NC_DOUBLE.  These are used to specify 8-bit inte‐
              gers, characters, 16-bit integers, 32-bit integers, 32-bit IEEE floating point numbers, and 64-bit
              IEEE floating-point numbers, respectively.  (NC_INT corresponds to NC_LONG in version 2, to speci‐
              fy a 32-bit integer).

       int dimids[]
              is a vector of dimension ID's and defines the shape of a netCDF variable.  The size of the  vector
              shall  be  greater  than  or  equal  to  the  rank (i.e. the number of dimensions) of the variable
              (ndims).  The vector shall be ordered by the speed with which a dimension varies:  dimids[ndims-1]
              shall  be the dimension ID of the most rapidly varying dimension and dimids[0] shall be the dimen‐
              sion ID of the most slowly varying dimension.  The maximum possible number  of  dimensions  for  a
              variable is given by the symbolic constant NC_MAX_VAR_DIMS.

       int dimid
              is  the  ID of a netCDF dimension.  netCDF dimension ID's are allocated sequentially from the non-
              negative integers beginning with 0.

       int ndims
              is either the total number of dimensions in a netCDF dataset or the rank (i.e. the number  of  di‐
              mensions) of a netCDF variable.  The value shall not be negative or greater than the symbolic con‐
              stant NC_MAX_VAR_DIMS.

       int varid
              is  the  ID  of  a  netCDF  variable or (for the attribute-access functions) the symbolic constant
              NC_GLOBAL, which is used to reference global attributes.  netCDF variable ID's are  allocated  se‐
              quentially from the non-negative integers beginning with 0.

       int* natts
              is  the number of global attributes in a netCDF dataset  for the nc_inquire() function or the num‐
              ber of attributes associated with a netCDF variable for the nc_varinq() function.

       const size_t index[]
              specifies the indicial coordinates of the netCDF data value to be accessed.  The indices start  at
              0;  thus,  for  example, the first data value of a two-dimensional variable is (0,0).  The size of
              the vector shall be at least the rank of the associated netCDF variable  and  its  elements  shall
              correspond, in order, to the variable's dimensions.

       const size_t start[]
              specifies  the  starting point for accessing a netCDF variable's data values in terms of the indi‐
              cial coordinates of the corner of the array section.  The indices start at 0; thus, the first data
              value of a variable is (0, 0, ..., 0).  The size of the vector shall be at least the rank  of  the
              associated  netCDF  variable and its elements shall correspond, in order, to the variable's dimen‐
              sions.

       const size_t count[]
              specifies the number of indices selected along each dimension of the array section.  Thus, to  ac‐
              cess  a  single  value, for example, specify count as (1, 1, ..., 1).  Note that, for strided I/O,
              this argument must be adjusted to be compatible with the stride and start arguments  so  that  the
              interaction  of the three does not attempt to access an invalid data co-ordinate.  The elements of
              the count vector correspond, in order, to the variable's dimensions.

       const size_t stride[]
              specifies the sampling interval along each dimension of the netCDF variable.   The elements of the
              stride vector correspond, in order, to the netCDF variable's dimensions (stride[0]) gives the sam‐
              pling interval along the most slowly varying dimension of the netCDF variable).   Sampling  inter‐
              vals  are  specified  in type-independent units of elements (a value of 1 selects consecutive ele‐
              ments of the netCDF variable along the corresponding dimension, a value of 2 selects  every  other
              element, etc.).  A NULL stride argument is treated as (1, 1, ... , 1).

       imap   specifies  the  mapping between the dimensions of a netCDF variable and the in-memory structure of
              the internal data array.  The elements of the index mapping vector correspond, in  order,  to  the
              netCDF  variable's  dimensions  (imap[0] gives the distance between elements of the internal array
              corresponding to the most slowly varying dimension of the netCDF variable).  Distances between el‐
              ements are specified in type-independent units of elements (the distance between internal elements
              that occupy adjacent memory locations is 1 and not the element's byte-length as in netCDF  2).   A
              NULL  pointer  means  the  memory-resident values have the same structure as the associated netCDF
              variable.

Dimensions

intnc_inq_dimid(intncid,constcharname[],int*dimid)

              (Corresponds to ncdimid() in version 2)

              Given a dimension name, returns the ID of a netCDF dimension in dimid.

       intnc_inq_dim(intncid,intdimid,charname[],size_t*len)intnc_inq_dimname(intncid,intdimid,charname[])intnc_inq_dimlen(intncid,intdimid,size_t*len)

              Use these functions to find out about a dimension.  If either the name argument or len argument is
              a NULL pointer, then the associated information will not be returned.  Otherwise, name  should  be
              big  enough (NC_MAX_NAME) to hold the dimension name as the name will be copied into your storage.
              The length return parameter, len will contain the size of the dimension.  For the unlimited dimen‐
              sion, the returned length is the current maximum value used for writing into any of the  variables
              which use the dimension.

       intnc_rename_dim(intncid,intdimid,constcharname[])

              (Corresponds to ncdimrename() in version 2)

              Renames  an  existing dimension in an open netCDF dataset.  If the new name is longer than the old
              name, the netCDF dataset must be in define mode.  You cannot rename a dimension to have  the  same
              name as another dimension.

Environment Variables

NETCDF_FFIOSPEC
           Specifies the Flexible File I/O buffers for netCDF I/O when executing under the UNICOS operating sys‐
           tem  (the  variable is ignored on other operating systems).  An appropriate specification can greatly
           increase the efficiency of netCDF I/O -- to the extent that it can actually  surpass  FORTRAN  binary
           I/O.   This environment variable has been made a little more generalized, such that other FFIO option
           specifications can now be added.  The default specification is  bufa:336:2,  unless  a  current  FFIO
           specification is in operation, which will be honored.  See UNICOS Flexible File I/O for more informa‐
           tion.

File Operations

intnc_create(constcharpath[],intcmode,int*ncid)

              Creates a new netCDF dataset at path, returning a netCDF ID in ncid.  The argument cmode  may  in‐
              clude  the  bitwise-or  of the following flags: NC_NOCLOBBER to protect existing datasets (default
              silently blows them away), NC_SHARE for synchronous dataset updates for classic format files  (de‐
              fault is to buffer accesses),

              When  a  netCDF  dataset  is  created, is is opened NC_WRITE.  The new netCDF dataset is in define
              mode.  NC_64BIT_OFFSET.  to create a file in the 64-bit offset format (as opposed to classic  for‐
              mat, the default).  NC_TRUE to create a netCDF-4/HDF5 file, and NC_CLASSIC_MODEL to guarantee that
              netCDF-4/HDF5 files maintain compatibility with the netCDF classic data model.

       intnc__create(constcharpath[],intcmode,size_tinitialsize,size_t*chunksize,int*ncid)

              Like nc_create() but has additional performance tuning parameters.

              The argument initialsize sets the initial size of the file at creation time.

              See nc__open() below for an explanation of the chunksize parameter.

       intnc_open(constcharpath[],intmode,int*ncid)

              (Corresponds to ncopen() in version 2)

              Opens  a existing netCDF dataset at path returning a netCDF ID in ncid.  The type of access is de‐
              scribed by the mode parameter, which may include the bitwise-or of the following  flags:  NC_WRITE
              for read-write access (default read-only), NC_SHARE for synchronous dataset updates (default is to
              buffer accesses), and NC_LOCK (not yet implemented).

       intnc__open(constcharpath[],intmode,size_t*chunksize,int*ncid)

              Like nc_open() but has an additional performance tuning parameter.

              The  argument  referenced  by chunksize controls a space versus time tradeoff, memory allocated in
              the netcdf library versus number of system calls.  Because of internal requirements, the value may
              not be set to exactly the value requested.  The actual value chosen is returned by reference.  Us‐
              ing the value NC_SIZEHINT_DEFAULT causes the library to choose a default.  How the  system  choses
              the  default  depends on the system.  On many systems, the "preferred I/O block size" is available
              from the stat() system call, structstat member st_blksize.  If this  is  available  it  is  used.
              Lacking  that, twice the system pagesize is used.  Lacking a call to discover the system pagesize,
              we just set default chunksize to 8192.

              The chunksize is a property of a given open netcdf descriptor ncid, it is not a persistent proper‐
              ty of the netcdf dataset.

       intnc_redef(intncid)

              (Corresponds to ncredef() in version 2)

              Puts an open netCDF dataset into define mode, so dimensions,  variables,  and  attributes  can  be
              added or renamed and attributes can be deleted.

       intnc_enddef(intncid)

              (Corresponds to ncendef() in version 2)

              Takes  an open netCDF dataset out of define mode.  The changes made to the netCDF dataset while it
              was in define mode are checked and committed to disk if no problems occurred.   Some  data  values
              may  be  written as well, see "VARIABLE PREFILLING" below.  After a successful call, variable data
              can be read or written to the dataset.

       intnc__enddef(intncid,size_th_minfree,size_tv_align,size_tv_minfree,size_tr_align)

              Like nc_enddef() but has additional performance tuning parameters.

              Caution: this function exposes internals of the netcdf version 1  file  format.   It  may  not  be
              available on future netcdf implementations.

              The  current  netcdf  file  format  has three sections, the "header" section, the data section for
              fixed size variables, and the data section for variables which have an unlimited dimension (record
              variables).  The header begins at the beginning of the file. The index (offset) of  the  beginning
              of  the  other  two  sections is contained in the header. Typically, there is no space between the
              sections. This causes copying overhead to accrue if one wishes to change the size of the sections,
              as may happen when changing names of things, text attribute values, adding  attributes  or  adding
              variables. Also, for buffered i/o, there may be advantages to aligning sections in certain ways.

              The  minfree  parameters  allow one to control costs of future calls to nc_redef(), nc_enddef() by
              requesting that minfree bytes be available at the end of the  section.   The  h_minfree  parameter
              sets  the  pad at the end of the "header" section. The v_minfree parameter sets the pad at the end
              of the data section for fixed size variables.

              The align parameters allow one to set the alignment of the beginning  of  the  corresponding  sec‐
              tions. The beginning of the section is rounded up to an index which is a multiple of the align pa‐
              rameter.  The  flag value NC_ALIGN_CHUNK tells the library to use the chunksize (see above) as the
              align parameter.  The v_align parameter controls the alignment of the beginning of the  data  sec‐
              tion  for  fixed size variables.  The r_align parameter controls the alignment of the beginning of
              the data section for variables which have an unlimited dimension (record variables).

              The file format requires mod 4 alignment, so the align parameters are silently rounded up to  mul‐
              tiples of 4. The usual call, nc_enddef(ncid) is equivalent to nc__enddef(ncid,0,4,0,4).

              The  file  format does not contain a "record size" value, this is calculated from the sizes of the
              record variables. This unfortunate fact prevents us from providing minfree and  alignment  control
              of  the  "records"  in  a netcdf file. If you add a variable which has an unlimited dimension, the
              third section will always be copied with the new variable added.

       intnc_sync(intncid)

              (Corresponds to ncsync() in version 2)

              Unless the NC_SHARE bit is set in nc_open() or nc_create(),  accesses  to  the  underlying  netCDF
              dataset  are  buffered  by  the  library.  This  function synchronizes the state of the underlying
              dataset and the library.  This is done automatically by nc_close() and nc_enddef().

       intnc_abort(intncid)

              (Corresponds to ncabort() in version 2)

              You don't need to call this function.  This function is called automatically by nc_close() if  the
              netCDF  was  in define mode and something goes wrong with the commit.  If the netCDF dataset isn't
              in define mode, then this function is equivalent to nc_close().  If it is called after nc_redef(),
              but before nc_enddef(), the new definitions are not committed and the dataset is closed.  If it is
              called after nc_create() but before nc_enddef(), the dataset disappears.

       intnc_close(intncid)

              (Corresponds to ncclose() in version 2)

              Closes an open netCDF dataset.  If the dataset is in define mode, nc_enddef() will be  called  be‐
              fore closing.  After a dataset is closed, its ID may be reassigned to another dataset.

       intnc_inq(intncid,int*ndims,int*nvars,int*natts,int*unlimdimid)intnc_inq_ndims(intncid,int*ndims)intnc_inq_nvars(intncid,int*nvars)intnc_inq_natts(intncid,int*natts)intnc_inq_unlimdim(intncid,int*unlimdimid)intnc_inq_format(intncid,int*formatn)

              Use  these  functions to find out what is in a netCDF dataset.  Upon successful return, ndims will
              contain  the number of dimensions defined for this netCDF dataset, nvars will contain  the  number
              of  variables, natts will contain the number of attributes, and unlimdimid will contain the dimen‐
              sion ID of the unlimited dimension if one exists, or -1 otherwise.  formatn will contain the  ver‐
              sion  number  of  the  dataset <format>, one of NC_FORMAT_CLASSIC, NC_FORMAT_64BIT_OFFSET, NC_FOR‐MAT_NETCDF4, or NC_FORMAT_NETCDF4_CLASSIC.  If any of the return parameters  is  a  NULL  pointer,
              then the corresponding information will not be returned; hence, no space need be allocated for it.

       intnc_def_dim(intncid,constcharname[],size_tlen,int*dimid)

              (Corresponds to ncdimdef() in version 2)

              Adds  a new dimension to an open netCDF dataset, which must be in define mode.  name is the dimen‐
              sion name.  If dimid is not a NULL pointer then upon successful completion dimid will contain  the
              dimension ID of the newly created dimension.

Groups

       Users may organize data into hierarchical groups in netCDF-4/HDF5 files (unless NC_CLASSIC_MODEL was used
       when creating the file).

       intnc_inq_grps(intncid,int*numgrps,intncids[])

              Learn how many groups (and their ncids) are available from the group represented by ncid.

       intnc_inq_grpname(intncid,charname[])intnc_inq_grpname_full(intncid,size_t*len,charname[])intnc_inq_grpname_len(intncid,size_t*len)intnc_inq_grp_parent(intncid,int*ncid)intnc_inq_grp_ncid(intncid,charname[],int*ncid)intnc_inq_full_ncid(intncid,charname[],int*ncid)

              Learn about a group.

       intnc_inq_varids(intncid,int*nvars,int*)

              Get the varids in a group.

       intnc_inq_dimids(intncid,int*ndims,int*dimids,intinclude_parents)

              Get the dimids in a group and (potentially) its parents.

       intnc_inq_typeids(intncid,int*ntypes,inttypeids[])

              Get the typeids of user-defined types in a group.

       intnc_def_grp(intncid,charname[],int*ncid)

              Create a group.

Library Version

       This document describes versions 3 and 4 of Unidata netCDF data-access interface for  the  C  programming
       language.

       constchar*nc_inq_libvers()

              Returns a string identifying the version of the netCDF library, and when it was built, like: "3.1a
              of Aug 22 1996 12:57:47 $".

       The  RCS  ident(1)  command will find a string like "$Id: @(#) netcdf library version 3.1a of Sep  6 1996
       15:56:26 $" in the library. The SCCS what(1) command will find a string like "netcdf library version 3.1a
       of Aug 23 1996 16:07:40 $".

Mailing-Lists

       Both  a  mailing list and a digest are available for discussion of the netCDF interface and announcements
       about netCDF bugs, fixes, and enhancements.  To begin or change your subscription to either the  mailing-
       list  or  the digest, send one of the following in the body (not the subject line) of an email message to
       "majordomo@unidata.ucar.edu".  Use your email address in place of jdoe@host.inst.domain.

       To subscribe to the netCDF mailing list:
              subscribenetcdfgroupjdoe@host.inst.domain
       To unsubscribe from the netCDF mailing list:
              unsubscribenetcdfgroupjdoe@host.inst.domain
       To subscribe to the netCDF digest:
              subscribenetcdfdigestjdoe@host.inst.domain
       To unsubscribe from the netCDF digest:
              unsubscribenetcdfdigestjdoe@host.inst.domain
       To retrieve the general introductory information for the mailing list:
              infonetcdfgroup
       To get a synopsis of other majordomo commands:
              help

Mpp Function Descriptions

       These functions were used on archaic SGI/Cray MPP machines. These functions  are  retained  for  backward
       compatibility; the PE arguments must all be set to zero.

       intnc__create_mp(constcharpath[],intcmode,size_tinitialsize,intpe,size_t*chunksize,int*ncid)

              Like nc__create().

              The argument pe must be zero.

       intnc__open_mp(constcharpath[],intmode,intpe,size_t*chunksize,int*ncid)

              Like nc__open().  The argument pe must be zero.

       intnc_inq_base_pe(intncid,int*pe)

              Always returns pe of zero.

       intnc_set_base_pe(intncid,intpe)

              This function does nothing.

Name

       netcdf - Unidata's Network Common Data Form (netCDF) library interface

Return Values

       All netCDF functions (except nc_inq_libvers() and nc_strerror()) return an integer status.

       If this returned status value is not equal to NC_NOERR (zero), it indicates that an error  occurred.  The
       possible status values are defined in system include file <errno.h> and in "netcdf.h".

       constchar*nc_strerror(intstatus)

              Returns  a  string  textual translation of the status value, like "Attribute or variable name con‐
              tains illegal characters" or "No such file or directory".

See Also

ncdump(1), ncgen(1), netcdf(3).

       netCDFUser'sGuide, published by the Unidata Program Center, University Corporation for Atmospheric  Re‐
       search, located in Boulder, Colorado.

       NetCDF home page at http:/www.unidata.ucar.edu/netcdf.

Printed: 2025-08-22                                1997-04-18                                          NETCDF(3)

Synopsis

#include"netcdf.h"cc...-lnetcdf-lhdf5_hl-lhdf5-lz-lmCompletedocumentationforthenetCDFlibrariescanbefoundatthenetCDFwebsite:https://www.unida‐ta.ucar.edu/software/netcdf/.

User Defined Types

       Users  many define types for a netCDF-4/HDF5 file (unless the NC_CLASSIC_MODEL was used when the file was
       creates). Users may define compound types, variable length arrays, enumeration types, and opaque types.

       intnc_def_compound(intncid,size_tsize,constcharname[],int*typeidp)

              Define a compound type.

       intnc_insert_compound(intncid,nc_type,constcharname[],size_toffset,nc_typefield_typeid)

              Insert an element into a compound type. May not be done after type has been  used,  or  after  the
              type has been written by an enddef.

       intnc_insert_array_compound(intncid,nc_type,constcharname[],size_toffset,nc_typefield_typeid,intndims,constintdim_sizes[])

              Insert an array into a compound type.

       intnc_inq_type(intncid,nc_type,charname[],size_t*sizep)

              Learn about a type.

       intnc_inq_compound(intncid,nc_type,charname[],size_t*sizep,size_t*nfieldsp)intnc_inq_compound_name(intncid,nc_type,charname[])intnc_inq_compound_size(intncid,nc_type,size_t*sizep)intnc_inq_compound_nfields(intncid,nc_type,size_t*nfieldsp)intnc_inq_compound_fieldname(intncid,nc_type,intfieldid,charname[])intnc_inq_compound_fieldindex(intncid,nc_type,constcharname[],int*fieldidp)intnc_inq_compound_fieldoffset(intncid,nc_type,intfieldid,size_t*offsetp)intnc_inq_compound_fieldtype(intncid,nc_type,intfieldid,nc_type*field_typeid)intnc_inq_compound_fieldndims(intncid,nc_type,intfieldid,int*ndims)intnc_inq_compound_fielddim_sizes(intncid,nc_type,intfieldid,intdim_sizes[])

              Learn about a compound type.

       intnc_def_vlen(intncid,constcharname[],nc_typebase_typeid,nc_type*xtypep)

              Create a variable length array type.

       intnc_inq_vlen(intncid,nc_type,charname[],size_t*datum_sizep,nc_type*base_nc_typep)

              Learn about a variable length array type.

       intnc_free_vlen(nc_vlen_t*vl)

              Free memory consumed by reading data of a variable length array type.

       intnc_put_vlen_element(intncid,nc_type,void*vlen_element,size_tlen,void*data)

              Write one VLEN.

       intnc_get_vlen_element(intncid,nc_type,void**vlen_element,size_tlen,void**data)

              Read one VLEN.

       intnc_free_string(size_tlen,char**data)

              Free memory consumed by reading data of a string type.

       intnc_inq_user_type(intncid,nc_type,charname[],size_t*,nc_type*,size_t*,int*)

              Learn about a user define type.

       intnc_def_enum(intncid,nc_typebase_typeid,constcharname[],nc_type*typeidp)

              Define an enumeration type.

       intnc_insert_enum(intncid,nc_typebase_typeid,constcharname[],constvoid*value)

              Insert a name-value pair into enumeration type.

       intnc_inq_enum_member(intncid,nc_typextype,intidx,charname[],void*value)intnc_inq_enum_ident(intncid,nc_typextype,intidx,longlongvalue,charidentifier[])

              Learn about a name-value pair into enumeration type.

       intnc_def_opaque(intncid,size_tsize,constcharname[],nc_type*xtypep)

              Create an opaque type.

       intnc_inq_opaque(intncid,nc_typextype,charname[],size_t*sizep)

              Learn about opaque type.

Variable Prefilling

       By default, the netCDF interface sets the values of all newly-defined variables of  finite  length  (i.e.
       those  that  do  not  have an unlimited, dimension) to the type-dependent fill-value associated with each
       variable.  This is done when nc_enddef() is called.  The fill-value for a variable may  be  changed  from
       the  default value by defining the attribute `_FillValue' for the variable.  This attribute must have the
       same type as the variable and be of length one.

       Variables with an unlimited dimension are also prefilled, but on an `as needed' basis.  For  example,  if
       the  first write of such a variable is to position 5, then positions 0 through 4 (and no others) would be
       set to the fill-value at the same time.

       This default prefilling of data values may be disabled by or'ing the NC_NOFILL flag into the mode parame‐
       ter of nc_open() or nc_create(), or, by calling the function nc_set_fill() with the  argument  NC_NOFILL.
       For  variables  that  do not use the unlimited dimension, this call must be made before nc_enddef().  For
       variables that use the unlimited dimension, this call may be made at any time.

       One can obtain increased performance of the netCDF interface by using this feature, but only at  the  ex‐
       pense of requiring the application to set every single data value.  The performance enhancing behavior of
       this  function  is dependent on the particulars of the implementation and dataset format.  The flag value
       controlled by nc_set_fill() is per netCDF ID, not per variable or per write.  Allowing this to change af‐
       fects the degree to which a program can be effectively parallelized.  Given all of this,  we  state  that
       the  use  of  this feature may not be available (or even needed) in future releases. Programmers are cau‐
       tioned against heavy reliance upon this feature.

       intnc_setfill(intncid,intfillmode,int*old_fillemode)

              (Corresponds to ncsetfill() in version 2)

              Determines whether or not variable prefilling will be done (see above).  The netCDF dataset  shall
              be  writable.   fillmode is either NC_FILL to enable prefilling (the default) or NC_NOFILL to dis‐
              able prefilling.  This function returns the previous setting in old_fillmode.

Variables

intnc_def_var(intncid,constcharname[],nc_typextype,intndims,constintdimids[],int*varid)

              (Corresponds to ncvardef() in version 2)

              Adds  a  new  variable  to a netCDF dataset. The netCDF must be in define mode.  If not NULL, then
              varid will be set to the netCDF variable ID.

       intnc_inq_varid(intncid,constcharname[],int*varid)

              (Corresponds to ncvarid() in version 2)

              Returns the ID of a netCDF variable in varid given its name.

       intnc_inq_var(intncid,intvarid,charname[],nc_type*xtype,int*ndims,intdimids[],int*natts)intnc_inq_varname(intncid,intvarid,charname[])intnc_inq_vartype(intncid,intvarid,nc_type*xtype)intnc_inq_varndims(intncid,intvarid,int*ndims)intnc_inq_vardimid(intncid,intvarid,intdimids[])intnc_inq_varnatts(intncid,intvarid,int*natts)

              Returns information about a netCDF variable, given its ID.  If any of the return parameters (name,
              xtype, ndims, dimids, or natts) is a NULL pointer, then the corresponding information will not  be
              returned; hence, no space need be allocated for it.

       intnc_rename_var(intncid,intvarid,constcharname[])

              (Corresponds to ncvarrename() in version 2)

              Changes  the  name  of a netCDF variable.  If the new name is longer than the old name, the netCDF
              must be in define mode.  You cannot rename a variable to have the name of any existing variable.

Variables In Netcdf-4 Files

       The following functions may only be used on variables in a netCDF-4/HDF5 data file. These functions  must
       be called after the variable is defined, but before an enddef call.

       intnc_def_var_deflate(intncid,intvarid,intshuffle,intdeflate,intdeflate_level)

       Turn on compression and/or shuffle filter. (Shuffle filter is only useful for integer data.)

       intnc_inq_var_deflate(intncid,intvarid,int*shufflep,int*deflatep,int*deflate_levelp)

              Learn about a variable's deflate settings.

       intnc_def_var_fletcher32(intncid,intvarid,intfletcher32)

              Turn on checksumming for a variable.

       intnc_inq_var_fletcher32(intncid,intvarid,int*fletcher32)

              Learn about checksumming for a variable.

       intnc_def_var_chunking(intncid,intvarid,intstorage,constsize_tchunksizesp[])

              Set chunksizes for a variable.

       intnc_inq_var_chunking(intncid,intvarid,int*storagep,size_tchunksizesp[])

              Learn about chunksizes for a variable.

       intnc_def_var_fill(intncid,intvarid,intno_fill,constsize_tchunksizesp[])

              Set a fill value for a variable.

       intnc_inq_var_fill(intncid,intvarid,int*storagep,size_tchunksizesp[])

              Learn the fill value for a variable.

       intnc_def_var_endian(intncid,intvarid,intendian)

              Set endianness of variable.

       intnc_inq_var_endian(intncid,intvarid,int*endianp)

              Learn the endianness of a variable.

Writing And Reading A Mapped Array

intnc_put_varm_text(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,constcharout[])intnc_put_varm_uchar(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,constunsignedcharout[])intnc_put_varm_schar(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,constsignedcharout[])intnc_put_varm_short(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,constshortout[])intnc_put_varm_int(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,constintout[])intnc_put_varm_long(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,constlongout[])intnc_put_varm_float(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,constfloatout[])intnc_put_varm_double(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,constdoubleout[])intnc_put_varm_ubyte(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,constunsignedcharout[])intnc_put_varm_ushort(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,constunsignedshortout[])intnc_put_varm_uint(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,constunsignedintout[])intnc_put_varm_int64(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,constlonglongout[])intnc_put_varm_uint64(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,constunsignedlonglongout[])intnc_put_varm_string(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,constchar*out[])

              These functions are used for mappedoutput, which is like strided output described  above,  except
              that  an  additional  index mapping vector is provided to specify the in-memory arrangement of the
              data values.  For an explanation of the index mapping vector, see  COMMON  ARGUMENTS  DESCRIPTIONS
              below.

       intnc_get_varm_text(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,charin[])intnc_get_varm_uchar(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,unsignedcharin[])intnc_get_varm_schar(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,signedcharin[])intnc_get_varm_short(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,shortin[])intnc_get_varm_int(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,intin[])intnc_get_varm_long(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,longin[])intnc_get_varm_float(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,floatin[])intnc_get_varm_double(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,doublein[])intnc_get_varm_ubyte(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,unsignedcharin[])intnc_get_varm_ushort(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,unsignedshortin[])intnc_get_varm_uint(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,unsignedintin[])intnc_get_varm_int64(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,longlongin[])intnc_get_varm_uint64(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,unsignedlonglongin[])intnc_get_varm_string(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],imap,char*in[])

              These  functions  are  used  for mappedinput, which is like strided input described above, except
              that an additional index mapping vector is provided to specify the in-memory  arrangement  of  the
              data  values.   For  an explanation of the index mapping vector, see COMMON ARGUMENTS DESCRIPTIONS
              below.

Writing And Reading A Sliced Array

intnc_put_vars_text(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],constcharout[])intnc_put_vars_uchar(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],constunsignedcharout[])intnc_put_vars_schar(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],constsignedcharout[])intnc_put_vars_short(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],constshortout[])intnc_put_vars_int(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],constintout[])intnc_put_vars_long(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],constlongout[])intnc_put_vars_float(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],constfloatout[])intnc_put_vars_double(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],constdoubleout[])intnc_put_vars_ubyte(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],constunsignedcharout[])intnc_put_vars_ushort(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],constunsignedshortout[])intnc_put_vars_uint(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],constunsignedintout[])intnc_put_vars_int64(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],constlonglongout[])intnc_put_vars_uint64(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],constunsignedlonglongout[])intnc_put_vars_string(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],constchar*out[])

              These  functions  are  used  for  stridedoutput, which is like the array section output described
              above, except that the sampling stride (the interval between accessed  values)  is  specified  for
              each  dimension.   For an explanation of the sampling stride vector, see COMMON ARGUMENTS DESCRIP‐
              TIONS below.

       intnc_get_vars_text(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],charin[])intnc_get_vars_uchar(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],unsignedcharin[])intnc_get_vars_schar(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],signedcharin[])intnc_get_vars_short(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],shortin[])intnc_get_vars_int(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],intin[])intnc_get_vars_long(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],longin[])intnc_get_vars_float(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],floatin[])intnc_get_vars_double(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],doublein[])intnc_get_vars_ubyte(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],unsignedcharin[])intnc_get_vars_ushort(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],unsignedshortin[])intnc_get_vars_uint(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],unsignedintin[])intnc_get_vars_int64(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],longlongin[])intnc_get_vars_uint64(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],unsignedlonglongin[])intnc_get_vars_string(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsize_tstride[],char*in[])

              These functions are used for stridedinput, which is like the array section input described above,
              except that the sampling stride (the interval between accessed values) is specified for  each  di‐
              mension.   For an explanation of the sampling stride vector, see COMMON ARGUMENTS DESCRIPTIONS be‐
              low.

Writing And Reading An Array

intnc_put_vara_text(intncid,intvarid,constsize_tstart[],constsize_tcount[],constcharout[])intnc_put_vara_uchar(intncid,intvarid,constsize_tstart[],constsize_tcount[],constunsignedcharout[])intnc_put_vara_schar(intncid,intvarid,constsize_tstart[],constsize_tcount[],constsignedcharout[])intnc_put_vara_short(intncid,intvarid,constsize_tstart[],constsize_tcount[],constshortout[])intnc_put_vara_int(intncid,intvarid,constsize_tstart[],constsize_tcount[],constintout[])intnc_put_vara_long(intncid,intvarid,constsize_tstart[],constsize_tcount[],constlongout[])intnc_put_vara_float(intncid,intvarid,constsize_tstart[],constsize_tcount[],constfloatout[])intnc_put_vara_double(intncid,intvarid,constsize_tstart[],constsize_tcount[],constdoubleout[])intnc_put_vara_ubyte(intncid,intvarid,constsize_tstart[],constsize_tcount[],constunsignedcharout[])intnc_put_vara_ushort(intncid,intvarid,constsize_tstart[],constsize_tcount[],constunsignedshortout[])intnc_put_vara_uint(intncid,intvarid,constsize_tstart[],constsize_tcount[],constunsignedintout[])intnc_put_vara_int64(intncid,intvarid,constsize_tstart[],constsize_tcount[],constlonglongout[])intnc_put_vara_uint64(intncid,intvarid,constsize_tstart[],constsize_tcount[],constunsignedlonglongout[])intnc_put_vara_string(intncid,intvarid,constsize_tstart[],constsize_tcount[],constchar*out[])

              Writes an array section of values into a netCDF variable of an open netCDF dataset, which must  be
              in  data  mode.   The  array  section  is specified by the start and count vectors, which give the
              starting index and count of values along each dimension of the specified variable.   The  type  of
              the  data is specified in the function name and is converted to the external type of the specified
              variable, if possible, otherwise an NC_ERANGE error is returned.

       intnc_get_vara_text(intncid,intvarid,constsize_tstart[],constsize_tcount[],charin[])intnc_get_vara_uchar(intncid,intvarid,constsize_tstart[],constsize_tcount[],unsignedcharin[])intnc_get_vara_schar(intncid,intvarid,constsize_tstart[],constsize_tcount[],signedcharin[])intnc_get_vara_short(intncid,intvarid,constsize_tstart[],constsize_tcount[],shortin[])intnc_get_vara_int(intncid,intvarid,constsize_tstart[],constsize_tcount[],intin[])intnc_get_vara_long(intncid,intvarid,constsize_tstart[],constsize_tcount[],longin[])intnc_get_vara_float(intncid,intvarid,constsize_tstart[],constsize_tcount[],floatin[])intnc_get_vara_double(intncid,intvarid,constsize_tstart[],constsize_tcount[],doublein[])intnc_get_vara_ubyte(intncid,intvarid,constsize_tstart[],constsize_tcount[],unsignedcharin[])intnc_get_vara_ushort(intncid,intvarid,constsize_tstart[],constsize_tcount[],unsignedshortin[])intnc_get_vara_uint(intncid,intvarid,constsize_tstart[],constsize_tcount[],unsignedintin[])intnc_get_vara_int64(intncid,intvarid,constsize_tstart[],constsize_tcount[],longlongin[])intnc_get_vara_uint64(intncid,intvarid,constsize_tstart[],constsize_tcount[],unsignedlonglongin[])intnc_get_vara_string(intncid,intvarid,constsize_tstart[],constsize_tcount[],char*in[])

              Reads an array section of values from a netCDF variable of an open netCDF dataset, which  must  be
              in  data  mode.   The  array  section  is specified by the start and count vectors, which give the
              starting index and count of values along each dimension of the specified variable.   The  data  is
              converted from the external type of the specified variable, if necessary, to the type specified in
              the function name.  If conversion is not possible, an NC_ERANGE error is returned.

Writing And Reading One Datum

intnc_put_var1_text(intncid,intvarid,constsize_tindex[],char*out)intnc_put_var1_uchar(intncid,intvarid,constsize_tindex[],unsignedchar*out)intnc_put_var1_schar(intncid,intvarid,constsize_tindex[],signedchar*out)intnc_put_var1_short(intncid,intvarid,constsize_tindex[],short*out)intnc_put_var1_int(intncid,intvarid,constsize_tindex[],int*out)intnc_put_var1_long(intncid,intvarid,constsize_tindex[],long*out)intnc_put_var1_float(intncid,intvarid,constsize_tindex[],float*out)intnc_put_var1_double(intncid,intvarid,constsize_tindex[],double*out)intnc_put_var1_ubyte(intncid,intvarid,constsize_tindex[],unsignedchar*out)intnc_put_var1_ushort(intncid,intvarid,constsize_tindex[],unsignedshort*out)intnc_put_var1_uint(intncid,intvarid,constsize_tindex[],unsignedint*out)intnc_put_var1_int64(intncid,intvarid,constsize_tindex[],longlong*out)intnc_put_var1_uint64(intncid,intvarid,constsize_tindex[],unsignedlonglong*out)intnc_put_var1_string(intncid,intvarid,constsize_tindex[],char**out)

              Puts  a  single data value into a variable at the position index of an open netCDF dataset that is
              in data mode.  The type of the data is specified in the function name, and it is converted to  the
              external type of the specified variable, if possible, otherwise an NC_ERANGE error is returned.

       intnc_get_var1_text(intncid,intvarid,constsize_tindex[],char*in)intnc_get_var1_uchar(intncid,intvarid,constsize_tindex[],unsignedchar*in)intnc_get_var1_schar(intncid,intvarid,constsize_tindex[],signedchar*in)intnc_get_var1_short(intncid,intvarid,constsize_tindex[],short*in)intnc_get_var1_int(intncid,intvarid,constsize_tindex[],int*in)intnc_get_var1_long(intncid,intvarid,constsize_tindex[],long*in)intnc_get_var1_float(intncid,intvarid,constsize_tindex[],float*in)intnc_get_var1_double(intncid,intvarid,constsize_tindex[],double*in)intnc_get_var1_ubyte(intncid,intvarid,constsize_tindex[],unsignedchar*in)intnc_get_var1_ushort(intncid,intvarid,constsize_tindex[],unsignedshort*in)intnc_get_var1_uint(intncid,intvarid,constsize_tindex[],unsignedint*in)intnc_get_var1_int64(intncid,intvarid,constsize_tindex[],longlong*in)intnc_get_var1_uint64(intncid,intvarid,constsize_tindex[],unsignedlonglong*in)intnc_get_var1_string(intncid,intvarid,constsize_tindex[],char**in)

              Gets  a  single data value from a variable at the position index of an open netCDF dataset that is
              in data mode.  The data is converted from the external type of the specified variable,  if  neces‐
              sary, to the type specified in the function name.  If conversion is not possible, an NC_ERANGE er‐
              ror is returned.

Writing And Reading Whole Variables

intnc_put_var_text(intncid,intvarid,constcharout[])intnc_put_var_uchar(intncid,intvarid,constunsignedcharout[])intnc_put_var_schar(intncid,intvarid,constsignedcharout[])intnc_put_var_short(intncid,intvarid,constshortout[])intnc_put_var_int(intncid,intvarid,constintout[])intnc_put_var_long(intncid,intvarid,constlongout[])intnc_put_var_float(intncid,intvarid,constfloatout[])intnc_put_var_double(intncid,intvarid,constdoubleout[])intnc_put_var_ubyte(intncid,intvarid,constunsignedcharout[])intnc_put_var_ushort(intncid,intvarid,constunsignedshortout[])intnc_put_var_uint(intncid,intvarid,constunsignedintout[])intnc_put_var_int64(intncid,intvarid,constlonglongout[])intnc_put_var_uint64(intncid,intvarid,constunsignedlonglongout[])intnc_put_var_string(intncid,intvarid,constchar*out[])

              Writes  an  entire  netCDF variable (i.e. all the values).  The netCDF dataset must be open and in
              data mode.  The type of the data is specified in the function name, and it is converted to the ex‐
              ternal type of the specified variable, if possible, otherwise an NC_ERANGE error is returned. Note
              that rounding is not performed during the conversion. Floating point numbers  are  truncated  when
              converted to integers.

       intnc_get_var_text(intncid,intvarid,charin[])intnc_get_var_uchar(intncid,intvarid,unsignedcharin[])intnc_get_var_schar(intncid,intvarid,signedcharin[])intnc_get_var_short(intncid,intvarid,shortin[])intnc_get_var_int(intncid,intvarid,intin[])intnc_get_var_long(intncid,intvarid,longin[])intnc_get_var_float(intncid,intvarid,floatin[])intnc_get_var_double(intncid,intvarid,doublein[])intnc_get_var_ubyte(intncid,intvarid,unsignedcharin[])intnc_get_var_ushort(intncid,intvarid,unsignedshortin[])intnc_get_var_uint(intncid,intvarid,unsignedintin[])intnc_get_var_int64(intncid,intvarid,longlongin[])intnc_get_var_uint64(intncid,intvarid,unsignedlonglongin[])intnc_get_var_string(intncid,intvarid,char*in[])

              Reads an entire netCDF variable (i.e. all the values).  The netCDF dataset must be open and in da‐
              ta mode.  The data is converted from the external type of the specified variable, if necessary, to
              the type specified in the function name.  If conversion is not possible, an NC_ERANGE error is re‐
              turned.

See Also