The trjconv -t0 option causes fr->time to be modified and
this then causes the skipping to be incorrect. Alternative
we could document that fr->time shouldn't be modified
and change that trjconv makes a copy of fr before changing
time. This change has the advantage it is less likely
to reintroduce the problem.
Fixes #1405, #1406
Change-Id: Ibd692dfecdf175450fc43f7f35b774bf4446b316
int natoms; /* number of atoms (atoms, x, v, f) */
real t0; /* time of the first frame, needed *
* for skipping frames with -dt */
+ real tf; /* internal frame time - DO NOT CHANGE */
real tpf; /* time of the previous frame, not */
/* the read, but real file frames */
real tppf; /* time of two frames ago */
fr->bDouble = FALSE;
fr->natoms = -1;
fr->t0 = 0;
+ fr->tf = 0;
fr->tpf = 0;
fr->tppf = 0;
fr->title = NULL;
int dummy = 0;
bRet = FALSE;
- pt = fr->time;
+ pt = fr->tf;
do
{
clear_trxframe(fr, FALSE);
fr->tppf = fr->tpf;
- fr->tpf = fr->time;
+ fr->tpf = fr->tf;
switch (gmx_fio_getftp(status->fio))
{
/* DvdS 2005-05-31: this has been fixed along with the increased
* accuracy of the control over -b and -e options.
*/
- if (bTimeSet(TBEGIN) && (fr->time < rTimeValue(TBEGIN)))
+ if (bTimeSet(TBEGIN) && (fr->tf < rTimeValue(TBEGIN)))
{
if (xtc_seek_time(status->fio, rTimeValue(TBEGIN), fr->natoms, TRUE))
{
gmx_fio_getname(status->fio));
#endif
}
+ fr->tf = fr->time;
if (bRet)
{
#endif
break;
}
+ fr->tf = fr->time;
/* Return FALSE if we read a frame that's past the set ending time. */
if (!bFirst && (!(fr->flags & TRX_DONT_SKIP) && check_times(fr->time) > 0))