Merged in latest changes to master

This commit is contained in:
Sterling Harper 2013-06-21 09:30:56 -04:00
commit 08d283d232
9 changed files with 44 additions and 46 deletions

View file

@ -66,6 +66,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)

View file

@ -253,6 +253,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

View file

@ -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

View 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

View file

@ -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()

View file

@ -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.

View file

@ -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

View file

@ -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,*) ' -k, --track Write tracks for all particles'
write(OUTPUT_UNIT,*) ' -v, --version Show version information'
write(OUTPUT_UNIT,*) ' -?, --help Show this message'
@ -1461,22 +1461,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
@ -1573,12 +1587,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')
@ -1592,18 +1601,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

View file

@ -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