Page 376 - Handbook Of Multiphase Flow Assurance
P. 376

Computer code (Makogon, 1994, 1997)              375

                       do j=n1,n2
                       nn=nn+10**(n2-j)*(ichar(cc(j:j))-48)
                       end do
                     nfound=nfound+1
                     irawbond(nbondfound,nfound) = nn
             15         end do
                   if(nfound.lt.2) goto 12
                   goto 90
                  endif
                  endif

            C     scan the line for Atom statements
                  do i=80,1,-1
                  ncc=i
                  if(cc(i:i).ne.' ') goto 16
                  end do
             16   if(ncc.gt.4) then
                  if(cc(ncc-3:ncc).eq.'Atom')then
                   natom=natom+1
                   n1=index(cc,'(') +1
                   n2=index(cc,'Atom') -2
                   nn=0
                     do j=n1,n2
                     nn=nn+10**(n2-j)*(ichar(cc(j:j))-48)
                     end do
                   irawatom(natom)=nn
             22       read (1,'(80A)')cc
            C           check for end of file attribute: ) in position 1
                     if(cc(1:1).eq.')') goto 100
                   if(cc(8:8).eq.'C')goto 24
                   if(cc(8:8).eq.'X')goto 26
                   if(cc(8:8).eq.'F')goto 28
                   goto 30
            C     get atomic charge
             24       aa=0.d0
                   n1=index(cc,'Charge') +7
                   n2=index(cc,'.') +1
                   n3=index(cc,')') -1
                     do j=n2,n3
                     aa=aa+10.D0**(n2-j-1)*(ichar(cc(j:j))-48.D0)
                     end do
                   if (cc(n1:n1).eq.'-') aa=-aa
                   nfound=nfound+1
                   atomdata(natom,4) = aa
                   goto 30
            C     get atomic coordinates
   371   372   373   374   375   376   377   378   379   380   381