more doxygen variable stuff

This commit is contained in:
Ed Hartnett 2011-07-12 15:37:24 +00:00
parent cb72a227b4
commit ed204b1cc9
9 changed files with 1431 additions and 908 deletions

View File

@ -582,6 +582,7 @@ libdispatch/var.c \
libdispatch/varinq.c \
libdispatch/varput.c libdispatch/varget.c \
libdispatch/error.c \
libdispatch/nc4.c \
libsrc4/nc4file.c \
man4/mainpage.doc man4/tutorial.doc COPYRIGHT man4/install.doc man4/dispatch.doc \
man4/guide.doc man4/types.doc man4/notes.doc
@ -1280,7 +1281,7 @@ INCLUDE_FILE_PATTERNS =
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
PREDEFINED =
PREDEFINED = USE_NETCDF4
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.

View File

@ -204,12 +204,14 @@ As a rule, NC_MAX_VAR_DIMS <= NC_MAX_DIMS.
#define NC_CONTIGUOUS 1
/**@}*/
/* In HDF5 files you can set check-summing for each variable.
* Currently the only checksum available is Fletcher-32, which can be
* set with the function nc_def_var_fletcher32. These defines are used
* there. */
/** In HDF5 files you can set check-summing for each variable.
Currently the only checksum available is Fletcher-32, which can be set
with the function nc_def_var_fletcher32. These defines are used
there. */
/**@{*/
#define NC_NOCHECKSUM 0
#define NC_FLETCHER32 1
/**@}*/
/**@{*/
/** Control the HDF5 shuffle filter. In HDF5 files you can specify
@ -761,7 +763,7 @@ 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_value);
nc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep);
/* Define the endianness of a variable. */
EXTERNL int

View File

@ -26,17 +26,17 @@ nc_create().
for a global attribute.
\param name Pointer to the location for the returned attribute \ref
object_name. Ignored if NULL.
object_name. \ref ignored_if_null.
\param xtypep Pointer to location for returned attribute \ref
data_type. Ignored if NULL.
data_type. \ref ignored_if_null.
\param lenp Pointer to location for returned number of values
currently stored in the attribute. For attributes of type ::NC_CHAR,
you should not assume that this includes a trailing zero byte; it
doesn't if the attribute was stored without a trailing zero byte, for
example from a FORTRAN program. Before using the value as a C string,
make sure it is null-terminated. Ignored if NULL.
make sure it is null-terminated. \ref ignored_if_null.
\section Example
@ -139,7 +139,7 @@ Find number of global attributes.
nc_create().
\param nattsp Pointer where number of global attributes will be
written. Ignored if NULL.
written. \ref ignored_if_null.
*/
int
nc_inq_natts(int ncid, int *nattsp)
@ -188,7 +188,7 @@ for a global attribute.
\param lenp Pointer to location for returned number of values
currently stored in the attribute. Before using the value as a C
string, make sure it is null-terminated. Ignored if NULL.
string, make sure it is null-terminated. \ref ignored_if_null.
*/
int
nc_inq_attlen(int ncid, int varid, const char *name, size_t *lenp)

View File

