diff --git a/src/constants.F90 b/src/constants.F90 index e9688e761d..8887e1fc9b 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -363,6 +363,7 @@ module constants integer, parameter :: UNIT_STATE = 16 ! unit # for writing state point integer, parameter :: CMFD_BALANCE = 17 ! unit # for writing cmfd balance file integer, parameter :: UNIT_PARTICLE = 18 ! unit # for writing particle restart + integer, parameter :: UNIT_TRACK = 19 ! unit # for writing particle tracks !============================================================================= ! CMFD CONSTANTS diff --git a/src/physics.F90 b/src/physics.F90 index 707049b1a8..e1c7f12c32 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -73,6 +73,12 @@ contains ! Force calculation of cross-sections by setting last energy to zero micro_xs % last_E = ZERO + if (run_mode == MODE_PARTICLE) then + open(UNIT=UNIT_TRACK, FILE='test', STATUS='replace', & + ACCESS='stream') + write(UNIT_TRACK) p % coord0 % xyz + end if + do while (p % alive) ! Calculate microscopic and macroscopic cross sections -- note: if the @@ -100,6 +106,10 @@ contains coord % xyz = coord % xyz + distance * coord % uvw coord => coord % next end do + + if (run_mode == MODE_PARTICLE) then + write(UNIT_TRACK) p % coord0 % xyz + end if ! Score track-length tallies if (active_tracklength_tallies % size() > 0) & @@ -175,6 +185,10 @@ contains end do + if (run_mode == MODE_PARTICLE) then + close(UNIT=UNIT_TRACK) + end if + end subroutine transport !===============================================================================