anchor.diff:   else if (trim(arg)=='-ignH') then
     ignoreH=.true.
     i=i+1
  + else if (trim(arg)=='-peratom') then
  +  peratom=.true.
  +  i=i+1
    else
     write(*,*)
     write(*,*) 'Unrecognized option:', TRIM(arg)
  
positive.code:  do
    read(9,*,iostat=ioerror)
    if (ioerror.lt.0) then
     exit
    else if (ioerror.gt.0) then
     write(*,*) 'READ ERROR'
     stop
    end if
    read(9,*) cstep, energy, scrdip
  
negative.code:   mask(i)=.false.
   end if
  !doesn't enter loop on i==1
   if(peratom) then
     atgrp(ig,2)=ig
     grptags(ig)=elem
     ig=ig+1
   else
   do j=1,i-1
    if (atgrp(i,1).eq.atgrp(j,1)) then
     atgrp(i,2)=atgrp(j,2)
  