Move MGXS-related module variables to mgxs_header

This commit is contained in:
Paul Romano 2017-08-10 10:49:17 -05:00
parent fd1d6faf0f
commit 472d808e97
5 changed files with 56 additions and 54 deletions

View file

@ -12,7 +12,7 @@ module global
use dict_header, only: DictCharInt, DictIntInt
use geometry_header, only: Cell, Universe, Lattice, LatticeContainer
use material_header, only: Material
use mgxs_header, only: Mgxs, MgxsContainer
use mgxs_header
use plot_header, only: ObjectPlot
use set_header, only: SetInt
use stl_vector, only: VectorInt
@ -97,24 +97,6 @@ module global
! ============================================================================
! MULTI-GROUP CROSS SECTION RELATED VARIABLES
! Cross section arrays
type(MgxsContainer), allocatable, target :: nuclides_MG(:)
! Cross section caches
type(MgxsContainer), target, allocatable :: macro_xs(:)
! Number of energy groups
integer :: num_energy_groups
! Number of delayed groups
integer :: num_delayed_groups
! Energy group structure
real(8), allocatable :: energy_bins(:)
! Midpoint of the energy group structure
real(8), allocatable :: energy_bin_avg(:)
! Maximum Data Order
integer :: max_order

View file

@ -16,6 +16,7 @@ module input_xml
use mesh_header, only: RegularMesh
use message_passing
use mgxs_data, only: create_macro_xs, read_mgxs
use mgxs_header
use multipole, only: multipole_read
use output, only: write_message, title, header
use plot_header

View file

@ -209,7 +209,25 @@ module mgxs_header
procedure :: calculate_xs => mgxsang_calculate_xs
end type MgxsAngle
contains
! Cross section arrays
type(MgxsContainer), allocatable, target :: nuclides_MG(:)
! Cross section caches
type(MgxsContainer), target, allocatable :: macro_xs(:)
! Number of energy groups
integer :: num_energy_groups
! Number of delayed groups
integer :: num_delayed_groups
! Energy group structure
real(8), allocatable :: energy_bins(:)
! Midpoint of the energy group structure
real(8), allocatable :: energy_bin_avg(:)
contains
!===============================================================================
! MGXS*_FROM_HDF5 reads in the data from the HDF5 Library. At the point of entry

View file

@ -147,7 +147,7 @@ contains
this % fission = .false.
this % delayed_group = 0
this % n_delayed_bank(:) = 0
this % g = 1
this % g = NONE
! Set up base level coordinates
this % coord(1) % universe = root_universe
@ -214,6 +214,7 @@ contains
this % last_uvw = src % uvw
if (run_CE) then
this % E = src % E
this % g = NONE
else
this % g = int(src % E)
this % last_g = int(src % E)

View file

@ -666,28 +666,28 @@ contains
integer :: bin
real(8) :: E
n = this % n_bins
if ((.not. run_CE) .and. this % matches_transport_groups) then
if (estimator == ESTIMATOR_TRACKLENGTH) then
call match % bins % push_back(num_energy_groups - p % g + 1)
call match % weights % push_back(ONE)
else
call match % bins % push_back(num_energy_groups - p % last_g + 1)
call match % weights % push_back(ONE)
end if
n = this % n_bins
if (p % g /= NONE .and. this % matches_transport_groups) then
if (estimator == ESTIMATOR_TRACKLENGTH) then
call match % bins % push_back(num_energy_groups - p % g + 1)
call match % weights % push_back(ONE)
else
! Pre-collision energy of particle
E = p % last_E
! Search to find incoming energy bin.
bin = binary_search(this % bins, n + 1, E)
if (bin /= NO_BIN_FOUND) then
call match % bins % push_back(bin)
call match % weights % push_back(ONE)
end if
call match % bins % push_back(num_energy_groups - p % last_g + 1)
call match % weights % push_back(ONE)
end if
else
! Pre-collision energy of particle
E = p % last_E
! Search to find incoming energy bin.
bin = binary_search(this % bins, n + 1, E)
if (bin /= NO_BIN_FOUND) then
call match % bins % push_back(bin)
call match % weights % push_back(ONE)
end if
end if
end subroutine get_all_bins_energy
subroutine to_statepoint_energy(this, filter_group)
@ -724,23 +724,23 @@ contains
integer :: n
integer :: bin
n = this % n_bins
n = this % n_bins
if ((.not. run_CE) .and. this % matches_transport_groups) then
! Tallies are ordered in increasing groups, group indices
! however are the opposite, so switch
call match % bins % push_back(num_energy_groups - p % g + 1)
if (p % g /= NONE .and. this % matches_transport_groups) then
! Tallies are ordered in increasing groups, group indices
! however are the opposite, so switch
call match % bins % push_back(num_energy_groups - p % g + 1)
call match % weights % push_back(ONE)
else
! Search to find incoming energy bin.
bin = binary_search(this % bins, n + 1, p % E)
if (bin /= NO_BIN_FOUND) then
call match % bins % push_back(bin)
call match % weights % push_back(ONE)
else
! Search to find incoming energy bin.
bin = binary_search(this % bins, n + 1, p % E)
if (bin /= NO_BIN_FOUND) then
call match % bins % push_back(bin)
call match % weights % push_back(ONE)
end if
end if
end if
end subroutine get_all_bins_energyout
subroutine to_statepoint_energyout(this, filter_group)