Page 374 - Handbook Of Multiphase Flow Assurance
P. 374
Computer code (Makogon, 1994, 1997) 373
c cycle through the wait list and search for other side group atoms
50 do l=1,nbonds(listwait(ntest))
c look at the atoms connected to current atom
natm=ibonddata(listwait(ntest),l)
c see that it's not already in wait list and not a backbone atom
nstatok=1
do m=1,nwait
if(listwait(m).eq.natm.or.natm.eq.chain(i)) nstatok=0
end do
if(nstatok.eq.1) then
nwait=nwait+1
listwait(nwait)=ibonddata(listwait(ntest),l)
endif
end do
ntest=ntest+1
c check that there are more atoms to test
if(ntest.le.nwait) goto 50
c all side group atoms were found - assign their monomer numbers
do l=1,nwait
iatomtype(listwait(l),2)=nmono
end do
c end of the side group routine
endif
endif
end do
end do
C assign atoms to their monomers by numbers
do i=1,99
monocount(i)=0
monodata(100,i)=0
do j=1,100
monodata(i,j)=0
end do
end do
do i=1,natom
nmono=iatomtype(i,2)
monocount(nmono)=monocount(nmono)+1
monodata(nmono,monocount(nmono))=i
end do
C store the backbone information in the 100th element of monodata(i,j)
do i=1,nbackbone
monodata(100,i)=chain(i)
end do
RETURN
END

