ncarg_gks - NCAR Graphics GKS Environment variables
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
cgm2ncgm(1NCARG), ncargintro(5NCARG), ncarg_env(5NCARG)
Copyright (C) 1987-2002
University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.