Hi Xinyan,
Matheus has given a correct way to change the path of your cross_sections.xml file for a given input file (settings.xml). But to set it such that you don't need to change each settings.xml file, you can use the environmental variables feature of your linux shell. To do this, perform the following (I will assume you are using Ubuntu with the default shell with these commands, let me know if that is not the case):
1. Find out the absolute path to your NNDC cross_sections.xml file. It will probably be /home/<username>/openmc/data/cross_sections.xml.
1.a. This is called the `absolute path` because the path works regardless of what directory you are currently in when you call it. A relative path would be something like ../data/cross_sections.xml which would tell the OS to "go back one directory (../) then look for data/cross_sections.xml.
2. Now lets set the path temporarily and make sure it works. Go to where ever you would go to run the OpenMC tests and instead of doing the usual python run_tests.py, prepend a command to set the environmental variable for just this command. That is:
export CROSS_SECTIONS=/home/<username>/openmc/data/cross_sections.xml python run_tests.py
Make sure you put in the actual absolute path that we discovered in Step 1.
3. If step 2 works, then we have the right path and we have set it correctly. Now we can make this change so that you don't need to run the export command every time you want to run OpenMC. To do this we should open up ~/.profile in whatever text editor you wish and at the end add the export command tha worked in step 2:
export CROSS_SECTIONS=/home/<username>/openmc/data/cross_sections.xml
4. This won't quite work just yet as you need to log off and then back on before it gets set for your whole user profile. To use it in the short term without re-logging in, just run the following command:
source ~/.profile
This will read in the changes you just made to .profile and set them for the currently open terminal window.
Hope this helps!
Adam