diff --git a/ChangeLog b/ChangeLog index 668d2b5ee2..211062cecd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2011-04-22 Paul Romano + + * 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 * main.f90: Moved RN_init_particle at end of cycle to diff --git a/src/geometry.f90 b/src/geometry.f90 index a1f9e66831..38746a9e9c 100644 --- a/src/geometry.f90 +++ b/src/geometry.f90 @@ -994,6 +994,9 @@ contains end do end do + deallocate(count_positive) + deallocate(count_negative) + end subroutine neighbor_lists end module geometry diff --git a/src/global.f90 b/src/global.f90 index 7301d798af..b19e72730e 100644 --- a/src/global.f90 +++ b/src/global.f90 @@ -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) diff --git a/src/mpi_routines.f90 b/src/mpi_routines.f90 index 9aee563ee1..a22613fb81 100644 --- a/src/mpi_routines.f90 +++ b/src/mpi_routines.f90 @@ -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 diff --git a/src/physics.f90 b/src/physics.f90 index aa3edca1cb..25fcbcfd04 100644 --- a/src/physics.f90 +++ b/src/physics.f90 @@ -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 diff --git a/src/source.f90 b/src/source.f90 index f26f21c7c9..edc262c5fa 100644 --- a/src/source.f90 +++ b/src/source.f90 @@ -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)