******************************************************************************* program geomchk ******************************************************************************* c c To compile non-graphics programs use : c f77 $(OPT) geomchk.f -o geomchk c real rx(300), ry(300), rz(300) real dax,day,daz,dhx,dhy,dhz real davec,dhvec,udax,uday,udaz real nbond character*80 record(300) character*80 rec character*80 aform character*40 fname character*40 gname character*8 left character*30 right integer i,ia,id,ih integer natom c c print *,'Enter car file name: ' read(5,'(a40)') fname c print *,'Input the number of atoms:' read(5,*) natom print *,'Input the number of bonds to check:' read(5,*) nbond c c open(unit=7,file=fname,form='formatted', $ status='old',err=990) c aform = "(a5,3(2x,f13.9),a29)" c read(7,'(a80)',end=997,err=995) record(1) read(7,'(a80)',end=997,err=995) record(2) read(7,'(a80)',end=997,err=995) record(3) read(7,'(a80)',end=997,err=995) record(4) do 200 i=1,natom read(7,'(a80)',end=997,err=995) record(i+4) write(6,'(a80)') record(i+4) read (record(i+4),aform,err=996) left,rx(i), $ ry(i),rz(i),right 200 continue do 250 i=1,nbond print *,'Input atom#1:' read(5,*) id print *,'Input atom#2:' read(5,*) ia dax=rx(id)-rx(ia) day=ry(id)-ry(ia) daz=rz(id)-rz(ia) davec=sqrt(dax*dax+day*day+daz*daz) print *,'The',id,'-',ia,' bond length is:',davec 250 continue c close(7) c goto 999 990 continue print *,'Error in input file' goto 999 995 continue print *,'Error in format' print *, record goto 999 996 continue print *,'Error parsing format' print *, record print *,left, rx(i), ry(i), rz(i),right goto 999 997 continue print *,'End of file detected' 999 continue c end c