mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Fixed allocation of fission/source bank. Deallocated several important arrays.
This commit is contained in:
parent
f143e7d5d0
commit
620aed0013
6 changed files with 30 additions and 8 deletions
11
ChangeLog
11
ChangeLog
|
|
@ -1,3 +1,14 @@
|
|||
2011-04-22 Paul Romano <romano7@mit.edu>
|
||||
|
||||
* geometry.f90: Deallocated count lists in neighbor_lists.
|
||||
* global.f90: Deallocate arrays that were not previously
|
||||
deallocated (xs_continuous, xs_thermal, e_grid, lattices).
|
||||
* mpi_routines.f90: Added variable p_sample to lessen calculation
|
||||
inside of sampling loop.
|
||||
* physics.f90: Commented warning about low particle energy.
|
||||
* source.f90: Changed source and fission banks to be allocated
|
||||
maxwork instead of n_particles.
|
||||
|
||||
2011-04-21 Paul Romano <romano7@mit.edu>
|
||||
|
||||
* main.f90: Moved RN_init_particle at end of cycle to
|
||||
|
|
|
|||
|
|
@ -994,6 +994,9 @@ contains
|
|||
end do
|
||||
end do
|
||||
|
||||
deallocate(count_positive)
|
||||
deallocate(count_negative)
|
||||
|
||||
end subroutine neighbor_lists
|
||||
|
||||
end module geometry
|
||||
|
|
|
|||
|
|
@ -285,9 +285,15 @@ contains
|
|||
if (allocated(cells)) deallocate(cells)
|
||||
if (allocated(surfaces)) deallocate(surfaces)
|
||||
if (allocated(materials)) deallocate(materials)
|
||||
if (allocated(lattices)) deallocate(lattices)
|
||||
|
||||
! Deallocate xsdata list
|
||||
! Deallocate cross section data
|
||||
if (allocated(xsdatas)) deallocate(xsdatas)
|
||||
if (allocated(xs_continuous)) deallocate(xs_continuous)
|
||||
if (allocated(xs_thermal)) deallocate(xs_thermal)
|
||||
|
||||
! Deallocate energy grid
|
||||
if (allocated(e_grid)) deallocate(e_grid)
|
||||
|
||||
! Deallocate fission and source bank
|
||||
if (allocated(fission_bank)) deallocate(fission_bank)
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ contains
|
|||
integer :: send_to_right ! # of bank sites to send/recv to or from right
|
||||
integer(8) :: sites_needed ! # of sites to be sampled
|
||||
integer(8) :: sites_remaining ! # of sites left in fission bank
|
||||
real(8) :: p_sample ! probability of sampling a site
|
||||
real(8) :: t0, t1, t2, t3, t4
|
||||
type(Bank), allocatable :: &
|
||||
& temp_sites(:), & ! local array of extra sites on each node
|
||||
|
|
@ -174,6 +175,7 @@ contains
|
|||
else
|
||||
sites_needed = n_particles
|
||||
end if
|
||||
p_sample = real(sites_needed,8)/real(total,8)
|
||||
|
||||
msg = "Sampling fission sites..."
|
||||
call message(msg, 8)
|
||||
|
|
@ -196,7 +198,7 @@ contains
|
|||
end if
|
||||
|
||||
! Randomly sample sites needed
|
||||
if (rang() < real(sites_needed)/real(total)) then
|
||||
if (rang() < p_sample) then
|
||||
count = count + 1
|
||||
temp_sites(count) = fission_bank(i)
|
||||
end if
|
||||
|
|
|
|||
|
|
@ -251,8 +251,8 @@ contains
|
|||
! check for very low energy
|
||||
if (p % E < 1.0e-100_8) then
|
||||
p % alive = .false.
|
||||
msg = "Killing neutron with extremely low energy"
|
||||
call warning(msg)
|
||||
! msg = "Killing neutron with extremely low energy"
|
||||
! call warning(msg)
|
||||
end if
|
||||
|
||||
! find energy index, interpolation factor
|
||||
|
|
|
|||
|
|
@ -33,14 +33,14 @@ contains
|
|||
msg = 'Initializing source particles...'
|
||||
call message(msg, 6)
|
||||
|
||||
! Allocate fission and source banks
|
||||
allocate(source_bank(n_particles))
|
||||
allocate(fission_bank(3*n_particles))
|
||||
|
||||
! Determine maximum amount of particles to simulate on each
|
||||
! processor
|
||||
maxwork = ceiling(real(n_particles)/n_procs)
|
||||
|
||||
! Allocate fission and source banks
|
||||
allocate(source_bank(maxwork))
|
||||
allocate(fission_bank(3*maxwork))
|
||||
|
||||
! Check external source type
|
||||
if (external_source%type == SRC_BOX) then
|
||||
p_min = external_source%values(1:3)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue