anchor.diff:  18     continue
          rmax = 4.0
          nb = 100
  -       atom1_tag = "O1"
  +       atom1_tag = " "
  +       atom1_id = 1
          atom2_tag = "O"
          latv = 10.0014453
          file_in = "test.xyz"
          file_out = "test.out"
  +       file_lattice = "lat.dat"
   c      ---------------------------      
   c      start checks/balances
   c      ---------------------------      
   c      atom tags
  -       if(atom1_tag.eq." ") then
  -         message = "please provide central atom tag"
  +       if(atom1_id.eq.0.and.atom1_tag.eq." ") then
  +         message = "please provide central atom id or tag"
            goto 911
          end if
  -       if(atom2_tag.eq." ") then
  -         atom2_tag = "*"
  +c      the lattice
  +       if(file_lattice.ne." ") then
  +         call lattice_read_file(file_lattice,lat)
  +       else
  +         do k=1,3
  +           lat(k,k) = latv(k)
  +         end do
          end if
  -c      the lattice
  -       if(all(latv.lt.0)) then
  +       if(any(lat.lt.0)) then
             message = "problems with lattice input"
             goto 911
          end if
  -       lat = 0.0
  -       do k=1,3
  -         lat(k,k) = latv(k)
  -       end do
   c      maximum radius
          if(rmax.lt.0) then
            rmax = 0.5*MINVAL(latv)
  
positive.code:        grs = 0.0d0
  c      get reciprocal lattice vectors 
         call smd_lat_invrt(lat,rlat)
         write(*,*) "Inverse Lattice vectors"
         write(*,*) (rlat(i,1),i=1,3)
         write(*,*) (rlat(i,2),i=1,3)
         write(*,*) (rlat(i,3),i=1,3)
  c      get lattice volume
         call smd_latt_vol(lat,vol)
  c
  
negative.code:        pname = "xyz_read_coords_byname"
         c1 = 0.0d0
         c2 = 0.0d0
  c       write(*,*) "in "//pname
         j1 = 0
         j2 = 0
  c      ------------------------------------------
  