[lammps-users] change atom type of charge during runtime

Dear all,
In my simulations, I need to change type/charge of an atom during the run time. Is there a simple way to do that?
I used the fortran version of lammps before and I usually do this kind of modifications in the diagnostic.f routine. Is there a similar user defined routine in the C++ version of lammps?

Thank you very much for help.
Best,
Binquan

The set command will let you change such things between runs.
It could also be used with the run every command to do something
periodicically during a run. If you want something more specific,
you could write a fix that will get called every timestep which
will do whatever you want. It's like the diagnostic option in
the old LAMMPS you mentioned.

Steve