@ -1,18 +1,24 @@
/*
Copyright 2010 University Corporation for Atmospheric
Research/Unidata. See COPYRIGHT file for more info.
/*! \file
Functions for netCDF-4 features.
This file defines the netcdf-4 functions.
"$Id: nc4.c,v 1.1 2010/06/01 15:46:50 ed Exp $"
*/
Copyright 2010 University Corporation for Atmospheric
Research/Unidata. See \ref COPYRIGHT file for more info. */
#include "ncdispatch.h"
/* When you read string type the library will allocate the storage
* space for the data. This storage space must be freed, so pass the
* pointer back to this function, when you're done with the data, and
* it will free the string memory. */
/** \ingroup variables
Free string space allocated by the library.
When you read string type the library will allocate the storage space
for the data. This storage space must be freed, so pass the pointer
back to this function, when you're done with the data, and it will
free the string memory.
\param len The number of character arrays in the array.
\param data The pointer to the data array.
\returns ::NC_NOERR No error.
*/
int
nc_free_string(size_t len, char **data)
{
@ -48,155 +54,6 @@ nc_free_vlens(size_t len, nc_vlen_t vlens[])
return NC_NOERR;
}
/* Wrappers for nc_inq_var_all */
int
nc_inq_var_deflate(int ncid, int varid, int *shufflep, int *deflatep, int *deflate_levelp)
{
NC* ncp;
int stat = NC_check_id(ncid,&ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->inq_var_all(
ncid, varid,
NULL, /*name*/
NULL, /*xtypep*/
NULL, /*ndimsp*/
NULL, /*dimidsp*/
NULL, /*nattsp*/
shufflep, /*shufflep*/
deflatep, /*deflatep*/
deflate_levelp, /*deflatelevelp*/
NULL, /*fletcher32p*/
NULL, /*contiguousp*/
NULL, /*chunksizep*/
NULL, /*nofillp*/
NULL, /*fillvaluep*/
NULL, /*endianp*/
NULL, /*optionsmaskp*/
NULL /*pixelsp*/
);
}
int
nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp)
{
NC* ncp;
int stat = NC_check_id(ncid,&ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->inq_var_all(
ncid, varid,
NULL, /*name*/
NULL, /*xtypep*/
NULL, /*ndimsp*/
NULL, /*dimidsp*/
NULL, /*nattsp*/
NULL, /*shufflep*/
NULL, /*deflatep*/
NULL, /*deflatelevelp*/
NULL, /*fletcher32p*/
NULL, /*contiguousp*/
NULL, /*chunksizep*/
NULL, /*nofillp*/
NULL, /*fillvaluep*/
NULL, /*endianp*/
options_maskp, /*optionsmaskp*/
pixels_per_blockp /*pixelsp*/
);
}
int
nc_inq_var_fletcher32(int ncid, int varid, int *fletcher32p)
{
NC* ncp;
int stat = NC_check_id(ncid,&ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->inq_var_all(
ncid, varid,
NULL, /*name*/
NULL, /*xtypep*/
NULL, /*ndimsp*/
NULL, /*dimidsp*/
NULL, /*nattsp*/
NULL, /*shufflep*/
NULL, /*deflatep*/
NULL, /*deflatelevelp*/
fletcher32p, /*fletcher32p*/
NULL, /*contiguousp*/
NULL, /*chunksizep*/
NULL, /*nofillp*/
NULL, /*fillvaluep*/
NULL, /*endianp*/
NULL, /*optionsmaskp*/
NULL /*pixelsp*/
);
}
int
nc_inq_var_chunking(int ncid, int varid, int *contiguousp, size_t *chunksizesp)
{
NC *ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->inq_var_all(ncid, varid, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, contiguousp,
chunksizesp, NULL, NULL, NULL, NULL, NULL);
}
int
nc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_value)
{
NC* ncp;
int stat = NC_check_id(ncid,&ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->inq_var_all(
ncid, varid,
NULL, /*name*/
NULL, /*xtypep*/
NULL, /*ndimsp*/
NULL, /*dimidsp*/
NULL, /*nattsp*/
NULL, /*shufflep*/
NULL, /*deflatep*/
NULL, /*deflatelevelp*/
NULL, /*fletcher32p*/
NULL, /*contiguousp*/
NULL, /*chunksizep*/
no_fill, /*nofillp*/
fill_value, /*fillvaluep*/
NULL, /*endianp*/
NULL, /*optionsmaskp*/
NULL /*pixelsp*/
);
}
int
nc_inq_var_endian(int ncid, int varid, int *endianp)
{
NC* ncp;
int stat = NC_check_id(ncid,&ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->inq_var_all(
ncid, varid,
NULL, /*name*/
NULL, /*xtypep*/
NULL, /*ndimsp*/
NULL, /*dimidsp*/
NULL, /*nattsp*/
NULL, /*shufflep*/
NULL, /*deflatep*/
NULL, /*deflatelevelp*/
NULL, /*fletcher32p*/
NULL, /*contiguousp*/
NULL, /*chunksizep*/
NULL, /*nofillp*/
NULL, /*fillvaluep*/
endianp, /*endianp*/
NULL, /*optionsmaskp*/
NULL /*pixelsp*/
);
}
int
nc_inq_ncid(int ncid, const char *name, int *grp_ncid)
{
@ -600,24 +457,6 @@ nc_def_var_endian(int ncid, int varid, int endian)
return ncp->dispatch->def_var_endian(ncid,varid,endian);
}
int
nc_set_var_chunk_cache(int ncid, int varid, size_t size, size_t nelems, float preemption)
{
NC* ncp;
int stat = NC_check_id(ncid,&ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->set_var_chunk_cache(ncid,varid,size,nelems,preemption);
}
int
nc_get_var_chunk_cache(int ncid, int varid, size_t *sizep, size_t *nelemsp, float *preemptionp)
{
NC* ncp;
int stat = NC_check_id(ncid,&ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->get_var_chunk_cache(ncid,varid,sizep,nelemsp,preemptionp);
}
int
nc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp)
{

View File

@ -163,7 +163,7 @@ element of the dimids array.
\returns ::NC_ESTRICTNC3 Attempting netcdf-4 operation on strict nc3 netcdf-4 file.
\returns ::NC_EMAXVARS NC_MAX_VARS exceeded
\returns ::NC_EBADTYPE Bad type.
\returns ::NC_EINVAL Number of dimensions to large.
\returns ::NC_EINVAL Invalid input.
\returns ::NC_ENAMEINUSE Name already in use.
\returns ::NC_EPERM Attempt to create object in read-only file.
@ -436,4 +436,76 @@ NC_getshape(int ncid, int varid, int ndims, size_t* shape)
return status;
}
#ifdef USE_NETCDF4
/** \ingroup variables
\param ncid NetCDF ID, from a previous call to nc_open() or
nc_create().
\param varid Variable ID
\param size The total size of the raw data chunk cache, in bytes.
\param nelems The number of chunk slots in the raw data chunk cache.
\param preemption The preemption, a value between 0 and 1 inclusive
that indicates how much chunks that have been fully read are favored
for preemption. A value of zero means fully read chunks are treated no
differently than other chunks (the preemption is strictly LRU) while a
value of one means fully read chunks are always preempted before other
chunks.
\returns ::NC_NOERR No error.
\returns ::NC_EBADID Bad ncid.
\returns ::NC_ENOTVAR Invalid variable ID.
\returns ::NC_ESTRICTNC3 Attempting netcdf-4 operation on strict nc3 netcdf-4 file.
\returns ::NC_EINVAL Invalid input
*/
int
nc_set_var_chunk_cache(int ncid, int varid, size_t size, size_t nelems,
float preemption)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->set_var_chunk_cache(ncid, varid, size,
nelems, preemption);
}
/** \ingroup variables
\param ncid NetCDF ID, from a previous call to nc_open() or
nc_create().
\param varid Variable ID
\param sizep The total size of the raw data chunk cache, in bytes,
will be put here. \ref ignored_if_null.
\param nelemsp The number of chunk slots in the raw data chunk cache
hash table will be put here. \ref ignored_if_null.
\param preemptionp The preemption will be put here. The preemtion
value is between 0 and 1 inclusive and indicates how much chunks that
have been fully read are favored for preemption. A value of zero means
fully read chunks are treated no differently than other chunks (the
preemption is strictly LRU) while a value of one means fully read
chunks are always preempted before other chunks. \ref ignored_if_null.
\returns ::NC_NOERR No error.
\returns ::NC_EBADID Bad ncid.
\returns ::NC_ENOTVAR Invalid variable ID.
\returns ::NC_ESTRICTNC3 Attempting netcdf-4 operation on strict nc3 netcdf-4 file.
\returns ::NC_EINVAL Invalid input
*/
int
nc_get_var_chunk_cache(int ncid, int varid, size_t *sizep, size_t *nelemsp,
float *preemptionp)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->get_var_chunk_cache(ncid, varid, sizep,
nelemsp, preemptionp);
}
#endif /* USE_NETCDF4 */

File diff suppressed because it is too large Load Diff

View File

@ -24,10 +24,11 @@ nc_create().
\param name Name of the variable.
\param varidp Pointer to location for returned variable ID.
\param varidp Pointer to location for returned variable ID. \ref
ignored_if_null.
\returns \ref NC_NOERR No error.
\returns \ref NC_EBADID Bad ncid.
\returns ::NC_NOERR No error.
\returns ::NC_EBADID Bad ncid.
\section Example
@ -65,23 +66,23 @@ nc_create().
\param varid Variable ID
\param name Returned variable name. The caller must allocate space for
the returned name. The maximum length is \ref NC_MAX_NAME. Ignored if
NULL.
the returned name. The maximum length is ::NC_MAX_NAME. \ref
ignored_if_null.
\param xtypep Pointer where typeid will be stored. Ignored if NULL.
\param xtypep Pointer where typeid will be stored. \ref ignored_if_null.
\param ndimsp Pointer where number of dimensions will be
stored. Ignored if NULL.
stored. \ref ignored_if_null.
\param dimidsp Pointer where array of dimension IDs will be
stored. Ignored if NULL.
stored. \ref ignored_if_null.
\param nattsp Pointer where number of attributes will be
stored. Ignored if NULL.
stored. \ref ignored_if_null.
\returns \ref NC_NOERR No error.
\returns \ref NC_EBADID Bad ncid.
\returns \ref NC_ENOTVAR Invalid variable ID.
\returns ::NC_NOERR No error.
\returns ::NC_EBADID Bad ncid.
\returns ::NC_ENOTVAR Invalid variable ID.
\section Example
@ -132,12 +133,12 @@ nc_create().
\param varid Variable ID
\param name Returned variable name. The caller must allocate space for
the returned name. The maximum length is \ref NC_MAX_NAME. Ignored if
the returned name. The maximum length is ::NC_MAX_NAME. Ignored if
NULL.
\returns \ref NC_NOERR No error.
\returns \ref NC_EBADID Bad ncid.
\returns \ref NC_ENOTVAR Invalid variable ID.
\returns ::NC_NOERR No error.
\returns ::NC_EBADID Bad ncid.
\returns ::NC_ENOTVAR Invalid variable ID.
*/
int
nc_inq_varname(int ncid, int varid, char *name)
@ -154,11 +155,11 @@ nc_create().
\param varid Variable ID
\param typep Pointer where typeid will be stored. Ignored if NULL.
\param typep Pointer where typeid will be stored. \ref ignored_if_null.
\returns \ref NC_NOERR No error.
\returns \ref NC_EBADID Bad ncid.
\returns \ref NC_ENOTVAR Invalid variable ID.
\returns ::NC_NOERR No error.
\returns ::NC_EBADID Bad ncid.
\returns ::NC_ENOTVAR Invalid variable ID.
*/
int
nc_inq_vartype(int ncid, int varid, nc_type *typep)
@ -176,11 +177,11 @@ nc_create().
\param varid Variable ID
\param ndimsp Pointer where number of dimensions will be
stored. Ignored if NULL.
stored. \ref ignored_if_null.
\returns \ref NC_NOERR No error.
\returns \ref NC_EBADID Bad ncid.
\returns \ref NC_ENOTVAR Invalid variable ID.
\returns ::NC_NOERR No error.
\returns ::NC_EBADID Bad ncid.
\returns ::NC_ENOTVAR Invalid variable ID.
*/
int
nc_inq_varndims(int ncid, int varid, int *ndimsp)
@ -197,11 +198,11 @@ nc_create().
\param varid Variable ID
\param dimidsp Pointer where array of dimension IDs will be
stored. Ignored if NULL.
stored. \ref ignored_if_null.
\returns \ref NC_NOERR No error.
\returns \ref NC_EBADID Bad ncid.
\returns \ref NC_ENOTVAR Invalid variable ID.
\returns ::NC_NOERR No error.
\returns ::NC_EBADID Bad ncid.
\returns ::NC_ENOTVAR Invalid variable ID.
*/
int
nc_inq_vardimid(int ncid, int varid, int *dimidsp)
@ -219,11 +220,11 @@ nc_create().
\param varid Variable ID
\param nattsp Pointer where number of attributes will be
stored. Ignored if NULL.
stored. \ref ignored_if_null.
\returns \ref NC_NOERR No error.
\returns \ref NC_EBADID Bad ncid.
\returns \ref NC_ENOTVAR Invalid variable ID.
\returns ::NC_NOERR No error.
\returns ::NC_EBADID Bad ncid.
\returns ::NC_ENOTVAR Invalid variable ID.
*/
int
nc_inq_varnatts(int ncid, int varid, int *nattsp)
@ -235,4 +236,285 @@ nc_inq_varnatts(int ncid, int varid, int *nattsp)
nattsp);
}
#ifdef USE_NETCDF4
/** \ingroup variables
Learn the storage and deflate settings for a variable.
This is a wrapper for nc_inq_var_all().
\param ncid NetCDF ID, from a previous call to nc_open() or
nc_create().
\param varid Variable ID
\param shufflep A 1 will be written here if the shuffle filter is
turned on for this variable, and a 0 otherwise. \ref ignored_if_null.
\param deflatep If this pointer is non-NULL, the nc_inq_var_deflate
function will write a 1 if the deflate filter is turned on for this
variable, and a 0 otherwise. \ref ignored_if_null.
\param deflate_levelp If the deflate filter is in use for this
variable, the deflate_level will be writen here. \ref ignored_if_null.
\returns ::NC_NOERR No error.
\returns ::NC_ENOTNC4 Not a netCDF-4 file.
\returns ::NC_EBADID Bad ncid.
\returns ::NC_ENOTVAR Invalid variable ID.
*/
int
nc_inq_var_deflate(int ncid, int varid, int *shufflep, int *deflatep,
int *deflate_levelp)
{
NC* ncp;
int stat = NC_check_id(ncid,&ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->inq_var_all(
ncid, varid,
NULL, /*name*/
NULL, /*xtypep*/
NULL, /*ndimsp*/
NULL, /*dimidsp*/
NULL, /*nattsp*/
shufflep, /*shufflep*/
deflatep, /*deflatep*/
deflate_levelp, /*deflatelevelp*/
NULL, /*fletcher32p*/
NULL, /*contiguousp*/
NULL, /*chunksizep*/
NULL, /*nofillp*/
NULL, /*fillvaluep*/
NULL, /*endianp*/
NULL, /*optionsmaskp*/
NULL /*pixelsp*/
);
}
/** \ingroup variables
Learn the szip settings of a variable.
This function returns the szip settings for a variable. NetCDF does
not allow variables to be created with szip (due to license problems
with the szip library), but we do enable read-only access of HDF5
files with szip compression.
This is a wrapper for nc_inq_var_all().
\param ncid NetCDF ID, from a previous call to nc_open() or
nc_create().
\param varid Variable ID
\param options_maskp The szip options mask will be copied to this
pointer. \ref ignored_if_null.
\param pixels_per_blockp The szip pixels per block will be copied
here. \ref ignored_if_null.
\returns ::NC_NOERR No error.
\returns ::NC_EBADID Bad ncid.
\returns ::NC_ENOTNC4 Not a netCDF-4 file.
\returns ::NC_ENOTVAR Invalid variable ID.
*/
int
nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp)
{
NC* ncp;
int stat = NC_check_id(ncid,&ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->inq_var_all(
ncid, varid,
NULL, /*name*/
NULL, /*xtypep*/
NULL, /*ndimsp*/
NULL, /*dimidsp*/
NULL, /*nattsp*/
NULL, /*shufflep*/
NULL, /*deflatep*/
NULL, /*deflatelevelp*/
NULL, /*fletcher32p*/
NULL, /*contiguousp*/
NULL, /*chunksizep*/
NULL, /*nofillp*/
NULL, /*fillvaluep*/
NULL, /*endianp*/
options_maskp, /*optionsmaskp*/
pixels_per_blockp /*pixelsp*/
);
}
/** \ingroup variables
Learn the checksum settings for a variable.
This is a wrapper for nc_inq_var_all().
\param ncid NetCDF ID, from a previous call to nc_open() or
nc_create().
\param varid Variable ID
\param fletcher32p Will be set to ::NC_FLETCHER32 if the fletcher32
checksum filter is turned on for this variable, and ::NC_NOCHECKSUM if
it is not. \ref ignored_if_null.
\returns ::NC_NOERR No error.
\returns ::NC_EBADID Bad ncid.
\returns ::NC_ENOTNC4 Not a netCDF-4 file.
\returns ::NC_ENOTVAR Invalid variable ID.
*/
int
nc_inq_var_fletcher32(int ncid, int varid, int *fletcher32p)
{
NC* ncp;
int stat = NC_check_id(ncid,&ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->inq_var_all(
ncid, varid,
NULL, /*name*/
NULL, /*xtypep*/
NULL, /*ndimsp*/
NULL, /*dimidsp*/
NULL, /*nattsp*/
NULL, /*shufflep*/
NULL, /*deflatep*/
NULL, /*deflatelevelp*/
fletcher32p, /*fletcher32p*/
NULL, /*contiguousp*/
NULL, /*chunksizep*/
NULL, /*nofillp*/
NULL, /*fillvaluep*/
NULL, /*endianp*/
NULL, /*optionsmaskp*/
NULL /*pixelsp*/
);
}
/** \ingroup variables
This is a wrapper for nc_inq_var_all().
\param ncid NetCDF ID, from a previous call to nc_open() or
nc_create().
\param varid Variable ID
\param storagep Address of returned storage property, returned as
::NC_CONTIGUOUS if this variable uses contiguous storage, or
::NC_CHUNKED if it uses chunked storage. \ref ignored_if_null.
\param chunksizesp The chunksizes will be copied here. \ref
ignored_if_null.
\returns ::NC_NOERR No error.
\returns ::NC_EBADID Bad ncid.
\returns ::NC_ENOTNC4 Not a netCDF-4 file.
\returns ::NC_ENOTVAR Invalid variable ID.
*/
int
nc_inq_var_chunking(int ncid, int varid, int *storagep, size_t *chunksizesp)
{
NC *ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->inq_var_all(ncid, varid, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, storagep,
chunksizesp, NULL, NULL, NULL, NULL, NULL);
}
/** \ingroup variables
Learn the fill mode of a variable.
The fill mode of a variable is set by nc_def_var_fill().
This is a wrapper for nc_inq_var_all().
\param ncid NetCDF ID, from a previous call to nc_open() or
nc_create().
\param varid Variable ID
\param no_fill Pointer to an integer which will get a 1 if no_fill
mode is set for this variable. \ref ignored_if_null.
\param fill_valuep A pointer which will get the fill value for this
variable. \ref ignored_if_null.
\returns ::NC_NOERR No error.
\returns ::NC_EBADID Bad ncid.
\returns ::NC_ENOTVAR Invalid variable ID.
*/
int
nc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep)
{
NC* ncp;
int stat = NC_check_id(ncid,&ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->inq_var_all(
ncid, varid,
NULL, /*name*/
NULL, /*xtypep*/
NULL, /*ndimsp*/
NULL, /*dimidsp*/
NULL, /*nattsp*/
NULL, /*shufflep*/
NULL, /*deflatep*/
NULL, /*deflatelevelp*/
NULL, /*fletcher32p*/
NULL, /*contiguousp*/
NULL, /*chunksizep*/
no_fill, /*nofillp*/
fill_valuep, /*fillvaluep*/
NULL, /*endianp*/
NULL, /*optionsmaskp*/
NULL /*pixelsp*/
);
}
/** \ingroup variables
Find the endianness of a variable.
This is a wrapper for nc_inq_var_all().
\param ncid NetCDF ID, from a previous call to nc_open() or
nc_create().
\param varid Variable ID
\param endianp Storage which will get ::NC_ENDIAN_LITTLE if this
variable is stored in little-endian format, ::NC_ENDIAN_BIG if it is
stored in big-endian format, and ::NC_ENDIAN_NATIVE if the endianness
is not set, and the variable is not created yet.
\returns ::NC_NOERR No error.
\returns ::NC_ENOTNC4 Not a netCDF-4 file.
\returns ::NC_EBADID Bad ncid.
\returns ::NC_ENOTVAR Invalid variable ID.
*/
int
nc_inq_var_endian(int ncid, int varid, int *endianp)
{
NC* ncp;
int stat = NC_check_id(ncid,&ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->inq_var_all(
ncid, varid,
NULL, /*name*/
NULL, /*xtypep*/
NULL, /*ndimsp*/
NULL, /*dimidsp*/
NULL, /*nattsp*/
NULL, /*shufflep*/
NULL, /*deflatep*/
NULL, /*deflatelevelp*/
NULL, /*fletcher32p*/
NULL, /*contiguousp*/
NULL, /*chunksizep*/
NULL, /*nofillp*/
NULL, /*fillvaluep*/
endianp, /*endianp*/
NULL, /*optionsmaskp*/
NULL /*pixelsp*/
);
}
#endif /* USE_NETCDF4 */
/*! \} */ /* End of named group ...*/

File diff suppressed because it is too large Load Diff

View File

@ -46,6 +46,11 @@ if (nc_inq(ncid, &ndims, NULL, NULL, NULL))
return SOME_ERROR;
\endcode
\section Allocating Storage for the Result
User must allocate space for the result of an inq function before the
function is called.
\page specify_hyperslab Specify a Hyperslab
The NetCDF allows specification of hyperslabs to be read or written
@ -77,4 +82,37 @@ variable's dimensions.
Setting any element of the count array to zero causes the function to
exit without error, and without doing anything.
\section stride_vector A Vector Specifying Stride for Each Dimension
A vector of size_t integers specifying the interval between selected
indices.
A value of 1 accesses adjacent values of the netCDF variable in the
corresponding dimension; a value of 2 accesses every other value of
the netCDF variable in the corresponding dimension; and so on.
The elements of the stride vector correspond, in order, to the
variable's dimensions.
A NULL stride argument is treated as (1, 1, ... , 1).
\section map_vector A Vector Specifying Mapping for Each Dimension
A vector of integers that specifies the mapping between the dimensions
of a netCDF variable and the in-memory structure of the internal data
array.
imap[0] gives the distance between elements of the internal array
corresponding to the most slowly varying dimension of the netCDF
variable. imap[n-1] (where n is the rank of the netCDF variable) gives
the distance between elements of the internal array corresponding to
the most rapidly varying dimension of the netCDF variable. Intervening
imap elements correspond to other dimensions of the netCDF variable in
the obvious way. Distances between elements are specified in
type-independent units of elements.
\note The distance between internal elements that occupy adjacent
memory locations is 1 and not the element's byte-length as in netCDF
2.
*/