NetCDF  4.6.1
 All Data Structures Files Functions Variables Typedefs Macros Modules Pages
nc4file.c File Reference
#include "config.h"
#include <errno.h>
#include "nc.h"
#include "nc4internal.h"
#include "nc4dispatch.h"
#include <H5DSpublic.h>
#include <H5Fpublic.h>
#include <hdf5_hl.h>

Go to the source code of this file.

Macros

#define CD_NELEMS_ZLIB   1
 Number of parameters needed for ZLIB filter. More...
 
#define LOGOPEN   1
 
#define NUM_TYPES   12
 Number of netCDF atomic types. More...
 

Typedefs

typedef struct
NC4_rec_read_metadata_obj_info 
NC4_rec_read_metadata_obj_info_t
 
typedef struct
NC4_rec_read_metadata_ud 
NC4_rec_read_metadata_ud_t
 

Functions

static herr_t att_read_var_callbk (hid_t loc_id, const char *att_name, const H5A_info_t *ainfo, void *att_data)
 
static int close_netcdf4_file (NC_HDF5_FILE_INFO_T *h5, int abort)
 
static herr_t dimscale_visitor (hid_t did, unsigned dim, hid_t dsid, void *dimscale_hdf5_objids)
 
static int get_netcdf_type (NC_HDF5_FILE_INFO_T *h5, hid_t native_typeid, nc_type *xtype)
 
static int get_type_info2 (NC_HDF5_FILE_INFO_T *h5, hid_t datasetid, NC_TYPE_INFO_T **type_info)
 
static void hdf5free (void *memory)
 
int NC4__enddef (int ncid, size_t h_minfree, size_t v_align, size_t v_minfree, size_t r_align)
 
int NC4_abort (int ncid)
 
int NC4_close (int ncid)
 
int NC4_create (const char *path, int cmode, size_t initialsz, int basepe, size_t *chunksizehintp, int use_parallel, void *parameters, NC_Dispatch *dispatch, NC *nc_file)
 
static int nc4_create_file (const char *path, int cmode, MPI_Comm comm, MPI_Info info, NC *nc)
 
static int NC4_enddef (int ncid)
 
int nc4_enddef_netcdf4_file (NC_HDF5_FILE_INFO_T *h5)
 
int NC4_inq (int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp)
 
int NC4_open (const char *path, int mode, int basepe, size_t *chunksizehintp, int use_parallel, void *parameters, NC_Dispatch *dispatch, NC *nc_file)
 
static int nc4_open_file (const char *path, int mode, void *parameters, NC *nc)
 
static int nc4_rec_read_metadata (NC_GRP_INFO_T *grp)
 
static int nc4_rec_read_metadata_cb (hid_t grpid, const char *name, const H5L_info_t *info, void *_op_data)
 
static int nc4_rec_read_metadata_cb_list_add (NC4_rec_read_metadata_obj_info_t **head, NC4_rec_read_metadata_obj_info_t **tail, const NC4_rec_read_metadata_obj_info_t *oinfo)
 
int NC4_redef (int ncid)
 
int NC4_set_fill (int ncid, int fillmode, int *old_modep)
 
int NC4_sync (int ncid)
 
int nc4typelen (nc_type type)
 
int nc_get_chunk_cache (size_t *sizep, size_t *nelemsp, float *preemptionp)
 Get chunk cache size. More...
 
int nc_get_chunk_cache_ints (int *sizep, int *nelemsp, int *preemptionp)
 
int nc_set_chunk_cache (size_t size, size_t nelems, float preemption)
 Set chunk cache size. More...
 
int nc_set_chunk_cache_ints (int size, int nelems, int preemption)
 
static int read_coord_dimids (NC_GRP_INFO_T *grp, NC_VAR_INFO_T *var)
 
static int read_dataset (NC_GRP_INFO_T *grp, hid_t datasetid, const char *obj_name, const H5G_stat_t *statbuf)
 
static int read_grp_atts (NC_GRP_INFO_T *grp)
 
static int read_hdf5_att (NC_GRP_INFO_T *grp, hid_t attid, NC_ATT_INFO_T *att)
 
static int read_scale (NC_GRP_INFO_T *grp, hid_t datasetid, const char *obj_name, const H5G_stat_t *statbuf, hsize_t scale_size, hsize_t max_scale_size, NC_DIM_INFO_T **dim)
 
static int read_type (NC_GRP_INFO_T *grp, hid_t hdf_typeid, char *type_name)
 
static int read_var (NC_GRP_INFO_T *grp, hid_t datasetid, const char *obj_name, size_t ndims, NC_DIM_INFO_T *dim)
 
void reportopenobjects (int log, hid_t)
 
static int sync_netcdf4_file (NC_HDF5_FILE_INFO_T *h5)
 

Variables

static hid_t h5_native_type_constant_g [NUM_TYPES]
 
static const int ILLEGAL_CREATE_FLAGS = (NC_NOWRITE|NC_MMAP|NC_INMEMORY|NC_64BIT_OFFSET|NC_CDF5)
 
static const int ILLEGAL_OPEN_FLAGS = (NC_MMAP|NC_64BIT_OFFSET)
 
size_t nc4_chunk_cache_nelems = CHUNK_CACHE_NELEMS
 Default chunk cache number of elements. More...
 
