mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Added source_write option to inhibit writing source sites in state points. Closes #153.
This commit is contained in:
parent
47e30f8e2f
commit
399694ed82
7 changed files with 34 additions and 15 deletions
|
|
@ -355,6 +355,12 @@ attributes/sub-elements:
|
|||
|
||||
*Default*: false
|
||||
|
||||
:source_write: If this element is set to "false", source sites are not written
|
||||
to the state point file. This can substantially reduce the size of state
|
||||
points if large numbers of particles per batch are used.
|
||||
|
||||
*Default*: true
|
||||
|
||||
``<survival_biasing>`` Element
|
||||
------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -189,6 +189,7 @@ module global
|
|||
|
||||
! Write source at end of simulation
|
||||
logical :: source_separate = .false.
|
||||
logical :: source_write = .true.
|
||||
|
||||
! ============================================================================
|
||||
! PARALLEL PROCESSING VARIABLES
|
||||
|
|
|
|||
|
|
@ -1104,14 +1104,16 @@ contains
|
|||
! TODO: Use parallel HDF5 to write source bank
|
||||
|
||||
! Write source bank
|
||||
dims(1) = work
|
||||
call h5screate_simple_f(1, dims, dspace, hdf5_err)
|
||||
call h5dcreate_f(hdf5_state_point, "source_bank", hdf5_bank_t, &
|
||||
dspace, dset, hdf5_err)
|
||||
f_ptr = c_loc(source_bank(1))
|
||||
CALL h5dwrite_f(dset, hdf5_bank_t, f_ptr, hdf5_err)
|
||||
call h5dclose_f(dset, hdf5_err)
|
||||
call h5sclose_f(dspace, hdf5_err)
|
||||
if (source_write) then
|
||||
dims(1) = work
|
||||
call h5screate_simple_f(1, dims, dspace, hdf5_err)
|
||||
call h5dcreate_f(hdf5_state_point, "source_bank", hdf5_bank_t, &
|
||||
dspace, dset, hdf5_err)
|
||||
f_ptr = c_loc(source_bank(1))
|
||||
CALL h5dwrite_f(dset, hdf5_bank_t, f_ptr, hdf5_err)
|
||||
call h5dclose_f(dset, hdf5_err)
|
||||
call h5sclose_f(dspace, hdf5_err)
|
||||
end if
|
||||
|
||||
! Write out CMFD info if active
|
||||
if (cmfd_on) then
|
||||
|
|
|
|||
|
|
@ -507,8 +507,11 @@ contains
|
|||
|
||||
! Check if the user has specified to write binary source file
|
||||
call lower_case(state_point_(1) % source_separate)
|
||||
call lower_case(state_point_(1) % source_write)
|
||||
if (state_point_(1) % source_separate == 'true' .or. &
|
||||
state_point_(1) % source_separate == '1') source_separate = .true.
|
||||
if (state_point_(1) % source_write == 'false' .or. &
|
||||
state_point_(1) % source_write == '0') source_write = .false.
|
||||
else
|
||||
! If no <state_point> tag was present, by default write state point at
|
||||
! last batch only
|
||||
|
|
|
|||
|
|
@ -126,9 +126,11 @@ contains
|
|||
! a separate file, we make a call to the appropriate subroutine to
|
||||
! write it separately
|
||||
|
||||
path_source = "source." // trim(to_str(current_batch)) // ".binary"
|
||||
call write_source_binary()
|
||||
else
|
||||
if (source_write) then
|
||||
path_source = "source." // trim(to_str(current_batch)) // ".binary"
|
||||
call write_source_binary()
|
||||
end if
|
||||
elseif (source_write) then
|
||||
! Otherwise, write the source sites in the state point file
|
||||
|
||||
! Get current offset for master
|
||||
|
|
@ -302,9 +304,11 @@ contains
|
|||
! a separate file, we make a call to the appropriate subroutine to
|
||||
! write it separately
|
||||
|
||||
path_source = "source." // trim(to_str(current_batch)) // ".binary"
|
||||
call write_source_binary()
|
||||
else
|
||||
if (source_write) then
|
||||
path_source = "source." // trim(to_str(current_batch)) // ".binary"
|
||||
call write_source_binary()
|
||||
end if
|
||||
elseif (source_write) then
|
||||
! Otherwise, write the source sites in the state point file
|
||||
|
||||
write(UNIT_STATE) source_bank
|
||||
|
|
|
|||
|
|
@ -88,7 +88,9 @@ element settings {
|
|||
attribute interval { xsd:positiveInteger })
|
||||
) &
|
||||
(element source_separate { xsd:boolean } |
|
||||
attribute source_separate { xsd:boolean })?
|
||||
attribute source_separate { xsd:boolean })? &
|
||||
(element source_write { xsd:boolean } |
|
||||
attribute source_write { xsd:boolean })?
|
||||
}? &
|
||||
|
||||
element survival_biasing { xsd:boolean }? &
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
<component name="batches" type="integer-array" />
|
||||
<component name="interval" type="integer" default="0" />
|
||||
<component name="source_separate" type="word" length="5" default="''" />
|
||||
<component name="source_write" type="word" length="5" default="''" />
|
||||
</typedef>
|
||||
|
||||
<variable name="confidence_intervals_" tag="confidence_intervals" type="word" length="5" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue