Hi Christoffer,
I have been using the Q program a bit more recently, and today found what seems to be a bug.
I was working on a toy system of 6 atoms, and wanted to set 8 of the interaction pairs as soft pairs using the [soft_pairs] section of the FEP file. I got a segfault whenever I set over 6 soft pairs.
Looking in the qatom.f90 file, there are two lines (912 and 913 in current github version):
allocate(iqexpnb(nqat))
allocate(jqexpnb(nqat))
which contain the indices of the interacting atoms i and j. Given that in a system of N atoms with no bonds, the max number of soft pairs would be N(N-1) / 2, I think this allocation is incorrect as it limits the number of soft pairs to N which is not right unless I am missing something important.
I changed it to
allocate(iqexpnb(nqat*(nqat-1)/2))
allocate(jqexpnb(nqat*(nqat-1)/2))
and it works fine (no segfault). Better would be changing it to allocate the arrays using the actual number of soft pairs in the input file, but given the typically small number of Q-atoms in a system it would not save much RAM.
I couldn't find a good way to get this to the Q-users attention so I thought I would try talking to you. Let me know if there is somewhere better to discuss this.