Merge pull request #442 from walshjon/hotfix-src

Hotfix for fixed-source leakage bug
This commit is contained in:
Paul Romano 2015-08-14 13:51:31 +07:00
commit ff6f8b36db
5 changed files with 26 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

@ -117,6 +117,17 @@ 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()

View file

@ -7,7 +7,7 @@ module output
use endf, only: reaction_name
use error, only: fatal_error, warning
use geometry_header, only: Cell, Universe, Surface, Lattice, RectLattice, &
&HexLattice, BASE_UNIVERSE
HexLattice, BASE_UNIVERSE
use global
use math, only: t_percentile
use mesh_header, only: StructuredMesh

View file

@ -1,3 +1,6 @@
tally 1:
4.483337E+02
2.017057E+04
leakage:
9.820000E+00
9.648000E+00

View file

@ -28,6 +28,10 @@ class FixedSourceTestHarness(TestHarness):
outstr += '\n'.join(results) + '\n'
tally_num += 1
outstr += 'leakage:\n'
outstr += '{0:12.6E}'.format(sp._global_tallies[3][0]) + '\n'
outstr += '{0:12.6E}'.format(sp._global_tallies[3][1]) + '\n'
return outstr