From 5779389d1dd20c95bec7a578ebf1da2682bfcbfb Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 18 Jun 2013 21:09:12 -0400 Subject: [PATCH 1/7] Added #ifdef around a variable declaration in state_point module. --- src/state_point.F90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/state_point.F90 b/src/state_point.F90 index 462822158..d6f3fb30a 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -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(:,:) From 0b67b5ac5e46116226ccc0a1a0eadf3c1ca0780d Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 18 Jun 2013 21:19:47 -0400 Subject: [PATCH 2/7] Only call tally_statistics if more than one active batch is used. --- src/DEPENDENCIES | 1 + src/finalize.F90 | 4 +++- src/output.F90 | 30 +++++++++++++++++++++--------- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/DEPENDENCIES b/src/DEPENDENCIES index e8cc541f4..e5d20644b 100644 --- a/src/DEPENDENCIES +++ b/src/DEPENDENCIES @@ -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 diff --git a/src/finalize.F90 b/src/finalize.F90 index adffe7b71..98c06b820 100644 --- a/src/finalize.F90 +++ b/src/finalize.F90 @@ -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 diff --git a/src/output.F90 b/src/output.F90 index 3a1278f0a..fa895f97b 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -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 @@ -1464,18 +1465,29 @@ contains 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 From e88ef6e3b51059a50d593fe6ef5d3f907caafcd3 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 18 Jun 2013 21:26:28 -0400 Subject: [PATCH 3/7] Simplify multiplying of tally uncertainties by t-value. --- src/output.F90 | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/output.F90 b/src/output.F90 index fa895f97b..4b1b21096 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -1603,18 +1603,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 From 8b6f059c0b92cdbc7a5120b2d4176507f2a9589a Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 18 Jun 2013 21:32:43 -0400 Subject: [PATCH 4/7] Fix reporting of confidence interval on average keff. --- src/eigenvalue.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eigenvalue.F90 b/src/eigenvalue.F90 index fc44489d0..82ad2d73a 100644 --- a/src/eigenvalue.F90 +++ b/src/eigenvalue.F90 @@ -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 From 19cf65fe3b9324f5ebc17ba7322c4a75b8add8b0 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 18 Jun 2013 21:35:38 -0400 Subject: [PATCH 5/7] Use N-3 degrees of freedom for combined k estimator. --- src/output.F90 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/output.F90 b/src/output.F90 index 4b1b21096..1ff53f0d0 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -1461,7 +1461,10 @@ 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 From a699e954e8e9ac94254488cebae5fa2c7a6c6d39 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 18 Jun 2013 21:52:09 -0400 Subject: [PATCH 6/7] Updated email in man page. --- man/man1/openmc.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/man1/openmc.1 b/man/man1/openmc.1 index eb8981f38..1614e4875 100644 --- a/man/man1/openmc.1 +++ b/man/man1/openmc.1 @@ -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) From 509e2ea532adf271ac2016f8f4864b23b772f3ea Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 18 Jun 2013 21:49:54 -0400 Subject: [PATCH 7/7] Remove special run mode --tallies. --- src/constants.F90 | 3 +-- src/finalize.F90 | 1 - src/initialize.F90 | 8 -------- src/main.F90 | 3 --- src/output.F90 | 8 +------- src/state_point.F90 | 2 +- 6 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/constants.F90 b/src/constants.F90 index 0ffd9e85a..6734a7bcd 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -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 diff --git a/src/finalize.F90 b/src/finalize.F90 index 98c06b820..ac64e90fb 100644 --- a/src/finalize.F90 +++ b/src/finalize.F90 @@ -50,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() diff --git a/src/initialize.F90 b/src/initialize.F90 index 2216a4c4b..da9194915 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -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. diff --git a/src/main.F90 b/src/main.F90 index 5e5ea89ba..e4a33f009 100644 --- a/src/main.F90 +++ b/src/main.F90 @@ -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 diff --git a/src/output.F90 b/src/output.F90 index 1ff53f0d0..9ecc629c0 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -170,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 @@ -1587,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') diff --git a/src/state_point.F90 b/src/state_point.F90 index d6f3fb30a..5020f8f3d 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -675,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