1 cc---------------------------------
2 subroutine refresh_bank(ntrial)
3 implicit real*8 (a-h,o-z)
8 include 'COMMON.IOUNITS'
11 include 'COMMON.CONTROL'
14 double precision l_diff(mxio),denep
18 nstatnx_tot(i,j)=nstatnx_tot(i,j)+nstatnx(i,j)
23 c loop over all newly obtained conformations
27 nstatnx(movernx(n),1)=nstatnx(movernx(n),1)+1
28 cccccccccccccccccccccccccccccccccccccccccccc
31 if(rmsn(n).gt.rmscut.or.pncn(n).lt.pnccut) goto 100
34 if(etot(n).gt.ebmax) goto 100
35 c Find the conformation closest to the conformation n in the bank
38 call get_diff12(dihang(1,1,1,n),bvar(1,1,1,m),l_diff(m))
39 if(l_diff(m).lt.difmin) then
45 if(difmin.lt.cutdif) then
46 c n is redundant to idmin
47 if(etot(n).lt.bene(idmin)) then
48 if(etot(n).lt.bene(idmin)-0.01d0) then
52 denep=bene(idmin)-etot(n)
53 call replace_bvar(idmin,n)
57 dij(i1,idmin)=l_diff(i1)
58 dij(idmin,i1)=l_diff(i1)
63 nstatnx(movernx(n),2)=nstatnx(movernx(n),2)+1
64 if(idmin.eq.ibmax) call find_max
67 c got new conformation
69 if(ebmax-ebmin.gt.del_ene) then
71 call replace_bvar(ibmax,n)
75 dij(i1,ibmax)=l_diff(i1)
76 dij(ibmax,i1)=l_diff(i1)
81 nstatnx(movernx(n),3)=nstatnx(movernx(n),3)+1
86 if(del_ene.lt.0.0001) then
87 write (iout,*) 'ERROR in refresh_bank: '
88 write (iout,*) 'ebmax: ',ebmax
89 write (iout,*) 'ebmin: ',ebmin
90 write (iout,*) 'del_ene: ',del_ene
91 crc call mpi_abort(mpi_comm_world,ierror,ierrcode)
93 cjp nbmax is never defined so condition below is always false
94 c if(nbank.lt.nbmax) then
96 c call replace_bvar(nbank,n)
100 call replace_bvar(ibmax,n)
107 cccccccccccccccccccccccccccccccccccccccccccc
111 write(iout,'(i3,a3,i4,i5,a6,1pe12.4,a4,i3,i4,3i5)')
112 & indb(n,2),' e ',indb(n,3),indb(n,1),' etot ',etot(n),' mv ',
113 & indb(n,5),indb(n,4),indb(n,7),indb(n,8),indb(n,9)
115 write(iout,'(i3,a3,i4,i5,a6,1pe12.4,a4,i3,i4,3i5
116 & ,a5,0pf4.1,a5,f3.0)')
117 & indb(n,2),' e ',indb(n,3),indb(n,1),' etot ',etot(n),' mv ',
118 & indb(n,5),indb(n,4),indb(n,7),indb(n,8),indb(n,9),
119 & ' rms ',rmsn(n),' %NC ',pncn(n)*100
123 write(iout,'(i3,a3,i4,i5,a6,1pe12.4,a4,i3,i4,3i5,
124 & 1x,a1,i4,0pf8.1,0pf8.1)')
125 & indb(n,2),' e ',indb(n,3),indb(n,1),' etot ',etot(n),' mv ',
126 & indb(n,5),indb(n,4),indb(n,7),indb(n,8),indb(n,9),
127 & chacc,iaccn,difmin,denep
129 write(iout,'(i3,a3,i4,i5,a6,1pe12.4,a4,i3,i4,3i5,a5,
130 & 0pf4.1,a5,f3.0,1x,a1,i4,0pf8.1,0pf8.1)')
131 & indb(n,2),' e ',indb(n,3),indb(n,1),' etot ',etot(n),' mv ',
132 & indb(n,5),indb(n,4),indb(n,7),indb(n,8),indb(n,9),
133 & ' rms ',rmsn(n),' %NC ',pncn(n)*100,
134 & chacc,iaccn,difmin,denep
138 c end of loop over all newly obtained conformations
140 if(nstatnx(i,1).ne.0) then
142 write(iout,'(a4,i1,a7,i4,a7,i4,a5,i4,a5,f5.1)')
143 & '## N',i,' total=',nstatnx(i,1),
144 & ' close=',nstatnx(i,2),' far=',nstatnx(i,3),
145 & ' %acc',(nstatnx(i,2)+nstatnx(i,3))*100.0/nstatnx(i,1)
147 write(iout,'(a3,i2,a7,i4,a7,i4,a5,i4,a5,f5.1)')
148 & '##N',i,' total=',nstatnx(i,1),
149 & ' close=',nstatnx(i,2),' far=',nstatnx(i,3),
150 & ' %acc',(nstatnx(i,2)+nstatnx(i,3))*100.0/nstatnx(i,1)
154 write(iout,'(a4,i1,a7,i4,a7,i4,a5,i4,a5,f5.1)')
155 & '## N',i,' total=',nstatnx(i,1),
156 & ' close=',nstatnx(i,2),' far=',nstatnx(i,3),
159 write(iout,'(a3,i2,a7,i4,a7,i4,a5,i4,a5,f5.1)')
160 & '##N',i,' total=',nstatnx(i,1),
161 & ' close=',nstatnx(i,2),' far=',nstatnx(i,3),
168 crc moved up, saves some get_diff12 calls
172 crc if(jbank(i1).eq.0.or.jbank(i2).eq.0) then
173 crc call get_diff12(bvar(1,1,1,i1),bvar(1,1,1,i2),diff)
186 c---------------------------------
187 subroutine replace_bvar(iold,inew)
188 implicit real*8 (a-h,o-z)
191 include 'COMMON.IOUNITS'
193 include 'COMMON.BANK'
194 include 'COMMON.CHAIN'
195 include 'COMMON.CONTROL'
196 include 'COMMON.SBRIDGE'
198 if (iold.gt.mxio .or. iold.lt.1 .or. inew.gt.mxio .or. inew.lt.1)
200 write (iout,*) 'Dimension ERROR in REPLACE_BVAR: IOLD',iold,
202 call mpi_abort(mpi_comm_world,ierror,ierrcode)
207 bvar(i,j,k,iold)=dihang(i,j,k,inew)
211 bene(iold)=etot(inew)
212 brmsn(iold)=rmsn(inew)
213 bpncn(iold)=pncn(inew)
215 if(bene(iold).lt.ebmin) then
221 bvar_nss(iold)=nss_out(inew)
222 cd write(iout,*) 'SS BANK',iold,bvar_nss(iold)
223 do i=1,bvar_nss(iold)
224 bvar_ss(1,i,iold)=iss_out(i,inew)
225 bvar_ss(2,i,iold)=jss_out(i,inew)
226 cd write(iout,*) 'SS',bvar_ss(1,i,iold)-nres,
227 cd & bvar_ss(2,i,iold)-nres
230 bvar_ns(iold)=ns-2*bvar_nss(iold)
231 cd write(iout,*) 'CYS #free ', bvar_ns(iold)
235 do while( iss(i).ne.iss_out(j,inew)-nres .and.
236 & iss(i).ne.jss_out(j,inew)-nres .and.
237 & j.le.nss_out(inew))
240 if (j.gt.nss_out(inew)) then
242 bvar_s(k,iold)=iss(i)
245 cd write(iout,*) 'CYS free',(bvar_s(k,iold),k=1,bvar_ns(iold))
250 c---------------------------------------
251 subroutine write_rbank(jlee,adif,nft)
252 implicit real*8 (a-h,o-z)
254 include 'COMMON.IOUNITS'
256 include 'COMMON.BANK'
257 include 'COMMON.CHAIN'
260 open(icsa_rbank,file=csa_rbank,status="unknown")
261 write (icsa_rbank,900) jlee,nbank,nstep,nft,icycle,adif
263 write (icsa_rbank,952) k,rene(k),rrmsn(k),rpncn(k)
266 write (icsa_rbank,850) (rad2deg*rvar(i,l,j,k),i=1,4)
273 900 format (1x,"jlee =",i3,3x,"nbank =",i4,3x,"nstep =",
275 952 format (1x,'#',i4,' total E ',1pe14.5,' rmsd from N ',0pf8.3
280 c---------------------------------------
281 subroutine read_rbank(jlee,adif)
282 implicit real*8 (a-h,o-z)
285 include 'COMMON.IOUNITS'
287 include 'COMMON.BANK'
288 include 'COMMON.CHAIN'
290 include 'COMMON.SETUP'
293 open(icsa_rbank,file=csa_rbank,status="old")
294 read (icsa_rbank,901) jleer,nbankr,nstepr,nftr,icycler,adif
295 print *,jleer,nbankr,nstepr,nftr,icycler,adif
296 c print *, 'adif from read_rbank ',adif
297 if(nbankr.ne.nbank) then
298 write (iout,*) 'ERROR in READ_BANK: NBANKR',nbankr,
300 call mpi_abort(mpi_comm_world,ierror,ierrcode)
302 if(jleer.ne.jlee) then
303 write (iout,*) 'ERROR in READ_BANK: JLEER',jleer,
305 call mpi_abort(mpi_comm_world,ierror,ierrcode)
310 read (icsa_rbank,'(a80)') karta
311 write(iout,*) "READ_RBANK: kk=",kk
313 c if (index(karta,"*").gt.0) then
314 c write (iout,*) "***** Stars in bankr ***** k=",k,
318 c read (30,850) (rdummy,i=1,4)
323 call reada(karta,"total E",rene(kk),1.0d20)
324 call reada(karta,"rmsd from N",rrmsn(kk),0.0d0)
325 call reada(karta,"%NC",rpncn(kk),0.0d0)
326 write(iout,*)"total E",bene(kk),"rmsd from N",brmsn(kk),
327 & "%NC",bpncn(kk),ibank(kk)
328 c read (icsa_rbank,953) kdummy,rene(kk),rrmsn(kk),rpncn(kk)
331 read (icsa_rbank,850) (rvar(i,l,j,kk),i=1,4)
332 c write (iout,850) (rvar(i,l,j,kk),i=1,4)
334 rvar(i,l,j,kk)=deg2rad*rvar(i,l,j,kk)
340 cd write (*,*) "read_rbank ******************* kk",kk,
342 if (kk.lt.nbankr) nbankr=kk
347 cd write (*,850) (rvar(i,l,j,kk),i=1,4)
354 901 format (1x,6x,i3,3x,7x,i4,3x,7x,i8,i10,i2,f15.5)
355 953 format (1x,1x,i4,9x,f12.3,13x,f8.3,5x,f5.2)
359 c---------------------------------------
360 subroutine write_bank(jlee,nft)
361 implicit real*8 (a-h,o-z)
363 include 'COMMON.IOUNITS'
365 include 'COMMON.BANK'
366 include 'COMMON.CHAIN'
368 include 'COMMON.SBRIDGE'
369 include 'COMMON.CONTROL'
374 open(icsa_bank,file=csa_bank,status="unknown")
375 write (icsa_bank,900) jlee,nbank,nstep,nft,icycle,cutdif
376 write (icsa_bank,902) nglob_csa, eglob_csa
377 open (igeom,file=intname,status='UNKNOWN')
379 write (icsa_bank,952) k,bene(k),brmsn(k),bpncn(k),ibank(k)
380 if (vdisulf) write (icsa_bank,'(101i4)')
381 & bvar_nss(k),((bvar_ss(j,i,k),j=1,2),i=1,bvar_nss(k))
384 write (icsa_bank,850) (rad2deg*bvar(i,l,j,k),i=1,4)
387 if (bvar_nss(k).le.9) then
388 write (igeom,'(I5,F10.3,I2,9(1X,2I3))') k,bene(k),
389 & bvar_nss(k),(bvar_ss(1,i,k),bvar_ss(2,i,k),i=1,bvar_nss(k))
391 write (igeom,'(I5,F10.3,I2,9(1X,2I3))') k,bene(k),
392 & bvar_nss(k),(bvar_ss(1,i,k),bvar_ss(2,i,k),i=1,9)
393 write (igeom,'(3X,11(1X,2I3))') (bvar_ss(1,i,k),
394 & bvar_ss(2,i,k),i=10,bvar_nss(k))
396 write (igeom,200) (rad2deg*bvar(1,i,1,k),i=2,nres-1)
397 write (igeom,200) (rad2deg*bvar(2,i,1,k),i=2,nres-2)
398 write (igeom,200) (rad2deg*bvar(3,i,1,k),i=2,nres-1)
399 write (igeom,200) (rad2deg*bvar(4,i,1,k),i=2,nres-1)
404 if (nstep/200.gt.ilastnstep) then
406 ilastnstep=(ilastnstep+1)*1.5
407 write(chfrm,'(a2,i1,a1)') '(i',int(dlog10(dble(nstep))+1),')'
408 write(chtmp,chfrm) nstep
409 open(icsa_int,file=prefix(:ilen(prefix))
410 & //'_'//chtmp(:ilen(chtmp))//'.int',status='UNKNOWN')
412 if (bvar_nss(k).le.9) then
413 write (icsa_int,'(I5,F10.3,I2,9(1X,2I3))') k,bene(k),
414 & bvar_nss(k),(bvar_ss(1,i,k),bvar_ss(2,i,k),i=1,bvar_nss(k))
416 write (icsa_int,'(I5,F10.3,I2,9(1X,2I3))') k,bene(k),
417 & bvar_nss(k),(bvar_ss(1,i,k),bvar_ss(2,i,k),i=1,9)
418 write (icsa_int,'(3X,11(1X,2I3))') (bvar_ss(1,i,k),
419 & bvar_ss(2,i,k),i=10,bvar_nss(k))
421 write (icsa_int,200) (rad2deg*bvar(1,i,1,k),i=2,nres-1)
422 write (icsa_int,200) (rad2deg*bvar(2,i,1,k),i=2,nres-2)
423 write (icsa_int,200) (rad2deg*bvar(3,i,1,k),i=2,nres-1)
424 write (icsa_int,200) (rad2deg*bvar(4,i,1,k),i=2,nres-1)
432 900 format (1x,"jlee =",i3,3x,"nbank =",i4,3x,"nstep =",
434 902 format (1x,'nglob_csa =',i4,' eglob_csa =',1pe14.5)
435 952 format (1x,'#',i4,' total E ',1pe14.5,' rmsd from N ',0pf8.3,
440 c---------------------------------------
441 subroutine write_bank_reminimized(jlee,nft)
442 implicit real*8 (a-h,o-z)
444 include 'COMMON.IOUNITS'
446 include 'COMMON.BANK'
447 include 'COMMON.CHAIN'
449 include 'COMMON.SBRIDGE'
451 open(icsa_bank_reminimized,file=csa_bank_reminimized,
453 write (icsa_bank_reminimized,900)
454 & jlee,nbank,nstep,nft,icycle,cutdif
455 open (igeom,file=intname,status='UNKNOWN')
457 write (icsa_bank_reminimized,952) k,bene(k),brmsn(k),
461 write (icsa_bank_reminimized,850) (rad2deg*bvar(i,l,j,k),i=1,4)
465 write (igeom,'(I5,F10.3,I2,9(1X,2I3))') k,bene(k),
466 & nss,(ihpb(i),jhpb(i),i=1,nss)
468 write (igeom,'(I5,F10.3,I2,9(1X,2I3))') k,bene(k),
469 & nss,(ihpb(i),jhpb(i),i=1,9)
470 write (igeom,'(3X,11(1X,2I3))') (ihpb(i),jhpb(i),i=10,nss)
472 write (igeom,200) (rad2deg*bvar(1,i,1,k),i=2,nres-1)
473 write (igeom,200) (rad2deg*bvar(2,i,1,k),i=2,nres-2)
474 write (igeom,200) (rad2deg*bvar(3,i,1,k),i=2,nres-1)
475 write (igeom,200) (rad2deg*bvar(4,i,1,k),i=2,nres-1)
477 close(icsa_bank_reminimized)
482 900 format (1x,"jlee =",i3,3x,"nbank =",i4,3x,"nstep =",
484 952 format (1x,'#',i4,' total E ',1pe14.5,' rmsd from N ',0pf8.3
485 & ,' %NC ',0pf5.2,i5)
489 c---------------------------------
490 subroutine read_bank(jlee,nft,cutdifr)
491 implicit real*8 (a-h,o-z)
493 include 'COMMON.IOUNITS'
495 include 'COMMON.BANK'
496 include 'COMMON.CHAIN'
498 include 'COMMON.CONTROL'
499 include 'COMMON.SBRIDGE'
504 open(icsa_bank,file=csa_bank,status="old")
505 read (icsa_bank,901) jlee,nbank,nstep,nft,icycle,cutdifr
506 read (icsa_bank,902) nglob_csa, eglob_csa
507 c if(jleer.ne.jlee) then
508 c write (iout,*) 'ERROR in READ_BANK: JLEER',jleer,
510 c call mpi_abort(mpi_comm_world,ierror,ierrcode)
515 read (icsa_bank,'(a80)') karta
516 write(iout,*) "READ_BANK: kk=",kk
518 c if (index(karta,"*").gt.0) then
519 c write (iout,*) "***** Stars in bank ***** k=",k,
523 c read (33,850) (rdummy,i=1,4)
528 call reada(karta,"total E",bene(kk),1.0d20)
529 call reada(karta,"rmsd from N",brmsn(kk),0.0d0)
530 call reada(karta,"%NC",bpncn(kk),0.0d0)
531 read (karta(ilen(karta)-1:),*,end=111,err=111) ibank(kk)
535 write(iout,*)"total E",bene(kk),"rmsd from N",brmsn(kk),
536 & "%NC",bpncn(kk),ibank(kk)
537 c read (icsa_bank,953) kdummy,bene(k),brmsn(k),bpncn(k),ibank(k)
539 read (icsa_bank,'(101i4)')
540 & bvar_nss(kk),((bvar_ss(j,i,kk),j=1,2),i=1,bvar_nss(kk))
541 bvar_ns(kk)=ns-2*bvar_nss(kk)
542 write(iout,*) 'read SSBOND',bvar_nss(kk),
543 & ((bvar_ss(j,i,kk),j=1,2),i=1,bvar_nss(kk))
544 cd write(iout,*) 'read CYS #free ', bvar_ns(kk)
548 do while( iss(i).ne.bvar_ss(1,j,kk)-nres .and.
549 & iss(i).ne.bvar_ss(2,j,kk)-nres .and.
553 if (j.gt.bvar_nss(kk)) then
558 cd write(iout,*)'read CYS free',(bvar_s(l,kk),l=1,bvar_ns(kk))
562 read (icsa_bank,850) (bvar(i,l,j,kk),i=1,4)
563 c write (iout,850) (bvar(i,l,j,kk),i=1,4)
565 bvar(i,l,j,kk)=deg2rad*bvar(i,l,j,kk)
572 if (kk.lt.nbank) nbank=kk
573 cd write (*,*) "read_bank ******************* kk",kk,
579 cd write (*,850) (bvar(i,l,j,kk),i=1,4)
585 c read (33,953) kdummy,bene(k),brmsn(k),bpncn(k),ibank(k)
588 c read (33,850) (bvar(i,l,j,k),i=1,4)
590 c bvar(i,l,j,k)=deg2rad*bvar(i,l,j,k)
598 952 format (1x,'#',i4,' total E ',f12.3,' rmsd from N ',f8.3,i5)
599 901 format (1x,6x,i3,3x,7x,i4,3x,7x,i8,i10,i2,f15.5)
600 902 format (1x,11x,i4,12x,1pe14.5)
601 953 format (1x,1x,i4,9x,f12.3,13x,f8.3,5x,f5.2,i5)
605 c---------------------------------------
606 subroutine write_bank1(jlee)
607 implicit real*8 (a-h,o-z)
609 include 'COMMON.IOUNITS'
611 include 'COMMON.BANK'
612 include 'COMMON.CHAIN'
615 #if defined(AIX) || defined(PGI)
616 open(icsa_bank1,file=csa_bank1,position="append")
618 open(icsa_bank1,file=csa_bank1,access="append")
620 write (icsa_bank1,900) jlee,nbank,nstep,cutdif
622 write (icsa_bank1,952) k,bene(k),brmsn(k),bpncn(k),ibank(k)
625 write (icsa_bank1,850) (rad2deg*bvar(i,l,j,k),i=1,4)
631 900 format (4x,"jlee =",i5,3x,"nbank =",i5,3x,"nstep =",i10,f15.5)
632 952 format (1x,'#',i4,' total E ',1pe14.5,' rmsd from N ',0pf8.3
633 & ,' %NC ',0pf5.2,i5)
637 c---------------------------------
638 subroutine save_is(ind)
639 implicit real*8 (a-h,o-z)
642 include 'COMMON.IOUNITS'
644 include 'COMMON.BANK'
645 include 'COMMON.CHAIN'
648 c print *, "nbank,ind,index,is(ind) ",nbank,ind,index,is(ind)
649 if (index.gt.mxio .or. index.lt.1 .or.
650 & is(ind).gt.mxio .or. is(ind).lt.1) then
651 write (iout,*) 'Dimension ERROR in SAVE_IS: INDEX',index,
652 & ' IND',ind,' IS',is(ind)
653 call mpi_abort(mpi_comm_world,ierror,ierrcode)
658 bvar(i,j,k,index)=bvar(i,j,k,is(ind))
662 bene(index)=bene(is(ind))
667 c---------------------------------
668 subroutine select_is(n,ifar,idum)
669 implicit real*8 (a-h,o-z)
672 include 'COMMON.BANK'
673 dimension itag(mxio),adiff(mxio)
677 if(ibank(i).eq.0) then
687 if(ibank(i).eq.2) then
694 call get_is(idum,ifar,n,imade,0)
695 ctest3 call get_is_max(idum,ifar,n,imade,0)
696 else if(iuse.eq.n) then
701 else if(iuse.lt.n) then
702 c if(icycle.eq.0) then
704 c ind=mod(i-1,iuse)+1
715 c call get_is_ran(idum,n,imade,1)
716 call get_is(idum,ifar,n,imade,1)
717 ctest3 call get_is_max(idum,ifar,n,imade,1)
718 c if(iusesv.le.n/10) then
722 c if(ibank(i).eq.2) then
724 if(ibank(i).ge.2) then
733 call get_is(idum,ifar,n,imade,0)
734 ctest3 call get_is_max(idum,ifar,n,imade,0)
740 c---------------------------------
741 subroutine get_is_ran(idum,n,imade,k)
742 implicit real*8 (a-h,o-z)
745 include 'COMMON.BANK'
747 dimension itag(mxio),adiff(mxio)
752 if(ibank(i).eq.k) then
757 iran=iuse* ran1(idum)+1
764 c---------------------------------
765 subroutine get_is(idum,ifar,n,imade,k)
766 implicit real*8 (a-h,o-z)
769 include 'COMMON.BANK'
771 dimension itag(mxio),adiff(mxio)
775 if(ibank(i).eq.k) then
780 iran=iuse* ran1(idum)+1
786 if(icycle.eq.-1) then
787 call select_iseed_max(i,k)
789 call select_iseed_min(i,k)
790 ctest4 call select_iseed_max(i,k)
796 call select_iseed_far(i,k)
802 c---------------------------------
803 subroutine select_iseed_max(imade1,ik)
804 implicit real*8 (a-h,o-z)
807 include 'COMMON.BANK'
808 dimension itag(mxio),adiff(mxio)
814 if(ibank(n).eq.ik) then
819 c call get_diff12(bvar(1,1,1,n),bvar(1,1,1,m),diff,idiff)
822 if(diff.lt.diffmn) diffmn=diff
824 if(diffmn.gt.difmax) difmax=diffmn
832 c avedif=(avedif+difmax)/2
835 if(adiff(i).ge.avedif) then
838 if(benei.gt.emax) then
845 if(ik.eq.0) iuse=iuse-1
849 c---------------------------------
850 subroutine select_iseed_min(imade1,ik)
851 implicit real*8 (a-h,o-z)
854 include 'COMMON.BANK'
855 dimension itag(mxio),adiff(mxio)
861 if(ibank(n).eq.ik) then
866 c call get_diff12(bvar(1,1,1,n),bvar(1,1,1,m),diff,idiff)
869 if(diff.lt.diffmn) diffmn=diff
871 if(diffmn.gt.difmax) difmax=diffmn
879 c avedif=(avedif+difmax)/2
882 c print *,"i, adiff(i),avedif : ",i,adiff(i),avedif
883 if(adiff(i).ge.avedif) then
886 c print *,"i, benei,emin : ",i,benei,emin
887 if(benei.lt.emin) then
894 if(ik.eq.0) iuse=iuse-1
896 c print *, "exiting select_iseed_min",is(imade1)
900 c---------------------------------
901 subroutine select_iseed_far(imade1,ik)
902 implicit real*8 (a-h,o-z)
905 include 'COMMON.BANK'
909 if(ibank(n).eq.ik) then
913 c call get_diff12(bvar(1,1,1,n),bvar(1,1,1,m),diff,idiff)
916 if(diff.lt.diffmn) diffmn=diff
919 if(diffmn.gt.dmax) then
927 c---------------------------------
929 implicit real*8 (a-h,o-z)
932 include 'COMMON.BANK'
938 if(benei.lt.ebmin) then
946 c---------------------------------
947 subroutine write_csa_pdb(var,ene,nft,ik,iw_pdb)
948 implicit real*8 (a-h,o-z)
951 include 'COMMON.BANK'
953 include 'COMMON.IOUNITS'
954 include 'COMMON.MINIM'
955 include 'COMMON.SETUP'
957 include 'COMMON.CHAIN'
958 include 'COMMON.LOCAL'
959 include 'COMMON.INTERACT'
960 include 'COMMON.NAMES'
961 include 'COMMON.SBRIDGE'
962 integer lenpre,lenpot,ilen
964 dimension var(maxvar)
965 character*50 titelloc
969 if(ene.lt.eglob_csa) then
971 nglob_csa=nglob_csa+1
972 call numstr(nglob_csa,zahl)
974 call var_to_geom(nvar,var)
976 call secondary2(.false.)
979 open(icsa_pdb,file=prefix(:lenpre)//'@'//zahl//'.pdb')
981 if (iw_pdb.eq.1) then
982 write(titelloc,'(a2,i3,a3,i9,a3,i6)')
983 & 'GM',nglob_csa,' e ',nft,' m ',nmin_csa
985 write(titelloc,'(a2,i3,a3,i9,a3,i6,a5,f5.2,a5,f5.1)')
986 & 'GM',nglob_csa,' e ',nft,' m ',nmin_csa,' rms '
987 & ,rmsn(ik),' %NC ',pncn(ik)*100
989 call pdbout(eglob_csa,titelloc,icsa_pdb)
995 c---------------------------------
997 implicit real*8 (a-h,o-z)
1000 include 'COMMON.BANK'
1006 if(benei.gt.ebmax) then
1014 c---------------------------------
1016 implicit real*8 (a-h,o-z)
1017 include 'DIMENSIONS'
1018 include 'COMMON.CSA'
1019 include 'COMMON.BANK'
1025 if(jbank(i1).eq.0.or.jbank(i2).eq.0) then
1026 call get_diff12(bvar(1,1,1,i1),bvar(1,1,1,i2),diff)
1033 if(diff.lt.difmin) difmin=diff
1042 avedif=tdiff/nbank/(nbank-1)*2
1046 c---------------------------------
1047 subroutine estimate_cutdif(adif,xct,cutdifr)
1048 implicit real*8 (a-h,o-z)
1049 include 'DIMENSIONS'
1050 include 'COMMON.CSA'
1051 include 'COMMON.BANK'
1055 exponent = cutdifr*cut1/adif
1056 exponent = dlog(exponent)/dlog(xct)
1059 cutdif= adif/cut1*xct**nexp
1060 if(cutdif.lt.ctdif1) cutdif=ctdif1
1064 c---------------------------------
1065 subroutine get_is_max(idum,ifar,n,imade,k)
1066 implicit real*8 (a-h,o-z)
1067 include 'DIMENSIONS'
1068 include 'COMMON.CSA'
1069 include 'COMMON.BANK'
1070 double precision emax
1075 if(ibank(j).eq.k .and. bene(j).gt.emax) then