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 if (q(nQ+1,iii+1).le.frac_cutoff) then
99 c fT=T0*beta_h(ib,ipar)*1.987D-3
100 c ft=2.0d0/(1.0d0+1.0d0/(T0*beta_h(ib,ipar)*1.987D-3))
101 if (rescale_mode.eq.1) then
102 quot=1.0d0/(T0*beta_h(ib,ipar)*1.987D-3)
104 tt = 1.0d0/(beta_h(ib,ipar)*1.987D-3)
105 ft(6)=(320.0+80.0*dtanh((tt-320.0)/80.0))/320.0
116 fT(l)=kfacl/(kfacl-1.0d0+quotl)
118 else if (rescale_mode.eq.2) then
119 quot=1.0d0/(T0*beta_h(ib,ipar)*1.987D-3)
121 tt = 1.0d0/(beta_h(ib,ipar)*1.987D-3)
122 ft(6)=(320.0+80.0*dtanh((tt-320.0)/80.0))/320.0
131 fT(l)=1.12692801104297249644d0/
132 & dlog(dexp(quotl)+dexp(-quotl))
134 else if (rescale_mode.eq.0) then
139 write (iout,*) "Error in ECECALC: wrong RESCALE_MODE",
145 c write (iout,*) "T",1.0d0/(beta_h(ib,ipar)*1.987D-3)," T0",T0,
146 c & " kfac",kfac,"quot",quot," fT",fT
152 call int_from_cart1(.false.)
156 call restore_parm(iparm)
158 write (iout,*) wsc,wscp,welec,wvdwpp,wang,wtor,wscloc,
159 & wcorr,wcorr5,wcorr6,wturn4,wturn3,wturn6,wel_loc,
160 & wtor_d,wsccor,wbond
162 call etotal(energia(0),fT)
164 write (iout,*) "Conformation",i
165 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
166 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
167 call enerprint(energia(0),fT)
168 write (iout,'(2i5,21f8.2)') i,iparm,(energia(k),k=1,21)
169 write (iout,*) "ftors(1)",ftors(1)
170 call briefout(i,energia(0))
171 temp=1.0d0/(beta_h(ib,ipar)*1.987D-3)
172 write (iout,*) "temp", temp
173 call pdbout(i,temp,energia(0),energia(0),0.0d0,0.0d0)
175 if (energia(0).ge.1.0d20) then
176 write (iout,*) "NaNs detected in some of the energy",
177 & " components for conformation",ii+1
178 write (iout,*) "The Cartesian geometry is:"
179 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
180 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
181 write (iout,*) "The internal geometry is:"
183 c call pdbout(ii+1,beta_h(ib,ipar),efree,energia(0),0.0d0,rmsdev)
184 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
185 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
186 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
187 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
188 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
189 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
190 write (iout,*) "The components of the energy are:"
191 call enerprint(energia(0),fT)
193 & "This conformation WILL NOT be added to the database."
198 if (ipar.eq.iparm) write (iout,*) i,iparm,
199 & 1.0d0/(beta_h(ib,ipar)*1.987D-3),eini,energia(0)
201 if (ipar.eq.iparm .and. einicheck.gt.0 .and.
202 & dabs(eini-energia(0)).gt.tole) then
203 if (errmsg_count.le.maxerrmsg_count) then
204 write (iout,'(2a,2e15.5,a,2i8,a,f8.1)')
205 & "Warning: energy differs remarkably from ",
206 & " the value read in: ",energia(0),eini," point",
207 & iii+1,indstart(me1)+iii," T",
208 & 1.0d0/(1.987D-3*beta_h(ib,ipar))
210 C write (iout,*) "The Cartesian geometry is:"
211 C write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
212 C write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
213 call pdbout(indstart(me1)+iii,
214 & 1.0d0/(1.987D-3*beta_h(ib,ipar)),
215 &energia(0),eini,0.0d0,0.0d0)
216 call enerprint(energia(0),fT)
217 errmsg_count=errmsg_count+1
218 if (errmsg_count.gt.maxerrmsg_count)
219 & write (iout,*) "Too many warning messages"
220 if (einicheck.gt.1) then
221 write (iout,*) "Calculation stopped."
224 call MPI_Abort(WHAM_COMM,IERROR,ERRCODE)
231 potE(iii+1,iparm)=energia(0)
233 enetb(k,iii+1,iparm)=energia(k)
236 write (iout,'(2i5,f10.1,3e15.5)') i,iii,
237 & 1.0d0/(beta_h(ib,ipar)*1.987D-3),energia(0),eini,efree
238 c call enerprint(energia(0),fT)
241 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
242 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
243 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
244 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
245 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
246 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
247 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
248 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
249 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
250 write (iout,'(8f10.5)') (q(k,iii+1),k=1,nQ)
251 write (iout,'(f10.5,i10)') rmsdev,iscor
252 call enerprint(energia(0),fT)
253 call pdbout(ii+1,beta_h(ib,ipar),efree,energia(0),0.0d0,rmsdev)
260 if (q(1,iii).le.0.0d0 .and. indpdb.gt.0) q(1,iii)=qwolynes(0,0)
261 write (ientout,rec=iii)
262 & ((csingle(l,k),l=1,3),k=1,nres),
263 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
264 & nss,(ihpb(k),jhpb(k),k=1,nss),
265 & potE(iii,ipar),efree,rmsdev,(q(k,iii),k=1,nQ),iR,ib,ipar
266 c write (iout,'(2i5,2e15.5)') ii,iii,potE(iii,ipar),efree
268 if (separate_parset) then
269 snk_p(iR,ib,1)=snk_p(iR,ib,1)+1
271 snk_p(iR,ib,ipar)=snk_p(iR,ib,ipar)+1
273 c write (iout,*) "iii",iii," iR",iR," ib",ib," ipar",ipar,
274 c & " snk",snk_p(iR,ib,ipar)
276 snk(iR,ib,ipar,islice)=snk(iR,ib,ipar,islice)+1
282 write (iout,*) "Me",me," scount_buff",scount_buff(me)
284 c Master gathers updated numbers of conformations written by all procs.
285 c call MPI_AllGather(MPI_IN_PLACE,1,MPI_DATATYPE_NULL,scount(0),1,
286 c & MPI_INTEGER, WHAM_COMM, IERROR)
287 call MPI_AllGather( scount_buff(me), 1, MPI_INTEGER, scount(0), 1,
288 & MPI_INTEGER, WHAM_COMM, IERROR)
293 indstart(i)=indend(i-1)+1
294 indend(i)=indstart(i)+scount(i)-1
297 write (iout,*) "Revised conformation counts"
299 write (iout,'(a,i5,a,i7,a,i7,a,i7)')
300 & "Processor",i," indstart",indstart(i),
301 & " indend",indend(i)," count",scount(i)
304 call MPI_AllReduce(snk_p(1,1,1),snk(1,1,1,islice),
305 & MaxR*MaxT_h*nParmSet,
306 & MPI_INTEGER,MPI_SUM,WHAM_COMM,IERROR)
312 stot(islice)=stot(islice)+snk(i,ib,iparm,islice)
316 write (iout,*) "Revised SNK"
319 write (iout,'("Param",i3," Temp",f6.1,3x,32i8)')
320 & iparm,1.0d0/(1.987D-3*beta_h(ib,iparm)),
321 & (snk(i,ib,iparm,islice),i=1,nR(ib,iparm))
322 write (iout,*) "snk_p",(snk_p(i,ib,iparm),i=1,nR(ib,iparm))
325 write (iout,'("Total",i10)') stot(islice)
328 101 write (iout,*) "Error in scratchfile."
332 c------------------------------------------------------------------------------
333 subroutine write_dbase(islice,*)
336 include "DIMENSIONS.ZSCOPT"
337 include "DIMENSIONS.FREE"
338 include "DIMENSIONS.COMPAR"
341 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
344 include "COMMON.CONTROL"
345 include "COMMON.CHAIN"
346 include "COMMON.IOUNITS"
347 include "COMMON.PROTFILES"
348 include "COMMON.NAMES"
350 include "COMMON.SBRIDGE"
352 include "COMMON.FFIELD"
353 include "COMMON.ENEPS"
354 include "COMMON.LOCAL"
355 include "COMMON.WEIGHTS"
356 include "COMMON.INTERACT"
357 include "COMMON.FREE"
358 include "COMMON.ENERGIES"
359 include "COMMON.COMPAR"
360 include "COMMON.PROT"
361 include "COMMON.CONTACTS1"
363 character*80 bxname,cxname
364 character*64 bprotfile_temp
365 character*3 liczba,licz
367 integer i,itj,ii,iii,j,k,l
370 double precision rmsdev,efree,eini
371 real*4 csingle(3,maxres2)
372 double precision energ
375 integer ir,ib,iparm, scount_buff(0:99)
376 integer isecstr(maxres)
377 write (licz2,'(bz,i2.2)') islice
378 call opentmp(islice,ientout,bprotfile_temp)
379 write (iout,*) "bprotfile_temp ",bprotfile_temp
381 if (.not.bxfile .and. .not. cxfile .and. indpdb.eq.0
382 & .and. ensembles.eq.0) then
383 close(ientout,status="delete")
387 write (liczba,'(bz,i3.3)') me
388 if (bxfile .or. cxfile .or. ensembles.gt.0) then
389 if (.not.separate_parset) then
390 bxname = prefix(:ilen(prefix))//liczba//".bx"
392 write (licz,'(bz,i3.3)') myparm
393 bxname = prefix(:ilen(prefix))//liczba//"_par"//licz//".bx"
395 open (ientin,file=bxname,status="unknown",
396 & form="unformatted",access="direct",recl=lenrec1)
399 if (bxfile .or. cxfile .or. ensembles.gt.0) then
400 if (nslice.eq.1) then
401 bxname = prefix(:ilen(prefix))//".bx"
403 bxname = prefix(:ilen(prefix))//
404 & "_slice_"//licz2//".bx"
406 open (ientin,file=bxname,status="unknown",
407 & form="unformatted",access="direct",recl=lenrec1)
408 write (iout,*) "Calculating energies; writing geometry",
409 & " and energy components to ",bxname(:ilen(bxname))
411 #if (defined(AIX) && !defined(JUBL))
412 call xdrfopen_(ixdrf,cxname, "w", iret)
414 call xdrfopen(ixdrf,cxname, "w", iret)
417 write (iout,*) "Error opening cxfile ",cxname(:ilen(cxname))
422 if (indpdb.gt.0) then
423 if (nslice.eq.1) then
425 if (.not.separate_parset) then
426 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))
429 write (licz,'(bz,i3.3)') myparm
430 statname=prefix(:ilen(prefix))//'_par'//licz//'_'//
431 & pot(:ilen(pot))//liczba//'.stat'
435 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//'.stat'
439 if (.not.separate_parset) then
440 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//
441 & "_slice_"//licz2//liczba//'.stat'
443 write (licz,'(bz,i3.3)') myparm
444 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//
445 & '_par'//licz//"_slice_"//licz2//liczba//'.stat'
448 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))
449 & //"_slice_"//licz2//'.stat'
452 open(istat,file=statname,status="unknown")
460 read(ientout,rec=i,err=101)
461 & ((csingle(l,k),l=1,3),k=1,nres),
462 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
463 & nss,(ihpb(k),jhpb(k),k=1,nss),
464 & eini,efree,rmsdev,(q(k,i),k=1,nQ),iR,ib,iparm
465 c write (iout,*) iR,ib,iparm,eini,efree
471 call int_from_cart1(.false.)
473 c write (iout,*) "Calling conf_compar",i
475 anatemp= 1.0d0/(beta_h(ib,iparm)*1.987D-3)
476 if (indpdb.gt.0) then
477 call conf_compar(i,.false.,.true.)
479 c call elecont(.false.,ncont,icont,nnt,nct)
480 c call secondary2(.false.,.false.,ncont,icont,isecstr)
482 c write (iout,*) "Exit conf_compar",i
484 if (bxfile .or.cxfile .or. ensembles.gt.0) write (ientin,rec=i)
485 & ((csingle(l,k),l=1,3),k=1,nres),
486 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
487 & nss,(ihpb(k),jhpb(k),k=1,nss),
488 c & potE(i,iparm),-entfac(i),rms_nat,iscore
489 & potE(i,nparmset),-entfac(i),rms_nat,iscore
490 c write (iout,'(2i5,3e15.5)') i,me,potE(i,iparm),-entfac(i)
492 if (cxfile) call cxwrite(ixdrf,csingle,potE(i,nparmset),
493 & -entfac(i),rms_nat,iscore)
496 close(ientout,status="delete")
498 if (bxfile .or. cxfile .or. ensembles.gt.0) close(ientin)
500 call MPI_Barrier(WHAM_COMM,IERROR)
501 if (me.ne.Master .or. .not.bxfile .and. .not. cxfile
502 & .and. ensembles.eq.0) return
504 if (bxfile .or. ensembles.gt.0) then
505 if (nslice.eq.1) then
506 if (.not.separate_parset) then
507 bxname = prefix(:ilen(prefix))//".bx"
509 write (licz,'(bz,i3.3)') myparm
510 bxname = prefix(:ilen(prefix))//"_par"//licz//".bx"
513 if (.not.separate_parset) then
514 bxname = prefix(:ilen(prefix))//"_slice_"//licz2//".bx"
516 write (licz,'(bz,i3.3)') myparm
517 bxname = prefix(:ilen(prefix))//"par_"//licz//
518 & "_slice_"//licz2//".bx"
521 open (ientout,file=bxname,status="unknown",
522 & form="unformatted",access="direct",recl=lenrec1)
523 write (iout,*) "Master is creating binary database ",
524 & bxname(:ilen(bxname))
527 if (nslice.eq.1) then
528 if (.not.separate_parset) then
529 cxname = prefix(:ilen(prefix))//".cx"
531 cxname = prefix(:ilen(prefix))//"_par"//licz//".cx"
534 if (.not.separate_parset) then
535 cxname = prefix(:ilen(prefix))//
536 & "_slice_"//licz2//".cx"
538 cxname = prefix(:ilen(prefix))//"_par"//licz//
539 & "_slice_"//licz2//".cx"
542 #if (defined(AIX) && !defined(JUBL))
543 call xdrfopen_(ixdrf,cxname, "w", iret)
545 call xdrfopen(ixdrf,cxname, "w", iret)
548 write (iout,*) "Error opening cxfile ",cxname(:ilen(cxname))
553 write (liczba,'(bz,i3.3)') j
554 if (separate_parset) then
555 write (licz,'(bz,i3.3)') myparm
556 bxname = prefix(:ilen(prefix))//liczba//"_par"//licz//".bx"
558 bxname = prefix(:ilen(prefix))//liczba//".bx"
560 open (ientin,file=bxname,status="unknown",
561 & form="unformatted",access="direct",recl=lenrec1)
562 write (iout,*) "Master is reading conformations from ",
563 & bxname(:ilen(bxname))
565 c write (iout,*) "j",j," indstart",indstart(j)," indend",indend(j)
567 do i=indstart(j),indend(j)
569 read(ientin,rec=iii,err=101)
570 & ((csingle(l,k),l=1,3),k=1,nres),
571 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
572 & nss,(ihpb(k),jhpb(k),k=1,nss),
573 & eini,efree,rmsdev,iscor
574 if (bxfile .or. ensembles.gt.0) then
575 write (ientout,rec=i)
576 & ((csingle(l,k),l=1,3),k=1,nres),
577 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
578 & nss,(ihpb(k),jhpb(k),k=1,nss),
579 & eini,efree,rmsdev,iscor
581 if(cxfile)call cxwrite(ixdrf,csingle,eini,efree,rmsdev,iscor)
588 call int_from_cart1(.false.)
589 write (iout,'(2i5,3e15.5)') i,iii,eini,efree
590 write (iout,*) "The Cartesian geometry is:"
591 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
592 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
593 write (iout,*) "The internal geometry is:"
594 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
595 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
596 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
597 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
598 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
599 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
600 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
601 write (iout,'(f10.5,i5)') rmsdev,iscor
604 write (iout,*) iii," conformations (from",indstart(j)," to",
605 & indend(j),") read from ",
606 & bxname(:ilen(bxname))
607 close (ientin,status="delete")
609 if (bxfile .or. cxfile .or. ensembles.gt.0) close (ientout)
610 #if (defined(AIX) && !defined(JUBL))
611 if (cxfile) call xdrfclose_(ixdrf,cxname,iret)
613 if (cxfile) call xdrfclose(ixdrf,cxname,iret)
617 101 write (iout,*) "Error in scratchfile."
621 c-------------------------------------------------------------------------------
622 subroutine cxwrite(ixdrf,csingle,eini,efree,rmsdev,iscor)
625 include "DIMENSIONS.ZSCOPT"
626 include "DIMENSIONS.FREE"
627 include "DIMENSIONS.COMPAR"
630 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
633 include "COMMON.CONTROL"
634 include "COMMON.CHAIN"
635 include "COMMON.IOUNITS"
636 include "COMMON.PROTFILES"
637 include "COMMON.NAMES"
639 include "COMMON.SBRIDGE"
641 include "COMMON.FFIELD"
642 include "COMMON.ENEPS"
643 include "COMMON.LOCAL"
644 include "COMMON.WEIGHTS"
645 include "COMMON.INTERACT"
646 include "COMMON.FREE"
647 include "COMMON.ENERGIES"
648 include "COMMON.COMPAR"
649 include "COMMON.PROT"
650 integer i,j,itmp,iscor,iret,ixdrf
651 double precision rmsdev,efree,eini
652 real*4 csingle(3,maxres2),xoord(3,maxres2+2)
655 c write (iout,*) "cxwrite"
660 xoord(j,i)=csingle(j,i)
665 xoord(j,nres+i-nnt+1)=csingle(j,i+nres)
671 c write (iout,*) "itmp",itmp
673 #if (defined(AIX) && !defined(JUBL))
674 call xdrf3dfcoord_(ixdrf, xoord, itmp, prec, iret)
676 c write (iout,*) "xdrf3dfcoord"
678 call xdrfint_(ixdrf, nss, iret)
681 call xdrfint(ixdrf, idssb(j)+nres, iret)
682 call xdrfint(ixdrf, jdssb(j)+nres, iret)
684 call xdrfint_(ixdrf, ihpb(j), iret)
685 call xdrfint_(ixdrf, jhpb(j), iret)
688 call xdrffloat_(ixdrf,real(eini),iret)
689 call xdrffloat_(ixdrf,real(efree),iret)
690 call xdrffloat_(ixdrf,real(rmsdev),iret)
691 call xdrfint_(ixdrf,iscor,iret)
693 call xdrf3dfcoord(ixdrf, xoord, itmp, prec, iret)
695 call xdrfint(ixdrf, nss, iret)
698 call xdrfint(ixdrf, idssb(j)+nres, iret)
699 call xdrfint(ixdrf, jdssb(j)+nres, iret)
701 call xdrfint(ixdrf, ihpb(j), iret)
702 call xdrfint(ixdrf, jhpb(j), iret)
705 call xdrffloat(ixdrf,real(eini),iret)
706 call xdrffloat(ixdrf,real(efree),iret)
707 call xdrffloat(ixdrf,real(rmsdev),iret)
708 call xdrfint(ixdrf,iscor,iret)
713 c------------------------------------------------------------------------------
714 logical function conf_check(ii,iprint)
717 include "DIMENSIONS.ZSCOPT"
718 include "DIMENSIONS.FREE"
721 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
724 include "COMMON.CHAIN"
725 include "COMMON.IOUNITS"
726 include "COMMON.PROTFILES"
727 include "COMMON.NAMES"
729 include "COMMON.SBRIDGE"
731 include "COMMON.FFIELD"
732 include "COMMON.ENEPS"
733 include "COMMON.LOCAL"
734 include "COMMON.WEIGHTS"
735 include "COMMON.INTERACT"
736 include "COMMON.FREE"
737 include "COMMON.ENERGIES"
738 include "COMMON.CONTROL"
739 include "COMMON.TORCNSTR"
740 integer j,k,l,ii,itj,iprint
741 if (.not.check_conf) then
745 call int_from_cart1(.false.)
747 if (itype(j-1).ne.ntyp1 .and. itype(j).ne.ntyp1 .and.
748 & (vbld(j).lt.2.0d0 .or. vbld(j).gt.5.0d0)) then
750 & write (iout,*) "Bad CA-CA bond length",j," ",vbld(j),
751 & " for conformation",ii
752 if (iprint.gt.1) then
753 write (iout,*) "The Cartesian geometry is:"
754 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
755 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
756 write (iout,*) "The internal geometry is:"
757 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
758 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
759 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
760 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
761 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
762 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
764 if (iprint.gt.0) write (iout,*)
765 & "This conformation WILL NOT be added to the database."
772 if (itype(j).ne.10 .and.itype(j).ne.ntyp1 .and.
773 & (vbld(nres+j)-dsc(iabs(itj))).gt.2.0d0) then
775 & write (iout,*) "Bad CA-SC bond length",j," ",vbld(nres+j),
776 & " for conformation",ii
777 if (iprint.gt.1) then
778 write (iout,*) "The Cartesian geometry is:"
779 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
780 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
781 write (iout,*) "The internal geometry is:"
782 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
783 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
784 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
785 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
786 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
787 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
789 if (iprint.gt.0) write (iout,*)
790 & "This conformation WILL NOT be added to the database."
796 if (theta(j).le.0.0d0) then
798 & write (iout,*) "Zero theta angle(s) in conformation",ii
799 if (iprint.gt.1) then
800 write (iout,*) "The Cartesian geometry is:"
801 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
802 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
803 write (iout,*) "The internal geometry is:"
804 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
805 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
806 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
807 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
808 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
809 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
811 if (iprint.gt.0) write (iout,*)
812 & "This conformation WILL NOT be added to the database."
816 if (theta(j).gt.179.97*deg2rad) theta(j)=179.97*deg2rad
819 c write (iout,*) "conf_check passed",ii