We used source_newgen.f to define a complicated neutron source (FNG neutron source). There is an angular dependence of the source energy distribution. There are total of 19 angular dependence spectrum files. Here are just two samples as shown in followed figure 1.
we sample the moment_engery according to the various beam direction as the following code:
call sample_isotropic_direction( direction_cosx, direction_cosy, direction_cosz )
i = 1
do i = 1, 18
if ((direction_cosz <= Ang_list(i+1)) .and. (direction_cosz > Ang_list(i))) then
momentum_energy = sample_spectrum_momentum_energy( SPEC_filenamelist(i), "MeV" )
print *,'FILE NAME is ', SPEC_filenamelist(i), momentum_energy, direction_cosz
end do
We found there seems some error in sampling the momentum_energy from spec_files.
The debug log file is shown as follows.
As shown in figure1, the energy range of SPEC_2.TXT is from 14.3 to 15.1 MeV, while the energy range of SPEC_15.TXT is about 13.4 to 13.8 MeV. But the results show the energy does not fit on the energy range of spec_file.
We think there is a bug happening on the function ‘sample_spectrum_momentum_energy’. it just loaded the spec_file to memory one time without updating the latest spec_file to the memory. then it will cause this error to happen.
Hoping to get feedback from exporters. Thank you in advance.