Call openmc_reset during openmc_simulation_init

This commit is contained in:
Paul Romano 2018-11-09 07:39:26 -06:00
parent 62cc251914
commit 5d4c39cc7d
2 changed files with 8 additions and 10 deletions

View file

@ -25,10 +25,10 @@ extern "C" bool cmfd_on;
extern "C" void accumulate_tallies();
extern "C" void allocate_banks();
extern "C" void allocate_tally_results();
extern "C" void check_triggers();
extern "C" void cmfd_init_batch();
extern "C" void cmfd_tally_init();
extern "C" void configure_tallies();
extern "C" void execute_cmfd();
extern "C" void init_tally_routines();
extern "C" void join_bank_from_threads();
@ -92,7 +92,7 @@ int openmc_simulation_init()
allocate_banks();
// Allocate tally results arrays if they're not allocated yet
configure_tallies();
allocate_tally_results();
// Activate the CMFD tallies
cmfd_tally_init();
@ -106,6 +106,7 @@ int openmc_simulation_init()
simulation::k_generation.clear();
simulation::entropy.clear();
simulation::need_depletion_rx = false;
openmc_reset();
// If this is a restart run, load the state point data and binary source
// file

View file

@ -17,7 +17,7 @@ module tally_header
implicit none
private
public :: configure_tallies
public :: allocate_tally_results
public :: free_memory_tally
public :: openmc_extend_tallies
public :: openmc_get_tally_index
@ -275,9 +275,6 @@ contains
allocate(this % results(3, this % total_score_bins, this % n_filter_bins))
end if
! Initialize results array to zero
this % results(:,:,:) = ZERO
end subroutine tally_allocate_results
@ -392,21 +389,21 @@ contains
! tallies.xml file.
!===============================================================================
subroutine configure_tallies() bind(C)
subroutine allocate_tally_results() bind(C)
integer :: i
! Allocate and initialize global tallies
! Allocate global tallies
if (.not. allocated(global_tallies)) then
allocate(global_tallies(3, N_GLOBAL_TALLIES))
end if
global_tallies(:,:) = ZERO
! Allocate results arrays for tallies
do i = 1, n_tallies
call tallies(i) % obj % allocate_results()
end do
end subroutine configure_tallies
end subroutine allocate_tally_results
!===============================================================================
! FREE_MEMORY_TALLY deallocates global arrays defined in this module