Merge branch 'master' into reconnection

This commit is contained in:
Grzegorz Kowal 2021-11-08 22:37:40 -03:00
commit bbdee13e88

View File

@ -134,6 +134,10 @@ program amun
real(kind=8) :: tbeg = 0.0d+00, thrs
real(kind=8) :: tm_curr, tm_exec, tm_conv, tm_last = 0.0d+00
! vectors for better estimation of the remaining simulation time
!
real(kind=8), dimension(8) :: tprv, tm_prev
#ifndef __GFORTRAN__
! the type of the function SIGNAL should be defined for Intel compiler
!
@ -590,6 +594,11 @@ program amun
!
tbeg = time
! initialize vectors for the remaining time estimation
!
tprv(:) = time
tm_prev(:) = get_timer_total()
! initialize estimated remaining time of calculations
!
ed = 9999
@ -685,11 +694,20 @@ program amun
! print progress info to console, but not too often
!
if (master) then
! update vectors for the remaining time estimation
!
tm_prev(1) = tm_curr
tprv(1) = time
tm_prev = cshift(tm_prev, 1)
tprv = cshift(tprv , 1)
if (time >= tmax .or. (tm_curr - tm_last) >= 1.0d+00) then
! calculate days, hours, seconds
!
ec = int(tm_curr * (tmax - time) / max(1.0d-03, time - tbeg), kind = 4)
ec = int((tm_curr - tm_prev(1)) * (tmax - time) &
/ max(1.0d-03, time - tprv(1)), kind = 4)
es = max(0, min(863999999, ec))
ed = es / 86400
es = es - 86400 * ed