Previous chapter LLUs Home Next chapter Index
envA list of all the environment variables that have been set will be shown, along with their values.
If you don't have either NCARG_ROOT, or NCARG_BIN, NCARG_LIB, and NCARG_INCLUDE set, then please contact the person who installed NCAR Graphics at your site for information on how to set them.
"Appendix D: A pictorial guide to NCAR Graphics examples" provides grayscale prints of the example plots available via ncargex. Choose one that does something like what you want to do, then type:
ncargex examplewhere example is the name under the plot of your choice.
The ncargex command puts several files in your current working directory. The file example.f is the main program that you will want to modify, and the file example.ncgm is the NCAR Graphics Computer Graphics Metafile (NCGM) that is created when the example is compiled and executed. Other files that are created when you run ncargex include an executable file named example, and occasionally, a file full of support routines for the main program.
Before you modify an example program, please study the "Writing a graphics program" chapter of this guide so that you understand what the different calls do. Also, when modifying an example program, we recommend that you comment out lines of code and run the example to check the result first. You may then decide to remove some of the code that you commented out: this prevents you from removing something critical, then later finding that you have to locate and replace a deleted line.
For a C program, execute:
ncargcc example.cWhere example.c is the name of the program you want to compile.
For a Fortran program, execute:
ncargf77 example.fWhere example.f is the name of the program you want to compile.
a.outWhen you run your program, one of two things will happen depending on the workstation type you have chosen. Either output will be displayed directly on your X Windows workstation, or an NCGM will be created. By default, NCGM files are named gmeta.
If you choose to create an NCGM file, the rest of this section gives you an overview of your viewing and editing options.
To view an NCGM file, it must be translated into commands that your terminal, workstation, or printer recognizes. The translator that does this is called ctrans, and it can be accessed directly or through either a command line interface called ictrans or a graphical user interface (GUI) called idt. If you are working on a terminal or workstation that is not running X Windows, you should use ictrans. If you are working on an X terminal or a workstation running X Windows, you will probably want to use idt, although ictrans will also work.
If you have run ncargex example, which produces an NCGM named example.ncgm, and you are working on a Tektronix 4107 graphics terminal, you can view example.ncgm by typing either:
setenv GRAPHCAP t4107or:
ictrans -d t4107 example.ncgmTyping "1p" directs the translator to plot frame 1. When the plotting is complete, a "<READY>" prompt appears; you must then press RETURN in your terminal window before a new "ictrans>" prompt will be displayed. If the example program only produces a single frame, then entering "2p" will result in an error message.
Many ictrans commands are available for interactive viewing of your metafiles. You can find out about other ictrans commands by typing the abbreviation for the help command:
ictrans> hAll ictrans commands can be abbreviated to the shortest unique string, just as the "h" above stands for "help."
To exit ictrans, type:
ictrans> qMore information about ictrans appears on the man page for ictrans and in the "Viewing and editing your NCGMs and raster images."
localstation> setenv GRAPHCAP X11
localstation> setenv DISPLAY 0:0
localstation> idt example.ncgm
mainframe> setenv GRAPHCAP X11Two idt windows will come up. Use the window with the "pushbutton" controls to plot your frames. Complete instructions for using idt appear in the chapter "Viewing and editing your CGMs and raster images."
mainframe> setenv DISPLAY localstation.domain:0
mainframe> idt example.ncgm
In both of the preceding examples, we have set the environment variables using the C shell. If you are using a different shell, use the man page for your shell to learn how to set environment variables. If you frequently use the same type of graphics display, you can set these variables in your .login, .cshrc, or .profile file so that they are set automatically every time you log in. In example 2, the computer named localstation must have been configured to allow X11 requests from the computer named mainframe. See the man page on xhost, or consult your system administrator if necessary.
For further details about viewing and editing images, see the chapter "Viewing and editing your CGMs and raster images."
Previous chapter LLUs Home Next chapter Index