mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
Changed all atomics to criticals. gfortran now produce correct k-effective.
This commit is contained in:
parent
077431f1e5
commit
31db282802
3 changed files with 38 additions and 19 deletions
|
|
@ -254,20 +254,22 @@ contains
|
|||
p % last_wgt = p % wgt
|
||||
|
||||
! Score implicit absorption estimate of keff
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
global_tallies(K_ABSORPTION) % value = &
|
||||
global_tallies(K_ABSORPTION) % value + p % absorb_wgt * &
|
||||
micro_xs(i_nuclide) % nu_fission / micro_xs(i_nuclide) % absorption
|
||||
!$omp end critical
|
||||
|
||||
else
|
||||
! See if disappearance reaction happens
|
||||
if (micro_xs(i_nuclide) % absorption > &
|
||||
prn() * micro_xs(i_nuclide) % total) then
|
||||
! Score absorption estimate of keff
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
global_tallies(K_ABSORPTION) % value = &
|
||||
global_tallies(K_ABSORPTION) % value + p % wgt * &
|
||||
micro_xs(i_nuclide) % nu_fission / micro_xs(i_nuclide) % absorption
|
||||
!$omp end critical
|
||||
|
||||
p % alive = .false.
|
||||
p % event = EVENT_ABSORB
|
||||
|
|
|
|||
|
|
@ -202,9 +202,10 @@ contains
|
|||
! get the score and tally it
|
||||
score = last_wgt * calc_pn(n, mu)
|
||||
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
t % results(score_index, filter_index) % value = &
|
||||
t % results(score_index, filter_index) % value + score
|
||||
!$omp end critical
|
||||
end do
|
||||
j = j + t % scatt_order(j)
|
||||
cycle SCORE_LOOP
|
||||
|
|
@ -341,9 +342,10 @@ contains
|
|||
end select
|
||||
|
||||
! Add score to tally
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
t % results(score_index, filter_index) % value = &
|
||||
t % results(score_index, filter_index) % value + score
|
||||
!$omp end critical
|
||||
|
||||
end do SCORE_LOOP
|
||||
|
||||
|
|
@ -415,9 +417,10 @@ contains
|
|||
i_filter = sum((t % matching_bins - 1) * t % stride) + 1
|
||||
|
||||
! Add score to tally
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
t % results(i_score, i_filter) % value = &
|
||||
t % results(i_score, i_filter) % value + score
|
||||
!$omp end critical
|
||||
end do
|
||||
|
||||
! reset outgoing energy bin and score index
|
||||
|
|
@ -704,9 +707,10 @@ contains
|
|||
score_index = (k - 1)*t % n_score_bins + j
|
||||
|
||||
! Add score to tally
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
t % results(score_index, filter_index) % value = &
|
||||
t % results(score_index, filter_index) % value + score
|
||||
!$omp end critical
|
||||
|
||||
end do SCORE_LOOP
|
||||
|
||||
|
|
@ -848,9 +852,10 @@ contains
|
|||
score_index = (i_nuclide - 1)*t % n_score_bins + j
|
||||
|
||||
! Add score to tally
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
t % results(score_index, filter_index) % value = &
|
||||
t % results(score_index, filter_index) % value + score
|
||||
!$omp end critical
|
||||
|
||||
end do SCORE_LOOP
|
||||
|
||||
|
|
@ -947,9 +952,10 @@ contains
|
|||
score_index = n_nuclides_total*t % n_score_bins + j
|
||||
|
||||
! Add score to tally
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
t % results(score_index, filter_index) % value = &
|
||||
t % results(score_index, filter_index) % value + score
|
||||
!$omp end critical
|
||||
|
||||
end do MATERIAL_SCORE_LOOP
|
||||
|
||||
|
|
@ -1256,9 +1262,10 @@ contains
|
|||
score_index = (b - 1)*t % n_score_bins + j
|
||||
|
||||
! Add score to tally
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
t % results(score_index, filter_index) % value = &
|
||||
t % results(score_index, filter_index) % value + score
|
||||
!$omp end critical
|
||||
|
||||
end do SCORE_LOOP
|
||||
|
||||
|
|
@ -1489,9 +1496,10 @@ contains
|
|||
t % matching_bins(i_filter_mesh) = &
|
||||
mesh_indices_to_bin(m, ijk0 + 1, .true.)
|
||||
filter_index = sum((t % matching_bins - 1) * t % stride) + 1
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
t % results(1, filter_index) % value = &
|
||||
t % results(1, filter_index) % value + p % wgt
|
||||
!$omp end critical
|
||||
end if
|
||||
end do
|
||||
else
|
||||
|
|
@ -1502,9 +1510,10 @@ contains
|
|||
t % matching_bins(i_filter_mesh) = &
|
||||
mesh_indices_to_bin(m, ijk0 + 1, .true.)
|
||||
filter_index = sum((t % matching_bins - 1) * t % stride) + 1
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
t % results(1, filter_index) % value = &
|
||||
t % results(1, filter_index) % value + p % wgt
|
||||
!$omp end critical
|
||||
end if
|
||||
end do
|
||||
end if
|
||||
|
|
@ -1519,9 +1528,10 @@ contains
|
|||
t % matching_bins(i_filter_mesh) = &
|
||||
mesh_indices_to_bin(m, ijk0 + 1, .true.)
|
||||
filter_index = sum((t % matching_bins - 1) * t % stride) + 1
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
t % results(1, filter_index) % value = &
|
||||
t % results(1, filter_index) % value + p % wgt
|
||||
!$omp end critical
|
||||
end if
|
||||
end do
|
||||
else
|
||||
|
|
@ -1532,9 +1542,10 @@ contains
|
|||
t % matching_bins(i_filter_mesh) = &
|
||||
mesh_indices_to_bin(m, ijk0 + 1, .true.)
|
||||
filter_index = sum((t % matching_bins - 1) * t % stride) + 1
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
t % results(1, filter_index) % value = &
|
||||
t % results(1, filter_index) % value + p % wgt
|
||||
!$omp end critical
|
||||
end if
|
||||
end do
|
||||
end if
|
||||
|
|
@ -1549,9 +1560,10 @@ contains
|
|||
t % matching_bins(i_filter_mesh) = &
|
||||
mesh_indices_to_bin(m, ijk0 + 1, .true.)
|
||||
filter_index = sum((t % matching_bins - 1) * t % stride) + 1
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
t % results(1, filter_index) % value = &
|
||||
t % results(1, filter_index) % value + p % wgt
|
||||
!$omp end critical
|
||||
end if
|
||||
end do
|
||||
else
|
||||
|
|
@ -1562,9 +1574,10 @@ contains
|
|||
t % matching_bins(i_filter_mesh) = &
|
||||
mesh_indices_to_bin(m, ijk0 + 1, .true.)
|
||||
filter_index = sum((t % matching_bins - 1) * t % stride) + 1
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
t % results(1, filter_index) % value = &
|
||||
t % results(1, filter_index) % value + p % wgt
|
||||
!$omp end critical
|
||||
end if
|
||||
end do
|
||||
end if
|
||||
|
|
@ -1687,9 +1700,10 @@ contains
|
|||
end if
|
||||
|
||||
! Add to surface current tally
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
t % results(1, filter_index) % value = &
|
||||
t % results(1, filter_index) % value + p % wgt
|
||||
!$omp end critical
|
||||
end if
|
||||
|
||||
! Calculate new coordinates
|
||||
|
|
|
|||
|
|
@ -60,8 +60,9 @@ contains
|
|||
n_event = 0
|
||||
|
||||
! Add paricle's starting weight to count for normalizing tallies later
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
total_weight = total_weight + p % wgt
|
||||
!$omp end critical
|
||||
|
||||
! Force calculation of cross-sections by setting last energy to zero
|
||||
micro_xs % last_E = ZERO
|
||||
|
|
@ -101,10 +102,11 @@ contains
|
|||
call score_tracklength_tally(p, distance)
|
||||
|
||||
! Score track-length estimate of k-eff
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
global_tallies(K_TRACKLENGTH) % value = &
|
||||
global_tallies(K_TRACKLENGTH) % value + p % wgt * distance * &
|
||||
material_xs % nu_fission
|
||||
!$omp end critical
|
||||
|
||||
if (d_collision > d_boundary) then
|
||||
! ====================================================================
|
||||
|
|
@ -128,10 +130,11 @@ contains
|
|||
! PARTICLE HAS COLLISION
|
||||
|
||||
! Score collision estimate of keff
|
||||
!$omp atomic
|
||||
!$omp critical
|
||||
global_tallies(K_COLLISION) % value = &
|
||||
global_tallies(K_COLLISION) % value + p % wgt * &
|
||||
material_xs % nu_fission / material_xs % total
|
||||
!$omp end critical
|
||||
|
||||
! score surface current tallies -- this has to be done before the collision
|
||||
! since the direction of the particle will change and we need to use the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue