NCARG_GKS(1NCAR)

πŸ’– ncarg_gks β€” the NCAR Graphics GKS environment variables (1NCAR, NCAR GRAPHICS) πŸ’–

okay bestie, gather round, because this one is literally just a big pile of environment variables that let you boss around how NCAR Graphics' GKS behaves. no command, no flags, just vibes you set in your shell and the library obeys. it's giving puppet master. πŸŽ€


✨ SYNOPSIS ✨

a whole collection of environment variables lets you control certain aspects of NCAR Graphics' GKS behaviour. here's the lineup, no cap:

  • NCARG_GKS_OUTPUT lets you specify what file or process CGM output is directed to.
  • NCARG_GKS_PSOUTPUT lets you specify what file any PostScript output from NCAR GKS is directed to (and yeah, stdout is allowed πŸ‘‘).
  • NCARG_GKS_PDFOUTPUT lets you specify what file any PDF output from NCAR GKS is directed to (also, stdout is allowed πŸ’…).
  • NCARG_GKS_GENCGM lets you request that the NCAR GKS package generate binary encoded CGM rather than NCGM (which is the NCAR private encoding of binary encoded CGM). heads up though: other NCAR Graphics utilities, like the metafile translators, cannot read in generic CGM. not a single one. 😭
  • NCARG_GKS_BUFSIZE gives you 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. it's the "tell me everything" button 🫢

🌸 NCARG_GKS_OUTPUT 🌸

by default, CGM output is directed to a file called gmeta, but bestie, the environment variable NCARG_GKS_OUTPUT can be used to redirect output to a file with a different name or to a translator process. glow-up for your filenames ✨

Examples:

setenv NCARG_GKS_OUTPUT myfile

this causes CGM output to be placed in myfile. iconic.

setenv NCARG_GKS_OUTPUT "|ctrans"

this causes the ctrans translator to be forked and CGM output piped to it. feeding it straight into the machine πŸ“

setenv NCARG_GKS_OUTPUT "|"

this causes a default translator to be forked and CGM output to be piped to it. now listen β€” not just any process can be used here, because it's assumed that the process is invoked as translatorname - where the - indicates that the translator is to read from standard input. so no random little guy off the street, okay? πŸ’€


πŸ¦‹ 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. periodt.

Examples:

setenv NCARG_GKS_PSOUTPUT myfile

this causes all PostScript output to be written to myfile.

setenv NCARG_GKS_PSOUTPUT stdout

this causes all PostScript output to be written to standard out. straight to the terminal, main character energy πŸ’…


🌈 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. she's consistent like that πŸ’–

Examples:

setenv NCARG_GKS_PDFOUTPUT myfile

this causes all PDF output to be written to myfile.

setenv NCARG_GKS_PDFOUTPUT stdout

this 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 encoded CGM. and as mentioned above, other NCAR Graphics utilities such as translators don't yet support generic CGM as input. so this option is useful primarily for getting CGM output into a form appropriate for use with other software packages that expect binary encoded CGM. iykyk 🧚

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. choose your own adventure, bestie.

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, because we love a rerun: if you output binary encoded CGM rather than NCGM (NCAR CGM), NCAR Graphics generally won't deal with it. she said no. πŸ™ˆ

the one exception is that you can convert the file back to NCGM using cgm2ncgm. thank u next πŸ’…


πŸ”₯ SEE ALSO πŸ”₯

  • 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.


okay that's the whole page, bestie, go forth and set your environment variables responsibly 🫢

later, legend β€” this was the NCAR Graphics manual page for NCARG_GKS(1NCAR), dated January 1992, straight from NCAR πŸ’–βœ¨