![]() |
NetCDF 4.9.3
|
#include "config.h"
#include "nc4internal.h"
#include "nc4dispatch.h"
#include <math.h>
Go to the source code of this file.
Macros | |
#define | BIT_XPL_NBR_SGN_DBL (52) |
Used in quantize code. | |
#define | BIT_XPL_NBR_SGN_FLT (23) |
Used in quantize code. | |
#define | DEFAULT_1D_UNLIM_SIZE (4096) |
#define | M_LN10 2.30258509299404568402 |
log_e 10 | |
#define | M_LN2 0.69314718055994530942 |
log_e 2 | |
Functions | |
int | nc4_check_chunksizes (NC_GRP_INFO_T *grp, NC_VAR_INFO_T *var, const size_t *chunksizes) |
int | nc4_convert_type (const void *src, void *dest, const nc_type src_type, const nc_type dest_type, const size_t len, int *range_error, const void *fill_value, int strict_nc3, int quantize_mode, int nsd) |
int | nc4_find_default_chunksizes2 (NC_GRP_INFO_T *grp, NC_VAR_INFO_T *var) |
int | nc4_get_default_atomic_fill_value (nc_type xtype, void *fill_value) |
int | nc4_get_default_fill_value (NC_TYPE_INFO_T *tinfo, void *fill_value) |
int | nc4_get_fill_value (NC_FILE_INFO_T *h5, NC_VAR_INFO_T *var, void **fillp) |
int | nc4_get_typelen_mem (NC_FILE_INFO_T *h5, nc_type xtype, size_t *len) |
int | NC4_get_var_chunk_cache (int ncid, int varid, size_t *sizep, size_t *nelemsp, float *preemptionp) |
int | NC4_inq_var_all (int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp, int *shufflep, int *deflatep, int *deflate_levelp, int *fletcher32p, int *storagep, size_t *chunksizesp, int *no_fill, void *fill_valuep, int *endiannessp, unsigned int *idp, size_t *nparamsp, unsigned int *params) |
int | NC4_inq_varid (int ncid, const char *name, int *varidp) |
int | NC4_var_par_access (int ncid, int varid, int par_access) |
int | nc_get_var_chunk_cache_ints (int ncid, int varid, int *sizep, int *nelemsp, int *preemptionp) |
int | nc_inq_var_chunking_ints (int ncid, int varid, int *storagep, int *chunksizesp) |
This file is part of netcdf-4, a netCDF-like interface for HDF5, or a HDF5 backend for netCDF, depending on your point of view. This file handles the NetCDF-4 variable functions.
Definition in file nc4var.c.
#define BIT_XPL_NBR_SGN_DBL (52) |
#define BIT_XPL_NBR_SGN_FLT (23) |
#define DEFAULT_1D_UNLIM_SIZE (4096) |
int nc4_check_chunksizes | ( | NC_GRP_INFO_T * | grp, |
NC_VAR_INFO_T * | var, | ||
const size_t * | chunksizes ) |
Check a set of chunksizes to see if they specify a chunk that is too big.
grp | Pointer to the group info. |
var | Pointer to the var info. |
chunksizes | Array of chunksizes to check. |
int nc4_convert_type | ( | const void * | src, |
void * | dest, | ||
const nc_type | src_type, | ||
const nc_type | dest_type, | ||
const size_t | len, | ||
int * | range_error, | ||
const void * | fill_value, | ||
int | strict_nc3, | ||
int | quantize_mode, | ||
int | nsd ) |
Copy data from one buffer to another, performing appropriate data conversion.
This function will copy data from one buffer to another, in accordance with the types. Range errors will be noted, and the fill value used (or the default fill value if none is supplied) for values that overflow the type.
This function applies quantization to float and double data, if desired. The code to do this is derived from the corresponding filter in the CCR project (e.g., https://github.com/ccr/ccr/blob/master/hdf5_plugins/BITGROOM/src/H5Zbitgroom.c).
src | Pointer to source of data. |
dest | Pointer that gets data. |
src_type | Type ID of source data. |
dest_type | Type ID of destination data. |
len | Number of elements of data to copy. |
range_error | Pointer that gets 1 if there was a range error. |
fill_value | The fill value. |
strict_nc3 | Non-zero if strict model in effect. |
quantize_mode | May be NC_NOQUANTIZE, NC_QUANTIZE_BITGROOM, NC_QUANTIZE_GRANULARBR, or NC_QUANTIZE_BITROUND. |
nsd | Number of significant digits for quantize. Ignored unless quantize_mode is NC_QUANTIZE_BITGROOM, NC_QUANTIZE_GRANULARBR, or NC_QUANTIZE_BITROUND |
int nc4_find_default_chunksizes2 | ( | NC_GRP_INFO_T * | grp, |
NC_VAR_INFO_T * | var ) |
Determine some default chunksizes for a variable.
grp | Pointer to the group info. |
var | Pointer to the var info. |
int nc4_get_default_atomic_fill_value | ( | nc_type | xtype, |
void * | fill_value ) |
int nc4_get_default_fill_value | ( | NC_TYPE_INFO_T * | tinfo, |
void * | fill_value ) |
int nc4_get_fill_value | ( | NC_FILE_INFO_T * | h5, |
NC_VAR_INFO_T * | var, | ||
void ** | fillp ) |
int nc4_get_typelen_mem | ( | NC_FILE_INFO_T * | h5, |
nc_type | xtype, | ||
size_t * | len ) |
int NC4_get_var_chunk_cache | ( | int | ncid, |
int | varid, | ||
size_t * | sizep, | ||
size_t * | nelemsp, | ||
float * | preemptionp ) |
This is called by nc_get_var_chunk_cache(). Get chunk cache size for a variable.
ncid | File ID. |
varid | Variable ID. |
sizep | Gets size in bytes of cache. |
nelemsp | Gets number of element slots in cache. |
preemptionp | Gets cache swapping setting. |
int NC4_inq_var_all | ( | int | ncid, |
int | varid, | ||
char * | name, | ||
nc_type * | xtypep, | ||
int * | ndimsp, | ||
int * | dimidsp, | ||
int * | nattsp, | ||
int * | shufflep, | ||
int * | deflatep, | ||
int * | deflate_levelp, | ||
int * | fletcher32p, | ||
int * | storagep, | ||
size_t * | chunksizesp, | ||
int * | no_fill, | ||
void * | fill_valuep, | ||
int * | endiannessp, | ||
unsigned int * | idp, | ||
size_t * | nparamsp, | ||
unsigned int * | params ) |
Get all the information about a variable. Pass NULL for whatever you don't care about. This is the internal function called by nc_inq_var(), nc_inq_var_deflate(), nc_inq_var_fletcher32(), nc_inq_var_chunking(), nc_inq_var_chunking_ints(), nc_inq_var_fill(), nc_inq_var_endian(), nc_inq_var_filter(), and nc_inq_var_szip().
ncid | File ID. |
varid | Variable ID. |
name | Gets name. |
xtypep | Gets type. |
ndimsp | Gets number of dims. |
dimidsp | Gets array of dim IDs. |
nattsp | Gets number of attributes. |
shufflep | Gets shuffle setting. |
deflatep | Gets deflate setting. |
deflate_levelp | Gets deflate level. |
fletcher32p | Gets fletcher32 setting. |
storagep | Gets storage setting. |
chunksizesp | Gets chunksizes. |
no_fill | Gets fill mode. |
fill_valuep | Gets fill value. |
endiannessp | Gets one of NC_ENDIAN_BIG NC_ENDIAN_LITTLE NC_ENDIAN_NATIVE |
idp | Pointer to memory to store filter id. |
nparamsp | Pointer to memory to store filter parameter count. |
params | Pointer to vector of unsigned integers into which to store filter parameters. |
int NC4_inq_varid | ( | int | ncid, |
const char * | name, | ||
int * | varidp ) |
Find the ID of a variable, from the name. This function is called by nc_inq_varid().
ncid | File ID. |
name | Name of the variable. |
varidp | Gets variable ID. |
int NC4_var_par_access | ( | int | ncid, |
int | varid, | ||
int | par_access ) |
This function will change the parallel access of a variable from independent to collective.
ncid | File ID. |
varid | Variable ID. |
par_access | NC_COLLECTIVE or NC_INDEPENDENT. |
int nc_get_var_chunk_cache_ints | ( | int | ncid, |
int | varid, | ||
int * | sizep, | ||
int * | nelemsp, | ||
int * | preemptionp ) |
A wrapper for NC4_get_var_chunk_cache(), we need this version for fortran.
ncid | File ID. |
varid | Variable ID. |
sizep | Gets size in MB of cache. |
nelemsp | Gets number of element slots in cache. |
preemptionp | Gets cache swapping setting. |
int nc_inq_var_chunking_ints | ( | int | ncid, |
int | varid, | ||
int * | storagep, | ||
int * | chunksizesp ) |
Inquire about chunking settings for a var. This is used by the fortran API.
ncid | File ID. |
varid | Variable ID. |
storagep | Gets contiguous setting. |
chunksizesp | Gets chunksizes. |