**!**[ingridinit] ( any name object -- ) defines any as name in object.

**2Darea**[ingridinit] ( stream -- stream' ) returns the surface area of the data.

**2Dintegral:dxdy**[ingridinit] ( stream -- stream' ) returns integral over the surface without cos
weighing.

**2unitcheck**[udunits] ( unitname unitname -- unitname unitname unitS/name unitS/name flag )
returns false if both unitnames convert to structures, true otherwise.

**:RFREAD**[ingridinit] ( stream -- stream' ) finishes off RFREAD

**:dataset**[newdata] ( object object -- ) marks the end of a dataset, stores it by

**==**[fginterp] ( any -- ) print FGIelement to stdout{.} If ==alias or ==do exist within
an object, they are used to print the object, i.e. == gives a relatively short representation.

**===**[fginterp] ( any -- ) print FGIelement to stdout (long representation).

**BufferOrder**[task] ( stream int -- stream' ) insures that the stream's buffer order is at least
int.

**CommonStream**[stream] ( *stream_1* \ldots *stream_n* n -- stream) Returns a stream which has only the common grids of the set.

**CommonUnits**[newdata] ( -- object ) contains abbreviations for some common units.

**CompressionTypes**[ingridinit] ( -- object ) holds predefined Compression types.

**DoTasks**[stream] ( -- ) executes any currently scheduled tasks, sometimes useful for debugging.

**DebugTasks**[stream] ( -- ) executes any currently scheduled tasks, tracing the task queue{.}
Sometimes useful for debugging. \subsection{TestStream}

**TestStream**[stream] ( -- stream ) generates a test stream.

**Explicit:endLoop**[ingridinit] ( dh -- h ) ends an explicit integration loop.

**FillNaN**[filters] ( stream grid default -- stream' ) modifies a stream so that if it has
a missing data flag the missing data is filled in.

**Fourier_transform**[fft] ( stream grid sign -- stream' ) computes fouriertransform. A word of warning:
From the continuous perspective, a periodic time series transforms to a finite set
of frequencies, and likewise a finite time series transforms to a periodic set of
frequencies. The discrete fourier transform transforms from a periodic time series
to a periodic frequency series. In other words, the difference is only in the frequencies
beyond the set presented. At the moment, these routines label their output grids
periodic always, but maybe someday I will figure out that I can consistently transform
finite to periodic to finite and change the grid labelling accordingly.

**GRID**[filters] ( stream grid low step hi -- stream' ) regrids stream to an evenly--spaced
grid [ *low* to *high* by *step* ] in variable *grid*. \writedoc{\input{regrid.doc}} \section{rescale} This filter undoes any scale_factor
and add_offset that might be on the current stream. It comes in two flavors: FGIrescale,
which uses InStream and takes its scale and offset from the stack, and Srescale, which
uses SInStream so that it can be called within InStream-like routines, and takes its
arguments from the top object on the stack. \subsection{rescale.h} \begin{includefile}[rescale.h]
#include "stream.h"

**GRID**[ingridinit] ( stream1 low step high -- stream' ) regrids evenly.

**GRIDParent**[stream] ( -- object ) is the parent object for all the grid objects. It contains
the words that can extract information \aword first ( grid -- grid firstvalue ) returns
first value of a grid. \aword last ( grid -- grid lastvalue ) returns last value of
a grid. \aword name ( grid -- grid name ) returns name of object. \aword units ( grid
-- grid units ) returns units of object. \aword evenGRID ( grid -- grid' ) returns
an equally spaced grid which spans the same range as the input grid. from grids.

**GrADSunitsdict**[grads] ( -- object ) contains definitions for units, but everything comes out in
GrADS format.

**IfFortranTask**[task] ( taskp -- true/false )

**InStream**[stream] ( stream -- ) makes the stream the next input sequence for the task currently
being defined. This gets redefined for different stream sources, SInStream is the
standard version.

**L4cycle:endLoop**[ingridinit] ( dh -- h ) ends a Lorenz 4-cycle scheme integration loop.

**MATCH**[stream] ( *stream_1* *stream_2* \ldots *stream_n* n *grid_1* \ldots *grid_m* m -- *stream_1'* *stream_2'* \ldots *stream_n'* ) { makes a set of *n* streams all have the same grid. The chunksize is set to contain the *m* dimensions *grid_1 \ldots grid_m* in that order. Alternatively, you can specify *null* for the chunk, in which case the chunk of the last stream is used. Ranges on common
grids are shrunk to match the smallest; a stream that doesn't depend on a particular
grid has the same data for all values of that grid. The matching is not complete:
within the chunk data is not repeated}. Works by creating a child object for each
stream, a child which contains a modified <SIRecord>.

**MATCHalong**[ingridinit] ( stream1 ... streamN N grid -- stream1 ... streamN ) matches streams
along the given grid without rechunking or reordering.

**NaN**[fginterp] ( -- real ) real constant equal to NaN.

**NewEvenGRID**[grid] ( name units type low step high -- grid ) returns a new grid. Both name
and units should be names. *type* should be either {\it ordered}, {\it periodic}, or {\it unordered}.

**NewGRID**[grid] ( name units type array -- grid ) returns a new grid. Both name and units
should be names. *type* should be either {\it ordered}, {\it periodic}, or {\it unordered}. The array can
either be an array of numbers or of names; if it is names the type should be unordered.
If there is only a single element in the array, the [] can be omitted.

**NewGRIDdef**[grid] ( stream name units type array -- stream ) defines a new grid within the
current stream. If the name matches one of the grids already defined, replaces it.
Otherwise, adds it as the slowest varying dimension not yet defined. Both name and
units should be names. *type* should be either {\it ordered}, {\it periodic}, or {\it unordered}. The array can
either be an array of numbers or of names; if it is names the type should be unordered.

**NewIntegerGRID**[ingridinit] ( name N -- grid ) returns a grid that goes from 1 to N.

**NewSizedBuffer**[stream] ( parent n wdsize -- object ) returns an object which contains a first
order buffer filled by the current task.

**NewStreamPtr**[stream] ( nrdim mark grid1 \ldots gridn -- pointer ) This routine returns a new
streamindex pointer given an array of independent variables and the number of dimensions
in a chunk.

**NtoNaN**[ingridinit] ( stream1 ... streamN N -- stream1 ... streamN ) applies toNaN to N
streams.

**POPs**[kalman] ( yearly -- dataset[ dpi eigenvalues eigenvectors ] ) computes Principle
Oscillation Patterns.

**PrintStream**[stream] ( stream -- ) prints all information for a stream, including data values.

**RANGE**[ingridinit] ( low high -- ) sets range, i.e. centers of first and last color boxes.

**RANGE**[stream] ( stream grid low high -- stream' ) samples stream along one coordinate.
Works by created an child object of the stream, a child which contains a modified
<SIRecord>.

**RANGEEDGES**[ingridinit] ( low high -- ) sets range, i.e. bottom of first color box and top
of last color box.

**RANGESPAN**[stream] ( stream grid low high -- stream' ) samples stream along one coordinate.
Works by created an child object of the stream, a child which contains a modified
<SIRecord>. Differs from RANGENEAR in that the new grid spans low and high -- never
rounds in even if that is closer to the limits. Useful for setting up interpolations.

**REGRID**[regrid] ( stream grid1 grid2 -- stream' ) regrids stream from grid1 to grid2. \tableofcontents
\section{regrid.h} \begin{includefile}[regrid.h] PARAMETER (NregridSize=4*7)

**REORDER**[stream] ( stream grid1 \ldots gridn n -- stream' ) reorders stream so that the
chunk for the stream has *n* dimensions and is ordered with the fastest varying dimension corresponding to *grid1*, the second to *grid2*, etc. Works by created an child object of the stream, a child which contains a modified
<SIRecord>.

**RESCALE**[filters] ( stream scale offset -- stream' ) multiplies data by a scalar and adds
a scalar. If the scale and offset match scale_factor and add_offset, modifies them
in the output stream; otherwise, adds a comment to the history. Also changes the
missing_value flag to NaN. Does nothing if scale is 1 and offset is 0.

**RFREAD:**[ingridinit] ( stream -- stream iindex counts limits TIN cufS ) prepares arguments
for DOcufR. Uses SIRecord, bufferSIRecord, and

**RFreadinputs**[cuf] ( stream -- stream iindex counts limits cufS ) creates

**SAMPLE**[stream] ( stream grid1 grid2 -- stream' ) samples stream along grid1 according
to grid2.

**SCALE**[ingridinit] ( stream scale_factor add_offset -- stream' ) scales stream according
to scale_factor and add_offset, and the attributes are changed accordingly.

**SELECT**[ingridinit] ( dataset stream -- dataset' ) selects data based on stream. stream
should have exactly one grid that has more that one point.

**SIRecord**[grid] {\it or} bufferSIRecord ( grid -- grid SIRecordid ) returns SIRecord of a
grid.

**SM121**[filters] ( stream grid1 grid2 *n* -- stream' ) applies *n* passes of two-dimensional 121 smoothing to a stream{.} grid1 and grid2 are the two
dimensions that are smoothed over.

**STEP**[stream] ( stream grid step -- stream' ) samples stream along one coordinate. Works
by created an child object of the stream, a child which contains a modified <SIRecord>.

**STREAM**[stream] ( -- object ) parent object for streams.

**STREAMDOC**[stream] ( -- object ) documentation words for STREAMs.

**STREAMGRID**[ingridinit] ( stream array -- stream grid ) creates a grid that matches a stream
in name and units with a set of values `array'.

**STREAMGRID**[zterp] ( stream array -- stream grid ) creates a grid that matches a stream in
name and units with a set of values {\it array}.

**toS**[zterp] ( *{T(X)}* *{S(X)}* *{S_0/[ s_1 \ldots s_n ]}* *X* -- *{T(S_0)}* ) changes a stream T(X) to a stream T(S). The four inputs are the input stream *T(X,\ldots)*, the coordinate stream *S(X,\ldots)*, the values of *S* that should be used specified as either a grid *S_0* or as simply an array of values (which toS will then convert to a grid), and *X* the grid that is being replaced by *S_0*. The output is the new stream *T(S_0)*. For example, to get depth of the *20^\circ* isotherm, you would say

temp Z exch 20 Z toS

To get the depth of several isotherms, you would saytemp Z exch [ 20 21 22 ] Z toS

To get the salinity of thesal temp 20 Z toS

**SUM**[sum] ( stream grid -- stream ) sums data in {\it stream} over {\it grid}. So let
us talk about a stream *D(m_1, m_2, \ldots , m_n)* and say that the grid specified corresponds to dimension *g* (e.g. *m_g*) and the highest dimension within the chunk is *c*. To be relatively efficient, instead of reordering the data to make it easy to write
the averaging code, this averaging code deals with two possible cases: the grid to
be sumd over is within a chunk, or the grid to be sumed over corresponds to many chunks.
In either case, there are three numbers: \paragraph{*g\le c*} \begin{variablelist} \v N1 n_1 number of points within the sum,
(*n_1=\prod_{i=1}^{g-1} m_i*). \v N2 n_2 number of points in the sum (*n_2=m_g*). \v N3 n_3 number of points above the sum (*n_3=\prod_{i=g+1}^c m_i*). \end{variablelist} \paragraph{*g>c*} \begin{variablelist} \v N0 n_0 number of points in a chunk \v N1 n_1
number of chunks within the sum (*n_1=\prod_{i=c+1}^{g-1}m_i*) \v N2 n_2 number of chunks in the sum (*n_2=m_g*). \end{variablelist} \begin{includefile}[sum.h] PARAMETER (NsumS=12)

**SetBufferRept**[task] ( stream nrept -- stream ) To make it possible to a have a loop that is not
the highest index, we add SetBufferRept, which sets the number of repetitions of the
metatask list. It defaults to 1, so it is unnecessary to set it if the loop grid
is the outermost grid.

**SetBuffernchunk**[task] ( stream nchunk -- stream ) As it turns out, given the stream structures
I have, it is more reasonable to set the buffer's nchunk just after the begin buffer
loop than anything else. This routine makes it possible.

**SetStreamIndex***[stream] ( nrdim -- object nrdim mark ) This word is used to set 'SIRecord' with
a new streamidex pointer.

*****[stream] ( object nrdim mark grid1 ... gridn -- ) This pair of words is used to
set 'SIRecord' with a new streamindex pointer. The technique is to create an object
with two definitions: `start*' and `*'. Then we define NewStreamIndex to be a procedure
which puts the object on the stack and then executes 'start*'.

**StreamTree**[stream] ( stream -- ) prints chain of buffers for a stream.

**TABLE**[table] ( [ stream1 ... streamN ] grid combine -- ) prints a table using values
from several streams. The rows correspond to different values of grid.

**TraceStream**[stream] ( stream -- ) prints chain of buffers for a stream.

**Tspharmfns**[legendre] ( n nlat -- stream ) calculates spherical harmonic functions for triangular
truncation N and an nlat gaussian grid.

**VALUE**[stream] ( stream grid value -- stream' ) samples stream along one coordinate.
Works by created an child object of the stream, a child which contains a modified
<SIRecord>.

**WFwriteinputs**[cuf] ( stream -- stream iindex counts limits cufS ) creates

**a64l**[newfns] ( string string2 -- ) converts up to 4 ch string1 to up to 3 ch string2
using 64 bit decoding.

**abrat**[eos] ( *\theta* S P -- *\alpha/\beta* ) ratio of *\alpha* to *\beta*.

**beta**[eos] ( *\theta* S P -- *\beta* ) $\beta = {1 \over \rho } \left.{\partial \rho \over \partial S}\right|_{\theta,p}$.

**dens**[eos] ( T S P -- density ) unecso'81 density (insitu) of seawater.

**densa**[eos] ( T S P -- density ) unecso'81 density (insitu) of seawater minus 1.

**depth**[eos] ( P -- depth ) depth from pressure, ignoring density anomaly.

**potemp**[eos] ( T S P -- *\theta* ) calculates potential temperature.

**pressure**[eos] ( T S Z -- P ) computes hydrostatic pressure by integrating from the surface.

**abs**[fginterp] ( num -- num ) absolute value.

**add0**[pairdiff] ( stream1 stream2 -- stream' ) subtracts stream2 from stream1 preserving
the chunking of stream1 if stream2 is 1D.

**add**[fginterp] ( num num -- num ) adds two numbers.

**add**[filters] ( stream1 stream2 -- stream' ) adds two streams value by value.

**addhistory**[stream] ( string -- ) adds to the history (see below).

**2combinehistory**[stream] ( *stream_1* *stream_2* -- string/array ) combines the histories of two streams.

**combinehistory**[stream] ( *stream_1* \ldots *stream_n* n -- string/array ) combines the histories of *n* streams.

**combinefullname**[stream] ( *stream/fullname_1* \ldots *stream/fullname_n* *n* *name/string_{OP}* -- array ) combines *n* fullname arrays using the operator *string_{OP}*. If *n* is negative, includes common 1pt grids in the new name, otherwise, assumes they will
be kept as grids.

**aload**[fginterp] ( array -- any1, \ldots, anyn array ) gets FGIelements from array.

**and**[fginterp] ( bool bool -- bool ) logical `and' of two booleans.

**append**[fginterp] ( *string/array_1* *string/array_2* -- string/array ) combines two strings or arrays into one by concatenation.

**array**[fginterp] ( n -- array ) makes array of size *n*.

**arraypairtodict**[newfns] ( array1 array2 -- object ) makes an object where array1 indexes array2.
Both arrays should be realarray, integerarray, or name arrays.

**astore**[fginterp] ( any1, \ldots, anyn array -- array ) stores FGIelements

**begin**[fginterp] ( object -- ) pushes object onto dictionary stack

**end**[fginterp] ( -- ) pops object off of dictionary stack into array.

**autoload**[ingridinit] ( name string -- ) defines name to load file 'string' and then execute
name. The file must redefine name in order for this to work.

**average**[ingridinit] ( A [ grid1 grid2 ... ] -- AM ) returns the average over the specified
grids, skipping missing_values.

**rmsover**[ingridinit] ( A [ grid1 grid2 ... ] -- AM ) returns the rms averaged over the specified
grids, skipping missing_values.

**rmsaover**[ingridinit] ( A [ grid1 grid2 ... ] -- AM ) returns the rms (mean removed) averaged
over the specified grids, skipping missing_values.

**maxover**[ingridinit] ( A [ grid1 grid2 ... ] -- AM ) returns the max over the specified
grids, skipping missing_values.

**minover**[ingridinit] ( A [ grid1 grid2 ... ] -- AM ) returns the min over the specified
grids, skipping missing_values.

**standardize**[ingridinit] ( stream [ grid1 ... ] -- AS ) returns the data with the mean removed
and normalized by the standard deviation. purely stream functions

**bandmax**[ingridinit] ( color value -- ) interprets value as desired upper edge of one of
the maxncolor-3 color boxes.

**bilinearinterp**[bilin] ( D WX(S) WY(S) I(S) [ NX NS ] -- D(S) ) compute actual interpolation.

**bilinearweights**[bilin] ( X Y X(S) Y(S) -- WX(S) WY(S) I(S) [ NX NS ] ) returns bilinear weights
WX and WY and a composite index.

**binarysetSIRecord**[matchchunk] ( stream stream1 stream2 -- stream' ) sets the grids for stream from
combining stream1 and stream2 consistent with {\bf chunkpattern}.

**blue**[fig] ( -- figobject ) makes subsequent lines/contours blue.

**black**[fig] ( -- figobject ) makes subsequent lines/contours black (default).

**white**[fig] ( -- figobject ) makes subsequent lines/contours white.

**yellow**[fig] ( -- figobject ) makes subsequent lines/contours yellow.

**magenta**[fig] ( -- figobject ) makes subsequent lines/contours magenta.

**cyan**[fig] ( -- figobject ) makes subsequent lines/contours cyan.

**green**[fig] ( -- figobject ) makes subsequent lines/contours green.

**red**[fig] ( -- figobject ) makes subsequent lines/contours red.

**thin**[fig] ( -- figobject ) makes subsequent lines/contours thin.

**thinish**[fig] ( -- figobject ) makes subsequent lines/contours almost thin.

**medium**[fig] ( -- figobject ) makes subsequent lines/contours medium.

**mediumthick**[fig] ( -- figobject ) makes subsequent lines/contours thicker than medium.

**thick**[fig] ( -- figobject ) makes subsequent lines/contours thick.

**uniform**[fig] ( -- figobject ) makes subsequent contours uniform.

**nozero**[fig] ( -- figobject ) makes subsequent contours skip the zero contour, dashed for
negative.

**thickzero**[fig] ( -- figobject ) makes subsequent contours emphasize the zero contour, dashed
for negative (default).

**solid**[fig] ( -- figobject ) makes subsequent lines/contours solid (default for first
line).

**dashed**[fig] ( -- figobject ) makes subsequent lines/contours dashed (default for second
line).

**dotted**[fig] ( -- figobject ) makes subsequent lines/contours dotted.

**dotdashed**[fig] ( -- figobject ) makes subsequent lines/contours dotdashed.

**buffer**[grid] ( grid -- grid bufferid ) returns buffer of a grid.

**checkforD**[newdata] ( mark grid1 ... gridn -- ) checks the grid list for an array of names.
If found, removes it from the list and calls it Darray, its position in the list (starting
from 0) is Dgridno.

**checkunits**[ingridinit] ( name -- ) makes sure it is a legal unit.

**chunkaverage**[ingridinit] ( stream -- stream' ) averages over the chunk of the current stream.

**chunkmax**[ingridinit] ( stream -- stream' ) maximum of the chunk of the current stream.

**chunkmin**[ingridinit] ( stream -- stream' ) minimum of the chunk of the current stream.

**chunkpattern**[matchchunk] ( stream1 stream2 -- stream1 stream2 [ndim n inc1 inc2 m inc1 inc2
... ] ) returns the pattern of integers that describes the n-dimensional do-loop necessary
to process the chunks of the two streams that have been through {\bf reordertomatch}.
This n-dimensional do-loop is described by an array of integers: first the number
of sets, then each set consists of the size of the set followed by the approprate
increment for the dimension. The idea is to have a loop that goes through all the
elements of the array, and exactly one increment is applied for each interation of
the loop. The increment that is applied is the one that corresponds to the dimension
that is incremented (lower dimensions were simply reset to 1). For example, suppose
the two streams were *str1 [ X Y T ]* and *str2 [P T]*. The output stream is then *out [ X Y P T]* and the sets are derived from IOUT1 = [ N 1 T] and IOUT2 = [ 1 P T ], where N is
the number of XY points, P is the number of P points, and T is the number of T points.
That gives an output array of [ 3 N 1 0 P (1-N) 1 T 1 1 ].

**chunks==**[ingridinit] ( stream -- stream string ) returns a string which describes the chunk
of a stream.

**chunksub**[pairdiff] ( stream1 stream2 -- stream' ) takes the difference between two streams
with identical chunking.

**chunksum**[ingridinit] ( stream -- stream' ) sums over the chunk of the current stream.

**chusci**[newfns] ( low high -- first step nstep ) picks round intervals.

**coasts**[fig] ( grid1 grid2 -- ) draws coasts from WORLDBATH.

**colorareas**[fig] ( stream1 stream2 stream3 -- ) draws lines with points colored by a third
variable.

**colorbars2**[fig] ( stream1 stream2 grid -- ) draws bar plot with heights stream1 and colors
stream2.

**colorbars**[fig] ( stream1 stream2 stream3 -- ) draws bar plot with points colored by a third
variable.

**colorcontours**[fig] ( stream grid1 grid2 -- ) renders stream in colorcontours.

**colorlines**[fig] ( stream1 stream2 stream3 -- ) draws lines with points colored by a third
variable.

**colors**[fig] ( stream grid1 grid2 -- ) renders stream in colors.

**colorscale20**[fig] ( stream1 stream2 grid -- ) renders colorscale for colorbars2, i.e. 2 streams.

**colorscale2**[fig] ( stream grid1 grid2 -- ) renders colorscale for colors, i.e. 2D stream.

**colorscale30**[fig] ( stream1 stream2 stream3 -- ) renders colorscale for scattercolors, i.e.
3 streams.

**colorscale**[fig] ( stream -- ) renders colorscale..

**combine**[table] ( [ stream1 ... streamN ] grid -- stream ) combines several streams together,
using their names to create a D coordinate.

**commonachunk**[matchchunk] ( stream1 ... streamN N -- [ grid1 .. gridN ] ) returns an array of
grids that spans the achunks of all the streams.

**commongrids**[matchchunk] ( stream1 ... stream N N -- [ grid1 ... gridN ] returns a set of grids
which are the intersection of the grids in the streams.

**compression:**[ingridinit] ( stream name -- stream object ) Marks the current stream as being
compressed with type name.

**:compression**[ingridinit] (stream object -- stream ) Finishes setting compression. All definitions
between compression: and :compression are saved for the decompression routine.

**concat**[ingridinit] ( [ string1 \dots stringn ] -- string ) concatenates an array of strings
together.

**constantdata**[newdata] ( stream num/realarray/doublearray -- stream' ) returns constant data.

**contouraveraging**[ingridinit] ( stream -- mean sd ) computes the averaging

**contours**[fig] ( stream grid1 grid2 -- ) renders stream in contours.

**convertunits**[ingridinit] ( real/stream units -- real/stream' ) converts to standard units (MKS).

**copy**[fginterp] ( *any_1* \ldots *any_n* n -- *any_1* \ldots *any_n* *any_1* \ldots *any_n* ) duplicates the top *n* elements on the stack.

**counttomark**[fginterp] ( mark *any_1* \ldots *any_n* -- n ) counts items to mark.

**counttoobject**[fginterp] ( mark *any_1* \ldots *any_n* -- n ) counts items to object.

**cvi**[fginterp] ( real -- int ) converts real to integer.

**cvlit**[fginterp] ( any -- any ) makes any literal rather than executable.

**cvn**[fginterp] ( string -- name ) converts string to name.

**cvntos**[fginterp] ( name -- string ) converts name to a string.

**cvx**[fginterp] ( any -- any ) marks any executable.

**copyachunk**[pairdiff] ( stream1 stream2 -- stream1 stream2' ) copies the achunk of stream1
to stream2. stream1 can be an array of grids, alternatively.

**copyimagetoPS2defs**[fig] ( plotobject -- plotobject ) copies some defs from the current imagename to
PS2defs.

**cos**[filters] ( stream/num -- stream/real ) cosine of a stream or number.

**eexp**[filters] ( stream/num -- stream/real ) power base *e* of a stream or number.

**ln**[filters] ( stream/num -- stream/real ) natural log of a stream or number.

**log**[filters] ( stream/num -- stream/real ) log (base 10) of a stream or number.

**mag**[filters] ( stream/num stream/num -- stream/real ) vector magnitude.

**min**[filters] ( stream/num stream/num -- stream/real ) min of two streams

**max**[filters] ( stream/num stream/num -- stream/real ) max of two streams

**pi**[filters] ( -- *\pi* ) {returns 3.14159265}.

**sin**[filters] ( stream/num -- stream/real ) sine of a stream or number.

**sqrt**[filters] ( stream/num -- stream/real ) square root of a stream or number.

**sqrtsgn**[filters] ( stream/num -- stream/real ) square root of a stream or number, negative
arguments result in a negative answer.

**covAdvance**[kalman] ( Q A P -- *P_F* ) advances covariance one timestep.

**covAssimilateMS**[kalman] ( RI H *P_F* -- K P ) calculates covariance after assimilation and assimilation matrix K given
the model covariance, the inverse data covariance RI, and the sampling model H. Inverts
in model space.

**covReplaceMS**[kalman] ( RI H *P_F* -- K P ) calculates covariance after assimilation by replacement and the replacement
matrix K given the model covariance, the inverse data covariance RI, and the sampling
model H. Inverts in model space. \subsection{covNotOptimal: Additional error introduced
by non-optimal estimator} When the assimilation scheme is not optimal, an additional
error is introducted. This routine computes the increment.

**covarianceEvolution**[kalman] ( Q A RI H P(0) T -- K P PF ) calculates covariance evolution.

**cufcheckforgrid**[ingridinit] ( dataset cufvar name string -- dataset cufvar name string/grid ) called
in readcuf to convert entries that consist

**currentobject**[ingridinit] ( -- object ) gets the current object.

**cvdatatype**[ingridinit] ( stream/dataset/grid value -- stream/dataset/grid value' ) converts
the type of value to match the datatype of stream, if possible.

**datarank0**[newfns] ( stream -- ) converts data to rank.

**datarank**[ingridinit] ( stream [ grids ] -- stream' ) ranks data over given grids.

**dataset:**[newdata] ( -- object object ) marks the beginning of a dataset.

**datatable0**[fghtml] ( stream X Y -- ) prints data from a stream.

**datatable1**[fghtml] ( stream X Y T -- ) prints data from a stream.

**datatabletsv0**[fghtml] ( stream X Y -- ) prints data from a stream.

**datatabletsv1**[fghtml] ( stream X Y T -- ) prints data from a stream.

**def**[fginterp] ( name any -- ) defines name to be any in the current object.

**div**[fginterp] ( num num -- num ) divides.

**dup**[fginterp] ( any -- any any ) duplicates.

**eq**[fginterp] ( *any_1* *any_2* -- bool ) returns true if the two objects are equal{.} strings, objects, and arrays
must be duplicates of the same array: having the same values is not sufficient.

**exch**[fginterp] ( *any_1* *any_2* -- *any_2* *any_1* ) swaps two elements on the stack.

**exec**[fginterp] ( any -- ) executes top element on the stack.

**defdatasetgrids**[newdata] ( dataset [ grid1 grid2 ... ] -- ) defines grids in dataset and all parent
datasets.

**deltabars**[fig] ( stream1 stream2 grid -- ) draws bars between stream1 and stream2.

**differences0**[pairdiff] ( stream p -- stream' ) takes the pairwise difference along one coordinate
of the stream within the chunk.

**differences**[pairdiff] ( stream grid -- stream' ) takes pairwise differences along grid of stream.

**distrib1D0**[distrib] ( A Alo Ahi -- C ) computes univariate counts for a stream A.

**distrib1D**[ingridinit] ( A DATA Alo Ahi Astp RANGESTEP -- C ) or ( A [ grid1 grid2 ... ] --
C ) returns

**distrib2D**[distrib] ( A B -- C ) returns bivariate counts

**distrib2D**[ingridinit] ( A B -- C ) or ( A B [ grid ] -- C ) returns bivariate counts

**distrib**[filters] ( stream min step max -- stream' ) gives the distributions of values for
a given stream *d(x,y,z,t)* by returning a new stream *f(d)* which gives the number of occurrences of data points nearest the values *d_i* which are equally spaced from *min* to *max* in steps of *step*. \subsection{filters.distrib.h} \begin{includefile}[filters.distrib.h]

**div0**[pairdiff] ( stream1 stream2 -- stream' ) divides stream1 by stream2 preserving
the chunking of stream1. stream2 is 1D.

**div**[filters] ( stream1 stream2 -- stream' ) divides two streams value by value.

**doPLOTCOAST**[ingridinit] ( { ifcoast } { ifland } { ifnone } -- ) picks

**dods**[ingridinit] ( dataset/stream -- dataset/stream dods ) makes it possible to download
a dataset or stream directly into an application using the DODS protecol.

**domainline**[fig] ( plotobject -- plotobject ) prints domainline for a zoomable object. Only
works after inputimagelink is called.

**dots**[fig] ( stream grid -- ) draws single line as dots.

**dupmulsub**[newfns] ( stream stream -- stream ) computes dup mul sub in real*8

**eigenvalues**[kalman] ( stream grid1 grid2 -- ev ) calculates eigenvalues of a matrix.

**eigrs**[kalman] ( Q -- D Z ) computes eigenvalues and eigenvectors -- returns low to high
(but indexes the highest one as 1).

**evengridAverage**[ingridinit] ( stream grid low step high [Wmin] -- stream' ) regrids a stream to
a new grid by averaging.

**false**[fginterp] ( -- bool ) returns false.

**forall**[fginterp] ( array proc -- ) executes {\it proc } for each element in array by pushing
the first element onto the stack, executing {\it proc}, pushing the second element
onto the stack, etc.

**ge**[fginterp] ( bool bool -- bool ) greater than or equal to.

**get**[fginterp] ( array index -- any ) extracts any from array: array can also be a string,
a realarray, an integerarray, or a namearray{.} Also works on objects: ( {\it object
key -- any} ).

**getinterval**[fginterp] ( array index count -- subarray ) extracts subarray from array: array
can also be a string, a realarray, an integerarray, or a namearray.

**gt**[fginterp] ( num num -- bool ) greater than.

**if**[fginterp] ( bool proc -- ) executes proc if bool is true.

**ifelse**[fginterp] ( bool *proc_1* *proc_2* -- ) executes *proc_1* if true, *proc_2* if false.

**index**[fginterp] ( *any_n* \ldots *any_0* n -- *any_n* \ldots *any_0* *any_n* ) copies *n^{th}* element to top of stack.

**known**[fginterp] ( object name -- bool ) returns true if name is defined in object.

**fftspi**[fft] ( npts -- coeffs ) generates coefficients for fft transform.

**fftrcsp**[fft] ( stream grid sign -- ft) computes fourier transform real to complex symmetric.

**fgmasknotfound0**[newfns] ( stream p - stream' ) changes all strings not containing the substring
to start with a null.

**fig**[fig] ( -- object ) contains defining words for figures.

**fig:**[fig] ( -- fig figobject mark ) delimits the beginning of a figure.

**:fig**[fig] ( fig figobject mark plotobject \ldots -- plotobject ) creates a new plotobject
out of a set of plot objects.

**fig-**[fig] ( -- fig mark ) synonym for fig: that is URL-legal.

**-fig**[fig] ( fig mark plotobject \ldots -- plotobject ) synonym for :fig that is URL-legal.
The idea here is that \ldots fig: vector contour :fig.ps will generate a vector contour
plot from \ldots. This gives me a clean mechanism for creating multiple plot overlays:
I pile all the data on the stack, then run this function. Another example might be
\ldots fig: colors land :fig.ps would generate a plot with land overlaid. A URL version
would be fig-+colors+land+-fig.ps. draw has the needed stack behavior of a draw function.
It puts the grids into an array and carefully moves it around on the stack as it loops
through the plot objects in the array. At the end, it drops the grid array. This
means it is recursive: figobjects are legal subobjects of figobjects.

**file:**[newdata] :file ( -- ) file containing multiple variables.

**first**[grid] ( grid -- grid firstvalue ) returns first value of a grid.

**first**[grid] ( grid value -- grid index ) returns index corresponding to value (numbered
from 0).

**flagge**[filters] ( stream1 stream2 -- stream' ) ge two streams value by value.

**foralldata**[forallstreams] ( dataset -- ) runs doifgrid doifstream doifdataset doifnetcdf for
each object in dataset.

**foralldatasets2**[newdata] ( dataset { datasetproc } { streamproc } -- ) operates on all datasets
and streams. Improved version: automatically operates on all datasets and streams,
stack is clear for use, relativename returns the namearray for the current dataset/stream
relative to the dataset being traversed.

**foralldatasets**[newdata] ( dataset { datasetproc } { streamproc } -- ) operates on all datasets
and streams. Both datasetproc and streamproc should pop their argument from the stack,
i.e.

**datasetproc**[newdata] ( dataset -- ) operates on datasets. It needs to invoke mycaseexeconeach
on the dataset in order to process all subdatasets.

**forallstns**[ingridinit] ( longs lats ids xl xh yl yh proc -- ) runs proc on long lat id for
all points within ranges..

**forsome**[fginterp] ( object botobject skipobject proc -- ) Like forall in that each entry
in object is pushed on the stack (name and value) and proc is executed, but some entries
are not executed. If botobject is a parent object to object or any of its parents,
object is considered to end above botobject. skipobject is a list of names (their
definitions are ignored) that are also not operated upon. botobject can be null, in
which case the whole object is processed. skipobject can be null, in which case no
definitions are skipped. skipobject must have parent null.

**fullimagelink**[fig] ( plotobject ingridcode -- ) creates an img link to an image which is invoked
by the ingridcode. 'null' for ingridcode means use the standard figure name .gif
(no grids!).

**gaussianinv**[ingridinit] ( stream -- stream' ) converts random data uniformly distributed on
[0,1) to gaussian data.

**gaussianlat**[legendre] ( n -- grid ) returns gaussian grid with n points.

**gaussianlatWeights**[legendre] ( grid -- stream ) returns weights for a gaussian grid.

**gentab**[ingridinit] ( stream1 ... streamN tableobject format -- entrycount ) generates
table.

**getimageinput**[fig] ( name -- object true or false ) returns an object containing the information
corresponding to the input image 'name' on the current form. To allow url to be
blank, when getimageinput is invoked for the first time on a particular image, the
plotobject should be on the bottom of the stack. Since getimageinput is called from
inputimagelink, this is fairly likely since inputimagelink is frequently called first.

**getrealization**[newfns] ( stream -- array ) returns values for the (single realization of the stream).

**ginverse**[kalman] ( stream [grid1a grid1b] [grid2a grid2b] -- inverse ) computes the (tranposed)
generalized inverse *[A)((A][A))^{-1}* of *[A)* with the grid1 grids as the first dimension of the matrix and the grid2 grids as
the second dimension of the matrix.

**grayMV**[fig] ( stream grid1 grid2 -- ) renders missing data in stream in gray.

**grid:**[newdata] ( -- object mark ) marks the beginning of a grid declaration.

**gridarray1fn**[ingridinit] ( dataset/stream [ grids ] option proc name -- dataset/stream ) applies
proc to single dataset/stream with optional gridarray and real options. Used in average
and company.

**gridarray1fnnopt**[ingridinit] ( dataset/stream [ grids ] proc name -- dataset/stream ) applies proc
to single dataset/stream with optional gridarray. Used in average and company.

**grideven**[grid] ( -- flag ) returns true if grid is evenly spaced.

**gridno**[stream] ( stream grid -- stream int ) returns dimension index of grid in stream.

**gridstride**[stream] ( stream grid -- stream int ) returns stride of grid in stream.

**ndim**[stream] ( -- n ) returns number of dimensions in a stream.

**nrdim**[stream] ( -- m ) returns number of dimensions in the chunk of a stream.

**chunk**[stream] ( stream -- stream *grid_1* \ldots *grid_m* m ) returns grids and number of dimensions in the chunk of a stream.

**>chunk**[stream] ( stream -- *grid_1* \ldots *grid_m* m ) returns grids and number of dimensions in the chunk of a stream.

**achunk**[stream] ( stream -- stream *grid_1* \ldots *grid_n* n ) returns grids above the chunk and ndim-nrdim for the current stream.

**>achunk**[stream] ( stream -- *grid_1* \ldots *grid_n* n ) returns grids above the chunk and ndim-nrdim for the current stream.

**streamgrids**[stream] ( stream -- stream *grid_1* \ldots *grid_n* ) returns stream grids.

**>streamgrids**[stream] ( stream -- *grid_1* \ldots *grid_n* ) returns stream grids.

**chunksize**[stream] ( -- nsize ) returns number of elements in a chunk of the stream.

**nchunk**[stream] ( -- n ) returns number of chunks in the stream.

**gridtomatch**[ingridinit] ( stream1 stream2 -- stream1' ) returns stream1 regridded to match
stream2.

**gridtomatchnamed**[ingridinit] ( stream1 stream2 object name -- stream1' ) returns stream1 regridded
to match stream2, giving it name name in object.

**gridtype**[grid] ( -- type ) returns grid type: ordered, periodic, or unordered.

**gridvalues**[grid] ( -- array ) returns array of grid values.

**history**[stream] ( -- array ) {returns a nested array of strings which contain the history
of manipulations of the current stream. history starts with a null definition}.

**name**[stream] ( -- name ) short name of stream.

**fullname**[stream] ( -- array of names/strings ) full name of stream.

**{longname**[stream] {\it or} long_name} ( -- string ) returns a string describing the current
stream: defaults to string version of name. longname defaults to name, and long_name
is mapped to longname (I really do not like underscores).

**title**[stream] ( -- string) returns a short description of the stream: defaults to null.

**units**[stream] ( -- name ) units of data in the current stream: units defaults to real.

**missing_value**[stream] ( -- null/real ) {value to use as a missing data flag. Many stream filters
changed this to NaN. It defaults to null, which means there is no missing data flag}.

**scale_factor**[stream] ( -- real ) simple data compression scale factor.

**add_offset**[stream] ( -- real ) simple data compression offset (applied after scale_factor).
scale_factor and add_offset also default to have no effect. The data is considered
to be trueval = scale_factor*val + add_offset. This

**horizontalgridlines**[fig] ( grid1 -- ) draws horizontalgridlines.

**htmlformulaprint**[ingridinit] ( string -- ) converts and prints a string that has PS equation escapes
in it. HTML is pretty limited, so it does not do much, but it does some.

**idtoidf**[ingridinit] ( id -- idf ) returns idf (i.e. return from NCOPEN) for permanent id
id. Opens file if necessary, could close other files if necessary, too.

**imageexists?**[fig] ( nameofobject nameofvalue -- flag ) checks for definition in current image.

**imageget?**[fig] ( nameofobject nameofvalue -- value true or false ) if it exists, returns
value and true flag, otherwise returns false.

**imagegetnum?**[fig] ( nameofobject nameofvalue -- number true or false ) if it exists, returns
value and true flag, otherwise returns false. Differs from inageget? only in that
it converts the string to a number.

**imageknown**[fig] ( name -- flag ) checks for name in current image.

**imagelink**[fig] ( plotobject url -- ) creates an img link to an image which is invoked by
the url. Omitting the url means it will generate the url from the datsets and the
fig.

**imagelinkstart**[fig] ( fig url -- imageobject ) preps for imagelink and similar words.

**imageput**[fig] ( nameofobject nameofvalue value -- ) stores value as nameofvalue in nameofobject
in imagename.

**incGRIBvar**[grib] ( name time depth -- ) adds entry to list.

**var:**[grib] ( name -- object ) pulls var from set.

**initGrADS**[grads] ( stream filename -- stream IUNIT ) initializes GrADS files.

**inputimagelink**[fig] ( plotobject name url -- plotobject ) creates a input link 'name' to an image
which is invoked by the url. 'null' for url means use the standard figure name .gif
(no grids!). Also creates an hidden variable that hold the info needed to process
a click.

**insertdataset:**[newdata] ( name -- object object ) marks the beginning of a dataset. At completion
this dataset will be stored in the current

**integral0**[pairdiff] ( stream dx p -- stream' ) integrates along one coordinate of the stream
within the chunk.

**integral1**[pairdiff] ( integral stream dx p -- stream' ) integral over chunks.

**integral**[pairdiff] ( stream grid -- stream' ) takes integral with respect to grid.

**integral**[partial] ( stream grid -- stream' ) takes integral with respect to grid. \begin{code}
SUBROUTINE STREAMintegral

**integrate**[pairdiff] ( stream grid initial -- stream' ) takes integral with respect to grid
starting with initial value.

**integrateddistrib1D**[ingridinit] ( A -- stream ) computes the integrated distribution of A, i.e. the
values along A range from 0 to 1.

**integrateddistrib2D**[ingridinit] ( A B -- stream ) computes the normalized distribution and then integates
it, thus the values will range from zero to one. The stream is marked so that contours
will be at 66\% and 96\% widths as well as at the median.

**ipack**[ingridinit] ( -- ) ipack compression. Assumes {\it indices\/} is an integer array
or the name of an integer array, {\it grids} is an array of grids or names of grids
for the uncompressed stream (defaults

**isolines**[ingridinit] ( data X Y levels -- XS YS GRDS )

**kalmanFilter**[kalman] ( WO RI H P00 Q A T -- dataset[ W P WOERR K H A RI WO ] ) Kalman Filter
with optimally assimilated initial conditions, i.e. I start with zero model state
so that the initial covariance (P00) is the total variance of the system.

**labels**[fig] ( stream1 stream2 names/stream3 -- ) draws scatter plot with just labels.

**laggedcovariance3**[ingridinit] ( stream Tgrid period [ lags ] Egrid -- D1 cov

**laggedcovariance3bs**[ingridinit] ( stream Tgrid period [ lags ] Egrid nrealizations fraction -- D1 cov

**laggedcovariance**[ingridinit] ( stream Tgrid period [ lags ] Egrid -- cov ) computes

**land**[fig] ( grid1 grid2 -- ) draws land from WORLDBATH.

**last**[grid] ( grid -- grid lastvalue ) returns last value of a grid.

**lcovar0**[covar] ( A LAGS -- C ) computes seasonal covariance at a set of

**lcovar0b**[covar] ( A LAGS -- C ) computes seasonal covariance at a set of

**lcovar30**[covar] ( A LAG -- C D1 D0) computes seasonal covariance at multiple lags. Covariance
averages over n1,n2,n3,n5, depends on n4,m,ns,nl. Returns both the lag zero covariance
at the next timestep and the lag zero covariance at the current timestep in addition
to the lag(s) requested. The season corresponds to the lagged month.

**lcovar30b**[covar] ( A LAG -- C D1 D0) computes seasonal covariance at multiple lags. Covariance
averages over n1,n2,n3,n5, depends on n4,m,ns,nl. Returns both the lag zero covariance
at the next timestep and the lag zero covariance at the current timestep in addition
to the lag(s) requested.

**lcovar30bs**[covar] ( SKIP A LAG -- C D1 D0) computes seasonal covariance at multiple lags.
Covariance averages over n1,n2,n3,n5, depends on n4,m,ns,nl. Returns both the lag
zero covariance at the next timestep and the lag zero covariance at the current timestep
in addition to the lag(s) requested. %Skips the ISKIPth point to generate a set
of realizations %for bootstrapping. Randomly selects half the points for bootstrapping.
The season corresponds to the lagged month.

**lcovar31**[covar] ( A LAG -- C D1 D0) computes seasonal covariance at multiple lags. Covariance
averages over n1,n2,n3,n5, depends on n4,m,ns,nl. Returns both the lag zero covariance
at the previous timestep and the lag zero covariance at the current timestep in addition
to the lag(s) requested. Same as lcovar30, except now m varies faster than nt in the
A array.

**le**[fginterp] ( num num -- bool ) less than or equal to.

**length**[fginterp] ( array/string -- int ) returns length of array or string.

**lt**[fginterp] ( num num -- bool ) less than.

**mark**[fginterp] ( -- mark ) returns a mark.

**max**[fginterp] ( num num -- num ) returns maximum.

**maxlength**[fginterp] ( object -- int ) returns maximum length of object.

**max==array**[fginterp] ( -- int/null ) maximum number of array elements to print.

**min**[fginterp] ( num num -- num ) returns minimum.

**mul**[fginterp] ( num num -- num ) returns product.

**ne**[fginterp] ( num num -- bool ) not equal.

**not**[fginterp] ( bool -- bool ) logical not.

**null**[fginterp] ( -- null ) returns a null element.

**leftline**[fig] ( stream grid -- ) draws single line with left axis.

**leftlines**[ingridinit] ( array/string -- ) prints an array of strings with each string on
a separate line.

**line**[fig] ( stream grid -- ) draws single line.

**linearweights**[bilin] ( X X(S) -- W(S) I(S) ) returns weight W and index I such that *X(S) = W(S)*X(I(S)) + ( 1 - W(S) ) * X(I(S) + 1)*. The index is such that the first element is 0.

**makeperiodic**[ingridinit] ( stream grid period -- stream' ) makes a stream periodic in grid.

**markstreamsymmetric**[ingridinit] ( stream -- stream' ) changes a stream which has been defined as full
storage to a stream that is in symmetric storage mode. The data is not actually changed,
i.e. the stream so far has been defined incorrectly. The first two grids are combined
into the symmetric grid.

**mask0**[newfns] ( stream stream2 p -- stream' ) masks stream with NaN in stream2.

**mask**[fig] ( stream grid1 grid2 -- ) renders non-negative data as black, missing or negative
as clear.

**maskbybin**[ingridinit] ( stream bin edges -- stream' ) bins data into bins from lo to high
by step, returning a mask with an additional grid (the bins) that is either NaN or
1.

**matchachunk**[matchchunk] ( stream1 ... streamN N -- stream1' ... streamN' ) changes stream1
through streamN to have the same achunk, i.e. a common set of grids is found, and
the data in each stream is reordered and repeated to match.

**matrixinverse**[kalman] ( stream [ grid1a ... grid1n] [ grid2a ... grid2n] -- stream' ) calculates
matrix inverse of stream using the first array of grids as the first dimension and
the second array of grids for the second dimension. At the momement, assumes the
matrix is compressed symmetric.

**maxfnof0**[distrib] ( A -- C AM ) computes maximum for a stream A.

**mean0**[distrib] ( A -- AM C ) computes mean for a stream A.

**mean**[ingridinit] ( A -- C ) or ( A [ grid1 grid2 ... ] -- AM ) returns mean of A values.
If [ grid1 ... ] is given, then the mean *AM* will

**meanpmsd**[ingridinit] ( stream -- mean sd) computes mean and sd over first two dimensions
of stream.

**meansq0**[distrib] ( A -- AM C ) computes mean square for a stream A.

**meansq**[ingridinit] ( A -- C ) or ( A [ grid1 grid2 ... ] -- AM ) returns mean square
of A values. If [ grid1 ... ] is given, then the mean *AM* will

**median**[ingridinit] ( A -- stream ) computes the median.

**medianover**[ingridinit] ( stream [ grids ] -- stream') computes median over the given grids
(special case of replacebypercentile).

**minfnof0**[distrib] ( A -- C AM ) computes maximum for a stream A.

**monthlygrid**[ingridinit] ( grid -- newgrid ) computes the monthly grid that encompasses first
and last from grid.

**monthtimetodaytime**[ingridinit] (grid -- grid') changes units from months since 1 Jan 1960 to days
since 1 Jan 1960.

**mul0**[pairdiff] ( stream1 stream2 -- stream' ) multiplies stream1 by stream2 preserving
the chunking of stream1. stream2 is 1D.

**mul**[filters] ( stream1 stream2 -- stream' ) multiplies two streams value by value.

**mulsum**[pairdiff] ( A B grid -- C ) returns A*B multiplied and summed along grid. If
grid is an array of grids, sums over all of them.

**n==**[udunits] ( unitS -- name ) converts unit structure to a (canonical and PS) name.
We use this to recognize units.

**name**[grid] ( -- name ) returns grid name.

**nameargs**[ingridinit] ( arg1 ... argn { nam1 ... namn } -- object ) creates an object that
contains all the input arguments

**nan00**[newfns] ( stream mvs -- stream' ) converts the stream using the list of missing
values in mvs so that missing values are now NaNs.

**nan01**[newfns] ( stream mvs -- stream' ) converts the stream using the valid range in
mvs so that values outside the range are now NaNs.

**neededpsdefs**[fig] ( plotobject -- plotobject ) defines PS2defs that are changed from their defaults.

**netCDFdef**[ingridinit] ( dataset stream -- dataset ) defines stream in dataset after some
postprocessing.

**newid**[ingridinit] ( filename -- id ) returns permanent id for filename.

**newpartialS**[pairdiff] ( stream grid -- structure ) makes new partialS structure and sets it
to go along grid in stream.

**newplotstream**[ingridinit] ( integer/array/stream -- ) resets the plotstream according to the
input argument. If an integer, the achunk is an integer grid of that size. If an
array of grids, those grids are used as the achunk. If a stream, the achunk of the
stream is used as the achunk of the new plotstream.

**newurloption**[fig] ( -- ) allows figure changing.

**normalize**[pairdiff] ( stream1 stream2 minimum -- stream' ) divides stream1 by stream2. Points
less than minimum in stream2 become NaN in the

**normalizePOPs0**[kalman] ( evec npts -- alpha evec ) renomalizes a la VNRMC2.

**normalizePOPs**[kalman] ( evec -- evec alpha ) renormalizes POPs.

**normalizeddistrib1D**[ingridinit] ( A -- stream ) computes the normalized distribution of A, i.e. the
integral along A will be one.

**normalizeddistrib2D**[ingridinit] ( A B -- stream ) computes the distribution of A vs B (see distrib2D)
and then renormalizes by the integral along B. This new stream has the property that
the integral along B is 1.

**npts**[grid] ( -- npts ) returns grid number of points.

**nullplot**[fig] ( -- ) does nothing.

**object**[fginterp] ( parent size -- newobject) creates a new object from parent of size.

**ocean**[fig] ( grid1 grid2 -- ) draws land from WORLDBATH.

**ocean**[fig] ( grid1 grid2 -- ) draws land from WORLDBATH.

**outlinedata**[forallstreams] ( dataset -- ) makes an outline of the data catalog/a dataset.

**pairsums0**[pairdiff] ( stream p -- stream' ) pairwise sums along one coordinate of the stream
within the chunk.

**pairsums1**[pairdiff] ( streamsum stream p -- stream' ) pairsums over chunks.

**pairsums**[pairdiff] ( stream grid -- stream' ) pairwise sums along grid of stream. This
is the stream equivalent of integralgrid.

**parenstring**[ingridinit] ( string -- string' ) puts () around string.

**parent**[fginterp] ( object -- parent) returns parent of object, null if no parent.

**pop**[fginterp] ( any -- ) removes object from stack.

**print**[fginterp] ( string -- ) prints string to stdout.

**pstack**[fginterp] ( *any_1* \ldots *any_n* -- *any_1* \ldots *any_n*) prints stack without changing it.

**put**[fginterp] (array/string/dict index/key any -- ) puts any into array/string/dict
with given index/key.

**putinterval**[fginterp] ( array/string index *array/string_2* -- ) puts *array_2* into *array_1* at index (first element is zero).

**repeat**[fginterp] ( i proc -- ) repeats proc *i* times.

**roll**[fginterp] ( *any_{n-1}* \ldots *any_0* n j -- *any_{(j-1) \mod n}* \ldots *any_0* *any_{n-1}* \ldots *any_{j \mod n}* ) performs circular shift on stack.

**round**[fginterp] ( num -- num ) returns rounded number.

**setmax==array**[fginterp] ( int/null -- ) sets maximum number of array elements to print, {\it
null} means print all the values.

**split**[fginterp] ( any [ *proc_1* \ldots *proc_n* ] -- ) applies each of the {\it proc}edures in the array [ ] to *any*, {i.e.} for each procedure pushes *any* onto the stack and then executes *proc*{.} Usually used to split a stream into substreams.

**string**[fginterp] ( int -- string ) creates a string of the specified length.

**sub**[fginterp] ( num num -- num ) subtracts.

**type**[fginterp] ( any -- name ) returns name of type of any.

**true**[fginterp] ( -- bool ) returns true.

**xor**[fginterp] ( bool bool -- bool ) logical eXclusive OR.

**parsedimageurl**[fig] ( -- object ) returns an object containing the parsed imageurl if it is completely
parseable, otherwise returns false. parseable means everything before fig- is understood,
and there is something between fig- and -fig (though the latter is not currently checked).

**partial**[pairdiff] ( stream grid -- stream' ) takes partial derivative of stream along grid.

**partial**[partial] ( stream grid -- stream' ) takes partial derivative with respect to grid.
\begin{code} SUBROUTINE STREAMpartial

**partialS**[pairdiff] ( -- structure ) a structure used for holding the arguments to differences0.

**partialgrid**[ingridinit] ( grid -- newgrid ) computes grid for partial deriviatives; new grid
has points in between the old gridpts.

**percentileover**[ingridinit] ( stream [ grids ] -- stream' ) normalized rank data over given grids.

**pickstn**[newfns] ( xs ys xl xh yl yh -- is ) returns indices of xs and ys that fall in range.

**placelabels**[ingridinit] ( XS YS GRD LVL -- LBLARRAY ) calculates array of labels for a contour
plot. Labels are placed at minimum gradient of contours and higher levels are favored
if crowded.

**plaincolor**[fig] ( stream grid1 grid2 -- ) does plain color plot.

**plaincontour**[fig] ( stream grid1 grid2 -- ) does plaincontour map.

**plotgridcheck**[ingridinit] ( grid -- grid' ) checks grid for short range in large number. If so,
removes offset.

**plotobject**[fig] ( -- object ) parent to all plotobjects. \subsection{Within plotobject}

**new**[fig] ( plotobject -- object ) creates a new plotobject.

**nplotstream**[fig] ( -- int ) number of data streams used by plot.

**nplotgrid**[fig] ( -- int ) number of grids used by plot. The plot arguments are then stream1
\ldots streamN grid1 \ldots gridM.

**rollplotobject**[fig] ( stream1 \ldots streamN grid1 \ldots gridM plotobject deviceobject -- plotobject
deviceobject stream1 \ldots streamN grid1 \ldots gridM ) reorders stack so that the
data is accessable to the plotting routines.

**drawfn**[fig] ( stream1 \ldots streamN grid1 \ldots gridM -- ) appends the plot from the
current plotobject to the current opened plot. None of the plotobject information
is used.

**draw**[fig] ( stream1 \ldots streamN grid1 \ldots gridM plotobject -- ) appends the plot
from the current plotobject to the current opened plot.

**standardplot**[fig] ( stream1 \ldots streamN grid1 \ldots gridM plotobject -- ) draws the standardplot
for the current plotobject. note that ps and .ps are the same because ps removes
objects from the stack (the . prefix only removes the previous element from the stack
if the word adds things to the stack).

**boundingbox**[fig] ( -- x0 x1 y0 y1 ) returns bounding box of figure.

**x0,x1,y0,y1**[fig] ( -- int ) returns pixel limits of data area.

**plotoptionline**[fig] ( -- ) give plot-sizing options.

**ppnewobjectdefget**[ingridinit] ( object name -- newobject ) defines an empty object name in object
and replaces it with the newobject. Used by ppdef, one version in FORMwords and one
version in DATASET.

**preferredunitname**[ingridinit] ( string/name -- name ) returns the preferred name for the given unit.
If udunits is active, this involves real processing. Otherwise, just converts to
a name after checking PreferredUnits.

**printcatentry**[ingridinit] ( name -- ) prints data catalog entry.

**printvarlist**[forallstreams] ( object -- ) prints sorted-by-variable object as html nested list.

**profile**[fig] ( stream grid -- ) draws single vertical line.

**psfigline**[fig] ( plotobject -- plotobject ) prints fig line after inputimagelink has run.
\end{ingrid}

**publicproc:**[ingridinit] ( stream1 ... streamN N name [lib] -- stream1 ... streamN ) marks the
beginning of a public procedure, i.e. one that adds to the history chain. lib is
the object containing the proc, if any. End of the procedure is marked by :publicproc.

**randomdata**[newdata] ( stream -- stream' ) returns a stream of random numbers.

**rankcorrelate**[ingridinit] ( stream1 stream2 [ grids ] minfraction -- stream ) rank correlates
stream1 and stream2 over grids. Points with less than minfraction of the data are
dropped (0. keeps all, 1. insists on all data).

**rddai**[newfns] ( array offset name -- ) reads data.

**read3col0**[newfns] ( -- stream ) reads 3 col datafile.

**readarray**[newfns] ( N name format -- array ) reads *N*-element real array from file {\it name} using {\it format}.

**readcdf**[nasacdf] ( string -- object ) reads a cdf file, converting it to an object which
contains several streams.

**readgrib**[grib] ( -- ) ( filename int -- dataset ) appends int to filename and uses as the
name of a gribfile -- continues incrementing until filename is not found referring
to all the grib files.

**readunits**[ingridinit] ( object string -- object number/string ) converts string to number
as appropriate for current units.

**rechunktocontaingrids**[ingridinit] ( stream [ grids ] -- stream ) rechunks (and copies) stream so that
the grids are within the chunk if necessary.

**regridAverage**[ingridinit] ( stream grid grid' [Wmin] -- stream' or stream1 stream2 [ grid1
... gridn ] Wght Wmin -- stream1 stream2' ) regrids by averaging. Second form allows
regridded multiple grids at once (the Wmin is also optional).

**regridAverageVer2**[ingridinit] ( stream1 stream2 [ grid1 grid2 ... ] Wght Wmin -- stream1 stream2'
) regrids stream2 along the named grids to match stream1. A single grid need not be
in an array.

**removeGRID**[ingridinit] ( stream grid -- stream' ) removes a single-valued grid from stream.

**renameGRID**[ingridinit] ( stream grid name -- stream' ) renames grid in stream.

**reordertomatch**[matchchunk] ( stream1 stream2 -- stream1 stream2' ) reorders second stream to match
the first. grids in the first stream's chunk are in the second stream's chunk; grids
in the first stream's achunk are highest in the second stream's achunk. Assumes setcommongrids
has already been run on the pair.

**replaceGRID**[ingridinit] ( stream grid1 grid2 -- stream' ) replaces grid in stream.

**replaceGRID**[stream] ( stream oldgrid newgrid -- stream' ) returns a stream where oldgrid is
replaced by newgrid in the SIRecord. If the newgrid is null, removes the grid.

**replaceNaN**[ingridinit] ( stream value -- stream' ) replaces missing_values in stream with
value (which can be a stream). The stream is then considered to have no missing data.

**replacebypercentile**[ingridinit] ( stream [ grids ] p1 ... pn minfrac -- stream' ) computes percentile
bounds over given grids.

**reserverealization**[newfns] ( stream -- ) schedules single realization for later calls by getrealization.

**rightline**[fig] ( stream grid -- ) draws single line with left axis.

**rms**[ingridinit] ( A -- C ) or ( A [ grid1 grid2 ... ] -- AM ) returns rms (mean not
removed) of A values. If [ grid1 ... ] is given, then the mean *AM* will

**rootmeansq0**[distrib] ( A -- AM C ) computes root mean square for a stream A.

**rootmeansqanom0**[distrib] ( A -- AM C ) computes root mean square for a stream A.

**rotatedata**[ingridinit] ( D X Y X' Y' *\alpha* ox oy -- D' ) rotates a stream onto a new grid (X' Y').

**rotatedata**[testrot] ( D X Y X' Y' *\alpha* ox oy -- D' ) rotates a stream onto a new grid (X' Y').

**samplearray**[newfns] ( array N -- array' ) samples array to length N. If array is shorter than
N, returns array unmodified.

**scatter**[fig] ( stream1 stream2 -- ) draws scatter plot.

**scattercolor**[fig] ( stream1 stream2 stream3 -- ) draws scatter plot with points colored by a
third variable.

**scatterlabel**[fig] ( stream1 stream2 names/stream3 -- ) draws scatter plot with labelled points.

**scatterline**[fig] ( stream1 stream2 -- ) draws scatter plot.

**scatterlines**[fig] ( stream1 stream2 stream3 -- ) draws scatter line, one for each stream3 (but
no labels).

**scattersized**[fig] ( stream1 stream2 stream3 -- ) draws scatter plot with points sized by a third
variable.

**seasmarkov**[ingridinit] (cov stab or lag0cov1 cov lag0cov0 stab -- dataset ) seasonal markov
model from lagged covariance.

**seasmarkovI**[ingridinit] ( cov stab -- dataset ) seasonal markov model from lagged covariance.

**seasmarkovII**[ingridinit] ( cov1 cov cov0 stab -- ) seasonal markov model from lagged covariance.

**seasonalPOPs**[kalman] ( A -- dataset ) calculates seasonal POPs.

**selectarray**[ingridinit] ( stream grid -- gridvaluearray ) finds elements of grid that correspond
to non-missing-values of stream.

**selectarray**[newfns] ( stream grid -- gridvaluearray ) returns grid values that correspond to
non-missing values in stream.

**selectarray0**[newfns] ( stream grid -- npts gridvalues ) returns a stream of gridvalues that
have been picked out by stream (stream and grid should be the same size), i.e. missing_values
in stream will be dropped. Note that gridvalues and npts are streams: they are converted
to arrays by selectarray.

**setIthGrid**[regrid] ( stream grid i -- stream' ) makes a child stream which has the *i_{th}* grid {\it grid}.

**setLastTaskArgs**[ingridinit] (arg1 .. argn param n -- arg1 .. argn param ) internal word called
by Ingrid to set TaskStreams and TaskParameterBlock. TaskStreams is an array that
contains the stream

**setSIRecord**[matchchunk] ( stream ptr -- stream' ) sets SIRecord in the current stream. If
it results in a change, a child stream of the original stream is created. Otherwise,
the stream is left unchanged, and the SIRecord is deleted.

**setcommongrids**[matchchunk] ( stream1 ... streamN N -- stream1 ... streamN ) samples a set of streams
to have matching points (without reordering or repeating).

**setfirsttime**[grib] ( year month day hour -- ) sets the first time.

**setlasttime**[grib] ( year month day hour -- ) sets subsequent times. These words together keep
track of the time grid with quadruplets of integers representing each time. Since
the time grids are usually even, firsttime, lasttime, and NT are usually sufficient.
If the grids are not even, then an object alltimes is defined, which stores all the
times keyed by NT. setlasttime is responsible for making that decision.

**setgridtype**[grid] ( type -- ) sets grid type: ordered, periodic, or unordered.

**setmissing_value**[ingridinit] ( stream value -- stream' ) changes the missing_value (flag for missing
data to value.

**setplotstream**[ingridinit] ( -- ) initializes plotstream.

**nextplotstream**[ingridinit] ( -- ) uses buffer from last task to reset plotstream.

**settaskqueue**[task] ( int -- ) sets the queue where tasks will be put. Default is zero, the computational
queue.

**setunits**[grid] ( units -- ) sets grid units.

**shiftGRID**[ingridinit] ( stream grid delta -- stream' ) shifts grid by delta, i.e. the data
is relabeled.

**shiftdata**[ingridinit] ( stream grid low high -- stream' ) shifts data in turn by first to
last. Defines a new grid with _lag appended to the grid name. Positive lag means
data in the output stream has been moved later, i.e. if it is correlated with another
dataset it leads by that amount.

**showstream**[forallstreams] ( name stream -- ) shows a stream.

**showunitsdict**[ingridinit] ( -- object ) contains words that convert units to strings.

**sirecord==**[stream] ( -- ) print sirecord of the current stream.

**sortbyvariable**[forallstreams] ( dataset -- ) makes an outline of the data catalog/a dataset.

**splitgrid**[grid] ( grid real -- grid1 grid2 ) converts a grid into two grids by using {\it
real} as the interval in grid2; grid1 indexes within {\it real}.

**splitstreamgrid**[ingridinit] ( stream grid largestep -- stream' ) splits grid into two parts: the
second grid will have step largestep.

**stackreserverealization**[newfns] ( -- ) calls reserverealization for all streams in stack.

**standardsetXOVY**[ingridinit] ( -- ) sets XOVY from plot width if not defined.

**stateAdvance**[kalman] ( A W -- WF' ) advances state one timestep.

**stateAssimilate**[kalman] ( WO K H WF -- WOERR WA ) assimilates observations WO into forecast WF
using the sampling model H and the assimilation matrix K. Returns both the modified
model state WA and the data misfits WOERR.

**stateEvolution**[kalman] ( WO W(0) T K H A -- WOERR WA WF ) calculates model state evolution.

**sub0**[pairdiff] ( stream1 stream2 -- stream' ) subtracts stream2 from stream1 preserving
the chunking of stream1 if stream2 is 1D.

**sub**[filters] ( stream1 stream2 -- stream' ) subtracts two streams value by value.

**subvssq**[ingridinit] ( stream streams -- stream' ) subtracts a scalar from a vector and
squares it. Streams must have matching achunk and streams has to have chunksize 1.

**sums0**[pairdiff] ( stream p -- stream' ) sums along one coordinate of the stream within
the chunk.

**sums1**[pairdiff] ( streamsum stream p -- stream' ) sums over chunks.

**sums**[pairdiff] ( stream grid -- stream' ) sums along grid of stream.

**surfaceaverage:integral**[ingridinit] ( stream -- stream' ) returns the X Y average value.

**svd**[newdata] ( stream/dataset [ grid1 \ldots gridn ] [ grid1' \ldots gridm'] percent
-- dataset ) calculates the singular value decomposition (i.e. Empirical Orthogonal
Functions) of an input stream or dataset, returning a dataset containing the structures
and eigenvalues. There are a set of structures S ( grid1 \ldots gridn iev ) which
are normalized to rms 1, a set of structures T ( grid1' \ldots gridm' iev ) such that
S*T = stream/dataset, a set of singular values: sv(iev), such that sum(sv*sv) = trace(covariance)/N,
and a set of normalized eigenvalues evaln(iev), such that sum(evaln) = 1 (i.e. percentage
of variance). All outputs remain functions of any unmentioned grids. In the case
of a dataset input, an optional first array controls whether variables are combined
in forming the S structures. Omitting the array means eofs will be computed for
each variable separately. An empty array means that eofs will be computed averaging
over all variables. If the array has elements, each subelement results in a separate
set of eofs: variables listed within a subelement are combined together. For example,
if the dataset contains the four variables u,v,sst,h: \begin{description} \item means
there will be separate eofs for u,v,sst,h, and the output dataset eofs will contain
svd.u.Ss, svd.v.Ss, etc, \item[[]] means there will be one set of eofs, including
components for u,v,sst,h, and the output dataset will contain svd.Ss, svd.Ts,
etc, and \item[[[u v] sst h]] means there will be separate eofs for (u,v), sst,
and h and the output dataset will contain svd.u_v.Ss svd.sst.Ss, svd.h.Ss, etc.
Note that svd.u_v.Ss.u are the structures for u, and svd.u_v.Ss.v are the structures
for v, while svd.u_v.Ts are the time series for the combined variables. \end{description}
Note that usually different variables with different units have to be renormalized
so that it makes sense to combine them. That can be done in the specification of
variables, namely \begin{description} \item[[u 20 div v 20 div sst 100 div h 1000
div ]] means there will be one set of eofs using the renormalized variables. \end{description}

**tablefunction**[ingridinit] ( A(...) B(A) -- B(...) or A(...) A2(Z ...) [Z] -- Z(...) ) converts
a stream A to a stream B using a table B(A) (a 1D stream).

**thisfigure**[fig] ( plotobject label -- plotobject ) prints link to plain page version of current
plotobject.

**timetable.tsv**[ingridinit] ( stream1 ... streamN N -- ) makes table.

**toGrADStime**[grads] ( real -- string ) converts to GrADS time format according to units.

**toNaN**[ingridinit] ( stream -- stream' ) changes missing_values into NaNs. Uses either
missing_value or valid_range flags.

**total0**[distrib] ( A -- AM C ) computes sum for a stream A.

**transit**[bilin] ( D(X,Y) X(S) Y(S) S -- D(S) ) given a stream D(X,Y) and a ship track X(S),
Y(S), returns D(S).

**translateNASAatts**[ingridinit] ( stream -- stream' ) defines Ingrid versions of all the NASA cdf attributes.

**trimulsum**[legendre] ( stream(sp) stream(sp,lat) nx -- stream'(k_x,lat) ) does mulsum of legendre
polynomials with spectral coefficients.

**trimulsuminv**[legendre] ( stream(k_X,lat) stream(sp,lat) -- stream'(sp) ) does mulsum of legendre
polynomials with zonal Fourier transform.

**tsptogau**[legendre] ( stream nx ny -- stream' ) converts spectral coefficients to lon/lat.

**gautotsp**[legendre] ( stream nwave -- stream' ) converts lon/lat to spectral coefficients.

**tsptogauR**[legendre] ( stream nx ny -- stream' ) converts spectral coefficients to lon/lat.

**gautotsp**[legendre] ( stream nwave -- stream' ) converts lon/lat to spectral coefficients.

**units**[grid] ( -- units ) returns grid units.

**unsplitstreamgrid**[ingridinit] ( stream grid -- stream' ) undoes the splitting done by splitstreamgrid.

**value**[ingridinit] ( color value -- ) interprets value as desired center of one of the
maxncolor-3 color boxes.

**vectors**[fig] ( stream1 stream2 grid1 grid2 -- ) does vector map.

**viewimagelink.html**[fig] ( plotobject -- ) creates an img link to an image with anchor to the view
page. Assumes imageurl already set.

**vmufsf**[kalman] ( cov vector grid -- cov ) multiply a covariance matrix by a vector on
both sides.

**wf_define_dataset_attributes**[ingridinit] ( dataset -- ) defines attributes for dataset.

**wf_define_variable_attributes**[ingridinit] ( stream -- ) copies attributes from stream to cuf/cdf file.

**width96**[ingridinit] ( A -- stream ) computes the 96 precentile widths.

**wr.r4**[newfns] ( stream file -- ) writes stream to random access file.

**wrda**[newfns] ( stream offset file -- ) writes data to random access file.

**wrda0**[newfns] ( stream p -- ) writes data.

**wrNaN**[newfns] ( stream name -- ) writes NaN to file.

**wrdai**[newfns] ( array offset name -- ) writes data.

**writeCUF**[ingridinit] ( dataset filename -- ) writes dataset to file filename. If the filename
is null, writes to standard output. This word opens the file, defines all the attributes
and variables, and submits tasks to write the variables to the file.

**writeGrADS**[grads] ( stream filename -- ) writes a pair of files for input to GrADS.

**writegrads0**[grads] ( stream p -- ) actually writes data

**yearlymodel**[ingridinit] ( A -- Y ) converts a set of seasonal lagged models A into yearly
transition matrices, starting with the first month only.

**yearlymodels**[covar] ( -- ) converts markov models at various lags to yearly lags.

**yearlymodels**[ingridinit] ( A -- Y ) converts a set of seasonal lagged models A into a set of
year transition matrices.

**zeroline**[fig] ( grid1 -- ) draws zeroline.