Make sure photon data gets cleared at end of simulation

This commit is contained in:
Paul Romano 2018-03-14 13:35:38 -05:00
parent a2c4b60f6f
commit 093a22384f
2 changed files with 22 additions and 1 deletions

View file

@ -116,7 +116,8 @@ contains
check_overlaps = .false.
confidence_intervals = .false.
create_fission_neutrons = .true.
energy_cutoff = ZERO
electron_treatment = ELECTRON_LED
energy_cutoff(:) = [ZERO, 1000.0_8, ZERO, ZERO]
energy_max_neutron = INFINITY
energy_min_neutron = ZERO
entropy_on = .false.
@ -135,6 +136,7 @@ contains
output_summary = .true.
output_tallies = .true.
particle_restart_run = .false.
photon_transport = .false.
pred_batches = .false.
reduce_tallies = .true.
res_scat_on = .false.
@ -305,6 +307,7 @@ contains
use cmfd_header
use mgxs_header
use photon_header
use plot_header
use sab_header
use settings
@ -321,6 +324,7 @@ contains
call free_memory_volume()
call free_memory_simulation()
call free_memory_nuclide()
call free_memory_photon()
call free_memory_settings()
call free_memory_mgxs()
call free_memory_sab()

View file

@ -434,4 +434,21 @@ contains
end subroutine photon_calculate_xs
!===============================================================================
! FREE_MEMORY_PHOTON deallocates/resets global variables in this module
!===============================================================================
subroutine free_memory_photon()
! Deallocate photon cross section data
if (allocated(elements)) deallocate(elements)
if (allocated(compton_profile_pz)) deallocate(compton_profile_pz)
n_elements = 0
call element_dict % clear()
! Clear TTB-related arrays
if (allocated(ttb_e_grid)) deallocate(ttb_e_grid)
if (allocated(ttb_k_grid)) deallocate(ttb_k_grid)
if (allocated(ttb)) deallocate(ttb)
end subroutine free_memory_photon
end module photon_header