3.2.2. The basic SMOKE directories

By default, SMOKE is installed in a directory called SMK_HOME (the complete process for installing SMOKE is described in Chapter 12, Downloading, Installing, and Compiling SMOKE). As shown in the previous section, SMK_HOME is an environment variable on which other SMOKE directories depend; it is the root directory of all other SMOKE directories. When you install SMOKE, you must define and create your own SMK_HOME directory as part of the installation process. Since SMK_HOME is an environment variable, you can choose whatever name you like; we cannot prescribe a name for you because each UNIX user has a different computer and disk names. One recommendation that we can make is that SMK_HOME be set close to the bottom of a directory structure, such as a short directory name like /models. Using a short directory name will limit the overall directory lengths for some of the subdirectories deep within the SMOKE directory structure. The SMK_HOME directory used for SMOKE can be the same directory used to install VERDI or the I/O API.

Figure 3.1, “Basic SMOKE directories: the first three levels of the directory structure” shows the first three layers of the SMOKE directory structure. All of the directories in the figure are created during the SMOKE installation process. From the SMK_HOME directory stems the data directory, the scripts directory, and the subsys directory. The data directory corresponds to the environment variable SMKDAT, while the subsys directory corresponds to SMK_SUBSYS; the environment variables are shown in parentheses underneath the actual directory names in the figure. The scripts directory does not have an associated environment variable since we did not feel that one was necessary. The subsys directory is discussed in more detail within this subsection. The data directory will be described more fully in Section 3.2.3, “Locations of input files”, Section 3.2.4, “Locations of intermediate files for base and growth/control cases”, Section 3.2.5, “Locations of model-ready output files for base and growth/control cases”, and Section 3.2.6, “Locations of reports”, when we describe the locations of input, intermediate, output, and report files. We will not discuss the scripts directory since it only contains two general setup scripts that should not need to be modified under normal SMOKE use.

Figure 3.1. Basic SMOKE directories: the first three levels of the directory structure

Basic SMOKE directories: the first three levels of the directory structure

The environment variables shown in parentheses are available to you once you invoke the Assigns file from the command line. The run scripts that come with SMOKE invoke the Assigns file to set up the environment variables automatically. To manually invoke the Assigns file, you must go to the $SMKROOT/assigns directory and type

source <Assigns file name>

where <Assigns file name> is replaced with your specific Assigns file name. Note that SMOKE only works with variants of the C-shell including csh and tcsh. If you are running a different shell (such as bash), you will need to switch into a C-shell before sourcing the Assigns file or running any SMOKE scripts.

Once this command has been used in a UNIX window (e.g., xterm, terminal, console), then the environment variables are available at the command line or to a script that uses the Assigns file. What this means is that the UNIX environment “remembers” the setting of the environment variable. To access the contents of the variable - in this case, a path name - the dollar sign ($) must be used in front of the variable from a UNIX prompt or script. From the prompt, this is most useful for changing directories. For example, after the Assigns file has been invoked, the command

cd $SMKDAT

will take you to the $SMK_HOME/data directory, no matter where else in the directory structure you were located when the command was issued. Similarly, the Assigns file can use these environment variables for setting the paths for the input and output files.

As shown in Figure 3.1, “Basic SMOKE directories: the first three levels of the directory structure”, the subsys directory (creating during installation of SMOKE) contains six subdirectories, each with the following purposes:

Figure 3.2, “Subdirectories of the main SMOKE directory” shows the subdirectories inside the main SMOKE directory, smoke; these are all created during the installation of SMOKE. These subdirectories contain the Assigns files, source code and makefiles, scripts, and executables.

Figure 3.2. Subdirectories of the main SMOKE directory

Subdirectories of the main SMOKE directory

These five subdirectories have the following purposes: