Page 373 - Handbook Of Multiphase Flow Assurance
P. 373

372                          10.  Research methods in flow assurance

                 c      it's an oxygen
                       if(iatomtype(natm,1).eq.3.and.natm.ne.chain(nbackbone-1))then
                 c     check that it isn't a side group oxygen - that it isn't -OH
                        if(iatomtype(chain(nbackbone-1),1).ne.3.and.
                      &       iatomtype(ibonddata(natm,1) ,1).ne.1.and.
                      &       iatomtype(ibonddata(natm,2) ,1).ne.1) then
                        morecanfind=1
                        nbackbone=nbackbone+1
                        chain(nbackbone)=ibonddata(chain(nbackbone-1),i)
                        goto 30
                        endif
                       endif
                      end do
                  30   if(morecanfind.eq.1) goto 25
                 C
                      atmono=nbackbone/ngroups
                      if(atmono.ne.int(atmono)) then
                      print *,'Non-integer number of backbone atoms per monomer'
                      print *,'Please input this number (e.g. 2 for a vinyl chain)'
                      read (*,*)atmono
                      endif
                 C     assign numbers to backbone atoms
                      do i=1,nbackbone
                      nmono =i
                 c           =int(i/atmono+0.5D0) - this formula can be used to assign monomer numbers
                      iatomtype(chain(i),2)=nmono
                 c     assign monomer numbers to backbone nearest neighbors
                      do j=1,nbonds(chain(i))
                      natm =ibonddata(chain(i),j)
                 c       check that the backbone neighbor isn't a next/previous backbone atom
                      ibone=0
                        do k=1,nbackbone
                        if(natm.eq.chain(k))ibone=1
                        end do
                      if(ibone.eq.0) then
                        iatomtype(natm,2)=nmono
                 c     assign monomer numbers to side groups
                 c     if it's not a hydrogen, and atom isn't in backbone, it's a side group
                        if(iatomtype(natm,1).ne.1) then
                 c     reset counters of atom being tested and those waiting for testing
                        ntest=1
                        nwait=1
                 c     store the side group first atom as nside
                        nside=natm
                        listwait(nwait)=nside
   368   369   370   371   372   373   374   375   376   377   378