File ncdump/vardata.c

RCS Header: /usr/local/pkg/usg/netcdf3.4x/cvs/src/ncdump/vardata.c,v 1.1.1.1 1998/05/22 15:09:07 rkowen Exp




Included Files

for FLT_EPSILON, DBL_EPSILON

NO_FLOAT_H


Preprocessor definitions

#define STREQ( a, b )

#define absval( x )

corner coordinates edges of hypercube "odometer" increment to next "row"

#define VALBUFSIZ 1000


Local Variables

float_eps
static float float_eps
Used in:

double_eps
static double double_eps

Used in:

Global Function vardata()

Output the data for a single variable, in CDL syntax.

int vardata ( const struct ncvar* vp, size_t vdims[], int ncid, int varid, const struct fspec* fsp )

const struct ncvar* vp
variable
size_t vdims[]
variable dimension sizes
int ncid
netcdf id
int varid
variable id
const struct fspec* fsp
formatting specs
Prototyped in:
Calls:
Called by:

Local Function annotate()

* Annotates a value in data section with var name and indices in comment

static void annotate ( const struct ncvar* vp, const struct fspec* fsp, const size_t* cor, long iel )

const struct ncvar* vp
variable
const struct fspec* fsp
formatting specs
const size_t* cor
corner coordinates
long iel
which element in current row
Prototyped in:
Calls:
Called by:

Local Function double_epsilon()

static double double_epsilon ( void )
Prototyped in:
Called by:

Local Function float_epsilon()

static float float_epsilon ( void )
Prototyped in:
Called by:

Local Function init_epsilons()

static void init_epsilons ( void )
Prototyped in:
Calls:
Called by:
References Variables:

Local Function lastdelim()

* print last delimiter in each line before annotation (, or ;)

static void lastdelim ( boolean more, boolean lastrow )

Prototyped in:
Calls:
Called by:

Local Function lastdelim2()

* print last delimiter in each line before annotation (, or ;)

static void lastdelim2 ( boolean more, boolean lastrow )

Prototyped in:
Calls:
Called by:

Local Function pr_bvals()

* Print a number of byte variable values, where the optional comments * for each value identify the variable, and each dimension index.

static void pr_bvals ( const struct ncvar* vp, size_t len, const char* fmt, boolean more, boolean lastrow, const signed char* vals, const struct fspec* fsp, const size_t* cor )

const struct ncvar* vp
variable
size_t len
number of values to print
const char* fmt
printf format used for each value. If * nc_type is NC_CHAR and this is NULL, * character arrays will be printed as * strings enclosed in quotes.
boolean more
true if more data for this row will * follow, so add trailing comma
boolean lastrow
true if this is the last row for this * variable, so terminate with ";" instead * of ","
const signed char* vals
pointer to block of values
const struct fspec* fsp
formatting specs
const size_t* cor
corner coordinates
Prototyped in:
Calls:
Called by:

Local Function pr_dvals()

* Print a number of double variable values, where the optional comments * for each value identify the variable, and each dimension index.

static void pr_dvals ( const struct ncvar* vp, size_t len, const char* fmt, boolean more, boolean lastrow, const double* vals, const struct fspec* fsp, const size_t* cor )

const struct ncvar* vp
variable
size_t len
number of values to print
const char* fmt
printf format used for each value. If * nc_type is NC_CHAR and this is NULL, * character arrays will be printed as * strings enclosed in quotes.
boolean more
true if more data for this row will * follow, so add trailing comma
boolean lastrow
true if this is the last row for this * variable, so terminate with ";" instead * of ","
const double* vals
pointer to block of values
const struct fspec* fsp
formatting specs
const size_t* cor
corner coordinates
Prototyped in:
Calls:
Called by:

Local Function pr_fvals()

* Print a number of float variable values, where the optional comments * for each value identify the variable, and each dimension index.

static void pr_fvals ( const struct ncvar* vp, size_t len, const char* fmt, boolean more, boolean lastrow, const float* vals, const struct fspec* fsp, const size_t* cor )

const struct ncvar* vp
variable
size_t len
number of values to print
const char* fmt
printf format used for each value. If * nc_type is NC_CHAR and this is NULL, * character arrays will be printed as * strings enclosed in quotes.
boolean more
true if more data for this row will * follow, so add trailing comma
boolean lastrow
true if this is the last row for this * variable, so terminate with ";" instead * of ","
const float* vals
pointer to block of values
const struct fspec* fsp
formatting specs
const size_t* cor
corner coordinates
Prototyped in:
Calls:
Called by:

Local Function pr_ivals()

* Print a number of int variable values, where the optional comments * for each value identify the variable, and each dimension index.

