Skip to content

Commit d6edf3b

Browse files
committed
Fix ETA off-by-one, wall_time_avg restart bug, declaration ordering
1 parent 00d3a24 commit d6edf3b

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/post_process/m_start_up.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ contains
152152
& int(ceiling(100._wp*(real(t_step - n_start)/(n_save)))), t_step, n_save, wall_time_avg, wall_time, eta_hh, &
153153
& eta_mm, eta_ss
154154
else
155-
eta_sec = wall_time_avg*real((t_step_stop - t_step)/t_step_save + 1, wp)
155+
eta_sec = wall_time_avg*real((t_step_stop - t_step)/t_step_save, wp)
156156
eta_hh = int(eta_sec)/3600
157157
eta_mm = mod(int(eta_sec), 3600)/60
158158
eta_ss = mod(int(eta_sec), 60)

src/simulation/m_start_up.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,10 +609,10 @@ contains
609609
!> Advance the simulation by one time step, handling CFL-based dt and time-stepper dispatch
610610
impure subroutine s_perform_time_step(t_step, time_avg)
611611

612-
integer :: i, eta_hh, eta_mm, eta_ss
613-
real(wp) :: eta_sec
614612
integer, intent(inout) :: t_step
615613
real(wp), intent(inout) :: time_avg
614+
integer :: i, eta_hh, eta_mm, eta_ss
615+
real(wp) :: eta_sec
616616

617617
if (cfl_dt) then
618618
if (cfl_const_dt .and. t_step == 0) call s_compute_dt()

src/simulation/m_time_steppers.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,8 @@ contains
588588
wall_time = abs(finish - start)
589589

590590
if (cfl_dt) then
591-
if (t_step >= 2) then
592-
wall_time_avg = (wall_time + (t_step - 2)*wall_time_avg)/(t_step - 1)
591+
if (t_step - t_step_start >= 2) then
592+
wall_time_avg = (wall_time + (t_step - t_step_start - 2)*wall_time_avg)/(t_step - t_step_start - 1)
593593
else
594594
wall_time_avg = 0._wp
595595
end if

0 commit comments

Comments
 (0)