2.3. Installation and Execution on Linux OS

2.3.1. Installation on Linux OS

Copy phits.zip from the PHITS installation package to a directory where you would like to install. Copy also the installer for Linux PHITS-Installer_lin.sh from the linux folder in the PHITS installation package to the same folder. Open a terminal and move to the installing folder. Then type the following command to add executable property to the installer:

chmod +x PHITS-Installer_lin.sh

Then execute the installer by the following command:

./PHITS-Installer_lin.sh

Installation will proceed in unzipping the ZIP file, modifying the installation PATH in files, and setting the execution PATH. Input of passward will be required during the unzip. PATH setting will be done in .profile with the assumption of the use of Bash. If you are using other shells, please change the setting accordingly. Installation is successfully finished if you do not see any error message.

Type the following command to activate the PATH setting:

source ~/.profile

This command is not necessary anymore from the next login, since .profile will be automatically read when logging in.

2.3.2. Execution on Linux OS

In Linux environment, PHITS is executed via terminal. Open a terminal and move to the directory which contains the input file by the cd command. Then PHITS can be executed in the following fashion.

phits.sh phits.inp

Here phits.inp is the PHITS input file name (e.g., lec01.inp). As command histories can be retrieved by pressing the ↑ key in the terminal, it is convenient to use the same input file name when you want to repeatedly execute PHITS.

The execution of ANGEL and DCHAN-SP can be done in a similar fashion. ANGEL can be executed by

angel.sh angel.inp

where angel.inp is the input file name (tally output of PHITS. e.g., track_xz.out).

To execute DCHAIN, type the following command in the terminal:

dchain.sh dchain.out

where dchain.out is the name of the DCHAIN input file (the file name is designated in the [t-dchain] section of the PHITS input).

Note that if errors, such as no permission, occur when executing PHITS, it might be because the execution permission has not been added to the executable file. For such a situation, go to phits/bin or where the executable file is located in the terminal, and type the following command for authorization:

chmod +x XXX

Here XXX is the name of the executable file (e.g., phits335.exe).

2.3.2.1. Execute by specifying an executable file without using a shell

The PHITS code can be executed on Linux without using a shell by the following command:

phitsXXX.exe < input.inp

where phitsXXX.exe is the PHITS executable file and XXX is the version number, and input.inp is the input file for PHITS calculation.

(Note 1) If additional files are used with the infl: parameter when PHITS is executed with this method. In this case, the following text should be written in the first line of the main input file:

file = phits.inp

See Section 4.3 for further discussion of infl:.

(Note 2) To perform a PHITS calculation using distributed-memory parallel computing, the name of the input file must be specified in the first line of the phits.in file, which locates in the same folder containing the executable file, by the following manner:

file = input.inp

The name of phits.in is fixed and cannot be changed arbitrarily. See the example in Section 11.1.3 for more detail.