anchor.diff:             write(*,*) "  Removing Element ", i, " (based on coord!)"        
             else
               NEL2 = NEL2 + 1
  -            IEN2(NEL2,1)=o2n(IEN(i,1))
  -            IEN2(NEL2,2)=o2n(IEN(i,2))
  -            IEN2(NEL2,3)=o2n(IEN(i,3))
  -            IEN2(NEL2,4)=o2n(IEN(i,4))
  -            IEN2(NEL2,5)=o2n(IEN(i,5))
  -            IEN2(NEL2,6)=o2n(IEN(i,6))
  -            IEN2(NEL2,7)=o2n(IEN(i,7))
  -            IEN2(NEL2,8)=o2n(IEN(i,8))
  +            IEN2(NEL2,1)=o2n(IEN(i,1)+1)
  +            IEN2(NEL2,2)=o2n(IEN(i,2)+1)
  +            IEN2(NEL2,3)=o2n(IEN(i,3)+1)
  +            IEN2(NEL2,4)=o2n(IEN(i,4)+1)
  +            IEN2(NEL2,5)=o2n(IEN(i,5)+1)
  +            IEN2(NEL2,6)=o2n(IEN(i,6)+1)
  +            IEN2(NEL2,7)=o2n(IEN(i,7)+1)
  +            IEN2(NEL2,8)=o2n(IEN(i,8)+1)
            endif
           else
             write(*,*) "  Removing Element", i
  
positive.code:          else
             NNODZ2 = NNODZ2+1           
             xg2(NNODZ2,:) = xg(i,:)
             o2n(i)=NNODZ2
           endif    
    
        end do
  
        NEL2 = 0
        do i = 1, NEL
          if ( (o2n(IEN(i,1)).ge.0).and.(o2n(IEN(i,2)).ge.0).and.
       &       (o2n(IEN(i,3)).ge.0).and.(o2n(IEN(i,4)).ge.0).and.
       &       (o2n(IEN(i,5)).ge.0).and.(o2n(IEN(i,6)).ge.0).and.
       &       (o2n(IEN(i,7)).ge.0).and.(o2n(IEN(i,8)).ge.0)) then
            xn = (xg(IEN(i,1),:) + xg(IEN(i,2),:)
       &       +  xg(IEN(i,3),:) + xg(IEN(i,4),:)   
       &       +  xg(IEN(i,5),:) + xg(IEN(i,6),:) 
       &       +  xg(IEN(i,7),:) + xg(IEN(i,8),:))/8d0   
           
            if ((xn(1).gt.x0).and.(xn(1).lt.x1).and.
       &        (xn(2).gt.y0).and.(xn(2).lt.y1).and.
  
negative.code:       real*8  xs(4),ys(4),zs(3)  
        real*8  dx(3),dy(3),dz(2)  
        integer xn(3),yn(3),zn(2) 
        integer xnn,ynn,znn 
        
        integer meshf
        logical ex
  
        real*8, allocatable :: x(:),y(:),z(:)
  
  