Merge remote-tracking branch 'upstream/master' into PnInput

This commit is contained in:
Adam Nelson 2012-12-11 10:05:02 -05:00
commit 6133d86fd5
10 changed files with 61 additions and 35 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1201,32 +1201,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_gen + gen_per_batch*(current_batch - 1))
! 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
@ -1235,13 +1256,14 @@ 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)
! 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

View file

@ -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
@ -371,7 +371,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
@ -682,8 +682,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
@ -890,7 +890,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