From df157fa23439d7c7a76b17ae0a2e08063e4bfde5 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 2 Dec 2012 15:51:08 -0500 Subject: [PATCH 01/11] Added scatter-4 and scatter-5 to statepoint.py. --- src/utils/statepoint.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/statepoint.py b/src/utils/statepoint.py index 3e1cdab3a..c19b8f953 100644 --- a/src/utils/statepoint.py +++ b/src/utils/statepoint.py @@ -12,9 +12,10 @@ filter_types = {1: 'universe', 2: 'material', 3: 'cell', 4: 'cellborn', score_types = {-1: 'flux', -2: 'total', -3: 'scatter', -4: 'nu-scatter', -5: 'scatter-1', -6: 'scatter-2', -7: 'scatter-3', - -8: 'transport', -9: 'diffusion', -10: 'n1n', -11: 'n2n', - -12: 'n3n', -13: 'n4n', -14: 'absorption', -15: 'fission', - -16: 'nu-fission', -17: 'current', -18: 'events'} + -8: 'scatter-4', -9: 'scatter-5', -10: 'transport', + -11: 'diffusion', -12: 'n1n', -13: 'n2n', -14: 'n3n', + -15: 'n4n', -16: 'absorption', -17: 'fission', + -18: 'nu-fission', -19: 'current', -20: 'events'} class BinaryFile(object): def __init__(self, filename): From 7a7d83e4e2282d40bfefd54b3a8f6db8d4953892 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 2 Dec 2012 15:52:43 -0500 Subject: [PATCH 02/11] Removed add_to_score subroutine and replaced calls with += instruction. --- src/geometry.F90 | 9 ++++---- src/physics.F90 | 22 +++++++++----------- src/tally.F90 | 54 +++++++++++++++++++++++------------------------- 3 files changed, 40 insertions(+), 45 deletions(-) diff --git a/src/geometry.F90 b/src/geometry.F90 index 00af1c7fb..fecdc33cf 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -8,7 +8,7 @@ module geometry use output, only: write_message use particle_header, only: LocalCoord, deallocate_coord use string, only: to_str - use tally, only: score_surface_current, add_to_score + use tally, only: score_surface_current implicit none @@ -272,10 +272,9 @@ contains call score_surface_current() end if - if (tallies_on) then - ! Score to global leakage tally - call add_to_score(global_tallies(LEAKAGE), p % wgt) - end if + ! Score to global leakage tally + if (tallies_on) global_tallies(LEAKAGE) % value = & + global_tallies(LEAKAGE) % value + p % wgt ! Display message if (verbosity >= 10 .or. trace) then diff --git a/src/physics.F90 b/src/physics.F90 index 58676d715..23f83d5ec 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -19,7 +19,7 @@ module physics use search, only: binary_search use string, only: to_str use tally, only: score_analog_tally, score_tracklength_tally, & - score_surface_current, add_to_score + score_surface_current implicit none @@ -103,12 +103,10 @@ contains if (associated(active_tracklength_tallies)) & call score_tracklength_tally(distance) - ! Score global tracklength tallies - if (tallies_on) then - ! Score track-length estimate of k-eff - call add_to_score(global_tallies(K_TRACKLENGTH), & - p % wgt * distance * material_xs % nu_fission) - end if + ! Score track-length estimate of k-eff + if (tallies_on) global_tallies(K_TRACKLENGTH) % value = & + global_tallies(K_TRACKLENGTH) % value + p % wgt * distance * & + material_xs % nu_fission if (d_collision > d_boundary) then ! ==================================================================== @@ -132,10 +130,9 @@ contains ! PARTICLE HAS COLLISION ! Score collision estimate of keff - if (tallies_on) then - call add_to_score(global_tallies(K_COLLISION), & - p % wgt * material_xs % nu_fission / material_xs % total) - end if + if (tallies_on) global_tallies(K_COLLISION) % value = & + global_tallies(K_COLLISION) % value + p % wgt * & + material_xs % nu_fission / material_xs % total p % surface = NONE call collision() @@ -908,7 +905,8 @@ contains end if ! Add to analog estimate of keff - call add_to_score(global_tallies(K_ANALOG), nu/weight * keff) + global_tallies(K_ANALOG) % value = & + global_tallies(K_ANALOG) % value + nu/weight * keff ! Bank source neutrons if (nu == 0 .or. n_bank == 3*work) return diff --git a/src/tally.F90 b/src/tally.F90 index daf3973e2..f52766b0e 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -330,7 +330,8 @@ contains end select ! Add score to tally - call add_to_score(t % scores(score_index, filter_index), score) + t % scores(score_index, filter_index) % value = & + t % scores(score_index, filter_index) % value + score end do SCORE_LOOP @@ -399,7 +400,8 @@ contains i_filter = sum((t % matching_bins - 1) * t % stride) + 1 ! Add score to tally - call add_to_score(t % scores(i_score, i_filter), score) + t % scores(i_score, i_filter) % value = & + t % scores(i_score, i_filter) % value + score end do ! reset outgoing energy bin and score index @@ -559,7 +561,8 @@ contains score_index = (k - 1)*t % n_score_bins + j ! Add score to tally - call add_to_score(t % scores(score_index, filter_index), score) + t % scores(score_index, filter_index) % value = & + t % scores(score_index, filter_index) % value + score end do SCORE_LOOP @@ -653,7 +656,8 @@ contains score_index = (i_nuclide - 1)*t % n_score_bins + j ! Add score to tally - call add_to_score(t % scores(score_index, filter_index), score) + t % scores(score_index, filter_index) % value = & + t % scores(score_index, filter_index) % value + score end do SCORE_LOOP @@ -693,7 +697,8 @@ contains score_index = n_nuclides_total*t % n_score_bins + j ! Add score to tally - call add_to_score(t % scores(score_index, filter_index), score) + t % scores(score_index, filter_index) % value = & + t % scores(score_index, filter_index) % value + score end do MATERIAL_SCORE_LOOP @@ -981,7 +986,8 @@ contains score_index = (b - 1)*t % n_score_bins + j ! Add score to tally - call add_to_score(t % scores(score_index, filter_index), score) + t % scores(score_index, filter_index) % value = & + t % scores(score_index, filter_index) % value + score end do SCORE_LOOP @@ -1202,7 +1208,8 @@ contains t % matching_bins(i_filter_mesh) = & mesh_indices_to_bin(m, ijk0 + 1, .true.) filter_index = sum((t % matching_bins - 1) * t % stride) + 1 - call add_to_score(t % scores(1, filter_index), p % wgt) + t % scores(1, filter_index) % value = & + t % scores(1, filter_index) % value + p % wgt end if end do else @@ -1213,7 +1220,8 @@ contains t % matching_bins(i_filter_mesh) = & mesh_indices_to_bin(m, ijk0 + 1, .true.) filter_index = sum((t % matching_bins - 1) * t % stride) + 1 - call add_to_score(t % scores(1, filter_index), p % wgt) + t % scores(1, filter_index) % value = & + t % scores(1, filter_index) % value + p % wgt end if end do end if @@ -1229,7 +1237,8 @@ contains t % matching_bins(i_filter_mesh) = & mesh_indices_to_bin(m, ijk0 + 1, .true.) filter_index = sum((t % matching_bins - 1) * t % stride) + 1 - call add_to_score(t % scores(1, filter_index), p % wgt) + t % scores(1, filter_index) % value = & + t % scores(1, filter_index) % value + p % wgt end if end do else @@ -1240,7 +1249,8 @@ contains t % matching_bins(i_filter_mesh) = & mesh_indices_to_bin(m, ijk0 + 1, .true.) filter_index = sum((t % matching_bins - 1) * t % stride) + 1 - call add_to_score(t % scores(1, filter_index), p % wgt) + t % scores(1, filter_index) % value = & + t % scores(1, filter_index) % value + p % wgt end if end do end if @@ -1256,7 +1266,8 @@ contains t % matching_bins(i_filter_mesh) = & mesh_indices_to_bin(m, ijk0 + 1, .true.) filter_index = sum((t % matching_bins - 1) * t % stride) + 1 - call add_to_score(t % scores(1, filter_index), p % wgt) + t % scores(1, filter_index) % value = & + t % scores(1, filter_index) % value + p % wgt end if end do else @@ -1267,7 +1278,8 @@ contains t % matching_bins(i_filter_mesh) = & mesh_indices_to_bin(m, ijk0 + 1, .true.) filter_index = sum((t % matching_bins - 1) * t % stride) + 1 - call add_to_score(t % scores(1, filter_index), p % wgt) + t % scores(1, filter_index) % value = & + t % scores(1, filter_index) % value + p % wgt end if end do end if @@ -1391,7 +1403,8 @@ contains end if ! Add to surface current tally - call add_to_score(t % scores(1, filter_index), p % wgt) + t % scores(1, filter_index) % value = & + t % scores(1, filter_index) % value + p % wgt end if ! Calculate new coordinates @@ -1635,21 +1648,6 @@ contains end subroutine tally_statistics -!=============================================================================== -! ADD_TO_SCORE accumulates a scoring contribution to a specific tally bin and -! specific response function. Note that we don't need to add the square of the -! contribution since that is done at the batch level, not the history level -!=============================================================================== - - subroutine add_to_score(score, val) - - type(TallyScore), intent(inout) :: score - real(8), intent(in) :: val - - score % value = score % value + val - - end subroutine add_to_score - !=============================================================================== ! ACCUMULATE_SCORE accumulates scores from many histories (or many generations) ! into a single realization of a random variable. From 3f61c736b46a6dcb236567201188423e36de2761 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 2 Dec 2012 22:48:32 -0500 Subject: [PATCH 03/11] Changed criticality to eigenvalue (modules, input, etc). --- docs/source/usersguide/input.rst | 62 ++++++++++++------------- src/DEPENDENCIES | 36 +++++++------- src/OBJECTS | 2 +- src/bank_header.F90 | 2 +- src/constants.F90 | 2 +- src/{criticality.F90 => eigenvalue.F90} | 14 +++--- src/global.F90 | 4 +- src/hdf5_interface.F90 | 12 ++--- src/initialize.F90 | 2 +- src/input_xml.F90 | 29 ++++++++---- src/main.F90 | 6 +-- src/output.F90 | 6 +-- src/source_header.F90 | 2 +- src/state_point.F90 | 28 +++++------ src/tally.F90 | 2 +- src/templates/settings.rnc | 2 +- src/templates/settings_t.xml | 5 +- 17 files changed, 114 insertions(+), 102 deletions(-) rename src/{criticality.F90 => eigenvalue.F90} (98%) diff --git a/docs/source/usersguide/input.rst b/docs/source/usersguide/input.rst index 1ad4b5f9c..e0495226b 100644 --- a/docs/source/usersguide/input.rst +++ b/docs/source/usersguide/input.rst @@ -69,37 +69,6 @@ deviation. *Default*: off -```` Element -------------------------- - -The ```` element indicates that a criticality calculation should be -performed. It has the following attributes/sub-elements: - - :batches: - The total number of batches, where each batch corresponds to multiple - fission source iterations. Batching is done to eliminate correlation between - realizations of random variables. - - *Default*: None - - :generations_per_batch: - The number of total fission source iterations per batch. - - *Default*: 1 - - :inactive: - The number of inactive batches. In general, the starting cycles in a - criticality calculation can not be used to contribute to tallies since the - fission source distribution and eigenvalue are generally not converged - immediately. - - *Default*: None - - :particles: - The number of neutrons to simulate per fission source iteration. - - *Default*: None - .. _cross_sections: ```` Element @@ -130,6 +99,37 @@ default. This element has the following attributes/sub-elements: *Default*: 1.0 +```` Element +------------------------ + +The ```` element indicates that a :math:`k`-eigenvalue calculation +should be performed. It has the following attributes/sub-elements: + + :batches: + The total number of batches, where each batch corresponds to multiple + fission source iterations. Batching is done to eliminate correlation between + realizations of random variables. + + *Default*: None + + :generations_per_batch: + The number of total fission source iterations per batch. + + *Default*: 1 + + :inactive: + The number of inactive batches. In general, the starting cycles in a + criticality calculation can not be used to contribute to tallies since the + fission source distribution and eigenvalue are generally not converged + immediately. + + *Default*: None + + :particles: + The number of neutrons to simulate per fission source iteration. + + *Default*: None + ```` Element ------------------------- diff --git a/src/DEPENDENCIES b/src/DEPENDENCIES index 9b7f715b5..0d2e4e2de 100644 --- a/src/DEPENDENCIES +++ b/src/DEPENDENCIES @@ -90,23 +90,23 @@ cmfd_snes_solver.o: constants.o cmfd_snes_solver.o: global.o cmfd_snes_solver.o: string.o -criticality.o: cmfd_execute.o -criticality.o: constants.o -criticality.o: error.o -criticality.o: global.o -criticality.o: hdf5_interface.o -criticality.o: math.o -criticality.o: mesh.o -criticality.o: mesh_header.o -criticality.o: output.o -criticality.o: physics.o -criticality.o: random_lcg.o -criticality.o: search.o -criticality.o: source.o -criticality.o: state_point.o -criticality.o: string.o -criticality.o: tally.o -criticality.o: timing.o +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 +eigenvalue.o: output.o +eigenvalue.o: physics.o +eigenvalue.o: random_lcg.o +eigenvalue.o: search.o +eigenvalue.o: source.o +eigenvalue.o: state_point.o +eigenvalue.o: string.o +eigenvalue.o: tally.o +eigenvalue.o: timing.o cross_section.o: ace_header.o cross_section.o: constants.o @@ -243,7 +243,7 @@ interpolation.o: search.o interpolation.o: string.o main.o: constants.o -main.o: criticality.o +main.o: eigenvalue.o main.o: finalize.o main.o: fixed_source.o main.o: global.o diff --git a/src/OBJECTS b/src/OBJECTS index 324f16d76..1a0aac382 100644 --- a/src/OBJECTS +++ b/src/OBJECTS @@ -14,10 +14,10 @@ cmfd_power_solver.o \ cmfd_prod_operator.o \ cmfd_snes_solver.o \ cross_section.o \ -criticality.o \ datatypes.o \ datatypes_header.o \ doppler.o \ +eigenvalue.o \ endf.o \ endf_header.o \ energy_grid.o \ diff --git a/src/bank_header.F90 b/src/bank_header.F90 index 2d49dead7..1a91f86f7 100644 --- a/src/bank_header.F90 +++ b/src/bank_header.F90 @@ -3,7 +3,7 @@ module bank_header implicit none !=============================================================================== -! BANK is used for storing fission sites in criticality calculations. Since all +! BANK is used for storing fission sites in eigenvalue calculations. Since all ! the state information of a neutron is not needed, this type allows sites to be ! stored with less memory !=============================================================================== diff --git a/src/constants.F90 b/src/constants.F90 index e1d8e853a..fe025c7e8 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -347,7 +347,7 @@ module constants ! Running modes integer, parameter :: & MODE_FIXEDSOURCE = 1, & ! Fixed source mode - MODE_CRITICALITY = 2, & ! Criticality mode + MODE_EIGENVALUE = 2, & ! K eigenvalue mode MODE_PLOTTING = 3, & ! Plotting mode MODE_TALLIES = 4 ! Tally results mode diff --git a/src/criticality.F90 b/src/eigenvalue.F90 similarity index 98% rename from src/criticality.F90 rename to src/eigenvalue.F90 index a19acdc6d..33e217f92 100644 --- a/src/criticality.F90 +++ b/src/eigenvalue.F90 @@ -1,4 +1,4 @@ -module criticality +module eigenvalue #ifdef MPI use mpi @@ -29,15 +29,15 @@ module criticality contains !=============================================================================== -! RUN_CRITICALITY encompasses all the main logic where iterations are performed -! over the batches, generations, and histories. +! RUN_EIGENVALUE encompasses all the main logic where iterations are performed +! over the batches, generations, and histories in a k-eigenvalue calculation. !=============================================================================== - subroutine run_criticality() + subroutine run_eigenvalue() integer(8) :: i ! index over individual particles - if (master) call header("CRITICALITY TRANSPORT SIMULATION", level=1) + if (master) call header("K EIGENVALUE SIMULATION", level=1) ! Allocate particle allocate(p) @@ -99,7 +99,7 @@ contains if (master) call header("SIMULATION FINISHED", level=1) - end subroutine run_criticality + end subroutine run_eigenvalue !=============================================================================== ! INITIALIZE_BATCH @@ -692,4 +692,4 @@ contains end subroutine count_source_for_ufs -end module criticality +end module eigenvalue diff --git a/src/global.F90 b/src/global.F90 index 47d778bac..41a016b10 100644 --- a/src/global.F90 +++ b/src/global.F90 @@ -154,7 +154,7 @@ module global type(ListInt), pointer :: active_tallies => null() ! ============================================================================ - ! CRITICALITY SIMULATION VARIABLES + ! EIGENVALUE SIMULATION VARIABLES integer(8) :: n_particles = 0 ! # of particles per generation integer :: n_batches ! # of batches @@ -250,7 +250,7 @@ module global ! ============================================================================ ! MISCELLANEOUS VARIABLES - ! Mode to run in (fixed source, criticality, plotting, etc) + ! Mode to run in (fixed source, eigenvalue, plotting, etc) integer :: run_mode = NONE ! Restart run diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index c6ec49c4d..a52719738 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -94,8 +94,8 @@ contains ! Write header information call hdf5_write_header() - ! Write criticality information - if (run_mode == MODE_CRITICALITY) then + ! Write eigenvalue information + if (run_mode == MODE_EIGENVALUE) then ! Need to write integer(8)'s using double instead since there is no H5LT ! call for making a dataset of type long call hdf5_write_double(hdf5_output_file, "n_particles", real(n_particles,8)) @@ -865,8 +865,8 @@ contains ! Write out current batch number call hdf5_write_integer(hdf5_state_point, "current_batch", current_batch) - ! Write out information for criticality run - if (run_mode == MODE_CRITICALITY) then + ! Write out information for eigenvalue run + if (run_mode == MODE_EIGENVALUE) then call hdf5_write_integer(hdf5_state_point, "n_inactive", n_inactive) call hdf5_write_integer(hdf5_state_point, "gen_per_batch", gen_per_batch) @@ -1132,8 +1132,8 @@ contains ! Read batch number to restart at call hdf5_read_integer(hdf5_state_point, "current_batch", restart_batch) - ! Read information specific to criticality run - if (mode == MODE_CRITICALITY) then + ! Read information specific to eigenvalue run + if (mode == MODE_EIGENVALUE) then call hdf5_read_integer(hdf5_state_point, "n_inactive", n_inactive) call hdf5_read_integer(hdf5_state_point, "gen_per_batch", gen_per_batch) diff --git a/src/initialize.F90 b/src/initialize.F90 index cdd85dfdb..d25da7ddc 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -120,7 +120,7 @@ contains ! Allocate banks and create source particles -- for a fixed source ! calculation, the external source distribution is sampled during the ! run, not at initialization - if (run_mode == MODE_CRITICALITY) then + if (run_mode == MODE_EIGENVALUE) then call allocate_banks() if (.not. restart_run) call initialize_source() end if diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 621856834..3cb546098 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -102,32 +102,41 @@ contains end if ! Make sure that either criticality or fixed source was specified - if (criticality_ % batches == 0 .and. fixed_source_ % batches == 0) then - message = "Number of batches on or " & - // "tag was zero." + if (eigenvalue_ % batches == 0 .and. fixed_source_ % batches == 0 & + .and. criticality_ % batches == 0) then + message = "Number of batches on or & + &tag was zero." call fatal_error() end if - ! Criticality information + ! Check for old tag if (criticality_ % batches > 0) then + eigenvalue_ = criticality_ + message = "The element has been deprecated and & + &replaced by ." + call warning() + end if + + ! Eigenvalue information + if (eigenvalue_ % batches > 0) then ! Set run mode - if (run_mode == NONE) run_mode = MODE_CRITICALITY + if (run_mode == NONE) run_mode = MODE_EIGENVALUE ! Check number of particles - if (len_trim(criticality_ % particles) == 0) then + if (len_trim(eigenvalue_ % particles) == 0) then message = "Need to specify number of particles per cycles." call fatal_error() end if ! If the number of particles was specified as a command-line argument, we ! don't set it here - if (n_particles == 0) n_particles = str_to_int(criticality_ % particles) + if (n_particles == 0) n_particles = str_to_int(eigenvalue_ % particles) ! Copy batch and generation information - n_batches = criticality_ % batches - n_inactive = criticality_ % inactive + n_batches = eigenvalue_ % batches + n_inactive = eigenvalue_ % inactive n_active = n_batches - n_inactive - gen_per_batch = criticality_ % generations_per_batch + gen_per_batch = eigenvalue_ % generations_per_batch ! Allocate array for batch keff and entropy allocate(k_batch(n_batches)) diff --git a/src/main.F90 b/src/main.F90 index 89cc7e857..c5875d5d0 100644 --- a/src/main.F90 +++ b/src/main.F90 @@ -1,7 +1,7 @@ program main use constants - use criticality, only: run_criticality + use eigenvalue, only: run_eigenvalue use finalize, only: finalize_run use fixed_source, only: run_fixedsource use global @@ -17,8 +17,8 @@ program main select case (run_mode) case (MODE_FIXEDSOURCE) call run_fixedsource() - case (MODE_CRITICALITY) - call run_criticality() + case (MODE_EIGENVALUE) + call run_eigenvalue() case (MODE_PLOTTING) call run_plot() case (MODE_TALLIES) diff --git a/src/output.F90 b/src/output.F90 index 04cfcb8a9..4be436291 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -1078,13 +1078,13 @@ contains ! Display problem summary call header("PROBLEM SUMMARY", unit=UNIT_SUMMARY) select case(run_mode) - case (MODE_CRITICALITY) - write(UNIT_SUMMARY,100) 'Problem type:', 'Criticality' + case (MODE_EIGENVALUE) + write(UNIT_SUMMARY,100) 'Problem type:', 'k eigenvalue' write(UNIT_SUMMARY,101) 'Number of Batches:', n_batches write(UNIT_SUMMARY,101) 'Number of Inactive Batches:', n_inactive write(UNIT_SUMMARY,101) 'Generations per Batch:', gen_per_batch case (MODE_FIXEDSOURCE) - write(UNIT_SUMMARY,100) 'Problem type:', 'External Source' + write(UNIT_SUMMARY,100) 'Problem type:', 'fixed source' end select write(UNIT_SUMMARY,101) 'Number of Particles:', n_particles diff --git a/src/source_header.F90 b/src/source_header.F90 index cb0eb290c..11c74d110 100644 --- a/src/source_header.F90 +++ b/src/source_header.F90 @@ -4,7 +4,7 @@ module source_header !=============================================================================== ! EXTSOURCE describes an external source of neutrons for a fixed-source problem -! or for the starting source in a criticality problem +! or for the starting source in a k eigenvalue problem !=============================================================================== type ExtSource diff --git a/src/state_point.F90 b/src/state_point.F90 index 72ec8463a..566ce04ad 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -120,7 +120,7 @@ contains ! ========================================================================== ! SOURCE BANK - if (run_mode == MODE_CRITICALITY) then + if (run_mode == MODE_EIGENVALUE) then if (source_separate) then ! If the user has specified that the source sites should be written in ! a separate file, we make a call to the appropriate subroutine to @@ -179,8 +179,8 @@ contains ! Write out current batch number write(UNIT_STATE) current_batch - ! Write out information for criticality run - if (run_mode == MODE_CRITICALITY) then + ! Write out information for eigenvalue run + if (run_mode == MODE_EIGENVALUE) then write(UNIT_STATE) n_inactive, gen_per_batch write(UNIT_STATE) k_batch(1:current_batch) write(UNIT_STATE) entropy(1:current_batch) @@ -281,7 +281,7 @@ contains end if ! Write out source bank - if (run_mode == MODE_CRITICALITY) then + if (run_mode == MODE_EIGENVALUE) then if (source_separate) then ! If the user has specified that the source sites should be written in ! a separate file, we make a call to the appropriate subroutine to @@ -349,8 +349,8 @@ contains call MPI_FILE_WRITE(fh, current_batch, 1, MPI_INTEGER, & MPI_STATUS_IGNORE, mpi_err) - ! Write out information for criticality run - if (run_mode == MODE_CRITICALITY) then + ! Write out information for eigenvalue run + if (run_mode == MODE_EIGENVALUE) then call MPI_FILE_WRITE(fh, n_inactive, 1, MPI_INTEGER, & MPI_STATUS_IGNORE, mpi_err) call MPI_FILE_WRITE(fh, gen_per_batch, 1, MPI_INTEGER, & @@ -644,8 +644,8 @@ contains call MPI_FILE_READ_ALL(fh, restart_batch, 1, MPI_INTEGER, & MPI_STATUS_IGNORE, mpi_err) - ! Read information specific to criticality run - if (mode == MODE_CRITICALITY) then + ! Read information specific to eigenvalue run + if (mode == MODE_EIGENVALUE) then call MPI_FILE_READ_ALL(fh, n_inactive, 1, MPI_INTEGER, & MPI_STATUS_IGNORE, mpi_err) call MPI_FILE_READ_ALL(fh, gen_per_batch, 1, MPI_INTEGER, & @@ -781,7 +781,7 @@ contains ! ========================================================================== ! SOURCE BANK - if (run_mode == MODE_CRITICALITY) then + if (run_mode == MODE_EIGENVALUE) then ! Get current offset for master if (master) call MPI_FILE_GET_POSITION(fh, offset, mpi_err) @@ -841,8 +841,8 @@ contains ! Read batch number to restart at read(UNIT_STATE) restart_batch - ! Read information specific to criticality run - if (mode == MODE_CRITICALITY) then + ! Read information specific to eigenvalue run + if (mode == MODE_EIGENVALUE) then read(UNIT_STATE) n_inactive, gen_per_batch read(UNIT_STATE) k_batch(1:restart_batch) read(UNIT_STATE) entropy(1:restart_batch) @@ -966,8 +966,8 @@ contains end if end if - ! Read source bank for criticality run - if (mode == MODE_CRITICALITY .and. run_mode /= MODE_TALLIES) then + ! Read source bank for eigenvalue run + if (mode == MODE_EIGENVALUE .and. run_mode /= MODE_TALLIES) then read(UNIT_STATE) source_bank end if @@ -995,7 +995,7 @@ contains call write_message(1) end if - ! For criticality calculations, turn on tallies if we've reached active + ! For eigenvalue calculations, turn on tallies if we've reached active ! batches if (current_batch == n_inactive) then tallies_on = .true. diff --git a/src/tally.F90 b/src/tally.F90 index f52766b0e..e271cad72 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -1506,7 +1506,7 @@ contains curr_ptr => curr_ptr % next end do - if (run_mode == MODE_CRITICALITY) then + if (run_mode == MODE_EIGENVALUE) then ! Before accumulating scores for global_tallies, we need to get the ! current batch estimate of k_analog for displaying to output if (active_batches) k_batch(current_batch) = global_tallies(K_ANALOG) % value diff --git a/src/templates/settings.rnc b/src/templates/settings.rnc index 772a182e9..a2d75254f 100644 --- a/src/templates/settings.rnc +++ b/src/templates/settings.rnc @@ -2,7 +2,7 @@ element settings { element confidence_intervals { ( "on" | "off" ) }? & ( - element criticality { + element eigenvalue { (element batches { xsd:positiveInteger } | attribute batches { xsd:positiveInteger }) & (element inactive { xsd:nonNegativeInteger } | diff --git a/src/templates/settings_t.xml b/src/templates/settings_t.xml index 2a220b726..c897c99f8 100644 --- a/src/templates/settings_t.xml +++ b/src/templates/settings_t.xml @@ -42,9 +42,9 @@ - + @@ -60,4 +60,7 @@ + + + From a5057a424d98717fe5e261ca688d5e9294e47329 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 4 Dec 2012 10:25:29 -0500 Subject: [PATCH 04/11] Changed TallyScore to TallyResult, t % scores to t % results, etc. --- src/cmfd_data.F90 | 40 +++++----- src/cmfd_execute.F90 | 4 +- src/cmfd_input.F90 | 2 +- src/global.F90 | 16 ++-- src/hdf5_interface.F90 | 48 ++++++------ src/initialize.F90 | 36 ++++----- src/mesh.F90 | 4 +- src/output.F90 | 68 ++++++++--------- src/state_point.F90 | 96 ++++++++++++------------ src/tally.F90 | 142 ++++++++++++++++++------------------ src/tally_header.F90 | 20 ++--- src/tally_initialize.F90 | 8 +- src/utils/statepoint.py | 36 ++++----- src/utils/statepoint_cmp.py | 6 +- 14 files changed, 263 insertions(+), 263 deletions(-) diff --git a/src/cmfd_data.F90 b/src/cmfd_data.F90 index e6e3665fe..211d0e148 100644 --- a/src/cmfd_data.F90 +++ b/src/cmfd_data.F90 @@ -61,7 +61,7 @@ contains meshes use mesh, only: mesh_indices_to_bin use mesh_header, only: StructuredMesh - use tally_header, only: TallyObject, TallyScore + use tally_header, only: TallyObject integer :: nx ! number of mesh cells in x direction integer :: ny ! number of mesh cells in y direction @@ -155,7 +155,7 @@ contains score_index = sum((t % matching_bins - 1) * t%stride) + 1 ! get flux - flux = t % scores(1,score_index) % sum + flux = t % results(1,score_index) % sum cmfd % flux(h,i,j,k) = flux ! detect zero flux @@ -166,13 +166,13 @@ contains end if ! get total rr and convert to total xs - cmfd % totalxs(h,i,j,k) = t % scores(2,score_index) % sum / flux + cmfd % totalxs(h,i,j,k) = t % results(2,score_index) % sum / flux ! get p1 scatter rr and convert to p1 scatter xs - cmfd % p1scattxs(h,i,j,k) = t % scores(3,score_index) % sum / flux + cmfd % p1scattxs(h,i,j,k) = t % results(3,score_index) % sum / flux ! extract diffusion coefficient tally - cmfd % diffusion(h,i,j,k) = t % scores(4,score_index) % sum / flux + cmfd % diffusion(h,i,j,k) = t % results(4,score_index) % sum / flux ! calculate diffusion coefficient ! cmfd % diffcof(h,i,j,k) = ONE/(3.0_8*cmfd%totalxs(h,i,j,k)) @@ -206,16 +206,16 @@ contains score_index = sum((t % matching_bins - 1) * t%stride) + 1 ! get scattering - cmfd % scattxs(h,g,i,j,k) = t % scores(1,score_index) % sum /& + cmfd % scattxs(h,g,i,j,k) = t % results(1,score_index) % sum /& cmfd % flux(h,i,j,k) ! get nu-fission - cmfd % nfissxs(h,g,i,j,k) = t % scores(2,score_index) % sum /& + cmfd % nfissxs(h,g,i,j,k) = t % results(2,score_index) % sum /& cmfd % flux(h,i,j,k) ! bank source cmfd % openmc_src(g,i,j,k) = cmfd % openmc_src(g,i,j,k) + & - t % scores(2,score_index) % sum + t % results(2,score_index) % sum end do INGROUP @@ -232,60 +232,60 @@ contains (/ i-1, j, k /) + 1, .true.) t % matching_bins(i_filter_surf) = IN_RIGHT score_index = sum((t % matching_bins - 1) * t % stride) + 1 ! outgoing - cmfd % current(1,h,i,j,k) = t % scores(1,score_index) % sum + cmfd % current(1,h,i,j,k) = t % results(1,score_index) % sum t % matching_bins(i_filter_surf) = OUT_RIGHT score_index = sum((t % matching_bins - 1) * t % stride) + 1 ! incoming - cmfd % current(2,h,i,j,k) = t % scores(1,score_index) % sum + cmfd % current(2,h,i,j,k) = t % results(1,score_index) % sum ! right surface t % matching_bins(i_filter_mesh) = mesh_indices_to_bin(m, & (/ i, j, k /) + 1, .true.) t % matching_bins(i_filter_surf) = IN_RIGHT score_index = sum((t % matching_bins - 1) * t % stride) + 1 ! incoming - cmfd % current(3,h,i,j,k) = t % scores(1,score_index) % sum + cmfd % current(3,h,i,j,k) = t % results(1,score_index) % sum t % matching_bins(i_filter_surf) = OUT_RIGHT score_index = sum((t % matching_bins - 1) * t % stride) + 1 ! outgoing - cmfd % current(4,h,i,j,k) = t % scores(1,score_index) % sum + cmfd % current(4,h,i,j,k) = t % results(1,score_index) % sum ! back surface t % matching_bins(i_filter_mesh) = mesh_indices_to_bin(m, & (/ i, j-1, k /) + 1, .true.) t % matching_bins(i_filter_surf) = IN_FRONT score_index = sum((t % matching_bins - 1) * t % stride) + 1 ! outgoing - cmfd % current(5,h,i,j,k) = t % scores(1,score_index) % sum + cmfd % current(5,h,i,j,k) = t % results(1,score_index) % sum t % matching_bins(i_filter_surf) = OUT_FRONT score_index = sum((t % matching_bins - 1) * t % stride) + 1 ! incoming - cmfd % current(6,h,i,j,k) = t % scores(1,score_index) % sum + cmfd % current(6,h,i,j,k) = t % results(1,score_index) % sum ! front surface t % matching_bins(i_filter_mesh) = mesh_indices_to_bin(m, & (/ i, j, k /) + 1, .true.) t % matching_bins(i_filter_surf) = IN_FRONT score_index = sum((t % matching_bins - 1) * t % stride) + 1 ! incoming - cmfd % current(7,h,i,j,k) = t % scores(1,score_index) % sum + cmfd % current(7,h,i,j,k) = t % results(1,score_index) % sum t % matching_bins(i_filter_surf) = OUT_FRONT score_index = sum((t % matching_bins - 1) * t % stride) + 1 ! outgoing - cmfd % current(8,h,i,j,k) = t % scores(1,score_index) % sum + cmfd % current(8,h,i,j,k) = t % results(1,score_index) % sum ! bottom surface t % matching_bins(i_filter_mesh) = mesh_indices_to_bin(m, & (/ i, j, k-1 /) + 1, .true.) t % matching_bins(i_filter_surf) = IN_TOP score_index = sum((t % matching_bins - 1) * t % stride) + 1 ! outgoing - cmfd % current(9,h,i,j,k) = t % scores(1,score_index) % sum + cmfd % current(9,h,i,j,k) = t % results(1,score_index) % sum t % matching_bins(i_filter_surf) = OUT_TOP score_index = sum((t % matching_bins - 1) * t % stride) + 1 ! incoming - cmfd % current(10,h,i,j,k) = t % scores(1,score_index) % sum + cmfd % current(10,h,i,j,k) = t % results(1,score_index) % sum ! top surface t % matching_bins(i_filter_mesh) = mesh_indices_to_bin(m, & (/ i, j, k /) + 1, .true.) t % matching_bins(i_filter_surf) = IN_TOP score_index = sum((t % matching_bins - 1) * t % stride) + 1 ! incoming - cmfd % current(11,h,i,j,k) = t % scores(1,score_index) % sum + cmfd % current(11,h,i,j,k) = t % results(1,score_index) % sum t % matching_bins(i_filter_surf) = OUT_TOP score_index = sum((t % matching_bins - 1) * t % stride) + 1 ! outgoing - cmfd % current(12,h,i,j,k) = t % scores(1,score_index) % sum + cmfd % current(12,h,i,j,k) = t % results(1,score_index) % sum end if TALLY diff --git a/src/cmfd_execute.F90 b/src/cmfd_execute.F90 index fed242582..c962fd997 100644 --- a/src/cmfd_execute.F90 +++ b/src/cmfd_execute.F90 @@ -478,7 +478,7 @@ contains use global, only: n_user_tallies, n_tallies, tallies, message use output, only: write_message - use tally, only: reset_score + use tally, only: reset_result integer :: i ! loop counter @@ -491,7 +491,7 @@ contains ! reset that tally tallies(i) % n_realizations = 0 - call reset_score(tallies(i) % scores) + call reset_result(tallies(i) % results) end do diff --git a/src/cmfd_input.F90 b/src/cmfd_input.F90 index 51e8a1aad..aa8c1e23f 100644 --- a/src/cmfd_input.F90 +++ b/src/cmfd_input.F90 @@ -173,7 +173,7 @@ contains use mesh_header, only: StructuredMesh use string use tally, only: setup_active_cmfdtallies - use tally_header, only: TallyObject, TallyScore, TallyFilter + use tally_header, only: TallyObject, TallyFilter use xml_data_cmfd_t integer :: i ! loop counter diff --git a/src/global.F90 b/src/global.F90 index 41a016b10..813de5673 100644 --- a/src/global.F90 +++ b/src/global.F90 @@ -13,7 +13,7 @@ module global use particle_header, only: Particle use plot_header, only: Plot use source_header, only: ExtSource - use tally_header, only: TallyObject, TallyMap, TallyScore + use tally_header, only: TallyObject, TallyMap, TallyResult use timing, only: Timer #ifdef MPI @@ -111,7 +111,7 @@ module global ! 3) track-length estimate of k-eff ! 4) leakage fraction - type(TallyScore), target :: global_tallies(N_GLOBAL_TALLIES) + type(TallyResult), target :: global_tallies(N_GLOBAL_TALLIES) ! Tally map structure type(TallyMap), allocatable :: tally_maps(:) @@ -208,7 +208,7 @@ module global logical :: mpi_enabled = .false. ! is MPI in use and initialized? integer :: mpi_err ! MPI error code integer :: MPI_BANK ! MPI datatype for fission bank - integer :: MPI_TALLYSCORE ! MPI datatype for TallyScore + integer :: MPI_TALLYRESULT ! MPI datatype for TallyResult ! No reduction at end of batch logical :: reduce_tallies = .true. @@ -240,11 +240,11 @@ module global ! HDF5 VARIABLES #ifdef HDF5 - integer(HID_T) :: hdf5_output_file ! identifier for output file - integer(HID_T) :: hdf5_tallyscore_t ! Compound type for TallyScore - integer(HID_T) :: hdf5_bank_t ! Compound type for Bank - integer(HID_T) :: hdf5_integer8_t ! type for integer(8) - integer :: hdf5_err ! error flag + integer(HID_T) :: hdf5_output_file ! identifier for output file + integer(HID_T) :: hdf5_tallyresult_t ! Compound type for TallyResult + integer(HID_T) :: hdf5_bank_t ! Compound type for Bank + integer(HID_T) :: hdf5_integer8_t ! type for integer(8) + integer :: hdf5_err ! error flag #endif ! ============================================================================ diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index a52719738..e13be7ca9 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -30,20 +30,20 @@ contains subroutine hdf5_initialize() - type(TallyScore), target :: tmp(2) ! temporary TallyScore - type(Bank), target :: tmpb(2) ! temporary Bank - integer(HID_T) :: coordinates_t ! HDF5 type for 3 reals - integer(HSIZE_T) :: dims(1) = (/3/) ! size of coordinates + type(TallyResult), target :: tmp(2) ! temporary TallyResult + type(Bank), target :: tmpb(2) ! temporary Bank + integer(HID_T) :: coordinates_t ! HDF5 type for 3 reals + integer(HSIZE_T) :: dims(1) = (/3/) ! size of coordinates ! Initialize FORTRAN interface. call h5open_f(hdf5_err) - ! Create the compound datatype for TallyScore + ! Create the compound datatype for TallyResult call h5tcreate_f(H5T_COMPOUND_F, h5offsetof(c_loc(tmp(1)), & - c_loc(tmp(2))), hdf5_tallyscore_t, hdf5_err) - call h5tinsert_f(hdf5_tallyscore_t, "sum", h5offsetof(c_loc(tmp(1)), & + c_loc(tmp(2))), hdf5_tallyresult_t, hdf5_err) + call h5tinsert_f(hdf5_tallyresult_t, "sum", h5offsetof(c_loc(tmp(1)), & c_loc(tmp(1)%sum)), H5T_NATIVE_DOUBLE, hdf5_err) - call h5tinsert_f(hdf5_tallyscore_t, "sum_sq", h5offsetof(c_loc(tmp(1)), & + call h5tinsert_f(hdf5_tallyresult_t, "sum_sq", h5offsetof(c_loc(tmp(1)), & c_loc(tmp(1)%sum_sq)), H5T_NATIVE_DOUBLE, hdf5_err) ! Create compound type for xyz and uvw @@ -73,7 +73,7 @@ contains subroutine hdf5_finalize() ! Release compound datatypes - call h5tclose_f(hdf5_tallyscore_t, hdf5_err) + call h5tclose_f(hdf5_tallyresult_t, hdf5_err) ! Close FORTRAN interface. call h5close_f(hdf5_err) @@ -1031,10 +1031,10 @@ contains ! Write global tallies dims(1) = N_GLOBAL_TALLIES call h5screate_simple_f(1, dims, dspace, hdf5_err) - call h5dcreate_f(hdf5_state_point, "global_tallies", hdf5_tallyscore_t, & + call h5dcreate_f(hdf5_state_point, "global_tallies", hdf5_tallyresult_t, & dspace, dset, hdf5_err) f_ptr = c_loc(global_tallies(1)) - CALL h5dwrite_f(dset, hdf5_tallyscore_t, f_ptr, hdf5_err) + CALL h5dwrite_f(dset, hdf5_tallyresult_t, f_ptr, hdf5_err) call h5dclose_f(dset, hdf5_err) call h5sclose_f(dspace, hdf5_err) @@ -1043,7 +1043,7 @@ contains call hdf5_write_integer(tallies_group, "tallies_present", 1) ! Write tally sum and sum_sq - TALLY_SCORES: do i = 1, n_tallies + TALLY_RESULTS: do i = 1, n_tallies ! Get pointer to tally t => tallies(i) @@ -1052,18 +1052,18 @@ contains temp_group, hdf5_err) ! Write sum and sum_sq for each bin - dims2 = shape(t % scores) + dims2 = shape(t % results) call h5screate_simple_f(2, dims2, dspace, hdf5_err) - call h5dcreate_f(temp_group, "values", hdf5_tallyscore_t, & + call h5dcreate_f(temp_group, "results", hdf5_tallyresult_t, & dspace, dset, hdf5_err) - f_ptr = c_loc(t % scores(1, 1)) - CALL h5dwrite_f(dset, hdf5_tallyscore_t, f_ptr, hdf5_err) + f_ptr = c_loc(t % results(1, 1)) + CALL h5dwrite_f(dset, hdf5_tallyresult_t, f_ptr, hdf5_err) call h5dclose_f(dset, hdf5_err) call h5sclose_f(dspace, hdf5_err) ! Close group for the i-th tally call h5gclose_f(temp_group, hdf5_err) - end do TALLY_SCORES + end do TALLY_RESULTS else ! Indicate that tallies are off call hdf5_write_integer(tallies_group, "tallies_present", 0) @@ -1153,7 +1153,7 @@ contains ! Read global tallies f_ptr = c_loc(global_tallies(1)) - call h5dread_f(dset, hdf5_tallyscore_t, f_ptr, hdf5_err) + call h5dread_f(dset, hdf5_tallyresult_t, f_ptr, hdf5_err) ! Close global tallies dataset call h5dclose_f(dset, hdf5_err) @@ -1167,14 +1167,14 @@ contains call hdf5_read_integer(tally_group, "n_realizations", & tallies(i) % n_realizations) - ! Open dataset for tally values - call h5dopen_f(tally_group, "values", dset, hdf5_err) + ! Open dataset for tally results + call h5dopen_f(tally_group, "results", dset, hdf5_err) ! Read sum and sum_sq for each tally bin - f_ptr = c_loc(tallies(i) % scores(1,1)) - call h5dread_f(dset, hdf5_tallyscore_t, f_ptr, hdf5_err) + f_ptr = c_loc(tallies(i) % results(1,1)) + call h5dread_f(dset, hdf5_tallyresult_t, f_ptr, hdf5_err) - ! Close dataset for tally values + ! Close dataset for tally results call h5dclose_f(dset, hdf5_err) ! Close tally group @@ -1191,7 +1191,7 @@ contains f_ptr = c_loc(source_bank(1)) call h5dread_f(dset, hdf5_bank_t, f_ptr, hdf5_err) - ! Close dataset for tally values + ! Close dataset for source bank call h5dclose_f(dset, hdf5_err) ! Close HDF5 state point file diff --git a/src/initialize.F90 b/src/initialize.F90 index d25da7ddc..3eb2a156e 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -169,14 +169,14 @@ contains integer :: bank_types(4) ! Datatypes integer(MPI_ADDRESS_KIND) :: bank_disp(4) ! Displacements integer :: temp_type ! temporary derived type - integer :: score_blocks(1) ! Count for each datatype - integer :: score_types(1) ! Datatypes - integer(MPI_ADDRESS_KIND) :: score_disp(1) ! Displacements - integer(MPI_ADDRESS_KIND) :: score_base_disp ! Base displacement - integer(MPI_ADDRESS_KIND) :: lower_bound ! Lower bound for TallyScore - integer(MPI_ADDRESS_KIND) :: extent ! Extent for TallyScore + integer :: result_blocks(1) ! Count for each datatype + integer :: result_types(1) ! Datatypes + integer(MPI_ADDRESS_KIND) :: result_disp(1) ! Displacements + integer(MPI_ADDRESS_KIND) :: result_base_disp ! Base displacement + integer(MPI_ADDRESS_KIND) :: lower_bound ! Lower bound for TallyResult + integer(MPI_ADDRESS_KIND) :: extent ! Extent for TallyResult type(Bank) :: b - type(TallyScore) :: ts + type(TallyResult) :: tr ! Indicate that MPI is turned on mpi_enabled = .true. @@ -215,29 +215,29 @@ contains call MPI_TYPE_COMMIT(MPI_BANK, mpi_err) ! ========================================================================== - ! CREATE MPI_TALLYSCORE TYPE + ! CREATE MPI_TALLYRESULT TYPE ! Determine displacements for MPI_BANK type - call MPI_GET_ADDRESS(ts % value, score_base_disp, mpi_err) - call MPI_GET_ADDRESS(ts % sum, score_disp(1), mpi_err) + call MPI_GET_ADDRESS(tr % value, result_base_disp, mpi_err) + call MPI_GET_ADDRESS(tr % sum, result_disp(1), mpi_err) ! Adjust displacements - score_disp = score_disp - score_base_disp + result_disp = result_disp - result_base_disp - ! Define temporary type for tallyscore - score_blocks = (/ 2 /) - score_types = (/ MPI_REAL8 /) - call MPI_TYPE_CREATE_STRUCT(1, score_blocks, score_disp, score_types, & + ! Define temporary type for TallyResult + result_blocks = (/ 2 /) + result_types = (/ MPI_REAL8 /) + call MPI_TYPE_CREATE_STRUCT(1, result_blocks, result_disp, result_types, & temp_type, mpi_err) ! Adjust lower-bound and extent of type for tally score lower_bound = 0 - extent = score_disp(1) + 16 + extent = result_disp(1) + 16 call MPI_TYPE_CREATE_RESIZED(temp_type, lower_bound, extent, & - MPI_TALLYSCORE, mpi_err) + MPI_TALLYRESULT, mpi_err) ! Commit derived type for tally scores - call MPI_TYPE_COMMIT(MPI_TALLYSCORE, mpi_err) + call MPI_TYPE_COMMIT(MPI_TALLYRESULT, mpi_err) end subroutine initialize_mpi #endif diff --git a/src/mesh.F90 b/src/mesh.F90 index 1c80a94e0..cc3734d43 100644 --- a/src/mesh.F90 +++ b/src/mesh.F90 @@ -93,7 +93,7 @@ contains !=============================================================================== ! MESH_INDICES_TO_BIN maps (i,j) or (i,j,k) indices to a single bin number for -! use in a TallyObject scores array +! use in a TallyObject results array !=============================================================================== function mesh_indices_to_bin(m, ijk, surface_current) result(bin) @@ -126,7 +126,7 @@ contains end function mesh_indices_to_bin !=============================================================================== -! BIN_TO_MESH_INDICES maps a single mesh bin from a TallyObject scores array to +! BIN_TO_MESH_INDICES maps a single mesh bin from a TallyObject results array to ! (i,j) or (i,j,k) indices !=============================================================================== diff --git a/src/output.F90 b/src/output.F90 index 4be436291..8a8d3a176 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -1387,7 +1387,7 @@ contains integer :: n ! loop index for nuclides integer :: type ! type of tally filter integer :: indent ! number of spaces to preceed output - integer :: filter_index ! index in scores array for filters + integer :: filter_index ! index in results array for filters integer :: score_index ! scoring bin index integer :: i_nuclide ! index in nuclides array integer :: i_listing ! index in xs_listings array @@ -1453,14 +1453,14 @@ contains ! Multiply uncertainty by t-value if (confidence_intervals) then - do k = 1, size(t % scores, 2) - do j = 1, size(t % scores, 1) + 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 % scores(j,k) % sum_sq = t_value * t % scores(j,k) % sum_sq + t % results(j,k) % sum_sq = t_value * t % results(j,k) % sum_sq end do end do end if @@ -1480,7 +1480,7 @@ contains cycle end if - ! WARNING: Admittedly, the logic for moving for printing scores is + ! WARNING: Admittedly, the logic for moving for printing results is ! extremely confusing and took quite a bit of time to get correct. The ! logic is structured this way since it is not practical to have a do ! loop for each filter variable (given that only a few filters are likely @@ -1511,7 +1511,7 @@ contains indent = indent - 2 ! ================================================================= - ! VALID BIN -- WRITE FILTER INFORMATION OR EXIT TO WRITE SCORES + ! VALID BIN -- WRITE FILTER INFORMATION OR EXIT TO WRITE RESULTS else ! Check if this is last filter @@ -1544,7 +1544,7 @@ contains filter_index = 1 end if - ! Write scores for this filter bin combination + ! Write results for this filter bin combination score_index = 0 if (t % n_filters > 0) indent = indent + 2 do n = 1, t % n_nuclide_bins @@ -1564,8 +1564,8 @@ contains score_index = score_index + 1 write(UNIT=UNIT_TALLY, FMT='(1X,2A,1X,A,"+/- ",A)') & repeat(" ", indent), score_name(abs(t % score_bins(k))), & - to_str(t % scores(score_index,filter_index) % sum), & - trim(to_str(t % scores(score_index,filter_index) % sum_sq)) + to_str(t % results(score_index,filter_index) % sum), & + trim(to_str(t % results(score_index,filter_index) % sum_sq)) end do indent = indent - 2 @@ -1601,7 +1601,7 @@ contains integer :: n ! number of incoming energy bins integer :: len1 ! length of string integer :: len2 ! length of string - integer :: filter_index ! index in scores array for filters + integer :: filter_index ! index in results array for filters logical :: print_ebin ! should incoming energy bin be displayed? character(MAX_LINE_LEN) :: string type(StructuredMesh), pointer :: m => null() @@ -1652,15 +1652,15 @@ contains filter_index = sum((t % matching_bins - 1) * t % stride) + 1 write(UNIT=UNIT_TALLY, FMT='(5X,A,T35,A,"+/- ",A)') & "Outgoing Current to Left", & - to_str(t % scores(1,filter_index) % sum), & - trim(to_str(t % scores(1,filter_index) % sum_sq)) + to_str(t % results(1,filter_index) % sum), & + trim(to_str(t % results(1,filter_index) % sum_sq)) t % matching_bins(i_filter_surf) = OUT_RIGHT filter_index = sum((t % matching_bins - 1) * t % stride) + 1 write(UNIT=UNIT_TALLY, FMT='(5X,A,T35,A,"+/- ",A)') & "Incoming Current from Left", & - to_str(t % scores(1,filter_index) % sum), & - trim(to_str(t % scores(1,filter_index) % sum_sq)) + to_str(t % results(1,filter_index) % sum), & + trim(to_str(t % results(1,filter_index) % sum_sq)) ! Right Surface t % matching_bins(i_filter_mesh) = & @@ -1669,15 +1669,15 @@ contains filter_index = sum((t % matching_bins - 1) * t % stride) + 1 write(UNIT=UNIT_TALLY, FMT='(5X,A,T35,A,"+/- ",A)') & "Incoming Current from Right", & - to_str(t % scores(1,filter_index) % sum), & - trim(to_str(t % scores(1,filter_index) % sum_sq)) + to_str(t % results(1,filter_index) % sum), & + trim(to_str(t % results(1,filter_index) % sum_sq)) t % matching_bins(i_filter_surf) = OUT_RIGHT filter_index = sum((t % matching_bins - 1) * t % stride) + 1 write(UNIT=UNIT_TALLY, FMT='(5X,A,T35,A,"+/- ",A)') & "Outgoing Current to Right", & - to_str(t % scores(1,filter_index) % sum), & - trim(to_str(t % scores(1,filter_index) % sum_sq)) + to_str(t % results(1,filter_index) % sum), & + trim(to_str(t % results(1,filter_index) % sum_sq)) ! Back Surface t % matching_bins(i_filter_mesh) = & @@ -1686,15 +1686,15 @@ contains filter_index = sum((t % matching_bins - 1) * t % stride) + 1 write(UNIT=UNIT_TALLY, FMT='(5X,A,T35,A,"+/- ",A)') & "Outgoing Current to Back", & - to_str(t % scores(1,filter_index) % sum), & - trim(to_str(t % scores(1,filter_index) % sum_sq)) + to_str(t % results(1,filter_index) % sum), & + trim(to_str(t % results(1,filter_index) % sum_sq)) t % matching_bins(i_filter_surf) = OUT_FRONT filter_index = sum((t % matching_bins - 1) * t % stride) + 1 write(UNIT=UNIT_TALLY, FMT='(5X,A,T35,A,"+/- ",A)') & "Incoming Current from Back", & - to_str(t % scores(1,filter_index) % sum), & - trim(to_str(t % scores(1,filter_index) % sum_sq)) + to_str(t % results(1,filter_index) % sum), & + trim(to_str(t % results(1,filter_index) % sum_sq)) ! Front Surface t % matching_bins(i_filter_mesh) = & @@ -1703,15 +1703,15 @@ contains filter_index = sum((t % matching_bins - 1) * t % stride) + 1 write(UNIT=UNIT_TALLY, FMT='(5X,A,T35,A,"+/- ",A)') & "Incoming Current from Front", & - to_str(t % scores(1,filter_index) % sum), & - trim(to_str(t % scores(1,filter_index) % sum_sq)) + to_str(t % results(1,filter_index) % sum), & + trim(to_str(t % results(1,filter_index) % sum_sq)) t % matching_bins(i_filter_surf) = OUT_FRONT filter_index = sum((t % matching_bins - 1) * t % stride) + 1 write(UNIT=UNIT_TALLY, FMT='(5X,A,T35,A,"+/- ",A)') & "Outgoing Current to Front", & - to_str(t % scores(1,filter_index) % sum), & - trim(to_str(t % scores(1,filter_index) % sum_sq)) + to_str(t % results(1,filter_index) % sum), & + trim(to_str(t % results(1,filter_index) % sum_sq)) ! Bottom Surface t % matching_bins(i_filter_mesh) = & @@ -1720,15 +1720,15 @@ contains filter_index = sum((t % matching_bins - 1) * t % stride) + 1 write(UNIT=UNIT_TALLY, FMT='(5X,A,T35,A,"+/- ",A)') & "Outgoing Current to Bottom", & - to_str(t % scores(1,filter_index) % sum), & - trim(to_str(t % scores(1,filter_index) % sum_sq)) + to_str(t % results(1,filter_index) % sum), & + trim(to_str(t % results(1,filter_index) % sum_sq)) t % matching_bins(i_filter_surf) = OUT_TOP filter_index = sum((t % matching_bins - 1) * t % stride) + 1 write(UNIT=UNIT_TALLY, FMT='(5X,A,T35,A,"+/- ",A)') & "Incoming Current from Bottom", & - to_str(t % scores(1,filter_index) % sum), & - trim(to_str(t % scores(1,filter_index) % sum_sq)) + to_str(t % results(1,filter_index) % sum), & + trim(to_str(t % results(1,filter_index) % sum_sq)) ! Top Surface t % matching_bins(i_filter_mesh) = & @@ -1737,15 +1737,15 @@ contains filter_index = sum((t % matching_bins - 1) * t % stride) + 1 write(UNIT=UNIT_TALLY, FMT='(5X,A,T35,A,"+/- ",A)') & "Incoming Current from Top", & - to_str(t % scores(1,filter_index) % sum), & - trim(to_str(t % scores(1,filter_index) % sum_sq)) + to_str(t % results(1,filter_index) % sum), & + trim(to_str(t % results(1,filter_index) % sum_sq)) t % matching_bins(i_filter_surf) = OUT_TOP filter_index = sum((t % matching_bins - 1) * t % stride) + 1 write(UNIT=UNIT_TALLY, FMT='(5X,A,T35,A,"+/- ",A)') & "Outgoing Current to Top", & - to_str(t % scores(1,filter_index) % sum), & - trim(to_str(t % scores(1,filter_index) % sum_sq)) + to_str(t % results(1,filter_index) % sum), & + trim(to_str(t % results(1,filter_index) % sum_sq)) end do end do diff --git a/src/state_point.F90 b/src/state_point.F90 index 566ce04ad..e32833476 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -82,7 +82,7 @@ contains ! If using the no-tally-reduction method, we need to collect tally ! results before writing them to the state point file. - call write_tally_scores_nr(fh) + call write_tally_results_nr(fh) elseif (master) then ! Write number of realizations @@ -93,7 +93,7 @@ contains call MPI_FILE_WRITE(fh, N_GLOBAL_TALLIES, 1, MPI_INTEGER, & MPI_STATUS_IGNORE, mpi_err) call MPI_FILE_WRITE(fh, global_tallies, N_GLOBAL_TALLIES, & - MPI_TALLYSCORE, MPI_STATUS_IGNORE, mpi_err) + MPI_TALLYRESULT, MPI_STATUS_IGNORE, mpi_err) if (tallies_on) then ! Indicate that tallies are on @@ -101,14 +101,14 @@ contains call MPI_FILE_WRITE(fh, temp, 1, MPI_INTEGER, & MPI_STATUS_IGNORE, mpi_err) - ! Write all tally scores - TALLY_SCORES: do i = 1, n_tallies + ! Write all tally results + TALLY_RESULTS: do i = 1, n_tallies t => tallies(i) - n = size(t % scores, 1) * size(t % scores, 2) - call MPI_FILE_WRITE(fh, t % scores, n, MPI_TALLYSCORE, & + n = size(t % results, 1) * size(t % results, 2) + call MPI_FILE_WRITE(fh, t % results, n, MPI_TALLYRESULT, & MPI_STATUS_IGNORE, mpi_err) - end do TALLY_SCORES + end do TALLY_RESULTS else ! Indicate that tallies are off temp = 0 @@ -209,7 +209,7 @@ contains ! Number of realizations write(UNIT_STATE) t % n_realizations - ! Write size of each dimension of tally scores array + ! Write size of each dimension of tally results array write(UNIT_STATE) t % total_score_bins write(UNIT_STATE) t % total_filter_bins @@ -263,18 +263,18 @@ contains ! Indicate that tallies are on write(UNIT_STATE) 1 - TALLY_SCORES: do i = 1, n_tallies + TALLY_RESULTS: do i = 1, n_tallies ! Get pointer to tally t => tallies(i) ! Write tally sum and sum_sq for each bin - do k = 1, size(t % scores, 2) - do j = 1, size(t % scores, 1) - write(UNIT_STATE) t % scores(j,k) % sum - write(UNIT_STATE) t % scores(j,k) % sum_sq + do k = 1, size(t % results, 2) + do j = 1, size(t % results, 1) + write(UNIT_STATE) t % results(j,k) % sum + write(UNIT_STATE) t % results(j,k) % sum_sq end do end do - end do TALLY_SCORES + end do TALLY_RESULTS else ! Indicate that tallies are off write(UNIT_STATE) 0 @@ -454,10 +454,10 @@ contains #ifdef MPI !=============================================================================== -! WRITE_TALLY_SCORES_NR +! WRITE_TALLY_RESULTS_NR !=============================================================================== - subroutine write_tally_scores_nr(fh) + subroutine write_tally_results_nr(fh) integer, intent(in) :: fh ! file handle @@ -466,7 +466,7 @@ contains integer :: m ! number of score bins integer :: temp ! temporary variable integer :: n_bins ! total number of bins - real(8), allocatable :: tally_temp(:,:,:) ! contiguous array of scores + real(8), allocatable :: tally_temp(:,:,:) ! contiguous array of results real(8) :: global_temp(2,N_GLOBAL_TALLIES) real(8) :: dummy ! temporary receive buffer for non-root reduces type(TallyObject), pointer :: t => null() @@ -518,20 +518,20 @@ contains MPI_STATUS_IGNORE, mpi_err) end if - ! Write all tally scores - TALLY_SCORES: do i = 1, n_tallies + ! Write all tally results + TALLY_RESULTS: do i = 1, n_tallies t => tallies(i) - ! Determine size of tally scores array - m = size(t % scores, 1) - n = size(t % scores, 2) + ! Determine size of tally results array + m = size(t % results, 1) + n = size(t % results, 2) n_bins = m*n*2 ! Allocate array for storing sums and sums of squares, but ! contiguously in memory for each allocate(tally_temp(2,m,n)) - tally_temp(1,:,:) = t % scores(:,:) % sum - tally_temp(2,:,:) = t % scores(:,:) % sum_sq + tally_temp(1,:,:) = t % results(:,:) % sum + tally_temp(2,:,:) = t % results(:,:) % sum_sq if (master) then ! The MPI_IN_PLACE specifier allows the master to copy values into @@ -544,10 +544,10 @@ contains MPI_STATUS_IGNORE, mpi_err) ! At the end of the simulation, store the results back in the - ! regular TallyScores array + ! regular TallyResults array if (current_batch == n_batches) then - t % scores(:,:) % sum = tally_temp(1,:,:) - t % scores(:,:) % sum_sq = tally_temp(2,:,:) + t % results(:,:) % sum = tally_temp(1,:,:) + t % results(:,:) % sum_sq = tally_temp(2,:,:) end if else ! Receive buffer not significant at other processors @@ -557,7 +557,7 @@ contains ! Deallocate temporary copy of tally results deallocate(tally_temp) - end do TALLY_SCORES + end do TALLY_RESULTS else if (master) then ! Indicate that tallies are off @@ -567,7 +567,7 @@ contains end if end if - end subroutine write_tally_scores_nr + end subroutine write_tally_results_nr #endif !=============================================================================== @@ -687,12 +687,12 @@ contains call MPI_FILE_READ(fh, tallies(i) % n_realizations, 1, & MPI_INTEGER, MPI_STATUS_IGNORE, mpi_err) - ! Read dimensions of tally filters and scores and make sure they + ! Read dimensions of tally filters and results and make sure they ! match call MPI_FILE_READ(fh, temp, 2, MPI_INTEGER, & MPI_STATUS_IGNORE, mpi_err) - if (temp(1) /= size(tallies(i) % scores, 1) .or. & - temp(2) /= size(tallies(i) % scores, 2)) then + if (temp(1) /= size(tallies(i) % results, 1) .or. & + temp(2) /= size(tallies(i) % results, 2)) then message = "Tally dimensions do not match in state point." call fatal_error() end if @@ -736,7 +736,7 @@ contains MPI_STATUS_IGNORE, mpi_err) deallocate(int_array) - ! Read number of scores + ! Read number of results call MPI_FILE_READ(fh, temp, 1, MPI_INTEGER, & MPI_STATUS_IGNORE, mpi_err) @@ -760,7 +760,7 @@ contains ! Read global tally data call MPI_FILE_READ(fh, global_tallies, N_GLOBAL_TALLIES, & - MPI_TALLYSCORE, MPI_STATUS_IGNORE, mpi_err) + MPI_TALLYRESULT, MPI_STATUS_IGNORE, mpi_err) ! Check if tally results are present call MPI_FILE_READ(fh, temp, 1, MPI_INTEGER, MPI_STATUS_IGNORE, mpi_err) @@ -770,11 +770,11 @@ contains ! Read sum and sum squared if (temp(1) == 1) then - TALLY_SCORES: do i = 1, n_tallies - n = size(tallies(i) % scores, 1) * size(tallies(i) % scores, 2) - call MPI_FILE_READ(fh, tallies(i) % scores, n, MPI_TALLYSCORE, & + TALLY_RESULTS: do i = 1, n_tallies + n = size(tallies(i) % results, 1) * size(tallies(i) % results, 2) + call MPI_FILE_READ(fh, tallies(i) % results, n, MPI_TALLYRESULT, & MPI_STATUS_IGNORE, mpi_err) - end do TALLY_SCORES + end do TALLY_RESULTS end if end if @@ -886,11 +886,11 @@ contains ! Read number of realizations read(UNIT_STATE) tallies(i) % n_realizations - ! Read dimensions of tally filters and scores and make sure they + ! Read dimensions of tally filters and results and make sure they ! match read(UNIT_STATE) temp(1:2) - if (temp(1) /= size(tallies(i) % scores, 1) .or. & - temp(2) /= size(tallies(i) % scores, 2)) then + if (temp(1) /= size(tallies(i) % results, 1) .or. & + temp(2) /= size(tallies(i) % results, 2)) then message = "Tally dimensions do not match in state point." call fatal_error() end if @@ -927,7 +927,7 @@ contains read(UNIT_STATE) int_array deallocate(int_array) - ! Read number of scores + ! Read number of results read(UNIT_STATE) temp(1) ! Read nuclide bins @@ -955,14 +955,14 @@ contains ! Read sum and sum squared read(UNIT_STATE) temp(1) if (temp(1) == 1) then - TALLY_SCORES: do i = 1, n_tallies - do k = 1, size(tallies(i) % scores, 2) - do j = 1, size(tallies(i) % scores, 1) - read(UNIT_STATE) tallies(i) % scores(j,k) % sum - read(UNIT_STATE) tallies(i) % scores(j,k) % sum_sq + TALLY_RESULTS: do i = 1, n_tallies + do k = 1, size(tallies(i) % results, 2) + do j = 1, size(tallies(i) % results, 1) + read(UNIT_STATE) tallies(i) % results(j,k) % sum + read(UNIT_STATE) tallies(i) % results(j,k) % sum_sq end do end do - end do TALLY_SCORES + end do TALLY_RESULTS end if end if diff --git a/src/tally.F90 b/src/tally.F90 index e271cad72..87c468e52 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -11,7 +11,7 @@ module tally use output, only: header use search, only: binary_search use string, only: to_str - use tally_header, only: TallyScore, TallyMapItem, TallyMapElement + use tally_header, only: TallyResult, TallyMapItem, TallyMapElement #ifdef MPI use mpi @@ -73,10 +73,10 @@ contains end if ! ======================================================================= - ! CALCULATE SCORES AND ACCUMULATE TALLY + ! CALCULATE RESULTS AND ACCUMULATE TALLY ! If we have made it here, we have a scoring combination of bins for this - ! tally -- now we need to determine where in the scores array we should + ! tally -- now we need to determine where in the results array we should ! be accumulating the tally values ! Determine scoring index for this filter combination @@ -303,7 +303,7 @@ contains ! bin. However, in the case of fission, since multiple ! fission neutrons were emitted with different energies, ! multiple outgoing energy bins may have been scored to. The - ! following logic treats this special case and scores to + ! following logic treats this special case and results to ! multiple bins call score_fission_eout(t, score_index) @@ -330,8 +330,8 @@ contains end select ! Add score to tally - t % scores(score_index, filter_index) % value = & - t % scores(score_index, filter_index) % value + score + t % results(score_index, filter_index) % value = & + t % results(score_index, filter_index) % value + score end do SCORE_LOOP @@ -400,8 +400,8 @@ contains i_filter = sum((t % matching_bins - 1) * t % stride) + 1 ! Add score to tally - t % scores(i_score, i_filter) % value = & - t % scores(i_score, i_filter) % value + score + t % results(i_score, i_filter) % value = & + t % results(i_score, i_filter) % value + score end do ! reset outgoing energy bin and score index @@ -465,10 +465,10 @@ contains end if ! ======================================================================= - ! CALCULATE SCORES AND ACCUMULATE TALLY + ! CALCULATE RESULTS AND ACCUMULATE TALLY ! If we have made it here, we have a scoring combination of bins for this - ! tally -- now we need to determine where in the scores array we should + ! tally -- now we need to determine where in the results array we should ! be accumulating the tally values ! Determine scoring index for this filter combination @@ -561,8 +561,8 @@ contains score_index = (k - 1)*t % n_score_bins + j ! Add score to tally - t % scores(score_index, filter_index) % value = & - t % scores(score_index, filter_index) % value + score + t % results(score_index, filter_index) % value = & + t % results(score_index, filter_index) % value + score end do SCORE_LOOP @@ -656,8 +656,8 @@ contains score_index = (i_nuclide - 1)*t % n_score_bins + j ! Add score to tally - t % scores(score_index, filter_index) % value = & - t % scores(score_index, filter_index) % value + score + t % results(score_index, filter_index) % value = & + t % results(score_index, filter_index) % value + score end do SCORE_LOOP @@ -697,8 +697,8 @@ contains score_index = n_nuclides_total*t % n_score_bins + j ! Add score to tally - t % scores(score_index, filter_index) % value = & - t % scores(score_index, filter_index) % value + score + t % results(score_index, filter_index) % value = & + t % results(score_index, filter_index) % value + score end do MATERIAL_SCORE_LOOP @@ -986,8 +986,8 @@ contains score_index = (b - 1)*t % n_score_bins + j ! Add score to tally - t % scores(score_index, filter_index) % value = & - t % scores(score_index, filter_index) % value + score + t % results(score_index, filter_index) % value = & + t % results(score_index, filter_index) % value + score end do SCORE_LOOP @@ -1208,8 +1208,8 @@ contains t % matching_bins(i_filter_mesh) = & mesh_indices_to_bin(m, ijk0 + 1, .true.) filter_index = sum((t % matching_bins - 1) * t % stride) + 1 - t % scores(1, filter_index) % value = & - t % scores(1, filter_index) % value + p % wgt + t % results(1, filter_index) % value = & + t % results(1, filter_index) % value + p % wgt end if end do else @@ -1220,8 +1220,8 @@ contains t % matching_bins(i_filter_mesh) = & mesh_indices_to_bin(m, ijk0 + 1, .true.) filter_index = sum((t % matching_bins - 1) * t % stride) + 1 - t % scores(1, filter_index) % value = & - t % scores(1, filter_index) % value + p % wgt + t % results(1, filter_index) % value = & + t % results(1, filter_index) % value + p % wgt end if end do end if @@ -1237,8 +1237,8 @@ contains t % matching_bins(i_filter_mesh) = & mesh_indices_to_bin(m, ijk0 + 1, .true.) filter_index = sum((t % matching_bins - 1) * t % stride) + 1 - t % scores(1, filter_index) % value = & - t % scores(1, filter_index) % value + p % wgt + t % results(1, filter_index) % value = & + t % results(1, filter_index) % value + p % wgt end if end do else @@ -1249,8 +1249,8 @@ contains t % matching_bins(i_filter_mesh) = & mesh_indices_to_bin(m, ijk0 + 1, .true.) filter_index = sum((t % matching_bins - 1) * t % stride) + 1 - t % scores(1, filter_index) % value = & - t % scores(1, filter_index) % value + p % wgt + t % results(1, filter_index) % value = & + t % results(1, filter_index) % value + p % wgt end if end do end if @@ -1266,8 +1266,8 @@ contains t % matching_bins(i_filter_mesh) = & mesh_indices_to_bin(m, ijk0 + 1, .true.) filter_index = sum((t % matching_bins - 1) * t % stride) + 1 - t % scores(1, filter_index) % value = & - t % scores(1, filter_index) % value + p % wgt + t % results(1, filter_index) % value = & + t % results(1, filter_index) % value + p % wgt end if end do else @@ -1278,8 +1278,8 @@ contains t % matching_bins(i_filter_mesh) = & mesh_indices_to_bin(m, ijk0 + 1, .true.) filter_index = sum((t % matching_bins - 1) * t % stride) + 1 - t % scores(1, filter_index) % value = & - t % scores(1, filter_index) % value + p % wgt + t % results(1, filter_index) % value = & + t % results(1, filter_index) % value + p % wgt end if end do end if @@ -1403,8 +1403,8 @@ contains end if ! Add to surface current tally - t % scores(1, filter_index) % value = & - t % scores(1, filter_index) % value + p % wgt + t % results(1, filter_index) % value = & + t % results(1, filter_index) % value + p % wgt end if ! Calculate new coordinates @@ -1499,7 +1499,7 @@ contains ! Accumulate on master only unless run is not reduced then do it on all if (master .or. (.not. reduce_tallies)) then - ! Accumulate scores for each tally + ! Accumulate results for each tally curr_ptr => active_tallies do while(associated(curr_ptr)) call accumulate_tally(tallies(curr_ptr % data)) @@ -1507,13 +1507,13 @@ contains end do if (run_mode == MODE_EIGENVALUE) then - ! Before accumulating scores for global_tallies, we need to get the + ! Before accumulating results for global_tallies, we need to get the ! current batch estimate of k_analog for displaying to output if (active_batches) k_batch(current_batch) = global_tallies(K_ANALOG) % value end if - ! Accumulate scores for global tallies - if (active_batches) call accumulate_score(global_tallies) + ! Accumulate results for global tallies + if (active_batches) call accumulate_result(global_tallies) end if if (associated(curr_ptr)) nullify(curr_ptr) @@ -1530,7 +1530,7 @@ contains integer :: n ! number of filter bins integer :: m ! number of score bins integer :: n_bins ! total number of bins - real(8), allocatable :: tally_temp(:,:) ! contiguous array of scores + real(8), allocatable :: tally_temp(:,:) ! contiguous array of results real(8) :: global_temp(N_GLOBAL_TALLIES) real(8) :: dummy ! temporary receive buffer for non-root reduces type(TallyObject), pointer :: t => null() @@ -1546,7 +1546,7 @@ contains allocate(tally_temp(m,n)) - tally_temp = t % scores(:,:) % value + tally_temp = t % results(:,:) % value if (master) then ! The MPI_IN_PLACE specifier allows the master to copy values into @@ -1555,14 +1555,14 @@ contains MPI_SUM, 0, MPI_COMM_WORLD, mpi_err) ! Transfer values to value on master - t % scores(:,:) % value = tally_temp + t % results(:,:) % value = tally_temp else ! Receive buffer not significant at other processors call MPI_REDUCE(tally_temp, dummy, n_bins, MPI_REAL8, & MPI_SUM, 0, MPI_COMM_WORLD, mpi_err) ! Reset value on other processors - t % scores(:,:) % value = 0 + t % results(:,:) % value = 0 end if deallocate(tally_temp) @@ -1620,14 +1620,14 @@ contains t % n_realizations = t % n_realizations + n_procs end if - ! Accumulate each TallyScore - call accumulate_score(t % scores) + ! Accumulate each TallyResult + call accumulate_result(t % results) end subroutine accumulate_tally !=============================================================================== ! TALLY_STATISTICS computes the mean and standard deviation of the mean of each -! tally and stores them in the val and val_sq attributes of the TallyScores +! tally and stores them in the val and val_sq attributes of the TallyResults ! respectively !=============================================================================== @@ -1640,72 +1640,72 @@ contains do i = 1, n_tallies t => tallies(i) - call statistics_score(t % scores, t % n_realizations) + call statistics_result(t % results, t % n_realizations) end do ! Calculate statistics for global tallies - call statistics_score(global_tallies, n_realizations) + call statistics_result(global_tallies, n_realizations) end subroutine tally_statistics !=============================================================================== -! ACCUMULATE_SCORE accumulates scores from many histories (or many generations) +! ACCUMULATE_RESULT accumulates results from many histories (or many generations) ! into a single realization of a random variable. !=============================================================================== - elemental subroutine accumulate_score(score) + elemental subroutine accumulate_result(this) - type(TallyScore), intent(inout) :: score + type(TallyResult), intent(inout) :: this real(8) :: val - ! Add the sum and square of the sum of contributions from a tally score to + ! Add the sum and square of the sum of contributions from a tally result to ! the variables sum and sum_sq. This will later allow us to calculate a ! variance on the tallies. - val = score % value/total_weight - score % sum = score % sum + val - score % sum_sq = score % sum_sq + val*val + val = this % value/total_weight + this % sum = this % sum + val + this % sum_sq = this % sum_sq + val*val ! Reset the single batch estimate - score % value = ZERO + this % value = ZERO - end subroutine accumulate_score + end subroutine accumulate_result !=============================================================================== -! STATISTICS_SCORE determines the sample mean and the standard deviation of the -! mean for a TallyScore. +! STATISTICS_RESULT determines the sample mean and the standard deviation of the +! mean for a TallyResult. !=============================================================================== - elemental subroutine statistics_score(score, n) + elemental subroutine statistics_result(this, n) - type(TallyScore), intent(inout) :: score - integer, intent(in) :: n + type(TallyResult), intent(inout) :: this + integer, intent(in) :: n ! Calculate sample mean and standard deviation of the mean -- note that we ! have used Bessel's correction so that the estimator of the variance of the ! sample mean is unbiased. - score % sum = score % sum/n - score % sum_sq = sqrt((score % sum_sq/n - score % sum * & - score % sum) / (n - 1)) + this % sum = this % sum/n + this % sum_sq = sqrt((this % sum_sq/n - this % sum * & + this % sum) / (n - 1)) - end subroutine statistics_score + end subroutine statistics_result !=============================================================================== -! RESET_SCORE zeroes out the value and accumulated sum and sum-squared for a -! single TallyScore. +! RESET_RESULT zeroes out the value and accumulated sum and sum-squared for a +! single TallyResult. !=============================================================================== - elemental subroutine reset_score(score) + elemental subroutine reset_result(this) - type(TallyScore), intent(inout) :: score + type(TallyResult), intent(inout) :: this - score % value = ZERO - score % sum = ZERO - score % sum_sq = ZERO + this % value = ZERO + this % sum = ZERO + this % sum_sq = ZERO - end subroutine reset_score + end subroutine reset_result !=============================================================================== ! SETUP_ACTIVE_USERTALLIES diff --git a/src/tally_header.F90 b/src/tally_header.F90 index f47f0ab1d..073aa95ca 100644 --- a/src/tally_header.F90 +++ b/src/tally_header.F90 @@ -35,14 +35,14 @@ module tally_header end type TallyMap !=============================================================================== -! TALLYSCORE provides accumulation of scores in a particular tally bin +! TALLYRESULT provides accumulation of results in a particular tally bin !=============================================================================== - type TallyScore + type TallyResult real(8) :: value = 0. real(8) :: sum = 0. real(8) :: sum_sq = 0. - end type TallyScore + end type TallyResult !=============================================================================== ! TALLYFILTER describes a filter that limits what events score to a tally. For @@ -59,8 +59,8 @@ module tally_header !=============================================================================== ! TALLYOBJECT describes a user-specified tally. The region of phase space to -! tally in is given by the TallyBins and the scores are stored in a TallyScore -! array. +! tally in is given by the TallyFilters and the results are stored in a +! TallyResult array. !=============================================================================== type TallyObject @@ -77,10 +77,10 @@ module tally_header integer :: n_filters ! Number of filters type(TallyFilter), allocatable :: filters(:) ! Filter data (type/bins) - ! The stride attribute is used for determining the index in the scores + ! The stride attribute is used for determining the index in the results ! array for a matching_bin combination. Since multiple dimensions are - ! mapped onto one dimension in the scores array, the stride attribute gives - ! the stride for a given filter type within the scores array + ! mapped onto one dimension in the results array, the stride attribute gives + ! the stride for a given filter type within the results array integer, allocatable :: matching_bins(:) integer, allocatable :: stride(:) @@ -100,14 +100,14 @@ module tally_header integer :: n_score_bins = 0 integer, allocatable :: score_bins(:) - ! Scores for each bin -- the first dimenion of the array is for scores + ! Results for each bin -- the first dimension of the array is for scores ! (e.g. flux, total reaction rate, fission reaction rate, etc.) and the ! second dimension of the array is for the combination of filters ! (e.g. specific cell, specific energy group, etc.) integer :: total_filter_bins integer :: total_score_bins - type(TallyScore), allocatable :: scores(:,:) + type(TallyResult), allocatable :: results(:,:) ! reset property - allows a tally to be reset after every batch logical :: reset = .false. diff --git a/src/tally_initialize.F90 b/src/tally_initialize.F90 index 916bcfde2..d8e503a85 100644 --- a/src/tally_initialize.F90 +++ b/src/tally_initialize.F90 @@ -25,7 +25,7 @@ contains !=============================================================================== ! SETUP_TALLY_ARRAYS allocates and populates several member arrays of the -! TallyObject derived type, including stride, matching_bins, and scores. +! TallyObject derived type, including stride, matching_bins, and results. !=============================================================================== subroutine setup_tally_arrays() @@ -57,8 +57,8 @@ contains t % total_filter_bins = n t % total_score_bins = t % n_score_bins * t % n_nuclide_bins - ! Allocate scores array - allocate(t % scores(t % total_score_bins, t % total_filter_bins)) + ! Allocate results array + allocate(t % results(t % total_score_bins, t % total_filter_bins)) end do TALLY_LOOP @@ -68,7 +68,7 @@ contains ! SETUP_TALLY_MAPS creates a map that allows a quick determination of which ! tallies and bins need to be scored to when a particle makes a collision. This ! subroutine also sets the stride attribute for each tally as well as allocating -! storage for the scores array. +! storage for the results array. !=============================================================================== subroutine setup_tally_maps() diff --git a/src/utils/statepoint.py b/src/utils/statepoint.py index c19b8f953..0f400f8fe 100644 --- a/src/utils/statepoint.py +++ b/src/utils/statepoint.py @@ -81,7 +81,7 @@ class StatePoint(BinaryFile): # Set flags for what data was read self._metadata = False - self._values = False + self._results = False self._source = False # Initialize arrays for meshes and tallies @@ -194,7 +194,7 @@ class StatePoint(BinaryFile): # Set flag indicating metadata has already been read self._metadata = True - def read_values(self): + def read_results(self): # Check whether metadata has been read if not self._metadata: self._read_metadata() @@ -215,16 +215,16 @@ class StatePoint(BinaryFile): for t in self.tallies: n = t.total_score_bins * t.total_filter_bins - t.values = np.array(self._get_double(2*n)) - t.values.shape = (t.total_filter_bins, t.total_score_bins, 2) + t.results = np.array(self._get_double(2*n)) + t.results.shape = (t.total_filter_bins, t.total_score_bins, 2) - # Indicate that tally values have been read - self._values = True + # Indicate that tally results have been read + self._results = True def read_source(self): - # Check whether tally values have been read - if not self._values: - self.read_values() + # Check whether tally results have been read + if not self._results: + self.read_results() for i in range(self.n_particles): s = SourceSite() @@ -274,18 +274,18 @@ class StatePoint(BinaryFile): # Regular tallies for t in self.tallies: - for i in range(t.values.shape[0]): - for j in range(t.values.shape[1]): + for i in range(t.results.shape[0]): + for j in range(t.results.shape[1]): # Get sum and sum of squares - s, s2 = t.values[i,j] + s, s2 = t.results[i,j] # Calculate sample mean and replace value s /= n - t.values[i,j,0] = s + t.results[i,j,0] = s # Calculate standard deviation if s != 0.0: - t.values[i,j,1] = t_value*sqrt((s2/n - s*s)/(n-1)) + t.results[i,j,1] = t_value*sqrt((s2/n - s*s)/(n-1)) def get_value(self, tally_index, spec_list, score_index): """Returns a tally score given a list of filters to satisfy. @@ -305,14 +305,14 @@ class StatePoint(BinaryFile): score_index : int Index corresponding to score for tally, i.e. the second index in - Tally.values[:,:,:]. + Tally.results[:,:,:]. """ # Get Tally object given the index t = self.tallies[tally_index] - # Initialize index for filter in Tally.values[:,:,:] + # Initialize index for filter in Tally.results[:,:,:] filter_index = 0 # Loop over specified filters in spec_list @@ -335,7 +335,7 @@ class StatePoint(BinaryFile): else: filter_index += f_index*t.filters[f_type].stride - # Return the desired result from Tally.values. This could be the sum and + # Return the desired result from Tally.results. This could be the sum and # sum of squares, or it could be mean and stdev if self.generate_stdev() # has been called already. - return t.values[filter_index, score_index] + return t.results[filter_index, score_index] diff --git a/src/utils/statepoint_cmp.py b/src/utils/statepoint_cmp.py index 52ac000da..c4ef18a81 100755 --- a/src/utils/statepoint_cmp.py +++ b/src/utils/statepoint_cmp.py @@ -17,8 +17,8 @@ sp1 = StatePoint(path1) sp2 = StatePoint(path2) # Read tally results -sp1.read_values() -sp2.read_values() +sp1.read_results() +sp2.read_results() # Compare header information assert sp1.revision == sp2.revision @@ -71,7 +71,7 @@ for t1, t2 in zip(sp1.tallies, sp2.tallies): assert t1.scores == t2.scores # Compare tally results - assert_allclose(t1.values, t2.values) + assert_allclose(t1.results, t2.results) # If criticality, compare source sites if sp1.run_mode == 2: From 219a34b91f878d5a20ab4629e813ee08b997b56a Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 4 Dec 2012 11:02:53 -0500 Subject: [PATCH 05/11] Store k_batch at beginning of finalize_batch. --- src/eigenvalue.F90 | 7 +++++-- src/tally.F90 | 6 ------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/eigenvalue.F90 b/src/eigenvalue.F90 index 33e217f92..97603c3d8 100644 --- a/src/eigenvalue.F90 +++ b/src/eigenvalue.F90 @@ -152,6 +152,11 @@ contains integer :: i ! loop index for state point batches + ! Before accumulating results for global_tallies, we need to get the + ! current batch estimate of k_analog for displaying to output + if (run_mode == MODE_EIGENVALUE) k_batch(current_batch) = & + global_tallies(K_ANALOG) % value + ! Collect tallies if (tallies_on) then call timer_start(time_tallies) @@ -545,8 +550,6 @@ contains ! ========================================================================= ! SINGLE-BATCH ESTIMATE OF K-EFFECTIVE - if (.not. active_batches) k_batch(current_batch) = global_tallies(K_ANALOG) % value - #ifdef MPI if ((.not. active_batches) .or. (.not. reduce_tallies)) then ! Reduce value of k_batch if running in parallel diff --git a/src/tally.F90 b/src/tally.F90 index 87c468e52..e1af9ae66 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -1506,12 +1506,6 @@ contains curr_ptr => curr_ptr % next end do - if (run_mode == MODE_EIGENVALUE) then - ! Before accumulating results for global_tallies, we need to get the - ! current batch estimate of k_analog for displaying to output - if (active_batches) k_batch(current_batch) = global_tallies(K_ANALOG) % value - end if - ! Accumulate results for global tallies if (active_batches) call accumulate_result(global_tallies) end if From a819b4db40ad20393b808081571c2c5b70ca201f Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 4 Dec 2012 14:01:54 -0500 Subject: [PATCH 06/11] Fixed output of surface neighbors in summary.out. --- src/output.F90 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/output.F90 b/src/output.F90 index 8a8d3a176..9f6ecf96e 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -484,6 +484,7 @@ contains integer :: i ! loop index for coefficients integer :: unit_ ! unit to write to character(MAX_LINE_LEN) :: string + type(Cell), pointer :: c => null() ! set default unit if not specified if (present(unit)) then @@ -539,7 +540,9 @@ contains string = "" if (allocated(surf % neighbor_pos)) then do i = 1, size(surf % neighbor_pos) - string = trim(string) // ' ' // to_str(surf % neighbor_pos(i)) + c => cells(abs(surf % neighbor_pos(i))) + string = trim(string) // ' ' // to_str(& + sign(c % id, surf % neighbor_pos(i))) end do end if write(unit_,*) ' Positive Neighbors = ' // trim(string) @@ -548,7 +551,9 @@ contains string = "" if (allocated(surf % neighbor_neg)) then do i = 1, size(surf % neighbor_neg) - string = trim(string) // ' ' // to_str(surf % neighbor_neg(i)) + c => cells(abs(surf % neighbor_neg(i))) + string = trim(string) // ' ' // to_str(& + sign(c % id, surf % neighbor_neg(i))) end do end if write(unit_,*) ' Negative Neighbors =' // trim(string) From 6e4cdd4c4b58ebae23a3517bf2a9688b0e3e8ce4 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 4 Dec 2012 15:02:11 -0500 Subject: [PATCH 07/11] Rearranged use of tallies_on and inactive/active timers. --- src/eigenvalue.F90 | 35 ++++++++++++++++------------------- src/input_xml.F90 | 3 --- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/eigenvalue.F90 b/src/eigenvalue.F90 index 97603c3d8..374ed45ba 100644 --- a/src/eigenvalue.F90 +++ b/src/eigenvalue.F90 @@ -45,6 +45,9 @@ contains ! Display column titles call print_columns() + ! Turn on inactive timer + call timer_start(time_inactive) + ! ========================================================================== ! LOOP OVER BATCHES BATCH_LOOP: do current_batch = 1, n_batches @@ -113,19 +116,22 @@ contains ! Reset total starting particle weight used for normalizing tallies total_weight = ZERO + if (current_batch == n_inactive + 1) then + ! Switch from inactive batch timer to active batch timer + call timer_stop(time_inactive) + call timer_start(time_active) + + ! Enable active batches (and tallies_on if it hasn't been enabled) + active_batches = .true. + tallies_on = .true. + + ! Add user tallies to active tallies list + call setup_active_usertallies() + end if + ! check CMFD initialize batch if (cmfd_run) call cmfd_init_batch() - if (current_batch == n_inactive + 1) then - ! This will start the active timer at the first non-inactive batch - ! (including batch 1 if there are no inactive batches). - call timer_start(time_active) - elseif (current_batch == 1) then - ! If there are inactive batches, start the inactive timer on the first - ! batch. - call timer_start(time_inactive) - end if - end subroutine initialize_batch !=============================================================================== @@ -189,15 +195,6 @@ contains end if end do - ! Turn tallies on once inactive batches are complete - if (current_batch == n_inactive) then - tallies_on = .true. - active_batches = .true. - call timer_stop(time_inactive) - call timer_start(time_active) - call setup_active_usertallies() - end if - end subroutine finalize_batch !=============================================================================== diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 3cb546098..63d3e5d18 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -177,9 +177,6 @@ contains call fatal_error() end if - ! Turn on tallies if no inactive batches - if (n_inactive == 0) tallies_on = .true. - ! Copy random number seed if specified if (seed_ > 0) seed = seed_ From b8bba283a02d341d90883f928f32c04dda4e1c9a Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 4 Dec 2012 16:42:14 -0500 Subject: [PATCH 08/11] Fixed coincident surfaces from separate universes and particle tangent to surfaces. Closes #80 on github. Closes #124 on github. --- src/constants.F90 | 1 + src/geometry.F90 | 48 ++++++++++++++++++++++++++++++++++------------- src/plot.F90 | 2 +- 3 files changed, 37 insertions(+), 14 deletions(-) diff --git a/src/constants.F90 b/src/constants.F90 index fe025c7e8..abc0866b6 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -32,6 +32,7 @@ module constants ! User for precision in geometry real(8), parameter :: FP_PRECISION = 1e-14_8 real(8), parameter :: FP_REL_PRECISION = 1e-5_8 + real(8), parameter :: FP_COINCIDENT = 1e-12_8 ! Maximum number of collisions/crossings integer, parameter :: MAX_EVENTS = 10000 diff --git a/src/geometry.F90 b/src/geometry.F90 index fecdc33cf..fb15f6f3c 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -47,7 +47,7 @@ contains ! Determine the specified sense of the surface in the cell and the actual ! sense of the particle with respect to the surface s => surfaces(abs(i_surface)) - actual_sense = sense(s, p % coord % xyz) + actual_sense = sense(s) specified_sense = (c % surfaces(i) > 0) ! Compare sense of point to specified sense @@ -480,14 +480,32 @@ contains ! ========================================================================== ! COULDN'T FIND PARTICLE IN NEIGHBORING CELLS, SEARCH ALL CELLS + ! Remove lower coordinate levels and assignment of surface + p % surface = NONE + p % coord => p % coord0 + call deallocate_coord(p % coord % next) call find_cell(found) - ! Couldn't find next cell anywhere! - if ((.not. found) .and. (run_mode /= MODE_PLOTTING)) then - message = "After particle " // trim(to_str(p % id)) // " crossed surface " & - // trim(to_str(surfaces(abs(p%surface)) % id)) // " it could not be & - &located in any cell and it did not leak." - call fatal_error() + if (run_mode /= MODE_PLOTTING .and. (.not. found)) then + ! If a cell is still not found, there are two possible causes: 1) there is + ! a void in the model, and 2) the particle hit a surface at a tangent. If + ! the particle is really traveling tangent to a surface, if we move it + ! forward a tiny bit it should fix the problem. + + p % coord => p % coord0 + call deallocate_coord(p % coord % next) + p % coord % xyz = p % coord % xyz + TINY_BIT * p % coord % uvw + call find_cell(found) + + ! Couldn't find next cell anywhere! This probably means there is an actual + ! undefined region in the geometry. + + if (.not. found) then + message = "After particle " // trim(to_str(p % id)) // " crossed surface " & + // trim(to_str(surfaces(abs(p%surface)) % id)) // " it could not be & + &located in any cell and it did not leak." + call fatal_error() + end if end if end subroutine cross_surface @@ -1141,10 +1159,9 @@ contains ! is in. !=============================================================================== - function sense(surf, xyz) result(s) + recursive function sense(surf) result(s) type(Surface), pointer :: surf ! surface - real(8), intent(in) :: xyz(3) ! coordinates of particle logical :: s ! sense of particle real(8) :: x,y,z ! coordinates of particle @@ -1163,9 +1180,9 @@ contains real(8) :: r ! radius for quadratic surfaces real(8) :: x1,y1,z1 ! upper-right corner of box - x = xyz(1) - y = xyz(2) - z = xyz(3) + x = p % coord % xyz(1) + y = p % coord % xyz(2) + z = p % coord % xyz(3) select case (surf % type) case (SURF_PX) @@ -1319,7 +1336,12 @@ contains end select ! Check which side of surface the point is on - if (func > 0) then + if (abs(func) < FP_COINCIDENT) then + ! Particle may be coincident with this surface. Artifically move the + ! particle forward a tiny bit. + p % coord % xyz = p % coord % xyz + TINY_BIT * p % coord % uvw + s = sense(surf) + elseif (func > 0) then s = .true. else s = .false. diff --git a/src/plot.F90 b/src/plot.F90 index a0ccbabe6..4e9d48c25 100644 --- a/src/plot.F90 +++ b/src/plot.F90 @@ -95,7 +95,7 @@ contains allocate(p) call initialize_particle() p % coord % xyz = xyz - p % coord % uvw = (/ 1, 0, 0 /) + p % coord % uvw = (/ 0.5, 0.5, 0.5 /) p % coord % universe = BASE_UNIVERSE do y = 1, img % height From 737b90160e0b1612aea166db66130159586a9f69 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 4 Dec 2012 17:03:06 -0500 Subject: [PATCH 09/11] Make only run_eigenvalue public, and remove MODE_EIGENVALUE in finalize_batch. --- src/eigenvalue.F90 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/eigenvalue.F90 b/src/eigenvalue.F90 index 374ed45ba..4028dc235 100644 --- a/src/eigenvalue.F90 +++ b/src/eigenvalue.F90 @@ -26,6 +26,9 @@ module eigenvalue use hdf5_interface, only: hdf5_write_state_point #endif + private + public :: run_eigenvalue + contains !=============================================================================== @@ -160,8 +163,7 @@ contains ! Before accumulating results for global_tallies, we need to get the ! current batch estimate of k_analog for displaying to output - if (run_mode == MODE_EIGENVALUE) k_batch(current_batch) = & - global_tallies(K_ANALOG) % value + k_batch(current_batch) = global_tallies(K_ANALOG) % value ! Collect tallies if (tallies_on) then From 31ba238f89ded6bf3d591501869f566ac6611a66 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 4 Dec 2012 17:10:09 -0500 Subject: [PATCH 10/11] Added bug fixes to release notes. --- docs/source/releasenotes/notes_0.5.0.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/source/releasenotes/notes_0.5.0.rst b/docs/source/releasenotes/notes_0.5.0.rst index ddff604ab..edf4b4b6c 100644 --- a/docs/source/releasenotes/notes_0.5.0.rst +++ b/docs/source/releasenotes/notes_0.5.0.rst @@ -32,6 +32,9 @@ New Features Bug Fixes --------- +- 737b90_: Coincident surfaces from separate universes / particle traveling + tangent to a surface. +- a819b4_: Output of surface neighbors in summary.out file. - b11696_: Reading long attribute lists in XML input. - 2bd46a_: Search for tallying nuclides when no default_xs specified. - 7a1f08_: Fix word wrapping when writing messages. @@ -39,6 +42,8 @@ Bug Fixes - 6f8d9d_: Set default tally labels. - 6a3a5e_: Fix problem with corner-crossing in lattices. +.. _737b90: https://github.com/mit-crpg/openmc/commit/737b90 +.. _a819b4: https://github.com/mit-crpg/openmc/commit/a819b4 .. _b11696: https://github.com/mit-crpg/openmc/commit/b11696 .. _2bd46a: https://github.com/mit-crpg/openmc/commit/2bd46a .. _7a1f08: https://github.com/mit-crpg/openmc/commit/7a1f08 From dd87f7ff68ae7c074717999b1d8e5e71a599b37a Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 4 Dec 2012 19:46:04 -0500 Subject: [PATCH 11/11] Moved k_batch back to tally module. --- src/eigenvalue.F90 | 6 ++---- src/tally.F90 | 8 ++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/eigenvalue.F90 b/src/eigenvalue.F90 index 4028dc235..6647603c4 100644 --- a/src/eigenvalue.F90 +++ b/src/eigenvalue.F90 @@ -161,10 +161,6 @@ contains integer :: i ! loop index for state point batches - ! Before accumulating results for global_tallies, we need to get the - ! current batch estimate of k_analog for displaying to output - k_batch(current_batch) = global_tallies(K_ANALOG) % value - ! Collect tallies if (tallies_on) then call timer_start(time_tallies) @@ -549,6 +545,8 @@ contains ! ========================================================================= ! SINGLE-BATCH ESTIMATE OF K-EFFECTIVE + if (.not. active_batches) k_batch(current_batch) = global_tallies(K_ANALOG) % value + #ifdef MPI if ((.not. active_batches) .or. (.not. reduce_tallies)) then ! Reduce value of k_batch if running in parallel diff --git a/src/tally.F90 b/src/tally.F90 index e1af9ae66..8bcffcd13 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -1506,6 +1506,14 @@ contains curr_ptr => curr_ptr % next end do + if (run_mode == MODE_EIGENVALUE) then + ! Get the current batch estimate of k_analog for displaying to output + ! --- this has to be performed after reduce_tally_values and before + ! accumulate_result + + k_batch(current_batch) = global_tallies(K_ANALOG) % value + end if + ! Accumulate results for global tallies if (active_batches) call accumulate_result(global_tallies) end if