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
37 integer ir,ib,ipar,iparm
39 real*4 csingle(3,maxres2)
40 double precision energ
43 double precision energia(0:max_ene),rmsdev,efree,eini
44 double precision fT(6),quot,quotl,kfacl,kfac /2.4d0/,T0 /3.0d2/
46 integer snk_p(MaxR,MaxT_h,Max_parm)
48 character*64 bprotfile_temp
49 call opentmp(islice,ientout,bprotfile_temp)
53 write (iout,*) "enecalc: nparmset ",nparmset
62 do i=indstart(me1),indend(me1)
73 read(ientout,rec=i,err=101)
74 & ((csingle(l,k),l=1,3),k=1,nres),
75 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
76 & nss,(ihpb(k),jhpb(k),k=1,nss),
77 & eini,efree,rmsdev,(q(j,iii+1),j=1,nQ),iR,ib,ipar
86 c(l,k+nres)=csingle(l,k+nres)
89 q(nQ+1,iii+1)=rmsnat(iii+1)
91 q(nQ+2,iii+1)=gyrate(iii+1)
92 c fT=T0*beta_h(ib,ipar)*1.987D-3
93 c ft=2.0d0/(1.0d0+1.0d0/(T0*beta_h(ib,ipar)*1.987D-3))
94 if (rescale_mode.eq.1) then
95 quot=1.0d0/(T0*beta_h(ib,ipar)*1.987D-3)
97 tt = 1.0d0/(beta_h(ib,ipar)*1.987D-3)
98 ft(6)=(320.0+80.0*dtanh((tt-320.0)/80.0))/320.0
109 fT(l)=kfacl/(kfacl-1.0d0+quotl)
111 else if (rescale_mode.eq.2) then
112 quot=1.0d0/(T0*beta_h(ib,ipar)*1.987D-3)
114 tt = 1.0d0/(beta_h(ib,ipar)*1.987D-3)
115 ft(6)=(320.0+80.0*dtanh((tt-320.0)/80.0))/320.0
124 fT(l)=1.12692801104297249644d0/
125 & dlog(dexp(quotl)+dexp(-quotl))
127 else if (rescale_mode.eq.0) then
132 write (iout,*) "Error in ECECALC: wrong RESCALE_MODE",
138 c write (iout,*) "T",1.0d0/(beta_h(ib,ipar)*1.987D-3)," T0",T0,
139 c & " kfac",kfac,"quot",quot," fT",fT
145 call int_from_cart1(.false.)
149 call restore_parm(iparm)
151 write (iout,*) wsc,wscp,welec,wvdwpp,wang,wtor,wscloc,
152 & wcorr,wcorr5,wcorr6,wturn4,wturn3,wturn6,wel_loc,
153 & wtor_d,wsccor,wbond
155 call etotal(energia(0),fT)
157 write (iout,*) "Conformation",i
158 call enerprint(energia(0),fT)
159 c write (iout,'(2i5,21f8.2)') i,iparm,(energia(k),k=1,21)
160 c write (iout,*) "ftors",ftors
163 if (energia(0).ge.1.0d20) then
164 write (iout,*) "NaNs detected in some of the energy",
165 & " components for conformation",ii+1
166 write (iout,*) "The Cartesian geometry is:"
167 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
168 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
169 write (iout,*) "The internal geometry is:"
171 c call pdbout(ii+1,beta_h(ib,ipar),efree,energia(0),0.0d0,rmsdev)
172 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
173 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
174 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
175 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
176 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
177 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
178 write (iout,*) "The components of the energy are:"
179 call enerprint(energia(0),fT)
181 & "This conformation WILL NOT be added to the database."
186 if (ipar.eq.iparm) write (iout,*) i,iparm,
187 & 1.0d0/(beta_h(ib,ipar)*1.987D-3),eini,energia(0)
189 if (ipar.eq.iparm .and. einicheck.gt.0 .and.
190 & dabs(eini-energia(0)).gt.tole) then
191 if (errmsg_count.le.maxerrmsg_count) then
192 write (iout,'(2a,2e15.5,a,2i8,a,f8.1)')
193 & "Warning: energy differs remarkably from ",
194 & " the value read in: ",energia(0),eini," point",
195 & iii+1,indstart(me1)+iii," T",
196 & 1.0d0/(1.987D-3*beta_h(ib,ipar))
197 errmsg_count=errmsg_count+1
198 if (errmsg_count.gt.maxerrmsg_count)
199 & write (iout,*) "Too many warning messages"
200 if (einicheck.gt.1) then
201 write (iout,*) "Calculation stopped."
204 call MPI_Abort(WHAM_COMM,IERROR,ERRCODE)
211 potE(iii+1,iparm)=energia(0)
213 enetb(k,iii+1,iparm)=energia(k)
216 write (iout,'(2i5,f10.1,3e15.5)') i,iii,
217 & 1.0d0/(beta_h(ib,ipar)*1.987D-3),energia(0),eini,efree
218 c call enerprint(energia(0),fT)
221 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
222 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
223 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
224 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
225 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
226 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
227 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
228 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
229 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
230 write (iout,'(8f10.5)') (q(k,iii+1),k=1,nQ)
231 write (iout,'(f10.5,i10)') rmsdev,iscor
232 call enerprint(energia(0),fT)
233 call pdbout(ii+1,beta_h(ib,ipar),efree,energia(0),0.0d0,rmsdev)
240 if (q(1,iii).le.0.0d0 .and. indpdb.gt.0) q(1,iii)=qwolynes(0,0)
241 write (ientout,rec=iii)
242 & ((csingle(l,k),l=1,3),k=1,nres),
243 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
244 & nss,(ihpb(k),jhpb(k),k=1,nss),
245 & potE(iii,ipar),efree,rmsdev,(q(k,iii),k=1,nQ),iR,ib,ipar
246 c write (iout,'(2i5,2e15.5)') ii,iii,potE(iii,ipar),efree
248 if (separate_parset) then
249 snk_p(iR,ib,1)=snk_p(iR,ib,1)+1
251 snk_p(iR,ib,ipar)=snk_p(iR,ib,ipar)+1
253 c write (iout,*) "iii",iii," iR",iR," ib",ib," ipar",ipar,
254 c & " snk",snk_p(iR,ib,ipar)
256 snk(iR,ib,ipar,islice)=snk(iR,ib,ipar,islice)+1
262 write (iout,*) "Me",me," scount",scount(me)
264 c Master gathers updated numbers of conformations written by all procs.
265 call MPI_AllGather( scount(me), 1, MPI_INTEGER, scount(0), 1,
266 & MPI_INTEGER, WHAM_COMM, IERROR)
270 indstart(i)=indend(i-1)+1
271 indend(i)=indstart(i)+scount(i)-1
274 write (iout,*) "Revised conformation counts"
276 write (iout,'(a,i5,a,i7,a,i7,a,i7)')
277 & "Processor",i," indstart",indstart(i),
278 & " indend",indend(i)," count",scount(i)
281 call MPI_AllReduce(snk_p(1,1,1),snk(1,1,1,islice),
282 & MaxR*MaxT_h*nParmSet,
283 & MPI_INTEGER,MPI_SUM,WHAM_COMM,IERROR)
289 stot(islice)=stot(islice)+snk(i,ib,iparm,islice)
293 write (iout,*) "Revised SNK"
296 write (iout,'("Param",i3," Temp",f6.1,3x,32i8)')
297 & iparm,1.0d0/(1.987D-3*beta_h(ib,iparm)),
298 & (snk(i,ib,iparm,islice),i=1,nR(ib,iparm))
299 write (iout,*) "snk_p",(snk_p(i,ib,iparm),i=1,nR(ib,iparm))
302 write (iout,'("Total",i10)') stot(islice)
305 101 write (iout,*) "Error in scratchfile."
309 c------------------------------------------------------------------------------
310 subroutine write_dbase(islice,*)
313 include "DIMENSIONS.ZSCOPT"
314 include "DIMENSIONS.FREE"
315 include "DIMENSIONS.COMPAR"
318 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
321 include "COMMON.CONTROL"
322 include "COMMON.CHAIN"
323 include "COMMON.IOUNITS"
324 include "COMMON.PROTFILES"
325 include "COMMON.NAMES"
327 include "COMMON.SBRIDGE"
329 include "COMMON.FFIELD"
330 include "COMMON.ENEPS"
331 include "COMMON.LOCAL"
332 include "COMMON.WEIGHTS"
333 include "COMMON.INTERACT"
334 include "COMMON.FREE"
335 include "COMMON.ENERGIES"
336 include "COMMON.COMPAR"
337 include "COMMON.PROT"
339 character*80 bxname,cxname
340 character*64 bprotfile_temp
341 character*3 liczba,licz
343 integer i,itj,ii,iii,j,k,l
346 double precision rmsdev,efree,eini
347 real*4 csingle(3,maxres2)
348 double precision energ
352 write (licz2,'(bz,i2.2)') islice
353 call opentmp(islice,ientout,bprotfile_temp)
354 write (iout,*) "bprotfile_temp ",bprotfile_temp
356 if (.not.bxfile .and. .not. cxfile .and. indpdb.eq.0
357 & .and. ensembles.eq.0) then
358 close(ientout,status="delete")
362 write (liczba,'(bz,i3.3)') me
363 if (bxfile .or. cxfile .or. ensembles.gt.0) then
364 if (.not.separate_parset) then
365 bxname = prefix(:ilen(prefix))//liczba//".bx"
367 write (licz,'(bz,i3.3)') myparm
368 bxname = prefix(:ilen(prefix))//liczba//"_par"//licz//".bx"
370 open (ientin,file=bxname,status="unknown",
371 & form="unformatted",access="direct",recl=lenrec1)
374 if (bxfile .or. cxfile .or. ensembles.gt.0) then
375 if (nslice.eq.1) then
376 bxname = prefix(:ilen(prefix))//".bx"
378 bxname = prefix(:ilen(prefix))//
379 & "_slice_"//licz2//".bx"
381 open (ientin,file=bxname,status="unknown",
382 & form="unformatted",access="direct",recl=lenrec1)
383 write (iout,*) "Calculating energies; writing geometry",
384 & " and energy components to ",bxname(:ilen(bxname))
386 #if (defined(AIX) && !defined(JUBL))
387 call xdrfopen_(ixdrf,cxname, "w", iret)
389 call xdrfopen(ixdrf,cxname, "w", iret)
392 write (iout,*) "Error opening cxfile ",cxname(:ilen(cxname))
397 if (indpdb.gt.0) then
398 if (nslice.eq.1) then
400 if (.not.separate_parset) then
401 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))
404 write (licz,'(bz,i3.3)') myparm
405 statname=prefix(:ilen(prefix))//'_par'//licz//'_'//
406 & pot(:ilen(pot))//liczba//'.stat'
410 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//'.stat'
414 if (.not.separate_parset) then
415 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//
416 & "_slice_"//licz2//liczba//'.stat'
418 write (licz,'(bz,i3.3)') myparm
419 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//
420 & '_par'//licz//"_slice_"//licz2//liczba//'.stat'
423 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))
424 & //"_slice_"//licz2//'.stat'
427 open(istat,file=statname,status="unknown")
435 read(ientout,rec=i,err=101)
436 & ((csingle(l,k),l=1,3),k=1,nres),
437 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
438 & nss,(ihpb(k),jhpb(k),k=1,nss),
439 & eini,efree,rmsdev,(q(k,i),k=1,nQ),iR,ib,iparm
440 c write (iout,*) iR,ib,iparm,eini,efree
446 call int_from_cart1(.false.)
448 if (indpdb.gt.0) then
449 call conf_compar(i,.false.,.true.)
451 if (bxfile .or.cxfile .or. ensembles.gt.0) write (ientin,rec=i)
452 & ((csingle(l,k),l=1,3),k=1,nres),
453 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
454 & nss,(ihpb(k),jhpb(k),k=1,nss),
455 c & potE(i,iparm),-entfac(i),rms_nat,iscore
456 & potE(i,nparmset),-entfac(i),rms_nat,iscore
457 c write (iout,'(2i5,3e15.5)') i,me,potE(i,iparm),-entfac(i)
459 if (cxfile) call cxwrite(ixdrf,csingle,potE(i,nparmset),
460 & -entfac(i),rms_nat,iscore)
463 close(ientout,status="delete")
465 if (bxfile .or. cxfile .or. ensembles.gt.0) close(ientin)
467 call MPI_Barrier(WHAM_COMM,IERROR)
468 if (me.ne.Master .or. .not.bxfile .and. .not. cxfile
469 & .and. ensembles.eq.0) return
471 if (bxfile .or. ensembles.gt.0) then
472 if (nslice.eq.1) then
473 if (.not.separate_parset) then
474 bxname = prefix(:ilen(prefix))//".bx"
476 write (licz,'(bz,i3.3)') myparm
477 bxname = prefix(:ilen(prefix))//"_par"//licz//".bx"
480 if (.not.separate_parset) then
481 bxname = prefix(:ilen(prefix))//"_slice_"//licz2//".bx"
483 write (licz,'(bz,i3.3)') myparm
484 bxname = prefix(:ilen(prefix))//"par_"//licz//
485 & "_slice_"//licz2//".bx"
488 open (ientout,file=bxname,status="unknown",
489 & form="unformatted",access="direct",recl=lenrec1)
490 write (iout,*) "Master is creating binary database ",
491 & bxname(:ilen(bxname))
494 if (nslice.eq.1) then
495 if (.not.separate_parset) then
496 cxname = prefix(:ilen(prefix))//".cx"
498 cxname = prefix(:ilen(prefix))//"_par"//licz//".cx"
501 if (.not.separate_parset) then
502 cxname = prefix(:ilen(prefix))//
503 & "_slice_"//licz2//".cx"
505 cxname = prefix(:ilen(prefix))//"_par"//licz//
506 & "_slice_"//licz2//".cx"
509 #if (defined(AIX) && !defined(JUBL))
510 call xdrfopen_(ixdrf,cxname, "w", iret)
512 call xdrfopen(ixdrf,cxname, "w", iret)
515 write (iout,*) "Error opening cxfile ",cxname(:ilen(cxname))
520 write (liczba,'(bz,i3.3)') j
521 if (separate_parset) then
522 write (licz,'(bz,i3.3)') myparm
523 bxname = prefix(:ilen(prefix))//liczba//"_par"//licz//".bx"
525 bxname = prefix(:ilen(prefix))//liczba//".bx"
527 open (ientin,file=bxname,status="unknown",
528 & form="unformatted",access="direct",recl=lenrec1)
529 write (iout,*) "Master is reading conformations from ",
530 & bxname(:ilen(bxname))
532 c write (iout,*) "j",j," indstart",indstart(j)," indend",indend(j)
534 do i=indstart(j),indend(j)
536 read(ientin,rec=iii,err=101)
537 & ((csingle(l,k),l=1,3),k=1,nres),
538 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
539 & nss,(ihpb(k),jhpb(k),k=1,nss),
540 & eini,efree,rmsdev,iscor
541 if (bxfile .or. ensembles.gt.0) then
542 write (ientout,rec=i)
543 & ((csingle(l,k),l=1,3),k=1,nres),
544 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
545 & nss,(ihpb(k),jhpb(k),k=1,nss),
546 & eini,efree,rmsdev,iscor
548 if(cxfile)call cxwrite(ixdrf,csingle,eini,efree,rmsdev,iscor)
555 call int_from_cart1(.false.)
556 write (iout,'(2i5,3e15.5)') i,iii,eini,efree
557 write (iout,*) "The Cartesian geometry is:"
558 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
559 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
560 write (iout,*) "The internal geometry is:"
561 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
562 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
563 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
564 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
565 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
566 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
567 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
568 write (iout,'(f10.5,i5)') rmsdev,iscor
571 write (iout,*) iii," conformations (from",indstart(j)," to",
572 & indend(j),") read from ",
573 & bxname(:ilen(bxname))
574 close (ientin,status="delete")
576 if (bxfile .or. cxfile .or. ensembles.gt.0) close (ientout)
577 #if (defined(AIX) && !defined(JUBL))
578 if (cxfile) call xdrfclose_(ixdrf,cxname,iret)
580 if (cxfile) call xdrfclose(ixdrf,cxname,iret)
584 101 write (iout,*) "Error in scratchfile."
588 c-------------------------------------------------------------------------------
589 subroutine cxwrite(ixdrf,csingle,eini,efree,rmsdev,iscor)
592 include "DIMENSIONS.ZSCOPT"
593 include "DIMENSIONS.FREE"
594 include "DIMENSIONS.COMPAR"
597 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
600 include "COMMON.CONTROL"
601 include "COMMON.CHAIN"
602 include "COMMON.IOUNITS"
603 include "COMMON.PROTFILES"
604 include "COMMON.NAMES"
606 include "COMMON.SBRIDGE"
608 include "COMMON.FFIELD"
609 include "COMMON.ENEPS"
610 include "COMMON.LOCAL"
611 include "COMMON.WEIGHTS"
612 include "COMMON.INTERACT"
613 include "COMMON.FREE"
614 include "COMMON.ENERGIES"
615 include "COMMON.COMPAR"
616 include "COMMON.PROT"
617 integer i,j,itmp,iscor,iret,ixdrf
618 double precision rmsdev,efree,eini
619 real*4 csingle(3,maxres2),xoord(3,maxres2+2)
622 c write (iout,*) "cxwrite"
627 xoord(j,i)=csingle(j,i)
632 xoord(j,nres+i-nnt+1)=csingle(j,i+nres)
638 c write (iout,*) "itmp",itmp
640 #if (defined(AIX) && !defined(JUBL))
641 call xdrf3dfcoord_(ixdrf, xoord, itmp, prec, iret)
643 c write (iout,*) "xdrf3dfcoord"
645 call xdrfint_(ixdrf, nss, iret)
647 call xdrfint_(ixdrf, ihpb(j), iret)
648 call xdrfint_(ixdrf, jhpb(j), iret)
650 call xdrffloat_(ixdrf,real(eini),iret)
651 call xdrffloat_(ixdrf,real(efree),iret)
652 call xdrffloat_(ixdrf,real(rmsdev),iret)
653 call xdrfint_(ixdrf,iscor,iret)
655 call xdrf3dfcoord(ixdrf, xoord, itmp, prec, iret)
657 call xdrfint(ixdrf, nss, iret)
659 call xdrfint(ixdrf, ihpb(j), iret)
660 call xdrfint(ixdrf, jhpb(j), iret)
662 call xdrffloat(ixdrf,real(eini),iret)
663 call xdrffloat(ixdrf,real(efree),iret)
664 call xdrffloat(ixdrf,real(rmsdev),iret)
665 call xdrfint(ixdrf,iscor,iret)
670 c------------------------------------------------------------------------------
671 logical function conf_check(ii,iprint)
674 include "DIMENSIONS.ZSCOPT"
675 include "DIMENSIONS.FREE"
678 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
681 include "COMMON.CHAIN"
682 include "COMMON.IOUNITS"
683 include "COMMON.PROTFILES"
684 include "COMMON.NAMES"
686 include "COMMON.SBRIDGE"
688 include "COMMON.FFIELD"
689 include "COMMON.ENEPS"
690 include "COMMON.LOCAL"
691 include "COMMON.WEIGHTS"
692 include "COMMON.INTERACT"
693 include "COMMON.FREE"
694 include "COMMON.ENERGIES"
695 include "COMMON.CONTROL"
696 include "COMMON.TORCNSTR"
697 integer j,k,l,ii,itj,iprint
698 if (.not.check_conf) then
702 call int_from_cart1(.false.)
704 if (vbld(j).lt.2.0d0 .or. vbld(j).gt.5.0d0) then
706 & write (iout,*) "Bad CA-CA bond length",j," ",vbld(j),
707 & " for conformation",ii
708 if (iprint.gt.1) then
709 write (iout,*) "The Cartesian geometry is:"
710 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
711 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
712 write (iout,*) "The internal geometry is:"
713 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
714 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
715 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
716 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
717 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
718 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
720 if (iprint.gt.0) write (iout,*)
721 & "This conformation WILL NOT be added to the database."
728 if (itype(j).ne.10 .and. (vbld(nres+j)-dsc(itj)).gt.2.0d0) then
730 & write (iout,*) "Bad CA-SC bond length",j," ",vbld(nres+j),
731 & " for conformation",ii
732 if (iprint.gt.1) then
733 write (iout,*) "The Cartesian geometry is:"
734 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
735 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
736 write (iout,*) "The internal geometry is:"
737 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
738 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
739 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
740 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
741 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
742 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
744 if (iprint.gt.0) write (iout,*)
745 & "This conformation WILL NOT be added to the database."
751 if (theta(j).le.0.0d0) then
753 & write (iout,*) "Zero theta angle(s) in conformation",ii
754 if (iprint.gt.1) then
755 write (iout,*) "The Cartesian geometry is:"
756 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
757 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
758 write (iout,*) "The internal geometry is:"
759 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
760 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
761 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
762 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
763 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
764 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
766 if (iprint.gt.0) write (iout,*)
767 & "This conformation WILL NOT be added to the database."
771 if (theta(j).gt.179.97*deg2rad) theta(j)=179.97*deg2rad
774 c write (iout,*) "conf_check passed",ii