Added run statistics output.

This commit is contained in:
Paul Romano 2011-09-26 23:08:06 -04:00
parent dd08327837
commit 45c0257733
4 changed files with 26 additions and 4 deletions

View file

@ -81,6 +81,7 @@ module global
! cycle keff
real(8) :: keff
real(8) :: keff_std
logical :: tallies_on
@ -94,6 +95,7 @@ module global
type(Timer) :: time_total ! timer for total run
type(Timer) :: time_init ! timer for initialization
type(Timer) :: time_intercycle ! timer for intercycle synchronization
type(Timer) :: time_inactive ! timer for inactive cycles
type(Timer) :: time_compute ! timer for computation
! Paths to input file, cross section data, etc

View file

@ -55,6 +55,7 @@ contains
if (master) call header("BEGIN SIMULATION", 1)
tallies_on = .false.
call timer_start(time_inactive)
! ==========================================================================
! LOOP OVER CYCLES
@ -110,7 +111,10 @@ contains
! print cycle information
! Turn tallies on once inactive cycles are complete
if (i_cycle == n_inactive) tallies_on = .true.
if (i_cycle == n_inactive) then
tallies_on = .true.
call timer_stop(time_inactive)
end if
! Stop timer for inter-cycle synchronization
call timer_stop(time_intercycle)
@ -123,8 +127,8 @@ contains
! Calculate statistics for tallies
call tally_statistics()
if (master) call header("SIMULATION FINISHED", 1)
end subroutine run_problem
end program main

View file

@ -695,6 +695,9 @@ contains
subroutine print_runtime()
integer :: total_particles
real(8) :: speed
! display header block
call header("Time Elapsed")
@ -704,8 +707,20 @@ contains
write(ou,100) "Total time in computation", trim(real_to_str(time_compute % elapsed))
write(ou,100) "Total time between cycles", trim(real_to_str(time_intercycle % elapsed))
! format for write statments
! display header block
call header("Run Statistics")
! display calculate rate and final keff
total_particles = n_particles * n_cycles
speed = real(total_particles) / time_compute % elapsed
write(ou,101) "Calculation Rate", trim(real_to_str(speed))
write(ou,102) "Final Keff", trim(real_to_str(keff)), trim(real_to_str(keff_std))
write(ou,*)
! format for write statements
100 format (1X,A,T33,"= ",A," seconds")
101 format (1X,A,T20,"= ",A," neutrons/second")
102 format (1X,A,T20,"= ",A," +/- ",A)
end subroutine print_runtime

View file

@ -64,6 +64,7 @@ contains
k2 = k2 + kcoll**2
keff = k1/n
std = sqrt((k2/n-keff**2)/n)
keff_std = std
if (i_cycle > n_inactive+1) then
write(6,101) i_cycle, kcoll, keff, std
else