1 subroutine enecalc(islice,*)
4 include "DIMENSIONS.ZSCOPT"
5 include "DIMENSIONS.FREE"
8 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
11 include "COMMON.CHAIN"
12 include "COMMON.IOUNITS"
13 include "COMMON.PROTFILES"
14 include "COMMON.NAMES"
16 include "COMMON.SBRIDGE"
18 include "COMMON.FFIELD"
19 include "COMMON.ENEPS"
20 include "COMMON.LOCAL"
21 include "COMMON.WEIGHTS"
22 include "COMMON.INTERACT"
24 include "COMMON.ENERGIES"
25 include "COMMON.CONTROL"
26 include "COMMON.TORCNSTR"
30 double precision qwolynes
32 integer errmsg_count,maxerrmsg_count /100/
33 double precision rmsnat,gyrate
34 external rmsnat,gyrate
35 double precision tole /1.0d-1/
36 integer i,itj,ii,iii,j,k,l,licz,itmp
37 integer ir,ib,ipar,iparm
39 real*4 csingle(3,maxres2)
40 double precision energ
44 double precision energia(0:max_ene),rmsdev,efree,eini
45 double precision fT(6),quot,quotl,kfacl,kfac /2.4d0/,T0 /3.0d2/
47 integer snk_p(MaxR,MaxT_h,Max_parm)
49 character*64 bprotfile_temp
50 call opentmp(islice,ientout,bprotfile_temp)
54 write (iout,*) "enecalc: nparmset ",nparmset
63 do i=indstart(me1),indend(me1)
74 read(ientout,rec=i,err=101)
75 & ((csingle(l,k),l=1,3),k=1,nres),
76 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
77 & nss,(ihpb(k),jhpb(k),k=1,nss),
78 & eini,efree,rmsdev,(q(j,iii+1),j=1,nQ),iR,ib,ipar
87 c(l,k+nres)=csingle(l,k+nres)
90 anatemp= 1.0d0/(beta_h(ib,ipar)*1.987D-3)
91 q(nQ+1,iii+1)=rmsnat(iii+1)
93 q(nQ+2,iii+1)=gyrate(iii+1)
94 c fT=T0*beta_h(ib,ipar)*1.987D-3
95 c ft=2.0d0/(1.0d0+1.0d0/(T0*beta_h(ib,ipar)*1.987D-3))
96 if (rescale_mode.eq.1) then
97 quot=1.0d0/(T0*beta_h(ib,ipar)*1.987D-3)
99 tt = 1.0d0/(beta_h(ib,ipar)*1.987D-3)
100 ft(6)=(320.0+80.0*dtanh((tt-320.0)/80.0))/320.0
111 fT(l)=kfacl/(kfacl-1.0d0+quotl)
113 else if (rescale_mode.eq.2) then
114 quot=1.0d0/(T0*beta_h(ib,ipar)*1.987D-3)
116 tt = 1.0d0/(beta_h(ib,ipar)*1.987D-3)
117 ft(6)=(320.0+80.0*dtanh((tt-320.0)/80.0))/320.0
126 fT(l)=1.12692801104297249644d0/
127 & dlog(dexp(quotl)+dexp(-quotl))
129 else if (rescale_mode.eq.0) then
134 write (iout,*) "Error in ECECALC: wrong RESCALE_MODE",
140 c write (iout,*) "T",1.0d0/(beta_h(ib,ipar)*1.987D-3)," T0",T0,
141 c & " kfac",kfac,"quot",quot," fT",fT
147 call int_from_cart1(.false.)
151 call restore_parm(iparm)
153 write (iout,*) wsc,wscp,welec,wvdwpp,wang,wtor,wscloc,
154 & wcorr,wcorr5,wcorr6,wturn4,wturn3,wturn6,wel_loc,
155 & wtor_d,wsccor,wbond
157 call etotal(energia(0),fT)
159 write (iout,*) "Conformation",i
160 c write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
161 c write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
162 call enerprint(energia(0),fT)
163 c write (iout,'(2i5,21f8.2)') i,iparm,(energia(k),k=1,21)
164 c write (iout,*) "ftors",ftors
168 c call briefout(i,energia(0))
171 c temp=1.0d0/(beta_h(ib,ipar)*1.987D-3)
172 c write (iout,*) "temp", temp
175 call pdbout(i,temp,energia(0),energia(0),0.0d0,0.0d0)
178 if (energia(0).ge.1.0d20) then
179 write (iout,*) "NaNs detected in some of the energy",
180 & " components for conformation",ii+1
181 write (iout,*) "The Cartesian geometry is:"
182 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
183 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
184 write (iout,*) "The internal geometry is:"
186 c call pdbout(ii+1,beta_h(ib,ipar),efree,energia(0),0.0d0,rmsdev)
187 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
188 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
189 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
190 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
191 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
192 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
193 write (iout,*) "The components of the energy are:"
194 call enerprint(energia(0),fT)
196 & "This conformation WILL NOT be added to the database."
201 if (ipar.eq.iparm) write (iout,*) i,iparm,
202 & 1.0d0/(beta_h(ib,ipar)*1.987D-3),eini,energia(0)
204 if (ipar.eq.iparm .and. einicheck.gt.0 .and.
205 & dabs(eini-energia(0)).gt.tole) then
206 if (errmsg_count.le.maxerrmsg_count) then
207 write (iout,'(2a,2e15.5,a,2i8,a,f8.1)')
208 & "Warning: energy differs remarkably from ",
209 & " the value read in: ",energia(0),eini," point",
210 & iii+1,indstart(me1)+iii," T",
211 & 1.0d0/(1.987D-3*beta_h(ib,ipar))
216 call pdbout(indstart(me1)+iii,
217 & 1.0d0/(1.987D-3*beta_h(ib,ipar)),
218 &energia(0),eini,0.0d0,0.0d0)
220 call enerprint(energia(0),fT)
222 errmsg_count=errmsg_count+1
223 if (errmsg_count.gt.maxerrmsg_count)
224 & write (iout,*) "Too many warning messages"
225 if (einicheck.gt.1) then
226 write (iout,*) "Calculation stopped."
229 call MPI_Abort(WHAM_COMM,IERROR,ERRCODE)
236 potE(iii+1,iparm)=energia(0)
238 enetb(k,iii+1,iparm)=energia(k)
241 write (iout,'(2i5,f10.1,3e15.5)') i,iii,
242 & 1.0d0/(beta_h(ib,ipar)*1.987D-3),energia(0),eini,efree
243 c call enerprint(energia(0),fT)
246 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
247 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
248 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
249 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
250 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
251 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
252 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
253 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
254 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
255 write (iout,'(8f10.5)') (q(k,iii+1),k=1,nQ)
256 write (iout,'(f10.5,i10)') rmsdev,iscor
257 call enerprint(energia(0),fT)
258 call pdbout(ii+1,beta_h(ib,ipar),efree,energia(0),0.0d0,rmsdev)
265 if (q(1,iii).le.0.0d0 .and. indpdb.gt.0) q(1,iii)=qwolynes(0,0)
266 write (ientout,rec=iii)
267 & ((csingle(l,k),l=1,3),k=1,nres),
268 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
269 & nss,(ihpb(k),jhpb(k),k=1,nss),
270 & potE(iii,ipar),efree,rmsdev,(q(k,iii),k=1,nQ),iR,ib,ipar
271 c write (iout,'(2i5,2e15.5)') ii,iii,potE(iii,ipar),efree
273 if (separate_parset) then
274 snk_p(iR,ib,1)=snk_p(iR,ib,1)+1
276 snk_p(iR,ib,ipar)=snk_p(iR,ib,ipar)+1
278 c write (iout,*) "iii",iii," iR",iR," ib",ib," ipar",ipar,
279 c & " snk",snk_p(iR,ib,ipar)
281 snk(iR,ib,ipar,islice)=snk(iR,ib,ipar,islice)+1
287 write (iout,*) "Me",me," scount",scount(me)
289 c Master gathers updated numbers of conformations written by all procs.
290 call MPI_AllGather( scount(me), 1, MPI_INTEGER, scount(0), 1,
291 & MPI_INTEGER, WHAM_COMM, IERROR)
295 indstart(i)=indend(i-1)+1
296 indend(i)=indstart(i)+scount(i)-1
299 write (iout,*) "Revised conformation counts"
301 write (iout,'(a,i5,a,i7,a,i7,a,i7)')
302 & "Processor",i," indstart",indstart(i),
303 & " indend",indend(i)," count",scount(i)
306 call MPI_AllReduce(snk_p(1,1,1),snk(1,1,1,islice),
307 & MaxR*MaxT_h*nParmSet,
308 & MPI_INTEGER,MPI_SUM,WHAM_COMM,IERROR)
314 stot(islice)=stot(islice)+snk(i,ib,iparm,islice)
318 write (iout,*) "Revised SNK"
321 write (iout,'("Param",i3," Temp",f6.1,3x,32i8)')
322 & iparm,1.0d0/(1.987D-3*beta_h(ib,iparm)),
323 & (snk(i,ib,iparm,islice),i=1,nR(ib,iparm))
324 write (iout,*) "snk_p",(snk_p(i,ib,iparm),i=1,nR(ib,iparm))
327 write (iout,'("Total",i10)') stot(islice)
330 101 write (iout,*) "Error in scratchfile."
334 c------------------------------------------------------------------------------
335 subroutine write_dbase(islice,*)
338 include "DIMENSIONS.ZSCOPT"
339 include "DIMENSIONS.FREE"
340 include "DIMENSIONS.COMPAR"
343 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
346 include "COMMON.CONTROL"
347 include "COMMON.CHAIN"
348 include "COMMON.IOUNITS"
349 include "COMMON.PROTFILES"
350 include "COMMON.NAMES"
352 include "COMMON.SBRIDGE"
354 include "COMMON.FFIELD"
355 include "COMMON.ENEPS"
356 include "COMMON.LOCAL"
357 include "COMMON.WEIGHTS"
358 include "COMMON.INTERACT"
359 include "COMMON.FREE"
360 include "COMMON.ENERGIES"
361 include "COMMON.COMPAR"
362 include "COMMON.PROT"
363 include "COMMON.CONTACTS1"
365 character*80 bxname,cxname
366 character*64 bprotfile_temp
367 character*3 liczba,licz
369 integer i,itj,ii,iii,j,k,l
372 double precision rmsdev,efree,eini
373 real*4 csingle(3,maxres2)
374 double precision energ
378 integer isecstr(maxres)
379 write (licz2,'(bz,i2.2)') islice
380 call opentmp(islice,ientout,bprotfile_temp)
381 write (iout,*) "bprotfile_temp ",bprotfile_temp
383 if (.not.bxfile .and. .not. cxfile .and. indpdb.eq.0
384 & .and. ensembles.eq.0) then
385 close(ientout,status="delete")
389 write (liczba,'(bz,i3.3)') me
390 if (bxfile .or. cxfile .or. ensembles.gt.0) then
391 if (.not.separate_parset) then
392 bxname = prefix(:ilen(prefix))//liczba//".bx"
394 write (licz,'(bz,i3.3)') myparm
395 bxname = prefix(:ilen(prefix))//liczba//"_par"//licz//".bx"
397 open (ientin,file=bxname,status="unknown",
398 & form="unformatted",access="direct",recl=lenrec1)
401 if (bxfile .or. cxfile .or. ensembles.gt.0) then
402 if (nslice.eq.1) then
403 bxname = prefix(:ilen(prefix))//".bx"
405 bxname = prefix(:ilen(prefix))//
406 & "_slice_"//licz2//".bx"
408 open (ientin,file=bxname,status="unknown",
409 & form="unformatted",access="direct",recl=lenrec1)
410 write (iout,*) "Calculating energies; writing geometry",
411 & " and energy components to ",bxname(:ilen(bxname))
413 #if (defined(AIX) && !defined(JUBL))
414 call xdrfopen_(ixdrf,cxname, "w", iret)
416 call xdrfopen(ixdrf,cxname, "w", iret)
419 write (iout,*) "Error opening cxfile ",cxname(:ilen(cxname))
424 if (indpdb.gt.0) then
425 if (nslice.eq.1) then
427 if (.not.separate_parset) then
428 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))
431 write (licz,'(bz,i3.3)') myparm
432 statname=prefix(:ilen(prefix))//'_par'//licz//'_'//
433 & pot(:ilen(pot))//liczba//'.stat'
437 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//'.stat'
441 if (.not.separate_parset) then
442 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//
443 & "_slice_"//licz2//liczba//'.stat'
445 write (licz,'(bz,i3.3)') myparm
446 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//
447 & '_par'//licz//"_slice_"//licz2//liczba//'.stat'
450 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))
451 & //"_slice_"//licz2//'.stat'
454 open(istat,file=statname,status="unknown")
462 read(ientout,rec=i,err=101)
463 & ((csingle(l,k),l=1,3),k=1,nres),
464 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
465 & nss,(ihpb(k),jhpb(k),k=1,nss),
466 & eini,efree,rmsdev,(q(k,i),k=1,nQ),iR,ib,iparm
467 c write (iout,*) iR,ib,iparm,eini,efree
473 call int_from_cart1(.false.)
475 c write (iout,*) "Calling conf_compar",i
477 anatemp= 1.0d0/(beta_h(ib,iparm)*1.987D-3)
478 if (indpdb.gt.0) then
479 call conf_compar(i,.false.,.true.)
481 c call elecont(.false.,ncont,icont,nnt,nct)
482 c call secondary2(.false.,.false.,ncont,icont,isecstr)
484 c write (iout,*) "Exit conf_compar",i
486 if (bxfile .or.cxfile .or. ensembles.gt.0) write (ientin,rec=i)
487 & ((csingle(l,k),l=1,3),k=1,nres),
488 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
489 & nss,(ihpb(k),jhpb(k),k=1,nss),
490 c & potE(i,iparm),-entfac(i),rms_nat,iscore
491 & potE(i,nparmset),-entfac(i),rms_nat,iscore
492 c write (iout,'(2i5,3e15.5)') i,me,potE(i,iparm),-entfac(i)
494 if (cxfile) call cxwrite(ixdrf,csingle,potE(i,nparmset),
495 & -entfac(i),rms_nat,iscore)
498 close(ientout,status="delete")
500 if (bxfile .or. cxfile .or. ensembles.gt.0) close(ientin)
502 call MPI_Barrier(WHAM_COMM,IERROR)
503 if (me.ne.Master .or. .not.bxfile .and. .not. cxfile
504 & .and. ensembles.eq.0) return
506 if (bxfile .or. ensembles.gt.0) then
507 if (nslice.eq.1) then
508 if (.not.separate_parset) then
509 bxname = prefix(:ilen(prefix))//".bx"
511 write (licz,'(bz,i3.3)') myparm
512 bxname = prefix(:ilen(prefix))//"_par"//licz//".bx"
515 if (.not.separate_parset) then
516 bxname = prefix(:ilen(prefix))//"_slice_"//licz2//".bx"
518 write (licz,'(bz,i3.3)') myparm
519 bxname = prefix(:ilen(prefix))//"par_"//licz//
520 & "_slice_"//licz2//".bx"
523 open (ientout,file=bxname,status="unknown",
524 & form="unformatted",access="direct",recl=lenrec1)
525 write (iout,*) "Master is creating binary database ",
526 & bxname(:ilen(bxname))
529 if (nslice.eq.1) then
530 if (.not.separate_parset) then
531 cxname = prefix(:ilen(prefix))//".cx"
533 cxname = prefix(:ilen(prefix))//"_par"//licz//".cx"
536 if (.not.separate_parset) then
537 cxname = prefix(:ilen(prefix))//
538 & "_slice_"//licz2//".cx"
540 cxname = prefix(:ilen(prefix))//"_par"//licz//
541 & "_slice_"//licz2//".cx"
544 #if (defined(AIX) && !defined(JUBL))
545 call xdrfopen_(ixdrf,cxname, "w", iret)
547 call xdrfopen(ixdrf,cxname, "w", iret)
550 write (iout,*) "Error opening cxfile ",cxname(:ilen(cxname))
555 write (liczba,'(bz,i3.3)') j
556 if (separate_parset) then
557 write (licz,'(bz,i3.3)') myparm
558 bxname = prefix(:ilen(prefix))//liczba//"_par"//licz//".bx"
560 bxname = prefix(:ilen(prefix))//liczba//".bx"
562 open (ientin,file=bxname,status="unknown",
563 & form="unformatted",access="direct",recl=lenrec1)
564 write (iout,*) "Master is reading conformations from ",
565 & bxname(:ilen(bxname))
567 c write (iout,*) "j",j," indstart",indstart(j)," indend",indend(j)
569 do i=indstart(j),indend(j)
571 read(ientin,rec=iii,err=101)
572 & ((csingle(l,k),l=1,3),k=1,nres),
573 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
574 & nss,(ihpb(k),jhpb(k),k=1,nss),
575 & eini,efree,rmsdev,iscor
576 if (bxfile .or. ensembles.gt.0) then
577 write (ientout,rec=i)
578 & ((csingle(l,k),l=1,3),k=1,nres),
579 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
580 & nss,(ihpb(k),jhpb(k),k=1,nss),
581 & eini,efree,rmsdev,iscor
583 if(cxfile)call cxwrite(ixdrf,csingle,eini,efree,rmsdev,iscor)
590 call int_from_cart1(.false.)
591 write (iout,'(2i5,3e15.5)') i,iii,eini,efree
592 write (iout,*) "The Cartesian geometry is:"
593 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
594 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
595 write (iout,*) "The internal geometry is:"
596 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
597 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
598 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
599 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
600 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
601 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
602 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
603 write (iout,'(f10.5,i5)') rmsdev,iscor
606 write (iout,*) iii," conformations (from",indstart(j)," to",
607 & indend(j),") read from ",
608 & bxname(:ilen(bxname))
609 close (ientin,status="delete")
611 if (bxfile .or. cxfile .or. ensembles.gt.0) close (ientout)
612 #if (defined(AIX) && !defined(JUBL))
613 if (cxfile) call xdrfclose_(ixdrf,cxname,iret)
615 if (cxfile) call xdrfclose(ixdrf,cxname,iret)
619 101 write (iout,*) "Error in scratchfile."
623 c-------------------------------------------------------------------------------
624 subroutine cxwrite(ixdrf,csingle,eini,efree,rmsdev,iscor)
627 include "DIMENSIONS.ZSCOPT"
628 include "DIMENSIONS.FREE"
629 include "DIMENSIONS.COMPAR"
632 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
635 include "COMMON.CONTROL"
636 include "COMMON.CHAIN"
637 include "COMMON.IOUNITS"
638 include "COMMON.PROTFILES"
639 include "COMMON.NAMES"
641 include "COMMON.SBRIDGE"
643 include "COMMON.FFIELD"
644 include "COMMON.ENEPS"
645 include "COMMON.LOCAL"
646 include "COMMON.WEIGHTS"
647 include "COMMON.INTERACT"
648 include "COMMON.FREE"
649 include "COMMON.ENERGIES"
650 include "COMMON.COMPAR"
651 include "COMMON.PROT"
652 integer i,j,itmp,iscor,iret,ixdrf
653 double precision rmsdev,efree,eini
654 real*4 csingle(3,maxres2),xoord(3,maxres2+2)
657 c write (iout,*) "cxwrite"
662 xoord(j,i)=csingle(j,i)
667 xoord(j,nres+i-nnt+1)=csingle(j,i+nres)
673 c write (iout,*) "itmp",itmp
675 #if (defined(AIX) && !defined(JUBL))
676 call xdrf3dfcoord_(ixdrf, xoord, itmp, prec, iret)
678 c write (iout,*) "xdrf3dfcoord"
680 call xdrfint_(ixdrf, nss, iret)
682 call xdrfint_(ixdrf, ihpb(j), iret)
683 call xdrfint_(ixdrf, jhpb(j), iret)
685 call xdrffloat_(ixdrf,real(eini),iret)
686 call xdrffloat_(ixdrf,real(efree),iret)
687 call xdrffloat_(ixdrf,real(rmsdev),iret)
688 call xdrfint_(ixdrf,iscor,iret)
690 call xdrf3dfcoord(ixdrf, xoord, itmp, prec, iret)
692 call xdrfint(ixdrf, nss, iret)
694 call xdrfint(ixdrf, ihpb(j), iret)
695 call xdrfint(ixdrf, jhpb(j), iret)
697 call xdrffloat(ixdrf,real(eini),iret)
698 call xdrffloat(ixdrf,real(efree),iret)
699 call xdrffloat(ixdrf,real(rmsdev),iret)
700 call xdrfint(ixdrf,iscor,iret)
705 c------------------------------------------------------------------------------
706 logical function conf_check(ii,iprint)
709 include "DIMENSIONS.ZSCOPT"
710 include "DIMENSIONS.FREE"
713 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
716 include "COMMON.CHAIN"
717 include "COMMON.IOUNITS"
718 include "COMMON.PROTFILES"
719 include "COMMON.NAMES"
721 include "COMMON.SBRIDGE"
723 include "COMMON.FFIELD"
724 include "COMMON.ENEPS"
725 include "COMMON.LOCAL"
726 include "COMMON.WEIGHTS"
727 include "COMMON.INTERACT"
728 include "COMMON.FREE"
729 include "COMMON.ENERGIES"
730 include "COMMON.CONTROL"
731 include "COMMON.TORCNSTR"
732 integer j,k,l,ii,itj,iprint
733 if (.not.check_conf) then
737 call int_from_cart1(.false.)
739 if (itype(j-1).ne.ntyp1 .and. itype(j).ne.ntyp1 .and.
740 & (vbld(j).lt.2.0d0 .or. vbld(j).gt.5.0d0)) then
742 & write (iout,*) "Bad CA-CA bond length",j," ",vbld(j),
743 & " for conformation",ii
744 if (iprint.gt.1) then
745 write (iout,*) "The Cartesian geometry is:"
746 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
747 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
748 write (iout,*) "The internal geometry is:"
749 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
750 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
751 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
752 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
753 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
754 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
756 if (iprint.gt.0) write (iout,*)
757 & "This conformation WILL NOT be added to the database."
764 if (itype(j).ne.10 .and.itype(j).ne.ntyp1 .and.
765 & (vbld(nres+j)-dsc(iabs(itj))).gt.2.0d0) then
767 & write (iout,*) "Bad CA-SC bond length",j," ",vbld(nres+j),
768 & " for conformation",ii
769 if (iprint.gt.1) then
770 write (iout,*) "The Cartesian geometry is:"
771 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
772 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
773 write (iout,*) "The internal geometry is:"
774 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
775 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
776 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
777 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
778 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
779 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
781 if (iprint.gt.0) write (iout,*)
782 & "This conformation WILL NOT be added to the database."
788 if (theta(j).le.0.0d0) then
790 & write (iout,*) "Zero theta angle(s) in conformation",ii
791 if (iprint.gt.1) then
792 write (iout,*) "The Cartesian geometry is:"
793 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
794 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
795 write (iout,*) "The internal geometry is:"
796 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
797 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
798 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
799 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
800 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
801 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
803 if (iprint.gt.0) write (iout,*)
804 & "This conformation WILL NOT be added to the database."
808 if (theta(j).gt.179.97*deg2rad) theta(j)=179.97*deg2rad
811 c write (iout,*) "conf_check passed",ii