From 075f8f0b896a491e3287f2a5c1f8d8a1b8eadec5 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 22 Jun 2013 17:31:10 -0400 Subject: [PATCH] Fix divide-by-zero when no inactive batches. --- src/output.F90 | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/output.F90 b/src/output.F90 index 1ff53f0d01..50c3726487 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -1420,16 +1420,20 @@ contains gen_per_batch) / time_active % elapsed end if else - speed_inactive = real(n_particles * n_inactive * gen_per_batch) / & - time_inactive % elapsed + if (n_inactive > 0) then + speed_inactive = real(n_particles * n_inactive * gen_per_batch) / & + time_inactive % elapsed + end if speed_active = real(n_particles * n_active * gen_per_batch) / & time_active % elapsed end if ! display calculation rate - string = to_str(speed_inactive) - if (.not. (restart_run .and. (restart_batch >= n_inactive))) & - write(ou,101) "Calculation Rate (inactive)", trim(string) + if (.not. (restart_run .and. (restart_batch >= n_inactive)) & + .and. n_inactive > 0) then + string = to_str(speed_inactive) + write(ou,101) "Calculation Rate (inactive)", trim(string) + end if string = to_str(speed_active) write(ou,101) "Calculation Rate (active)", trim(string)