8 #include "ncdispatch.h"
208 int ndims,
const int *dimidsp,
int *varidp)
213 if ((stat = NC_check_id(ncid, &ncp)))
215 return ncp->dispatch->def_var(ncid, name, xtype, ndims,
283 int stat = NC_check_id(ncid, &ncp);
285 return ncp->dispatch->rename_var(ncid, varid, name);
293 NC_is_recvar(
int ncid,
int varid,
size_t* nrecs)
304 if(ndims == 0)
return 0;
307 status =
nc_inq_dim(ncid,dimset[0],NULL,nrecs);
309 return (dimset[0] == unlimid ? 1: 0);
332 return ((
int)
sizeof(
char));
334 return ((
int)
sizeof(
signed char));
336 return ((
int)
sizeof(
short));
338 return ((
int)
sizeof(
int));
340 return ((
int)
sizeof(
float));
342 return ((
int)
sizeof(
double));
346 return ((
int)
sizeof(
unsigned char));
348 return ((
int)(
sizeof(
unsigned short)));
350 return ((
int)
sizeof(
unsigned int));
352 return ((
int)
sizeof(
signed long long));
354 return ((
int)
sizeof(
unsigned long long));
357 return ((
int)
sizeof(
char*));
369 NC_atomictypelen(
nc_type xtype)
373 case NC_NAT: sz = 0;
break;
374 case NC_BYTE: sz =
sizeof(
signed char);
break;
375 case NC_CHAR: sz =
sizeof(char);
break;
376 case NC_SHORT: sz =
sizeof(short);
break;
377 case NC_INT: sz =
sizeof(int);
break;
378 case NC_FLOAT: sz =
sizeof(float);
break;
379 case NC_DOUBLE: sz =
sizeof(double);
break;
380 case NC_INT64: sz =
sizeof(
signed long long);
break;
381 case NC_UBYTE: sz =
sizeof(
unsigned char);
break;
382 case NC_USHORT: sz =
sizeof(
unsigned short);
break;
383 case NC_UINT: sz =
sizeof(
unsigned int);
break;
384 case NC_UINT64: sz =
sizeof(
unsigned long long);
break;
386 case NC_STRING: sz =
sizeof(
char*);
break;
397 NC_atomictypename(
nc_type xtype)
401 case NC_NAT: nm =
"undefined";
break;
402 case NC_BYTE: nm =
"byte";
break;
403 case NC_CHAR: nm =
"char";
break;
405 case NC_INT: nm =
"int";
break;
411 case NC_UINT: nm =
"uint";
break;
426 NC_getshape(
int ncid,
int varid,
int ndims,
size_t* shape)
434 for(i = 0; i < ndims; i++)
472 int stat = NC_check_id(ncid, &ncp);
474 return ncp->dispatch->set_var_chunk_cache(ncid, varid, size,
510 int stat = NC_check_id(ncid, &ncp);
512 return ncp->dispatch->get_var_chunk_cache(ncid, varid, sizep,
513 nelemsp, preemptionp);
533 for (i = 0; i < len; i++)
539 nc_def_var_deflate(
int ncid,
int varid,
int shuffle,
int deflate,
int deflate_level)
542 int stat = NC_check_id(ncid,&ncp);
544 return ncp->dispatch->def_var_deflate(ncid,varid,shuffle,deflate,deflate_level);
548 nc_def_var_fletcher32(
int ncid,
int varid,
int fletcher32)
551 int stat = NC_check_id(ncid,&ncp);
553 return ncp->dispatch->def_var_fletcher32(ncid,varid,fletcher32);
557 nc_def_var_chunking(
int ncid,
int varid,
int storage,
558 const size_t *chunksizesp)
561 int stat = NC_check_id(ncid, &ncp);
563 return ncp->dispatch->def_var_chunking(ncid, varid, storage,
568 nc_def_var_fill(
int ncid,
int varid,
int no_fill,
const void *fill_value)
571 int stat = NC_check_id(ncid,&ncp);
573 return ncp->dispatch->def_var_fill(ncid,varid,no_fill,fill_value);
577 nc_def_var_endian(
int ncid,
int varid,
int endian)
580 int stat = NC_check_id(ncid,&ncp);
582 return ncp->dispatch->def_var_endian(ncid,varid,endian);
EXTERNL int nc_inq_unlimdim(int ncid, int *unlimdimidp)
Find the ID of the unlimited dimension.
#define NC_CHAR
ISO/ASCII character.
int nc_get_var_chunk_cache(int ncid, int varid, size_t *sizep, size_t *nelemsp, float *preemptionp)
EXTERNL int nc_inq_vardimid(int ncid, int varid, int *dimidsp)
Learn the dimension IDs associated with 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.
#define NC_UBYTE
unsigned 1 byte int
#define NC_MAX_VAR_DIMS
max per variable dimensions
#define NC_UINT
unsigned 4-byte int
#define NC_INT64
signed 8-byte int
#define NC_DOUBLE
double precision floating point number
EXTERNL int nc_inq_varndims(int ncid, int varid, int *ndimsp)
Learn how many dimensions are associated with a variable.
int nc_type
The nc_type type is just an int.
#define NC_BYTE
signed 1 byte integer
int nc_set_var_chunk_cache(int ncid, int varid, size_t size, size_t nelems, float preemption)
int nc_rename_var(int ncid, int varid, const char *name)
Rename a variable.
#define NC_INT
signed 4 byte integer
#define NC_NAT
Not A Type.
int nc_free_string(size_t len, char **data)
Free string space allocated by the library.
#define NC_USHORT
unsigned 2-byte int
#define NC_SHORT
signed 2 byte integer
#define NC_NOERR
No Error.
EXTERNL int nc_inq_dimlen(int ncid, int dimid, size_t *lenp)
Find the length of a dimension.
#define NC_FLOAT
single precision floating point number
#define NC_UINT64
unsigned 8-byte int
EXTERNL int nc_inq_dim(int ncid, int dimid, char *name, size_t *lenp)
Find the name and length of a dimension.