Hi Aidan,
Sorry that I did not put it clear in my previous email, but as I mentioned, my code is not a general one, and I use it to subtract the bond connectivity of NH3 molecules only.
That is why in the beginning I/O section, I have the followings:
open (unit=20, file=‘N129.txt’, status=‘unknown’)
open (unit=21, file=‘N133.txt’, status=‘unknown’)
open (unit=22, file=‘N137.txt’, status=‘unknown’)
open (unit=23, file=‘N141.txt’, status=‘unknown’)
open (unit=24, file=‘N145.txt’, status=‘unknown’)
open (unit=25, file=‘N149.txt’, status=‘unknown’)
open (unit=26, file=‘N153.txt’, status=‘unknown’)
open (unit=27, file=‘N157.txt’, status=‘unknown’)
The numbers after the letter “N” in the file names here are the index of N atoms in my initial data file (which is used in the command of “read-data” command of input script).
The basic idea of my code is to scan the output from ‘fix reax/bonds’ line by line and subtract all the connectivity information for all nitrogen atom. If the number of bonds of nitrogen atom is not equal to 3, in my case, it implies the happening of reaction at that step. I then write the image index (which is corresponding to the simulation step or time, if you read that number together with the ‘thermo’ frequency and ‘run’ iterations).
I checked your file (“bonds.reax.tatb”) and it looks good to me. So, for example, if you want to extract the connection for the atom with id 100, you need to change the constant definition in the code,
image = 1
headline = 7
tailline = 1
natom = 384
You totally have two images in the file, the first is at t=0, and the second is from one iteration, that is why “image = 1” in the code. Then you may want to change the I/O section, and corresponding “IF” commands there. I was using something like "if (id .eq. 129) then ", but you need change all those IFs (there are several IFs and you have to change all) into “if (id .eq. 100) then” for your case.
I got the code running correctly for your “bonds.reax.tatb” file after those changes. You may also need to delete the last blank line there in your file. The code reads the file as repeated combinations of “Head( 7 lines)+Body(384 lines ,in your case)+tail(1 line)”. There is no blank line in between.
I may update that code later so that we can use it for general purpose.
Best wishes,
Paul