cdfinteg −− integrate a field with respect to a dimension
cdfinteg -t or -b int_field field dim_field
Cdfinteg 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 integral of a specified field with respect to a specified dimension. The dimension must have an associated index field. The "int_field" argument on the command line is the name of the integral field to be added, while "field" the that field whose integral is to be taken. The index field name is specified by "dim_field" on the command line. The -b option implies that the integral is started with a zero value on the low index side of the domain. The -t option starts the integration from the high index side. Simpson’s rule is used, and the integration is started over if a bad datum is encountered.
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%cdfinteg -b intx u x < infile > outfile
adds a field "intx" to "infile" and puts the result in "outfile". "intx" contains the integral of "u" with respect to "x". Note that "u" may have zero or more dimensions in addition to "x". The integral will be computed for all values of these optional dimensions.