mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Merge branch 'master' into refactor
This commit is contained in:
commit
f79592c7c8
9 changed files with 53 additions and 50 deletions
|
|
@ -63,6 +63,6 @@ The OpenMC source code is hosted on GitHub at
|
|||
https://github.com/mit-crpg/openmc. With a github account, you can submit issues
|
||||
directly on the github repository that will then be reviewed by OpenMC
|
||||
developers. Alternatively, you can send a bug report to
|
||||
.I openmc-dev@mit.edu\fP.
|
||||
.I openmc-users@googlegroups.com\fP.
|
||||
.SH AUTHOR
|
||||
Paul K. Romano (\fIpaul.k.romano@gmail.com\fP)
|
||||
|
|
|
|||
|
|
@ -100,7 +100,6 @@ eigenvalue.o: cmfd_execute.o
|
|||
eigenvalue.o: constants.o
|
||||
eigenvalue.o: error.o
|
||||
eigenvalue.o: global.o
|
||||
eigenvalue.o: hdf5_interface.o
|
||||
eigenvalue.o: math.o
|
||||
eigenvalue.o: mesh.o
|
||||
eigenvalue.o: mesh_header.o
|
||||
|
|
@ -139,7 +138,6 @@ fission.o: search.o
|
|||
|
||||
fixed_source.o: constants.o
|
||||
fixed_source.o: global.o
|
||||
fixed_source.o: hdf5_interface.o
|
||||
fixed_source.o: output.o
|
||||
fixed_source.o: particle_header.o
|
||||
fixed_source.o: random_lcg.o
|
||||
|
|
@ -180,8 +178,9 @@ hdf5_summary.o: constants.o
|
|||
hdf5_summary.o: endf.o
|
||||
hdf5_summary.o: geometry_header.o
|
||||
hdf5_summary.o: global.o
|
||||
hdf5_summary.o: hdf5_interface.o
|
||||
hdf5_summary.o: material_header.o
|
||||
hdf5_summary.o: mesh_header.o
|
||||
hdf5_summary.o: output_interface.o
|
||||
hdf5_summary.o: output.o
|
||||
hdf5_summary.o: string.o
|
||||
hdf5_summary.o: tally_header.o
|
||||
|
|
@ -196,7 +195,9 @@ initialize.o: geometry.o
|
|||
initialize.o: geometry_header.o
|
||||
initialize.o: global.o
|
||||
initialize.o: hdf5_interface.o
|
||||
initialize.o: hdf5_summary.o
|
||||
initialize.o: input_xml.o
|
||||
initialize.o: output_interface.o
|
||||
initialize.o: output.o
|
||||
initialize.o: random_lcg.o
|
||||
initialize.o: source.o
|
||||
|
|
@ -256,6 +257,7 @@ mesh.o: search.o
|
|||
output.o: ace_header.o
|
||||
output.o: constants.o
|
||||
output.o: endf.o
|
||||
output.o: error.o
|
||||
output.o: geometry_header.o
|
||||
output.o: global.o
|
||||
output.o: math.o
|
||||
|
|
@ -266,8 +268,12 @@ output.o: plot_header.o
|
|||
output.o: string.o
|
||||
output.o: tally_header.o
|
||||
|
||||
output_interface.o: constants.o
|
||||
output_interface.o: error.o
|
||||
output_interface.o: global.o
|
||||
output_interface.o: hdf5_interface.o
|
||||
output_interface.o: mpiio_interface.o
|
||||
output_interface.o: tally_header.o
|
||||
|
||||
particle_header.o: constants.o
|
||||
particle_header.o: geometry_header.o
|
||||
|
|
@ -336,9 +342,9 @@ source.o: math.o
|
|||
source.o: output.o
|
||||
source.o: particle_header.o
|
||||
source.o: random_lcg.o
|
||||
source.o: state_point.o
|
||||
source.o: string.o
|
||||
|
||||
state_point.o: constants.o
|
||||
state_point.o: error.o
|
||||
state_point.o: global.o
|
||||
state_point.o: output.o
|
||||
|
|
|
|||
|
|
@ -356,8 +356,7 @@ module constants
|
|||
MODE_FIXEDSOURCE = 1, & ! Fixed source mode
|
||||
MODE_EIGENVALUE = 2, & ! K eigenvalue mode
|
||||
MODE_PLOTTING = 3, & ! Plotting mode
|
||||
MODE_TALLIES = 4, & ! Tally results mode
|
||||
MODE_PARTICLE = 5 ! Particle restart mode
|
||||
MODE_PARTICLE = 4 ! Particle restart mode
|
||||
|
||||
! Unit numbers
|
||||
integer, parameter :: UNIT_SUMMARY = 11 ! unit # for writing summary file
|
||||
|
|
|
|||
|
|
@ -616,7 +616,7 @@ contains
|
|||
if (confidence_intervals) then
|
||||
! Calculate t-value for confidence intervals
|
||||
alpha = ONE - CONFIDENCE_LEVEL
|
||||
t_value = t_percentile(ONE - alpha/TWO, n_realizations - 1)
|
||||
t_value = t_percentile(ONE - alpha/TWO, n - 1)
|
||||
else
|
||||
t_value = ONE
|
||||
end if
|
||||
|
|
|
|||
|
|
@ -32,7 +32,9 @@ contains
|
|||
|
||||
if (run_mode /= MODE_PLOTTING .and. run_mode /= MODE_PARTICLE) then
|
||||
! Calculate statistics for tallies and write to tallies.out
|
||||
if (master) call tally_statistics()
|
||||
if (master) then
|
||||
if (n_realizations > 1) call tally_statistics()
|
||||
end if
|
||||
if (output_tallies) then
|
||||
if (master) call write_tallies()
|
||||
end if
|
||||
|
|
@ -48,7 +50,6 @@ contains
|
|||
call time_finalize % stop()
|
||||
call time_total % stop()
|
||||
if (master .and. (run_mode /= MODE_PLOTTING .and. &
|
||||
run_mode /= MODE_TALLIES .and. &
|
||||
run_mode /= MODE_PARTICLE)) then
|
||||
call print_runtime()
|
||||
call print_results()
|
||||
|
|
|
|||
|
|
@ -357,14 +357,6 @@ contains
|
|||
particle_restart_run = .true.
|
||||
end select
|
||||
|
||||
case ('-t', '-tallies', '--tallies')
|
||||
run_mode = MODE_TALLIES
|
||||
|
||||
! Read path for state point
|
||||
i = i + 1
|
||||
path_state_point = argv(i)
|
||||
restart_run = .true.
|
||||
|
||||
case ('-g', '-geometry-debug', '--geometry-debug')
|
||||
check_overlaps = .true.
|
||||
|
||||
|
|
|
|||
|
|
@ -22,9 +22,6 @@ program main
|
|||
call run_eigenvalue()
|
||||
case (MODE_PLOTTING)
|
||||
call run_plot()
|
||||
case (MODE_TALLIES)
|
||||
! For tallies-only mode, we just skip straight to finalize_run to write out
|
||||
! the tally results
|
||||
case (MODE_PARTICLE)
|
||||
if (master) call run_particle_restart()
|
||||
end select
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ module output
|
|||
use ace_header, only: Nuclide, Reaction, UrrData
|
||||
use constants
|
||||
use endf, only: reaction_name
|
||||
use error, only: warning
|
||||
use geometry_header, only: Cell, Universe, Surface, BASE_UNIVERSE
|
||||
use global
|
||||
use math, only: t_percentile
|
||||
|
|
@ -169,7 +170,6 @@ contains
|
|||
write(OUTPUT_UNIT,*) ' -p, --plot Run in plotting mode'
|
||||
write(OUTPUT_UNIT,*) ' -r, --restart Restart a previous run from a state point'
|
||||
write(OUTPUT_UNIT,*) ' or a particle restart file'
|
||||
write(OUTPUT_UNIT,*) ' -t, --tallies Write tally results from state point'
|
||||
write(OUTPUT_UNIT,*) ' -v, --version Show version information'
|
||||
write(OUTPUT_UNIT,*) ' -?, --help Show this message'
|
||||
end if
|
||||
|
|
@ -1460,22 +1460,36 @@ contains
|
|||
global_tallies(:) % sum_sq = t_value * global_tallies(:) % sum_sq
|
||||
|
||||
! Adjust combined estimator
|
||||
k_combined(2) = t_value * k_combined(2)
|
||||
if (n_realizations > 3) then
|
||||
t_value = t_percentile(ONE - alpha/TWO, n_realizations - 3)
|
||||
k_combined(2) = t_value * k_combined(2)
|
||||
end if
|
||||
end if
|
||||
|
||||
! write global tallies
|
||||
write(ou,102) "k-effective (Collision)", global_tallies(K_COLLISION) &
|
||||
% sum, global_tallies(K_COLLISION) % sum_sq
|
||||
write(ou,102) "k-effective (Track-length)", global_tallies(K_TRACKLENGTH) &
|
||||
% sum, global_tallies(K_TRACKLENGTH) % sum_sq
|
||||
write(ou,102) "k-effective (Absorption)", global_tallies(K_ABSORPTION) &
|
||||
% sum, global_tallies(K_ABSORPTION) % sum_sq
|
||||
if (n_active > 3) write(ou,102) "Combined k-effective", k_combined
|
||||
write(ou,102) "Leakage Fraction", global_tallies(LEAKAGE) % sum, &
|
||||
global_tallies(LEAKAGE) % sum_sq
|
||||
if (n_realizations > 1) then
|
||||
write(ou,102) "k-effective (Collision)", global_tallies(K_COLLISION) &
|
||||
% sum, global_tallies(K_COLLISION) % sum_sq
|
||||
write(ou,102) "k-effective (Track-length)", global_tallies(K_TRACKLENGTH) &
|
||||
% sum, global_tallies(K_TRACKLENGTH) % sum_sq
|
||||
write(ou,102) "k-effective (Absorption)", global_tallies(K_ABSORPTION) &
|
||||
% sum, global_tallies(K_ABSORPTION) % sum_sq
|
||||
if (n_realizations > 3) write(ou,102) "Combined k-effective", k_combined
|
||||
write(ou,102) "Leakage Fraction", global_tallies(LEAKAGE) % sum, &
|
||||
global_tallies(LEAKAGE) % sum_sq
|
||||
else
|
||||
message = "Could not compute uncertainties -- only one active batch simulated!"
|
||||
call warning()
|
||||
|
||||
write(ou,103) "k-effective (Collision)", global_tallies(K_COLLISION) % sum
|
||||
write(ou,103) "k-effective (Track-length)", global_tallies(K_TRACKLENGTH) % sum
|
||||
write(ou,103) "k-effective (Absorption)", global_tallies(K_ABSORPTION) % sum
|
||||
write(ou,103) "Leakage Fraction", global_tallies(LEAKAGE) % sum
|
||||
end if
|
||||
write(ou,*)
|
||||
|
||||
102 format (1X,A,T30,"= ",F8.5," +/- ",F8.5)
|
||||
103 format (1X,A,T30,"= ",F8.5)
|
||||
|
||||
end subroutine print_results
|
||||
|
||||
|
|
@ -1572,12 +1586,7 @@ contains
|
|||
score_names(abs(SCORE_EVENTS)) = "Events"
|
||||
|
||||
! Create filename for tally output
|
||||
if (run_mode == MODE_TALLIES) then
|
||||
filename = trim(path_output) // "tallies." // &
|
||||
trim(to_str(restart_batch)) // ".out"
|
||||
else
|
||||
filename = trim(path_output) // "tallies.out"
|
||||
end if
|
||||
filename = trim(path_output) // "tallies.out"
|
||||
|
||||
! Open tally file for writing
|
||||
open(FILE=filename, UNIT=UNIT_TALLY, STATUS='replace', ACTION='write')
|
||||
|
|
@ -1591,18 +1600,15 @@ contains
|
|||
TALLY_LOOP: do i = 1, n_tallies
|
||||
t => tallies(i)
|
||||
|
||||
! Multiply uncertainty by t-value
|
||||
if (confidence_intervals) then
|
||||
do k = 1, size(t % results, 2)
|
||||
do j = 1, size(t % results, 1)
|
||||
! Calculate t-value for confidence intervals
|
||||
if (confidence_intervals) then
|
||||
alpha = ONE - CONFIDENCE_LEVEL
|
||||
t_value = t_percentile(ONE - alpha/TWO, t % n_realizations - 1)
|
||||
end if
|
||||
t % results(j,k) % sum_sq = t_value * t % results(j,k) % sum_sq
|
||||
end do
|
||||
end do
|
||||
! Calculate t-value for confidence intervals
|
||||
if (confidence_intervals) then
|
||||
alpha = ONE - CONFIDENCE_LEVEL
|
||||
t_value = t_percentile(ONE - alpha/TWO, t % n_realizations - 1)
|
||||
end if
|
||||
|
||||
! Multiply uncertainty by t-value
|
||||
t % results % sum_sq = t_value * t % results % sum_sq
|
||||
end if
|
||||
|
||||
! Write header block
|
||||
|
|
|
|||
|
|
@ -312,7 +312,9 @@ contains
|
|||
integer :: n_bins ! total number of bins
|
||||
real(8), allocatable :: tally_temp(:,:,:) ! contiguous array of results
|
||||
real(8), target :: global_temp(2,N_GLOBAL_TALLIES)
|
||||
#ifdef MPI
|
||||
real(8) :: dummy ! temporary receive buffer for non-root reduces
|
||||
#endif
|
||||
type(TallyObject), pointer :: t => null()
|
||||
type(TallyResult), allocatable :: tallyresult_temp(:,:)
|
||||
|
||||
|
|
@ -673,7 +675,7 @@ contains
|
|||
end if
|
||||
|
||||
! Read source if in eigenvalue mode
|
||||
if (run_mode == MODE_EIGENVALUE .and. run_mode /= MODE_TALLIES) then
|
||||
if (run_mode == MODE_EIGENVALUE) then
|
||||
|
||||
! Check if source was written out separately
|
||||
if (source_separate) then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue