diff --git a/CMakeLists.txt b/CMakeLists.txt index e62c413476..135a724311 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -424,6 +424,7 @@ add_library(libopenmc SHARED src/output.cpp src/particle.cpp src/physics_common.cpp + src/physics_mg.cpp src/plot.cpp src/position.cpp src/pugixml/pugixml_c.cpp diff --git a/src/mgxs_interface.F90 b/src/mgxs_interface.F90 index 9dccc92301..55a18afaba 100644 --- a/src/mgxs_interface.F90 +++ b/src/mgxs_interface.F90 @@ -156,7 +156,7 @@ module mgxs_interface real(8), allocatable :: energy_bins(:) ! Midpoint of the energy group structure - real(8), allocatable :: energy_bin_avg(:) + real(C_DOUBLE), allocatable :: energy_bin_avg(:) ! Energy group structure with increasing energy real(C_DOUBLE), allocatable, target :: rev_energy_bins(:) diff --git a/src/physics_mg.F90 b/src/physics_mg.F90 index 1d60b371ee..8d0c976180 100644 --- a/src/physics_mg.F90 +++ b/src/physics_mg.F90 @@ -20,6 +20,14 @@ module physics_mg implicit none + interface + subroutine scatter(p, energy_bin_avg) bind(C) + import Particle, C_DOUBLE + type(Particle), intent(inout) :: p + real(C_DOUBLE), intent(in) :: energy_bin_avg(*) + end subroutine scatter + end interface + contains !=============================================================================== @@ -85,7 +93,7 @@ contains ! Sample a scattering reaction and determine the secondary energy of the ! exiting neutron - call scatter(p) + call scatter(p, energy_bin_avg) ! Play russian roulette if survival biasing is turned on if (survival_biasing) then @@ -133,25 +141,6 @@ contains end subroutine absorption -!=============================================================================== -! SCATTER -!=============================================================================== - - subroutine scatter(p) - - type(Particle), intent(inout) :: p - - call sample_scatter_c(p % material, p % last_g, p % g, p % mu, & - p % wgt, p % coord(1) % uvw) - - ! Update energy value for downstream compatability (in tallying) - p % E = energy_bin_avg(p % g) - - ! Set event component - p % event = EVENT_SCATTER - - end subroutine scatter - !=============================================================================== ! CREATE_FISSION_SITES determines the average total, prompt, and delayed ! neutrons produced from fission and creates appropriate bank sites.