program alextract implicit none integer*4 i,nat real*8 c(3),xx,xy,yy,xz,yz,zz,x,y,z,bohr character*80 s80,fn logical li li=.false. call getarg(1,fn) bohr=0.529177d0 open(9,file=fn) 1 read(9,80,end=99,err=99)s80 80 format(a80) if(s80(27:44).eq.'Input orientation:')then do 2 i=1,4 2 read(9,*) c=0.0d0 nat=0 3 read(9,80)s80 if(s80(2:2).ne.'-')then nat=nat+1 read(s80(31:70),*)x,y,z c(1)=c(1)+x c(2)=c(2)+y c(3)=c(3)+z goto 3 endif c(1)=c(1)/dble(nat)/bohr c(2)=c(2)/dble(nat)/bohr c(3)=c(3)/dble(nat)/bohr li=.true. endif if(s80(3:23).eq.'Exact polarizability:')then read(s80(24:71),*)xx,xy,yy,xz,yz,zz endif if(s80(23:43).eq.'Alpha(-w,w) frequency')then read(9,*) read(9,*)xx,xx,xy,xz read(9,*)xy,xy,yy,yz read(9,*)xz,xz,yz,zz endif goto 1 99 write(6,601)xx,xy,yy,xz,yz,zz,c,nat 601 format(6f10.3,1x,3f10.3,i4) if(.not.li)write(6,*)'mass center not found' close(9) end