Page 372 - Handbook Of Multiphase Flow Assurance
P. 372
Computer code (Makogon, 1994, 1997) 371
C*******************************************************************
c if backbone contains atoms other than C or O, obtain the needed
c info from user (which types are there; in what order are they
c connected
C*******************************************************************
C distinguish which are the backbone atoms
nbackbone=0
c first, find the terminating carbon of CH3 group
do i=1,natom
ntype=0
do j=1,nbonds(i)
ntype=ntype+iatomtype(ibonddata(i,j),1)
end do
if(ntype.eq.5.and.iatomtype(i,1).eq.2) then
nend=i
goto 20
endif
end do
20 nbackbone=1
chain(1)=nend
c find the backbone atom next to CH3 – check that it's not a hydrogen
do i=1,4
if(iatomtype(ibonddata(chain(1),i),1).ne.1)then
nbackbone=2
chain(2)=ibonddata(chain(1),i)
endif
end do
c find the following backbone atoms
25 do i=1,nbonds(chain(nbackbone))
morecanfind=0
natm=ibonddata(chain(nbackbone),i)
c it's a carbon
if(iatomtype(natm,1).eq.2.and.natm.ne.chain(nbackbone–1))then
c check that it isn't a side group carbon
isum=0
do j=1,4
if(iatomtype(ibonddata(natm,j),1).eq.1)isum=isum+1
end do
if(isum.eq.2.or.isum.eq.1) then
morecanfind=1
nbackbone=nbackbone+1
chain(nbackbone)=ibonddata(chain(nbackbone-1),i)
goto 30
endif
endif

