Page 425 - Handbook Of Multiphase Flow Assurance
P. 425

424                          10.  Research methods in flow assurance

                      if (bflag.eq.0) then
                        write(6,34)B
                      else
                        write(6,35)B
                  34       FORMAT(1X,'Position set to ',F10.6)
                  35       FORMAT(1X,'Position reset to ',F10.6)
                      endif
                 C end of check for proper slice position input
                 endif
                 C
                      write(*,*)'Enter desired slice thickness in Z direction:'
                      read(*,*) C

                 C read in the unit cell
                      do i=1, npts
                      read(1,*)ii,x1(i),y1(i),z1(i),x2(i),y2(i),z2(i),
                      -  x3(i),y3(i),z3(i)
                      end do

                 C ------------[111]-------------------
                      if(ap.eq.2) then
                 C if constructing the [111] surface, the unit cell will be
                 C replicated 12 times for slicing
                      do 45 ix=0, nx
                      do 45 iy=0, ny
                      do 45 iz=0, nz
                      do 45 i=1, npts
                      x1(i+ix*6*npts+iy*3*npts+iz*npts)=x1(i)-ix
                      y1(i+ix*6*npts+iy*3*npts+iz*npts)=y1(i)-iy
                      z1(i+ix*6*npts+iy*3*npts+iz*npts)=z1(i)-iz
                      x2(i+ix*6*npts+iy*3*npts+iz*npts)=x2(i)-ix
                      y2(i+ix*6*npts+iy*3*npts+iz*npts)=y2(i)-iy
                      z2(i+ix*6*npts+iy*3*npts+iz*npts)=z2(i)-iz
                      x3(i+ix*6*npts+iy*3*npts+iz*npts)=x3(i)-ix
                      y3(i+ix*6*npts+iy*3*npts+iz*npts)=y3(i)-iy
                      z3(i+ix*6*npts+iy*3*npts+iz*npts)=z3(i)-iz
                 45      continue
                 C determine which molecules should be sliced off in [111]
                      do i=1,npts*12
                        remflag(i)=0
                 C check the cell in direction of equation 1: -2x+y+z=1
                        xyz=-x1(i)-x1(i)+y1(i)+z1(i)
                 c correct computational error
                        if(abs(xyz-dnint(xyz)).lt.1d-10) xyz=dnint(xyz)
                        if(xyz.GT.1.D0) remflag(i)=1
   420   421   422   423   424   425   426   427   428   429   430