-
Notifications
You must be signed in to change notification settings - Fork 0
EditPath
The skinny on editing the path If you are using a Linux computer, a Mac, or a Windows machine with Cygwin, you can use a makefile to build the code. You do not need to do the steps on this page and you can go on to the next step, CompileCode.
There are vast amounts of atomic data that the code must reference in order to compute a model. These are the files that live in the data directory. The code must be able to find these data files.
Setting the path to the data files is done automatically when compiling the code with make. This is adequate for the code to find the atomic data files that it needs. If you do not need a custom search path, you can simply go on to the next step: CompileCode - compile the code.
Since Cloudy version C06.02, compiling the code with make will automatically set the search path for the data files. The method described below is only needed if you want to modify the default path generated by make. The latter should suffice for the needs of most users. If you are not sure what the explanations below mean, simply compile the code with make and skip the rest of this page.
Since Cloudy version C08 you can set the path to the data files at runtime before you start up Cloudy by setting the environment variable CLOUDY_DATA_PATH. This setting will always override any settings generated by make. On Unix platforms, the method for setting the environment variable depends on the shell you are using. For csh/tcsh use:
setenv CLOUDY_DATA_PATH "/usr/gary/cloudy/data" (double quotes are optional)
For bash/sh/ksh/etc... you should use:
export CLOUDY_DATA_PATH="/usr/gary/cloudy/data" (no spaces around the '='!)
In windows you would use:
set CLOUDY_DATA_PATH=c:\cloudy\trunk\data (no spaces around the '=', no double quotes around the directory name!)
If the environment variable is defined before starting up Cloudy, it will always override the path stored in the executable. In versions C17 and earlier, setting the environment variable before compiling the code would also modify the default search path stored in the executable. That behavior has been removed since C22.
The environment value CLOUDY_DATA_PATH supports a search path with multiple components, similar to the search paths used in UNIX. You can supply multiple directory paths, separated by a colon (':') on UNIX and Mac systems, or separated by a semicolon (';') on Windows systems. When Cloudy searches for a file, it will search in each of the component directories and use the first match that it finds. If multiple matches are found along the search path, a caution will be generated in the output. An example (for UNIX) would be
export CLOUDY_DATA_PATH="/usr/gary/cloudy/data:/usr/gary/local_data"
When Cloudy looks for a data file, it will first look in the directory /usr/gary/cloudy/data. If it doesn't find the file there, it will look in /usr/gary/local_data instead. The latter is convenient for storing locally generated data such as grain opacity or stellar atmosphere files. Storing them in /usr/gary/local_data avoids having to move them around every time you switch to a new Cloudy version.
Starting with Cloudy version C17, the search path will also support the special path component "+" which will be expanded to the default search path that make would have generated for that release. This makes it even more convenient to maintain locally generated data files by using
export CLOUDY_DATA_PATH="+:/usr/gary/local_data"
This way you don't have to worry what the correct path would be to the standard data files that are distributed with Cloudy! The special path component "+" is only supported when you use make to compile the code.
Next step: CompileCode - compile the code.
Return to StepByStep instructions or go home.