Understanding grompp -t

GROMACS version: 2021.3
GROMACS modification: No

Hi all,
I have been reading the user manual as well as different posts about restarting a simulation, and I want to check my understanding of " gmx grompp -t previous.cpt" followed by gmx mdrun without mentioning the checkpoint file again.

In the following sample code, if step0.cpt is provided to gmx grompp, are the positions and velocities from the end of step0 read into step1? I understand that the time of my simulation in step1 starts from time zero again, but are the starting positions/velocities actually from step0 (since I am not gen_vel in step1.mdp)?

Run step 0

gmx grompp -f step0.mdp -o step0.tpr -c system.gro -p topol.top
gmx mdrun -v -deffnm step0

Run step 1 after step 0

gmx grompp -f step1.mdp -o step1.tpr -c step0.gro -t step0.cpt -p topol.top -n index.ndx
gmx mdrun -v -deffnm step1

I have alternatively tried to include the cpi and cpo flags on the gmx mdrun line similar to the following code. Note that both step1 and step0 have 1000 nsteps, and the only way I could get step1 to run after step0 was to include the -nstep flag in the command line although I have already specified nsteps in the mdp files as well.

Run step 0

gmx grompp -f step0.mdp -o step0.tpr -c system.gro -p topol.top
gmx mdrun -v -deffnm step0

Run step 1 after step 0

gmx grompp -f step1.mdp -o step1.tpr -c step0.gro -t step0.cpt -p topol.top -n index.ndx
gmx mdrun -v -s step1.tpr -cpi step0.cpt -cpo step1.cpt -nsteps 1000 -deffnm step1

However, using this second example, I have noticed that the energies do not exactly match up at the last time step of step0 and the zeroth timestep of step1. I don’t understand why there is a discrepancy. If I just want to make sure I am starting my simulation step1 from the last step of step0, is it sufficient to just use gmx grompp -t step0.cpt and gmx mdrun -deffnm step1 without mentioning the checkpoint file again in the gmx mdrun line?

Thank you for any clarification on this topic!