diff --git a/src/gravity.F90 b/src/gravity.F90 index 200fb64..82824ec 100644 --- a/src/gravity.F90 +++ b/src/gravity.F90 @@ -216,11 +216,11 @@ module gravity ! ! t, dt - time and the time increment; ! x, y, z - rectangular coordinates; -! gacc - vector of the gravitational acceleration; +! acc - vector of the gravitational acceleration; ! !=============================================================================== ! - subroutine gacc_none(t, dt, x, y, z, gacc) + subroutine gacc_none(t, dt, x, y, z, acc) ! local variables are not implicit by default ! @@ -230,7 +230,7 @@ module gravity ! real(kind=8) , intent(in) :: t, dt real(kind=8) , intent(in) :: x, y, z - real(kind=8), dimension(3), intent(out) :: gacc + real(kind=8), dimension(3), intent(out) :: acc ! !------------------------------------------------------------------------------- ! @@ -240,6 +240,10 @@ module gravity call start_timer(imc) #endif /* PROFILE */ +! reset gravitational acceleration +! + acc(:) = 0.0d+00 + #ifdef PROFILE ! stop accounting time for the gravitational acceleration calculation ! diff --git a/src/io.F90 b/src/io.F90 index 1381bb2..44e9df0 100644 --- a/src/io.F90 +++ b/src/io.F90 @@ -33,9 +33,7 @@ module io ! import external subroutines ! use blocks, only : pointer_meta -#ifdef PROFILE use timers, only : set_timer, start_timer, stop_timer -#endif /* PROFILE */ ! module variables are not implicit by default ! @@ -89,9 +87,10 @@ module io #endif /* HDF5 */ end interface -#ifdef PROFILE ! timer indices ! + integer , save :: iio +#ifdef PROFILE integer , save :: ioi, iow, ios #endif /* PROFILE */ @@ -204,9 +203,10 @@ module io ! !------------------------------------------------------------------------------- ! -#ifdef PROFILE ! set timer descriptions ! + call set_timer('SNAPSHOTS I/O' , iio) +#ifdef PROFILE call set_timer('io:: initialization' , ioi) call set_timer('io:: snapshot writing', iow) call set_timer('io:: snapshot reading', ios) @@ -360,12 +360,24 @@ module io call start_timer(ios) #endif /* PROFILE */ +! reset the return flag +! + iret = 0 + +! start accounting time for I/O +! + call start_timer(iio) + #ifdef HDF5 ! read HDF5 restart file and rebuild the meta and data block structures ! call read_restart_snapshot_h5(iret) #endif /* HDF5 */ +! stop accounting time for I/O +! + call stop_timer(iio) + ! calculate the shift of the snapshot counter, and the next snapshot time ! ishift = int(time / hsnap) - isnap + 1 @@ -411,6 +423,10 @@ module io ! !------------------------------------------------------------------------------- ! +! reset the return flag +! + iret = 0 + ! check if conditions for storing the restart snapshot have been met ! if (hrest < 5.0d-02 .or. thrs < irest * hrest) return @@ -421,12 +437,20 @@ module io call start_timer(iow) #endif /* PROFILE */ +! start accounting time for I/O +! + call start_timer(iio) + #ifdef HDF5 ! store restart file ! call write_restart_snapshot_h5(nrun, iret) #endif /* HDF5 */ +! stop accounting time for I/O +! + call stop_timer(iio) + ! increase the restart snapshot counter ! irest = irest + 1 @@ -476,6 +500,10 @@ module io call start_timer(iow) #endif /* PROFILE */ +! start accounting time for I/O +! + call start_timer(iio) + #ifdef HDF5 ! store variable snapshot file ! @@ -486,6 +514,10 @@ module io end if #endif /* HDF5 */ +! stop accounting time for I/O +! + call stop_timer(iio) + ! increase the snapshot counter and calculate the next snapshot time ! isnap = isnap + 1 diff --git a/src/user_problem.F90 b/src/user_problem.F90 index 8a2332e..dab5585 100644 --- a/src/user_problem.F90 +++ b/src/user_problem.F90 @@ -831,6 +831,10 @@ module user_problem call start_timer(img) #endif /* PROFILE */ +! reset gravitational acceleration +! + acc(:) = 0.0d+00 + #ifdef PROFILE ! stop accounting time for the gravitational acceleration calculation !