Ben Domenico
Daniel E. Vietor and Ernest M. Agee
To produce such a picture, the researcher writes an applications program that uses the map generation (EZMAP) and contouring (CONRAN and CONREC) utilities within the NCAR Graphics library. This application calls EZMAP routines to generate the base map and CONRAN or CONREC routines to produce the contour lines representing the data. Titles and labels may be added by calling the appropriate routines for annotating the final plot. Until recently, the only form of output from the package was NCAR metacode, which is stored in a disk file. A separate program, called a metacode translator, reads the metacode file and generates specific instructions to produce the picture on a particular graphics device.
An important thing to note here is that, while the researcher has to write the applications program, he or she can produce a reasonably good contour plot and basemap on quite a variety of graphics devices without delving into the details of contouring algorithms of map projection transformations. Moreover, since metacode translators have been written for most of the common graphics devices, there is no need to learn the special instruction sets for driving specialized graphics devices. In addition to such direct uses of the graphics software, many research groups with data display requirements that go beyond the capability of NCAR graphics use portions of the existing package as a template for generating their own tailored graphics library.
On the other side of the coin, the old form of NCAR Graphics has many noticeable limitations--especially in the world of graphics workstations and personal computers. The old version served well in the batch supercomputing environment at NCAR, but does not take advantage of the capabilities of interactive computing systems: there is no provision for graphics input and the only form of output is metacode which has to be translated by a separate program. Furthermore, the old system has no consistent mechanism for dealing with color, for filling polygon shaped areas, of for displaying raster images. There is no mechanism for taking advantage of these facilities on modern interactive computer systems.
The GKS standard includes a Fortran binding that specifies the names and arguments of the library of routines that comprise a standard system. Many of these routines duplicate the functionality of the old NSPP routines, but there are also many other routines for producing pictures with color, filled areas, raster images, etc. Some examples of GKS output primitives are POLYLINE for drawing lines between multiple sets of points; TEXT for writing characters in a plot; FILL AREA for filling polygons with color of patterns; and CELL ARRAY for plotting raster image data.
Thus a transition to GKS can retain the best features of the old package, namely portability and device-independence. At the same time, a GKS-based application has access graphics input facilities and extended output facilities. GKS also eliminates the need for the intermediate step of creating a metacode file. While there is a provision for storing pictures in a standard Computer Graphics Metafile (CGM), GKS can drive graphics devices directly. For example, one might construct a contour plot using the new version Of CONREC, then write the application go that the user can use graphics input to specify a portion of the picture to "zoom in" on.
The graphics utilities are the heart of the NCAR graphics. They provide many of the graphics functions commonly needed by scientists and engineers. Some of the popular packages are: CONREC for contour plots of regularly-spaced data; CONRAN for contour plots of randomly-spaced data; EZMAP for geographical maps using various projections; AUTOGRAPH for X-Y plots; SRFACE for representing two-dimensional data field as a surface in three dimensions; VELVCT for displaying velocity vector fields; and THREED and ISOSRF for producing wire-frame representations of three-dimensional data.
The layering of the old system makes it possible to replace the NCAR System Plot Package (NSPP) with GKS, since GKS provides a standard subroutine library which includes most of the functions of the NSPP. In somewhat oversimplified terms, subroutine calls from the utility packages to the old NSPP routines were replaced with calls to GKS routines. This approach made it possible to produce a standardized version of the utilities with only minimal alterations of the interface to the utilities.
While the NSPP routines were being replaced by GKS, the code was also converted to Fortran 77, so that it would conform to international standards for language as well as for graphics. To ease the transition for existing applications which called the old NSPP directly and to supply NSPP functions missing in GKS (log-log plotting coordinates for example), a library called the System Plot Package Simulator (SPPS) was added to the utilities layer.
The graphics package contains several demonstration programs in order to show the capabilities of the various graphics subroutines.
NCAR Graphics on the IBM microcomputers uses GKS from which graphics metacode is produced and sent to the Virtual Device Interface (VDI). The VDI allows the computer to access general input/output devices independent of the applications program. The interface receives the generic metacode and directs it to one of the many I/O device drivers that have been loaded into the computer. The device drivers convert the metacode into specific commands for the particular I/O device. Therefore, the device driver takes the place of the metacode translator in the old package.
The new version of NCAR Graphics does not take care of all of the GKS initialization. Subroutines exist within the package to accomplish some of the initialization but these may not work for a specific computer and application. Therefore, editing of various parameters like I/O devices and GKS working space and relinking the program may be necessary. Also, additional GKS routines can be integrated into NCAR Graphics applications in order to accomplish tasks not incorporated into the NCAR package.
The current version of NCAR Graphics still lacks an interactive environment. The future goal for NCAR Graphics is to incorporate the interactive routine available within GKS in order to upgrade the package to the level Of GEMPAK/GEMPLT and McIDAS. This will allow the use of input devices like mouses, light-pens and keyboards to edit the output graphics displays. This may include color fill of contour intervals, overlaying contour fields on satellite imagery and selecting three-dimensional viewing angles. The higher level GKS routines will soon carry the capabilities of the NCAR Graphics far beyond its current batch environment into the future of interactive graphics.
The authors are grateful for the help and support of their colleagues Carla Breiner, research associate; Bret Pennington and Keith Lingwall, computer technicians. This research was supported in part by NSF Grants ATM-8506124 and ATM-8505477, and DOD-ONR Grant N00014-86-K-0179 awarded to Purdue University.
Barnes, S. L. , 1964: A technique for maximizing detail in numerical weather map analysis. J. Appl. Meteor., 3, 396-409.