Use direct address table for reactions in nuclides

This commit is contained in:
Jose Salcedo Perez 2017-08-15 14:46:04 +00:00 committed by Paul Romano
parent 4e40788128
commit 29a8737b25
2 changed files with 13 additions and 11 deletions

View file

@ -87,9 +87,9 @@ module nuclide_header
! Reactions
type(Reaction), allocatable :: reactions(:)
type(DictIntInt) :: reaction_index ! map MT values to index in reactions
!type(DictIntInt) :: reaction_index ! map MT values to index in reactions
! array; used at tally-time
integer, allocatable :: rxn_index_MT(:)
! Fission energy release
class(Function1D), allocatable :: fission_q_prompt ! prompt neutrons, gammas
class(Function1D), allocatable :: fission_q_recov ! neutrons, gammas, betas
@ -561,7 +561,8 @@ contains
n_temperature = size(this % kTs)
allocate(this % sum_xs(n_temperature))
allocate(this % rxn_index_MT(1000))
this % rxn_index_MT(:)=0
do i = 1, n_temperature
! Allocate and initialize derived cross sections
n_grid = size(this % grid(i) % energy)
@ -580,8 +581,9 @@ contains
i_fission = 0
do i = 1, size(this % reactions)
call MTs % push_back(this % reactions(i) % MT)
call this % reaction_index % set(this % reactions(i) % MT, i)
this % rxn_index_MT(this % reactions(i) % MT) = i
associate (rx => this % reactions(i))
! Skip total inelastic level scattering, gas production cross sections

View file

@ -247,7 +247,7 @@ contains
! multiplicities of one.
score = p % last_wgt * flux
else
m = nuclides(p % event_nuclide) % reaction_index % get(p % event_MT)
m = nuclides(p % event_nuclide) % rxn_index_MT(p % event_MT)
! Get yield and apply to score
associate (rxn => nuclides(p % event_nuclide) % reactions(m))
@ -273,7 +273,7 @@ contains
! multiplicities of one.
score = p % last_wgt * flux
else
m = nuclides(p % event_nuclide) % reaction_index % get(p % event_MT)
m = nuclides(p % event_nuclide) % rxn_index_MT(p % event_MT)
! Get yield and apply to score
associate (rxn => nuclides(p % event_nuclide) % reactions(m))
@ -299,7 +299,7 @@ contains
! multiplicities of one.
score = p % last_wgt * flux
else
m = nuclides(p % event_nuclide) % reaction_index % get(p % event_MT)
m = nuclides(p % event_nuclide) % rxn_index_MT(p % event_MT)
! Get yield and apply to score
associate (rxn => nuclides(p%event_nuclide)%reactions(m))
@ -1148,8 +1148,8 @@ contains
score = ZERO
if (i_nuclide > 0) then
m = nuclides(i_nuclide) % reaction_index % get(score_bin)
if (m /= EMPTY) then
m = nuclides(i_nuclide) % rxn_index_MT(score_bin)
if (m /= 0) then
! Retrieve temperature and energy grid index and interpolation
! factor
i_temp = micro_xs(i_nuclide) % index_temp
@ -1187,8 +1187,8 @@ contains
! Get index in nuclides array
i_nuc = materials(p % material) % nuclide(l)
m = nuclides(i_nuc) % reaction_index % get(score_bin)
if (m /= EMPTY) then
m = nuclides(i_nuc) % rxn_index_MT(score_bin)
if (m /= 0) then
! Retrieve temperature and energy grid index and
! interpolation factor
i_temp = micro_xs(i_nuc) % index_temp