run upto

Dear lammps users,

When I use run upto, if the specified time step is lower than the current time step, the program returns an error and exits. This is problematic since I have other run commands in the same input script that need to be executed. Is there a way to have the same behavior as with run upto except that the program would move on to the rest of the input script instead of exiting?
I realize this might be doable with an if command but run upto is very convenient, I think it would be nice to be able to use it without necessarily exiting the execution.

Regards.

Dear lammps users,

When I use run upto, if the specified time step is lower than the
current time step, the program returns an error and exits. This is
problematic since I have other run commands in the same input script
that need to be executed. Is there a way to have the same behavior as
with run upto except that the program would move on to the rest of the
input script instead of exiting?
I realize this might be doable with an if command but run upto is very
convenient, I think it would be nice to be able to use it without
necessarily exiting the execution.

i am not certain, whether this is desirable on a global level. for the
average user it is generally preferable to terminate LAMMPS when an
inconsistent state appears rather than continuing.

however, since you have the source code, you are free to make this
modification for yourself in the binaries that you use.
e.g. you could do a modification like the following:

diff --git a/src/run.cpp b/src/run.cpp
index f238e78..8be8556 100644
--- a/src/run.cpp
+++ b/src/run.cpp
@@ -113,9 +113,8 @@ void Run::command(int narg, char **arg)
     nsteps = static_cast<int> (nsteps_input);
   } else {
     bigint delta = nsteps_input - update->ntimestep;
- if (delta < 0 || delta > MAXSMALLINT)
- error->all(FLERR,"Invalid run command upto value");
- nsteps = static_cast<int> (delta);
+ if (delta < 0 || delta > MAXSMALLINT) nsteps = 0;
+ else nsteps = static_cast<int> (delta);
   }

   // error check

axel.