This section is intended to give an overall view of VASPACKT and selected aspects of its design; it covers some details, but, in general, one should refer to the sections "SUBROUTINES" and "PARAMETERS" for detailed descriptions of subroutines and parameters mentioned. (Parameters are mentioned by name; all the names are of the form 'XXX', where XXX is a three-character mnemonic.) The section "ERROR HANDLING" describes error messages written by VASPACKT. The section "EXAMPLES" describes the examples available for VASPACKT.
It is assumed that the reader is familiar with NCAR Graphics in general and has some knowledge of the packages AREAS, EZMAP, and perhaps TDPACK.
The design of VASPACKT is similar to that of an earlier NCAR Graphics Package, called CONPACKT, which allows a user to construct, from data on a triangular mesh, plots showing simple contours and filled contour bands.
To warn the user of unimplemented features, sections describing them are marked with a "DI" that serves as a link to this note.
To represent a triangular mesh requires three singly-dimensioned arrays: RPNT defines points, IEDG defines edges (each of which consists of two connected points), and ITRI defines triangles (each of which consists of three connected edges). The elements of each array form "nodes" having nominal lengths as follows:
PARAMETER (LOPN=6) ! length of a point node PARAMETER (LOEN=4) ! length of an edge node PARAMETER (LOTN=5) ! length of a triangle node(In some cases, additional elements may be used in some types of nodes, but these are the basic ones that must be present.)
The six elements of a point node are reals, as follows:
The four elements of an edge node are integers, as follows:
The five elements of a triangle node are integers, as follows:
The "base index" of a point node, an edge node, or a triangle node is always a non-negative multiple of the length of the node, to which can be added an offset to get the index of a particular element of the node. For example, if IPTT is the base index of a triangle of interest, ITRI(IPTT+1) is its first element, which is the base index of the triangle's first edge. Thus, IEDG(ITRI(IPTT+1)+2) is the second element of the triangle's first edge; that is to say, it is the base index of the second point of the first edge of the triangle with base index IPTT. In a similar fashion, it may be seen that RPNT(IEDG(ITRI(IPTT+1)+2)+3) is the third (Z) coordinate of the second point of the first edge of the triangle with base index IPTT.
It is the pointers from the edge nodes back to the triangle nodes that allow VASPACKT to navigate the mesh, moving from triangle to triangle as it follows a streamline. These pointers are a little tricky to define: if IPTE is the base index of an edge node and IEDG(IPTE+3) is zero or more, saying that there is a triangle to the left of the edge, then IEDG(IPTE+3) is the actual index of that element of the triangle node that points to the edge node; that is, ITRI(IEDG(IPTE+3))=IPTE. The base index of the triangle node defining that triangle is IPTT, where IPTT=LOTN*((IEDG(IPTE+3)-1)/LOTN), and the index of the pointer to the edge within the triangle node is IPTI=IEDG(IPTE+3)-IPTT, so that ITRI(IPTT+IPTI)=IPTE. Similar comments apply to element 4 of an edge node, which points into the triangle node defining the triangle to the right of the edge.
For some types of triangular mesh, the maximum number of points, edges, and triangles can be computed easily:
PARAMETER (IDIM=321,JDIM=384,IDM1=IDIM-1,JDM1=JDIM-1)and then compute from those values the maximum number of points (MNOP), the maximum number of edges (MNOE), and the maximum number of triangles (MNOT) that the triangular mesh arrays will need to hold. The computed values will be exactly as required if no points or edges of the rectangular mesh are repeated in it; if there are repeating points or edges, space for slightly fewer points and edges will be needed:
PARAMETER (MNOP=IDIM*JDIM) PARAMETER (MNOE=3*IDM1*JDM1+IDM1+JDM1) PARAMETER (MNOT=2*IDM1*JDM1)
PARAMETER (MNOP=10*NDIV*NDIV+2) PARAMETER (MNOE=30*NDIV*NDIV) PARAMETER (MNOT=20*NDIV*NDIV)
PARAMETER (MPNT=MNOP*LOPN) ! space for points PARAMETER (MEDG=MNOE*LOEN) ! space for edges PARAMETER (MTRI=MNOT*LOTN) ! space for trianglesThen, we can declare the arrays to hold the point nodes, edge nodes, and triangle nodes defining the triangular mesh:
DIMENSION RPNT(MPNT),IEDG(MEDG),ITRI(MTRI)In all of the examples, code like that above (throughout the section) will be found.
The vectors defining the flow field are specified at the vertices of the triangular mesh; at each vertex, X, Y, and Z components are given. Each vector does not, in general, lie in the plane of any of the triangles that meet at its vertex; neither do interpolated vectors in the interiors of triangles. But, in order to trace streamlines through the interiors of triangles, we must be able to project the interpolated vectors at interior points into vectors that do lie in the planes of the triangles, which is tricky. What one is tempted to do is project each interpolated vector into the plane of its triangle using projection lines perpendicular to that plane. Unfortunately, doing that leads to troubling discontinuities at the boundaries of adjoining triangles: it is possible, for example, to have interpolated vectors that seem to imply outward flow from each of a pair of adjoining triangles into the other and this can send the code that traces the streamlines into an infinite loop. Instead, the interpolated vectors are projected into the planes of individual triangles using projection lines radiating from a center point, whose coordinates are given by 'PCX', 'PCY', and 'PCZ'. Doing this ensures continuity of the flow field across the boundaries of adjoining triangles in the principal case of interest: a triangular mesh representing a sphere centered at ('PCX','PCY','PCZ'). In fact, it works in any situation in which the "back" side of each triangle is visible from the point ('PCX','PCY','PCZ') and is not obscured by any other triangle; however, it does not work for completely arbitrary meshes, such as the mushroom-shaped blobs shown in the CONPACKT example "cttd01". This is indeed unfortunate, but, as of this writing, I have not been able to find a better projection method.
Linear interpolation is used to estimate flow field components in the interior of each triangle from user-defined components at the vertices. A possible future enhancement would be to provide optional non-linear interpolation methods which may provide more meaningful results on relatively sparse meshes. For the moment, if you have such a mesh, you will have to use some other package to interpolate to a denser mesh.
Streamlines are traced in a somewhat simplistic fashion, by taking tiny steps in the local interpolated direction of the flow field. Thus, there is cumulative error along each streamline: for example, if the flow field should bend smoothly in one direction, the traced streamline will not bend quite as much as it should. There are ways to compensate for this, but the use of such methods will have to be reserved for future enhancements. Meanwhile, one can make the code trace streamlines more accurately by decreasing the step size ('SLP').
After all required parameters have been set, the process of drawing a vector or streamline plot begins with a call to an initialization routine:
At any time, it is possible to retrieve the value of an internal parameter by calling one of the three following routines:
If 'MAP' is given a positive non-zero value, each triplet of X, Y, and Z coordinates is mapped, prior to use, by a statement of the form
CALL VTMXYZ (IMAP,XINP,YINP,ZINP,XOTP,YOTP)IMAP is the value of 'MAP'; XINP, YINP, and ZINP are the unmapped (input) 3D coordinates; and XOTP and YOTP are the mapped (output) 2D coordinates to be used as "user coordinates".
The default version of VTMXYZ does the following mappings (where RTOD = 57.2957795130823 (180/pi):
RLAT=RTOD*ASIN(ZINP/SQRT(XINP*XINP+YINP*YINP+ZINP*ZINP)) IF (XINP.EQ.0..AND.YINP.EQ.0.) THEN RLON=0. ELSE RLON=RTOD*ATAN2(YINP,XINP) END IF
and then calls the EZMAP routine MAPTRA to obtain XOTP and YOTP, which are the coordinates of the point on the map specified by the current state of EZMAP:
CALL MAPTRA (RLAT,RLON,XOTP,YOTP)
The way in which "user coordinates" are mapped to "fractional coordinates" in the plotter frame is determined by the current definitions of the "window" in the user system and the "viewport" on the plotter frame. The window and viewport may have been defined by a call to the SPPS routine SET or by calls to GKS routines; the former will be described.
A call to the SPPS routine SET has the form
CALL SET (XVPL,XVPR,YVPB,YVPT,XWDL,XWDR,YWDB,YWDT,LNLG)All arguments are REALs except for LNLG, which is an INTEGER. The first four arguments must all be between 0 and 1, inclusive; they define a rectangular area in the fractional coordinate space of the plotter frame known as the "viewport". The next four arguments define a rectangular area in "user coordinate" space known as the "window". The final argument indicates whether the mapping of user coordinates into the viewport is to be linear or logarithmic in X and Y.
By default, VASPACKT (specifically, the routine VTMESH ) calls the SPPS routine SET. One may, by zeroing 'SET', prevent this from happening; in that case, one must do the call for oneself or depend on some other utility (such as EZMAP) to have done it.
If VASPACKT calls SET, it always uses LNLG = 1, requesting a linear-linear mapping from the window to the viewport, and it positions the viewport and window as follows: The viewport is positioned as specified by the current values of 'VPL', 'VPR', 'VPB', 'VPT', and 'VPS'. The first four of these specify the position of a "viewport area", in which the viewport is to be centered and made as large as possible; the final one says how the shape of the viewport is to be determined. By default, the position of the window in the user coordinate system is determined by computing the minimum and maximum values of X and Y over all the points of the triangular mesh. 'WDL', 'WDR', 'WDB', and 'WDT' may be used to override this default behavior and specify the exact values to be used in the SET call to define the window.
If the triangular mesh represents data on the surface of a globe of radius 1, then to map the VASPACKT output onto an EZMAP background, one need only set 'MAP' to 1 and initialize EZMAP (which results in a call to the SPPS routine SET).
A possible value for 'ORV', if it is to be set non-zero, is 1.E12, which has historically been returned by the EZMAP routines MAPTRN and MAPTRA to indicate a point which is outside the area depicted by a given map projection.
The union of all points for which VTMXYZ returns the out-of-range value constitutes a set of out-of-range areas. Vectors are not placed, and curly vectors and streamlines are not traced, in out-of-range areas (indeed, they cannot be). A binary-halving technique is used to extend lines to the very edge of such areas.
When a line is traced, if two consecutive points are out of range (in range), then the entire line segment connecting those two points is assumed to be out of range (in range). If the detail of the out-of-range areas is small enough, this assumption may cause errors. Giving 'PIS' a non-zero value will cause more points to be examined along each such line segment, thus curing the problem. Alternatively, giving 'PIT' a non-zero value may cure the problem in a more efficient way.
The appearance of these labels may be determined in detail by setting parameters:
All labels are written by means of calls to the character-plotting routine PLCHHQ, in the package PLOTCHAR. The angle, in degrees, at which a label is written is determined by 'xxA'. The box flag 'xxB' determines whether or not, prior to writing the label, a box surrounding it is filled, and whether or not, after writing the label, the edge of the box is drawn. If the box is filled, it is done using the color index specified by 'LBC'; if the edge of the box is drawn, it is done using the color index, if any, chosen for the label itself, which is determined by the value of 'xxC'. The line width to be used in drawing the box is determined by 'xxL'. The size (width) of the characters is determined by 'xxS'. The text of the label is determined by 'xxT'; usually, this string may contain embedded substrings of the form '$xxx$', which are to be replaced by the value of the quantity specified by the three-character mnemonic 'xxx'. The width of the "white space" to be left around the label (which defines the dimensions of the box around it) is determined by 'xxW'.
The parameter 'SFS' says how the scale factor is to be chosen. If it is given a value greater than zero, that value is the desired scale factor. If 'SFS' is given a value less than or equal to zero, VASPACKT is directed to choose a scale factor to use, in one of five different ways. The parameter 'SFU' may be retrieved by the user; it specifies the scale factor which has been selected for use.
The scale factor may be displayed as a part of the informational label. This is done by embedding the substring '$SFU$' in the string defining 'ILT'.
The default value of 'SFS' is 1, which essentially specifies that no scale factor is to be used.
When 'ZFF' is non-zero, a call to one of the routines VTCVDM, VTCVDR, VTSLDM, VTSLDR, VTSVDM, or VTSVDR will not cause anything to be drawn; instead, the zero-field label will be written.
In general, it is safest not to use the workspace arrays for other purposes between one call to a VASPACKT routine and the next (unless the next is to the routine VTMESH, which initializes the workspace pointers).
It is possible to find out how much space has been used in each of the workspace arrays. The parameters 'IWU' and 'RWU' are zeroed by a call to VTMESH and are updated thereafter to reflect maximum usage of space in the arrays. Thus, one might give the arrays large dimensions, create a typical plot, retrieve the values of 'IWU' and 'RWU' to see how much space was actually used, and then reduce the dimensions to more reasonable values.
Currently, workspace usage by all routines can be predicted exactly. However, because this could potentially change in the future, there is a parameter, called 'WSO', that says what to do when a workspace overflow occurs. The four possibilities are as follows: to terminate after printing an error message, to continue running after printing an error message (this is the default), to just continue running without printing anything, or to do a recoverable-error call to SETER and then continue running without printing anything. Of course, in the latter two cases, incomplete plots may result. It is possible to find out whether or not a workspace overflow has occurred during a given call to a VASPACKT routine; this is done by retrieving 'IWU' and 'RWU' and comparing them with the dimensions of the workspace arrays IWRK and RWRK.
If "n" is the number of triangles in the triangular mesh, then
This structure allows the use of a tiered approach to color setting. If no color setting whatsoever is done, plots are drawn entirely in the colors specified by the applicable default values of the GKS color indices. If, on the other hand, prior to calling VASPACKT, one defines the color index "IC" (see the next section, "GKS Considerations") and then uses
CALL GSPLCI (IC)to change the GKS polyline color index, then all polylines drawn by VASPACKT change color. Similarly, one may use the statement
CALL GSTXCI (IC)to change the GKS text color index and the statement
CALL GSFACI (IC)to change the GKS fill area color index; the first will cause labels drawn by VASPACKT to change color and the second will cause label boxes filled by VASPACKT to change color.
If, in addition or instead, VASPACKT color-setting parameters are given values greater than or equal to zero, the objects or classes of objects to which those parameters apply are colored accordingly; these colors are used in preference to values preset by calls to GSPLCI, GSTXCI, or GSFACI.
A final opportunity to set color is provided by the user-supplied versions of the "change" routines, with names of the form VTCHxx (DI); calls to GSPLCI, GSTXCI, and GSFACI may occur in such a routine and take precedence over color setting by any other means. Note that, if color is being set for drawing a label, then either or both of the polyline color index and the text color index may need to be set, depending on whether the labels are being drawn by calls to the GKS routine GPL (to draw polylines stroking out the characters) or by calls to the GKS routine GTX (to draw text). In particular, the routine PLCHHQ , in the package PLOTCHAR, which is called by VASPACKT to draw labels, may be directed by the user to draw high-quality characters, which are stroked; medium-quality characters, which are also stroked; or low-quality characters, which are drawn by GTX.
(1) Like all the utilities in the NCAR graphics package, VASPACKT assumes that GKS has been opened and that the desired workstations have been opened and activated. The statement
CALL OPNGKScalls the SPPS routine OPNGKS, the GKS equivalent of which is
CALL GOPKS (6,0) CALL GOPWK (1,2,1) CALL GACWK (1)creating a single metacode workstation associated with FORTRAN unit 2.
Similarly, at the end of one's program, the workstations must be deactivated and closed and then GKS must be closed. The statement
CALL CLSGKScalls the SPPS routine CLSGKS, the GKS equivalent of which is
CALL GDAWK (1) CALL GCLWK (1) CALL GCLKS(2) It is assumed that the aspect source flags for various quantities are set to "individual". (The NCAR GKS package does this by default, but other packages may not.) To make sure that all the aspect source flags are set correctly, use the following code:
DIMENSION IASF(13) ... DATA IASF / 13*1 / ... CALL GSASF (IASF)(3) Color fill is done by VASPACKT using calls to the GKS routine GFA. To get solid fill, rather than hollow fill, one must call a GKS routine to set the "fill area interior style":
CALL GSFAIS (1)(This is because the default "fill area interior style", as mandated by the GKS standard, is "hollow", rather than "solid".)
(4) Color-setting by VASPACKT is done by executing calls to the GKS routines GSPLCI, GSTXCI, and GSFACI, with user-defined color indices as arguments. The association of these color indices with colors on the workstations must have been defined previously by the user. This should be done by calling the GKS routine GSCR. The statement
CALL GSCR (IW,IC,RC,GC,BC)defines, for workstation IW, color index IC, with RGB components RC, GC, and BC. To be consistent with the SPPS routines OPNGKS and CLSGKS, use IW = 1. The value of IC may be any non-negative integer. By default, color index 0 is associated with the color black, which is defined by (RC,GC,BC) = (0.,0.,0.) and is used as the background color, while color index 1 is associated with the color white, which is defined by (RC,GC,BC) = (1.,1.,1.).
The initial version of VTBACK does very little. User feedback will be useful in determining what this routine is eventually made to do.
RPNT (REAL array, dimensioned as specified in the last call to VTMESH, input) is the user's mesh-point array.
IEDG (INTEGER array, dimensioned as specified in the last call to VTMESH, input) is the user's edge array.
ITRI (INTEGER array, dimensioned as specified in the last call to VTMESH, input) is the user's triangle array.
RWRK (REAL array, dimensioned as specified in the last call to VTMESH or VTMVRW, input/output) is the current real workspace array.
IWRK (INTEGER array, dimensioned as specified in the last call to VTMESH or VTMVIW, input/output) is the current integer workspace array.
The text of the label may be retrieved by means of a "CALL VTGETC ('CTM',CVAL)". The text of the label may be changed by means of a "CALL VTSETC ('CTM',CVAL)"; this should only be done during a call with IFLG = 1 or IFLG = 3, and, if it is done for one of those values, it should be done for the other.
The parameters 'LBX' and 'LBY' will have been set to the X and Y coordinates of the center point of the label, in the current user coordinate system.
The text of the label being written may be retrieved by means of a "CALL VTGETC ('CTM',CVAL)". The text of the label may be changed by means of a "CALL VTSETC ('CTM',CVAL)"; this should only be done during a call with IFLG = 1 or 3 and, if it is done for one of those two values, it should also be done for the other.
The parameters 'LBX' and 'LBY' will have been set to the X and Y coordinates of the center point of the label, in the current user coordinate system.
VTCVDM generates the vectors, masks them against a user-specified area map, and generates calls to a user-specified routine - one call for each polyline resulting from the masking process. Each such polyline lies entirely within precisely one of the areas defined by the area map. The user routine may examine the information provided by its arguments, describing the area the polyline is in, and either draw or not draw the polyline. The object of masking the curly vectors may be simply to avoid drawing them through label boxes or it may be something more complicated, like limiting the drawing of the vectors to the ocean areas on an EZMAP background.
VTCVDR generates and draws the vectors, with no masking. (Actually, it's implemented by calling VTCVDM with an argument array IAMA having its single element set to zero, which turns off masking.)
Each curly vector is just a short streamline, of a length, as measured on the surface of the triangular mesh, proportional to the magnitude of the velocity field at the center of the vector. See the descriptions of 'VFR', 'VRL', and 'VRM', which may be used to control the sizes of the vectors.
To distribute the curly vectors more or less evenly on the surface of the triangular mesh, the triangles are considered in random order. A curly vector is placed in a triangle (and centered on its center point) if and only if certain conditions are met: 1) no curly vector has previously passed through the triangle; 2) the largest angle between the velocity vectors at any pair of vertices of the triangle is less than the maximum value specified by 'AM1'; 3) two lines traced, from the starting point, in the two directions perpendicular to the velocity field, for the distance specified by 'TTL', do not cross any curly vector previously drawn; and 4) the entire curly vector can be drawn without crossing or passing too close to any curly vector previously drawn (as determined by tracing lines perpendicular to the velocity field at intervals along the curly vector and of the lengths specified by the values of 'TTS' and 'TTL') or being terminated for some other reason (like hitting an external edge of the mesh, entering a triangle containing another curly vector, or entering a triangle where the largest angle between the velocity vectors at any pair of vertices of the triangle is larger than the value specified by 'AM2').
No curly vector will be placed in any triangle of the mesh that is blocked, as specified by the current values of the blocking masks 'TBA' and 'TBX' and the blocking flag for the triangle.
See the example "vtex02".
RPNT (REAL array, dimensioned as specified in the last call to VTMESH, input) is the user's mesh-point array.
IEDG (INTEGER array, dimensioned as specified in the last call to VTMESH, input) is the user's edge array.
ITRI (INTEGER array, dimensioned as specified in the last call to VTMESH, input) is the user's triangle array.
RWRK (REAL array, dimensioned as specified in the last call to VTMESH or VTMVRW, input/output) is the current real workspace array.
IWRK (INTEGER array, dimensioned as specified in the last call to VTMESH or VTMVIW, input/output) is the current integer workspace array.
IAMA (INTEGER array, dimensioned as specified in a call to ARINAM, in the package AREAS, input/output) is an array containing an area map which is to be used to mask the curly vectors as they are drawn. If no masking is desired, use an array with its first element zeroed.
RTPL (EXTERNAL subroutine) is the user subroutine which is to process the polylines which result from masking the curly vectors against the area map. It must be declared EXTERNAL in the routine which calls VTCVDM. It will be called repeatedly and must have the following form:
SUBROUTINE RTPL (XCS,YCS,NCS,IAI,IAG,NAI) DIMENSION XCS(*),YCS(*),IAI(*),IAG(*) ... (CODE TO PROCESS POLYLINE DEFINED BY ARGUMENTS) ... RETURN ENDThe real arrays XCS and YCS hold the X and Y coordinates of NCS points defining a polyline which is to be considered for drawing. For each I greater than or equal to 1 and less than or equal to NAI, IAI(I) is the area identifier for the area in which the polyline lies, relative to the edge group IAG(I). The X and Y coordinates are all normalized device coordinates and it may be assumed that the appropriate SET call has been done. If it is decided to draw the line, it may be done with a call to the SPPS routine CURVE, to the DASHCHAR routine CURVED, to the DASHPACK routine DPCURV, or to the GKS routine GPL.
If the only object of using VTCVDM is to avoid drawing curly vectors through areas having negative area identifiers, then the routine VTDRPL may be used for RTPL. In the routine that calls VTCVDM, insert the declaration
EXTERNAL VTDRPLand then use VTDRPL for the last argument.
For more information, see the description of the argument LPR of the AREAS subroutine ARDRLN.
EXTERNAL VTDRPLand, in the call, use VTDRPL for the argument RTPL. Each time VTDRPL is called, it draws the polyline defined by its first three arguments if, and only if, none of the area identifiers defined by the other three arguments is negative.
YCS (a REAL array of dimension at least NCS, input) is an array containing the Y coordinates of NCS points defining a polyline.
NCS (INTEGER, input) is the number of points defining the polyline.
IAI (an INTEGER array of dimension at least NAI, input) is an array of area identifiers for the area in which the polyline lies. For each I from 1 to NAI, IAI(I) is the area identifier of the area with respect to the edge group IAG(I).
IAG (an INTEGER array of dimension at least NAI, input) is an array of group identifiers. See the description of IAI, above.
NAI (INTEGER, input) is the number of area identifiers in the array IAI and the number of group identifiers in the array IAG.
CALL VTGETC (PNAM,CVAL)at any time to retrieve in CVAL the current character value of the parameter whose name is PNAM. If that parameter is an array, the array element specified by the current value of 'PAI' will be the one retrieved.
CVAL (CHARACTER, output) is a variable in which the value of the parameter specified by PNAM is to be returned.
CALL VTGETI (PNAM,IVAL)at any time to retrieve in IVAL the current integer value of the parameter whose name is PNAM. If that parameter is an array, the array element specified by the current value of 'PAI' will be the one retrieved.
IVAL (INTEGER, output) is a variable in which the value of the parameter specified by PNAM is to be returned. If the parameter is of type INTEGER and has the value "i", then IVAL = i; if the parameter is of type REAL and has the value "r", then IVAL = INT(r).
CALL VTGETR (PNAM,RVAL)at any time to retrieve in RVAL the current real value of the parameter whose name is PNAM. If that parameter is an array, the array element specified by the current value of 'PAI' will be the one retrieved.
RVAL (REAL, output) is a variable in which the value of the parameter specified by PNAM is to be returned. If the parameter is of type INTEGER and has the value "i", then RVAL = REAL(i); if the parameter is of type REAL and has the value "r", then RVAL = r.
Initializes the drawing of simple vectors, curly vectors, and/or streamlines on a triangular mesh. VTMESH ignores triangles of the triangular mesh that are blocked by the user, as specified by the low-order bits of the blocking masks 'TBA' and 'TBX' and the blocking flag for each triangle.
When VTMESH is called: The dimensions of all the arrays are transferred to variables in COMMON, so that those dimensions may be omitted from calls to other VASPACKT routines. Some needed constants that cannot be set in DATA statements (because their values may be different on different machines) are computed. The internal pointers used to manage workspace usage are initialized. The average length of the edges in the mesh ('AEL') is computed. The ranges of the X, Y, and Z coordinates of the points in the mesh ('XMN', 'XMX', 'YMN', 'YMX', 'ZMN', and 'ZMX') and the ranges of the flow field magnitudes 'DMN' and 'DMX') are determined. The parameter 'ZFF' is set appropriately. The ranges of the 2D coordinates of the mapped points of the mesh in the drawing plane are determined. If VASPACKT is to call the SPPS routine SET, appropriate arguments are determined and SET is called; otherwise, GETSET is called to retrieve the arguments from the user's call to SET. Numeric-label quantities that depend on the range of values in the flow field are initialized (see 'NEL', 'NET', 'NEU', 'NLS', 'NLS', 'NOF', and 'NSD'. A scale factor may be chosen (see 'SFS' and 'SFU').
NPNT (INTEGER, input) is the number of elements in RPNT (that is, the number of points in the triangular mesh, times LOPN).
LOPN (INTEGER, input) is the length of a point node.
IEDG (INTEGER array, dimensioned greater than or equal to NEDG x LOEN, input) is the user's edge array.
NEDG (INTEGER, input) is the number of elements in IEDG (that is, the number of edges of the triangular mesh, times LOEN).
LOEN (INTEGER, input) is the length of an edge node.
ITRI (INTEGER array, dimensioned greater than or equal to NTRI x LOTN, input) is the user's triangle array.
NTRI (INTEGER, input) is the number of elements in ITRI (that is, the number of triangles of the triangular mesh, times LOTN).
LOTN (INTEGER, input) is the length of a triangle node.
RWRK (REAL array, dimensioned LRWK, input/output) is the real work array.
LRWK (INTEGER, input) is the length of RWRK.
IWRK (INTEGER array, dimensioned LIWK, input/output) is the integer work array.
LIWK (INTEGER, input) is the length of IWRK.
IWKN (an output array of type INTEGER, dimensioned LWKN) is the array which is to become the new integer workspace array.
LWKN (INTEGER, input) is the dimension of the array IWKN.
RWKN (an output array of type REAL, dimensioned LWKN) is the array which is to become the new real workspace array.
LWKN (INTEGER, input) is the dimension of the array RWKN.
The first argument in a call to VTMXYZ will always be positive; the call is intended to map the X, Y, and Z coordinates of a point from the 3D space in which the triangular mesh is defined to X and Y "user" coordinates in the 2D space of the drawing plane.
(Note, however, that, if the same routine is being used as a replacement for both VTMXYZ and the analogous CONPACKT routine CTMXYZ, then negative values of the first argument can occur and one should review the discussion of that routine.)
The default version of VTMXYZ is as follows:
SUBROUTINE VTMXYZ (IMAP,XINP,YINP,ZINP,XOTP,YOTP) DATA RTOD / 57.2957795130823 / ! (radians to degrees) IF (IMAP.EQ.1) THEN RLAT=RTOD*ASIN(ZINP/SQRT(XINP*XINP+YINP*YINP+ZINP*ZINP)) IF (XINP.EQ.0..AND.YINP.EQ.0.) RLON=0. ELSE RLON=RTOD*ATAN2(YINP,XINP) END IF CALL MAPTRA (RLAT,RLON,XOTP,YOTP) ELSE IF (IMAP.EQ.-1) THEN CALL MAPTRI (XINP,YINP,XOTP,YOTP) ELSE IF (IMAP.EQ.2) THEN CALL TDPRPT (XINP,YINP,ZINP,XOTP,YOTP) ELSE XOTP=XINP YOTP=YINP END IF RETURN ENDWhen VTMXYZ is called with IMAP = 1, the incoming X, Y and Z coordinates are assumed to represent points on the surface of a sphere of radius 1; from these, it computes values of latitude and longitude and calls the EZMAP routine MAPTRA to find the X and Y coordinates on the map of the projection of the specified point on the globe; those coordinates are returned as the outgoing X and Y coordinates.
When IMAP = -1 (which can only happen if the call comes from the package CONPACKT), the incoming X and Y coordinates are assumed to be the X and Y coordinates of a projected point on the map; the EZMAP routine MAPTRI is called to find the latitude and longitude of the original point on the globe and those values are returned as the outgoing X and Y coordinates. If the point is off the map (as, for example, when an orthographic projection is used and the point is outside the circle of radius 1 into which the visible hemisphere of the earth is mapped by that projection), then MAPTRI will return the value 1.E12 (which should be declared the "out-of-range" value, 'ORV', for VASPACKT).
When VTMXYZ is called with IMAP = 2, the incoming X, Y, and Z coordinates are assumed to represent points on an arbitrary mesh in 3-space; these are projected to an image plane by calling the routine TDPRPT, in the 3D package TDPACK.
Note that calling VTMXYZ with IMAP = -2 does not use TDPACK; furthermore, when 'MAP' is given the value 2, 'ORV' should not be set non-zero; there is no "out-of-range" value.
If IMAP is anything else, the input X and Y coordinates are simply returned as the output X and Y coordinates.
If VTMXYZ is changed to do a new mapping for a particular value of 'MAP', it must be made to respond properly to a first argument with value +'MAP' or -'MAP' .
XINP (REAL, input) is used in one of two ways:
XOTP (REAL, output) and YOTP (REAL, output) are used in one of two ways:
CALL VTSETC (PNAM,CVAL)to give the parameter whose name is PNAM the character value CVAL. If that parameter is an array, the element specified by the current value of 'PAI' will be the one changed.
CVAL (CHARACTER, input) is a character constant or variable, the value of which is to be given to the parameter specified by PNAM.
CALL VTSETI (PNAM,IVAL)to give the parameter whose name is PNAM the integer value IVAL. If that parameter is an array, the element specified by the current value of 'PAI' will be the one changed.
IVAL (INTEGER, input) is an expression, the value of which is to be given to the parameter specified by PNAM. If the parameter is of type INTEGER, it is given the value IVAL; if the parameter is of type REAL, it is given the value REAL(IVAL).
CALL VTSETR (PNAM,RVAL)to give the parameter whose name is PNAM the real value RVAL. If that parameter is an array, the element specified by the current value of 'PAI' will be the one changed.
RVAL (REAL, input) is an expression, the value of which is to be given to the parameter specified by PNAM. If the parameter is of type INTEGER, it is given the value INT(RVAL); if the parameter is of type REAL, it is given the value RVAL.
VTSLDM generates the streamlines, masks them against a user-specified area map, and generates calls to a user-specified routine - one call for each polyline resulting from the masking process. Each such polyline lies entirely within precisely one of the areas defined by the area map. The user routine may examine the information provided by its arguments, describing the area the polyline is in, and either draw or not draw the polyline. The object of masking the streamlines may be simply to avoid drawing them through label boxes or it may be something more complicated, like limiting the drawing of the streamlines to the ocean areas on an EZMAP background.
VTSLDR generates and draws the streamlines, with no masking. (Actually, it's implemented by calling VTSLDM with an argument array IAMA having its single element set to zero, which turns off masking.)
The following algorithm is used to achieve a pleasing distribution of streamlines on a triangular mesh consisting of N triangles:
As each streamline is drawn, arrowheads are drawn at regular intervals of 'AHS' along its length. Each arrowhead is constructed by drawing two short, possibly slightly curved, lines of the length specified by 'AHL': where the two lines meet, at the streamline, the angle between them is determined by 'AHA' and each maintains a constant angle with respect to the flow field along its entire length. This technique avoids the problem of using straight arrowheads that could cross the streamline in turbulent regions, where the streamline is bending sharply.
The arrowheads on each streamline are shifted along it by a random amount that is unique to that streamline. This is meant to avoid having the arrowheads on all of the streamlines generated by a particular streamline generator line up in distracting rows. It can happen that arrowheads on closely-spaced streamlines overlap in a displeasing fashion; in some cases (as, for example, when preparing a particular plot for publication), it may be worthwhile to change the value of 'RNG', which will change the set of random numbers used.
Tracing and/or drawing of each streamline generator, each streamline, and each segment of each arrowhead is done using points that are separated on the surface of the triangular mesh by a distance specified by 'SLP'. Making 'SLP' smaller will give one streamlines that more nearly reflect the actual path of a particle in the flow field, but it will take more time to draw them and the resulting metafile will be larger.
By default, streamlines are drawn in the current foreground color. However, the color of each streamline may vary along its length, as determined by the varying value of an associated quantity chosen by the user. See the descriptions of 'CTV', 'NLV', 'CLR', and 'TVL'.
No streamline will be drawn through any triangle of the mesh that is blocked, as specified by the current values of the blocking masks 'TBA' and 'TBX' and the blocking flag for the triangle.
See the example "vtex03".
RPNT (REAL array, dimensioned as specified in the last call to VTMESH, input) is the user's mesh-point array.
IEDG (INTEGER array, dimensioned as specified in the last call to VTMESH, input) is the user's edge array.
ITRI (INTEGER array, dimensioned as specified in the last call to VTMESH, input) is the user's triangle array.
RWRK (REAL array, dimensioned as specified in the last call to VTMESH or VTMVRW, input/output) is the current real workspace array.
IWRK (INTEGER array, dimensioned as specified in the last call to VTMESH or VTMVIW, input/output) is the current integer workspace array.
IAMA (INTEGER array, dimensioned as specified in a call to ARINAM, in the package AREAS, input/output) is an array containing an area map which is to be used to mask the streamlines as they are drawn. If no masking is desired, use an array with its first element zeroed.
RTPL (EXTERNAL subroutine) is the user subroutine which is to process the polylines which result from masking the streamlines against the area map. It must be declared EXTERNAL in the routine which calls VTCVDM. It will be called repeatedly and must have the following form:
SUBROUTINE RTPL (XCS,YCS,NCS,IAI,IAG,NAI) DIMENSION XCS(*),YCS(*),IAI(*),IAG(*) ... (CODE TO PROCESS POLYLINE DEFINED BY ARGUMENTS) ... RETURN ENDThe real arrays XCS and YCS hold the X and Y coordinates of NCS points defining a polyline which is to be considered for drawing. For each I greater than or equal to 1 and less than or equal to NAI, IAI(I) is the area identifier for the area in which the polyline lies, relative to the edge group IAG(I). The X and Y coordinates are all normalized device coordinates and it may be assumed that the appropriate SET call has been done. If it is decided to draw the line, it may be done with a call to the SPPS routine CURVE, to the DASHCHAR routine CURVED, to the DASHPACK routine DPCURV, or to the GKS routine GPL.
If the only object of using VTSLDM is to avoid drawing curly vectors through areas having negative area identifiers, then the routine VTDRPL may be used for RTPL. In the routine that calls VTSLDM, insert the declaration
EXTERNAL VTDRPLand then use VTDRPL for the last argument.
For more information, see the description of the argument LPR of the AREAS subroutine ARDRLN.
VTSVDM generates the simple vectors, masks them against a user-specified area map, and generates calls to a user-specified routine - one call for each polyline resulting from the masking process. Each such polyline lies entirely within precisely one of the areas defined by the area map. The user routine may examine the information provided by its arguments, describing the area the polyline is in, and either draw or not draw the polyline. The object of masking the vectors may be simply to avoid drawing them through label boxes or it may be something more complicated, like limiting the drawing of the vectors to the ocean areas on an EZMAP background.
VTSVDR generates and draws the vectors, with no masking. (Actually, it's implemented by calling VTSVDM with an argument array IAMA having its single element set to zero, which turns off masking.)
Each simple vector is just an arrow on the triangular mesh, of a length, as measured on the surface of the mesh, proportional to the magnitude of the velocity field at the center of the vector. See the descriptions of 'VFR', 'VRL', and 'VRM', which may be used to control the sizes of the vectors.
If 'SVT' is given a zero value, a simple vector is drawn at the center of every triangle. For a typically dense mesh, this yields far too many vectors, so the default value of the parameter is non-zero, activating a culling algorithm that results in the drawing of simple vectors at the centers of a subset of the triangles. To distribute the vectors more or less evenly on the surface of the triangular mesh, the triangles are considered in random order. For more information, see the description of 'SVT'.
No vector will be placed in any triangle of the mesh that is blocked, as specified by the current values of the blocking masks 'TBA' and 'TBX' and the blocking flag for the triangle.
See the example "vtex01".
RPNT (REAL array, dimensioned as specified in the last call to VTMESH, input) is the user's mesh-point array.
IEDG (INTEGER array, dimensioned as specified in the last call to VTMESH, input) is the user's edge array.
ITRI (INTEGER array, dimensioned as specified in the last call to VTMESH, input) is the user's triangle array.
RWRK (REAL array, dimensioned as specified in the last call to VTMESH or VTMVRW, input/output) is the current real workspace array.
IWRK (INTEGER array, dimensioned as specified in the last call to VTMESH or VTMVIW, input/output) is the current integer workspace array.
IAMA (INTEGER array, dimensioned as specified in a call to ARINAM, in the package AREAS, input/output) is an array containing an area map which is to be used to mask the simple vectors as they are drawn. If no masking is desired, use an array with its first element zeroed.
RTPL (EXTERNAL subroutine) is the user subroutine which is to process the polylines which result from masking the simple vectors against the area map. It must be declared EXTERNAL in the routine which calls VTCVDM. It will be called repeatedly and must have the following form:
SUBROUTINE RTPL (XCS,YCS,NCS,IAI,IAG,NAI) DIMENSION XCS(*),YCS(*),IAI(*),IAG(*) ... (CODE TO PROCESS POLYLINE DEFINED BY ARGUMENTS) ... RETURN ENDThe real arrays XCS and YCS hold the X and Y coordinates of NCS points defining a polyline which is to be considered for drawing. For each I greater than or equal to 1 and less than or equal to NAI, IAI(I) is the area identifier for the area in which the polyline lies, relative to the edge group IAG(I). The X and Y coordinates are all normalized device coordinates and it may be assumed that the appropriate SET call has been done. If it is decided to draw the line, it may be done with a call to the SPPS routine CURVE, to the DASHCHAR routine CURVED, to the DASHPACK routine DPCURV, or to the GKS routine GPL.
If the only object of using VTSVDM is to avoid drawing curly vectors through areas having negative area identifiers, then the routine VTDRPL may be used for RTPL. In the routine that calls VTSVDM, insert the declaration
EXTERNAL VTDRPLand then use VTDRPL for the last argument.
For more information, see the description of the argument LPR of the AREAS subroutine ARDRLN.
Let the low-order seven bits of each triangle's blocking flag be numbered (from left to right) B6, B5, B4, B3, B2, B1, and B0; the bits are assigned as follows:
B6 B5 B4 B3 B2 B1 B0 \ \ \ \ \ \ \__ reserved for user blocking of triangle \ \ \ \ \ \____ right (or only) eye, triangle seen from the wrong side \ \ \ \ \______ right (or only) eye, triangle edge-on to the line of sight \ \ \ \________ right (or only) eye, triangle hidden by other triangles \ \ \__________ left eye, triangle seen from the wrong side \ \____________ left eye, triangle edge-on to the line of sight \______________ left eye, triangle hidden by other trianglesIf the final argument (OTEP) in the last call to TDINIT (the offset to the eye position), was greater or equal to zero, then VTTDBF will set bits B3, B2, and B1 of each triangle blocking flag; if OTEP was less than zero, then VTTDBF will set bits B6, B5, and B4 of each triangle blocking flag. Bit B0 is not affected by the call, but the upper bits (B7 and above) are cleared for any triangle that is not blocked by the user.
The blocking flag allows one to maintain visibility information for all triangles of the mesh from two different viewpoints, which means that, by setting the triangle blocking mask parameters 'TBA' and 'TBX' appropriately, one can draw views from those two positions, on each view showing only the triangles visible from that viewpoint.
The argument IFLG allows the caller to say which conditions are to be tested for (as detailed below, in the section "Arguments"); when it is given the value 2 or 3, an algorithm is executed to determine which triangles are partially or completely hidden by other triangles. To run efficiently, this algorithm requires some integer workspace in IWRK; by default, it uses 2500 words, as specified by the value of 'IWB'; increasing the value of 'IWB' (and, of course, the declared length of IWRK) may make this algorithm run even faster. Some experimentation may be required to determine the optimum value to use.
RPNT (REAL array, dimensioned as specified in the last call to VTMESH, input) is the user's mesh-point array.
IEDG (INTEGER array, dimensioned as specified in the last call to VTMESH, input) is the user's edge array.
ITRI (INTEGER array, dimensioned as specified in the last call to VTMESH, input) is the user's triangle array.
RWRK (REAL array, dimensioned as specified in the last call to VTMESH or VTMVRW, input/output) is the current real workspace array.
IWRK (INTEGER array, dimensioned as specified in the last call to VTMESH or VTMVIW, input/output) is the current integer workspace array.
IFLG (INTEGER, input), is an expression, the value of which must be 0, 1, 2, or 3, with meanings as follows:
Let the low-order seven bits of each triangle's blocking flag be numbered (from left to right) B6, B5, B4, B3, B2, B1, and B0; the bits are assigned as follows:
B6 B5 B4 B3 B2 B1 B0 \ \ \ \ \ \ \__ reserved for user blocking of triangle \ \ \ \ \ \____ right (or only) eye, triangle seen from the wrong side \ \ \ \ \______ right (or only) eye, triangle edge-on to the line of sight \ \ \ \________ right (or only) eye, triangle hidden by other triangles \ \ \__________ left eye, triangle seen from the wrong side \ \____________ left eye, triangle edge-on to the line of sight \______________ left eye, triangle hidden by other trianglesThe user sets the B0 bits of the blocking flags directly; the routine VTTDBF is called to set the others. Subsequently, before drawing anything derived from the triangular mesh (streamlines, for example), a call to VTTDBM may be done to determine how the bits of the blocking flags are to be interpreted.
If the final argument (OTEP) in the last call to TDINIT (the offset to the eye position), was greater or equal to zero, VTTDBM will set bits B3, B2, B1, and B0 of 'TBA' and 'TBX', thus generating masks for the right (or only) eye; if OTEP was less than zero, VTTDBM will set bits B6, B5, B4, and B0 of 'TBA' and 'TBX', thus generating masks for the left eye.
Each bit of 'TBX' (an XOR mask) that is a "1" acts as a toggle for the corresponding bit of a triangle's blocking flag, reversing its meaning, while each bit of 'TBA' (an AND mask) that is a "1" acts as a selector for the corresponding bit of a triangle's blocking flag, selecting it as a meaningful bit for testing purposes.
For example, the call
C x x x x a a a a C h e w u h e w u CALL VTTDBM (0,0,0,0,1,1,1,1)says that no bits of the triangles' blocking flags are to be toggled and that all of the bits are to be capable of blocking the triangle. The effect will be to block all triangles that are hidden, edge-on, seen from the wrong side, or user-blocked.
The call
C x x x x a a a a C h e w u h e w u CALL VTTDBM (0,0,0,0,1,1,0,1)says that no bits of the triangles' blocking flags are to be toggled and that all of the bits except the "wrong-side" flag are to be capable of blocking the triangle. This allows one to (for example) draw the triangular-mesh edges, no matter which side of the mesh the triangles are seen from.
The call
C x x x x a a a a C h e w u h e w u CALL VTTDBM (1,1,1,0,1,1,1,1)says that the "hidden", "edge-on", and "wrong-side" bits of the triangles' blocking flags are to be toggled and that all of the bits in the flag are to be capable of blocking the triangle. This would allow one to use only those triangles that not blocked by the user, but are hidden, edge-on, or viewed from the wrong side. (It's not completely clear why one would want to do this, but it's possible to do it.)
IEBX (INTEGER, input), is an expression, the value of which must be 0 or 1, which provides the value of bit B5 or B2 of 'TBX'. This bit toggles the value of the "edge-on" bit of the triangle's blocking flag.
IWBX (INTEGER, input), is an expression, the value of which must be 0 or 1, which provides the value of bit B4 or B1 of 'TBX'. This bit toggles the value of the "wrong-side" bit of the triangle's blocking flag.
IUBX (INTEGER, input), is an expression, the value of which must be 0 or 1, which provides the value of bit B0 of 'TBX'. This bit toggles the value of the "user" bit of the triangle's blocking flag.
IHBA (INTEGER, input), is an expression, the value of which must be 0 or 1, which provides the value of bit B6 or B3 of 'TBA'. This bit masks the value of the "hidden" bit of the triangle's blocking flag.
IEBA (INTEGER, input), is an expression, the value of which must be 0 or 1, which provides the value of bit B5 or B2 of 'TBA'. This bit masks the value of the "edge-on" bit of the triangle's blocking flag.
IWBA (INTEGER, input), is an expression, the value of which must be 0 or 1, which provides the value of bit B4 or B1 of 'TBA'. This bit masks the value of the "wrong-side" bit of the triangle's blocking flag.
IUBA (INTEGER, input), is an expression, the value of which must be 0 or 1, which provides the value of bit B0 of 'TBA'. This bit masks the value of the "user" bit of the triangle's blocking flag.
RPNT (REAL array, dimensioned as specified in the last call to VTMESH, input) is the user's mesh-point array.
IEDG (INTEGER array, dimensioned as specified in the last call to VTMESH, input) is the user's edge array.
ITRI (INTEGER array, dimensioned as specified in the last call to VTMESH, input) is the user's triangle array.
RWRK (REAL array, dimensioned as specified in the last call to VTMESH or VTMVRW, input/output) is the current real workspace array.
IWRK (INTEGER array, dimensioned as specified in the last call to VTMESH or VTMVIW, input/output) is the current integer workspace array.
IDIA (INTEGER, input), if non-zero, is the index of an element in each edge node that acts as a flag to indicate whether that edge is to be drawn (zero) or not (non-zero). See the example "cttd01", for the analogous CONPACKT routine CTTDDM, which uses this feature to suppress the drawing of those edges of the mesh that were diagonals of the quadrilaterals of the original mesh from which the triangular mesh was created. Note that, if this feature is used, code must be inserted to create the specified elements in the edge nodes.
RPNT (REAL array, dimensioned as specified in the last call to VTMESH, input) is the user's mesh-point array.
IEDG (INTEGER array, dimensioned as specified in the last call to VTMESH, input) is the user's edge array.
ITRI (INTEGER array, dimensioned as specified in the last call to VTMESH, input) is the user's triangle array.
RWRK (REAL array, dimensioned as specified in the last call to VTMESH or VTMVRW, input/output) is the current real workspace array.
IWRK (INTEGER array, dimensioned as specified in the last call to VTMESH or VTMVIW, input/output) is the current integer workspace array.
The routine VTTMRG ("VaspackT, Triangular Mesh from Rectangular mesh on Globe") is intended to simplify the process of creating triangular meshes of a particular type: given arrays defining a rectangular grid of data deformed to wrap around the globe, it returns arrays defining a triangular mesh representing the data.
CALL VTTMRG (IDIM,JDIM, ! dimensioning information + RLAT,RLON,RDAT,ISCR, ! data arrays, scratch array + SVAL,RTMI, ! special value, index mapper + RPNT,MPNT,NPNT,LOPN, ! point node array + IEDG,MEDG,NEDG,LOEN, ! edge node array + ITRI,MTRI,NTRI,LOTN) ! triangle node array
JDIM (INTEGER, input) is the second dimension of the rectangular mesh.
RLAT and RLON (REAL arrays, dimensioned IDIM x JDIM, input) specify the latitudes and longitudes of the node points of the rectangular mesh. The mesh is the collection of quadrilaterals defined by corner points having indices (I,J), (I+1,J), (I,J+1), and (I+1,J+1), for all pairs (I,J) such that I is between 1 and IDIM-1, inclusive, and J is between 1 and JDIM-1, inclusive. The mesh may (and, indeed, probably will) touch itself along certain "seams", but it must not overlap itself.
RDAT (REAL array, dimensioned IDIM x JDIM, input) specifies the data values at the points of the rectangular mesh.
ISCR (INTEGER array, dimensioned IDIM x JDIM x 4, scratch) is a scratch array required by VTTMRG.
SVAL (REAL, input) is a value which, if used in the array RDAT, marks that datum as "special" or "missing". If there are no such values in the array RDAT, set SVAL to some value known not to occur in it.
RTMI ("Routine To Map Indices", user subroutine, input) is a user-defined subroutine describing how the edges of the rectangular mesh, as deformed onto the surface of the globe, fit together. RTMI allows VTTMRG to create a triangular mesh that contains only as many distinct points as there were different points in the rectangular mesh and that has no "seams" where the edges of the rectangular mesh came together.
RTMI must be declared EXTERNAL in the routine that calls VTTMRG; it will be called using FORTRAN statements like this:
CALL RTMI (IDIM,JDIM,IINI,JINI,IINO,JINO)The arguments IDIM and JDIM are as defined above. The arguments IINI and JINI are input expressions of type INTEGER defining the indices of a particular point of the rectangular mesh (where IINI is between 1 and IDIM and JINI is between 1 and JDIM, inclusive). The arguments IINO and JINO are output variables of type INTEGER that receive the values to be used for the specified point of the mesh in place of IINI and JINI. In general, IINO = IINI and JINO = JINI everywhere except at points that are coincident with other points of the mesh. For example, if the rectangular mesh wraps around the globe in such a way that the entire bottom and top edges of the mesh (for J = 1 and J = JDIM, respectively) each map into a single point (typically the south pole and the north pole, respectively) and the left and right edges of the mesh (for I = 1 and I = IDIM) are coincident on the globe, then one would define RTMI as follows:
SUBROUTINE RTMI (IDIM,JDIM,IINI,JINI,IINO,JINO) IF (JINI.EQ.1) THEN ! point in first row of mesh IINO=1 JINO=1 ELSE IF (JINI.EQ.JDIM) THEN ! point in last row of mesh IINO=1 JINO=JDIM ELSE IF (IINI.EQ.IDIM) THEN ! point in last column of mesh IINO=1 JINO=JINI ELSE ! all other points of the mesh IINO=IINI JINO=JINI END IF RETURN ENDRPNT (REAL array, dimensioned greater than or equal to MPNT x LOPN, output) receives the point array.
MPNT (INTEGER, input) is the dimension of RPNT.
NPNT (INTEGER, output) is the number of elements returned in RPNT (that is, the number of points in the triangular mesh, times LOPN).
LOPN (INTEGER, input) is the length of a point node.
IEDG (INTEGER array, dimensioned greater than or equal to MEDG x LOEN, output) receives the edge array.
MEDG (INTEGER, input) is the dimension of IEDG.
NEDG (INTEGER, output) is the number of elements returned in IEDG (that is, the number of edges of the triangular mesh, times LOEN).
LOEN (INTEGER, input) is the length of an edge node.
ITRI (INTEGER array, dimensioned greater than or equal to NTRI x LOTN, output) receives the triangle array.
MTRI (INTEGER, input) is the dimension of ITRI.
NTRI (INTEGER, output) is the number of elements returned in ITRI (that is, the number of triangles of the triangular mesh, times LOTN).
LOTN (INTEGER, input) is the length of a triangle node.
The routines VTTMTL ("VaspackT, Triangular Mesh from Triangle List") and VTTMTX (" ..., eXtended") make it relatively easy to obtain, from an collection of triangles in 3-space, a triangular mesh in the form required by VASPACKT. Of course, the collection isn't entirely arbitrary, since the triangles should fit together to form a mesh.
One need not supply information specifying which pairs of triangles adjoin; VTTMTL and VTTMTX can figure that out for themselves. However, it must be the case that, when two triangles have an edge in common, they have the entire edge in common (i.e., there must be at most one triangle to the left of each edge and at most one triangle to the right of each edge).
VTTMTL requires that the coordinates of a vertex that two triangles have in common be computed exactly the same in both triangles. Sometimes, this is a difficult thing to ensure; in such cases, one may call VTTMTX instead and provide an additional argument, EPST, that defines what it means for two coordinate values to be "identical". Note that VTTMTX is a little slower and it requires a larger scratch array IPPP for use in sorting the points (because the tree-sort nodes must contain backward pointers as well as forward pointers).
C C Declare the maximum number of points, edges, and triangles expected. C PARAMETER (MNOP=maximum_number_of_points,MPPP=MNOP) PARAMETER (MNOE=maximum_number_of_edges,MPPE=MNOE) PARAMETER (MNOT=maximum_number_of_triangles) C C Declare the lengths of a point node, an edge node, and a triangle C node, respectively. C PARAMETER (LOPN=4,LOEN=5,LOTN=4) C C Declare the lengths of the arrays in which the triangular mesh is to C be formed. C PARAMETER (MPNT=MNOP*LOPN) ! space for points PARAMETER (MEDG=MNOE*LOEN) ! space for edges PARAMETER (MTRI=MNOT*LOTN) ! space for triangles C C Declare the arrays to hold the point nodes, edge nodes, and triangle C nodes of the triangular mesh. C DIMENSION RPNT(MPNT),IEDG(MEDG),ITRI(MTRI) C C Declare a triangle buffer in which to store triangles temporarily. C This buffer makes it possible to randomize the order in which the C triangles of the mesh are processed. This is necessary to ensure C friendly behavior by the tree sorts that are done to identify points C and edges that more than one triangle have in common. The size of C the buffer (MBUF) and the number of triangles processed from it at c a time when the buffer is full (KBUF) are dependent on the size of C the user's triangular mesh. C PARAMETER (MBUF=5021,KBUF=173) C DIMENSION TBUF(18,MBUF) C C Declare a scratch array to be used to sort points. C DIMENSION IPPP(2,MPPP) C C Declare a scratch array to be used to sort edges. C DIMENSION IPPE(2,MPPE) C C Initialize various counters. C NPPP=0 ! number of points in point sorter NPPE=0 ! number of edges in edge sorter NBUF=0 ! number of triangles in triangle randomizing buffer NTRI=0 ! number of triangles in final triangle list C C Loop on the triangles in the mesh. C DO 101 I=1,number_of_triangles_in_arbitrary_mesh C C If the triangle buffer is full, process KBUF randomly-chosen C triangles from it, leaving the remainder at the beginning of C the buffer. C IF (NBUF.GE.MBUF) THEN CALL VTTMTL (KBUF, ! number to process + TBUF,MBUF,NBUF, ! triangle buffer + IPPP,MPPP,NPPP, ! point sorting array + IPPE,MPPE,NPPE, ! edge sorting array + RPNT,MPNT,NPNT,LOPN, ! point node array + IEDG,MEDG,NEDG,LOEN, ! edge node array + ITRI,MTRI,NTRI,LOTN) ! triangle node array END IF C C Generate triangle I and put it in the triangle buffer. C NBUF=NBUF+1 C TBUF( 1,NBUF)=X coordinate of point 1 of triangle I TBUF( 2,NBUF)=Y coordinate of point 1 of triangle I TBUF( 3,NBUF)=Z coordinate of point 1 of triangle I TBUF( 4,NBUF)=X flow component at point 1 of triangle I TBUF( 5,NBUF)=Y flow component at point 1 of triangle I TBUF( 6,NBUF)=Z flow component at point 1 of triangle I C TBUF( 7,NBUF)=X coordinate of point 2 of triangle I TBUF( 8,NBUF)=Y coordinate of point 2 of triangle I TBUF( 9,NBUF)=Z coordinate of point 2 of triangle I TBUF(10,NBUF)=X flow component at point 2 of triangle I TBUF(11,NBUF)=Y flow component at point 2 of triangle I TBUF(12,NBUF)=Z flow component at point 2 of triangle I C TBUF(13,NBUF)=X coordinate of point 3 of triangle I TBUF(14,NBUF)=Y coordinate of point 3 of triangle I TBUF(15,NBUF)=Z coordinate of point 3 of triangle I TBUF(16,NBUF)=X flow component at point 3 of triangle I TBUF(17,NBUF)=Y flow component at point 3 of triangle I TBUF(18,NBUF)=Z flow component at point 3 of triangle I C 101 CONTINUE C C Process any triangles that remain in the triangle buffer. C IF (NBUF.NE.0) THEN CALL VTTMTL (NBUF, ! number to process + TBUF,MBUF,NBUF, ! triangle buffer + IPPP,MPPP,NPPP, ! point sorting array + IPPE,MPPE,NPPE, ! edge sorting array + RPNT,MPNT,NPNT,LOPN, ! point node array + IEDG,MEDG,NEDG,LOEN, ! edge node array + ITRI,MTRI,NTRI,LOTN) ! triangle node array END IFNote that, if the triangle buffer is large enough to hold all the triangles of the mesh at once, the first call to VTTMTL and its enclosing block-IF can be omitted, since all the triangles will be processed out of the buffer by the second call to VTTMTL.
TBUF (REAL array, dimensioned 18 x MBUF, input) is an array of triangles that are to be used to create a triangular mesh. For each J from 1 to NBUF, the elements of TBUF(I,J), for I from 1 to 18, specify a triangle, as follows: TBUF(1,J) through TBUF(3,J) are the X, Y, and Z coordinates of point 1 and TBUF(4,J) through TBUF(6,J) are the X, Y, and Z components of the flow field associated with point 1; similarly, TBUF(7,J) through TBUF(12,J) define point 2 and TBUF(13,J) through TBUF(18,J) define point 3.
MBUF (INTEGER, input) is the second dimension of the array TBUF.
NBUF (INTEGER, input/output), is the number of triangles defined by the current contents of TBUF.
EPST (REAL, input, VTTMTX only), is an epsilon to be used in testing for equality of point coordinate values. Two coordinate values will be considered identical if the absolute value of the difference between them is less than or equal to EPST.
IPPP (INTEGER array, dimensioned 2 x MPPP (if VTTMTL is called) or 3 x MPPP (if VTTMTX is called), scratch) is a scratch array required by CTTMTL to sort points.
MPPP (INTEGER, input) is the second dimension of IPPP, which must be greater than or equal to the total number of distinct points in the triangular mesh.
NPPP (INTEGER, input/output) is the number of elements of IPPP used so far.
IPPE (INTEGER array, dimensioned 2 x MPPE, scratch) is a scratch array required by CTTMTL to sort edges.
MPPE (INTEGER, input) is the second dimension of IPPE, which must be greater than or equal to the total number of distinct edges in the triangular mesh.
NPPE (INTEGER, input/output) is the number of elements of IPPE used so far.
RPNT (REAL array, dimensioned greater than or equal to MPNT x LOPN, output) receives the point array.
MPNT (INTEGER, input) is the dimension of RPNT.
NPNT (INTEGER, output) is the number of elements returned in RPNT (that is, the number of points in the triangular mesh, times LOPN).
LOPN (INTEGER, input) is the length of a point node.
IEDG (INTEGER array, dimensioned greater than or equal to MEDG x LOEN, output) receives the edge array.
MEDG (INTEGER, input) is the dimension of IEDG.
NEDG (INTEGER, output) is the number of elements returned in IEDG (that is, the number of edges of the triangular mesh, times LOEN).
LOEN (INTEGER, input) is the length of an edge node.
ITRI (INTEGER array, dimensioned greater than or equal to NTRI x LOTN, output) receives the triangle array.
MTRI (INTEGER, input) is the dimension of ITRI.
NTRI (INTEGER, output) is the number of elements returned in ITRI (that is, the number of triangles of the triangular mesh, times LOTN).
LOTN (INTEGER, input) is the length of a triangle node.
Draws a "vector rose" on a globe centered at (0,0,0) and having a radius RADI. The center of the rose is specified by the latitude RLAT and the longitude RLON. The "zero line" of the rose (the first of its component vectors) is assumed to point north.
The "vector rose" consists of NVEC equally-spaced vectors radiating from the center point and tangent to the surface of the globe. Depending on the values of VMIN and VMAX, each vector is drawn either once or twice (with different lengths, in the latter case). The arguments ICOL, CMIN, and CMAX determine the colors to be used. If the vector rose is to be masked against an existing area map, the arguments IAMA and RTPL come into play.
RLAT (REAL, input) is the latitude of the center of the vector rose, in degrees.
RLON (REAL, input) is the longitude of the center of the vector rose, in degrees.
NVEC (INTEGER, input) is the number of equally-spaced positions at which vectors are to be drawn, emanating from the point (RLAT,RLON) and tangent to the surface of the globe.
VMIN and VMAX (REAL, input) specify the lengths of the two vectors to be drawn in each of NVEC directions. If VMIN and VMAX are equal, only one vector will be drawn in each direction, except that, if both VMIN and VMAX are zero, the vector lengths used will be as implied by the current values of the VASPACKT parameters 'VFR' and 'VRL'.
ICOL (INTEGER, input) is a flag saying whether or not the vectors are to be drawn in color. If ICOL is zero, they are drawn in the color specified by the current value of the polyline color index. If ICOL is non-zero, the values of CMIN and CMAX will be used to determine the colors to be used.
CMIN and CMAX (REAL, input), if ICOL is non-zero, are values of the associated field being used to determine the colors of vectors and streamlines drawn by VASPACKT. (Even if ICOL is zero, though, the values of CMIN and CMAX must be valid real values that will not cause arithmetic problems.)
IAMA (INTEGER array, dimensioned as specified in a call to ARINAM, in the package AREAS, input/output) is an array containing an area map which is to be used to mask the simple vectors as they are drawn. If no masking is desired, use an array with its first element zeroed.
RTPL (EXTERNAL subroutine) is the user subroutine which is to process the polylines which result from masking the vectors against the area map. It must be declared EXTERNAL in the routine which calls VTVRLL. It will be called repeatedly and must have the following form:
SUBROUTINE RTPL (XCS,YCS,NCS,IAI,IAG,NAI) DIMENSION XCS(*),YCS(*),IAI(*),IAG(*) ... (CODE TO PROCESS POLYLINE DEFINED BY ARGUMENTS) ... RETURN ENDThe real arrays XCS and YCS hold the X and Y coordinates of NCS points defining a polyline which is to be considered for drawing. For each I greater than or equal to 1 and less than or equal to NAI, IAI(I) is the area identifier for the area in which the polyline lies, relative to the edge group IAG(I). The X and Y coordinates are all normalized device coordinates and it may be assumed that the appropriate SET call has been done. If it is decided to draw the line, it may be done with a call to the SPPS routine CURVE, to the DASHCHAR routine CURVED, to the DASHPACK routine DPCURV, or to the GKS routine GPL.
If the only object of masking is to avoid drawing curly vectors through areas having negative area identifiers, then the routine VTDRPL may be used for RTPL. In the routine that calls VTVRLL, insert the declaration
EXTERNAL VTDRPLand then use VTDRPL for the last argument.
For more information, see the description of the argument LPR of the AREAS subroutine ARDRLN.
In general, once a parameter is given a particular value, it retains that value until it is given a new value.
CALL VTSETI ('AHA - ARROWHEAD ANGULAR WIDTH',45)The additional characters make it much easier to remember what the call is intended to do.
CALL VTSETI ('AHA - ARROWHEAD ANGULAR WIDTH',30) CALL VTSETR ('AHA - ARROWHEAD ANGULAR WIDTH',30.)to set the arrowhead angular width (which is intrinsically REAL) to 30 degrees. The first has the virtue of being one character shorter. Similarly, one could use either of the two statements
CALL VTSETI ('DBG - DEBUG FLAG',1) CALL VTSETR ('DBG - DEBUG FLAG',1.)to set 'DBG' (which is intrinsically INTEGER) to 1. (In this case, of course, the first of the two statements seems to make better sense.) If a REAL parameter is to be given a non-integral value (like 3.14159), then VTSETR must be used, of course.
CALL VTSETI ('PAI - PARAMETER ARRAY INDEX',10) CALL VTSETR ('TVL - COLOR THRESHOLD VALUES',196.3)
The parameter 'AEL' has no meaningful default value.
The default value of 'AHA' is 30.
The default value of 'AHL' is .04.
The default value of 'AHS' is .16.
This parameter has the effect of restricting the places where curly vectors, streamline generators, and streamlines start to portions of the mesh where the velocity field is relatively smooth.
See also the description of 'AM2', which is used in a similar fashion.
The default value of 'AM1' is 90.
Setting this parameter non-zero has the effect of terminating curly vectors and streamlines that enter portions of the mesh where the velocity field is relatively non-smooth.
The default value of 'AM2' is 0.
The parameter array 'CLR' contains no meaningful default values.
The parameter 'CTM' has no meaningful default value.
The default value of 'CWM' is 1.
Related parameters are 'SGC', 'STC', and 'TTC', which can be used to set the colors of different types of debug lines being drawn.
The default value of 'DBG' is 0.
The parameter 'DMN' has no meaningful default value.
The parameter 'DMX' has no meaningful default value.
The parameter 'DVA' has no meaningful default value.
The parameter 'DVU' has no meaningful default value.
The parameter 'EOM' has no meaningful default value.
The default value of 'ILA' is 0.
The default value of 'ILB' is 0.
The default value of 'ILC' is -1.
The default value of 'ILL' is 0.
The default value of 'ILP' is 4, so the upper right-hand corner of the box will be placed on the point ('ILX', 'ILY').
The default value of 'ILS' is .012.
$DMN$ - THE MINIMUM VALUE IN THE DATA ARRAY. $DMX$ - THE MAXIMUM VALUE IN THE DATA ARRAY. $SFU$ - THE CURRENT SCALE FACTOR.In each case except $SFU$, the given value will have been divided by the current scale factor. A "U" may be inserted just before the final "$" (as in '$DMNU$') to request the use of an unscaled value.
If 'ILT' is given the value ' ' (a single blank), there will be no informational label.
The default value of 'ILT' is 'SCALE FACTOR IS $SFU$'.
The default value of 'ILW' is .005.
The default value of 'ILX' is .98.
The default value of 'ILY' is -.02.
The default value of 'ISP' is zero.
The default value of 'IWB' is 2500.
The default value of 'LBC' is 0, which specifies the background color.
The default value of 'LBX' is 0.
The default value of 'LBY' is 0.
Of course, one can replace the routine VTMXYZ and build as many different mappings into it as desired, but the above mappings should be included. See the description of VTMXYZ.
The default value of 'MAP' is 0.
The default value of 'NEL' is 0.
The default value of 'NET' is 1.
The default value of 'NEU' is 5.
USING 'NLS'=0: .500 1.00 1.50 ... 9.50 10.5 ... USING 'NLS'=1: .5 1.0 1.5 ... 9.5 10.5 ...The default value of 'NLS' is 1.
The default value of 'NLV' is zero.
The default value of 'NLZ' is 0.
Contour line labels generated by VASPACKT and values in the informational label which are known to have been rounded to "nice" values (like '$CIU$', '$CMN$', and '$CMX$') will have trailing zeroes trimmed in any case, no matter what the value of 'NOF' is.
The default value of 'NOF' is 6 (4 + 2).
The default value of 'NSD' is 4.
When 'MAP' = 1, a good value for 'ORV' is 1.E12, since that value is returned by EZMAP routines to signal such a point.
The default value of 'ORV' is 0.
CALL VTSETI ('PAI - PARAMETER ARRAY INDEX',10) CALL VTSETI ('CLR - COLOR INDEX',14)The default value of 'PAI' is 0.
The default position of the projection center is (0,0,0), which is appropriate for a triangular mesh representing a sphere.
The default position of the projection center is (0,0,0), which is appropriate for a triangular mesh representing a sphere.
The default position of the projection center is (0,0,0), which is appropriate for a triangular mesh representing a sphere.
A negative value of 'PIS' causes ABS('PIS') points to be interpolated, but the interpolated points are not, in general, used to draw the line segment; the object, in this case, is simply to do a finer search for changes in visibility (out-of-range state, as defined by values of 'ORV' returned by the routine VTMXYZ) along the segment.
See also the description of 'PIT', which can be used to cause the interpolation of points on segments of streamlines only in regions where the mapping causes great distortion.
The default value of 'PIC' is 0.
The use of 'PIT' does not entirely replace the use of 'PIS'; indeed, there are situations in which both can be used to good advantage, particularly when negative values of 'PIS' are used to improve the resolution of the search for changes in out-of-range state along the line segments.
The default value of 'PIT' is 0. It's probably not a good idea to use values less than about .001 or greater than about .1.
The default value of 'RNG' is zero.
Arguments 5-8 of a SET call done by the user must be consistent with the ranges of the X and Y coordinates being used by VASPACKT, as specified by the X, Y, and Z coordinates of the points of the triangular mesh, the value of 'MAP', and, if 'MAP' is non-zero, the code of the routine VTMXYZ.
The default value of 'SET' is 1.
The default value of 'SGC' is 1.
The default value of 'SLL' is 8.
The default value of 'SLP' is .001.
The default value of 'SLS' is .072.
The default value of 'STC' is 1.
If 'SVS' is greater than zero, its value is interpreted as specified by 'ISP': if 'ISP' is zero, then 'SVS' is an actual length in the coordinate system used for the triangular mesh, but, if 'ISP' is non-zero, then 'SVS' is a multiple of 'EOM'.
The default value of 'SVS' is zero.
Using a "1" for one of the twelve bits of 'TBX' causes the corresponding bit of a triangle blocking flag to be toggled, so that its meaning is reversed. Using a "1" for one of the twelve bits of 'TBA' causes the corresponding bit of a triangle blocking flag to be examined, so that its value is significant in determining blocking of the triangle.
By convention, the rightmost bit of a triangle blocking flag is reserved for direct blocking of triangles by the user of VASPACKT. See the routines VTTDBF and VTTDBM for a description of a scheme that uses a total of six other bits to effect blocking of triangles that are hidden, edge-on, and/or seen from the wrong side by one of the two eyes in the case where VASPACKT is being used in conjunction with TDPACK to draw a perspective view of a triangular mesh.
The default value of 'TBA' is 1 (only the lowest bit of a triangle blocking flag is significant) and the default value of 'TBX' is 0 (none of the bits of a triangle blocking flag are toggled).
The default value of 'TTC' is 1.
See the discussion of termination tests in the description of 'TTS', next.
'TTL' must be given a positive value, which will be interpreted as specified by 'ISP': if 'ISP' is zero, then 'TTL' is an actual length in the coordinate system used for the triangular mesh, but, if 'ISP' is non-zero, then 'TTL' is a multiple of 'EOM'.
The default value of 'TTL' is .018.
What are "termination tests"? Periodically, as each streamline is traced (at intervals of 'TTS'), the code traces two little lines (of length 'TTL') - one line in each of the two possible directions - that start on the streamline and are everywhere perpendicular to the flow field. If either of these little lines crosses a previously-drawn streamline, tracing of the current streamline is terminated.)
'TTS' must be given a positive value, which will be interpreted as specified by 'ISP': if 'ISP' is zero, then 'TTS' is an actual length in the coordinate system used for the triangular mesh, but, if 'ISP' is non-zero, then 'TTS' is a multiple of 'EOM'.
The default values of 'SLS', 'TTS', and 'TTL' are such that 'SLS' is twice as large as 'TTS', which is itself twice as large as 'TTL'; experiments indicate that this works relatively well. Note that giving 'TTL' a value greater than that of 'SLS' is a bad idea, since then each streamline would be terminated as soon as it began.
The default value of 'TTS' is .036.
The value ranges are determined by the values in 'TVL'. Let S be the interpolated value of the auxiliary data field at the center of a streamline segment, T_{I} the value of the I^{th} element of 'TVL', C_{I} the value of the I^{th} element of 'CLR', and N the value of 'NLV'. Then:
If 'CTV' is given a positive value, VASPACKT will supply values in 'TVL' (during the call to VTMESH). The value used for T_{I} (assuming minimum and maximum values in the auxiliary data field of T_{min} and T_{max}) will be T_{min}+REAL(I)*(T_{max}-T_{min})/REAL(N).
The parameter array 'CLR' contains no meaningful default values.
'VFR' * 'VRL'_{R} + (1. - 'VFR') * 'VRL'_{R} * ( V / 'VRM'_{R} )
Note that, if 'VFR' is zero, the vector lengths used range from zero to 'VRL' and are linearly related to the magnitude of the flow field, while, if 'VFR' is one, all of the vectors are of length 'VRL', no matter what the magnitude of the flow field is. For values of 'VFR' between zero and one, a specified portion of the length is always present and the remainder of the length reflects the strength of the flow field.
The default value of 'VFR' is zero.
The default value of 'VPB' is .05.
The default value of 'VPL' is .05.
The default value of 'VPR' is .95.
The default value of 'VPS' is .25.
The default value of 'VPT' is .95.
The default value of 'VRL' is zero.
The default value of 'VRM' is zero.
The default value of 'VVM' is zero.
The default value of 'WDB' is 0.
The default value of 'WDL' is 0.
The default value of 'WDR' is 0.
The default value of 'WDT' is 0.
The default value of 'WSO' is 1.
The default value of 'ZFA' is 0.
The default value of 'ZFB' is 0.
The default value of 'ZFC' is -1.
The default value of 'ZFF' (prior to any call to VTMESH) is zero.
The default value of 'ZFL' is 0.
The default value of 'ZFP' is 0, so the zero-field label will be centered on the point whose coordinates are 'ZFX' and 'ZFY'.
The default value of 'ZFS' is .012.
If 'ZFT' is given the value ' ' (a single blank), the constant-field label will not be written.
The default value of 'ZFT' is 'ZERO FIELD'.
The default value of 'ZFW' is .005.
The default value of 'ZFX' is .5, so the zero-field label is centered horizontally in the viewport.
The default value of 'ZFY' is .5, so the zero-field label is centered vertically in the viewport.
By default, SETER prints a line and STOPs. The line printed will look something like this:
ERROR 3 IN VTGRWS - REAL WORKSPACE OVERFLOWThe error number ("3", in the example) may be of use to a consultant (to determine exactly where the error occurred), but is not otherwise meaningful. The actual error message consists of the name of the routine in which the error occurred ("VTGRWS", in the example), a blank, a minus sign, another blank, and, lastly, a short description of the error.
All errors are "recoverable" in the sense that, if the user program puts SETER into "recovery mode", control will be returned to the caller of the VASPACKT routine in which the error occurred. In some cases, it is then possible to take remedial action to get around whatever problem has occurred; in any case, the error flag can be cleared and execution of the user's program can continue.
When SETER is in recovery mode (and, occasionally, even when it is not), error messages may have a somewhat more complicated form, like this:
VTSLDM/VTGRWS - REAL WORKSPACE OVERFLOWWhat this particular error message says is that VTSLDM called VTGRWS, which detected an error condition (real workspace overflow) and called SETER. Upon getting control back from VTGRWS, VTSLDM detected the fact that VTGRWS had logged an error. It augmented the error message by prepending its own name, followed by a slash, and then passed control back to the user. Of course, there can be more than two such levels of routine calls indicated in the error message: in a few cases, seven or eight routine names may be listed, each separated from the next by a slash.
The various error conditions in VASPACKT are described in the list below. Each bulleted item includes an error message and a thumb-nail description of the error. The items in the list are arranged in alphabetical order. If you get an error message with one or more prefixed subroutine names, as described above, omit them and look up the result in this list. Note that, since VASPACKT routines sometimes call other routines, elsewhere in NCAR Graphics, that can detect error conditions and call SETER, the error message you get by calling a VASPACKT routine may not be listed here, but in the programmer document for some other package.
ncargex example_namewhere "example_name" is one of the following:
vtex01 vtex02 vtex03To obtain the code for an example without running it, one uses the command
ncargex -n example_nameAfter the code has been examined and, perhaps, modified, it can be compiled and executed using the commands
ncargf77 *.f a.outThe metafile created by executing an example can be viewed using the command
ctrans metafile_name(It may be necessary to set some environment variables and/or to set other options on the "ctrans" command line.)
Most of the example code is heavily commented to explain what is being done and it is heavily parameterized. For example, one can easily specify the nature of the workstation being used (NCGM, X Windows, PostScript, or PDF in portrait or landscape mode). In many cases, one can select which of the plots an example can draw will actually be drawn and what the resolution of the triangular mesh used in the example will be. In the case of 3D plots, one can easily change the vantage point from which the mesh is viewed, its distance from the eye, whether stereo views or a single view will be drawn, and so on.