program kuk implicit none integer*4 ia,nf,nat,ix,ja,na1,na2,nh,nht,nas,nhs,nhts,nus,ka,nhu real*8 xi,yi,zi,xj,yj,zj,d character*80 fn logical ac,ls real*8,allocatable::r(:) character*1 si,sj integer*4,allocatable::q(:),sl(:) write(6,600) 600 format(' Kuk looks at geometries listed in X.LST',/, 1 ' and counts hydrogen bonds',/) nus=0 inquire(file='SOLU.LST',exist=ls) if(ls)then open(9,file='SOLU.LST') read(9,*)nus allocate(sl(nus)) read(9,*)(sl(ia),ia=1,nus) close(9) write(6,*)nus,' atoms in SOLU.LST' endif nf=0 nht=0 nhts=0 nhu=0 open(9,file='X.LST',status='old') 1 read(9,90,end=99,err=99)fn 90 format(a80) nf=nf+1 open(8,file=fn,status='old') read(8,*) read(8,*)nat allocate(r(3*nat),q(nat)) do 2 ia=1,nat 2 read(8,*)q(ia),(r(3*(ia-1)+ix),ix=1,3) close(8) nh=0 nhs=0 do 3 ia=1,nat if(q(ia).eq.1)then call as(ia,xi,yi,zi,r) c na1..number of acidic atoms bonded to this hydrogen c na2..number of acidic atoms H-bonded to this hydrogen c nas..number of acidic atoms short H-bonded to this hydrogen na1=0 na2=0 nas=0 do 31 ja=1,nat if(ac(q(ja)))then call as(ja,xj,yj,zj,r) d=(xj-xi)**2+(yj-yi)**2+(zj-zi)**2 c d(XH)<1.5: if(d.lt.2.25d0)na1=na1+1 c 1.5