From 575d787d2ab6ba6af4e82fbc6ae15787589fa464 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Thu, 6 Dec 2012 07:27:56 -0800 Subject: [PATCH 1/7] removed weight hold for first cmfd batch --- src/cmfd_execute.F90 | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/cmfd_execute.F90 b/src/cmfd_execute.F90 index c962fd997d..2851aac093 100644 --- a/src/cmfd_execute.F90 +++ b/src/cmfd_execute.F90 @@ -153,8 +153,6 @@ contains if (cmfd_run .and. cmfd_begin == current_batch) then cmfd_on = .true. cmfd_tally_on = .true. - cmfd_hold_weights = .true. - call cmfd_tally_reset() end if ! check to flush cmfd tallies for active batches, no more inactive flush From 6f7a9d1654d0e5916b1c2348b9ce6625b99ef6fa Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Thu, 6 Dec 2012 08:03:32 -0800 Subject: [PATCH 2/7] added none option to such that ascii tally output would be disabled, NEEDS MORE ATTENTION --- src/input_xml.F90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 913fd52baa..8f37f44415 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -538,6 +538,10 @@ contains output_xs = .true. case ('tallies') output_tallies = .true. + case ('none') + output_summary = .false. + output_xs = .false. + output_tallies = .false. end select end do end if From 38b4efae61000b095d423e6fe8df96e399f00023 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Thu, 6 Dec 2012 13:26:50 -0800 Subject: [PATCH 3/7] for no ascii tally output you must still calculate tally_statistics because this also encompasses global tallies like k-eff --- src/finalize.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/finalize.F90 b/src/finalize.F90 index 3ac3177dd3..e0eb73074b 100644 --- a/src/finalize.F90 +++ b/src/finalize.F90 @@ -31,9 +31,9 @@ contains call timer_start(time_finalize) if (run_mode /= MODE_PLOTTING) then + ! Calculate statistics for tallies and write to tallies.out + if (master) call tally_statistics() if (output_tallies) then - ! Calculate statistics for tallies and write to tallies.out - if (master) call tally_statistics() if (master) call write_tallies() end if end if From 4afb2baeeb9f57f179e181e26b6e4b52dfe02564 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Thu, 6 Dec 2012 13:28:53 -0800 Subject: [PATCH 4/7] revised output to user to include generation information, currently only entropy is printed if this option is on. Entropy is now calculated on the generation level instead of batches, and adjustments to entropy vector sizes was done for reading and writing statepoints --- src/eigenvalue.F90 | 17 +++++++++++------ src/input_xml.F90 | 2 +- src/output.F90 | 40 +++++++++++++++++++++++++++++++--------- src/state_point.F90 | 10 +++++----- 4 files changed, 48 insertions(+), 21 deletions(-) diff --git a/src/eigenvalue.F90 b/src/eigenvalue.F90 index 08c294eebb..04abd1cd19 100644 --- a/src/eigenvalue.F90 +++ b/src/eigenvalue.F90 @@ -12,7 +12,7 @@ module eigenvalue use mesh, only: count_bank_sites use mesh_header, only: StructuredMesh use output, only: write_message, header, print_columns, & - print_batch_keff + print_batch_keff, print_generation use physics, only: transport use random_lcg, only: prn, set_particle_seed, prn_skip use search, only: binary_search @@ -93,6 +93,12 @@ contains call synchronize_bank() call timer_stop(time_bank) + ! Calculate shannon entropy + if (entropy_on) call shannon_entropy() + + ! Write generation output + if (master .and. current_gen /= gen_per_batch) call print_generation() + end do GENERATION_LOOP call finalize_batch() @@ -167,9 +173,6 @@ contains call synchronize_tallies() call timer_stop(time_tallies) - ! Calculate shannon entropy - if (entropy_on) call shannon_entropy() - ! Collect results and statistics call calculate_keff() @@ -462,6 +465,7 @@ contains subroutine shannon_entropy() + integer :: ent_idx ! entropy index integer :: i, j, k ! index for bank sites integer :: n ! # of boxes in each dimension logical :: sites_outside ! were there sites outside entropy box? @@ -512,12 +516,13 @@ contains ! Normalize to total weight of bank sites entropy_p = entropy_p / sum(entropy_p) - entropy(current_batch) = ZERO + ent_idx = current_gen + gen_per_batch*(current_batch - 1) + entropy(ent_idx) = ZERO do i = 1, m % dimension(1) do j = 1, m % dimension(2) do k = 1, m % dimension(3) if (entropy_p(1,i,j,k) > ZERO) then - entropy(current_batch) = entropy(current_batch) - & + entropy(ent_idx) = entropy(ent_idx) - & entropy_p(1,i,j,k) * log(entropy_p(1,i,j,k))/log(TWO) end if end do diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 8f37f44415..2edc459492 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -139,7 +139,7 @@ contains ! Allocate array for batch keff and entropy allocate(k_batch(n_batches)) - allocate(entropy(n_batches)) + allocate(entropy(n_batches*gen_per_batch)) entropy = ZERO end if diff --git a/src/output.F90 b/src/output.F90 index d694b144d9..17557caff1 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -1196,32 +1196,53 @@ contains if (entropy_on) then if (cmfd_run) then - message = " Batch k(batch) Entropy Average k CMFD k CMFD Ent" + message = " Bat./Gen. k(batch) Entropy Average k CMFD k CMFD Ent" call write_message(1) - message = " ===== ======== ======== ==================== ======== ========" + message = " ========= ======== ======== ==================== ======== ========" call write_message(1) else - message = " Batch k(batch) Entropy Average k" + message = " Bat./Gen. k(batch) Entropy Average k" call write_message(1) - message = " ===== ======== ======== ====================" + message = " ========= ======== ======== ====================" call write_message(1) end if else if (cmfd_run) then - message = " Batch k(batch) Average k CMFD k" + message = " Bat./Gen. k(batch) Average k CMFD k" call write_message(1) - message = " ===== ======== ==================== ========" + message = " ========= ======== ==================== ========" call write_message(1) else - message = " Batch k(batch) Average k" + message = " Bat./Gen. k(batch) Average k" call write_message(1) - message = " ===== ======== ====================" + message = " ========= ======== ====================" call write_message(1) end if end if end subroutine print_columns +!=============================================================================== +! PRINT_GENERATION displays information for a generation of neutrons. For now, +! if the user has entropy on, it will print out the entropy +!=============================================================================== + + subroutine print_generation() + + ! write out information about batch and generation + write(UNIT=OUTPUT_UNIT, FMT='(2X,A9)', ADVANCE='NO') & + trim(to_str(current_batch)) // "/" // trim(to_str(current_gen)) + write(UNIT=OUTPUT_UNIT, FMT='(11X)', ADVANCE='NO') + + ! write out entropy info + if (entropy_on) write(UNIT=OUTPUT_UNIT, FMT='(3X, F8.5)', ADVANCE='NO') & + entropy(current_batch) + + ! next line + write(UNIT=OUTPUT_UNIT, FMT=*) + + end subroutine print_generation + !=============================================================================== ! PRINT_BATCH_KEFF displays the last batch's tallied value of the neutron ! multiplication factor as well as the average value if we're in active batches @@ -1230,7 +1251,8 @@ contains subroutine print_batch_keff() ! write out information batch and option independent output - write(UNIT=OUTPUT_UNIT, FMT='(2X,I5)', ADVANCE='NO') current_batch + write(UNIT=OUTPUT_UNIT, FMT='(2X,A9)', ADVANCE='NO') & + trim(to_str(current_batch)) // "/" // trim(to_str(gen_per_batch)) write(UNIT=OUTPUT_UNIT, FMT='(3X,F8.5)', ADVANCE='NO') & k_batch(current_batch) diff --git a/src/state_point.F90 b/src/state_point.F90 index 0aca60b184..2eda44afe6 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -186,7 +186,7 @@ contains 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) + write(UNIT_STATE) entropy(1:current_batch*gen_per_batch) end if ! Write number of meshes @@ -368,7 +368,7 @@ contains MPI_STATUS_IGNORE, mpi_err) call MPI_FILE_WRITE(fh, k_batch, current_batch, MPI_REAL8, & MPI_STATUS_IGNORE, mpi_err) - call MPI_FILE_WRITE(fh, entropy, current_batch, MPI_REAL8, & + call MPI_FILE_WRITE(fh, entropy, current_batch*gen_per_batch, MPI_REAL8, & MPI_STATUS_IGNORE, mpi_err) end if @@ -674,8 +674,8 @@ contains MPI_STATUS_IGNORE, mpi_err) call MPI_FILE_READ_ALL(fh, k_batch, restart_batch, MPI_REAL8, & MPI_STATUS_IGNORE, mpi_err) - call MPI_FILE_READ_ALL(fh, entropy, restart_batch, MPI_REAL8, & - MPI_STATUS_IGNORE, mpi_err) + call MPI_FILE_READ_ALL(fh, entropy, restart_batch*gen_per_batch, & + MPI_REAL8, MPI_STATUS_IGNORE, mpi_err) end if if (master) then @@ -874,7 +874,7 @@ contains 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) + read(UNIT_STATE) entropy(1:restart_batch*gen_per_batch) end if if (master) then From aebce4d86e5cad0efb21c880f0a3e59d147e21a5 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 6 Dec 2012 21:08:25 -0500 Subject: [PATCH 5/7] Write entropy at every generation in HDF5 state points. --- src/hdf5_interface.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 24a5f6b92e..273b3cf6f0 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -878,6 +878,7 @@ contains dims(1) = current_batch call h5ltmake_dataset_double_f(hdf5_state_point, "k_batch", 1, & dims, k_batch, hdf5_err) + dims(1) = current_batch*gen_per_batch call h5ltmake_dataset_double_f(hdf5_state_point, "entropy", 1, & dims, entropy, hdf5_err) end if @@ -1149,7 +1150,7 @@ contains call h5ltread_dataset_double_f(hdf5_state_point, "k_batch", & k_batch(1:restart_batch), dims, hdf5_err) call h5ltread_dataset_double_f(hdf5_state_point, "entropy", & - entropy(1:restart_batch), dims, hdf5_err) + entropy(1:restart_batch*gen_per_batch), dims, hdf5_err) end if ! Read number of realizations for global tallies From bd35fbf6a44f776bedd90e1aafc8088214adbca2 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 6 Dec 2012 21:08:51 -0500 Subject: [PATCH 6/7] Write current entropy at each generation. --- src/output.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/output.F90 b/src/output.F90 index 17557caff1..ee8e93f82d 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -1236,7 +1236,7 @@ contains ! write out entropy info if (entropy_on) write(UNIT=OUTPUT_UNIT, FMT='(3X, F8.5)', ADVANCE='NO') & - entropy(current_batch) + entropy(current_gen + gen_per_batch*(current_batch - 1)) ! next line write(UNIT=OUTPUT_UNIT, FMT=*) @@ -1258,7 +1258,7 @@ contains ! write out entropy info if (entropy_on) write(UNIT=OUTPUT_UNIT, FMT='(3X, F8.5)', ADVANCE='NO') & - entropy(current_batch) + entropy(current_batch*gen_per_batch) ! write out accumulated k-effective if after first active batch if (current_batch > n_inactive + 1) then From 2189d838e21b993b0771050938dd3d050f3c2376 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 5 Dec 2012 19:09:42 -0500 Subject: [PATCH 7/7] Incremented version to 0.5.0. --- docs/source/conf.py | 4 ++-- docs/source/releasenotes/notes_0.5.0.rst | 4 ---- src/constants.F90 | 4 ++-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index e32790e465..c8c4442947 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -46,9 +46,9 @@ copyright = u'2011-2012, Massachusetts Institute of Technology' # built documents. # # The short X.Y version. -version = "0.4" +version = "0.5" # The full version, including alpha/beta/rc tags. -release = "0.4.4" +release = "0.5.0" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/releasenotes/notes_0.5.0.rst b/docs/source/releasenotes/notes_0.5.0.rst index 0c1416d3b0..16be1b063b 100644 --- a/docs/source/releasenotes/notes_0.5.0.rst +++ b/docs/source/releasenotes/notes_0.5.0.rst @@ -4,10 +4,6 @@ Release Notes for OpenMC 0.5.0 ============================== -.. note:: - These release notes are for an upcoming release of OpenMC and are still - subject to change. - ------------------- System Requirements ------------------- diff --git a/src/constants.F90 b/src/constants.F90 index be63ccc379..822452b5b3 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -7,8 +7,8 @@ module constants ! OpenMC major, minor, and release numbers integer, parameter :: VERSION_MAJOR = 0 - integer, parameter :: VERSION_MINOR = 4 - integer, parameter :: VERSION_RELEASE = 4 + integer, parameter :: VERSION_MINOR = 5 + integer, parameter :: VERSION_RELEASE = 0 ! Revision numbers for binary files integer, parameter :: REVISION_SOURCE = 1