@@ -1291,6 +1291,7 @@ subroutine inelastic_scatter(nuc, rxn, E, uvw, mu, wgt)
12911291 real (8 ) :: E_in ! incoming energy
12921292 real (8 ) :: E_cm ! outgoing energy in center-of-mass
12931293 real (8 ) :: Q ! Q-value of reaction
1294+ real (8 ) :: yield ! neutron yield
12941295
12951296 ! copy energy of neutron
12961297 E_in = E
@@ -1330,8 +1331,13 @@ subroutine inelastic_scatter(nuc, rxn, E, uvw, mu, wgt)
13301331 ! change direction of particle
13311332 uvw = rotate_angle(uvw, mu)
13321333
1333- ! change weight of particle based on multiplicity
1334- wgt = rxn % multiplicity * wgt
1334+ ! change weight of particle based on yield
1335+ if (rxn % multiplicity_with_E) then
1336+ yield = interpolate_tab1(rxn % multiplicity_E, E_in)
1337+ else
1338+ yield = rxn % multiplicity
1339+ end if
1340+ wgt = yield * wgt
13351341
13361342 end subroutine inelastic_scatter
13371343
@@ -1572,6 +1578,7 @@ recursive subroutine sample_energy(edist, E_in, E_out, mu_out, A, Q)
15721578 real (8 ) :: E_max ! parameter for n-body dist
15731579 real (8 ) :: x, y, v ! intermediate variables for n-body dist
15741580 real (8 ) :: r1, r2, r3, r4 , r5, r6
1581+ logical :: histogram_interp ! use histogram interpolation on incoming energy
15751582
15761583 ! ==========================================================================
15771584 ! SAMPLE ENERGY DISTRIBUTION IF THERE ARE MULTIPLE
@@ -1668,12 +1675,13 @@ recursive subroutine sample_energy(edist, E_in, E_out, mu_out, A, Q)
16681675 NR = int (edist % data (1 ))
16691676 NE = int (edist % data (2 + 2 * NR))
16701677 if (NR == 1 ) then
1671- if (master) call warning(" Assuming linear-linear interpolation when &
1672- &sampling continuous tabular distribution" )
1678+ histogram_interp = (edist % data (3 ) == 1 )
16731679 else if (NR > 1 ) then
16741680 ! call write_particle_restart(p)
16751681 call fatal_error(" Multiple interpolation regions not supported while &
16761682 &attempting to sample continuous tabular distribution." )
1683+ else
1684+ histogram_interp = .false.
16771685 end if
16781686
16791687 ! find energy bin and calculate interpolation factor -- if the energy is
@@ -1693,11 +1701,15 @@ recursive subroutine sample_energy(edist, E_in, E_out, mu_out, A, Q)
16931701 end if
16941702
16951703 ! Sample between the ith and (i+1)th bin
1696- r2 = prn()
1697- if (r > r2) then
1698- l = i + 1
1699- else
1704+ if (histogram_interp) then
17001705 l = i
1706+ else
1707+ r2 = prn()
1708+ if (r > r2) then
1709+ l = i + 1
1710+ else
1711+ l = i
1712+ end if
17011713 end if
17021714
17031715 ! interpolation for energy E1 and EK
@@ -1776,10 +1788,12 @@ recursive subroutine sample_energy(edist, E_in, E_out, mu_out, A, Q)
17761788 end if
17771789
17781790 ! Now interpolate between incident energy bins i and i + 1
1779- if (l == i) then
1780- E_out = E_1 + (E_out - E_i_1)* (E_K - E_1)/ (E_i_K - E_i_1)
1781- else
1782- E_out = E_1 + (E_out - E_i1_1)* (E_K - E_1)/ (E_i1_K - E_i1_1)
1791+ if (.not. histogram_interp) then
1792+ if (l == i) then
1793+ E_out = E_1 + (E_out - E_i_1)* (E_K - E_1)/ (E_i_K - E_i_1)
1794+ else
1795+ E_out = E_1 + (E_out - E_i1_1)* (E_K - E_1)/ (E_i1_K - E_i1_1)
1796+ end if
17831797 end if
17841798
17851799 case (5 )
0 commit comments