diff --git a/src/post_process/m_start_up.fpp b/src/post_process/m_start_up.fpp index c65e4cf7cf..a753aa17eb 100644 --- a/src/post_process/m_start_up.fpp +++ b/src/post_process/m_start_up.fpp @@ -139,16 +139,27 @@ contains impure subroutine s_perform_time_step(t_step) integer, intent(inout) :: t_step + integer :: eta_hh, eta_mm, eta_ss + real(wp) :: eta_sec if (proc_rank == 0) then if (cfl_dt) then - print '(" [", I3, "%] Saving ", I8, " of ", I0, " Time Avg = ", ES16.6, " Time/step = ", ES12.6, "")', & - & int(ceiling(100._wp*(real(t_step - n_start)/(n_save)))), t_step, n_save, wall_time_avg, wall_time + eta_sec = wall_time_avg*real(n_save - t_step, wp) + eta_hh = int(eta_sec)/3600 + eta_mm = mod(int(eta_sec), 3600)/60 + eta_ss = mod(int(eta_sec), 60) + print '(" [", I3, "%] Saving ", I8, " of ", I0, " Time Avg = ", ES16.6, " Time/step = ", ES12.6, " ETA (HH:MM:SS) = ", I0, ":", I2.2, ":", I2.2)', & + & int(ceiling(100._wp*(real(t_step - n_start)/(n_save)))), t_step, n_save, wall_time_avg, wall_time, eta_hh, & + & eta_mm, eta_ss else - print '(" [", I3, "%] Saving ", I8, " of ", I0, " @ t_step = ", I8, " Time Avg = ", ES16.6, " Time/step = ", ES12.6, "")', & + eta_sec = wall_time_avg*real((t_step_stop - t_step)/t_step_save + 1, wp) + eta_hh = int(eta_sec)/3600 + eta_mm = mod(int(eta_sec), 3600)/60 + eta_ss = mod(int(eta_sec), 60) + print '(" [", I3, "%] Saving ", I8, " of ", I0, " @ t_step = ", I8, " Time Avg = ", ES16.6, " Time/step = ", ES12.6, " ETA (HH:MM:SS) = ", I0, ":", I2.2, ":", I2.2)', & & int(ceiling(100._wp*(real(t_step - t_step_start)/(t_step_stop - t_step_start + 1)))), & & (t_step - t_step_start)/t_step_save + 1, (t_step_stop - t_step_start)/t_step_save + 1, t_step, & - & wall_time_avg, wall_time + & wall_time_avg, wall_time, eta_hh, eta_mm, eta_ss end if end if diff --git a/src/post_process/p_main.fpp b/src/post_process/p_main.fpp index 32d8dc2c7e..64da30aa6b 100644 --- a/src/post_process/p_main.fpp +++ b/src/post_process/p_main.fpp @@ -10,7 +10,7 @@ program p_main implicit none - integer :: t_step !< Iterator for the main time-stepping loop + integer :: t_step, nt_step !< Iterator for the main time-stepping loop !> Generic storage for the name(s) of the flow variable(s) that will be added to the formatted database file(s) character(LEN=name_len) :: varname real(wp) :: pres @@ -47,8 +47,13 @@ program p_main wall_time = abs(finish - start) - if (t_step >= 2) then - wall_time_avg = (wall_time + (t_step - 2)*wall_time_avg)/(t_step - 1) + if (cfl_dt) then + nt_step = t_step - n_start + 1 + else + nt_step = (t_step - t_step_start)/t_step_save + 1 + end if + if (nt_step >= 2) then + wall_time_avg = (wall_time + (nt_step - 2)*wall_time_avg)/(nt_step - 1) else wall_time_avg = 0._wp end if diff --git a/src/simulation/m_start_up.fpp b/src/simulation/m_start_up.fpp index c3f38ef500..526259417f 100644 --- a/src/simulation/m_start_up.fpp +++ b/src/simulation/m_start_up.fpp @@ -609,9 +609,10 @@ contains !> Advance the simulation by one time step, handling CFL-based dt and time-stepper dispatch impure subroutine s_perform_time_step(t_step, time_avg) + integer :: i, eta_hh, eta_mm, eta_ss + real(wp) :: eta_sec integer, intent(inout) :: t_step real(wp), intent(inout) :: time_avg - integer :: i if (cfl_dt) then if (cfl_const_dt .and. t_step == 0) call s_compute_dt() @@ -640,14 +641,23 @@ contains if (cfl_dt) then if (proc_rank == 0 .and. mod(t_step - t_step_start, t_step_print) == 0) then - print '(" [", I3, "%] Time ", ES16.6, " dt = ", ES16.6, " @ Time Step = ", I8, " Time Avg = ", ES16.6, " Time/step = ", ES12.6, "")', & - & int(ceiling(100._wp*(mytime/t_stop))), mytime, dt, t_step, wall_time_avg, wall_time + eta_sec = wall_time_avg*(t_stop - mytime)/max(dt, tiny(dt)) + eta_hh = int(eta_sec)/3600 + eta_mm = mod(int(eta_sec), 3600)/60 + eta_ss = mod(int(eta_sec), 60) + print '(" [", I3, "%] Time ", ES16.6, " dt = ", ES16.6, " @ Time Step = ", I8, " Time Avg = ", ES16.6, " Time/step = ", ES12.6, " ETA (HH:MM:SS) = ", I0, ":", I2.2, ":", I2.2)', & + & int(ceiling(100._wp*(mytime/t_stop))), mytime, dt, t_step, wall_time_avg, wall_time, eta_hh, eta_mm, eta_ss end if else if (proc_rank == 0 .and. mod(t_step - t_step_start, t_step_print) == 0) then - print '(" [", I3, "%] Time step ", I8, " of ", I0, " @ t_step = ", I8, " Time Avg = ", ES12.6, " Time/step= ", ES12.6, "")', & + eta_sec = wall_time_avg*real(t_step_stop - t_step, wp) + eta_hh = int(eta_sec)/3600 + eta_mm = mod(int(eta_sec), 3600)/60 + eta_ss = mod(int(eta_sec), 60) + print '(" [", I3, "%] Time step ", I8, " of ", I0, " @ t_step = ", I8, " Time Avg = ", ES12.6, " Time/step= ", ES12.6, " ETA (HH:MM:SS) = ", I0, ":", I2.2, ":", I2.2)', & & int(ceiling(100._wp*(real(t_step - t_step_start)/(t_step_stop - t_step_start + 1)))), & - & t_step - t_step_start + 1, t_step_stop - t_step_start + 1, t_step, wall_time_avg, wall_time + & t_step - t_step_start + 1, t_step_stop - t_step_start + 1, t_step, wall_time_avg, wall_time, eta_hh, & + & eta_mm, eta_ss end if end if diff --git a/src/simulation/m_time_steppers.fpp b/src/simulation/m_time_steppers.fpp index 4a741a4068..6358c251b0 100644 --- a/src/simulation/m_time_steppers.fpp +++ b/src/simulation/m_time_steppers.fpp @@ -587,10 +587,18 @@ contains wall_time = abs(finish - start) - if (t_step >= 2) then - wall_time_avg = (wall_time + (t_step - 2)*wall_time_avg)/(t_step - 1) + if (cfl_dt) then + if (t_step >= 2) then + wall_time_avg = (wall_time + (t_step - 2)*wall_time_avg)/(t_step - 1) + else + wall_time_avg = 0._wp + end if else - wall_time_avg = 0._wp + if (t_step - t_step_start >= 2) then + wall_time_avg = (wall_time + (t_step - t_step_start - 2)*wall_time_avg)/(t_step - t_step_start - 1) + else + wall_time_avg = 0._wp + end if end if end subroutine s_tvd_rk