ncl_ncarg_gks man page

NCAR Graphics GKS — Environment variables

Synopsis

A collection of environment variables allows you to control certain aspects of NCAR Graphics' GKS behaviour.

Ncarg_gks_output allows you to specify what file or process CGM output is directed to.

Ncarg_gks_psoutput allows you to specify what file any PostScript output from NCAR GKS is directed to (stdout is allowed).

Ncarg_gks_pdfoutput allows you to specify what file any PDF output from NCAR GKS is directed to (stdout is allowed).

Ncarg_gks_gencgm allows you to request that the NCAR GKS package generate binary encoded CGM rather than NCGM (the NCAR private encoding of binary encoded CGM). Note that other NCAR Graphics utilities, such as the metafile translators, cannot read in generic CGM.

Ncarg_gks_bufsize provides you with control over how CGM output is buffered.

NCARG_GKS_DEBUG, if set, will result in debugging information about the GKS I/O subsystem being output to standard out.

Ncarg_gks_output

By default, CGM output is directed to a file called "gmeta", but the environment variable Ncarg_gks_output can be used to redirect output to a file with a different name or a translator process.

Examples:

setenv Ncarg_gks_output myfile

causes CGM output to be placed in "myfile".

setenv Ncarg_gks_output "|ctrans"

causes the "ctrans" translator to be forked and CGM output piped to it.

setenv Ncarg_gks_output "|"

causes a default translator to be forked and CGM output to be piped to it. Note that not just any process can be used here because it is assumed that the process is invoked as "translatorname -" where the "-" indicates that the translator is to read from standard input.

Ncarg_gks_psoutput

By default, PostScript output is written to "gmetaNN.sfx" where "NN" is the NCAR GKS workstation ID used in the call to GOPWK to open the workstation and "sfx" is "ps", "eps", or "epsi" as appropriate. Setting Ncarg_gks_psoutput will override all defaults and write any PostScript output to the designated file.

Examples:

setenv Ncarg_gks_psoutput myfile

causes all PostScript output to be written to "myfile".

setenv Ncarg_gks_psoutput stdout

causes all PostScript output to be written to standard out.

Ncarg_gks_pdfoutput

By default, PDF output is written to "gmetaNN.pdf" where "NN" is the NCAR GKS workstation ID used in the call to GOPWK to open the workstation. Setting Ncarg_gks_pdfoutput will override all defaults and write any PDF output to the designated file.

Examples:

setenv Ncarg_gks_pdfoutput myfile

causes all PDF output to be written to "myfile".

setenv Ncarg_gks_pdfoutput stdout

causes all PDF output to be written to standard out.

Ncarg_gks_gencgm

If the Ncarg_gks_gencgm environment variable is set, GKS will strip off the NCAR wrapper and generate a binary encode CGM. As mentioned above, other NCAR Graphics utilities such as translators don't yet support generic CGM as input. Thus, this option is useful primarily for getting CGM output into a form appropriate for use with other software packages that expect binary encoded CGM.

Example:

setenv Ncarg_gks_gencgm

Ncarg_gks_bufsize

If output is to a standard file, buffered I/O is used and the Ncarg_gks_bufsize environment variable provides you with some flexibility in specifying buffer size.

On Cray systems, the default buffer size is 1MB. All others use whatever the system default is, as specified in the file "stdio.h".

If the environment variable Ncarg_gks_bufsize is set, it overrides the defaults. If Ncarg_gks_bufsize is set to N, behavior is as follows:

If N is 0:

CGM output is unbuffered.

If N is not 0:

Buffer Size = N * 1024 bytes.

Examples

Let's suppose you're running a long multi-frame graphics job on a Cray supercomputer and you'd like to use a very large I/O buffer. The default for a Cray is 1MB but you'd like to make it 2MB.

setenv Ncarg_gks_bufsize 2048

Now let's assume you're on the same Cray computer, but you want to pipe you're output to a translator and view the frames as they come up. A big buffer is a bad idea because your CGM might not be flushed out every frame. You can make the output unbuffered as follows:

setenv NCARG_GKS_OUTPUT "|ctrans"
setenv NCARG_GKS_BUFSIZE 0

As a final example, let's say you're running the big multi-frame NCAR Graphics job on a Sun, which happens to have a default buffer size of 1024 bytes (look in /usr/include/stdio.h). Specify a 1MB buffer using:

setenv Ncarg_gks_bufsize 1024

Caveats

It's worth saying one more time: if you output binary encoded CGM rather than NCGM (NCAR CGM), NCAR Graphics generally won't deal with it. The one exception is that you can convert the file back to NCGM using cgm2ncgm.

See Also

cgm2ncgm(1NCARG), ncargintro(5NCARG), ncarg_env(5NCARG)

Info

January 1992 NCAR NCAR GRAPHICS