2 cc---------------------------------
3 subroutine refresh_bank(ntrial)
4 implicit real*8 (a-h,o-z)
9 include 'COMMON.IOUNITS'
10 include 'COMMON.CHAIN'
12 include 'COMMON.CONTROL'
15 double precision l_diff(mxio),denep
19 nstatnx_tot(i,j)=nstatnx_tot(i,j)+nstatnx(i,j)
24 c loop over all newly obtained conformations
28 nstatnx(movernx(n),1)=nstatnx(movernx(n),1)+1
29 cccccccccccccccccccccccccccccccccccccccccccc
32 if(rmsn(n).gt.rmscut.or.pncn(n).lt.pnccut) goto 100
35 if(etot(n).gt.ebmax) goto 100
36 c Find the conformation closest to the conformation n in the bank
39 call get_diff12(dihang(1,1,1,n),bvar(1,1,1,m),l_diff(m))
40 if(l_diff(m).lt.difmin) then
46 if(difmin.lt.cutdif) then
47 c n is redundant to idmin
48 if(etot(n).lt.bene(idmin)) then
49 if(etot(n).lt.bene(idmin)-0.01d0) then
53 denep=bene(idmin)-etot(n)
54 call replace_bvar(idmin,n)
58 dij(i1,idmin)=l_diff(i1)
59 dij(idmin,i1)=l_diff(i1)
64 nstatnx(movernx(n),2)=nstatnx(movernx(n),2)+1
65 if(idmin.eq.ibmax) call find_max
68 c got new conformation
70 if(ebmax-ebmin.gt.del_ene) then
72 call replace_bvar(ibmax,n)
76 dij(i1,ibmax)=l_diff(i1)
77 dij(ibmax,i1)=l_diff(i1)
82 nstatnx(movernx(n),3)=nstatnx(movernx(n),3)+1
87 if(del_ene.lt.0.0001) then
88 write (iout,*) 'ERROR in refresh_bank: '
89 write (iout,*) 'ebmax: ',ebmax
90 write (iout,*) 'ebmin: ',ebmin
91 write (iout,*) 'del_ene: ',del_ene
92 crc call mpi_abort(mpi_comm_world,ierror,ierrcode)
94 cjp nbmax is never defined so condition below is always false
95 c if(nbank.lt.nbmax) then
97 c call replace_bvar(nbank,n)
101 call replace_bvar(ibmax,n)
108 cccccccccccccccccccccccccccccccccccccccccccc
112 write(iout,'(i3,a3,i4,i5,a6,1pe12.4,a4,i3,i4,3i5)')
113 & indb(n,2),' e ',indb(n,3),indb(n,1),' etot ',etot(n),' mv ',
114 & indb(n,5),indb(n,4),indb(n,7),indb(n,8),indb(n,9)
116 write(iout,'(i3,a3,i4,i5,a6,1pe12.4,a4,i3,i4,3i5
117 & ,a5,0pf4.1,a5,f3.0)')
118 & indb(n,2),' e ',indb(n,3),indb(n,1),' etot ',etot(n),' mv ',
119 & indb(n,5),indb(n,4),indb(n,7),indb(n,8),indb(n,9),
120 & ' rms ',rmsn(n),' %NC ',pncn(n)*100
124 write(iout,'(i3,a3,i4,i5,a6,1pe12.4,a4,i3,i4,3i5,
125 & 1x,a1,i4,0pf8.1,0pf8.1)')
126 & indb(n,2),' e ',indb(n,3),indb(n,1),' etot ',etot(n),' mv ',
127 & indb(n,5),indb(n,4),indb(n,7),indb(n,8),indb(n,9),
128 & chacc,iaccn,difmin,denep
130 write(iout,'(i3,a3,i4,i5,a6,1pe12.4,a4,i3,i4,3i5,a5,
131 & 0pf4.1,a5,f3.0,1x,a1,i4,0pf8.1,0pf8.1)')
132 & indb(n,2),' e ',indb(n,3),indb(n,1),' etot ',etot(n),' mv ',
133 & indb(n,5),indb(n,4),indb(n,7),indb(n,8),indb(n,9),
134 & ' rms ',rmsn(n),' %NC ',pncn(n)*100,
135 & chacc,iaccn,difmin,denep
139 c end of loop over all newly obtained conformations
141 if(nstatnx(i,1).ne.0) then
143 write(iout,'(a4,i1,a7,i4,a7,i4,a5,i4,a5,f5.1)')
144 & '## N',i,' total=',nstatnx(i,1),
145 & ' close=',nstatnx(i,2),' far=',nstatnx(i,3),
146 & ' %acc',(nstatnx(i,2)+nstatnx(i,3))*100.0/nstatnx(i,1)
148 write(iout,'(a3,i2,a7,i4,a7,i4,a5,i4,a5,f5.1)')
149 & '##N',i,' total=',nstatnx(i,1),
150 & ' close=',nstatnx(i,2),' far=',nstatnx(i,3),
151 & ' %acc',(nstatnx(i,2)+nstatnx(i,3))*100.0/nstatnx(i,1)
155 write(iout,'(a4,i1,a7,i4,a7,i4,a5,i4,a5,f5.1)')
156 & '## N',i,' total=',nstatnx(i,1),
157 & ' close=',nstatnx(i,2),' far=',nstatnx(i,3),
160 write(iout,'(a3,i2,a7,i4,a7,i4,a5,i4,a5,f5.1)')
161 & '##N',i,' total=',nstatnx(i,1),
162 & ' close=',nstatnx(i,2),' far=',nstatnx(i,3),
169 crc moved up, saves some get_diff12 calls
173 crc if(jbank(i1).eq.0.or.jbank(i2).eq.0) then
174 crc call get_diff12(bvar(1,1,1,i1),bvar(1,1,1,i2),diff)
187 c---------------------------------
188 subroutine replace_bvar(iold,inew)
189 implicit real*8 (a-h,o-z)
192 include 'COMMON.IOUNITS'
194 include 'COMMON.BANK'
195 include 'COMMON.CHAIN'
196 include 'COMMON.CONTROL'
197 include 'COMMON.SBRIDGE'
199 if (iold.gt.mxio .or. iold.lt.1 .or. inew.gt.mxio .or. inew.lt.1)
201 write (iout,*) 'Dimension ERROR in REPLACE_BVAR: IOLD',iold,
203 call mpi_abort(mpi_comm_world,ierror,ierrcode)
208 bvar(i,j,k,iold)=dihang(i,j,k,inew)
212 bene(iold)=etot(inew)
213 brmsn(iold)=rmsn(inew)
214 bpncn(iold)=pncn(inew)
216 if(bene(iold).lt.ebmin) then
222 bvar_nss(iold)=nss_out(inew)
223 cd write(iout,*) 'SS BANK',iold,bvar_nss(iold)
224 do i=1,bvar_nss(iold)
225 bvar_ss(1,i,iold)=iss_out(i,inew)
226 bvar_ss(2,i,iold)=jss_out(i,inew)
227 cd write(iout,*) 'SS',bvar_ss(1,i,iold)-nres,
228 cd & bvar_ss(2,i,iold)-nres
231 bvar_ns(iold)=ns-2*bvar_nss(iold)
232 cd write(iout,*) 'CYS #free ', bvar_ns(iold)
236 do while( iss(i).ne.iss_out(j,inew)-nres .and.
237 & iss(i).ne.jss_out(j,inew)-nres .and.
238 & j.le.nss_out(inew))
241 if (j.gt.nss_out(inew)) then
243 bvar_s(k,iold)=iss(i)
246 cd write(iout,*) 'CYS free',(bvar_s(k,iold),k=1,bvar_ns(iold))
251 c---------------------------------------
252 subroutine write_rbank(jlee,adif,nft)
253 implicit real*8 (a-h,o-z)
255 include 'COMMON.IOUNITS'
257 include 'COMMON.BANK'
258 include 'COMMON.CHAIN'
261 open(icsa_rbank,file=csa_rbank,status="unknown")
262 write (icsa_rbank,900) jlee,nbank,nstep,nft,icycle,adif
264 write (icsa_rbank,952) k,rene(k),rrmsn(k),rpncn(k)
267 write (icsa_rbank,850) (rad2deg*rvar(i,l,j,k),i=1,4)
274 900 format (1x,"jlee =",i3,3x,"nbank =",i4,3x,"nstep =",
276 952 format (1x,'#',i4,' total E ',1pe14.5,' rmsd from N ',0pf8.3
281 c---------------------------------------
282 subroutine read_rbank(jlee,adif)
283 implicit real*8 (a-h,o-z)
286 include 'COMMON.IOUNITS'
288 include 'COMMON.BANK'
289 include 'COMMON.CHAIN'
291 include 'COMMON.SETUP'
294 open(icsa_rbank,file=csa_rbank,status="old")
295 read (icsa_rbank,901) jleer,nbankr,nstepr,nftr,icycler,adif
296 print *,jleer,nbankr,nstepr,nftr,icycler,adif
297 c print *, 'adif from read_rbank ',adif
298 if(nbankr.ne.nbank) then
299 write (iout,*) 'ERROR in READ_BANK: NBANKR',nbankr,
301 call mpi_abort(mpi_comm_world,ierror,ierrcode)
303 if(jleer.ne.jlee) then
304 write (iout,*) 'ERROR in READ_BANK: JLEER',jleer,
306 call mpi_abort(mpi_comm_world,ierror,ierrcode)
311 read (icsa_rbank,'(a80)') karta
312 write(iout,*) "READ_RBANK: kk=",kk
314 c if (index(karta,"*").gt.0) then
315 c write (iout,*) "***** Stars in bankr ***** k=",k,
319 c read (30,850) (rdummy,i=1,4)
324 call reada(karta,"total E",rene(kk),1.0d20)
325 call reada(karta,"rmsd from N",rrmsn(kk),0.0d0)
326 call reada(karta,"%NC",rpncn(kk),0.0d0)
327 write(iout,*)"total E",bene(kk),"rmsd from N",brmsn(kk),
328 & "%NC",bpncn(kk),ibank(kk)
329 c read (icsa_rbank,953) kdummy,rene(kk),rrmsn(kk),rpncn(kk)
332 read (icsa_rbank,850) (rvar(i,l,j,kk),i=1,4)
333 c write (iout,850) (rvar(i,l,j,kk),i=1,4)
335 rvar(i,l,j,kk)=deg2rad*rvar(i,l,j,kk)
341 cd write (*,*) "read_rbank ******************* kk",kk,
343 if (kk.lt.nbankr) nbankr=kk
348 cd write (*,850) (rvar(i,l,j,kk),i=1,4)
355 901 format (1x,6x,i3,3x,7x,i4,3x,7x,i8,i10,i2,f15.5)
356 953 format (1x,1x,i4,9x,f12.3,13x,f8.3,5x,f5.2)
360 c---------------------------------------
361 subroutine write_bank(jlee,nft)
362 implicit real*8 (a-h,o-z)
364 include 'COMMON.IOUNITS'
366 include 'COMMON.BANK'
367 include 'COMMON.CHAIN'
369 include 'COMMON.SBRIDGE'
370 include 'COMMON.CONTROL'
375 open(icsa_bank,file=csa_bank,status="unknown")
376 write (icsa_bank,900) jlee,nbank,nstep,nft,icycle,cutdif
377 write (icsa_bank,902) nglob_csa, eglob_csa
378 open (igeom,file=intname,status='UNKNOWN')
380 write (icsa_bank,952) k,bene(k),brmsn(k),bpncn(k),ibank(k)
381 if (vdisulf) write (icsa_bank,'(101i4)')
382 & bvar_nss(k),((bvar_ss(j,i,k),j=1,2),i=1,bvar_nss(k))
385 write (icsa_bank,850) (rad2deg*bvar(i,l,j,k),i=1,4)
388 if (bvar_nss(k).le.9) then
389 write (igeom,'(I5,F10.3,I2,9(1X,2I3))') k,bene(k),
390 & bvar_nss(k),(bvar_ss(1,i,k),bvar_ss(2,i,k),i=1,bvar_nss(k))
392 write (igeom,'(I5,F10.3,I2,9(1X,2I3))') k,bene(k),
393 & bvar_nss(k),(bvar_ss(1,i,k),bvar_ss(2,i,k),i=1,9)
394 write (igeom,'(3X,11(1X,2I3))') (bvar_ss(1,i,k),
395 & bvar_ss(2,i,k),i=10,bvar_nss(k))
397 write (igeom,200) (rad2deg*bvar(1,i,1,k),i=2,nres-1)
398 write (igeom,200) (rad2deg*bvar(2,i,1,k),i=2,nres-2)
399 write (igeom,200) (rad2deg*bvar(3,i,1,k),i=2,nres-1)
400 write (igeom,200) (rad2deg*bvar(4,i,1,k),i=2,nres-1)
405 if (nstep/200.gt.ilastnstep) then
407 ilastnstep=(ilastnstep+1)*1.5
408 write(chfrm,'(a2,i1,a1)') '(i',int(dlog10(dble(nstep))+1),')'
409 write(chtmp,chfrm) nstep
410 open(icsa_int,file=prefix(:ilen(prefix))
411 & //'_'//chtmp(:ilen(chtmp))//'.int',status='UNKNOWN')
413 if (bvar_nss(k).le.9) then
414 write (icsa_int,'(I5,F10.3,I2,9(1X,2I3))') k,bene(k),
415 & bvar_nss(k),(bvar_ss(1,i,k),bvar_ss(2,i,k),i=1,bvar_nss(k))
417 write (icsa_int,'(I5,F10.3,I2,9(1X,2I3))') k,bene(k),
418 & bvar_nss(k),(bvar_ss(1,i,k),bvar_ss(2,i,k),i=1,9)
419 write (icsa_int,'(3X,11(1X,2I3))') (bvar_ss(1,i,k),
420 & bvar_ss(2,i,k),i=10,bvar_nss(k))
422 write (icsa_int,200) (rad2deg*bvar(1,i,1,k),i=2,nres-1)
423 write (icsa_int,200) (rad2deg*bvar(2,i,1,k),i=2,nres-2)
424 write (icsa_int,200) (rad2deg*bvar(3,i,1,k),i=2,nres-1)
425 write (icsa_int,200) (rad2deg*bvar(4,i,1,k),i=2,nres-1)
433 900 format (1x,"jlee =",i3,3x,"nbank =",i4,3x,"nstep =",
435 902 format (1x,'nglob_csa =',i4,' eglob_csa =',1pe14.5)
436 952 format (1x,'#',i4,' total E ',1pe14.5,' rmsd from N ',0pf8.3,
441 c---------------------------------------
442 subroutine write_bank_reminimized(jlee,nft)
443 implicit real*8 (a-h,o-z)
445 include 'COMMON.IOUNITS'
447 include 'COMMON.BANK'
448 include 'COMMON.CHAIN'
450 include 'COMMON.SBRIDGE'
452 open(icsa_bank_reminimized,file=csa_bank_reminimized,
454 write (icsa_bank_reminimized,900)
455 & jlee,nbank,nstep,nft,icycle,cutdif
456 open (igeom,file=intname,status='UNKNOWN')
458 write (icsa_bank_reminimized,952) k,bene(k),brmsn(k),
462 write (icsa_bank_reminimized,850) (rad2deg*bvar(i,l,j,k),i=1,4)
466 write (igeom,'(I5,F10.3,I2,9(1X,2I3))') k,bene(k),
467 & nss,(ihpb(i),jhpb(i),i=1,nss)
469 write (igeom,'(I5,F10.3,I2,9(1X,2I3))') k,bene(k),
470 & nss,(ihpb(i),jhpb(i),i=1,9)
471 write (igeom,'(3X,11(1X,2I3))') (ihpb(i),jhpb(i),i=10,nss)
473 write (igeom,200) (rad2deg*bvar(1,i,1,k),i=2,nres-1)
474 write (igeom,200) (rad2deg*bvar(2,i,1,k),i=2,nres-2)
475 write (igeom,200) (rad2deg*bvar(3,i,1,k),i=2,nres-1)
476 write (igeom,200) (rad2deg*bvar(4,i,1,k),i=2,nres-1)
478 close(icsa_bank_reminimized)
483 900 format (1x,"jlee =",i3,3x,"nbank =",i4,3x,"nstep =",
485 952 format (1x,'#',i4,' total E ',1pe14.5,' rmsd from N ',0pf8.3
486 & ,' %NC ',0pf5.2,i5)
490 c---------------------------------
491 subroutine read_bank(jlee,nft,cutdifr)
492 implicit real*8 (a-h,o-z)
494 include 'COMMON.IOUNITS'
496 include 'COMMON.BANK'
497 include 'COMMON.CHAIN'
499 include 'COMMON.CONTROL'
500 include 'COMMON.SBRIDGE'
505 open(icsa_bank,file=csa_bank,status="old")
506 read (icsa_bank,901) jlee,nbank,nstep,nft,icycle,cutdifr
507 read (icsa_bank,902) nglob_csa, eglob_csa
508 c if(jleer.ne.jlee) then
509 c write (iout,*) 'ERROR in READ_BANK: JLEER',jleer,
511 c call mpi_abort(mpi_comm_world,ierror,ierrcode)
516 read (icsa_bank,'(a80)') karta
517 write(iout,*) "READ_BANK: kk=",kk
519 c if (index(karta,"*").gt.0) then
520 c write (iout,*) "***** Stars in bank ***** k=",k,
524 c read (33,850) (rdummy,i=1,4)
529 call reada(karta,"total E",bene(kk),1.0d20)
530 call reada(karta,"rmsd from N",brmsn(kk),0.0d0)
531 call reada(karta,"%NC",bpncn(kk),0.0d0)
532 read (karta(ilen(karta)-1:),*,end=111,err=111) ibank(kk)
536 write(iout,*)"total E",bene(kk),"rmsd from N",brmsn(kk),
537 & "%NC",bpncn(kk),ibank(kk)
538 c read (icsa_bank,953) kdummy,bene(k),brmsn(k),bpncn(k),ibank(k)
540 read (icsa_bank,'(101i4)')
541 & bvar_nss(kk),((bvar_ss(j,i,kk),j=1,2),i=1,bvar_nss(kk))
542 bvar_ns(kk)=ns-2*bvar_nss(kk)
543 write(iout,*) 'read SSBOND',bvar_nss(kk),
544 & ((bvar_ss(j,i,kk),j=1,2),i=1,bvar_nss(kk))
545 cd write(iout,*) 'read CYS #free ', bvar_ns(kk)
549 do while( iss(i).ne.bvar_ss(1,j,kk)-nres .and.
550 & iss(i).ne.bvar_ss(2,j,kk)-nres .and.
554 if (j.gt.bvar_nss(kk)) then
559 cd write(iout,*)'read CYS free',(bvar_s(l,kk),l=1,bvar_ns(kk))
563 read (icsa_bank,850) (bvar(i,l,j,kk),i=1,4)
564 c write (iout,850) (bvar(i,l,j,kk),i=1,4)
566 bvar(i,l,j,kk)=deg2rad*bvar(i,l,j,kk)
573 if (kk.lt.nbank) nbank=kk
574 cd write (*,*) "read_bank ******************* kk",kk,
580 cd write (*,850) (bvar(i,l,j,kk),i=1,4)
586 c read (33,953) kdummy,bene(k),brmsn(k),bpncn(k),ibank(k)
589 c read (33,850) (bvar(i,l,j,k),i=1,4)
591 c bvar(i,l,j,k)=deg2rad*bvar(i,l,j,k)
599 952 format (1x,'#',i4,' total E ',f12.3,' rmsd from N ',f8.3,i5)
600 901 format (1x,6x,i3,3x,7x,i4,3x,7x,i8,i10,i2,f15.5)
601 902 format (1x,11x,i4,12x,1pe14.5)
602 953 format (1x,1x,i4,9x,f12.3,13x,f8.3,5x,f5.2,i5)
606 c---------------------------------------
607 subroutine write_bank1(jlee)
608 implicit real*8 (a-h,o-z)
610 include 'COMMON.IOUNITS'
612 include 'COMMON.BANK'
613 include 'COMMON.CHAIN'
616 #if defined(AIX) || defined(PGI)
617 open(icsa_bank1,file=csa_bank1,position="append")
619 open(icsa_bank1,file=csa_bank1,access="append")
621 write (icsa_bank1,900) jlee,nbank,nstep,cutdif
623 write (icsa_bank1,952) k,bene(k),brmsn(k),bpncn(k),ibank(k)
626 write (icsa_bank1,850) (rad2deg*bvar(i,l,j,k),i=1,4)
632 900 format (4x,"jlee =",i5,3x,"nbank =",i5,3x,"nstep =",i10,f15.5)
633 952 format (1x,'#',i4,' total E ',1pe14.5,' rmsd from N ',0pf8.3
634 & ,' %NC ',0pf5.2,i5)
638 c---------------------------------
639 subroutine save_is(ind)
640 implicit real*8 (a-h,o-z)
643 include 'COMMON.IOUNITS'
645 include 'COMMON.BANK'
646 include 'COMMON.CHAIN'
649 c print *, "nbank,ind,index,is(ind) ",nbank,ind,index,is(ind)
650 if (index.gt.mxio .or. index.lt.1 .or.
651 & is(ind).gt.mxio .or. is(ind).lt.1) then
652 write (iout,*) 'Dimension ERROR in SAVE_IS: INDEX',index,
653 & ' IND',ind,' IS',is(ind)
654 call mpi_abort(mpi_comm_world,ierror,ierrcode)
659 bvar(i,j,k,index)=bvar(i,j,k,is(ind))
663 bene(index)=bene(is(ind))
668 c---------------------------------
669 subroutine select_is(n,ifar,idum)
670 implicit real*8 (a-h,o-z)
673 include 'COMMON.BANK'
674 dimension itag(mxio),adiff(mxio)
678 if(ibank(i).eq.0) then
688 if(ibank(i).eq.2) then
695 call get_is(idum,ifar,n,imade,0)
696 ctest3 call get_is_max(idum,ifar,n,imade,0)
697 else if(iuse.eq.n) then
702 else if(iuse.lt.n) then
703 c if(icycle.eq.0) then
705 c ind=mod(i-1,iuse)+1
716 c call get_is_ran(idum,n,imade,1)
717 call get_is(idum,ifar,n,imade,1)
718 ctest3 call get_is_max(idum,ifar,n,imade,1)
719 c if(iusesv.le.n/10) then
723 c if(ibank(i).eq.2) then
725 if(ibank(i).ge.2) then
734 call get_is(idum,ifar,n,imade,0)
735 ctest3 call get_is_max(idum,ifar,n,imade,0)
741 c---------------------------------
742 subroutine get_is_ran(idum,n,imade,k)
743 implicit real*8 (a-h,o-z)
746 include 'COMMON.BANK'
748 dimension itag(mxio),adiff(mxio)
753 if(ibank(i).eq.k) then
758 iran=iuse* ran1(idum)+1
765 c---------------------------------
766 subroutine get_is(idum,ifar,n,imade,k)
767 implicit real*8 (a-h,o-z)
770 include 'COMMON.BANK'
772 dimension itag(mxio),adiff(mxio)
776 if(ibank(i).eq.k) then
781 iran=iuse* ran1(idum)+1
787 if(icycle.eq.-1) then
788 call select_iseed_max(i,k)
790 call select_iseed_min(i,k)
791 ctest4 call select_iseed_max(i,k)
797 call select_iseed_far(i,k)
803 c---------------------------------
804 subroutine select_iseed_max(imade1,ik)
805 implicit real*8 (a-h,o-z)
808 include 'COMMON.BANK'
809 dimension itag(mxio),adiff(mxio)
815 if(ibank(n).eq.ik) then
820 c call get_diff12(bvar(1,1,1,n),bvar(1,1,1,m),diff,idiff)
823 if(diff.lt.diffmn) diffmn=diff
825 if(diffmn.gt.difmax) difmax=diffmn
833 c avedif=(avedif+difmax)/2
836 if(adiff(i).ge.avedif) then
839 if(benei.gt.emax) then
846 if(ik.eq.0) iuse=iuse-1
850 c---------------------------------
851 subroutine select_iseed_min(imade1,ik)
852 implicit real*8 (a-h,o-z)
855 include 'COMMON.BANK'
856 dimension itag(mxio),adiff(mxio)
862 if(ibank(n).eq.ik) then
867 c call get_diff12(bvar(1,1,1,n),bvar(1,1,1,m),diff,idiff)
870 if(diff.lt.diffmn) diffmn=diff
872 if(diffmn.gt.difmax) difmax=diffmn
880 c avedif=(avedif+difmax)/2
883 c print *,"i, adiff(i),avedif : ",i,adiff(i),avedif
884 if(adiff(i).ge.avedif) then
887 c print *,"i, benei,emin : ",i,benei,emin
888 if(benei.lt.emin) then
895 if(ik.eq.0) iuse=iuse-1
897 c print *, "exiting select_iseed_min",is(imade1)
901 c---------------------------------
902 subroutine select_iseed_far(imade1,ik)
903 implicit real*8 (a-h,o-z)
906 include 'COMMON.BANK'
910 if(ibank(n).eq.ik) then
914 c call get_diff12(bvar(1,1,1,n),bvar(1,1,1,m),diff,idiff)
917 if(diff.lt.diffmn) diffmn=diff
920 if(diffmn.gt.dmax) then
928 c---------------------------------
930 implicit real*8 (a-h,o-z)
933 include 'COMMON.BANK'
939 if(benei.lt.ebmin) then
947 c---------------------------------
948 subroutine write_csa_pdb(var,ene,nft,ik,iw_pdb)
949 implicit real*8 (a-h,o-z)
952 include 'COMMON.BANK'
954 include 'COMMON.IOUNITS'
955 include 'COMMON.MINIM'
956 include 'COMMON.SETUP'
958 include 'COMMON.CHAIN'
959 include 'COMMON.LOCAL'
960 include 'COMMON.INTERACT'
961 include 'COMMON.NAMES'
962 include 'COMMON.SBRIDGE'
963 integer lenpre,lenpot,ilen
965 dimension var(maxvar)
966 character*50 titelloc
970 if(ene.lt.eglob_csa) then
972 nglob_csa=nglob_csa+1
973 call numstr(nglob_csa,zahl)
975 call var_to_geom(nvar,var)
977 call secondary2(.false.)
980 open(icsa_pdb,file=prefix(:lenpre)//'@'//zahl//'.pdb')
982 if (iw_pdb.eq.1) then
983 write(titelloc,'(a2,i3,a3,i9,a3,i6)')
984 & 'GM',nglob_csa,' e ',nft,' m ',nmin_csa
986 write(titelloc,'(a2,i3,a3,i9,a3,i6,a5,f5.2,a5,f5.1)')
987 & 'GM',nglob_csa,' e ',nft,' m ',nmin_csa,' rms '
988 & ,rmsn(ik),' %NC ',pncn(ik)*100
990 call pdbout(eglob_csa,titelloc,icsa_pdb)
996 c---------------------------------
998 implicit real*8 (a-h,o-z)
1000 include 'COMMON.CSA'
1001 include 'COMMON.BANK'
1007 if(benei.gt.ebmax) then
1015 c---------------------------------
1017 implicit real*8 (a-h,o-z)
1018 include 'DIMENSIONS'
1019 include 'COMMON.CSA'
1020 include 'COMMON.BANK'
1026 if(jbank(i1).eq.0.or.jbank(i2).eq.0) then
1027 call get_diff12(bvar(1,1,1,i1),bvar(1,1,1,i2),diff)
1034 if(diff.lt.difmin) difmin=diff
1043 avedif=tdiff/nbank/(nbank-1)*2
1047 c---------------------------------
1048 subroutine estimate_cutdif(adif,xct,cutdifr)
1049 implicit real*8 (a-h,o-z)
1050 include 'DIMENSIONS'
1051 include 'COMMON.CSA'
1052 include 'COMMON.BANK'
1056 exponent = cutdifr*cut1/adif
1057 exponent = dlog(exponent)/dlog(xct)
1060 cutdif= adif/cut1*xct**nexp
1061 if(cutdif.lt.ctdif1) cutdif=ctdif1
1065 c---------------------------------
1066 subroutine get_is_max(idum,ifar,n,imade,k)
1067 implicit real*8 (a-h,o-z)
1068 include 'DIMENSIONS'
1069 include 'COMMON.CSA'
1070 include 'COMMON.BANK'
1071 double precision emax
1076 if(ibank(j).eq.k .and. bene(j).gt.emax) then