Setting the path
Home Up C94.00 Other versions Revision history The future etcetera Acknowledgements Contacts, Mailing list Links Site map, search

 

Home
Up

 

There are vast amounts of atomic data that the code must reference in order to compute a model.  These are the *.dat files that come in the data tar file.  The code can be executed from any location if it knows how to find the data files. 

The location of the data files is stored in a global string variable named chDataPath.  This string is set in path.c, and you will need to change the string so that it gives the path to the data on your machine.

Edit the file path.c (which is in the directory where the source tar file was exploded) and locate chDataPath.

Remember that this is C code, and that a line ends with a semicolon.

On a Windows machine:

/* sample path on a W2K box */
char chDataPath[DATA_PATH_LENGTH]="c:\\projects\\cloudy\\current\\data\\" ;

Edit the string within the double quotes to point to the location of the data files on your system.  The double backslash is only needed on Windows systems to prevent the character following the slash from being interpreted as an escape sequence.

On a Unix machine:

On a Unix or Linux machine the path would be a string within double quotes as in

/* sample path on a Unix box */
char chDataPath[DATA_PATH_LENGTH]="/usr/gary/cloudy/data/" ;

The string giving the path MUST have the proper directory mark as the last character before the second quote.  This would be a "/" in Unix, a "\" in Windows, and a "]" in VMS. The entire line must end in a semicolon because this is C. 

If the path is longer than DATA_PATH_LENGTH characters then increase the length of the variable chDataPath by increasing DATA_PATH_LENGTH in path.h.  .  Remember that in C a string must have one extra byte for storing the end-of-string sentinel.  

NB - If this step is not done it will be necessary to always tell the code where the data live by using the set path command described in Part I of Hazy.  If you store your *.ini initialization files in the same directory as the data files it will never be necessary to set the path - the ini files will be automatically found by the code.

Next step: compile the code. 

Hit Counter
Last changed 04/05/03.
Return to the Cloudy Home Page.
Copyright 1978-2003 Gary J. Ferland