a custom source can now be read in from file

This commit is contained in:
Bryan Herman 2014-01-31 10:35:23 -05:00
parent 2246f590e1
commit 854c86aa42

View file

@ -1,16 +1,17 @@
module source
use bank_header, only: Bank
use bank_header, only: Bank
use constants
use error, only: fatal_error
use geometry, only: find_cell
use geometry_header, only: BASE_UNIVERSE
use error, only: fatal_error
use geometry, only: find_cell
use geometry_header, only: BASE_UNIVERSE
use global
use math, only: maxwell_spectrum, watt_spectrum
use output, only: write_message
use particle_header, only: Particle
use random_lcg, only: prn, set_particle_seed
use string, only: to_str
use math, only: maxwell_spectrum, watt_spectrum
use output, only: write_message
use output_interface, only: BinaryOutput
use particle_header, only: Particle
use random_lcg, only: prn, set_particle_seed
use string, only: to_str
#ifdef MPI
use mpi
@ -28,8 +29,9 @@ contains
integer(8) :: i ! loop index over bank sites
integer(8) :: id ! particle id
integer(8) :: itmp ! temporary integer
type(Bank), pointer :: src => null() ! source bank site
type(BinaryOutput) :: sp ! statepoint/source binary file
message = "Initializing source particles..."
call write_message(6)
@ -38,8 +40,17 @@ contains
! Read the source from a binary file instead of sampling from some
! assumed source distribution
message = 'This feature is currently disabled and will be added back in.'
call fatal_error()
! Open the binary file
call sp % file_open(path_source, 'r', serial = .false.)
! Read the file type
call sp % read_data(itmp, "filetype")
! Read in the source bank
call sp % read_source_bank()
! Close file
call sp % file_close()
else
! Generation source sites from specified distribution in user input