12#include "ncdispatch.h" 
   13#include "nc4internal.h" 
   15#include "nc4internal.h" 
  215           int ndims,  
const int *dimidsp, 
int *varidp)
 
  220    if ((stat = NC_check_id(ncid, &ncp)))
 
  223    return ncp->dispatch->def_var(ncid, name, xtype, ndims,
 
 
  312    int stat = NC_check_id(ncid,&ncp);
 
  321    return ncp->dispatch->def_var_fill(ncid,varid,no_fill,fill_value);
 
 
  464    int stat = NC_check_id(ncid,&ncp);
 
  466    return ncp->dispatch->def_var_deflate(ncid,varid,shuffle,deflate,deflate_level);
 
 
  563    int stat = NC_check_id(ncid,&ncp);
 
  568    return ncp->dispatch->def_var_quantize(ncid,varid,quantize_mode,nsd);
 
 
  612    int stat = NC_check_id(ncid,&ncp);
 
  614    return ncp->dispatch->def_var_fletcher32(ncid,varid,fletcher32);
 
 
  732    int stat = NC_check_id(ncid, &ncp);
 
  734    return ncp->dispatch->def_var_chunking(ncid, varid, storage,
 
 
  810    int stat = NC_check_id(ncid,&ncp);
 
  812    return ncp->dispatch->def_var_endian(ncid,varid,endian);
 
 
  870    unsigned int params[2] = {(
unsigned int)options_mask, (
unsigned int)pixels_per_block};
 
 
  947    int stat = NC_check_id(ncid, &ncp);
 
  950    return ncp->dispatch->rename_var(ncid, varid, name);
 
 
  964NC_is_recvar(
int ncid, 
int varid, 
size_t* nrecs)
 
  975    if(ndims == 0) 
return 0; 
 
  978    status = 
nc_inq_dim(ncid,dimset[0],NULL,nrecs);
 
  980    return (dimset[0] == unlimid ? 1: 0);
 
 1009NC_inq_recvar(
int ncid, 
int varid, 
int* nrecdimsp, 
int *is_recdim)
 
 1019    if(status != 
NC_NOERR) 
return status;
 
 1021    for(dim = 0; dim < nvardims; dim++)
 
 1024    if(status != 
NC_NOERR) 
return status;
 
 1025    if(unlimid == -1) 
return status; 
 
 1032        if(status != 
NC_NOERR) 
return status;
 
 1033        if(nunlimdims == 0) 
return status;
 
 1035        if (!(unlimids = malloc((
size_t)nunlimdims * 
sizeof(
int))))
 
 1047        for (dim = 0; dim < nvardims; dim++) { 
 
 1048            for(recdim = 0; recdim < nunlimdims; recdim++) {
 
 1049                if(dimset[dim] == unlimids[recdim]) {
 
 1059    if(status != 
NC_NOERR) 
return status;
 
 1060    if(dimset[0] == unlimid) {
 
 1065    if(nrecdimsp) *nrecdimsp = nrecdims;
 
 1091        return ((
int)
sizeof(
char));
 
 1093        return ((
int)
sizeof(
signed char));
 
 1095        return ((
int)
sizeof(
short));
 
 1097        return ((
int)
sizeof(
int));
 
 1099        return ((
int)
sizeof(
float));
 
 1101        return ((
int)
sizeof(
double));
 
 1105        return ((
int)
sizeof(
unsigned char));
 
 1107        return ((
int)(
sizeof(
unsigned short)));
 
 1109        return ((
int)
sizeof(
unsigned int));
 
 1111        return ((
int)
sizeof(
signed long long));
 
 1113        return ((
int)
sizeof(
unsigned long long));
 
 1116        return ((
int)
sizeof(
char*));
 
 1133NC_atomictypelen(
nc_type xtype)
 
 1137    case NC_NAT: sz = 0; 
break;
 
 1138    case NC_BYTE: sz = 
sizeof(
signed char); 
break;
 
 1139    case NC_CHAR: sz = 
sizeof(char); 
break;
 
 1140    case NC_SHORT: sz = 
sizeof(short); 
break;
 
 1141    case NC_INT: sz = 
sizeof(int); 
break;
 
 1142    case NC_FLOAT: sz = 
sizeof(float); 
break;
 
 1143    case NC_DOUBLE: sz = 
sizeof(double); 
break;
 
 1144    case NC_INT64: sz = 
sizeof(
signed long long); 
break;
 
 1145    case NC_UBYTE: sz = 
sizeof(
unsigned char); 
break;
 
 1146    case NC_USHORT: sz = 
sizeof(
unsigned short); 
break;
 
 1147    case NC_UINT: sz = 
sizeof(
unsigned int); 
break;
 
 1148    case NC_UINT64: sz = 
sizeof(
unsigned long long); 
break;
 
 1150    case NC_STRING: sz = 
sizeof(
char*); 
break;
 
 1166NC_atomictypename(
nc_type xtype)
 
 1170    case NC_NAT: nm = 
"undefined"; 
break;
 
 1171    case NC_BYTE: nm = 
"byte"; 
break;
 
 1172    case NC_CHAR: nm = 
"char"; 
break;
 
 1173    case NC_SHORT: nm = 
"short"; 
break;
 
 1174    case NC_INT: nm = 
"int"; 
break;
 
 1175    case NC_FLOAT: nm = 
"float"; 
break;
 
 1177    case NC_INT64: nm = 
"int64"; 
break;
 
 1178    case NC_UBYTE: nm = 
"ubyte"; 
break;
 
 1180    case NC_UINT: nm = 
"uint"; 
break;
 
 1208NC_getshape(
int ncid, 
int varid, 
int ndims, 
size_t* shape)
 
 1216    for(i = 0; i < ndims; i++)
 
 1248NC_check_nulls(
int ncid, 
int varid, 
const size_t *start, 
size_t **count,
 
 1258    if (!start && varndims)
 
 1264        if (!(*count = malloc((
size_t)varndims * 
sizeof(
size_t))))
 
 1266        if ((stat = NC_getshape(ncid, varid, varndims, *count)))
 
 1276    if (stride && !*stride)
 
 1280        if (!(*stride = malloc((
size_t)varndims * 
sizeof(ptrdiff_t))))
 
 1282        for (i = 0; i < varndims; i++)
 
 1316    for (i = 0; i < len; i++)
 
 
 1395    int stat = NC_check_id(ncid, &ncp);
 
 1397    return ncp->dispatch->set_var_chunk_cache(ncid, varid, size,
 
 1398                                              nelems, preemption);
 
 
 1436    int stat = NC_check_id(ncid, &ncp);
 
 1438    return ncp->dispatch->get_var_chunk_cache(ncid, varid, sizep,
 
 1439                                              nelemsp, preemptionp);
 
 
 1446nc_set_chunk_cache_ints(
int size, 
int nelems, 
int preemption)
 
 1452nc_get_chunk_cache_ints(
int *sizep, 
int *nelemsp, 
int *preemptionp)
 
 1458nc_set_var_chunk_cache_ints(
int ncid, 
int varid, 
int size, 
int nelems,
 
 1465nc_get_var_chunk_cache_ints(
int ncid, 
int varid, 
int *sizep,
 
 1466                int *nelemsp, 
int *preemptionp)
 
EXTERNL int nc_inq_dimlen(int ncid, int dimid, size_t *lenp)
Find the length of a dimension.
 
EXTERNL int nc_inq_dim(int ncid, int dimid, char *name, size_t *lenp)
Find the name and length of a dimension.
 
EXTERNL int nc_inq_unlimdim(int ncid, int *unlimdimidp)
Find the ID of the unlimited dimension.
 
EXTERNL int nc_inq_varndims(int ncid, int varid, int *ndimsp)
Learn how many dimensions are associated with a variable.
 
int nc_def_var_endian(int ncid, int varid, int endian)
Define endianness of a variable.
 
int nc_free_string(size_t len, char **data)
Free string space allocated by the library.
 
int nc_def_var_szip(int ncid, int varid, int options_mask, int pixels_per_block)
Set szip compression settings on a variable.
 
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.
 
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.
 
int nc_def_var_fletcher32(int ncid, int varid, int fletcher32)
Set checksum for a var.
 
int nc_def_var_quantize(int ncid, int varid, int quantize_mode, int nsd)
Turn on quantization for a variable.
 
EXTERNL int nc_inq_vardimid(int ncid, int varid, int *dimidsp)
Learn the dimension IDs associated with a variable.
 
int nc_def_var_fill(int ncid, int varid, int no_fill, const void *fill_value)
Set the fill value for a variable.
 
int nc_def_var(int ncid, const char *name, nc_type xtype, int ndims, const int *dimidsp, int *varidp)
Define a new variable.
 
int nc_rename_var(int ncid, int varid, const char *name)
Rename a variable.
 
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.
 
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.
 
Main header file for the C API.
 
#define NC_UINT
unsigned 4-byte int
 
#define NC_INT
signed 4 byte integer
 
#define NC_MAX_VAR_DIMS
max per variable dimensions
 
#define NC_BYTE
signed 1 byte integer
 
EXTERNL int nc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp)
Return number and list of unlimited dimensions.
 
#define NC_NAT
Not A Type.
 
#define NC_DOUBLE
double precision floating point number
 
#define NC_UBYTE
unsigned 1 byte int
 
#define NC_FLOAT
single precision floating point number
 
#define NC_ENOMEM
Memory allocation (malloc) failure.
 
#define NC_SHORT
signed 2 byte integer
 
#define NC_EINVALCOORDS
Index exceeds dimension bound.
 
#define NC_INT64
signed 8-byte int
 
#define NC_GLOBAL
Attribute id to put/get a global attribute.
 
#define NC_UINT64
unsigned 8-byte int
 
#define NC_NOERR
No Error.
 
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.
 
#define NC_USHORT
unsigned 2-byte int
 
#define NC_ENOTBUILT
Attempt to use feature that was not turned on when netCDF was built.
 
#define NC_EGLOBAL
Action prohibited on NC_GLOBAL varid.
 
#define NC_CHAR
ISO/ASCII character.
 
int nc_type
The nc_type type is just an int.