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
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 write (iout,*) "indstart(me1),indend(me1)"
64 &,indstart(me1),indend(me1)
65 do i=indstart(me1),indend(me1)
77 read(ientout,rec=i,err=101)
78 & ((csingle(l,k),l=1,3),k=1,nres),
79 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
80 & nss,(ihpb(k),jhpb(k),k=1,nss),
81 & eini,efree,rmsdev,(q(j,iii+1),j=1,nQ),iR,ib,ipar
90 c(l,k+nres)=csingle(l,k+nres)
93 anatemp= 1.0d0/(beta_h(ib,ipar)*1.987D-3)
94 q(nQ+1,iii+1)=rmsnat(iii+1)
96 q(nQ+2,iii+1)=gyrate(iii+1)
97 c fT=T0*beta_h(ib,ipar)*1.987D-3
98 c ft=2.0d0/(1.0d0+1.0d0/(T0*beta_h(ib,ipar)*1.987D-3))
99 if (rescale_mode.eq.1) then
100 quot=1.0d0/(T0*beta_h(ib,ipar)*1.987D-3)
102 tt = 1.0d0/(beta_h(ib,ipar)*1.987D-3)
103 ft(6)=(320.0+80.0*dtanh((tt-320.0)/80.0))/320.0
114 fT(l)=kfacl/(kfacl-1.0d0+quotl)
116 else if (rescale_mode.eq.2) then
117 quot=1.0d0/(T0*beta_h(ib,ipar)*1.987D-3)
119 tt = 1.0d0/(beta_h(ib,ipar)*1.987D-3)
120 ft(6)=(320.0+80.0*dtanh((tt-320.0)/80.0))/320.0
129 fT(l)=1.12692801104297249644d0/
130 & dlog(dexp(quotl)+dexp(-quotl))
132 else if (rescale_mode.eq.0) then
137 write (iout,*) "Error in ECECALC: wrong RESCALE_MODE",
143 c write (iout,*) "T",1.0d0/(beta_h(ib,ipar)*1.987D-3)," T0",T0,
144 c & " kfac",kfac,"quot",quot," fT",fT
150 call int_from_cart1(.false.)
154 call restore_parm(iparm)
156 write (iout,*) wsc,wscp,welec,wvdwpp,wang,wtor,wscloc,
157 & wcorr,wcorr5,wcorr6,wturn4,wturn3,wturn6,wel_loc,
158 & wtor_d,wsccor,wbond
160 C write (iout,*) "tuz przed energia"
161 call etotal(energia(0),fT)
162 C write (iout,*) "tuz za energia"
165 write (iout,*) "Conformation",i
166 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
167 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
168 call enerprint(energia(0),fT)
169 write (iout,'(2i5,21f8.2)') i,iparm,(energia(k),k=1,21)
170 write (iout,*) "ftors",ftors
171 call briefout(i,energia(0))
172 temp=1.0d0/(beta_h(ib,ipar)*1.987D-3)
173 write (iout,*) "temp", temp
174 call pdbout(i,temp,energia(0),energia(0),0.0d0,0.0d0)
176 if (energia(0).ge.1.0d20) then
177 write (iout,*) "NaNs detected in some of the energy",
178 & " components for conformation",ii+1
179 write (iout,*) "The Cartesian geometry is:"
180 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
181 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
182 write (iout,*) "The internal geometry is:"
184 c call pdbout(ii+1,beta_h(ib,ipar),efree,energia(0),0.0d0,rmsdev)
185 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
186 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
187 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
188 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
189 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
190 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
191 write (iout,*) "The components of the energy are:"
192 call enerprint(energia(0),fT)
194 & "This conformation WILL NOT be added to the database."
199 if (ipar.eq.iparm) write (iout,*) i,iparm,
200 & 1.0d0/(beta_h(ib,ipar)*1.987D-3),eini,energia(0)
202 if (ipar.eq.iparm .and. einicheck.gt.0 .and.
203 & dabs(eini-energia(0)).gt.tole) then
204 if (errmsg_count.le.maxerrmsg_count) then
205 write (iout,'(2a,2e15.5,a,2i8,a,f8.1)')
206 & "Warning: energy differs remarkably from ",
207 & " the value read in: ",energia(0),eini," point",
208 & iii+1,indstart(me1)+iii," T",
209 & 1.0d0/(1.987D-3*beta_h(ib,ipar))
211 call pdbout(indstart(me1)+iii,
212 & 1.0d0/(1.987D-3*beta_h(ib,ipar)),
213 &energia(0),eini,0.0d0,0.0d0)
214 call enerprint(energia(0),fT)
215 errmsg_count=errmsg_count+1
216 if (errmsg_count.gt.maxerrmsg_count)
217 & write (iout,*) "Too many warning messages"
218 if (einicheck.gt.1) then
219 write (iout,*) "Calculation stopped."
222 call MPI_Abort(WHAM_COMM,IERROR,ERRCODE)
229 C write (iout,*) "Czy tu dochodze"
230 potE(iii+1,iparm)=energia(0)
232 enetb(k,iii+1,iparm)=energia(k)
235 write (iout,'(2i5,f10.1,3e15.5)') i,iii,
236 & 1.0d0/(beta_h(ib,ipar)*1.987D-3),energia(0),eini,efree
237 c call enerprint(energia(0),fT)
240 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
241 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
242 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
243 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
244 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
245 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
246 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
247 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
248 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
249 write (iout,'(8f10.5)') (q(k,iii+1),k=1,nQ)
250 write (iout,'(f10.5,i10)') rmsdev,iscor
251 call enerprint(energia(0),fT)
252 call pdbout(ii+1,beta_h(ib,ipar),efree,energia(0),0.0d0,rmsdev)
259 if (q(1,iii).le.0.0d0 .and. indpdb.gt.0) q(1,iii)=qwolynes(0,0)
260 write (ientout,rec=iii)
261 & ((csingle(l,k),l=1,3),k=1,nres),
262 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
263 & nss,(ihpb(k),jhpb(k),k=1,nss),
264 & potE(iii,ipar),efree,rmsdev,(q(k,iii),k=1,nQ),iR,ib,ipar
265 c write (iout,'(2i5,2e15.5)') ii,iii,potE(iii,ipar),efree
267 if (separate_parset) then
268 snk_p(iR,ib,1)=snk_p(iR,ib,1)+1
270 snk_p(iR,ib,ipar)=snk_p(iR,ib,ipar)+1
272 c write (iout,*) "iii",iii," iR",iR," ib",ib," ipar",ipar,
273 c & " snk",snk_p(iR,ib,ipar)
275 snk(iR,ib,ipar,islice)=snk(iR,ib,ipar,islice)+1
281 write (iout,*) "Me",me," scount",scount(me)
283 c Master gathers updated numbers of conformations written by all procs.
284 call MPI_AllGather( scount(me), 1, MPI_INTEGER, scount(0), 1,
285 & MPI_INTEGER, WHAM_COMM, IERROR)
289 indstart(i)=indend(i-1)+1
290 indend(i)=indstart(i)+scount(i)-1
293 write (iout,*) "Revised conformation counts"
295 write (iout,'(a,i5,a,i7,a,i7,a,i7)')
296 & "Processor",i," indstart",indstart(i),
297 & " indend",indend(i)," count",scount(i)
300 call MPI_AllReduce(snk_p(1,1,1),snk(1,1,1,islice),
301 & MaxR*MaxT_h*nParmSet,
302 & MPI_INTEGER,MPI_SUM,WHAM_COMM,IERROR)
308 stot(islice)=stot(islice)+snk(i,ib,iparm,islice)
312 write (iout,*) "Revised SNK"
315 write (iout,'("Param",i3," Temp",f6.1,3x,32i8)')
316 & iparm,1.0d0/(1.987D-3*beta_h(ib,iparm)),
317 & (snk(i,ib,iparm,islice),i=1,nR(ib,iparm))
318 write (iout,*) "snk_p",(snk_p(i,ib,iparm),i=1,nR(ib,iparm))
321 write (iout,'("Total",i10)') stot(islice)
324 101 write (iout,*) "Error in scratchfile."
328 c------------------------------------------------------------------------------
329 subroutine write_dbase(islice,*)
332 include "DIMENSIONS.ZSCOPT"
333 include "DIMENSIONS.FREE"
334 include "DIMENSIONS.COMPAR"
337 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
340 include "COMMON.CONTROL"
341 include "COMMON.CHAIN"
342 include "COMMON.IOUNITS"
343 include "COMMON.PROTFILES"
344 include "COMMON.NAMES"
346 include "COMMON.SBRIDGE"
348 include "COMMON.FFIELD"
349 include "COMMON.ENEPS"
350 include "COMMON.LOCAL"
351 include "COMMON.WEIGHTS"
352 include "COMMON.INTERACT"
353 include "COMMON.FREE"
354 include "COMMON.ENERGIES"
355 include "COMMON.COMPAR"
356 include "COMMON.PROT"
357 include "COMMON.CONTACTS1"
359 character*80 bxname,cxname
360 character*64 bprotfile_temp
361 character*3 liczba,licz
363 integer i,itj,ii,iii,j,k,l
366 double precision rmsdev,efree,eini
367 real*4 csingle(3,maxres2)
368 double precision energ
372 integer isecstr(maxres)
373 write (licz2,'(bz,i2.2)') islice
374 call opentmp(islice,ientout,bprotfile_temp)
375 write (iout,*) "bprotfile_temp ",bprotfile_temp
377 if (.not.bxfile .and. .not. cxfile .and. indpdb.eq.0
378 & .and. ensembles.eq.0) then
379 close(ientout,status="delete")
383 write (liczba,'(bz,i3.3)') me
384 if (bxfile .or. cxfile .or. ensembles.gt.0) then
385 if (.not.separate_parset) then
386 bxname = prefix(:ilen(prefix))//liczba//".bx"
388 write (licz,'(bz,i3.3)') myparm
389 bxname = prefix(:ilen(prefix))//liczba//"_par"//licz//".bx"
391 open (ientin,file=bxname,status="unknown",
392 & form="unformatted",access="direct",recl=lenrec1)
395 if (bxfile .or. cxfile .or. ensembles.gt.0) then
396 if (nslice.eq.1) then
397 bxname = prefix(:ilen(prefix))//".bx"
399 bxname = prefix(:ilen(prefix))//
400 & "_slice_"//licz2//".bx"
402 open (ientin,file=bxname,status="unknown",
403 & form="unformatted",access="direct",recl=lenrec1)
404 write (iout,*) "Calculating energies; writing geometry",
405 & " and energy components to ",bxname(:ilen(bxname))
407 #if (defined(AIX) && !defined(JUBL))
408 call xdrfopen_(ixdrf,cxname, "w", iret)
410 call xdrfopen(ixdrf,cxname, "w", iret)
413 write (iout,*) "Error opening cxfile ",cxname(:ilen(cxname))
418 if (indpdb.gt.0) then
419 if (nslice.eq.1) then
421 if (.not.separate_parset) then
422 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))
425 write (licz,'(bz,i3.3)') myparm
426 statname=prefix(:ilen(prefix))//'_par'//licz//'_'//
427 & pot(:ilen(pot))//liczba//'.stat'
431 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//'.stat'
435 if (.not.separate_parset) then
436 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//
437 & "_slice_"//licz2//liczba//'.stat'
439 write (licz,'(bz,i3.3)') myparm
440 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//
441 & '_par'//licz//"_slice_"//licz2//liczba//'.stat'
444 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))
445 & //"_slice_"//licz2//'.stat'
448 open(istat,file=statname,status="unknown")
456 read(ientout,rec=i,err=101)
457 & ((csingle(l,k),l=1,3),k=1,nres),
458 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
459 & nss,(ihpb(k),jhpb(k),k=1,nss),
460 & eini,efree,rmsdev,(q(k,i),k=1,nQ),iR,ib,iparm
461 c write (iout,*) iR,ib,iparm,eini,efree
467 call int_from_cart1(.false.)
469 c write (iout,*) "Calling conf_compar",i
471 anatemp= 1.0d0/(beta_h(ib,iparm)*1.987D-3)
472 if (indpdb.gt.0) then
473 call conf_compar(i,.false.,.true.)
475 c call elecont(.false.,ncont,icont,nnt,nct)
476 c call secondary2(.false.,.false.,ncont,icont,isecstr)
478 c write (iout,*) "Exit conf_compar",i
480 if (bxfile .or.cxfile .or. ensembles.gt.0) write (ientin,rec=i)
481 & ((csingle(l,k),l=1,3),k=1,nres),
482 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
483 & nss,(ihpb(k),jhpb(k),k=1,nss),
484 c & potE(i,iparm),-entfac(i),rms_nat,iscore
485 & potE(i,nparmset),-entfac(i),rms_nat,iscore
486 c write (iout,'(2i5,3e15.5)') i,me,potE(i,iparm),-entfac(i)
488 if (cxfile) call cxwrite(ixdrf,csingle,potE(i,nparmset),
489 & -entfac(i),rms_nat,iscore)
492 close(ientout,status="delete")
494 if (bxfile .or. cxfile .or. ensembles.gt.0) close(ientin)
496 call MPI_Barrier(WHAM_COMM,IERROR)
497 if (me.ne.Master .or. .not.bxfile .and. .not. cxfile
498 & .and. ensembles.eq.0) return
500 if (bxfile .or. ensembles.gt.0) then
501 if (nslice.eq.1) then
502 if (.not.separate_parset) then
503 bxname = prefix(:ilen(prefix))//".bx"
505 write (licz,'(bz,i3.3)') myparm
506 bxname = prefix(:ilen(prefix))//"_par"//licz//".bx"
509 if (.not.separate_parset) then
510 bxname = prefix(:ilen(prefix))//"_slice_"//licz2//".bx"
512 write (licz,'(bz,i3.3)') myparm
513 bxname = prefix(:ilen(prefix))//"par_"//licz//
514 & "_slice_"//licz2//".bx"
517 open (ientout,file=bxname,status="unknown",
518 & form="unformatted",access="direct",recl=lenrec1)
519 write (iout,*) "Master is creating binary database ",
520 & bxname(:ilen(bxname))
523 if (nslice.eq.1) then
524 if (.not.separate_parset) then
525 cxname = prefix(:ilen(prefix))//".cx"
527 cxname = prefix(:ilen(prefix))//"_par"//licz//".cx"
530 if (.not.separate_parset) then
531 cxname = prefix(:ilen(prefix))//
532 & "_slice_"//licz2//".cx"
534 cxname = prefix(:ilen(prefix))//"_par"//licz//
535 & "_slice_"//licz2//".cx"
538 #if (defined(AIX) && !defined(JUBL))
539 call xdrfopen_(ixdrf,cxname, "w", iret)
541 call xdrfopen(ixdrf,cxname, "w", iret)
544 write (iout,*) "Error opening cxfile ",cxname(:ilen(cxname))
549 write (liczba,'(bz,i3.3)') j
550 if (separate_parset) then
551 write (licz,'(bz,i3.3)') myparm
552 bxname = prefix(:ilen(prefix))//liczba//"_par"//licz//".bx"
554 bxname = prefix(:ilen(prefix))//liczba//".bx"
556 open (ientin,file=bxname,status="unknown",
557 & form="unformatted",access="direct",recl=lenrec1)
558 write (iout,*) "Master is reading conformations from ",
559 & bxname(:ilen(bxname))
561 c write (iout,*) "j",j," indstart",indstart(j)," indend",indend(j)
563 do i=indstart(j),indend(j)
565 read(ientin,rec=iii,err=101)
566 & ((csingle(l,k),l=1,3),k=1,nres),
567 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
568 & nss,(ihpb(k),jhpb(k),k=1,nss),
569 & eini,efree,rmsdev,iscor
570 if (bxfile .or. ensembles.gt.0) then
571 write (ientout,rec=i)
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
577 if(cxfile)call cxwrite(ixdrf,csingle,eini,efree,rmsdev,iscor)
584 call int_from_cart1(.false.)
585 write (iout,'(2i5,3e15.5)') i,iii,eini,efree
586 write (iout,*) "The Cartesian geometry is:"
587 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
588 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
589 write (iout,*) "The internal geometry is:"
590 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
591 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
592 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
593 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
594 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
595 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
596 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
597 write (iout,'(f10.5,i5)') rmsdev,iscor
600 write (iout,*) iii," conformations (from",indstart(j)," to",
601 & indend(j),") read from ",
602 & bxname(:ilen(bxname))
603 close (ientin,status="delete")
605 if (bxfile .or. cxfile .or. ensembles.gt.0) close (ientout)
606 #if (defined(AIX) && !defined(JUBL))
607 if (cxfile) call xdrfclose_(ixdrf,cxname,iret)
609 if (cxfile) call xdrfclose(ixdrf,cxname,iret)
613 101 write (iout,*) "Error in scratchfile."
617 c-------------------------------------------------------------------------------
618 subroutine cxwrite(ixdrf,csingle,eini,efree,rmsdev,iscor)
621 include "DIMENSIONS.ZSCOPT"
622 include "DIMENSIONS.FREE"
623 include "DIMENSIONS.COMPAR"
626 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
629 include "COMMON.CONTROL"
630 include "COMMON.CHAIN"
631 include "COMMON.IOUNITS"
632 include "COMMON.PROTFILES"
633 include "COMMON.NAMES"
635 include "COMMON.SBRIDGE"
637 include "COMMON.FFIELD"
638 include "COMMON.ENEPS"
639 include "COMMON.LOCAL"
640 include "COMMON.WEIGHTS"
641 include "COMMON.INTERACT"
642 include "COMMON.FREE"
643 include "COMMON.ENERGIES"
644 include "COMMON.COMPAR"
645 include "COMMON.PROT"
646 integer i,j,itmp,iscor,iret,ixdrf
647 double precision rmsdev,efree,eini
648 real*4 csingle(3,maxres2),xoord(3,maxres2+2)
651 c write (iout,*) "cxwrite"
656 xoord(j,i)=csingle(j,i)
661 xoord(j,nres+i-nnt+1)=csingle(j,i+nres)
667 c write (iout,*) "itmp",itmp
669 #if (defined(AIX) && !defined(JUBL))
670 call xdrf3dfcoord_(ixdrf, xoord, itmp, prec, iret)
672 c write (iout,*) "xdrf3dfcoord"
674 call xdrfint_(ixdrf, nss, iret)
676 call xdrfint_(ixdrf, ihpb(j), iret)
677 call xdrfint_(ixdrf, jhpb(j), iret)
679 call xdrffloat_(ixdrf,real(eini),iret)
680 call xdrffloat_(ixdrf,real(efree),iret)
681 call xdrffloat_(ixdrf,real(rmsdev),iret)
682 call xdrfint_(ixdrf,iscor,iret)
684 call xdrf3dfcoord(ixdrf, xoord, itmp, prec, iret)
686 call xdrfint(ixdrf, nss, iret)
688 call xdrfint(ixdrf, ihpb(j), iret)
689 call xdrfint(ixdrf, jhpb(j), iret)
691 call xdrffloat(ixdrf,real(eini),iret)
692 call xdrffloat(ixdrf,real(efree),iret)
693 call xdrffloat(ixdrf,real(rmsdev),iret)
694 call xdrfint(ixdrf,iscor,iret)
699 c------------------------------------------------------------------------------
700 logical function conf_check(ii,iprint)
703 include "DIMENSIONS.ZSCOPT"
704 include "DIMENSIONS.FREE"
707 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
710 include "COMMON.CHAIN"
711 include "COMMON.IOUNITS"
712 include "COMMON.PROTFILES"
713 include "COMMON.NAMES"
715 include "COMMON.SBRIDGE"
717 include "COMMON.FFIELD"
718 include "COMMON.ENEPS"
719 include "COMMON.LOCAL"
720 include "COMMON.WEIGHTS"
721 include "COMMON.INTERACT"
722 include "COMMON.FREE"
723 include "COMMON.ENERGIES"
724 include "COMMON.CONTROL"
725 include "COMMON.TORCNSTR"
726 integer j,k,l,ii,itj,iprint
727 if (.not.check_conf) then
731 call int_from_cart1(.false.)
733 if (itype(j-1).ne.ntyp1 .and. itype(j).ne.ntyp1 .and.
734 & (vbld(j).lt.2.0d0 .or. vbld(j).gt.5.0d0)) then
736 & write (iout,*) "Bad CA-CA bond length",j," ",vbld(j),
737 & " for conformation",ii
738 if (iprint.gt.1) then
739 write (iout,*) "The Cartesian geometry is:"
740 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
741 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
742 write (iout,*) "The internal geometry is:"
743 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
744 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
745 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
746 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
747 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
748 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
750 if (iprint.gt.0) write (iout,*)
751 & "This conformation WILL NOT be added to the database."
758 if (itype(j).ne.10 .and.itype(j).ne.ntyp1 .and.
759 & (vbld(nres+j)-dsc(iabs(itj))).gt.2.0d0) then
761 & write (iout,*) "Bad CA-SC bond length",j," ",vbld(nres+j),
762 & " for conformation",ii
763 if (iprint.gt.1) then
764 write (iout,*) "The Cartesian geometry is:"
765 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
766 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
767 write (iout,*) "The internal geometry is:"
768 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
769 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
770 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
771 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
772 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
773 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
775 if (iprint.gt.0) write (iout,*)
776 & "This conformation WILL NOT be added to the database."
782 if (theta(j).le.0.0d0) then
784 & write (iout,*) "Zero theta angle(s) in conformation",ii
785 if (iprint.gt.1) then
786 write (iout,*) "The Cartesian geometry is:"
787 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
788 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
789 write (iout,*) "The internal geometry is:"
790 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
791 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
792 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
793 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
794 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
795 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
797 if (iprint.gt.0) write (iout,*)
798 & "This conformation WILL NOT be added to the database."
802 if (theta(j).gt.179.97*deg2rad) theta(j)=179.97*deg2rad
805 c write (iout,*) "conf_check passed",ii