NetCDF  4.8.1
dv2i.c File Reference
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include "netcdf.h"
#include <math.h>

Go to the source code of this file.

Macros

#define A_DECL(name, type, ndims, rhs)   const type *const name = ((const type *)(rhs))
 
#define A_FREE(name)
 Free a variable. More...
 
#define A_INIT(lhs, type, ndims, rhs)
 Init a variable. More...
 
#define NDIMS_DECL
 NDIMS declaration. More...
 

Typedefs

typedef signed char schar
 Signed character type. More...
 

Functions

static int dimsizes (int ncid, int varid, size_t *sizes)
 Retrieves the dimension sizes of a variable with a specified variable id in an open netCDF file. More...
 
void nc_advise (const char *routine_name, int err, const char *fmt,...)
 
int nc_get_rec (int ncid, size_t recnum, void **datap)
 
int nc_inq_rec (int ncid, size_t *nrecvarsp, int *recvarids, size_t *recsizes)
 
int nc_put_rec (int ncid, size_t recnum, void *const *datap)
 
int ncabort (int ncid)
 
int ncattcopy (int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out)
 
int ncattdel (int ncid, int varid, const char *name)
 
int ncattget (int ncid, int varid, const char *name, void *value)
 
int ncattinq (int ncid, int varid, const char *name, nc_type *datatype, int *len)
 
int ncattname (int ncid, int varid, int attnum, char *name)
 
int ncattput (int ncid, int varid, const char *name, nc_type datatype, int len, const void *value)
 
int ncattrename (int ncid, int varid, const char *name, const char *newname)
 
int ncclose (int ncid)
 
int nccreate (const char *path, int cmode)
 
int ncdimdef (int ncid, const char *name, long length)
 
int ncdimid (int ncid, const char *name)
 
int ncdiminq (int ncid, int dimid, char *name, long *length)
 
int ncdimrename (int ncid, int dimid, const char *name)
 
int ncendef (int ncid)
 
int ncinquire (int ncid, int *ndims, int *nvars, int *natts, int *recdim)
 
int ncopen (const char *path, int mode)
 
int ncrecget (int ncid, long recnum, void **datap)
 
int ncrecinq (int ncid, int *nrecvars, int *recvarids, long *recsizes)
 
int ncrecput (int ncid, long recnum, void *const *datap)
 
static int ncrecsize (int ncid, int varid, size_t *recsizep)
 Computes record size (in bytes) of the record variable with a specified variable id. More...
 
int ncredef (int ncid)
 
int ncsetfill (int ncid, int fillmode)
 
int ncsync (int ncid)
 
int ncvardef (int ncid, const char *name, nc_type datatype, int ndims, const int *dim)
 
int ncvarget (int ncid, int varid, const long *start, const long *count, void *value)
 
int ncvarget1 (int ncid, int varid, const long *index, void *value)
 
int ncvargetg (int ncid, int varid, const long *start, const long *count, const long *stride, const long *map, void *value)
 
int ncvargets (int ncid, int varid, const long *start, const long *count, const long *stride, void *value)
 
int ncvarid (int ncid, const char *name)
 
int ncvarinq (int ncid, int varid, char *name, nc_type *datatype, int *ndims, int *dim, int *natts)
 
int ncvarput (int ncid, int varid, const long *start, const long *count, const void *value)
 
int ncvarput1 (int ncid, int varid, const long *index, const void *value)
 
int ncvarputg (int ncid, int varid, const long *start, const long *count, const long *stride, const long *map, const void *value)
 
int ncvarputs (int ncid, int varid, const long *start, const long *count, const long *stride, const void *value)
 
int ncvarrename (int ncid, int varid, const char *name)
 
static int numrecvars (int ncid, int *nrecvarsp, int *recvarids)
 Computes number of record variables in an open netCDF file, and an array of the record variable ids, if the array parameter is non-null. More...
 

Variables

int ncerr = NC_NOERR
 V2 API error code. More...
 
int ncopts = (NC_FATAL | NC_VERBOSE)
 The subroutines in error.c emit no messages unless NC_VERBOSE bit is on. More...
 

Detailed Description

The V2 API Functions.

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

Definition in file dv2i.c.

Macro Definition Documentation

◆ A_FREE

#define A_FREE (   name)

Free a variable.

Definition at line 52 of file dv2i.c.

◆ A_INIT

#define A_INIT (   lhs,
  type,
  ndims,
  rhs 
)

Init a variable.

Definition at line 54 of file dv2i.c.

◆ NDIMS_DECL

#define NDIMS_DECL

NDIMS declaration.

Definition at line 46 of file dv2i.c.

Typedef Documentation

◆ schar

typedef signed char schar

Signed character type.

Definition at line 121 of file dv2i.c.

Function Documentation

◆ dimsizes()

static int dimsizes ( int  ncid,
int  varid,
size_t *  sizes 
)
static

Retrieves the dimension sizes of a variable with a specified variable id in an open netCDF file.


Parameters
ncidFile ID.
varidVariable ID.
sizesPointer that gets sizes.
Returns
NC_NOERR No error.
-1 on error.
Author
Russ Rew

Definition at line 240 of file dv2i.c.

◆ ncrecsize()

static int ncrecsize ( int  ncid,
int  varid,
size_t *  recsizep 
)
static

Computes record size (in bytes) of the record variable with a specified variable id.

Returns size as 0 if not a record variable.

Parameters
ncidFile ID.
varidVariable ID.
recsizepPointer that gets record size.
Returns
size, or 0 if not a record variable

Definition at line 188 of file dv2i.c.

◆ numrecvars()

static int numrecvars ( int  ncid,
int *  nrecvarsp,
int *  recvarids 
)
static

Computes number of record variables in an open netCDF file, and an array of the record variable ids, if the array parameter is non-null.

Parameters
ncidFile ID.
nrecvarspPointer that gets number of record variables.
recvaridsPointer that gets array of record variable IDs.
Returns
NC_NOERR No error.
-1 on error.
Author
Russ Rew

Definition at line 136 of file dv2i.c.

Variable Documentation

◆ ncerr

int ncerr = NC_NOERR

V2 API error code.

Definition at line 37 of file dv2i.c.

◆ ncopts

int ncopts = (NC_FATAL | NC_VERBOSE)

The subroutines in error.c emit no messages unless NC_VERBOSE bit is on.

They call exit() when NC_FATAL bit is on.

Definition at line 35 of file dv2i.c.