4.1 Factors Affecting File Search
Cold searches in a number of places for files. There are three things
that affect where it searches:
- The current directory (i.e. the directory from which the program was executed).
- The main search directory [controlled by the
ROOTSEARCHDIR
variable, which is set at compile time
(see Installation) by setting either the ROOTSEARCHDIR
or
mainsearchdir
variable when running make and
make install
]. This is the directory into which the default
files are installed, so this is where Cold will search for model
files, parameter files, etc.
- The --path commandline option (see -path). This is
automatically set from the .variables file (which can be
configured at installation, or manually after installation). It can be
changed by the commandline options, or another variable file
(see Variables). The default path includes directories
Models and Data. These are necessary for finding several
default files, so if you want to modify the path, you should probably
include these directories.
The file searching algorithm searches in all of the following places,
in this order:
- The current directory (i.e. the directory from which the program was executed).
- The main search directory. By default this is the subdirectory cold of your home directory. It is the directory in which Cold installed its default files.
- Subdirectories of the current directory indicated by the search
path (input from the command line using the --path option
(see -path), or from some variable file (see Variables).
- Subdirectories of the main search directory indicated by the
search path (input from the command line using the --path
option (see -path), or from some variable file (see Variables).
Actually, the last two are interleaved, so it goes through each
directory in the search path, and searches in that subdirectory of the
current directory, then that subdirectory of the main search
directory.
COLD opens the first match for the file in question, so for example,
by putting a file in the current directory, you can effectively
override the file in a later search directory.