Skip to content

Commit

Permalink
Number of dumps was estimated one too large
Browse files Browse the repository at this point in the history
 * Usage of floor()+1 makes more sense than ceiling()+1
 * This fixes the issue with the kernel wavefields being shifted in time weirdly. The bug was introduced in commit 4fdc3be
  • Loading branch information
sstaehler committed Aug 27, 2014
1 parent a068ba8 commit c73403f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SOLVER/parameters.F90
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ subroutine compute_numerical_parameters
if (dump_vtk .or. dump_xdmf .or. dump_memory_vars) then
snap_it = floor(snap_dt / deltat)
open(unit=2900+mynum, file=datapath(1:lfdata)//'/snap_info.dat'//appmynum)
nsnap = ceiling(real(niter) / real(snap_it))
nsnap = floor(real(niter) / real(snap_it)) + 1

write(2900+mynum,*) nsnap
do ielem=1, nsnap
Expand Down Expand Up @@ -1047,7 +1047,7 @@ subroutine compute_numerical_parameters
! strain tensor output, convert from num of dumps per period into
! incremental time steps
if (dump_wavefields) then
nstrain = ceiling(real(niter)/real(strain_it)) + 1
nstrain = floor(real(niter)/real(strain_it)) + 1

open(unit=2900+mynum,file=datapath(1:lfdata)//'/strain_info.dat'//appmynum)
write(2900+mynum,*) nstrain
Expand Down

0 comments on commit c73403f

Please sign in to comment.