Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions src/post_process/m_start_up.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 8 additions & 3 deletions src/post_process/p_main.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
20 changes: 15 additions & 5 deletions src/simulation/m_start_up.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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

Expand Down
14 changes: 11 additions & 3 deletions src/simulation/m_time_steppers.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading