DRIVER, IO: Make sure thrs is set before using it.

Variable thrs was used before it was calculated for the first time. This
patch fixes it.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
Grzegorz Kowal 2014-08-04 11:08:32 -03:00
parent 70a0b137b6
commit 9ae7ef065b
2 changed files with 12 additions and 12 deletions

View File

@ -559,6 +559,14 @@ program amun
step = step + 1 step = step + 1
nsteps = nsteps + 1 nsteps = nsteps + 1
! get current time in seconds
!
tm_curr = get_timer_total()
! compute elapsed time
!
thrs = tm_curr / 3.6d+03
! store mesh statistics ! store mesh statistics
! !
call store_mesh_stats(step, time) call store_mesh_stats(step, time)
@ -575,14 +583,6 @@ program amun
! !
call write_snapshot() call write_snapshot()
! get current time in seconds
!
tm_curr = get_timer_total()
! compute elapsed time
!
thrs = tm_curr / 3.6d+03
! check if the time exceeds execution time limit ! check if the time exceeds execution time limit
! !
if (thrs > trun) iterm = 100 if (thrs > trun) iterm = 100

View File

@ -117,9 +117,9 @@ module io
integer(kind=4) , save :: irest = 1 integer(kind=4) , save :: irest = 1
integer(kind=4) , save :: isnap = 0 integer(kind=4) , save :: isnap = 0
integer(kind=4) , save :: ishift = 0 integer(kind=4) , save :: ishift = 0
real(kind=8) , save :: hrest = 6.0e+00 real(kind=8) , save :: hrest = 6.0d+00
real(kind=8) , save :: hsnap = 1.0e+00 real(kind=8) , save :: hsnap = 1.0d+00
real(kind=8) , save :: tsnap = 0.0e+00 real(kind=8) , save :: tsnap = 0.0d+00
! flags to determine the way of data writing ! flags to determine the way of data writing
! !
@ -382,7 +382,7 @@ module io
! !
! check if conditions for storing the restart snapshot have been met ! check if conditions for storing the restart snapshot have been met
! !
if (hrest < 5.0e-02 .or. thrs < irest * hrest) return if (hrest < 5.0d-02 .or. thrs < irest * hrest) return
#ifdef PROFILE #ifdef PROFILE
! start accounting time for the data writing ! start accounting time for the data writing