NetCDF  4.3.2
 All Data Structures Files Functions Variables Typedefs Macros Modules Pages
nc4file.c File Reference

The netCDF-4 file functions. More...

#include "config.h"
#include <errno.h>
#include "nc.h"
#include "nc4internal.h"
#include "nc4dispatch.h"
#include "H5DSpublic.h"

Go to the source code of this file.

Data Structures

struct  NC4_rec_read_metadata_obj_info
 
struct  NC4_rec_read_metadata_ud
 

Macros

#define MIN_DEFLATE_LEVEL   0
 
#define MAX_DEFLATE_LEVEL   9
 
#define REFERENCE_LIST   "REFERENCE_LIST"
 
#define CLASS   "CLASS"
 
#define DIMENSION_LIST   "DIMENSION_LIST"
 
#define NAME   "NAME"
 
#define NUM_TYPES   12
 
#define MAGIC_NUMBER_LEN   4
 
#define NC_HDF5_FILE   1
 
#define NC_HDF4_FILE   2
 
#define CD_NELEMS_ZLIB   1
 
#define CD_NELEMS_SZIP   4
 

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 int NC4_enddef (int ncid)
 
static int nc4_rec_read_metadata (NC_GRP_INFO_T *grp)
 
static int close_netcdf4_file (NC_HDF5_FILE_INFO_T *h5, int abort)
 
int nc_set_chunk_cache (size_t size, size_t nelems, float preemption)
 
int nc_get_chunk_cache (size_t *sizep, size_t *nelemsp, float *preemptionp)
 
int nc_set_chunk_cache_ints (int size, int nelems, int preemption)
 
int nc_get_chunk_cache_ints (int *sizep, int *nelemsp, int *preemptionp)
 
int nc4typelen (nc_type type)
 
static int nc_check_for_hdf (const char *path, int use_parallel, MPI_Comm comm, MPI_Info info, int *hdf_file)
 
static int nc4_create_file (const char *path, int cmode, MPI_Comm comm, MPI_Info info, NC *nc)
 
int NC4_create (const char *path, int cmode, size_t initialsz, int basepe, size_t *chunksizehintp, int use_parallel, void *mpidata, NC_Dispatch *dispatch, NC *nc_file)
 Create a netCDF-4/HDF5 file. More...
 
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_coord_dimids (NC_VAR_INFO_T *var)
 
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 int read_hdf5_att (NC_GRP_INFO_T *grp, hid_t attid, NC_ATT_INFO_T *att)
 
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)
 
static int read_grp_atts (NC_GRP_INFO_T *grp)
 
static int read_dataset (NC_GRP_INFO_T *grp, hid_t datasetid, const char *obj_name, const H5G_stat_t *statbuf)
 
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)
 
static int nc4_rec_read_metadata_cb (hid_t grpid, const char *name, const H5L_info_t *info, void *_op_data)
 
static int nc4_open_file (const char *path, int mode, MPI_Comm comm, MPI_Info info, NC *nc)
 
int NC4_open (const char *path, int mode, int basepe, size_t *chunksizehintp, int use_parallel, void *mpidata, NC_Dispatch *dispatch, NC *nc_file)
 
int NC4_set_fill (int ncid, int fillmode, int *old_modep)
 
int NC4_redef (int ncid)
 
int NC4__enddef (int ncid, size_t h_minfree, size_t v_align, size_t v_minfree, size_t r_align)
 
static int sync_netcdf4_file (NC_HDF5_FILE_INFO_T *h5)
 
int NC4_sync (int ncid)
 
int NC4_abort (int ncid)
 
int NC4_close (int ncid)
 
int NC4_inq (int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp)
 
int nc4_enddef_netcdf4_file (NC_HDF5_FILE_INFO_T *h5)
 

Variables

size_t nc4_chunk_cache_size = CHUNK_CACHE_SIZE
 
size_t nc4_chunk_cache_nelems = CHUNK_CACHE_NELEMS
 
float nc4_chunk_cache_preemption = CHUNK_CACHE_PREEMPTION
 
static int virgin = 1
 
static hid_t h5_native_type_constant_g [NUM_TYPES]
 
static const char nc_type_name_g [NUM_TYPES][NC_MAX_NAME+1]
 
static const nc_type nc_type_constant_g [NUM_TYPES]
 
static const int nc_type_size_g [NUM_TYPES]
 

Detailed Description

The netCDF-4 file functions.

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.

Copyright 2003, University Corporation for Atmospheric Research. See COPYRIGHT file for copying and redistribution conditions.

Definition in file nc4file.c.

Function Documentation

int NC4_create ( const char *  path,
int  cmode,
size_t  initialsz,
int  basepe,
size_t *  chunksizehintp,
int  use_parallel,
void *  mpidata,
NC_Dispatch *  dispatch,
NC *  nc_file 
)

Create a netCDF-4/HDF5 file.

Parameters
pathThe file name of the new file.
cmodeThe creation mode flag.
initialszIgnored by this function.
basepeIgnored by this function.
chunksizehintpIgnored by this function.
use_parallel0 for sequential, non-zero for parallel I/O.
mpidatapointer to struct holdind data for parallel I/O layer. Ignored if NULL.
dispatchPointer to the dispatch table for this file.
nc_filePointer to an instance of NC.
Returns
NC_INVAL Invalid input (check cmode).

Definition at line 425 of file nc4file.c.

Variable Documentation

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

Definition at line 85 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 81 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 89 of file nc4file.c.


Return to the Main Unidata NetCDF page.
Generated on Sun Nov 23 2014 16:24:54 for NetCDF. NetCDF is a Unidata library.