float nc4_chunk_cache_preemption = CHUNK_CACHE_PREEMPTION
 Default chunk cache preemption. More...
 
size_t nc4_chunk_cache_size = CHUNK_CACHE_SIZE
 Default chunk cache size. More...
 
const char * NC_RESERVED_ATT_LIST []
 
const char * NC_RESERVED_SPECIAL_LIST []
 
const char * NC_RESERVED_VARATT_LIST []
 
static const nc_type nc_type_constant_g [NUM_TYPES]
 
static const char nc_type_name_g [NUM_TYPES][NC_MAX_NAME+1]
 
static const int nc_type_size_g [NUM_TYPES]
 

Macro Definition Documentation

#define CD_NELEMS_ZLIB   1

Number of parameters needed for ZLIB filter.

Definition at line 27 of file nc4file.c.

#define NUM_TYPES   12

Number of netCDF atomic types.

Definition at line 674 of file nc4file.c.

Function Documentation

int nc_get_chunk_cache ( size_t *  sizep,
size_t *  nelemsp,
float *  preemptionp 
)

Get chunk cache size.

Only affects files opened/created after it is called.

Parameters
sizepPointer that gets size in bytes to set cache.
nelemspPointer that gets number of elements to hold in cache.
preemptionpPointer that gets premption stragety (between 0 and 1).
Returns
NC_NOERR No error.
Author
Ed Hartnett

Definition at line 734 of file nc4file.c.

int nc_set_chunk_cache ( size_t  size,
size_t  nelems,
float  preemption 
)

Set chunk cache size.

Only affects files opened/created after it is called.

Parameters
sizeSize in bytes to set cache.
nelemsNumber of elements to hold in cache.
preemptionPremption stragety (between 0 and 1).
Returns
NC_NOERR No error.
NC_EINVAL Bad preemption.
Author
Ed Hartnett

Definition at line 712 of file nc4file.c.

Variable Documentation

size_t nc4_chunk_cache_nelems = CHUNK_CACHE_NELEMS

Default chunk cache number of elements.

Definition at line 671 of file nc4file.c.

float nc4_chunk_cache_preemption = CHUNK_CACHE_PREEMPTION

Default chunk cache preemption.

Definition at line 672 of file nc4file.c.

size_t nc4_chunk_cache_size = CHUNK_CACHE_SIZE

Default chunk cache size.

Definition at line 670 of file nc4file.c.

const char* NC_RESERVED_ATT_LIST[]
Initial value:
= {
NC_ATT_FORMAT,
NC3_STRICT_ATT_NAME,
NCPROPS,
ISNETCDF4ATT,
SUPERBLOCKATT,
NULL
}

Definition at line 650 of file nc4file.c.

const char* NC_RESERVED_SPECIAL_LIST[]
Initial value:
= {
ISNETCDF4ATT,
SUPERBLOCKATT,
NCPROPS,
NULL
}

Definition at line 663 of file nc4file.c.

const char* NC_RESERVED_VARATT_LIST[]
Initial value:
= {
NC_ATT_REFERENCE_LIST,
NC_ATT_CLASS,
NC_ATT_DIMENSION_LIST,
NC_ATT_NAME,
NC_ATT_COORDINATES,
NC_DIMID_ATT_NAME,
NULL
}

Definition at line 635 of file nc4file.c.

const nc_type nc_type_constant_g[NUM_TYPES]
static
Initial value:
#define NC_CHAR
ISO/ASCII character.
Definition: netcdf.h:35
#define NC_UBYTE
unsigned 1 byte int
Definition: netcdf.h:41
#define NC_UINT
unsigned 4-byte int
Definition: netcdf.h:43
#define NC_INT64
signed 8-byte int
Definition: netcdf.h:44
#define NC_STRING
string
Definition: netcdf.h:46
#define NC_DOUBLE
double precision floating point number
Definition: netcdf.h:40
#define NC_BYTE
signed 1 byte integer
Definition: netcdf.h:34
#define NC_INT
signed 4 byte integer
Definition: netcdf.h:37
#define NC_USHORT
unsigned 2-byte int
Definition: netcdf.h:42
#define NC_SHORT
signed 2 byte integer
Definition: netcdf.h:36
#define NC_FLOAT
single precision floating point number
Definition: netcdf.h:39
#define NC_UINT64
unsigned 8-byte int
Definition: netcdf.h:45

Definition at line 688 of file nc4file.c.

const char nc_type_name_g[NUM_TYPES][NC_MAX_NAME+1]
static
Initial value:
= {"char", "byte", "short",
"int", "float", "double", "ubyte",
"ushort", "uint", "int64",
"uint64", "string"}

Definition at line 682 of file nc4file.c.

const int nc_type_size_g[NUM_TYPES]
static
Initial value:
= {sizeof(char), sizeof(char), sizeof(short),
sizeof(int), sizeof(float), sizeof(double), sizeof(unsigned char),
sizeof(unsigned short), sizeof(unsigned int), sizeof(long long),
sizeof(unsigned long long), sizeof(char *)}

Definition at line 694 of file nc4file.c.


Return to the Main Unidata NetCDF page.
Generated on Fri May 11 2018 21:22:26 for NetCDF. NetCDF is a Unidata library.