added option to write out initial source guess

This commit is contained in:
Bryan Herman 2014-02-28 23:26:02 -05:00
parent 38a8c56e9a
commit 790d0776e7
3 changed files with 22 additions and 0 deletions

View file

@ -292,6 +292,9 @@ module global
! Particle restart run
logical :: particle_restart_run = .false.
! Write out initial source
logical :: write_initial_source = .false.
! ============================================================================
! CMFD VARIABLES

View file

@ -255,6 +255,14 @@ contains
call fatal_error()
end if
! Check if we want to write out source
if (check_for_node(node_source, "write_initial")) then
call get_node_value(node_source, "write_initial", temp_str)
call lower_case(temp_str)
if (trim(temp_str) == 'true' .or. trim(temp_str) == '1') &
write_initial_source = .true.
end if
! Check for external source file
if (check_for_node(node_source, "file")) then
! Copy path of source file

View file

@ -27,6 +27,7 @@ contains
subroutine initialize_source()
character(MAX_FILE_LEN) :: filename
integer(8) :: i ! loop index over bank sites
integer(8) :: id ! particle id
integer(4) :: itmp ! temporary integer
@ -70,6 +71,16 @@ contains
end do
end if
! Write out initial source
if (write_initial_source) then
message = 'Writing out initial source guess...'
call write_message(1)
filename = 'initial_source.h5'
call sp % file_create(filename, serial = .false.)
call sp % write_source_bank()
call sp % file_close()
end if
end subroutine initialize_source
!===============================================================================