Change statepoint_batch to type(SetInt).

This commit is contained in:
Paul Romano 2013-03-20 13:15:27 -04:00
parent 2e904bfe71
commit 47e30f8e2f
4 changed files with 20 additions and 31 deletions

View file

@ -165,8 +165,6 @@ contains
subroutine finalize_batch()
integer :: i ! loop index for state point batches
! Collect tallies
call time_tallies % start()
call synchronize_tallies()
@ -182,20 +180,17 @@ contains
if (master) call print_batch_keff()
! Write out state point if it's been specified for this batch
do i = 1, n_state_points
if (current_batch == statepoint_batch(i)) then
! Calculate combined estimate of k-effective
if (master) call calculate_combined_keff()
if (statepoint_batch % contains(current_batch)) then
! Calculate combined estimate of k-effective
if (master) call calculate_combined_keff()
! Create state point file
! Create state point file
#ifdef HDF5
call hdf5_write_state_point()
call hdf5_write_state_point()
#else
call write_state_point()
call write_state_point()
#endif
exit
end if
end do
end if
if (master .and. current_batch == n_batches) then
! Make sure combined estimate of k-effective is calculated at the last

View file

@ -108,24 +108,19 @@ contains
subroutine finalize_batch()
integer :: i ! loop index for state point batches
! Collect and accumulate tallies
call time_tallies % start()
call synchronize_tallies()
call time_tallies % stop()
! Write out state point if it's been specified for this batch
do i = 1, n_state_points
if (current_batch == statepoint_batch(i)) then
if (statepoint_batch % contains(current_batch)) then
#ifdef HDF5
call hdf5_write_state_point()
call hdf5_write_state_point()
#else
call write_state_point()
call write_state_point()
#endif
exit
end if
end do
end if
end subroutine finalize_batch

View file

@ -360,7 +360,7 @@ module global
! Information about state points to be written
integer :: n_state_points = 0
integer, allocatable :: statepoint_batch(:)
type(SetInt) :: statepoint_batch
! Various output options
logical :: output_summary = .false.

View file

@ -489,20 +489,20 @@ contains
if (n_state_points > 0) then
! User gave specific batches to write state points
allocate(statepoint_batch(n_state_points))
statepoint_batch = state_point_(1) % batches
do i = 1, n_state_points
call statepoint_batch % add(state_point_(1) % batches(i))
end do
elseif (state_point_(1) % interval /= 0) then
! User gave an interval for writing state points
n_state_points = n_batches / state_point_(1) % interval
allocate(statepoint_batch(n_state_points))
statepoint_batch = (/ (state_point_(1) % interval * i, i = 1, &
n_state_points) /)
do i = 1, n_state_points
call statepoint_batch % add(state_point_(1) % interval * i)
end do
else
! If neither were specified, write state point at last batch
n_state_points = 1
allocate(statepoint_batch(n_state_points))
statepoint_batch(1) = n_batches
call statepoint_batch % add(n_batches)
end if
! Check if the user has specified to write binary source file
@ -513,8 +513,7 @@ contains
! If no <state_point> tag was present, by default write state point at
! last batch only
n_state_points = 1
allocate(statepoint_batch(n_state_points))
statepoint_batch(1) = n_batches
call statepoint_batch % add(n_batches)
end if
! Check if the user has specified to not reduce tallies at the end of every