PHITS-EGSでGSモデルを用いる方法

Table of Contents

[2025-03-17 Mon 09:41]

1. 目的

EGS5では電子の多重散乱モデルとしてMoliereとGSを選択できる。現行 のPHITS-EGSではデフォルトのMoliereからGSに切り替えるにはソースの変更とコ ンパイルが必要である。その方法について説明する。

2. 必要なソフト等

  • プログラムをコンパイルするためのフォートランコンパイラ
  • make環境

3. 方法

3.1. phitsインストールディレクトリの確認

phitsインストールディレクトリを確認します。通常は以下の通り。

OS インストールディレクトリ
Win C:\phits
Mac /Users/youraccount/phits
Linux /home/youraccount/phits

これらphitsインストールディレクトリを、 $phits として以下で使います。

3.2. パラメータNBFIT, NEXFITの変更

$phits/src/include/egs5_h.f

を次のように編集します。

(編集前)

! Number of equally probable angle bins in PW mscat table
      integer NBFIT
      parameter (NBFIT = 2)  ! No GS option

! Number of additional angle bins, last bin in PW mscat table
      integer NEXFIT
      parameter (NEXFIT = 2) ! No GS option

(編集後)

! Number of equally probable angle bins in PW mscat table
      integer NBFIT
      parameter (NBFIT = 128)

! Number of additional angle bins, last bin in PW mscat table
      integer NEXFIT
      parameter (NEXFIT = 32)

3.3. ソース内でGSを有効にする

$phits/src/egs5mod.f

を次のように編集します。

(編集前)

DO i=1,iMXMED
  charD(i) = 0.d0
  iraylm(i) = 0
  incohm(i) = 0
  iprofm(i) = 0
  impacm(i) = 0
  useGSD(i) = 0
ENDDO

(編集後)

DO i=1,iMXMED
  charD(i) = 0.d0
  iraylm(i) = 0
  incohm(i) = 0
  iprofm(i) = 0
  impacm(i) = 0
  useGSD(i) = 1  ! GS turn on
ENDDO

3.4. コンパイルしてexeファイルを作成する

ターミナルで $phits/src/ へ移動します。 makeコマンドを実行してphitsをコンパイルしexeファイルを作成します。

phitsコンパイルの詳細はphitsマニュアルの「10 コンパイル」を参照下さい。

3.5. 更新したexeファイルでphits計算を行う

$phits/ に作成されたexeファイルを用いて計算を行います。 使用するOSとフォートランコンパイラの組み合わせによってexeファイルの名称が異なります。 phitsマニュアルの「10 コンパイル」を参照下さい。

3.6. GS計算が実行されていることの確認方法

作成したexeが実行された時に生成されるファイルのうち pegs5-gsdist.dat のファイルサイズが200MB程度あれば GSオプションが有効になっています。 (phitsパラメータでipegsオプションを0または-1として下さい)

Created: 2025-04-23 Wed 18:03