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
38 integer iscor,islice,scount_buff(0:99)
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 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
161 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
162 call enerprint(energia(0),fT)
163 write (iout,'(2i5,21f8.2)') i,iparm,(energia(k),k=1,21)
164 write (iout,*) "ftors",ftors
165 call briefout(i,energia(0))
166 temp=1.0d0/(beta_h(ib,ipar)*1.987D-3)
167 write (iout,*) "temp", temp
168 call pdbout(i,temp,energia(0),energia(0),0.0d0,0.0d0)
170 if (energia(0).ge.1.0d20) then
171 write (iout,*) "NaNs detected in some of the energy",
172 & " components for conformation",ii+1
173 write (iout,*) "The Cartesian geometry is:"
174 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
175 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
176 write (iout,*) "The internal geometry is:"
178 c call pdbout(ii+1,beta_h(ib,ipar),efree,energia(0),0.0d0,rmsdev)
179 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
180 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
181 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
182 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
183 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
184 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
185 write (iout,*) "The components of the energy are:"
186 call enerprint(energia(0),fT)
188 & "This conformation WILL NOT be added to the database."
193 if (ipar.eq.iparm) write (iout,*) i,iparm,
194 & 1.0d0/(beta_h(ib,ipar)*1.987D-3),eini,energia(0)
196 if (ipar.eq.iparm .and. einicheck.gt.0 .and.
197 & dabs(eini-energia(0)).gt.tole) then
198 if (errmsg_count.le.maxerrmsg_count) then
199 write (iout,'(2a,2e15.5,a,2i8,a,f8.1)')
200 & "Warning: energy differs remarkably from ",
201 & " the value read in: ",energia(0),eini," point",
202 & iii+1,indstart(me1)+iii," T",
203 & 1.0d0/(1.987D-3*beta_h(ib,ipar))
205 call pdbout(indstart(me1)+iii,
206 & 1.0d0/(1.987D-3*beta_h(ib,ipar)),
207 &energia(0),eini,0.0d0,0.0d0)
208 call enerprint(energia(0),fT)
209 errmsg_count=errmsg_count+1
210 if (errmsg_count.gt.maxerrmsg_count)
211 & write (iout,*) "Too many warning messages"
212 if (einicheck.gt.1) then
213 write (iout,*) "Calculation stopped."
216 call MPI_Abort(WHAM_COMM,IERROR,ERRCODE)
223 potE(iii+1,iparm)=energia(0)
225 enetb(k,iii+1,iparm)=energia(k)
228 write (iout,'(2i5,f10.1,3e15.5)') i,iii,
229 & 1.0d0/(beta_h(ib,ipar)*1.987D-3),energia(0),eini,efree
230 c call enerprint(energia(0),fT)
233 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
234 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
235 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
236 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
237 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
238 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
239 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
240 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
241 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
242 write (iout,'(8f10.5)') (q(k,iii+1),k=1,nQ)
243 write (iout,'(f10.5,i10)') rmsdev,iscor
244 call enerprint(energia(0),fT)
245 call pdbout(ii+1,beta_h(ib,ipar),efree,energia(0),0.0d0,rmsdev)
252 if (q(1,iii).le.0.0d0 .and. indpdb.gt.0) q(1,iii)=qwolynes(0,0)
253 write (ientout,rec=iii)
254 & ((csingle(l,k),l=1,3),k=1,nres),
255 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
256 & nss,(ihpb(k),jhpb(k),k=1,nss),
257 & potE(iii,ipar),efree,rmsdev,(q(k,iii),k=1,nQ),iR,ib,ipar
258 c write (iout,'(2i5,2e15.5)') ii,iii,potE(iii,ipar),efree
260 if (separate_parset) then
261 snk_p(iR,ib,1)=snk_p(iR,ib,1)+1
263 snk_p(iR,ib,ipar)=snk_p(iR,ib,ipar)+1
265 c write (iout,*) "iii",iii," iR",iR," ib",ib," ipar",ipar,
266 c & " snk",snk_p(iR,ib,ipar)
268 snk(iR,ib,ipar,islice)=snk(iR,ib,ipar,islice)+1
274 write (iout,*) "Me",me," scount_buff",scount_buff(me)
276 c Master gathers updated numbers of conformations written by all procs.
277 c call MPI_AllGather(MPI_IN_PLACE,1,MPI_DATATYPE_NULL,scount(0),1,
278 c & MPI_INTEGER, WHAM_COMM, IERROR)
279 call MPI_AllGather( scount_buff(me), 1, MPI_INTEGER, scount(0), 1,
280 & MPI_INTEGER, WHAM_COMM, IERROR)
285 indstart(i)=indend(i-1)+1
286 indend(i)=indstart(i)+scount(i)-1
289 write (iout,*) "Revised conformation counts"
291 write (iout,'(a,i5,a,i7,a,i7,a,i7)')
292 & "Processor",i," indstart",indstart(i),
293 & " indend",indend(i)," count",scount(i)
296 call MPI_AllReduce(snk_p(1,1,1),snk(1,1,1,islice),
297 & MaxR*MaxT_h*nParmSet,
298 & MPI_INTEGER,MPI_SUM,WHAM_COMM,IERROR)
304 stot(islice)=stot(islice)+snk(i,ib,iparm,islice)
308 write (iout,*) "Revised SNK"
311 write (iout,'("Param",i3," Temp",f6.1,3x,32i8)')
312 & iparm,1.0d0/(1.987D-3*beta_h(ib,iparm)),
313 & (snk(i,ib,iparm,islice),i=1,nR(ib,iparm))
314 write (iout,*) "snk_p",(snk_p(i,ib,iparm),i=1,nR(ib,iparm))
317 write (iout,'("Total",i10)') stot(islice)
320 101 write (iout,*) "Error in scratchfile."
324 c------------------------------------------------------------------------------
325 subroutine write_dbase(islice,*)
328 include "DIMENSIONS.ZSCOPT"
329 include "DIMENSIONS.FREE"
330 include "DIMENSIONS.COMPAR"
333 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
336 include "COMMON.CONTROL"
337 include "COMMON.CHAIN"
338 include "COMMON.IOUNITS"
339 include "COMMON.PROTFILES"
340 include "COMMON.NAMES"
342 include "COMMON.SBRIDGE"
344 include "COMMON.FFIELD"
345 include "COMMON.ENEPS"
346 include "COMMON.LOCAL"
347 include "COMMON.WEIGHTS"
348 include "COMMON.INTERACT"
349 include "COMMON.FREE"
350 include "COMMON.ENERGIES"
351 include "COMMON.COMPAR"
352 include "COMMON.PROT"
353 include "COMMON.CONTACTS1"
355 character*80 bxname,cxname
356 character*64 bprotfile_temp
357 character*3 liczba,licz
359 integer i,itj,ii,iii,j,k,l
362 double precision rmsdev,efree,eini
363 real*4 csingle(3,maxres2)
364 double precision energ
367 integer ir,ib,iparm, scount_buff(0:99)
368 integer isecstr(maxres)
369 write (licz2,'(bz,i2.2)') islice
370 call opentmp(islice,ientout,bprotfile_temp)
371 write (iout,*) "bprotfile_temp ",bprotfile_temp
373 if (.not.bxfile .and. .not. cxfile .and. indpdb.eq.0
374 & .and. ensembles.eq.0) then
375 close(ientout,status="delete")
379 write (liczba,'(bz,i3.3)') me
380 if (bxfile .or. cxfile .or. ensembles.gt.0) then
381 if (.not.separate_parset) then
382 bxname = prefix(:ilen(prefix))//liczba//".bx"
384 write (licz,'(bz,i3.3)') myparm
385 bxname = prefix(:ilen(prefix))//liczba//"_par"//licz//".bx"
387 open (ientin,file=bxname,status="unknown",
388 & form="unformatted",access="direct",recl=lenrec1)
391 if (bxfile .or. cxfile .or. ensembles.gt.0) then
392 if (nslice.eq.1) then
393 bxname = prefix(:ilen(prefix))//".bx"
395 bxname = prefix(:ilen(prefix))//
396 & "_slice_"//licz2//".bx"
398 open (ientin,file=bxname,status="unknown",
399 & form="unformatted",access="direct",recl=lenrec1)
400 write (iout,*) "Calculating energies; writing geometry",
401 & " and energy components to ",bxname(:ilen(bxname))
403 #if (defined(AIX) && !defined(JUBL))
404 call xdrfopen_(ixdrf,cxname, "w", iret)
406 call xdrfopen(ixdrf,cxname, "w", iret)
409 write (iout,*) "Error opening cxfile ",cxname(:ilen(cxname))
414 if (indpdb.gt.0) then
415 if (nslice.eq.1) then
417 if (.not.separate_parset) then
418 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))
421 write (licz,'(bz,i3.3)') myparm
422 statname=prefix(:ilen(prefix))//'_par'//licz//'_'//
423 & pot(:ilen(pot))//liczba//'.stat'
427 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//'.stat'
431 if (.not.separate_parset) then
432 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//
433 & "_slice_"//licz2//liczba//'.stat'
435 write (licz,'(bz,i3.3)') myparm
436 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//
437 & '_par'//licz//"_slice_"//licz2//liczba//'.stat'
440 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))
441 & //"_slice_"//licz2//'.stat'
444 open(istat,file=statname,status="unknown")
452 read(ientout,rec=i,err=101)
453 & ((csingle(l,k),l=1,3),k=1,nres),
454 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
455 & nss,(ihpb(k),jhpb(k),k=1,nss),
456 & eini,efree,rmsdev,(q(k,i),k=1,nQ),iR,ib,iparm
457 c write (iout,*) iR,ib,iparm,eini,efree
463 call int_from_cart1(.false.)
465 c write (iout,*) "Calling conf_compar",i
467 anatemp= 1.0d0/(beta_h(ib,iparm)*1.987D-3)
468 if (indpdb.gt.0) then
469 call conf_compar(i,.false.,.true.)
471 c call elecont(.false.,ncont,icont,nnt,nct)
472 c call secondary2(.false.,.false.,ncont,icont,isecstr)
474 c write (iout,*) "Exit conf_compar",i
476 if (bxfile .or.cxfile .or. ensembles.gt.0) write (ientin,rec=i)
477 & ((csingle(l,k),l=1,3),k=1,nres),
478 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
479 & nss,(ihpb(k),jhpb(k),k=1,nss),
480 c & potE(i,iparm),-entfac(i),rms_nat,iscore
481 & potE(i,nparmset),-entfac(i),rms_nat,iscore
482 c write (iout,'(2i5,3e15.5)') i,me,potE(i,iparm),-entfac(i)
484 if (cxfile) call cxwrite(ixdrf,csingle,potE(i,nparmset),
485 & -entfac(i),rms_nat,iscore)
488 close(ientout,status="delete")
490 if (bxfile .or. cxfile .or. ensembles.gt.0) close(ientin)
492 call MPI_Barrier(WHAM_COMM,IERROR)
493 if (me.ne.Master .or. .not.bxfile .and. .not. cxfile
494 & .and. ensembles.eq.0) return
496 if (bxfile .or. ensembles.gt.0) then
497 if (nslice.eq.1) then
498 if (.not.separate_parset) then
499 bxname = prefix(:ilen(prefix))//".bx"
501 write (licz,'(bz,i3.3)') myparm
502 bxname = prefix(:ilen(prefix))//"_par"//licz//".bx"
505 if (.not.separate_parset) then
506 bxname = prefix(:ilen(prefix))//"_slice_"//licz2//".bx"
508 write (licz,'(bz,i3.3)') myparm
509 bxname = prefix(:ilen(prefix))//"par_"//licz//
510 & "_slice_"//licz2//".bx"
513 open (ientout,file=bxname,status="unknown",
514 & form="unformatted",access="direct",recl=lenrec1)
515 write (iout,*) "Master is creating binary database ",
516 & bxname(:ilen(bxname))
519 if (nslice.eq.1) then
520 if (.not.separate_parset) then
521 cxname = prefix(:ilen(prefix))//".cx"
523 cxname = prefix(:ilen(prefix))//"_par"//licz//".cx"
526 if (.not.separate_parset) then
527 cxname = prefix(:ilen(prefix))//
528 & "_slice_"//licz2//".cx"
530 cxname = prefix(:ilen(prefix))//"_par"//licz//
531 & "_slice_"//licz2//".cx"
534 #if (defined(AIX) && !defined(JUBL))
535 call xdrfopen_(ixdrf,cxname, "w", iret)
537 call xdrfopen(ixdrf,cxname, "w", iret)
540 write (iout,*) "Error opening cxfile ",cxname(:ilen(cxname))
545 write (liczba,'(bz,i3.3)') j
546 if (separate_parset) then
547 write (licz,'(bz,i3.3)') myparm
548 bxname = prefix(:ilen(prefix))//liczba//"_par"//licz//".bx"
550 bxname = prefix(:ilen(prefix))//liczba//".bx"
552 open (ientin,file=bxname,status="unknown",
553 & form="unformatted",access="direct",recl=lenrec1)
554 write (iout,*) "Master is reading conformations from ",
555 & bxname(:ilen(bxname))
557 c write (iout,*) "j",j," indstart",indstart(j)," indend",indend(j)
559 do i=indstart(j),indend(j)
561 read(ientin,rec=iii,err=101)
562 & ((csingle(l,k),l=1,3),k=1,nres),
563 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
564 & nss,(ihpb(k),jhpb(k),k=1,nss),
565 & eini,efree,rmsdev,iscor
566 if (bxfile .or. ensembles.gt.0) then
567 write (ientout,rec=i)
568 & ((csingle(l,k),l=1,3),k=1,nres),
569 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
570 & nss,(ihpb(k),jhpb(k),k=1,nss),
571 & eini,efree,rmsdev,iscor
573 if(cxfile)call cxwrite(ixdrf,csingle,eini,efree,rmsdev,iscor)
580 call int_from_cart1(.false.)
581 write (iout,'(2i5,3e15.5)') i,iii,eini,efree
582 write (iout,*) "The Cartesian geometry is:"
583 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
584 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
585 write (iout,*) "The internal geometry is:"
586 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
587 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
588 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
589 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
590 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
591 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
592 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
593 write (iout,'(f10.5,i5)') rmsdev,iscor
596 write (iout,*) iii," conformations (from",indstart(j)," to",
597 & indend(j),") read from ",
598 & bxname(:ilen(bxname))
599 close (ientin,status="delete")
601 if (bxfile .or. cxfile .or. ensembles.gt.0) close (ientout)
602 #if (defined(AIX) && !defined(JUBL))
603 if (cxfile) call xdrfclose_(ixdrf,cxname,iret)
605 if (cxfile) call xdrfclose(ixdrf,cxname,iret)
609 101 write (iout,*) "Error in scratchfile."
613 c-------------------------------------------------------------------------------
614 subroutine cxwrite(ixdrf,csingle,eini,efree,rmsdev,iscor)
617 include "DIMENSIONS.ZSCOPT"
618 include "DIMENSIONS.FREE"
619 include "DIMENSIONS.COMPAR"
622 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
625 include "COMMON.CONTROL"
626 include "COMMON.CHAIN"
627 include "COMMON.IOUNITS"
628 include "COMMON.PROTFILES"
629 include "COMMON.NAMES"
631 include "COMMON.SBRIDGE"
633 include "COMMON.FFIELD"
634 include "COMMON.ENEPS"
635 include "COMMON.LOCAL"
636 include "COMMON.WEIGHTS"
637 include "COMMON.INTERACT"
638 include "COMMON.FREE"
639 include "COMMON.ENERGIES"
640 include "COMMON.COMPAR"
641 include "COMMON.PROT"
642 integer i,j,itmp,iscor,iret,ixdrf
643 double precision rmsdev,efree,eini
644 real*4 csingle(3,maxres2),xoord(3,maxres2+2)
647 c write (iout,*) "cxwrite"
652 xoord(j,i)=csingle(j,i)
657 xoord(j,nres+i-nnt+1)=csingle(j,i+nres)
663 c write (iout,*) "itmp",itmp
665 #if (defined(AIX) && !defined(JUBL))
666 call xdrf3dfcoord_(ixdrf, xoord, itmp, prec, iret)
668 c write (iout,*) "xdrf3dfcoord"
670 call xdrfint_(ixdrf, nss, iret)
672 call xdrfint_(ixdrf, ihpb(j), iret)
673 call xdrfint_(ixdrf, jhpb(j), iret)
675 call xdrffloat_(ixdrf,real(eini),iret)
676 call xdrffloat_(ixdrf,real(efree),iret)
677 call xdrffloat_(ixdrf,real(rmsdev),iret)
678 call xdrfint_(ixdrf,iscor,iret)
680 call xdrf3dfcoord(ixdrf, xoord, itmp, prec, iret)
682 call xdrfint(ixdrf, nss, iret)
684 call xdrfint(ixdrf, ihpb(j), iret)
685 call xdrfint(ixdrf, jhpb(j), iret)
687 call xdrffloat(ixdrf,real(eini),iret)
688 call xdrffloat(ixdrf,real(efree),iret)
689 call xdrffloat(ixdrf,real(rmsdev),iret)
690 call xdrfint(ixdrf,iscor,iret)
695 c------------------------------------------------------------------------------
696 logical function conf_check(ii,iprint)
699 include "DIMENSIONS.ZSCOPT"
700 include "DIMENSIONS.FREE"
703 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
706 include "COMMON.CHAIN"
707 include "COMMON.IOUNITS"
708 include "COMMON.PROTFILES"
709 include "COMMON.NAMES"
711 include "COMMON.SBRIDGE"
713 include "COMMON.FFIELD"
714 include "COMMON.ENEPS"
715 include "COMMON.LOCAL"
716 include "COMMON.WEIGHTS"
717 include "COMMON.INTERACT"
718 include "COMMON.FREE"
719 include "COMMON.ENERGIES"
720 include "COMMON.CONTROL"
721 include "COMMON.TORCNSTR"
722 integer j,k,l,ii,itj,iprint
723 if (.not.check_conf) then
727 call int_from_cart1(.false.)
729 if (itype(j-1).ne.ntyp1 .and. itype(j).ne.ntyp1 .and.
730 & (vbld(j).lt.2.0d0 .or. vbld(j).gt.5.0d0)) then
732 & write (iout,*) "Bad CA-CA bond length",j," ",vbld(j),
733 & " for conformation",ii
734 if (iprint.gt.1) then
735 write (iout,*) "The Cartesian geometry is:"
736 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
737 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
738 write (iout,*) "The internal geometry is:"
739 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
740 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
741 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
742 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
743 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
744 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
746 if (iprint.gt.0) write (iout,*)
747 & "This conformation WILL NOT be added to the database."
754 if (itype(j).ne.10 .and.itype(j).ne.ntyp1 .and.
755 & (vbld(nres+j)-dsc(iabs(itj))).gt.2.0d0) then
757 & write (iout,*) "Bad CA-SC bond length",j," ",vbld(nres+j),
758 & " for conformation",ii
759 if (iprint.gt.1) then
760 write (iout,*) "The Cartesian geometry is:"
761 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
762 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
763 write (iout,*) "The internal geometry is:"
764 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
765 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
766 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
767 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
768 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
769 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
771 if (iprint.gt.0) write (iout,*)
772 & "This conformation WILL NOT be added to the database."
778 if (theta(j).le.0.0d0) then
780 & write (iout,*) "Zero theta angle(s) in conformation",ii
781 if (iprint.gt.1) then
782 write (iout,*) "The Cartesian geometry is:"
783 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
784 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
785 write (iout,*) "The internal geometry is:"
786 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
787 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
788 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
789 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
790 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
791 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
793 if (iprint.gt.0) write (iout,*)
794 & "This conformation WILL NOT be added to the database."
798 if (theta(j).gt.179.97*deg2rad) theta(j)=179.97*deg2rad
801 c write (iout,*) "conf_check passed",ii