TinkerTools / tinker

Tinker: Software Tools for Molecular Design
https://dasher.wustl.edu/tinker/
Other
129 stars 61 forks source link

Activating an atom with i > n #94

Closed NF-AMU closed 3 years ago

NF-AMU commented 3 years ago

Hi,

When, by mistake (!), the ACTIVE keyword is used with an atom number larger than the total number of atoms, n, Tinker activates the nth atom, even if this last atom is intended to be inactive. In the attached archive, the second logfile (waterdimer.out2) shows this behavior. active.zip

Of course, this case is a true user error. However, I suppose it is worth including a test in active.f that would check that ACTIVE atom numbers stay <= n.

Nicolas

jayponder commented 3 years ago

Yes, that is bad behavior... Thanks for reporting it.

I've just put a simple fix into the master Github repo. Now when an "illegal" atom number entry is found in the ACTIVE or INACTIVE keyword lists, the program will not process that entry or any further entries. It also prints a warning message.

One could go much further and use a full parsing mechanism to protect the user against all sorts of incorrect input for this and other similar keywords. I prefer not to move in that direction, as it's impossible to protect against all illegal or incorrect inputs.