CDFDERIV

NAME
SYNOPSIS
DESCRIPTION
EXAMPLE

NAME

cdfderiv −− take partial derivative of a field with respect to a dimension

SYNOPSIS

cdfderiv [-c|r] derived_field input_field dimension

DESCRIPTION

Cdfderiv reads a common data format file from the standard input and writes a modified version to the standard output. The modification consists of adding a field that is the partial derivative of a specified field with respect to a specified dimension. The dimension must have an associated index field. The "derived_field" argument on the command line is the name of the derivative field to be added, while "input_field" is that field whose derivative is to be taken. The dimension name is specified by "dimension" on the command line.

Centered differences are used for computing the derivatives where possible. End points and those points that would require derivatives to be computed from bad data result in an attempt to use off−centered second order derivatives. If this fails, off−centered first order derivatives are tried, and if this also fails, the output point is set to the bad data value. If the option -c is set, the data are assumed to be cyclic along the dimension in question and the end point derivatives take data from the other end. If the option -r is set, the data are assumed to be cyclic with the end point being repeated, i. e., data[first point] = data[last point]. For either cyclic option the index field interval between successive points is assumed to be constant.

EXAMPLE

Suppose that "infile" has a field named "u" that has "x" as a dimension. Further suppose that the values of "x" are represented in an index field of that name. The invocation

kestrel%cdfderiv dudx u x < infile > outfile

adds a field "dudx" to "infile" and puts the result in "outfile". "Dudx" contains the derivative of "u" with respect to "x". Note that "u" may have zero or more dimensions in addition to "x". The derivative will be computed for all values of these optional dimensions.