compute leakage for fixed source runs

This commit is contained in:
walshjon 2015-08-13 12:33:13 -07:00
parent f4975b2b82
commit 2eeb002a6d
2 changed files with 21 additions and 8 deletions

View file

@ -176,19 +176,19 @@ contains
!$omp critical
global_tallies(K_TRACKLENGTH) % value = &
global_tallies(K_TRACKLENGTH) % value + global_tally_tracklength
global_tallies(K_COLLISION) % value = &
global_tallies(K_COLLISION) % value = &
global_tallies(K_COLLISION) % value + global_tally_collision
global_tallies(LEAKAGE) % value = &
global_tallies(LEAKAGE) % value = &
global_tallies(LEAKAGE) % value + global_tally_leakage
global_tallies(K_ABSORPTION) % value = &
global_tallies(K_ABSORPTION) % value = &
global_tallies(K_ABSORPTION) % value + global_tally_absorption
!$omp end critical
! reset private tallies
global_tally_tracklength = 0
global_tally_collision = 0
global_tally_leakage = 0
global_tally_absorption = 0
global_tally_tracklength = ZERO
global_tally_collision = ZERO
global_tally_leakage = ZERO
global_tally_absorption = ZERO
!$omp end parallel
#ifdef _OPENMP

View file

@ -6,7 +6,7 @@ module fixed_source
use constants, only: ZERO, MAX_LINE_LEN
use global
use output, only: write_message, header
use output, only: write_message, header, print_batch_leakage
use particle_header, only: Particle
use random_lcg, only: set_particle_seed
use source, only: sample_external_source, copy_source_attributes
@ -117,11 +117,24 @@ contains
subroutine finalize_batch()
! Update global tallies with the omp private accumulation variables
!$omp parallel
!$omp critical
global_tallies(LEAKAGE) % value = &
global_tallies(LEAKAGE) % value + global_tally_leakage
!$omp end critical
! reset private tallies
global_tally_leakage = ZERO
!$omp end parallel
! Collect and accumulate tallies
call time_tallies % start()
call synchronize_tallies()
call time_tallies % stop()
if (master) call print_batch_leakage()
! Check_triggers
if (master) call check_triggers()
#ifdef MPI