Appendix B.  Short description of each subroutine.

COMMANDS

SUBROUTINE ATTRIB
Set attributes such as lines vs. surfaces, color, line style, line width, and
transparency.  Used for subsets and walls.
BLOCK DATA BCONAT
Initialize common block /CONATT/.
BLOCK DATA BCONT
Initialize common block /CONT/.
BLOCK DATA BFSUR
Initialize common block /FSUR/.
BLOCK DATA BFUNC
Initialize common block /FUNC/.
BLOCK DATA BGRIDS
Initialize common block /GRIDS/.
BLOCK DATA BMINM
Initialize common block /MINM/.
BLOCK DATA BPLTOP
Initialize common block /PLTOPT/.
BLOCK DATA BRAKE
Initialize common block /RAKE/.
BLOCK DATA BSUBS
Initialize common block /SUBS/.
BLOCK DATA BTEXT
Initialize common block /TEXT/.
BLOCK DATA BVECAT
Initialize common block /VECATT/.
BLOCK DATA BVECT
Initialize common block /VECT/.
BLOCK DATA BVIEWA
Initialize common block /VIEWAX/.
BLOCK DATA BVPNT
Initialize common block /VPNT/.
BLOCK DATA BWALL
Initialize common block /WALL/.
SUBROUTINE CLRALL
Clear all calculated arrays (such as pressure and Mach number) from work array
WORK.
SUBROUTINE CLRCM1
Call CLRALL.
SUBROUTINE CLRCMD
Call CLRCM1 for the CLEAR command.
CHARACTER*20 FUNCTION COLRNM
Return the name of the color keyed to a given integer.
SUBROUTINE CONATR
Set contour attributes, which are slightly different than wall or subset
attributes: lines vs. color contours vs. contour surfaces, color map, plane
orientations, and the standard line style, etc.
SUBROUTINE CONAUT
Set the maximum number of contour levels for automatic contour level
calculation.
SUBROUTINE CONCM1
Display function range if requested, and call CONAUT, CONINC, or CONMAN,
depending on command line qualifiers.
COMMAND CONCMD
Look for qualifiers for CONTOUR command, and call CONCM1.
SUBROUTINE CONINC
Specify the increment between contour levels.
SUBROUTINE CONMAN
Specify sets of contour levels (min, max, increment), along with a full set of
attributes for each set.
SUBROUTINE CONSHO
Show current contour specifications.
SUBROUTINE FSUCM1
Process the qualifiers for the FSURFACE command.
SUBROUTINE FSUCMD
Look for qualifiers for the FSURFACE command, and call FSUCM1.
SUBROUTINE FSUSHO
Show the status of the FSURFACE command.
SUBROUTINE FUNCM1
Get a new function number and clear all calculated arrays from WORK.
SUBROUTINE FUNCMD
Call FUNCM1.  In the future, will look for FUNCTION command qualifiers.
SUBROUTINE FUNRAN
Get the range (minimum and maximum values) of the current function (better be
a scalar function) in the current subsets.
SUBROUTINE FUNSHO
Show the current function number and name, and if it is a scalar function,
calculate and show its range.
SUBROUTINE HLPCMD
Get help from the PLOT3D help library.  We have to get any HELP command
qualifiers or arguments and load them into a keyword array to pass to HELP.
SUBROUTINE LISCM1
Process arguments and qualifier arguments for the LIST command; decide whether
to call LISTX, LISTQ, or LISTF.
SUBROUTINE LISCMD
Process qualifiers for the LIST command and call LISCM1.
SUBROUTINE LISDIM
Write out the problem dimensions as a header for a PLOT3D-readable data file.
Called from LISTX, LISTQ, and LISTF.
SUBROUTINE LISTF
Process the text or PLOT3D-readable writing of function data for the LIST
command.  Called from LISCM1.
SUBROUTINE LISTFX
List the values of the current function in a (human-)readable form.  Lists
only current subsets.  Called from LISTF.
SUBROUTINE LISTQ
Process the text or PLOT3D-readable writing of Q data for the LIST command.
Called from LISCM1.
SUBROUTINE LISTQH
Write out the Q header record for a PLOT3D-readable Q data file.  Called from
LISTQ.
SUBROUTINE LISTQX
List the values of Q in a (human-)readable form.  Lists only current subsets.
Called from LISTQ.
SUBROUTINE LISTWB
Write an array of real data followed by an array of integer data.  Used for
making PLOT3D-readable data files (i.e., XYZ files with blanking).  Called
from LISTX.
SUBROUTINE LISTWH
Write an array of real data.  Used for making PLOT3D-readable data files.
Called from LISTX, LISTQ, and LISTF.
SUBROUTINE LISTX
Process the text or PLOT3D-readable writing of XYZ data for the LIST command.
Called from LISCM1.
SUBROUTINE LISTXX
List the values of XYZ in a (human-)readable form.  Lists only current
subsets.  Called from LISTX.
SUBROUTINE MAPCM1
Call MAP, which shows WORK array usage.
SUBROUTINE MAPCMD
Call MAPCM1 for the MAP command.
SUBROUTINE MINALL
Get x, y, and z plot ranges (min, max, and increment).  Z values are optional,
and increments are expected only if the /INCREMENT qualifier was used on the
MINMAX command.
SUBROUTINE MINCM1
Get plot ranges by calling MINSET or MINALL.
SUBROUTINE MINCMD
Look for MINMAX command qualifiers and call MINCM1.
SUBROUTINE MINSET
Get one set (min, max,inc) of plot ranges.  Increment is optional, based on
/INCREMENT qualifier on MINMAX command.
SUBROUTINE MINSHO
Show current MINMAX specifications.
SUBROUTINE P3DCOM
Command node for PLOT3D.  Called from P3DERR.
SUBROUTINE P3DERR
Set up system-dependent error handling and keyboard interrupt return path.
Called from P3DINI, calls P3DCOM.
SUBROUTINE P3DINI
Initialization of PLOT3D, print intro banner.  Called from PLOT3D, calls
P3DERR.
CHARACTER*20 FUNCTION PLANNM
Return a character representation of the plane orientations supplied as
integers.
PROGRAM PLOT3D
Main routine for PLOT3D.  WORK array is dimensioned here.  Calls P3DINI.
SUBROUTINE PLTCM1
Load PLOT command qualifiers into /PLTOPT/ and make a plot by calling PLT2D or
PLT3D.
SUBROUTINE PLTCMD
Look for qualifiers for command PLOT and call PLTCM1.
SUBROUTINE PLTSHO
Show current PLOT command options.
SUBROUTINE QUICM1
Perform cleanup for QUIT (or EXIT) command.  Save or delete journal file.
SUBROUTINE QUICMD
Look for qualifiers for QUIT (or EXIT) command and call QUICM1.
SUBROUTINE RAKATR
Set attributes for rakes of particle traces.  Again, somewhat different from
wall or subset attributes: lines vs. dots (dots aren't implemented yet),
color, etc.
SUBROUTINE RAKCM1
Get filename to read particle traces from, or get rakes from RAKIJK or RAKXYZ
and maybe a filename to write the traces out to.
SUBROUTINE RAKCMD
Look for RAKE command qualifiers and call RAKCM1.
SUBROUTINE RAKIJK
Get a rake, specified as (i,j,k) grid point values.
SUBROUTINE RAKSHO
Show the current rake specifications.
SUBROUTINE RAKXYZ
Get a rake, specified as (x,y,z) physical space points.
SUBROUTINE REACM1
Clear all calculated arrays, then call READX, READQ, and/or READF to read in
new data files.
SUBROUTINE REACMD
Look for READ command qualifiers, then call REACM1.
SUBROUTINE READF
Read a file of 1-, 2-, or 3-dimensional arbitrary function data.  (Plotting
such functions has not been implemented yet.)
SUBROUTINE READIM
Read the problem dimensions from the input data file and check to see if they
match the old dimensions.
SUBROUTINE READPB
Read an array of real data and an array of integer data, one plane per record
(READ/PLANES).  This is needed to read XYZ data files with IBLANK
information.
SUBROUTINE READPL
Read an array of real data one plane per record (READ/PLANES).  Used for reads
of Q data, arbitrary data, or XYZ data without blanking.
SUBROUTINE READQ
Read a file of 1-, 2-, or 3-dimensional Q data.
SUBROUTINE READQH
Read the Q data header record, containing freestream Mach number,
angle-of-attack, Reynolds number, and time.  Time is currently not used or
printed out.
SUBROUTINE READWB
Read a whole array of real data and a whole array of integer data, all
from the same record.  This is needed to read XYZ data files with IBLANK
information.
SUBROUTINE READWH
Read a whole array of real data from a single record.  Used for reads of Q
data, arbitrary data, or XYZ data without blanking.
SUBROUTINE READX
Read a file of 1-, 2-, or 3-dimensional XYZ (grid) data, with or without
IBLANK (blanking information).
SUBROUTINE REAINI
Initialize subsets, walls, and rakes after reading in a new set of data.
SUBROUTINE REAMSG
Write out an informational message including the grid number and dimensions of
the grid we're reading.
SUBROUTINE REMJAC
Check for no zero or negative metric Jacobians (actually the Jacobian matrix
determinants), then remove the Jacobian scaling from the Q variables.
SUBROUTINE SHOCM1
Show the current state of selected commands.
SUBROUTINE SHOCMD
Call SHOCM1 for the SHOW command.
SUBROUTINE SUBCM1
Handle qualifiers for the SUBSETS command, clear calculated arrays in WORK for
this grid, then get new subsets from SUBSAD.
SUBROUTINE SUBCMD
Look for SUBSETS command qualifiers, then call SUBCM1.
SUBROUTINE SUBSAD
Get subsets.
SUBROUTINE SUBSHO
Show current subsets.
SUBROUTINE TXTCM1
Get two lines of text, to be put on plots right below the title.
SUBROUTINE TXTCMD
Call TXTCM1 for the TEXT command.
SUBROUTINE VECATR
Set vector attributes such as vector length scale factor, whether vectors
should be scaled with vector magnitude, arrowhead size and type, whether the
arrowheads should be scaled with the vector length, line style, line width,
symbol type and size, etc.  Called from VECCM1.
SUBROUTINE VECCM1
Set the various parameters for vector plots.  Call VECATR to get vector
attributes.
SUBROUTINE VECCMD
Look for qualifiers for the VECTOR command, then call VECCM1.
SUBROUTINE VECSHO
Show the current vector attributes (associated scalar variable for coloring,
length scale, arrowhead type, etc.).
SUBROUTINE VIECM1
Specify what two-dimensional view to use for 2D plots (x vs. y, y vs. z,
etc.), or which two spatial axes to plot for a 3D carpet plot.
SUBROUTINE VIECMD
Call VIECM1 for the VIEW command.
SUBROUTINE VIESHO
Show current view (status of VIEW command).
SUBROUTINE VPTANG
Get a 3D viewpoint or eye position, specified in spherical coordinates as
(phi,theta,radius).  The origin of the spherical system is taken as the center
of the MINMAX box; radius is measured from that center.  The
(phi,theta,radius) system follows the DISSPLA convention: phi is measured in
the x-y plane, counterclockwise from the x-axis, and theta is the angle from
the x-y plane to the selected point, with the z-axis being +90 deg.
SUBROUTINE VPTCM1
Get viewpoint by calling VPTANG or VPTXYZ.
SUBROUTINE VPTCMD
Look for VPOINT command qualifiers, then call VPTCM1.
SUBROUTINE VPTSHO
Show current viewpoint for 3D plots.
SUBROUTINE VPTXYZ
Get a 3D viewpoint, specified as an (x,y,z) eye position, facing the center of
the MINMAX box.
SUBROUTINE WALCM1
Handle qualifiers for the WALLS command, then get new walls from WALSAD.
SUBROUTINE WALCMD
Look for WALLS command qualifiers, then call WALCM1.
SUBROUTINE WALSAD
Get walls.
SUBROUTINE WALSHO
Show current walls.

2D

SUBROUTINE PLT2D
Call routines to make a 2D plot.  Call GRID2D, SCAL2D, VECT2D, PART2D, or
SHOC2D for a grid, scalar variable, vector variable, particle trace, or shock
location plot.

2D/GRID

SUBROUTINE CRS2D
Highlight cells in this grid that fail the 2D crossing grid line check.
Call WAL2D to put in the walls, then loop through subsets, setting attributes
and calling CRS2L or CRS2P to do the check and draw the bad cells.
SUBROUTINE CRS2L
Do 2D crossing grid line check for this subset (subset must be a single plane).
Draw bad cells using lines.
SUBROUTINE CRS2P
Do 2D crossing grid line check for this subset (subset must be a single plane).
Draw bad cells using points.
SUBROUTINE GRD2D
Draw parts of a 2D grid.  Call WAL2D to put in the walls, then
loop through subsets, setting the attributes (color, line style, etc.), and
calling GRD2L to draw in the grid as lines, or GRD2P to draw it as points.
SUBROUTINE GRD2L
Draw the given subset of the grid as lines (by calling LINE2).
SUBROUTINE GRD2P
Draw the subset of the grid as points (by calling POINT2).
SUBROUTINE GRD2PS
Draw the subset of the grid as points, using a scalar function to set the
color of each point.
SUBROUTINE GRD2S
Draw the subset of the grid as a shaded surface (by calling POLY2).
SUBROUTINE GRID2D
Make a 2D grid-type plot by retrieving the XYZ data and calling ZIP2D, GRD2D,
or HOL2D for each grid in turn.  Called from PLT2D.
SUBROUTINE HOL2D
Draw 2D hole boundaries for this grid.  Call WAL2D to put in the walls, then
loop though subsets, setting the attributes and calling HOL2L or HOL2P to draw
in the hole boundaries.
SUBROUTINE HOL2L
Outline IBLANK hole boundaries in this subset using lines.  A hole boundary
consists of any points which border on regions where IBLANK is zero.
SUBROUTINE HOL2P
Outline IBLANK hole boundaries in this subset using points.  A hole boundary
consists of any points which border on regions where IBLANK is zero.
SUBROUTINE VO12D
Highlight cells in this grid that fail the tetrahedron decomposition cell
volume check.  Call WAL2D to put in the walls, then loop through subsets,
setting attributes and calling VO12L or VO12P to do the check and draw the bad
cells.
SUBROUTINE VO12L
Do tetrahedron decomposition cell volume check for this subset.
Draw bad cells using lines.
SUBROUTINE VO12P
Do tetrahedron decomposition cell volume check for this subset.
Draw bad cells using points.
SUBROUTINE VO22D
Highlight cells in this grid that fail the tetrahedron decomposition grid
crossing check.  Call WAL2D to put in the walls, then loop through subsets,
setting attributes and calling VO22L or VO22P to do the check and draw the bad
cells.
SUBROUTINE VO22L
Do tetrahedron decomposition grid crossing check for this subset.
Draw bad cells using lines.
SUBROUTINE VO22P
Do tetrahedron decomposition grid crossing check for this subset.
Draw bad cells using points.
SUBROUTINE WAL2D
Draw walls for this grid.  Loop through the walls, setting the attributes
and calling GRD2L for walls drawn as lines, GRD2S for walls drawn as shaded
surfaces.
SUBROUTINE WAL2S
Draw walls for this grid for a function surface plot.  Loop through the walls,
setting the attributes and calling GRD2L for walls drawn as lines, GRD2S for
walls drawn as shaded surfaces.
SUBROUTINE ZIP2D
Draw no grid information for this grid (but DO put in the walls!).  Call WAL2D
to put in the walls.

2D/SCALAR

SUBROUTINE CON2CC
Get set up to draw color contours.  Identical to CON2CL, except calls
CON2C,CON2CB instead of CON2L,CON2LB.
SUBROUTINE CON2CL
Get set up to draw contour lines in specified plane orientations (IJ, IK,
and/or JK): generate contour levels from min, max, and increment; loop through
orientations, loop through subsets, (if necessary) transpose x, y, z, and F
data into temporary arrays, then call CON2L or CON2LB to draw contour lines
for this subset of this plane.  If a subset is only a plane, use that
orientation instead of the specified one.
SUBROUTINE CON2D
For this grid, call WAL2D to draw walls, loop through contour level sets, set
attributes (color map, line style, etc.), and call CON2CL, GRD2LS, CON2CC, or
GRD2PS to do contours as lines, grid lines, color contours, or colored dots,
respectively.
SUBROUTINE FSU2D
For this grid, call WAL2D to draw walls, loop through contour level sets, set
attributes, and call GRD2LS, GRD2SS, or GRD2PS to do function surface
(line) plots as grid lines, shaded surface or colored dots,
respectively.
SUBROUTINE SCAL2D
Make a 2D plot of a scalar function.  If necessary, find the function range
(from FUNRAN) and generate nice contour levels (in CONSCL).  Loop through the
grids, getting pointers into WORK for XYZ, IBLANK (if there), and F, the
scalar function.  If F is not there, get Q and calculate the function by
calling SCAFUN.  Do the plot for this grid in the requested form by calling
CON2D or FSU2D.

2D/VECTOR

SUBROUTINE VEC2D
Call WAL2D to draw walls for this grid; loop through subsets, setting vector
attributes.  If there is an associated scalar variable, loop through the
contour level sets, set up the contour color map and draw the vectors for this
contour set by calling VEC2VS.  If there is NO associated scalar variable,
just call VEC2V to draw the vectors.
SUBROUTINE VEC2V
Draw 2D vectors of function F over this subset.  Call VECTO2 for each vector.
SUBROUTINE VEC2VS
Draw 2D vectors of function F over this subset, using scalar function SF to
set the color of the vector.  Calling CONCLR with the value of SF at each
point sets the color, and VECTO2 is called to draw each vector.
SUBROUTINE VECT2D
Make a 2D plot of a vector function.  If there is an associated scalar
variable (like for coloring the vectors), figure the function range and
contour levels (FUNRAN and CONSCL).  Loop through the grids, getting pointers
to XYZ, IBLANK (if there), the vector function, and the associated scalar
function.  Calculate the vector and scalar functions if necessary, by calling
VECFUN and SCAFUN.  Call VEC2D to draw 2D vectors, and call CCBAR to put a
color bar on the plot to identify the scalar function contour levels.

2D/PARTICLES

SUBROUTINE PAR2D
Read particle trace start locations from one of the temporary files.  If the
trace does not start in this grid, simply write the starting location back out
to the other temporary file.  If it does start in this grid, call PARTIC to
compute the particle trace until it leaves this grid or current subsets, can't
be traced because of grid warping, or reaches a point of zero velocity.  Write
the trace out to the particle trace file, along with the rake number and trace
number.  If the particle left the computational domain AND we have blanking,
figure out if we should look for the trace to continue in another (or a
different part of the same) grid.  This information comes from IBLANK on the
boundary of the grid we just exited.
SUBROUTINE PAR2DA
Call PAR2L or PAR2LS to draw the traces.
SUBROUTINE PAR2L
Rewind the particle trace file, read the traces one-by-one, set the attributes
based on the rake number recorded with the trace, and plot the trace.  Note
that one continuous trace may be split into several entries in the particle
trace file, due to crossing grid boundaries or tracing the particle in both
the + and - vector directions.
SUBROUTINE PAR2LS
For each grid: rewind the particle trace file, read the traces one-by-one.  Get
the associated scalar variable for coloring the traces, interpolate the
function to the trace points, set the attributes, and call CON2G for each
contour set to color the trace.
SUBROUTINE PART2D
Get started making a particle trace plot.  Get two temporary files to keep
track of particle start or continuation points, call PLINI2 to generate the
start points, open a file for the actual particle traces (file.PAR), then loop
through the grids.  Get pointers to XYZ and IBLANK, and the first time through
each grid, draw walls by calling ZIP2D.  Call PLFND2 to pin down the (i,j)
starting points for particles (and check if ANY start in this grid).  Get
pointers to the vector field function; if it isn't there, get Q and generate
the function by calling VECFUN.  Call PAR2D to do the traces.  If particles
leave the current grid and enter another, PAR2D will record them as
continuation points in one of the temporary files.  Keep looping through all
the grids until no points are left in any of the grids.  Call PAR2DA to read
the particle trace file and draw the traces.  Clean up files and unit
numbers.  THIS PLOTS THE CORRECT RESULT FOR TRUE 2D DATA ONLY.
SUBROUTINE PLFND2
Look through the list of particle trace starts and try to resolve starting
locations in the current grid.  If no grid numbers are listed, the (x,y)
values are valid but we don't know which grid it's in; otherwise we know the
(i,j) point but not the (x,y) location.  ONLY CURRENT SUBSETS ARE CHECKED.
Return status indicates if there are no starts in this grid or no starts left
in ANY grid.  Read from one temporary file and write out to the other.
SUBROUTINE PLINI2
Generate an initial list of particle starting points.  This list will be
modified and updated as the particles are found and advanced through various
grids.  The list is updated in PLFND2 and PAR2D by ping-ponging information
between the two temporary files opened in PART2D.  Data stored for each
particle start location is the trace number, rake number, number of grids in
which the particle might be and a list of those grids, (i,j) cell number and
a flag if that number is OK, (x,y) coordinates with a flag if the
coordinates are OK, time since the trace was started, time-march (or
vector-direction-march) direction (+1 or -1), and a flag for the type of
search to be done by CLOSE2.

2D/SHOCKS

SUBROUTINE SHK2CL
Compute 2D shock lines for this grid by looping through subsets, transposing
planes of (x,y,z) and F data, and calculating contours.  Call SHK2L or SHK2LB
for the contours so each line segment can be checked before being drawn as to
whether it is part of the shock.
SUBROUTINE SHK2D
Draw walls for this grid (WAL2D), set attributes, and call SHK2CL to draw the
shocks as lines.
SUBROUTINE SHOC2D
Make a plot of possible shock locations.  Loop through grids, getting pointers
to XYZ, IBLANK, and the function ("SHOCK FUNCTION BASED ON PRESSURE GRADIENT").
If the function is not found, get Q and call SCAFUN
to calculate it.  Get or compute the velocity, in order to check function
contour lines to see which parts actually correspond to shocks.  Call SHK2D to
draw the shock structure for this grid.  THIS PLOTS THE CORRECT RESULT FOR
TRUE 2D DATA ONLY.

3D

SUBROUTINE PLT3D
Call routines to make a 3D plot.  Call GRID3D, SCAL3D, VECT3D, PART3D, or
SHOC3D for a grid, scalar variable, vector variable, particle trace, or shock
location plot.

3D/GRID

SUBROUTINE CRS3D
Highlight cells in this grid that fail the 2D crossing grid line check.
Call WAL3D to put in the walls, then loop through subsets, setting attributes
and calling CRS3L or CRS3P to do the check and draw the bad cells.
SUBROUTINE CRS3L
Do 2D crossing grid line check for this subset (subset must be a single plane).
Draw bad cells using lines.
SUBROUTINE CRS3P
Do 2D crossing grid line check for this subset (subset must be a single plane).
Draw bad cells using points.
SUBROUTINE GRD3D
Draw parts of a 3D grid.  Call WAL3D to put in the walls, then
loop through subsets, setting the attributes (color, line style, etc.), and
calling GRD3L to draw in the grid as lines, or GRD3P to draw it as points.
SUBROUTINE GRD3L
Draw the given subset of the grid as lines (by calling LINE3).
SUBROUTINE GRD3P
Draw the subset of the grid as points (by calling POINT3).
SUBROUTINE GRD3PS
Draw the subset of the grid as points, using a scalar function to set the
color of each point.
SUBROUTINE GRD3S
Draw the subset of the grid as a shaded surface (by calling POLY3).
SUBROUTINE GRID3D
Make a 3D grid-type plot by retrieving the XYZ data and calling ZIP3D, GRD3D,
or HOL3D for each grid in turn.  Called from PLT3D.
SUBROUTINE HOL3D
Draw 3D hole boundaries for this grid.  Call WAL3D to put in the walls, then
loop though subsets, setting the attributes and calling HOL3L or HOL3P to draw
in the hole boundaries.
SUBROUTINE HOL3L
Outline IBLANK hole boundaries in this subset using lines.  A hole boundary
consists of any points which border on regions where IBLANK is zero.
SUBROUTINE HOL3P
Outline IBLANK hole boundaries in this subset using points.  A hole boundary
consists of any points which border on regions where IBLANK is zero.
SUBROUTINE VO13D
Highlight cells in this grid that fail the tetrahedron decomposition cell
volume check.  Call WAL3D to put in the walls, then loop through subsets,
setting attributes and calling VO13L or VO13P to do the check and draw the bad
cells.
SUBROUTINE VO13L
Do tetrahedron decomposition cell volume check for this subset.
Draw bad cells using lines.
SUBROUTINE VO13P
Do tetrahedron decomposition cell volume check for this subset.
Draw bad cells using points.
SUBROUTINE VO23D
Highlight cells in this grid that fail the tetrahedron decomposition grid
crossing check.  Call WAL3D to put in the walls, then loop through subsets,
setting attributes and calling VO23L or VO23P to do the check and draw the bad
cells.
SUBROUTINE VO23L
Do tetrahedron decomposition grid crossing check for this subset.
Draw bad cells using lines.
SUBROUTINE VO23P
Do tetrahedron decomposition grid crossing check for this subset.
Draw bad cells using points.
SUBROUTINE WAL3D
Draw walls for this grid.  Loop through the walls, setting the attributes
and calling GRD3L for walls drawn as lines, GRD3S for walls drawn as shaded
surfaces.
SUBROUTINE WAL3S
Draw walls for this grid for a function surface plot.  Loop through the walls,
setting the attributes and calling GRD3L for walls drawn as lines, GRD3S for
walls drawn as shaded surfaces.
SUBROUTINE ZIP3D
Draw no grid information for this grid (but DO put in the walls!).  Call WAL3D
to put in the walls.

3D/SCALAR

SUBROUTINE CON3CC
Get set up to draw color contours.  Identical to CON3CL, except calls
CON3C,CON3CB instead of CON3L,CON3LB.
SUBROUTINE CON3CL
Get set up to draw contour lines in specified plane orientations (IJ, IK,
and/or JK): generate contour levels from min, max, and increment; loop through
orientations, loop through subsets, (if necessary) transpose x, y, z, and F
data into temporary arrays, then call CON3L or CON3LB to draw contour lines
for this subset of this plane.  If a subset is only a plane, use that
orientation instead of the specified one.
SUBROUTINE CON3CS
Get set up to draw 3D contour surfaces: loop through subsets calling CON3S.
SUBROUTINE CON3D
For this grid, call WAL3D to draw walls, loop through contour level sets, set
attributes (color map, line style, etc.), and call CON3CL, CON3CS, GRD3LS,
CON3CC, or GRD3PS to do contours as lines, contour surfaces, grid lines, color
contours, or colored dots, respectively.
SUBROUTINE FSU3D
For this grid, call WAL3D to draw walls, loop through contour level sets, set
attributes, and call CON3CL, GRD3LS, GRD3SS, or GRD3PS to do function surface
(carpet) plots as contour lines, grid lines, shaded surface or colored dots,
respectively.
SUBROUTINE SCAL3D
Make a 3D plot of a scalar function.  If necessary, find the function range
(from FUNRAN) and generate nice contour levels (in CONSCL).  Loop through the
grids, getting pointers into WORK for XYZ, IBLANK (if there), and F, the
scalar function.  If F is not there, get Q and calculate the function by
calling SCAFUN.  Do the plot for this grid in the requested form by calling
CON3D or FSU3D.

3D/VECTOR

SUBROUTINE VEC3D
Call WAL3D to draw walls for this grid; loop through subsets, setting vector
attributes.  If there is an associated scalar variable, loop through the
contour level sets, set up the contour color map and draw the vectors for this
contour set by calling VEC3VS.  If there is NO associated scalar variable,
just call VEC3V to draw the vectors.
SUBROUTINE VEC3V
Draw 3D vectors of function F over this subset.  Call VECTO3 for each vector.
SUBROUTINE VEC3VS
Draw 3D vectors of function F over this subset, using scalar function SF to
set the color of the vector.  Calling CONCLR with the value of SF at each
point sets the color, and VECTO3 is called to draw each vector.
SUBROUTINE VECT3D
Make a 3D plot of a vector function.  If there is an associated scalar
variable (like for coloring the vectors), figure the function range and
contour levels (FUNRAN and CONSCL).  Loop through the grids, getting pointers
to XYZ, IBLANK (if there), the vector function, and the associated scalar
function.  Calculate the vector and scalar functions if necessary, by calling
VECFUN and SCAFUN.  Call VEC3D to draw 3D vectors, and call CCBAR to put a
color bar on the plot to identify the scalar function contour levels.

3D/PARTICLES

SUBROUTINE PAR3D
Read particle trace start locations from one of the temporary files.  If the
trace does not start in this grid, simply write the starting location back out
to the other temporary file.  If it does start in this grid, call PARTIC to
compute the particle trace until it leaves this grid or current subsets, can't
be traced because of grid warping, or reaches a point of zero velocity.  Write
the trace out to the particle trace file, along with the rake number and trace
number.  If the particle left the computational domain AND we have blanking,
figure out if we should look for the trace to continue in another (or a
different part of the same) grid.  This information comes from IBLANK on the
boundary of the grid we just exited.
SUBROUTINE PAR3DA
Call PAR3L or PAR3LS to draw the traces.
SUBROUTINE PAR3L
Rewind the particle trace file, read the traces one-by-one, set the attributes
based on the rake number recorded with the trace, and plot the trace.  Note
that one continuous trace may be split into several entries in the particle
trace file, due to crossing grid boundaries or tracing the particle in both
the + and - vector directions.
SUBROUTINE PAR3LS
For each grid: rewind the particle trace file, read the traces one-by-one.  Get
the associated scalar variable for coloring the traces, interpolate the
function to the trace points, set the attributes, and call CON3G for each
contour set to color the trace.
SUBROUTINE PART3D
Get started making a particle trace plot.  Get two temporary files to keep
track of particle start or continuation points, call PLINI3 to generate the
start points, open a file for the actual particle traces (file.PAR), then loop
through the grids.  Get pointers to XYZ and IBLANK, and the first time through
each grid, draw walls by calling ZIP3D.  Call PLFND3 to pin down the (i,j,k)
starting points for particles (and check if ANY start in this grid).  Get
pointers to the vector field function; if it isn't there, get Q and generate
the function by calling VECFUN.  Call PAR3D to do the traces.  If particles
leave the current grid and enter another, PAR3D will record them as
continuation points in one of the temporary files.  Keep looping through all
the grids until no points are left in any of the grids.  Call PAR3DA to read
the particle trace file and draw the traces.  Clean up files and unit
numbers.
SUBROUTINE PLFND3
Look through the list of particle trace starts and try to resolve starting
locations in the current grid.  If no grid numbers are listed, the (x,y,z)
values are valid but we don't know which grid it's in; otherwise we know the
(i,j,k) point but not the (x,y,z) location.  ONLY CURRENT SUBSETS ARE CHECKED.
Return status indicates if there are no starts in this grid or no starts left
in ANY grid.  Read from one temporary file and write out to the other.
SUBROUTINE PLINI3
Generate an initial list of particle starting points.  This list will be
modified and updated as the particles are found and advanced through various
grids.  The list is updated in PLFND3 and PAR3D by ping-ponging information
between the two temporary files opened in PART3D.  Data stored for each
particle start location is the trace number, rake number, number of grids in
which the particle might be and a list of those grids, (i,j,k) cell number and
a flag if that number is OK, (x,y,z) coordinates with a flag if the
coordinates are OK, time since the trace was started, time-march (or
vector-direction-march) direction (+1 or -1), and a flag for the type of
search to be done by CLOSE3.

3D/SHOCKS

SUBROUTINE SHK3CL
Compute 3D shock lines for this grid by looping through subsets, transposing
planes of (x,y,z) and F data, and calculating contours.  Call SHK3L or SHK3LB
for the contours so each line segment can be checked before being drawn as to
whether it is part of the shock.
SUBROUTINE SHK3CS
Compute 3D shock surfaces for this grid by looping through subsets and
calculating contour surfaces.  Call SHK3S for the contour surfaces so each
polygon can be checked before being drawn as to whether it is part of the
shock.
SUBROUTINE SHK3D
Draw walls for this grid (WAL3D), set attributes, and call SHK3CL or SHK3CS to
draw the shocks as lines or polygonal surfaces.
SUBROUTINE SHOC3D
Make a plot of possible shock locations.  Loop through grids, getting pointers
to XYZ, IBLANK, and the function ("SHOCK FUNCTION BASED ON PRESSURE GRADIENT").
If the function is not found, get Q and call SCAFUN
to calculate it.  Get or compute the velocity, in order to check function
contour lines to see which parts actually correspond to shocks.  Call SHK3D to
draw the shock structure for this grid.

FUNCTIONS

BLOCK DATA BFLUID
Initialize common block /FLUID/.
SUBROUTINE CPRESS
Pressure coefficient, c_p = (p-p_inf)/(.5*rho_inf*v_inf**2).
SUBROUTINE CROSSF
Cross-flow velocity, sqrt(v**2+w**2).
SUBROUTINE CSPRES
Stagnation pressure coefficient, c_p_0 = (p_0-p_0_inf)/(.5*rho_inf*v_inf**2).
SUBROUTINE DENSIT
Density, rho = Q(1).
SUBROUTINE DIVV
Divergence of velocity, Del dot V.
SUBROUTINE DPRESS
Dynamic pressure, q = (1/2)*rho*v**2
SUBROUTINE ENTHAL
Enthalpy, h = gamma*[e_0-.5*(u**2+v**2+w**2)].
SUBROUTINE ENTROP
Entropy, s = log_10[(p/p_inf)/(rho/rho_inf)**gamma].
SUBROUTINE FRANGE
Determine the range (minimum and maximum values) of the scalar function F for
all subsets in this grid.
SUBROUTINE FRHELI
Filtered relative helicity, same as relative helicity if the helicity density
(the numerator) is greater than or equal to 0.01, zero otherwise.
SUBROUTINE FSHOCP
Filtered shock function based on pressure gradient, unchanged if
|grad(p)| >= 0.1, zero otherwise.
CHARACTER*80 FUNCTION FUNNAM
Return the proper (long) name corresponding to the supplied function number.
CHARACTER*80 FUNCTION FUNSYM
Return the symbol corresponding to the supplied function number, e.g. "p" for
pressure, or "c_p" for pressure coefficient.
SUBROUTINE GRADDE
Compute the density gradient.  Similar to GRADPR.
SUBROUTINE GRADPR
Compute the pressure gradient.  Do this by first computing the pressure in AND
AROUND this subset (we need a fringe of points so we can compute the gradient
using central differencing where possible), then call GRAD to compute the
gradient for this subset.
SUBROUTINE HELICI
Helicity, V dot omega.
SUBROUTINE IENERG
Energy (or internal energy), e_i = e_0-.5*(u**2+v**2+w**2).
SUBROUTINE KENERG
Kinetic energy, e_k = .5*(u**2+v**2+w**2).
SUBROUTINE LNDENS
Log of normalized density, ln(rho/rhoinf).
SUBROUTINE LNPRES
Log of normalized pressure, ln(p/pinf).
SUBROUTINE LNTEMP
Log of normalized temperature, ln(T/Tinf).
SUBROUTINE MACHNO
Mach number, M = sqrt[(u**2+v**2+w**2)/c**2].
SUBROUTINE MOMENT
Momentum, (x_momentum, y_momentum,z_momentum) = (Q(2),Q(3),Q(4)).
SUBROUTINE NDENSI
Normalized density, rho/rho_inf.  (Freestream density is currently assumed to
be 1 in SCAFUN and VECFUN.)
SUBROUTINE NENTHA
Normalized enthalpy, h/h_inf.
SUBROUTINE NIENER
Normalized internal energy, e_i/e_i_inf.
SUBROUTINE NKENER
Normalized kinetic energy, e_k/e_k_inf.
SUBROUTINE NPRESS
Normalized pressure, p/p_inf.
SUBROUTINE NSDENS
Normalized stagnation density, rho_0/rho_0_inf.
SUBROUTINE NSENER
Normalized stagnation energy, e_0/e_0_inf.
SUBROUTINE NSENTH
Normalized stagnation enthalpy, h_0/h_0_inf.
SUBROUTINE NSPRES
Normalized stagnation pressure, p_0/p_0_inf.
SUBROUTINE NSTEMP
Normalized stagnation temperature, T_0/T_0_inf.
SUBROUTINE NTEMPE
Normalized temperature, T/T_inf.
SUBROUTINE PPRESS
Pitot pressure, p_p.
SUBROUTINE PPRESR
Pitot pressure ratio, p_p/p_inf.
SUBROUTINE PRESSU
Pressure, p = (gamma-1)*[Q(5)-.5*rho*(u**2+v**2+w**2)].
SUBROUTINE PVELOC
Perturbation velocity, V-V_inf.
SUBROUTINE QCHECK
Check the Q data for zero or negative densities or pressures.
SUBROUTINE RHELIC
Relative helicity, cos(phi) = (V dot omega)/(|V||omega|).
SUBROUTINE SCAFUN
Set fluid freestream values based on FSMACH from the Q data file and the
assumption that the freestream density and speed of sound are both 1.  Loop
through subsets and call one of the function routines to calculate the
appropriate scalar function.
SUBROUTINE SDENSI
Stagnation density, rho_0 = rho*{1+.5*(gamma-1)*M**2}**[1/(gamma-1)].
SUBROUTINE SENERG
Stagnation energy, e_0 = Q(5)/rho.
SUBROUTINE SENERV
Stagantion energy per unit volume, rho*e_0 = Q(5).
SUBROUTINE SENTHA
Stagnation enthalpy, h_0 = h+.5*(u**2+v**2+w**2).
SUBROUTINE SHOCKP
Compute the "shock function based on pressure gradient", which is the
Mach number component in the direction of the pressure gradient.
SUBROUTINE SOUND
Sound speed, c = sqrt(gamma*p/rho).
SUBROUTINE SPRESS
Stagnation pressure, p_0 = p*{1+.5*(gamma-1)*M**2}**[gamma/(gamma-1)].
SUBROUTINE STEMPE
Stagnation temperature, T_0 = T*{1+.5*(gamma-1)*M**2}.
SUBROUTINE STREAM
Normalized 2D stream function, taking the first point in the subset as being
on the zero-streamline.
SUBROUTINE SWIRL
Swirl, (omega dot V)/(rho*V**2).
SUBROUTINE TEMPER
Temperature, T = p/(rho*R) (perfect gas law; R is the gas constant).
SUBROUTINE UVELOC
U velocity, u = Q(2)/rho.
SUBROUTINE VECFUN
Set fluid freestream values based on FSMACH from the Q data file and the
assumption that the freestream density and speed of sound are both 1.  Loop
through subsets and call one of the function routines to calculate the
appropriate vector function.
SUBROUTINE VECMAG
Magnitude of a 3-component vector.
SUBROUTINE VELMAG
Velocity magnitude, V = sqrt(u**2+v**2+w**2).
SUBROUTINE VELOCI
Velocity, (u,v,w).
SUBROUTINE VELXOM
Velocity x vorticity, (u*omega_x,v*omega_y,w*omega_z).
SUBROUTINE VORTIC
Vorticity, omega = (omega_x,omega_y,omega_z).
SUBROUTINE VVELOC
V velocity, v = Q(3)/rho.
SUBROUTINE WVELOC
W velocity, w = Q(4)/rho.
SUBROUTINE XMOMEN
X momentum, Q(2).
SUBROUTINE XVORTI
X vorticity, omega_x = du/dy-dv/dz.
SUBROUTINE YMOMEN
Y momentum, Q(3).
SUBROUTINE YVORTI
Y vorticity, omega_y = du/dz-dw/dx.
SUBROUTINE ZMOMEN
Z momentum, Q(4).
SUBROUTINE ZVORTI
Z vorticity, omega_z = dv/dx-du/dy.

PARTICLES

SUBROUTINE CELL2
Same as CELL3, but for 2D grids.
SUBROUTINE CELL3
Given an (x,y,z) point and a "close" (i,j,k) grid index, find exactly which
grid cell the point is in as well as the (a,b,g) fraction of the computational
cell index.  The search can be limited to a subset of the grid.  The search is
performed by finding the computational index of the point based on the corner
points of the starting cell (using metric transformations and Newton
iteration), and changing the cell number until calculated index is within the
current cell.  A return code indicates if the point was not inside the
computational domain or subset.  The subset is assumed to be acceptable (not
degenerate), and the initial cell is assumed to be valid (not outside the
subset, not blanked out).  Use STRT3 to check these first, if necessary.
SUBROUTINE CELLIJ
Same as CELL3, but limited to the given IJ computational plane.
SUBROUTINE CELLIK
Same as CELL3, but limited to the given IK computational plane.
SUBROUTINE CELLJK
Same as CELL3, but limited to the given JK computational plane.
SUBROUTINE CLOSE2
2D version of CLOSE3.  Called from PLFND2.
SUBROUTINE CLOSE3
Find the cell containing the given (x,y,z) point and return its (i,j,k)
indices and subset number.  One of several types of searches is performed, each
consisting of several strategies, applied in order of increasing computational
work.  Types of searches are (1) a general search, (2) search from the previous
point found, and (3) search for a point coming from another grid (flagged
through the IBLANK array).  Search strategies are coded in routines ESRCH3,
HSRCH3, NSRCH3, and PSRCH3.
SUBROUTINE DMIN2
2D version of DMIN3.
SUBROUTINE DMIN3
Add to a list of minimum distance (i,j,k) points to a given (x,y,z) point.
Called from CLOSE3.
SUBROUTINE ESRCH2.
2D version of ESRCH3.
SUBROUTINE ESRCH3
Search for the given point by finding the closest point(s) along the edges of
the grid and calling PSRCH3 from there.  Called from CLOSE3.
SUBROUTINE FSRCH3
Search for the given point by finding the closest point(s) on the faces of the
grid and calling PSRCH3 from there.  Called from CLOSE3.
SUBROUTINE HSRCH2
2D version of HSRCH3.
SUBROUTINE HSRCH3
Search for the given point by finding the closest point(s) on a hole boundary
(IBLANK=0) and calling PSRCH3 from there.  Called from CLOSE3.
SUBROUTINE INTP2
2D version of INTP3.
SUBROUTINE INTP3
Interpolate the supplied function(s) at the given computational point,
expressed as an (i,j,k) cell number and the (a,b,g) fractional distances within
that cell.
SUBROUTINE INTPIJ
Same as INTP3 but assuming G=0.
SUBROUTINE INTPIK
Same as INTP3 but assuming B=0.
SUBROUTINE INTPJK
Same as INTP3 but assuming A=0.
SUBROUTINE INV2X2
2x2 version of INV3X3.
SUBROUTINE INV3X2
3x2 version of INV3X3.
SUBROUTINE INV3X3
Invert a 3x3 matrix, returning it's pseudo-inverse if the matrix is singular.
SUBROUTINE METR2
2D version of METR3.
SUBROUTINE METR3
Compute the metric transformation matrices at the given (i+a,j+b,k+g)
computational point, based only on the corner points of the (i,j,k) cell.
SUBROUTINE METRIJ
Same as METR3, but returning transformations that (1) assume G=0, and (2) zero
the row or column corresponding to the k-direction.
SUBROUTINE METRIK
Same as METR3, but returning transformations that (1) assume B=0, and (2) zero
the row or column corresponding to the j-direction.
SUBROUTINE METRJK
Same as METR3, but returning transformations that (1) assume A=0, and (2) zero
the row or column corresponding to the i-direction.
SUBROUTINE NSRCH2
2D version of NSRCH3.
SUBROUTINE NSRCH3
Search for the given point by finding the closest point(s) on a boundary with
grid n (IBLANK=-n) and calling PSRCH3 from there.  Called from CLOSE3.
SUBROUTINE PADV2
2D version of PADV3.
SUBROUTINE PADV3
Advance a particle trace one step through a vector field V, moving roughly a
given fraction of a computational cell.  Do this by finding the exact
computational cell index in CELL3, interpolating the vector field in INTP3, 
and advancing the trace via a second-order Runge-Kutta step.
SUBROUTINE PADVIJ
IJ plane version of PADV3.
SUBROUTINE PADVIK
IK plane version of PADV3.
SUBROUTINE PADVJK
JK plane version of PADV3.
SUBROUTINE PARTI2
2D version of PARTI3.
SUBROUTINE PARTI3
Main routine to trace a particle through a vector field V.  Arrays of
(x,y,z,t), as well as real number (i,j,k) for the trace are returned.  PARTI3
is called from PAR3D, and calls PADV3, PADVIJ, PADVIK, or PADVJK multiple
times to move the particle.
SUBROUTINE PSRCH2
2D version of PSRCH3.
SUBROUTINE PSRCH3
Search for a point by calling CELL3.  Called from CLOSE3.
SUBROUTINE STRT2
2D version of STRT3.
SUBROUTINE STRT3
Given subset boundaries and a computational index (real number (i,j,k)), (1)
check if the subset is degenerate (only one plane thick), (2) check whether
the computational point is outside that subset, (3) and adjust the cell number
and (a,b,g) offsets within that cell so that the cell is valid (within the
subset and contains no blanked-out points).  Return an (i,j,k) cell number and
the (a,b,g) offsets within that cell.
SUBROUTINE STRTIJ
IJ plane version of STRT3.
SUBROUTINE STRTIK
IK plane version of STRT3.
SUBROUTINE STRTJK
JK plane version of STRT3.
SUBROUTINE UWAL2
2D version of UWAL3.
SUBROUTINE UWAL3
Change the given velocity based on IBLANK information indicating solid walls
at the boundary of this cell.
SUBROUTINE UWALIJ
IJ plane version of UWAL3.
SUBROUTINE UWALIK
IK plane version of UWAL3.
SUBROUTINE UWALJK
JK plane version of UWAL3.
SUBROUTINE XWAL2
2D version of XWAL3.
SUBROUTINE XWAL3
Change the given grid index based on IBLANK information indicating solid walls
at the boundary of this cell.
SUBROUTINE XWALIJ
IJ plane version of XWAL3.
SUBROUTINE XWALIK
IK plane version of XWAL3.
SUBROUTINE XWALJK
JK plane version of XWAL3.

SHOCKS

SUBROUTINE SHK2L
Compute shock lines for this subset, using contour level 1 of function F.
For each contour line segment, if the velocity at (i,j) (nearby) points toward
the line, then the value of F (Mach number component in the direction of the
pressure gradient) should be greater than 1 for this to be part of a shock.
If the velocity points away, F should be less than 1.  This routine is a
modification of CON2L.
SUBROUTINE SHK2LB
Version of SHK2L with checks for blanked-out points (IBLANK=0).
SUBROUTINE SHK3L
Compute shock lines for this subset, using contour level 1 of function F.
For each contour line segment, if the velocity at (i,j) (nearby) points toward
the line, then the value of F (Mach number component in the direction of the
pressure gradient) should be greater than 1 for this to be part of a shock.
If the velocity points away, F should be less than 1.  This routine is a
modification of CON3L.
SUBROUTINE SHK3LB
Version of SHK3L with checks for blanked-out points (IBLANK=0).
SUBROUTINE SHK3S
Compute shock surfaces for this subset, using contour level 1 of function F.
For each contour surface polygon, if the velocity at (i,j,k) (nearby) points
toward the surface, then the value of F (Mach number component in the
direction of the pressure gradient) should be greater than 1 for this to be
part of a shock.  If the velocity points away, F should be less than 1.  This
routine is a modification of CON3S.

CONTOUR

SUBROUTINE CC2
Find and draw the color contour subpolygon(s) for a given (i,j) cell.  Calls
POLY2 to draw the polygon(s).  Called by CON2C,CON2CB.
SUBROUTINE CC3
Same as CC2, but with z-coordinate too.  Calls POLY3 to draw the polygon(s).
Called by CON3C,CON3CB.
SUBROUTINE CON2C
Compute and draw color contours for a given subset (of a single plane of (x,y)
and F).  Call CC2 to actually compute the subpolygons for a cell.
SUBROUTINE CON2CB
A version of CON2C with checks for blanked-out points (IBLANK=0).
SUBROUTINE CON3C
Compute and draw color contours for a given subset (of a single plane of
(x,y,z) and F).  Call CC3 to actually compute the subpolygons for a cell.
SUBROUTINE CON3CB
A version of CON3C with checks for blanked-out points (IBLANK=0).
SUBROUTINE CON2L
Compute and draw contour lines for a given subset (of a single plane of (x,y)
and F).  Use linear interpolation.  Use CLINE2 to draw contour lines.
SUBROUTINE CON2LB
A version of CON2L with checks for blanked-out points (IBLANK=0).
SUBROUTINE CON3L
Compute and draw contour lines for the given subset (of a single plane of
(x,y,z) and F).  Linear interpolation is used between grid points to find
where the contour line goes.
SUBROUTINE CON3LB
A version of CON3L with checks for blanked-out points (IBLANK=0).
SUBROUTINE CON3S
Generate and draw 3D contour surfaces for this subset.  Loop through each grid
cell, checking for cell edges where the function value changes through the
contour level, called a "hit".  Call CSINTP to find the point on the edge
where the function is equal to the contour level.  Loop through the edges
again: call CSINIT to "rotate" the cell so that CSPOLY can be called with a
hit on edge 1, with point 1 high (function value greater than the contour
level).  This rotating of the data may not be fast, but it simplifies the
rather complicated coding in CSPOLY.  Draw the polygon returned by CSPOLY and
check if any hits are left.
SUBROTUINE CONSCL
Implement various options for scaling the contour levels: (1) come up with a
"nice" scaling of no more than a given number of levels between Fmin and Fmax,
and return the minimum, maximum, and increment for the contour levels; (2) use
the supplied contour increment and return the minimum and maximum levels, and
the number of levels between Fmin and Fmax.  This routine sets values that
totally enclose the function range Fmin to Fmax.
SUBROUTINE CSINIT
Rotate the arrays of high points, hit edges, and contour points on the cell
edges so that the selected edge is first, and the given endpoint of that
edge is first.
SUBROUTINE CSINTP
Use linear interpolation between the endpoints of this cell edge to find the
point where the contour surface intersects the edge.
SUBROUTINE CSPOLY
Given that "edge 1" has a hit and "point 1" is high, find the contour surface
polygon that starts on edge 1.  Call CSPTMV to copy the contour surface/edge
intersection points into the polygon array.
SUBROUTINE CSPTMV
Update contour polygon point information: set the hit for this side to FALSE,
increment the number of points in this polygon, and add the intersection
coordinates to the polygon array.

STORAGE

SUBROUTINE BASFIL
Return the base filename of the data currently read in (Q data filename if
available, or XYZ data filename).  Return a blank if no data has been read in.
BLOCK DATA BVARIA
Initialize common block /VARIAB/.
SUBROUTINE DELPTR
Delete the pointer and release the space in the WORK array associated with
this variable for this grid.
SUBROUTINE DLCALC
Delete the pointer and release the space associated with all calculated
variables (such as pressure or Mach number) for this grid.  Calls DELPTR.
SUBROUTINE FRSPAC
Do our best to free up at least the requested number of words in WORK.  This
involves deleting calculated variables and paging out XYZ, IBLANK, and/or Q
for grids other than the current one.
SUBROUTINE GETPTR
Return the pointer index into WORK corresponding to the given variable in the
given grid.  If we can't find it, return an index of zero.  If the variable is
paged out, page it in, doing whatever is necessary to make room for it.
SUBROUTINE INIPTR
Initialize the pointers for the selected grid, erasing all previous
information and freeing the space in WORK.  Set the number of variables stored
for this grid to zero.  Calls DELPTR.
SUBROUTINE MAP
Print out a map of storage use in the WORK array.
SUBROUTINE NEWPTR
Request a new index into (and space in) WORK for the named variable and grid.
Also supply information as to whether the variable is also in a file, and if
so, what the record number and form of the file are.
SUBROUTINE PAGIN
Page (or read) a variable back into the WORK array.  Currently disconnected,
because automatic paging of variables has a problem: if we request space for a
new array (say MACH NUMBER), and end up paging out XYZ or Q or something from
a previous grid, then data will get moved around.  If we already got indices
into WORK for XYZ and Q to calculate the MACH NUMBER, they will now be
pointing to the wrong place!  What we need is a more sophisticated storage
manager, but I haven't decided how to do this cleanly yet.
SUBROUTINE PAGOUT
Page a variable out to disk (actually, it should already be on disk; simply
remove it from WORK and change the INMEM flag to zero).  Currently
disconnected because of the problem outlined in the description of PAGIN.

PARSER

BLOCK DATA BMODE
Initialize common block /MODE/.
BLOCK DATA BPARIO
Initialize common blocks /PARIO/ and /PARIOS/.
BLOCK DATA BPARPR
Initialize common blocks /PARPRM/ and /PARPST/.
SUBROUTINE CHAARG
Return this or the next command argument on the stack as a character string.
SUBROUTINE CHAQAR
Return this or the next qualifier argument on the stack as a character string.
SUBROUTINE CHAQUA
Return this or the next qualifier on the stack as a character string.
SUBROUTINE COMLIN
Return an image of the original command line, after the command (alone) has
been removed.  Line is saved in COMMAN; COMLIN is called from HLPCMD.
SUBROUTINE COMMAN
Prompt for and read a command line (by calling RDLIN), and parse it into the
command (calling FNDCOM), qualifiers and qualifier arguments (for each
qualifier) (FNDQUA), and command arguments (FNDARG).  If FNDCOM finds that the
first nonblank character is a "$", call the system-dependent routine SYSCOM to
execute an operating system command or just go to the operating system for
awhile to execute several commands.
SUBROUTINE CVTINT
Convert a character string into an integer value.
SUBROUTINE CVTREA
Convert a character string into a real (floating point) number.
SUBROUTINE DELFIL
Check if a given file exists, and delete it if requested.
SUBROUTINE ENDARG
Make sure there are no more command arguments on the stack.
SUBROUTINE ENDIO
Terminate standard parser I/O.  Save or delete journal file.
SUBROUTINE ENDQAR
Make sure there are no more arguments for this qualifier on the stack.
SUBROUTINE ERRMSG
Write an error message to the output device.  If this is not the standard
output device (i.e. terminal or batch log file), write the message there too.
Lines of text are written out by calling WRLIN.  For a batch job, an error is
considered fatal and the program is terminated.  For an interactive job, reset
the input and output file stack (don't take any more input from command files).
SUBROUTINE FNDARG
Find all command arguments in the line and put them in ARG, common blocks
/PARARG/ and /PARARC/.
SUBROUTINE FNDCOM
Find the command in the line and put it in COM (in common block /PARCOM/).
SUBROUTINE FNDQAR
Find all qualifier arguments in the given string and put them in QARG.  They
correspond to the given qualifier number.  Called from FNDQUA for each
qualifier.
SUBROUTINE FNDQUA
Find the qualifiers in the line and put them in QUAL.  Call FNDQAR to put
accompanying arguments in QARG.  Comments about the data structure for
qualifiers and their arguments are given in this routine.  Common blocks used
are /PARQUA/, /PARQUC/, /PARQAR/, and /PARQAC/.
SUBROUTINE GETCA
Get a character string argument by first looking at the (already parsed)
command line.  If there are no more arguments there and we are given a prompt
string (like "Please enter your name:"), prompt for the argument from the
terminal.  (PROMPT is called to write the prompt string, RDLIN is called to
read a line of input, and FNDARG is called to parse the line into arguments.
Note that arguments are delineated by blanks or commas; if a string contains
either one of these, the string should be enclosed in quotes to force it to be
treated as a single argument.)  If RDLIN reads an end-of-file, print the abort
message, if supplied.
SUBROUTINE GETCQ
Get a character string qualifier argument by first looking at the (already
parsed) command line.  If there are no more arguments for this qualifier and
we are given a prompt string, prompt for the argument.  (PROMPT is called to
write the prompt string, RDLIN is called to read a line of input, and FNDARG
is called to parse the line into arguments.  Note that arguments are
delineated by blanks or commas; if a string contains either one of these, the
string should be enclosed in quotes to force it to be treated as a single
argument.)  If RDLIN reads an end-of-file, print the abort message, if
supplied.
SUBROUTINE GETIA
Get an integer argument.  Similar to GETCA.
SUBROUTINE GETIQ
Get an integer qualifier argument.  Similar to GETCQ.
SUBROUTINE GETISA
Get an "integer set" (start, end, increment) as an argument or series of
arguments.  If no increment is given a value of 1 is assumed.  An increment of
zero is an error.  If no end is given the start value is assumed.  Similar to
GETCA.
SUBROUTINE GETISQ
Get an "integer set" (start, end, increment) as a series of qualifier
arguments.  Similar to GETISA.
SUBROUTINE GETLIN
Prompt for and read an entire line of text (rather than parsing into
arguments).  Called by TXTCM1, for instance.
SUBROUTINE GETRA
Get a real number argument.  Similar to GETCA.
SUBROUTINE GETRQ
Get a real number qualifier argument.  Similar to GETCQ.
SUBROUTINE GETRSA
Get an "real number set" (start, end, increment) as a series of arguments.  If
no end is given the start value is assumed.  If the end is different than the
start, an increment must be given.  An increment of zero is an error.  Similar
to GETCA.
SUBROUTINE GETRSQ
Get an "real number set" (start, end, increment) as a series of qualifier
arguments.  Similar to GETRSA.
SUBROUTINE GETXSA
Get an "index set" (start, end, increment) as a series of arguments.  If no
increment is given a value of 1 is assumed.  A zero increment is an error.  If
no end is given the start value is assumed.  Keywords "FIRST", "LAST", and
"ALL" are recognized, where "FIRST" and "LAST" can be substituted for either
start or end, and "ALL" substitutes for both start and end.  Start and end
values may be switched in this routine, based on the sign of the increment,
such as in "ALL -1", meaning loop from "LAST" to 1 by -1.  Similar to GETCA.
SUBROUTINE GETXSQ
Get an "index set" (start, end, increment) as a series of qualifier arguments.
Similar to GETXSA.
SUBROUTINE HELP
Get help on selected topics from a Help Library file corresponding to supplied
text.  Use routines HLPENT,HLPINF,HLPPRL,HLPSRY,HLPTOP,HLPTRV,HLPTXT to assist
in the task.  This help utility is written in standard FORTRAN (though it
isn't fast), and uses Help library files created by CREHLPLIB (which uses the
PLOT3D parser, utility, and operating system-dependent routines).  In
CREHLPLIB, the default file type for the Help library output is .hlb and the
Help file input is .hlp.  The file.hlp format is consistent with the VAX/VMS
Help Utility.
SUBROUTINE HLPENT
Find and print help entries corresponding to the supplied keywords.
SUBROUTINE HLPINF
Print "additional information available" headings for given keyword level.
SUBROUTINE HLPPRL
Print keywords.
SUBROUTINE HLPSRY
Print "Sorry, no information on ..." message.
SUBROUTINE HLPTOP
Prompt for additional help topic keywords.
SUBROUTINE HLPTRV
Traverse help library tree, either down one level, over one, or up and over
one level.
SUBROUTINE HLPTXT
Write out the text for the current help library entry.

SUBROUTINE IDXARG
Return this or the next argument as an index value.  Valid keywords are
"FIRST", "LAST", or "ALL", where "FIRST" is translated into 1, "LAST" into -1,
and "ALL" into 0 right here, as well as being flagged in the return code
STATUS.  Note that integers less than 1 are not valid indices.
SUBROUTINE IDXQAR
Return this or the next qualifier argument as an index value.  Similar to
IDXARG.
SUBROUTINE INITIO
Initialize standard I/O for the parser (which is done through RDLIN and
WRLIN).  Set BATCH (batch or interactive), ECHO (whether input should be
echoed to the output device), and PRMPT (whether to write prompts to the
output device) by calling SETMOD and SETECH.  Note that in FORTRAN 77, the
unit "*" is connected to the standard I/O devices by default.  Flag the use of
unit * by a zero for the unit number.  Open a journal file, if requested; push
the auto-initialization command file onto the input file stack, if found.
SUBROUTINE INTARG
Return this or the next argument as an integer value.
SUBROUTINE INTCHA
Convert an integer into a character string (with no leading blanks).  Return
the length of the string too.
SUBROUTINE INTQAR
Return this or the next qualifier argument as an integer value.
SUBROUTINE LOCASE
Convert a character string into all lower case.
SUBROUTINE LTRIM
Remove leading blanks, nulls, and tabs from a character string, then return
the length of the string after trailing blanks, nulls, and tabs have been
removed (by calling TRIM).
SUBROUTINE MATCH
Try to match a character string with a list of strings.  To avoid confusion,
everything is converted to upper case.  One can specify that only exact
matches are accepted; otherwise if (all of) the character string matches the
beginning of an element of the list, the comparison is successful.  Cases of
no matches or multiple matches are flagged.
SUBROUTINE MORE
Output lines of text, with pauses at 22-line intervals if the input device is
interactive.  Return whether anything but a <RETURN> was entered in response
to the prompt.  Used in HELP facility.
SUBROUTINE MSG
Write a message to the output device.  Lines of text are written out by
calling WRLIN.
SUBROUTINE POPINP
Pop a filename off the input file stack and set ECHO.  Set the current unit
number (this file should already be open), and close and free the old unit
number.  If there are no more entries in the stack, use the standard input
device (hooked to unit "*").  See PSHINP.
SUBROUTINE POPOUT
Pop a filename off the output file stack.  Open the file and set the unit
number, and close and free the old unit number.  If there are no more entries
in the stack, use the standard output device (hooked to unit "*").  See PSHOUT.
SUBROUTINE POPPRM
Pop a command prompt string (such as "PLOT3D V3: ") off the stack (see PSHPRM).
SUBROUTINE PROMPT
Prompt for input from the current input device.  Do this by writing the given
text out to the output device and not doing a carriage return after the last
line of prompt (see WRLIN).  If no prompt text is supplied, put out the
command prompt string.
SUBROUTINE PSHINP
Push this filename onto the input file stack and open it, connected with a new
unit number.  Set ECHO.  Leave the old file open.
SUBROUTINE PSHOUT
Push this filename onto the output file stack and open it, connected with a
new unit number.  Leave the old file open.
SUBROUTINE PSHPRM
Push a prompt string onto the parser prompt string stack.  Command prompting
(calling PROMPT with no text) will use the new prompt string.
SUBROUTINE QUALIF
Compare this list of valid qualifiers with the ones in QUAL that we found on
the command line.  Qualifiers come in sets (such as /FORMATTED and
/UNFORMATTED), of which only one may appear on a single command line.  For
each set, return the index of the qualifier that was found (i.e. 2 for
/UNFORMATTED), or zero if no qualifiers in this set were found.  If arguments
are expected for a particular qualifier, return a pointer into QUAL such that
routines xxxQAR can access the qualifier arguments, either picking up
arguments or reading in new ones.  See comments in QUALIF for further
information.
SUBROUTINE RDARG
Call RDLIN and FNDARG to read a line of input and parse it into arguments.
SUBROUTINE RDLIN
Read a line of input from the current input device.  If ECHO is TRUE, echo the
line to the output device.  Anything after a "!" is considered a comment and
is blanked out after the line is echoed.  A three-letter line "EOF" is
recognized as the equivalent of an end-of-file from the READ statement.  A "-"
as the last character in the line means that input is continued on the next
line.  Character strings enclosed in single quotes ("'") are considered
symbols to be translated by calling TRNLIN (which calls TRNSYM).  If the first
nonblank character is "@", the rest of the line is taken to be a filename to
be used for input.  Call PSHINP to push this file onto the stack and open it
for input; read the line we were SUPPOSED to get, from the new input file.  If
we get an end-of-file (or "EOF") through the READ statement, call POPINP to
pop the input stack; read another line.  If the input stack is empty, flag an
end-of-file and return.  Echo valid lines to the journal file, if there is one.
SUBROUTINE RDQAR
Call RDLIN and FNDQAR to read a line of input and parse it into arguments for
the given qualifier.
SUBROUTINE REAARG
Return this or the next argument as a real number.
SUBROUTINE REACHA
Convert a real number into a character string with no leading blanks.
SUBROUTINE REAQAR
Return this or the next qualifier argument as a real number.
SUBROUTINE RSTINP
Reset the input file stack, closing and freeing all old unit numbers, and set
ECHO.  The input device is reset to the standard input device.  Print an
informative message.
SUBROUTINE RSTOUT
Reset the output file stack, closing and freeing all old unit numbers.  The
output device is reset to the standard output device.  Print an informative
message.
SUBROUTINE RSTPRM
Reset the parser command prompt string stack.  The prompt is reset to "?".
SUBROUTINE SETECH
Determine whether the given input and output devices are batch or interactive.
If either is batch, we'll want to echo input lines to the output device.  Set
ECHO=TRUE in /MODE/.  Otherwise set ECHO=FALSE.  Set PRMPT=TRUE.
(Occasionally we wish to turn prompting off; this resets it.)
SUBROUTINE SETMOD
Determine whether the standard input device is interactive or not.  If not,
set BATCH=TRUE, otherwise BATCH=FALSE in /MODE/.
SUBROUTINE TRIM
Return the length of a character string after trailing blanks, nulls, and tabs
have been removed.
SUBROUTINE TRNLIN
Look through the given character string, translating symbols enclosed in
single quotes ("'") by calling the system-dependent routine TRNSYM.  Symbols
are defined at the operating system command level.
SUBROUTINE UPCASE
Convert a character string to upper case.
SUBROUTINE WRLIN
Write a line of text to the current output device.  If a "$" is in column 1 of
the supplied text, don't put a carriage return at the end of the line.  (There
is no FORTRAN 77 convention for this, but VAX/VMS, IRIS/Unix, and CRAY/UNICOS
FORTRAN 77 allow the form "('query?  ',$)".)  Break the line if necessary to
keep the output under 80 columns, including carriage control.
SUBROUTINE WRNMSG
Write a warning message to the current output device.

UTILITIES

SUBROUTINE CCOPY
Copy one section of a character string to another section, taking care for
possible overlapping strings.  Apply FORTRAN 77 rules for blank padding and
truncation.
SUBROUTINE COPY
Copy an array from one location to another.  The user is responsible for
making sure the second array doesn't overwrite the first.
SUBROUTINE COPYRV
Copy an array from one location to another, starting from the back-end.  This
can avoid the problem of overwriting the first array IF the two arrays overlap
and the second array begins after the start of the first.
SUBROUTINE CRSPR2
Calculate the perpendicular of a 2D vector.
SUBROUTINE CRSPRD
Calculate the cross product of two vectors.
SUBROUTINE CUBIC
Solve for the roots of a cubic polynomial.  If lead coefficient is too small,
calls QUADRA instead.
SUBROUTINE DI
Compute the derivative of a function in the i-direction at a given point.  Use
central differencing if possible, otherwise three-point one-sided differencing,
otherwise two-point one-sided, otherwise return zero and an error.
FUNCTION DOTPR2
Calculate the dot product of two 2D vectors.
FUNCTION DOTPRD
Calculate the dot product of two vectors.
SUBROUTINE GRAD
Calculate the gradient of a scalar function F in the given (i,j,k) index
ranges.  This involves calculating the metrics.  Note that the gradient is a
vector function.
SUBROUTINE IZERO
Zero an integer array.
SUBROUTINE LINEAR
Solve for the root of a linear polynomial.
SUBROUTINE NCRSP2
Calculate the perpendicular of a 2D vector.  Normalize the result.
SUBROUTINE NCRSPR
Calculate the cross product of two vectors.  Normalize the result.
SUBROUTINE NORMA2
Normalize a 2D vector.  Return its magnitude as well.
SUBROUTINE NORMAL
Normalize a vector.  Return its magnitude as well.
SUBROUTINE NRMVEC
Calculate a (normalized) normal vector for this n-point polygon.  If it's a
line or point, the vector is set to all zeros.
SUBROUTINE PCLCOE
Given the geometric form of a parametric cubic line, return the coefficients of
the cubic polynomial.
SUBROUTINE PCLFND
Given the geometric form of a parametric cubic line for a function, return the
parametric value at which the function is equal to a given value.
SUBROUTINE PCLINE
Return the 4x1 matrix representing the geometric form of a function along a
parametric cubic line between a given (i,j,k) point and the next point in the
i-, j-, or k-direction.
SUBROUTINE PCLVAL
Given the geometric form of a parametric cubic line for a function, return the
value of the function at a given parametric value.
SUBROUTINE QUADRA
Solve for the roots of a quadratic polynomial.  If lead coefficient is too small,
calls LINEAR instead.
SUBROUTINE RSTRV2
Restrict the given velocity vector by removing the component normal to given
coordinate directions.
SUBROUTINE RSTRV3
Restrict the given velocity vector by removing the component normal to given
coordinate directions.
SUBROUTINE SCLINC
Come up with a "nice" increment between two numbers, based on an upper limit
on the number of intervals.  Return the rounded upper and lower limits and the
increment.  Used for axis tick mark spacing.  Similar to CONSCL.
SUBROUTINE TRAN
Transpose (copy) part of a plane of the 3D array F into the 2D array FP.
SUBROUTINE ZERO
Zero a real number array.

DISSPLA

SUBROUTINE ADXPLT
Write additional text on the plot concerning Q header information (freestream
Mach number, angle-of-attack, etc.) and grid sizes by calling QHXPLT and
GRXPLT, respectively, for each grid.
SUBROUTINE ARRSCL
Set the arrowhead scaling (T or F) (specified via the VECTOR command).  Vector
attributes are stored in /DISVEC/, and are referenced in VECTO2 and VECTO3.
SUBROUTINE ARRSIZ
Set the arrowhead size factor (specified via the VECTOR command).  Vector
attributes are stored in /DISVEC/, and are referenced in VECTO2 and VECTO3.
SUBROUTINE ARRTYP
Set the arrowhead type (specified via the VECTOR command).  Vector
attributes are stored in /DISVEC/, and are referenced in VECTO2 and VECTO3.
SUBROUTINE AXES2D
Set the plot ranges in (x,y), viewpoint, and axis scaling.  Draw axes, tick
marks, and axis labels.  Call DISSPLA routines AREA2D and GRAF.
SUBROUTINE AXES3D
Set the plot ranges in (x,y,z), viewpoint, and axis scaling.  Draw axes, tick
marks, and axis labels.  Call DISSPLA routines AREA2D, VUANGL or VIEW, VOLM3D,
and GRAF3D.
SUBROUTINE AXISC2
Change relative scaling of axes.
SUBROUTINE AXISC3
Change relative scaling of axes.
SUBROUTINE AXITR2
Change relative translation (offset) of axes.
SUBROUTINE AXITR3
Change relative translation (offset) of axes.
BLOCK DATA BDISDE
Initialize the common block /DISDEV/.
BLOCK DATA BDISP
Initialize the common block /DISP/.
SUBROUTINE BGN2D
Initialize plotting device (INIPLT), put title and text on plot (TIXPLT), set
viewpoint and axis lengths, draw axes and axis labels for a 2D plot (AXES2D).
SUBROUTINE BGN2S
Same as BGN2D, but for a 2D function surface plot.
SUBROUTINE BGN3D
Initialize plotting device (INIPLT), put title and text on plot (TIXPLT), set
viewpoint and axis lengths, draw axes and axis labels for a 3D plot (AXES3D).
SUBROUTINE BGN3S
Same as BGN3D, but for a 3D function surface plot.
SUBROUTINE BGNCO2
Begin processing 2D contour lines.
SUBROUTINE BGNOBJ
Mark the start of a graphical object in a display list (not used in DISSPLA).
Reset some attributes.
SUBROUTINE CCBAR
Put a contour level color bar on the plot.  Calls CCMAP and CONCLR.  A known
bug is that due to roundoff, the last contour level may appear in white on the
color bar.
SUBROUTINE CCMAP
Establish a color map for contours, given a list of colors to be evenly
distributed between a minimum and maximum contour value.
SUBROUTINE CLINE2
Draw 2D contour lines.  For labels, this means calling DISSPLA contour
routines.  Otherwise, just call CONCLR and LINE2.
SUBROUTINE COLNAM
Change the current color based on the given index to one of the eight basic
colors.  These are BLACK, MAGENTA, RED, YELLOW, GREEN, CYAN, BLUE, and WHITE,
corresponding to the indices 1-8, respectively.  The index can also indicate
an RGB value which is handled by calling NAMRGB and COLRGB.  A bug is that
certain RGB-type integer values can be in the range 1-8, and also that an
index of zero is flagged as an error, but actually corresponds to an RGB value
of (0,0,0).  All this does not seem to be a problem, since most of the RGB
color changes are made through COLRGB, but yes, it should be cleaned up
sometime.
SUBROUTINE COLRGB
Set the current color to the specified RGB (red,green,blue) value (each
component can be in the range of 0 to 1).  DISSPLA uses hue, saturation, and
intensity for color specification, so we have to translate from RGB to HSI
(this is done by RGBHSI) and then call the DISSPLA routine HWHSI to set the
color.
SUBROUTINE COMDIS
Identify the DISSPLA plotting device as COMPRS, high resolution mode (to be
plotted using POP).  Output goes to a file "POPFIL.DAT".
SUBROUTINE CONCLR
Compute the RGB color corresponding to the given contour level, based on a
previous call to CCMAP.  Change the current color to that RGB value.
SUBROUTINE DICDIS
Identify the DISSPLA plotting device as DICOMD, the Dicomed film recorder,
producing a "file.D48".
SUBROUTINE DIPDIS
Identify the DISSPLA plotting device as DIP, producing a "file.DIP".  This
format is NASA Ames site-specific.
SUBROUTINE DONPLT
Totally done plotting; call the DISSPLA routine DONEPL to clean up any
graphics devices.
SUBROUTINE ENDCO2
End processing 2D contour line information.  For contour labels, call DISSPLA
contour routines to draw lines with labels.
SUBROUTINE ENDOBJ
Signal the end of a graphical object in a display list (not used in DISSPLA).
Reset some attributes.
SUBROUTINE ENDPLT
Finish up a plot: put on the frame and additional text (ADXPLT), and call the
DISSPLA routine ENDPL.
SUBROUTINE ENVDIS
Identify the plotting device as ENV230, an Envision 8-color terminal.
SUBROUTINE GRXPLT
Write a set of grid dimensions on the plot.  Called from ADXPLT.
SUBROUTINE HSIRGB
Convert (hue,saturation,intensity) color specification to RGB values.
SUBROUTINE INIPLT
Initialize the plotting device by calling PLTDEV, make some calls to DISSPLA
(SETDEV, GRACE, NOCHEK, RESET, and NOBRDR), set up the page by calling PAGE
and AREA2D, and set LDONEP=FALSE in /DISP/ to indicate that a graphics device
has been initialized and the DISSPLA routine DONEPL should be called before
exiting.
SUBROUTINE LINE2
Draw a 2D line through a series of points by calling the DISSPLA routine CURVE.
SUBROUTINE LINE3
Draw a 3D line through a series of points by calling the DISSPLA routine
CURV3D.
SUBROUTINE LINSTY
Change the current linestyle by calling one of the DISSPLA routines DASH, DOT,
CHNDSH, CHNDOT, or RESET.
SUBROUTINE LN0DIS
Identify the plotting device as a DEC LN01S (or LN03 Plus) printer.  Output
goes to a file "INTSCRT1.TMP".
SUBROUTINE LINWID
Change the current linewidth by calling the DISSPLA routine THKCRV.
SUBROUTINE MYCON
DISSPLA-called routine to set contour line attributes, instead of using CONLIN
in the normal fashion.
SUBROUTINE NAMRGB
Decode a color index into RGB values.  If the index is between 1 and 8, it is
an index into the eight standard colors (black, magenta, red, yellow, green,
cyan, blue, white).  Otherwise, consider the decimal representation of the
index to be rrrgggbbb0, where rrr/100. is the red value between 0 and 1.
These index representations of an RGB value come from retrofitting RGB into
the attribute lists (for walls and subsets) that used to only use 8 colors.
The attributes really should list the full RGB values.
SUBROUTINE PLTDEV
Called from INIPLT to initialize the selected plotting device.  Calls TEKDIS,
DIPDIS, QMSDIS, VERDIS, ENVDIS, DICDIS, COMDIS, or TK4DIS, based on the device
number IDEVIC.
SUBROUTINE POINT2
Make a 2D point at the given coordinates.  DISSPLA routine RLVEC is used for a
dot, CURVE for a symbol.  DISSPLA Version 9.2 may not make dots by any known
combination of calls...
SUBROUTINE POINT3
Make a 3D point at the given coordinates.  DISSPLA routine RLVEC3 is used for
a dot, CURV3D for a symbol.  DISSPLA Version 9.2 may not make dots by any
known combination of calls...
SUBROUTINE POLFIL
Set the polygon fill pattern by calling the DISSPLA routine SHDPAT.  Note that
SHDPAT works only for 2D plots; DISSPLA has no provision for 3D polygons.
SUBROUTINE POLSUR
Set the polygon surface properties.  Not used in DISSPLA.
SUBROUTINE POLY2
Draw a 2D polygon.  Implemented by calling CURVE, so I don't think shading
patterns will have any effect.
SUBROUTINE POLY3
Outline a 3D polygon by calling CURV3D.  Note that DISSPLA has no provisions
for filing or shading 3D polygons.
SUBROUTINE QHXPLT
Write a set of Q header information on the plot.  Called from ADXPLT.
SUBROUTINE QMSDIS
Identify the DISSPLA plotting device as a QMS Lasergrafix 1200 printer,
generating a "file.QMS".
SUBROUTINE RGBHSI
Convert RGB color values to (hue,saturation,intensity) color values.
SUBROUTINE SYMSIZ
Set the current symbol size by calling the DISSPLA routine SCLPIC.
SUBROUTINE SYMTYP
Set the current symbol (or marker) type by calling DISSPLA routine MARKER.
SUBROUTINE TEKDIS
Identify the DISSPLA plotting device as TK4014, a Tektronix 4014 or compatible
terminal.
SUBROUTINE TIXPLT
Print the title and up to two lines of additional text as the plot heading by
calling the DISSPLA routine HEADIN.  The additional text comes from the TEXT
command.
SUBROUTINE TK4DIS
Identify the DISSPLA plotting device as TK41(4105), a Tektronix 4105 terminal.
SUBROUTINE VECLEN
Set the vector length scale factor (specified via the VECTOR command).  Vector
attributes are stored in /DISVEC/, and are referenced in VECTO2 and VECTO3.
SUBROUTINE VECSCL
Set the vector scaling (T or F) (specified via the VECTOR command).  Vector
attributes are stored in /DISVEC/, and are referenced in VECTO2 and VECTO3.
SUBROUTINE VECTO2
Draw a 2D vector, with or without arrowhead, by calling the DISSPLA routine
RLVEC.
SUBROUTINE VECTO3
Draw a 3D vector, with or without arrowhead, by calling the DISSPLA routine
RLVEC3.
SUBROUTINE VERDIS
Identify the DISSPLA plotting device as a Versatec, producing a file which can
be plotted on a Versatec printer connected to a VAX.
SUBROUTINE VIEWPT
Store 3D viewpoint based on given (x,y,z) or (phi,theta,radius) eye position.
This will be looking at the center of the MINMAX box.  Viewpoint is actually
set in AXES3D.

IRIS2

SUBROUTINE ADXPLT
Write additional text on the plot concerning Q header information (freestream
Mach number, angle-of-attack, etc.) and grid sizes by calling QHXPLT and
GRXPLT, respectively, for each grid.
SUBROUTINE ARRSCL
Set the arrowhead scaling (T or F) (specified via the VECTOR command).  Vector
attributes are stored in /IRSVEC/, and are referenced in VECTO2 and VECTO3.
SUBROUTINE ARRSIZ
Set the arrowhead size factor (specified via the VECTOR command).  Vector
attributes are stored in /IRSVEC/, and are referenced in VECTO2 and VECTO3.
SUBROUTINE ARRTYP
Set the arrowhead type (specified via the VECTOR command).  Vector
attributes are stored in /IRSVEC/, and are referenced in VECTO2 and VECTO3.
SUBROUTINE ATTWIX
Attach input focus to the indicated graphics port and make it current.
SUBROUTINE AXES2D
Set the plot ranges in (x,y), viewpoint, and axis scaling.  Draw axes, tick
marks, and axis labels.
SUBROUTINE AXES3D
Set the plot ranges in (x,y,z), viewpoint, light source, and axis scaling.
Draw axes, tick marks, and axis labels.
SUBROUTINE AXISC2
Change relative scaling of axes.
SUBROUTINE AXISC3
Change relative scaling of axes.
SUBROUTINE AXITR2
Change relative translation (offset) of axes.
SUBROUTINE AXITR3
Change relative translation (offset) of axes.
BLOCK DATA BDISP
Initialize the common block /DISP/.
SUBROUTINE BGN2D
Initialize plotting device (INIPLT), put title and text on plot (TIXPLT), set
viewpoint and axis lengths, draw axes and axis labels for a 2D plot (AXES2D).
SUBROUTINE BGN2S
Same as BGN2D, but for a 2D function surface plot.
SUBROUTINE BGN3D
Initialize plotting device (INIPLT), put title and text on plot (TIXPLT), set
viewpoint and axis lengths, draw axes and axis labels for a 3D plot (AXES3D).
SUBROUTINE BGN3S
Same as BGN3D, but for a 3D function surface plot.
SUBROUTINE BGNCO2
Begin processing 2D contour line information.  Does nothing on IRIS.
SUBROUTINE BGNOBJ
Mark the start of a graphical object in a display list by calling the IRIS
routines GENOBJ and MAKEOB.  The object is identified by name in the call to
BGNOBJ, but currently this name is not used.  Reset some attributes.
BLOCK DATA BIRSMS
Initialize the common block /IRSMSE/.
BLOCK DATA BIRSOB
Initialize the common block /IRSOBJ/.
BLOCK DATA BIRSTX
Initialize the common block /IRSTXT/.
SUBROUTINE CCBAR
Put a contour level color bar on the plot.  Calls CCMAP and CONCLR.  A known
bug is that due to roundoff, the last contour level may appear in white on the
color bar.
SUBROUTINE CCMAP
Establish a color map for contours, given a list of colors to be evenly
distributed between a minimum and maximum contour value.
SUBROUTINE CLINE2
Draw a 2D contour line by calling CONCLR and LINE2.
SUBROUTINE CLNOBJ
Call IRIS routine DELOBJ to delete all graphical objects from IRIS display
list memory.  Called from ENDPLT at the end of viewing every plot.
SUBROUTINE CLOWIX
Close the indicated graphics port and attach to the next "youngest" port.
SUBROUTINE COLNAM
Change the current color based on the given index to one of the eight basic
colors.  These are BLACK, MAGENTA, RED, YELLOW, GREEN, CYAN, BLUE, and WHITE,
corresponding to the indices 1-8, respectively.  The index can also indicate
an RGB value which is handled by calling NAMRGB and COLRGB.  A bug is that
certain RGB-type integer values can be in the range 1-8, and also that an
index of zero is flagged as an error, but actually corresponds to an RGB value
of (0,0,0).  All this does not seem to be a problem, since most of the RGB
color changes are made through COLRGB, but yes, it should be cleaned up
sometime.
SUBROUTINE COLRGB
Set the current color to the specified RGB (red,green,blue) value (each
component can be in the range of 0 to 1).  Call the IRIS routine COLOR to set
the color.
INTEGER FUNCTION COLTBL
Given RGB values, return the corresponding IRIS color map index for an
appropriate color.  TABLE (in /IRSCTB/) was set up by INICTB and TBLxx,
depending on the number of available bit planes (and whether we're in single
or double buffer mode).
SUBROUTINE CONCLR
Compute the RGB color corresponding to the given contour level, based on a
previous call to CCMAP.  Change the current color to that RGB value.
SUBROUTINE CTROID
Calculate a centroid (or average center) for this polygon.  This is done by
averaging the vertices.  Used as a reference point to compute shading.  Called
from POLY3.
SUBROUTINE CTRSCR
Get qualifiers and arguments for Script CENTER command, used to move the
center of a picture.
SUBROUTINE CURWIX
Make this graphics window "current", meaning that further graphics commands go
to this window.
SUBROUTINE DMPQMS
C routine to read the screen image and save it in form printable on the QMS
Lasergrafix 1200 printer.
SUBROUTINE DONPLT
Totally done plotting; call ENDWIX to close all graphics windows, clear the
screen, and call GEXIT if feasible.
SUBROUTINE ENDCO2
End processing of 2D contour line information.  Does nothing on IRIS.
SUBROUTINE ENDOBJ
Signal the end of a graphical object in a display list (call IRIS routine
CLOSEO).  Reset some attributes.
SUBROUTINE ENDPLT
End the definition of a plot (call ADXPLT) and either call PLTSCR to read and
process Script commands (see Help library under PLOT) or call PLTINT to enable
the mouse and keyboard for interactive plot manipulation.
SUBROUTINE ENDQUE
Call IRIS routine UNQBUT to unqueue mouse buttons and selected keyboard
buttons.
SUBROUTINE ENDWIX
Clean up all graphics windows and terminate graphics mode.  Call GEXIT if
feasible.
SUBROUTINE EXEDL
Execute the display list: clear the screen, call the objects, swap buffers (if
in double buffered mode), and call IRIS routine GFLUSH to make sure everything
is sent through.  The plotting transformation has been set up ahead of time by
calling UPDPXF.  A known bug is that with axes, the plot title comes out
underneath the graphical stuff on the screen, and can thus be obscured.
SUBROUTINE EXEQUE
If the event queue of button pushes is empty and no mouse buttons are depressed
when we enter this routine, wait for an event (button press) to be entered in
the queue.  If there ARE mouse buttons depressed, just check the queue,
processing the entries already there.  If mouse buttons are depressed, check
the (x,y) mouse location and change the viewing transformation numbers;
<RETURN> means quit looking at the plot, "P" key means dump the screen image
to a .PXL file, "Q" key means dump it to a .QMS file (by calling QMSDMP) for
printing on the QMS Lasergrafix 1200.  Up and down arrow keys change the zoom
and drag mouse effectiveness.  "3" key changes to 30Hz mode, "6" to 60Hz, and
"N" to RS170 (NTSC compatible) (though the viewport has not been reduced, as
it needs to be).  "Z" key means toggle z-buffering on and off.  Handle queued
devices "INPUTCHANGE" and "REDRAW" to baby the MEX window manager through.
Redraw the screen and go back for more input, until we get a <RETURN>.
SUBROUTINE FBCHAR
Return the printable ASCII character corresponding to a font memory address
generated from IRIS feedback mode.  Translation is based on a table generated
by FBCHTB.  Called from PSDRW.
SUBROUTINE FBCHTB
Generate a translation table from ASCII printable character to font memory
address for the default character font.  Called the first time through PSDRW.
SUBROUTINE FBSYMB
Return a symbol number and size given IRIS feedback buffer data.  Called from
PSDRW.
INTEGER FUNCTION GETWIX
Return the currently active graphics port.
INTEGER FUNCTION GIDWIX
Convert a graphics window index into a graphics window ID (inverse function of
INQWIX).
SUBROUTINE GOSC1
Move smoothly from the current position to the new position in n frames.
Called from GOSCR.
SUBROUTINE GOSC2
Move to the new position.  Called from GOSCR.
SUBROUTINE GOSCR
Get qualifiers and arguments for Script GO command.  Call GOSC1 and/or GOSC2
to change the viewing transformation and display frames.
SUBROUTINE GRXPLT
Write a set of grid dimensions on the plot.  Called from ADXPLT.
SUBROUTINE HEADIN
Accumulate text strings to be centered at the top of the plot.  Write the text
on the last call by calling MESSAG.  Simulates action of the DISSPLA routine
HEADIN.
SUBROUTINE HLDSCR
Get qualifiers and arguments for Script HOLD command.  Call GOSC2 if necessary
to set a new viewpoint, then call UPDPXF and EXEDL to display the current
frame n times.
SUBROUTINE INICTB
Initialize the color map for the IRIS based on the number of available bit
planes by calling TBLxx.
SUBROUTINE INILIN
Initialize line styles.  Called by IRIS.
SUBROUTINE INIPAT
Initialize polygon fill patterns, used for transparency.  Called by IRIS.
SUBROUTINE INIPLT
Initialize the plotting device by calling PLTDEV and set LDONEP=FALSE in
/DISP/ to indicate that a graphics device has been initialized and the IRIS
routine GEXIT should be called before exiting.
SUBROUTINE INIPXF
Initialize the plot coordinate system transformation matrix.  Save the near
and far clipping planes and the field-of-view in /IRSXFM/.
SUBROUTINE INITXF
Initialize and save the text coordinate transfomation matrix.  Simply map the
current viewport into an 11"x8.5" page.  Save the matrix in /IRSXFM/.
SUBROUTINE INIQUE
Reset (flush) the event queue and initialize queued devices such as mouse
buttons.
SUBROUTINE INISCR
Initialize the common block /SCRI/ used to store the current and target
viewpoint and center for Script commands.
SUBROUTINE INISYM
Initialize raster fonts for symbols.  Called by IRIS.
SUBROUTINE INIWIX
Initialize the list of graphics ports, and graphics in general.
FUNCTION INQWIX
Return the graphics port index corresponding to the given graphics port ID
(inverse function of GIDWIX).
SUBROUTINE INTNO
Format and write out an integer number at the given plot location.  Simulates
action of the DISSPLA routine INTNO.
SUBROUTINE IRIS
Initialize the IRIS for plotting.  Use INIWIX and OPEWIX to initialize graphics
and open a window.  Call INILIN, INIPAT, and INISYM once to initialize line
styles, texture patterns, and raster symbols.  Call INICTB to initialize the
color map and table.  If double buffered, enable the front buffer so we can see
objects as they are created.  Clear the screen.
SUBROUTINE LINE2
Draw a 2D line through a series of points by calling the IRIS routines MOVE2
and DRAW2.  Call RESETL and LSBACK so that linestyle backup is off except for
the last line segment, so that the endpoint is drawn.  A bug is that if a
nonsolid linestyle is used and the line thickness is 2 or greater, the dashes
get messed up.  A not totally satisfactory fix is to set linestyle backup to
TRUE for all points in this case.
SUBROUTINE LINE3
Draw a 3D line through a series of points by calling the IRIS routines MOVE
and DRAW.  Call RESETL and LSBACK so that linestyle backup is off except for
the last line segment, so that the endpoint is drawn.  A bug is that if a
nonsolid linestyle is used and the line thickness is 2 or greater, the dashes
get messed up.  A not totally satisfactory fix is to set linestyle backup to
TRUE for all points in this case.
SUBROUTINE LINSTY
Set the current linestyle by calling the IRIS routine SETLIN.
SUBROUTINE LINWID
Set the current line width.  Only widths of 1 or 2 are available for IRIS
Graphics Library GL1 (1xxx series terminals and workstations).
SUBROUTINE MESSAG
Put a text string on the screen starting at the given (x,y) location.  It is
assumed that the current transformation matrix is 2D orthographic.  ADXPLT,
CCBAR, and TIXPLT, which either call MESSAG or call routins which call MESSAG,
push the current transformation matrix and call ORTHO2 to set the screen up as
an 11x8.5 unit plot, so that coordinates passed to MESSAG refer to
(pseudo-)inches, measured from the lower left corner.  These routines pop the
transformation matrix stack before returning.
SUBROUTINE MODWIX
Change the display mode for all graphics windows.  When running under the
window manager with more than one window, this has some problems, as noted in
warning messages in the routine.
SUBROUTINE NAMRGB
Decode a color index into RGB values.  If the index is between 1 and 8, it is
an index into the eight standard colors (black, magenta, red, yellow, green,
cyan, blue, white).  Otherwise, consider the decimal representation of the
index to be rrrgggbbb0, where rrr/100. is the red value between 0 and 1.
These index representations of an RGB value come from retrofitting RGB into
the attribute lists (for walls and subsets) that used to only use 8 colors.
The attributes really should list the full RGB values.
FUNCTION NXTWIX
Return the next "youngest" graphics port index.
SUBROUTINE OPEWIX
Open a graphics window.
SUBROUTINE PGMWIX
Attach input focus (keyboard and mouse) back to the program (text window,
whatever).  Can't really do this under W3.5-GL2--attaching to the console is
the best we can (and will) do.
SUBROUTINE PLTDEV
Called from INIPLT to initialize the selected plotting device.  In this case,
it always calls IRIS, indicating the selection of /IRIS (double buffered),
/IRISRGB (RGB mode), or /IRISSINGLE (single buffered) on the PLOT command.
SUBROUTINE PLTINT
Interactive manipulation of the display, called from ENDPLT or PLTSCR.
Attach input focus to this window, initialize the mouse and keyboard buttons
by calling INIQUE, ring the bell to signal that we're ready, and loop
through executing the display list (calling EXEDL), looking at the event
(button) queue (calling EXEQUE), and setting a new plotting transformation
(calling UPDPXF).  Attach input focus back to the program and unqueue the
mouse and keyboard buttons before returning.
SUBROUTINE PLTSCR
Read and process Script commands for manipulating the graphics image.  Set the
prompt string to "PLOT3D SCRIPT: ", call INISCR to initialize the script
common block, and loop through calling COMMAN to read and parse (Script)
commands and call VPTSCR, CTRSCR, GOSCR, HLDSCR, or PLTINT to do the
appropriate action.  Pop the command prompt string stack before returning, so
the command prompt string will revert back to what it was before.
SUBROUTINE POINT2
Make a 2D point at the given coordinates by calling the IRIS routine PNT2.
Symbols have not been implemented yet, or this would plot the current symbol
at this point.
SUBROUTINE POINT3
Make a 3D point at the given coordinates by calling the IRIS routine PNT.
Symbols have not been implemented yet, or this would plot the current symbol
at this point.
SUBROUTINE POLFIL
Set the current polygon fill pattern.  Not implemented; different polygon fill
patterns are used to simulate different levels of transparency.
SUBROUTINE POLSUR
Set the polygon surface attributes transparency, material, and shine.  Only
transparency is used, and has a value between 0 (opaque) and 1 (totally
transparent).  Transparency is simulated using different polygon fill patterns
to let some of the previously drawn objects be seen.
SUBROUTINE POLY2
Draw a 2D polygon (filled with the current fill pattern) by calling the IRIS
routine POLF2.
SUBROUTINE POLY3
Draw a 3D shaded polygon by calling CTROID and NRMVEC to find a reference
point and normal vector for the polygon, then calling PSHADE to set the
current color based on the light source, viewpoint, polygon position and
normal vector, and the full intensity color.  The polygon is drawn (filled
with the current fill pattern) by calling the IRIS routine POLF2.
SUBROUTINE PSDMP
Dump the graphics window to PostScript file.  Note that a shaded image can tie
up the printer for hours.
SUBROUTINE PSDRW
Make a PostScript file of the current graphics window by putting the IRIS into
feedback mode and translating the feedback buffer into PostScript commands, one
object at a time (so the buffer doesn't have to be too big).
SUBROUTINE PSHADE
Set the color for a 3D shaded polygon, given the center and normal vector for
the polygon, and the base (full intensity) color.  The color is based on the
light source direction and the viewpoint, and uses linear interpolation for
the intensity.  The intensity varies from 1 to 0.3 as the cosine of the angle
between the light source and the polygon normal goes from 1 to 0.  The
intensity varies from .3 to .1 as the cosine goes from 0 to -1.  Note that
cosines less than zero occur only when the light source is on the opposite
side of the polygon from the (initial) viewpoint.  In PLOT3D, AXES3D sets the
light source to the initial viewpoint, so this will never happen.  PSHADE is
called from POLY3.
SUBROUTINE PTRDAI
Convert (DISSPLA convention) spherical coordinates (phi,theta,radius) to IRIS
convention of (distance,azimuth,incidence).  The origin for both systems is at
the center of the MINMAX box.
SUBROUTINE PTRXYZ
Convert (phi,theta,radius) viewpoint and center to (x,y,z).
SUBROUTINE QHXPLT
Write a set of Q header information on the plot.  Called from ADXPLT.
SUBROUTINE QMSDMP
Call C routine DUMPQM to save the screen image into a .QMS file.
SUBROUTINE RASDMP
Dump the IRIS screen to a file (file.RAS).  Additional frames are appended to
the file, even in a separate run of PLOT3D.  Raster data is run-length-encoded,
which means the files produced should not be very big!  These files can be read
and redisplayed with the ARCGraph utility RASTER, or some as-yet unwritten
PLOT3D utility.
SUBROUTINE RDRWIX
Redraw the specified graphics port.
SUBROUTINE REALNO
Format and write out a real number at the given plot location.  Simulates
action of the DISSPLA routine REALNO.
SUBROUTINE SCRDMP
Call C routine SCRSAV to dump the screen to a file suitable for printing on a
Seiko color printer.
SUBROUTINE SCRSAVE
This is a fixed-up version of the SCRSAVE routine supplied by Silicon Graphics
under W3.5-GL2, in /usr/people/gifts/mextools/imglib/libimage.a.  It generates
a screen dump file suitable for printing on a Seiko color printer.  Called from
SCRDMP.
SUBROUTINE SETNF
Set values for the near and far clipping planes, either zero and "very big",
or based on the MINMAX box.  Used for z-buffering.  Because of a W2.3-GL2 bug,
be sure that the near clipping plane doesn't get closer to zero than epsilon.
SUBROUTINE SETVPO
Set the graphics viewport and aspect ratio.  IRIS call RESHAP screws up if
we're not running under the window manager.  Save the aspect ratio in /IRSXFM/.
SUBROUTINE SYMSIZ
Set the size of marker symbols by calling FONT.
SUBROUTINE SYMTYP
Set the current symbol type.
SUBROUTINE TBL10
Initialize the color table and IRIS color map for 10 bit planes.  Called from
INICTB.
SUBROUTINE TBL12
Initialize the color table and IRIS color map for 12 bit planes.  Called from
INICTB.
SUBROUTINE TBL2
Initialize the color table and IRIS color map for 2 bit planes.  Called from
INICTB.
SUBROUTINE TBL4
Initialize the color table and IRIS color map for 4 bit planes.  Called from
INICTB.
SUBROUTINE TBL6
Initialize the color table and IRIS color map for 6 bit planes.  Called from
INICTB.
SUBROUTINE TBL8
Initialize the color table and IRIS color map for 8 bit planes.  Called from
INICTB.
SUBROUTINE TIXPLT
Print the title and up to two lines of additional text as the plot heading by
calling HEADIN.  The additional text comes from the TEXT command.
SUBROUTINE UPDPXF
Update the plot coordinate transformation matrix with the viewing and
modelling transformations.
SUBROUTINE VECLEN
Set the vector length scale factor (specified via the VECTOR command).  Vector
attributes are stored in /IRSVEC/, and are referenced in VECTO2 and VECTO3.
SUBROUTINE VECSCL
Set the vector scaling (T or F) (specified via the VECTOR command).  Vector
attributes are stored in /IRSVEC/, and are referenced in VECTO2 and VECTO3.
SUBROUTINE VECTO2
Draw a 2D vector, with or without arrowhead by calling IRIS routines MOVE2,
DRAW2, and/or POLF2.
SUBROUTINE VECTO3
Draw a 3D vector, with or without arrowhead by calling IRIS routines MOVE,
DRAW, and/or POLF.
SUBROUTINE VIEWPT
Set initial 3D viewpoint based on given (x,y,z) or (phi,theta,radius) eye
position.  This will be looking at the center of the MINMAX box.
SUBROUTINE VPTSCR
Get qualifiers and arguments for Script VPOINT command, used to move the 3D
viewpoint.
SUBROUTINE XYZDAI
Convert an (x,y,z) viewpoint and center to the IRIS convention of
(distance,azimuth,incidence).
SUBROUTINE XYZPTR
Convert an (x,y,z) viewpoint and center to the DISSPLA convention of
(phi,theta,radius).
SUBROUTINE ZBFTGL
Toggle z-buffering on and off.  Change to and from single buffer mode.  EXEDL
does most of the actual z-buffer calls (SETDEP,ZBUFFE,ZCLEAR).

GRAFIX

SUBROUTINE ADXPLT
Write additional text on the plot concerning Q header information (freestream
Mach number, angle-of-attack, etc.) and grid sizes.  Does nothing in GRAFIX.
SUBROUTINE ARRSCL
Set the arrowhead scaling (T or F) (specified via the VECTOR command).  Vector
attributes are stored in /GRAVEC/, and are referenced in VECTO2 and VECTO3.
SUBROUTINE ARRSIZ
Set the arrowhead size factor (specified via the VECTOR command).  Vector
attributes are stored in /GRAVEC/, and are referenced in VECTO2 and VECTO3.
SUBROUTINE ARRTYP
Set the arrowhead type (specified via the VECTOR command).  Vector
attributes are stored in /GRAVEC/, and are referenced in VECTO2 and VECTO3.
SUBROUTINE AXES2D
Set the plot ranges in (x,y), viewpoint, and axis scaling.  Draw axes, tick
marks, and axis labels.
SUBROUTINE AXES3D
Set the plot ranges in (x,y,z), viewpoint, light source, and axis scaling.
Draw axes, tick marks, and axis labels.
SUBROUTINE AXISC2
Change relative scaling of axes.
SUBROUTINE AXISC3
Change relative scaling of axes.
SUBROUTINE AXITR2
Change relative translation (offset) of axes.
SUBROUTINE AXITR3
Change relative translation (offset) of axes.
BLOCK DATA BDISP
Initialize the common block /DISP/.
SUBROUTINE BGN2D
Initialize plotting device (INIPLT), put title and text on plot (TIXPLT), set
viewpoint and axis lengths, draw axes and axis labels for a 2D plot (AXES2D).
SUBROUTINE BGN2S
Same as BGN2D, but for a 2D function surface plot.
SUBROUTINE BGN3D
Initialize plotting device (INIPLT), put title and text on plot (TIXPLT), set
viewpoint and axis lengths, draw axes and axis labels for a 3D plot (AXES3D).
SUBROUTINE BGN3S
Same as BGN3D, but for a 3D function surface plot.
SUBROUTINE BGNCO2
Begin processing 2D contour line information.  Does nothing in GRAFIX.
SUBROUTINE BGNOBJ
Mark the start of a graphical object in a display list (not used in GRAFIX).
Reset some attributes.
SUBROUTINE CCBAR
Put a contour level color bar on the plot.  Calls CCMAP and CONCLR.  A known
bug is that due to roundoff, the last contour level may appear in white on the
color bar.
SUBROUTINE CCMAP
Establish a color map for contours, given a list of colors to be evenly
distributed between a minimum and maximum contour value.
SUBROUTINE CLINE2
Draw a 2D contour line by calling CONCLR and LINE2.
SUBROUTINE COLNAM
Change the current color based on the given index to one of the eight basic
colors.  These are BLACK, MAGENTA, RED, YELLOW, GREEN, CYAN, BLUE, and WHITE,
corresponding to the indices 1-8, respectively.  The index can also indicate
an RGB value which is handled by calling NAMRGB and COLRGB.  A bug is that
certain RGB-type integer values can be in the range 1-8, and also that an
index of zero is flagged as an error, but actually corresponds to an RGB value
of (0,0,0).  All this does not seem to be a problem, since most of the RGB
color changes are made through COLRGB, but yes, it should be cleaned up
sometime.
SUBROUTINE COLRGB
Set the current color to the specified RGB (red,green,blue) value (each
component can be in the range of 0 to 1).  Call the GRAFIX routines RGBPLO,
RGBVEC, and RGBPOL to set the color for anything we might draw.
SUBROUTINE CONCLR
Compute the RGB color corresponding to the given contour level, based on a
previous call to CCMAP.  Change the current color to that RGB value.
SUBROUTINE CTROID
Calculate a centroid (or average center) for this polygon.  This is done by
averaging the vertices.  Used as a reference point to compute shading.  Called
from POLY3.
SUBROUTINE DONPLT
Totally done plotting; call the GRAFIX routines CLOGRA and ENDGRA to clean up
the .GRA file.
SUBROUTINE ENDCO2
End processing of 2D contour line information.  Does nothing in GRAFIX.
SUBROUTINE ENDOBJ
Signal the end of a graphical object in a display list (not used in GRAFIX).
Reset some attributes.
SUBROUTINE ENDPLT
Finish up a plot, calling ADXPLT.  The frame marker is put at the beginning of
the next frame (in subroutine GRAFIX), rather than here.
SUBROUTINE GRAFIX
If we haven't made any previous plots, initialize GRAFIX by calling INIGRA and
OPEGRA to open a .GRA file.  Otherwise, call FRAGRA to put a frame marker in
the file.
SUBROUTINE INIPLT
Initialize the plotting device by calling PLTDEV and set LDONEP=FALSE in
/DISP/ to indicate that a graphics device has been initialized.
SUBROUTINE LINE2
Draw a 2D line through a series of points by calling the GRAFIX routines
MOVE3D and DRAW3D, with z=0.
SUBROUTINE LINE3
Draw a 3D line through a series of points by calling the GRAFIX routines
MOVE3D and DRAW3D.
SUBROUTINE LINSTY
Change the current linestyle by calling one of the GRAFIX routines DASON3 or
DASOF3.
SUBROUTINE LINWID
Change the current linewidth.  Not implemented in GRAFIX.
SUBROUTINE NAMRGB
Decode a color index into RGB values.  If the index is between 1 and 8, it is
an index into the eight standard colors (black, magenta, red, yellow, green,
cyan, blue, white).  Otherwise, consider the decimal representation of the
index to be rrrgggbbb0, where rrr/100. is the red value between 0 and 1.
These index representations of an RGB value come from retrofitting RGB into
the attribute lists (for walls and subsets) that used to only use 8 colors.
The attributes really should list the full RGB values.
SUBROUTINE PLTDEV
Initialize the plotting device by calling GRAFIX.
SUBROUTINE POINT2
Make a 2D point at the given coordinates by calling GRAFIX routine POIN3D with
z=0.
SUBROUTINE POINT3
Make a 3D point at the given coordinates by calling GRAFIX routine POIN3D.
SUBROUTINE POLFIL
Set the polygon fill pattern.  Not implemented in GRAFIX.
SUBROUTINE POLSUR
Set the polygon surface properties.  Only transparency is implemented (and
then only for rendered pictures) in GRAFIX.
SUBROUTINE POLY2
Draw a 2D polygon by calling GRAFIX routines PPOINT and PPOLY with z=0.
SUBROUTINE POLY3
Draw a 3D polygon by calling GRAFIX routines PPOINT and PPOLY.
SUBROUTINE PSHADE
Set the color for a 3D shaded polygon, given the center and normal vector for
the polygon, and the base (full intensity) color.  The color is based on the
light source direction and the viewpoint, and uses linear interpolation for
the intensity.  The intensity varies from 1 to 0.3 as the cosine of the angle
between the light source and the polygon normal goes from 1 to 0.  The
intensity varies from .3 to .1 as the cosine goes from 0 to -1.  Note that
cosines less than zero occur only when the light source is on the opposite
side of the polygon from the (initial) viewpoint.  In PLOT3D, AXES3D sets the
light source to the initial viewpoint, so this will never happen.  PSHADE is
called from POLY3.
SUBROUTINE PTRXYZ
Convert (phi,theta,radius) viewpoint and center to (x,y,z).
SUBROUTINE SYMSIZ
Set the size of marker symbols.  Not implemented in GRAFIX.
SUBROUTINE SYMTYP
Set the marker symbol type.  Not implemented in GRAFIX.
SUBROUTINE TIXPLT
Print title and text on plot.  Not implemented in GRAFIX.
SUBROUTINE VECLEN
Set the vector length scale factor (specified via the VECTOR command).  Vector
attributes are stored in /GRAVEC/, and are referenced in VECTO2 and VECTO3.
SUBROUTINE VECSCL
Set the vector scaling (T or F) (specified via the VECTOR command).  Vector
attributes are stored in /GRAVEC/, and are referenced in VECTO2 and VECTO3.
SUBROUTINE VECTO2
Draw a 2D vector, with or without arrowhead by calling GRAFIX routines MOVE3D,
DRAW3D, and/or PPOINT, and PPOLY, with z=0.
SUBROUTINE VECTO3
Draw a 3D vector, with or without arrowhead by calling GRAFIX routines MOVE3D,
DRAW3D, and/or PPOINT, and PPOLY.
SUBROUTINE VIEWPT
Set initial 3D viewpoint based on given (x,y,z) or (phi,theta,radius) eye
position.  This will be looking at the center of the MINMAX box.

VMS

BLOCK DATA BCHPK
Initialize common block /CHPK/ with NCHPWD=4, the number of characters per
(integer) word.
SUBROUTINE CHPACK
Pack a certain number of characters from a character string into an array of
integers.  Common block /CHPK/ supplies the number of characters per (integer)
word.
SUBROUTINE CHUNPK
Unpack a certain number of characters from an integer array into a character
string.  Common block /CHPK/ supplies the number of characters per (integer)
word.
SUBROUTINE FILNAM
Doctor up a given filename based on a supplied file type (.xxx) and whether
the file is new or old.  If the file is old, only use the supplied file type
if the filename doesn't have one yet.  If the file is new, strip off any
directory name and file type, and put on the new file type.  Filenames
SYS$INPUT and SYS$OUTPUT are special and should not be changed.
SUBROUTINE FREARR
Free space in memory previously allocated with GETARR.  Calls VAX/VMS
LIB$FREE_VM.
SUBROUTINE FRELUN
Call VAX/VMS Run-Time Library routine LIB$FREE_LUN to free a FORTRAN logical
unit number gotten from GETLUN.
SUBROUTINE GETARR
Return an index into an array representing the starting location for the
requested amount of space in memory (e.g., ARRAY(INDEX) is the first element of
a scratch array of length LENGTH).  Calls VAX/VMS LIB$GET_VM.
SUBROUTINE GETLUN
Call VAX/VMS Run-Time Library routine LIB$GET_LUN to get a unique FORTRAN
logical unit number.
LOGICAL FUNCTION INTERA
Determine whether this logical device is interactive (connected to a terminal)
or not.  Use VAX/VMS Run-Time Library routine LIB$SYS$TRNLOG to translate the
logical device to a physical device name.
SUBROUTINE KBDATT
Enable ^C keyboard attention interrupts.  This is a one-shot deal, good for
one interrupt per call.  It is therefore reset in TRPATT, the attention
interrupt trap routine.  Uses the VAX/VMS Run-Time Library and other VMS
system utilities.  Because of FORTRAN I/O, if a ^C is typed when waiting to
read input from the terminal, an infinite loop will result.
SUBROUTINE RETATT
Return keboard attention interrupt handling to VMS.
CHARACTER*80 FUNCTION STDDEV
Return the name of the standard input or output device (as in "SYS$INPUT" or
"SYS$OUTPUT"), depending on which we ask for.
SUBROUTINE SYSCOM
If a VAX/VMS command is supplied, execute it as a system command and return.
If no command is given, send the user to the system for awhile, to return when
he is through.  See comments in this routine for specific implementation
details.
SUBROUTINE SYSERR
Condition handler for run-time errors (divide by zero, file not found, etc.)
We want (1) to get the normal system message concerning the error, and (2) to
return to the routine that established this as the condition handler, at the
point where the offending routine (or its caller...) was called.  Routine
PLOT3D uses the VAX/VMS Run-Time Library routine LIB$ESTABLISH to establish
SYSERR as the condition handler.
SUBROUTINE TRNSYM
Use the VAX/VMS Run-Time Library routine LIB$GET_SYMBOL to translate a given
character string using the VMS symbol table.  (One defines symbols in VMS by
typing "$symbol-name:==replacement string".)
SUBROUTINE TRPATT
Keyboard attention interrupt trap.  When a ^C is typed at the terminal, PLOT3D
jumps to this routine to rearm the trap by calling KBDATT, reset the input
file stack by calling RSTINP, and call the VAX/VMS Run-Time Library routine
LIB$SIGNAL to unwind the call stack and return to PLOT3D.

UNIX

BLOCK DATA BCHPK
Initialize common block /CHPK/ with NCHPWD=4, the number of characters per
(integer) word.
INTEGER FUNCTION CAND
Bitwise and of two integers.
SUBROUTINE CCLOSE
C routine to close a file opened by COPENC or CSCRAT.  Calls Unix FCLOSE(3S).
INTEGER FUNCTION CCOMPL
Bitwise complement of an integer.
SUBROUTINE CFILE
"Unit numbers" for C I/O for different files must be unique, but have nothing
to do with FORTRAN unit numbers.  They are used for convenience in the FORTRAN
environment.  This C routine "translates" between the given unit number and
the (index to the) C file descriptor pointer.
SUBROUTINE CGETEC
FORTRAN/C interface for calling Unix GETENV(3C).
SUBROUTINE CGETEN
FORTRAN call for Unix GETENV(3C).
SUBROUTINE CHPACK
Pack a certain number of characters from a character string into an array of
integers.  Common block /CHPK/ supplies the number of characters per (integer)
word.
SUBROUTINE CHUNPK
Unpack a certain number of characters from an integer array into a character
string.  Common block /CHPK/ supplies the number of characters per (integer)
word.
INTEGER FUNCTION CISATT
FORTRAN call for Unix ISATTY(3C).
SUBROUTINE COPENC
Nice FORTRAN interface using type CHARACTER variables, to call COPENC.
SUBROUTINE COPENC
C routine to open a file for binary I/O.  Calls Unix FOPEN(3S).
INTEGER FUNCTION COR
Bitwise or of two integers.
SUBOUTINE CREAD
C routine to read data from a file opened by COPENC or CSCRAT.  Calls Unix
FREAD(3S).
SUBROUTINE CREWIN
C routine to rewind a file (opened by COPENC or CSCRAT).  Calls Unix REWIND(3S).
SUBROUTINE CSCRAT
C routine to open a scratch (or temporary) file for binary I/O.  Calls Unix
TMPFILE(3S).
SUBROUTINE CSEEK
C routine to move the file pointer to a given location in a file.  Calls Unix
FSEEK(3S).  File must have been opened by COPENC or CSCRAT.
INTEGER FUNCTION CSHFTL
Shift an integer left n bits (noncircular).
INTEGER FUNCTION CSHFTR
Shift an integer right n bits (noncircular).
INTEGER FUNCTION CSYSTC
FORTRAN/C interface for calling Unix SYSTEM(3S).
INTEGER FUNCTION CSYSTE
FORTRAN call for Unix SYSTEM(3S).
SUBROUTINE CTELL
C routine to return the offset of the file pointer from the beginning of the
file.  The file must have been opened by COPENC or CSCRAT.  Calls Unix
FTELL(3S).
SUBROUTINE CWRITE
C routine to write to a file opened by COPENC or CSCRAT.  Calls Unix FWRITE(3S).
INTEGER FUNCTION CXOR
Bitwise exclusive or of two integers.
SUBROUTINE FILNAM
Doctor up a given filename based on a supplied file type (.xxx) and whether
the file is new or old.  If the file is old, only use the supplied file type
if the filename doesn't have one yet.  If the file is new, strip off any
directory name and file type, and put on the new file type.  Filenames
"stdin", "stdout", "/dev/tty", "/dev/null", and "/dev/lp" are special and
should not be changed.
SUBROUTINE FREARR
Free space in memory previously allocated with GETARR.  Calls Unix FREE(3C).
SUBROUTINE FRELUN
Free a FORTRAN logical unit number gotten from GETLUN.
SUBROUTINE GETARR
Return an index into an array representing the starting location for the
requested amount of space in memory (e.g., ARRAY(INDEX) is the first element of
a scratch array of length LENGTH).  Calls Unix MALLOC(3C).
SUBROUTINE GETLUN
Get a unique FORTRAN logical unit number.  Assume that numbers between 11 and
50 are OK.
LOGICAL FUNCTION INTERA
Determine whether this logical device is interactive (connected to a terminal)
or not.  Use Unix ISATTY(3C).
SUBROUTINE KBDATT
Enable ^C or BREAK keyboard attention interrupts.  This is a one-shot deal, so
it is reset in TRPATT.
SUBROUTINE RETATT
Return to default keboard attention interrupt handling.
CHARACTER*80 FUNCTION STDDEV
Return the name of the standard input or output device ("stdin" or "stdout"),
depending on which we ask for.
SUBROUTINE SYSCOM
If a Unix command is supplied, execute it as a system command and return.
If no command is given, send the user to the system for awhile, to return when
he is through.  Use Unix SYSTEM(3S).  This may not work in PLOT3D because you
need twice as much swap space, since SYSTEM makes a copy of the current process
before deleting the old one.
SUBROUTINE SYSERR
Handle system errors flagged through Unix SIGNAL(2).  Call SYSMOD to rearm the
trap, print an error message, and call Unix LONGJMP(3C).
SUBROUTINE SYSMOD
A C routine to modify Unix's handling of some errors (specifically bus errors
and segmentation violations), and establish SYSERR as the error handler for
those errors.
SUBROUTINE TRNSYM
Translate a given character string using the system symbol table.  Uses Unix
GETENV(3C).
SUBROUTINE TRPATT
Keyboard attention interrupt trap.  Rearm the trap, reset the input file
stack, and call Unix LONGJMP(3C).

