Page 431 - Handbook Of Multiphase Flow Assurance
P. 431

430                          10.  Research methods in flow assurance

                       remflag(i)=0
                       if(z1(i).lt.(-C/unitside)) then
                       remflag(i)=1
                       endif
                      enddo
                      nrem=0
                      do i=1,npts
                       if(remflag(i).eq.0) then
                        x1(i-nrem)=x1(i)
                        y1(i-nrem)=y1(i)
                        z1(i-nrem)=z1(i)
                        x2(i-nrem)=x2(i)
                        y2(i-nrem)=y2(i)
                        z2(i-nrem)=z2(i)
                        x3(i-nrem)=x3(i)
                        y3(i-nrem)=y3(i)
                        z3(i-nrem)=z3(i)
                       else
                        nrem=nrem+1
                       endif
                      end do
                      npts=npts-nrem
                 C
                 C
                 C if desired, the unit cell will be enlarged to a NxMx1 surface size
                 C currently set to enlarge [100], [110] and [111] sI surfaces
                 C to                        2x2;   2x1;      2x2 respectively.
                 c For a sII[111] surface a 2x2 enlargement is done for polymers with >8 units.
                 C
                 C replicate molecules in xyz arrays and adjust surface parameters
                      if(ap.eq.1.and.a.eq.1) then
                 C for [100] (ap=1)
                       do 461 ix=0, 1
                       do 461 iy=0, 1
                       do 461 i=1, npts
                        x1(i+ix*2*npts+iy*npts)=x1(i)+ix
                        y1(i+ix*2*npts+iy*npts)=y1(i)+iy
                        z1(i+ix*2*npts+iy*npts)=z1(i)
                        x2(i+ix*2*npts+iy*npts)=x2(i)+ix
                        y2(i+ix*2*npts+iy*npts)=y2(i)+iy
                        z2(i+ix*2*npts+iy*npts)=z2(i)
                        x3(i+ix*2*npts+iy*npts)=x3(i)+ix
                        y3(i+ix*2*npts+iy*npts)=y3(i)+iy
                        z3(i+ix*2*npts+iy*npts)=z3(i)
                 461      continue
   426   427   428   429   430   431   432   433   434   435   436