Table of contents Previous: What You Need to Know to Start Using McIDAS Next: Getting Started Unidata McIDAS-X Training Workshop > What You Need to Know to Start Using McIDAS

2.0 The McIDAS Environment

McIDAS is a set of independent applications that communicate with each other through blocks of Unix/Linux shared memory. Each time a McIDAS session is started, system code in the package creates the necessary shared memory segments and "announces" the availability of the shared memory (its read/write handle) known through a Unix/Linux environment variable, MCENV_POSUC. The existence of MCENV_POSUC is not, however, sufficient for McIDAS applications to run.

In order to run, Unidata McIDAS requires that a number of environment variables be pre-defined in a user's Unix/Linux session. Defining these envionment variables is the responsibility of either the system adminstrator that installs McIDAS, or of the user him/herself.

Environment Variables

Environment Variable

Purpose

MCHOME the HOME directory of mcidas
MCDATA working directory for McIDAS-X sessions
MCPATH a colon-separated list of directories that McIDAS routines will search when looking for data and ancillary data files

MCGUI the directory in which the Unidata Tcl/Tk GUI executables and scripts reside
MCTABLE_READ a semi-colon separated list of fully qualified pathnames of ADDE client routing tables that will be read by McIDAS applications when determining the server from which data will be requested
MCTABLE_WRITE the ADDE client routing table that will be modified when the McIDAS DATALOC command is run
MCCOMPRESS when set, makes McIDAS clients request that ADDE servers send them data in compressed format
PATH add the MCGUI directory to the front of your PATH

The special user mcidas, will have two additional envionment variables defined in its Unix session:

Environment Variable

Purpose

McINST_ROOT the directory under which you wish to install Unidata McIDAS-X. This is usually the same as MCHOME)
XCD_disp_file fully qualified pathname of the XCD decoder status file, DECOSTAT.DAT. This should be located in mcidas's working directory.

These environment variables need to be defined in the user's shell-specific definition file: .cshrc for C shell users; .profile for Bourne and Korn shell users; and .bash_profile for BASH users so that they will be active whenever the user logs onto the workstation.

For the user mcidas, the definitions for these environment variables (C-shell syntax) will look something like:



# C-shell environment variable definitions for the user 'mcidas'

# umask
umask 002

# MCHOME and McINST_ROOT
setenv MCHOME $HOME
setenv McINST_ROOT $MCHOME

# NOTE: conditional definition is only needed for C-shell users
if ( ! ${?MCPATH} ) then
  setenv MCDATA $MCHOME/workdata
  setenv MCPATH ${MCDATA}:$MCHOME/data:$MCHOME/help
  setenv MCGUI  $MCHOME/bin
  setenv MCTABLE_READ "${MCDATA}/MCTABLE.TXT;$MCHOME/data/ADDESITE.TXT"
  setenv MCTABLE_WRITE "$MCHOME/data/ADDESITE.TXT"
  setenv XCD_disp_file $MCDATA/DECOSTAT.DAT
  if ( ! ${?path} ) then
    set path=${MCGUI}
  else
    set path=(${MCGUI} $path)
  endif
endif

# Limit ADDE transfers to compressed ones
setenv MCCOMPRESS TRUE


For users other than mcidas, the definitions for these environment variables (C-shell syntax) will look something like:



# C-shell environment variable definitions for a general user

# MCHOME - the HOME directory of the user 'mcidas'
setenv MCHOME /home/mcidas

# NOTE: conditional definition is needed for C-shell users
if ( ! ${?MCPATH} ) then
  setenv MCDATA $HOME/mcidas/data
  setenv MCPATH ${MCDATA}:$MCHOME/data:$MCHOME/help
  setenv MCGUI  $MCHOME/bin
  setenv MCTABLE_READ "$MCDATA/MCTABLE.TXT;$MCHOME/data/ADDESITE.TXT"
  setenv MCTABLE_WRITE "$MCDATA/MCTABLE.TXT"
  if ( ! ${?path} ) then
    set path=$MCGUI
  else
    set path=(${MCGUI} $path)
  endif
endif

# Limit ADDE transfers to compressed ones
setenv MCCOMPRESS TRUE


NOTE: The conditional definition of MCDATA, MCPATH, MCGUI, etc. is needed only by C Shell users. If this conditional clause is not included by these users, problems results will occur!

 

The Unidata McIDAS-X distribution includes files of needed settings that can be incorporated into a user's shell definition file (as indicated above), or referenced from the user's shell definition file. The following are the list of files provided:

user_env.csh non-mcidas user's C-shell environment file (.cshrc) settings
user_env.sh non-mcidas user's Bourne-shell environment file (.profile) settings
mcidas_env.csh mcidas user's C-shell environment file (.cshrc) settings
mcidas_env.sh mcidas user's Bourne-shell environment file (.profile) settings

Here is an example that sets needed environment variables in a user's .cshrc file (again, C-shell syntax):



if ( -f /home/mcidas/admin/user_env.csh ) then
  source /home/mcidas/admin/user_env.csh
endif


In addition, the user mcidas' session will have a second set of enviornment variables defined in a file named .mcenv. These definitions are used by the ADDE remote server that runs as the user mcadde (mcadde shares the HOME directory of mcidas).



# Bourne/Korn shell '.mcenv' environment variable definitions for the user
# 'mcadde'

# umask
umask 002

# MCHOME
MCHOME=/home/mcidas

# McIDAS environment variables
MCDATA=$MCHOME/workdata
MCPATH=${MCDATA}:$MCHOME/data:$MCHOME/help
MCGUI=$MCHOME/bin
MCTABLE_READ="$MCHOME/mcidas/data/MCTABLE.TXT"
MCTABLE_WRITE="$MCHOME/mcidas/data/MCTABLE.TXT"

# Turn on ADDE logging
ADDE_LOGGING=YES

# Define the PATH
PATH=${MCGUI}:$PATH

# Export the environment variables above
export MCPATH MCTABLE_READ MCTABLE_WRITE ADDE_LOGGING PATH

# CD to the MCDATA directory
cd $MCDATA


NOTES:


Table of contents Previous: What You Need to Know to Start Using McIDAS Next: Getting Started Unidata McIDAS-X Training Workshop > What You Need to Know to Start Using McIDAS