static void pr_ivals ( const struct ncvar* vp, size_t len, const char* fmt, boolean more, boolean lastrow, const int* vals, const struct fspec* fsp, const size_t* cor )

const struct ncvar* vp
variable
size_t len
number of values to print
const char* fmt
printf format used for each value. If * nc_type is NC_CHAR and this is NULL, * character arrays will be printed as * strings enclosed in quotes.
boolean more
true if more data for this row will * follow, so add trailing comma
boolean lastrow
true if this is the last row for this * variable, so terminate with ";" instead * of ","
const int* vals
pointer to block of values
const struct fspec* fsp
formatting specs
const size_t* cor
corner coordinates
Prototyped in:
Calls:
Called by:

Local Function pr_svals()

* Print a number of short variable values, where the optional comments * for each value identify the variable, and each dimension index.

static void pr_svals ( const struct ncvar* vp, size_t len, const char* fmt, boolean more, boolean lastrow, const short* vals, const struct fspec* fsp, const size_t* cor )

const struct ncvar* vp
variable
size_t len
number of values to print
const char* fmt
printf format used for each value. If * nc_type is NC_CHAR and this is NULL, * character arrays will be printed as * strings enclosed in quotes.
boolean more
true if more data for this row will * follow, so add trailing comma
boolean lastrow
true if this is the last row for this * variable, so terminate with ";" instead * of ","
const short* vals
pointer to block of values
const struct fspec* fsp
formatting specs
const size_t* cor
corner coordinates
Prototyped in:
Calls:
Called by:

Local Function pr_tvals()

* Print a number of char variable values, where the optional comments * for each value identify the variable, and each dimension index.

static void pr_tvals ( const struct ncvar* vp, size_t len, const char* fmt, boolean more, boolean lastrow, const char* vals, const struct fspec* fsp, const size_t* cor )

const struct ncvar* vp
variable
size_t len
number of values to print
const char* fmt
printf format used for each value. If * nc_type is NC_CHAR and this is NULL, * character arrays will be printed as * strings enclosed in quotes.
boolean more
true if more data for this row will * follow, so add trailing comma
boolean lastrow
true if this is the last row for this * variable, so terminate with ";" instead * of ","
const char* vals
pointer to block of values
const struct fspec* fsp
formatting specs
const size_t* cor
corner coordinates
Prototyped in:
Calls:
Called by:

Local Function printbval()

* Output a value of a byte variable, except if there is a fill value for * the variable and the value is the fill value, print the fill-value string * instead.

static void printbval ( char* sout, const char* fmt, const struct ncvar* varp, signed char val )

char* sout
string where output goes
const char* fmt
printf format used for value
const struct ncvar* varp
variable
signed char val
value
Prototyped in:
Calls:
Called by:

Local Function printdval()

* Output a value of a double variable, except if there is a fill value for * the variable and the value is the fill value, print the fill-value string * instead. Floating-point fill values need only be within machine epsilon of * defined fill value.

static void printdval ( char* sout, const char* fmt, const struct ncvar* varp, double val )

char* sout
string where output goes
const char* fmt
printf format used for value
const struct ncvar* varp
variable
double val
value
Prototyped in:
Calls:
Called by:
References Variables:

Local Function printfval()

* Output a value of a float variable, except if there is a fill value for * the variable and the value is the fill value, print the fill-value string * instead. Floating-point fill values need only be within machine epsilon of * defined fill value.

static void printfval ( char* sout, const char* fmt, const struct ncvar* varp, float val )

char* sout
string where output goes
const char* fmt
printf format used for value
const struct ncvar* varp
variable
float val
value
Prototyped in:
Calls:
Called by:
References Variables:

Local Function printival()

* Output a value of an int variable, except if there is a fill value for * the variable and the value is the fill value, print the fill-value string * instead.

static void printival ( char* sout, const char* fmt, const struct ncvar* varp, int val )

char* sout
string where output goes
const char* fmt
printf format used for value
const struct ncvar* varp
variable
int val
value
Prototyped in:
Calls:
Called by:

Local Function printsval()

* Output a value of a short variable, except if there is a fill value for * the variable and the value is the fill value, print the fill-value string * instead.

static void printsval ( char* sout, const char* fmt, const struct ncvar* varp, short val )

char* sout
string where output goes
const char* fmt
printf format used for value
const struct ncvar* varp
variable
short val
value
Prototyped in:
Calls:
Called by:

Local Function upcorner()

* Updates a vector of ints, odometer style. Returns 0 if odometer * overflowed, else 1.

static int upcorner ( const size_t* dims, int ndims, size_t* odom, const size_t* add )

const size_t* dims
The "odometer" limits for each dimension
int ndims
Number of dimensions
size_t* odom
The "odometer" vector to be updated
const size_t* add
A vector to "add" to odom on each update
Prototyped in:
Called by: