mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Respond to @smharper comments on #684
This commit is contained in:
parent
495556a2f5
commit
e9acaba58c
13 changed files with 54 additions and 48 deletions
|
|
@ -23,7 +23,8 @@ class DataLibrary(object):
|
|||
root = ET.Element('cross_sections')
|
||||
|
||||
# Determine common directory for library paths
|
||||
common_dir = os.path.commonpath([lib['path'] for lib in self.libraries])
|
||||
common_dir = os.path.dirname(os.path.commonprefix(
|
||||
[lib['path'] for lib in self.libraries]))
|
||||
if common_dir == '':
|
||||
common_dir = '.'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
module angle_distribution
|
||||
|
||||
use hdf5, only: HID_T, HSIZE_T
|
||||
|
||||
use constants, only: ZERO, ONE, HISTOGRAM, LINEAR_LINEAR
|
||||
use distribution_univariate, only: DistributionContainer, Tabular
|
||||
use hdf5, only: HID_T, HSIZE_T
|
||||
use hdf5_interface, only: read_attribute, get_shape, read_dataset, &
|
||||
open_dataset, close_dataset
|
||||
use random_lcg, only: prn
|
||||
|
|
@ -81,9 +82,9 @@ contains
|
|||
dset_id = open_dataset(group_id, 'energy')
|
||||
call get_shape(dset_id, dims)
|
||||
n_energy = int(dims(1), 4)
|
||||
allocate(this%energy(n_energy))
|
||||
allocate(this%distribution(n_energy))
|
||||
call read_dataset(this%energy, dset_id)
|
||||
allocate(this % energy(n_energy))
|
||||
allocate(this % distribution(n_energy))
|
||||
call read_dataset(this % energy, dset_id)
|
||||
call close_dataset(dset_id)
|
||||
|
||||
! Get outgoing energy distribution data
|
||||
|
|
@ -105,8 +106,8 @@ contains
|
|||
end if
|
||||
|
||||
! Create and initialize tabular distribution
|
||||
allocate(Tabular :: this%distribution(i)%obj)
|
||||
select type (mudist => this%distribution(i)%obj)
|
||||
allocate(Tabular :: this % distribution(i) % obj)
|
||||
select type (mudist => this % distribution(i) % obj)
|
||||
type is (Tabular)
|
||||
mudist % interpolation = interp(i)
|
||||
allocate(mudist % x(n), mudist % p(n), mudist % c(n))
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
module endf_header
|
||||
|
||||
use hdf5, only: HID_T, HSIZE_T
|
||||
|
||||
use constants, only: ZERO, HISTOGRAM, LINEAR_LINEAR, LINEAR_LOG, &
|
||||
LOG_LINEAR, LOG_LOG
|
||||
use hdf5_interface
|
||||
use hdf5, only: HID_T, HSIZE_T
|
||||
use search, only: binary_search
|
||||
|
||||
implicit none
|
||||
|
|
@ -157,25 +158,25 @@ contains
|
|||
|
||||
! Determine number of regions
|
||||
nr = nint(xss(idx))
|
||||
this%n_regions = nr
|
||||
this % n_regions = nr
|
||||
|
||||
! Read interpolation region data
|
||||
if (nr > 0) then
|
||||
allocate(this%nbt(nr))
|
||||
allocate(this%int(nr))
|
||||
this%nbt(:) = nint(xss(idx + 1 : idx + nr))
|
||||
this%int(:) = nint(xss(idx + nr + 1 : idx + 2*nr))
|
||||
allocate(this % nbt(nr))
|
||||
allocate(this % int(nr))
|
||||
this % nbt(:) = nint(xss(idx + 1 : idx + nr))
|
||||
this % int(:) = nint(xss(idx + nr + 1 : idx + 2*nr))
|
||||
end if
|
||||
|
||||
! Determine number of pairs
|
||||
ne = int(XSS(idx + 2*nr + 1))
|
||||
this%n_pairs = ne
|
||||
this % n_pairs = ne
|
||||
|
||||
! Read (x,y) pairs
|
||||
allocate(this%x(ne))
|
||||
allocate(this%y(ne))
|
||||
this%x(:) = xss(idx + 2*nr + 2 : idx + 2*nr + 1 + ne)
|
||||
this%y(:) = xss(idx + 2*nr + 2 + ne : idx + 2*nr + 1 + 2*ne)
|
||||
allocate(this % x(ne))
|
||||
allocate(this % y(ne))
|
||||
this % x(:) = xss(idx + 2*nr + 2 : idx + 2*nr + 1 + ne)
|
||||
this % y(:) = xss(idx + 2*nr + 2 + ne : idx + 2*nr + 1 + 2*ne)
|
||||
end subroutine tabulated1d_from_ace
|
||||
|
||||
subroutine tabulated1d_from_hdf5(this, dset_id)
|
||||
|
|
@ -185,19 +186,19 @@ contains
|
|||
real(8), allocatable :: xy(:,:)
|
||||
integer(HSIZE_T) :: dims(2)
|
||||
|
||||
call read_attribute(this%nbt, dset_id, 'breakpoints')
|
||||
call read_attribute(this%int, dset_id, 'interpolation')
|
||||
this%n_regions = size(this%nbt)
|
||||
call read_attribute(this % nbt, dset_id, 'breakpoints')
|
||||
call read_attribute(this % int, dset_id, 'interpolation')
|
||||
this % n_regions = size(this % nbt)
|
||||
|
||||
call get_shape(dset_id, dims)
|
||||
this%n_pairs = int(dims(1), 4)
|
||||
allocate(this%x(this%n_pairs))
|
||||
allocate(this%y(this%n_pairs))
|
||||
this % n_pairs = int(dims(1), 4)
|
||||
allocate(this % x(this % n_pairs))
|
||||
allocate(this % y(this % n_pairs))
|
||||
|
||||
allocate(xy(dims(1), dims(2)))
|
||||
call read_dataset(xy, dset_id)
|
||||
this%x(:) = xy(:,1)
|
||||
this%y(:) = xy(:,2)
|
||||
this % x(:) = xy(:,1)
|
||||
this % y(:) = xy(:,2)
|
||||
end subroutine tabulated1d_from_hdf5
|
||||
|
||||
pure function tabulated1d_evaluate(this, x) result(y)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
module energy_distribution
|
||||
|
||||
use hdf5
|
||||
|
||||
use constants, only: ZERO, ONE, HALF, TWO, PI, HISTOGRAM, LINEAR_LINEAR
|
||||
use endf_header, only: Tabulated1D
|
||||
use hdf5_interface
|
||||
use hdf5
|
||||
use math, only: maxwell_spectrum, watt_spectrum
|
||||
use random_lcg, only: prn
|
||||
use search, only: binary_search
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@ module hdf5_interface
|
|||
! can be combined into one simply accepting an assumed-shape array.
|
||||
!==============================================================================
|
||||
|
||||
use error, only: fatal_error
|
||||
use tally_header, only: TallyResult
|
||||
use, intrinsic :: ISO_C_BINDING
|
||||
|
||||
use hdf5
|
||||
use h5lt
|
||||
use, intrinsic :: ISO_C_BINDING
|
||||
|
||||
use error, only: fatal_error
|
||||
use tally_header, only: TallyResult
|
||||
#ifdef PHDF5
|
||||
use message_passing, only: MPI_COMM_WORLD, MPI_INFO_NULL
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
module input_xml
|
||||
|
||||
use hdf5
|
||||
|
||||
use cmfd_input, only: configure_cmfd
|
||||
use constants
|
||||
use dict_header, only: DictIntInt, ElemKeyValueCI
|
||||
|
|
@ -10,6 +12,7 @@ module input_xml
|
|||
use error, only: fatal_error, warning
|
||||
use geometry_header, only: Cell, Lattice, RectLattice, HexLattice
|
||||
use global
|
||||
use hdf5_interface
|
||||
use list_header, only: ListChar, ListInt, ListReal
|
||||
use mesh_header, only: RegularMesh
|
||||
use multipole, only: multipole_read
|
||||
|
|
@ -25,9 +28,6 @@ module input_xml
|
|||
use tally_initialize, only: add_tallies
|
||||
use xml_interface
|
||||
|
||||
use hdf5
|
||||
use hdf5_interface
|
||||
|
||||
implicit none
|
||||
save
|
||||
|
||||
|
|
@ -2087,14 +2087,14 @@ contains
|
|||
call read_materials_xml(libraries, library_dict)
|
||||
|
||||
! Read continuous-energy cross sections
|
||||
if (run_CE) then
|
||||
if (run_CE .and. run_mode /= MODE_PLOTTING) then
|
||||
call time_read_xs%start()
|
||||
call read_ce_cross_sections(libraries, library_dict)
|
||||
call time_read_xs%stop()
|
||||
end if
|
||||
|
||||
! Normalize atom/weight percents
|
||||
call normalize_ao()
|
||||
if (run_mode /= MODE_PLOTTING) call normalize_ao()
|
||||
|
||||
! Clear dictionary
|
||||
call library_dict % clear()
|
||||
|
|
@ -3295,11 +3295,6 @@ contains
|
|||
! If a specific nuclide was specified
|
||||
word = to_lower(sarray(j))
|
||||
|
||||
!!$ ! Append default_xs specifier to nuclide if needed
|
||||
!!$ if ((default_xs /= '') .and. (.not. ends_with(sarray(j), 'c'))) then
|
||||
!!$ word = trim(word) // "." // trim(default_xs)
|
||||
!!$ end if
|
||||
|
||||
! Search through nuclides
|
||||
pair_list => nuclide_dict % keys()
|
||||
do while (associated(pair_list))
|
||||
|
|
|
|||
|
|
@ -2,13 +2,14 @@ module nuclide_header
|
|||
|
||||
use, intrinsic :: ISO_FORTRAN_ENV
|
||||
|
||||
use hdf5, only: HID_T, HSIZE_T, SIZE_T, h5iget_name_f
|
||||
use h5lt, only: h5ltpath_valid_f
|
||||
|
||||
use constants
|
||||
use dict_header, only: DictIntInt
|
||||
use endf, only: reaction_name, is_fission, is_disappearance
|
||||
use endf_header, only: Function1D, Constant1D, Polynomial, Tabulated1D
|
||||
use error, only: fatal_error, warning
|
||||
use hdf5, only: HID_T, HSIZE_T, SIZE_T, h5iget_name_f
|
||||
use h5lt, only: h5ltpath_valid_f
|
||||
use hdf5_interface, only: read_attribute, open_group, close_group, &
|
||||
open_dataset, read_dataset, close_dataset, get_shape
|
||||
use list_header, only: ListInt
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
module product_header
|
||||
|
||||
use hdf5, only: HID_T
|
||||
|
||||
use angleenergy_header, only: AngleEnergyContainer
|
||||
use constants, only: ZERO, MAX_WORD_LEN, EMISSION_PROMPT, EMISSION_DELAYED, &
|
||||
EMISSION_TOTAL, NEUTRON, PHOTON
|
||||
use endf_header, only: Tabulated1D, Function1D, Constant1D, Polynomial
|
||||
use hdf5, only: HID_T
|
||||
use hdf5_interface, only: read_attribute, open_group, close_group, &
|
||||
open_dataset, close_dataset, read_dataset
|
||||
use random_lcg, only: prn
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
module reaction_header
|
||||
|
||||
use hdf5, only: HID_T, HSIZE_T
|
||||
|
||||
use hdf5_interface, only: read_attribute, open_group, close_group, &
|
||||
open_dataset, read_dataset, close_dataset, get_shape
|
||||
use product_header, only: ReactionProduct
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
module secondary_correlated
|
||||
|
||||
use hdf5, only: HID_T, HSIZE_T
|
||||
|
||||
use angleenergy_header, only: AngleEnergy
|
||||
use constants, only: ZERO, ONE, HALF, TWO, HISTOGRAM, LINEAR_LINEAR
|
||||
use distribution_univariate, only: DistributionContainer, Tabular
|
||||
use hdf5, only: HID_T, HSIZE_T
|
||||
use hdf5_interface, only: get_shape, read_attribute, open_dataset, &
|
||||
read_dataset, close_dataset
|
||||
use random_lcg, only: prn
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
module secondary_kalbach
|
||||
|
||||
use hdf5, only: HID_T, HSIZE_T
|
||||
|
||||
use angleenergy_header, only: AngleEnergy
|
||||
use constants, only: ZERO, HALF, ONE, TWO, HISTOGRAM, LINEAR_LINEAR
|
||||
use hdf5, only: HID_T, HSIZE_T
|
||||
use hdf5_interface, only: read_attribute, read_dataset, open_dataset, &
|
||||
close_dataset, get_shape
|
||||
use random_lcg, only: prn
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
module secondary_nbody
|
||||
|
||||
use hdf5, only: HID_T
|
||||
|
||||
use angleenergy_header, only: AngleEnergy
|
||||
use constants, only: ONE, TWO, PI
|
||||
use hdf5, only: HID_T
|
||||
use hdf5_interface, only: read_attribute
|
||||
use math, only: maxwell_spectrum
|
||||
use random_lcg, only: prn
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
module secondary_uncorrelated
|
||||
|
||||
use h5lt, only: h5ltpath_valid_f
|
||||
use hdf5, only: HID_T
|
||||
|
||||
use angle_distribution, only: AngleDistribution
|
||||
use angleenergy_header, only: AngleEnergy
|
||||
use constants, only: ONE, TWO, MAX_WORD_LEN
|
||||
use energy_distribution, only: EnergyDistribution, LevelInelastic, &
|
||||
ContinuousTabular, MaxwellEnergy, Evaporation, WattEnergy, DiscretePhoton
|
||||
use error, only: warning
|
||||
use h5lt, only: h5ltpath_valid_f
|
||||
use hdf5, only: HID_T
|
||||
use hdf5_interface, only: read_attribute, open_group, close_group
|
||||
use random_lcg, only: prn
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue