program prepq integer*4 nf,i character*80 gn logical*4 lex c write(6,*)'QGRAD optimization-additional calculation of Raman' write(6,*)'Number of fragments:' read(5,*)nf write(6,*)'Generic name:' read(5,5000)gn 5000 format(a80) do 2 n1=1,len(gn) 2 if(gn(n1:n1).ne.' ')goto 3 3 do 4 n2=len(gn),1,-1 4 if(gn(n2:n2).ne.' ')goto 5 5 inquire(file='goprepram',exist=lex) if(lex)then write(6,*)'goprepram exists' else open(4,file='goprepram') do 6 i=1,nf il=int(log(dble(i))/log(10.0d0))+1 ir=i do 8 ii=1,il jj=ir/10**(il-ii) gn(n2+ii:n2+ii)=char(48+jj) 8 ir=ir-jj*10**(il-ii) 4001 format(80a) write(4,4001)'cp goram '//gn(n2+1:n2+il) write(4,4001)'cd '//gn(n2+1:n2+il) write(4,4001)'mkrami' write(4,4001)'./goram' write(4,4001)'cd ..' write(4,4001)'cp '//gn(n2+1:n2+il)//'/TTT ' 1//gn(n1:n2+il)//'.ttt' 6 continue close(4) write(6,*)'goprepram created' endif c inquire(file='goram',exist=lex) if(.not.lex)then open(4,file='goram') write(4,4002) 4002 format('g98 FRERAM.INP FRERAM.OUT',/, 1 'echo AUTO > AUTO',/, 2 'cp FRERAM.OUT FRE.OUT',/,'gar',/, 6 'cp FILE.TTT TTT') close(4) write(6,*)'goram created' else write(6,*)'goram exists' endif c stop end