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(1)",ftors(1)
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 C write (iout,*) "The Cartesian geometry is:"
206 C write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
207 C write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
208 call pdbout(indstart(me1)+iii,
209 & 1.0d0/(1.987D-3*beta_h(ib,ipar)),
210 &energia(0),eini,0.0d0,0.0d0)
211 call enerprint(energia(0),fT)
212 errmsg_count=errmsg_count+1
213 if (errmsg_count.gt.maxerrmsg_count)
214 & write (iout,*) "Too many warning messages"
215 if (einicheck.gt.1) then
216 write (iout,*) "Calculation stopped."
219 call MPI_Abort(WHAM_COMM,IERROR,ERRCODE)
226 potE(iii+1,iparm)=energia(0)
228 enetb(k,iii+1,iparm)=energia(k)
231 write (iout,'(2i5,f10.1,3e15.5)') i,iii,
232 & 1.0d0/(beta_h(ib,ipar)*1.987D-3),energia(0),eini,efree
233 c call enerprint(energia(0),fT)
236 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
237 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
238 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
239 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
240 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
241 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
242 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
243 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
244 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
245 write (iout,'(8f10.5)') (q(k,iii+1),k=1,nQ)
246 write (iout,'(f10.5,i10)') rmsdev,iscor
247 call enerprint(energia(0),fT)
248 call pdbout(ii+1,beta_h(ib,ipar),efree,energia(0),0.0d0,rmsdev)
255 if (q(1,iii).le.0.0d0 .and. indpdb.gt.0) q(1,iii)=qwolynes(0,0)
256 write (ientout,rec=iii)
257 & ((csingle(l,k),l=1,3),k=1,nres),
258 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
259 & nss,(ihpb(k),jhpb(k),k=1,nss),
260 & potE(iii,ipar),efree,rmsdev,(q(k,iii),k=1,nQ),iR,ib,ipar
261 c write (iout,'(2i5,2e15.5)') ii,iii,potE(iii,ipar),efree
263 if (separate_parset) then
264 snk_p(iR,ib,1)=snk_p(iR,ib,1)+1
266 snk_p(iR,ib,ipar)=snk_p(iR,ib,ipar)+1
268 c write (iout,*) "iii",iii," iR",iR," ib",ib," ipar",ipar,
269 c & " snk",snk_p(iR,ib,ipar)
271 snk(iR,ib,ipar,islice)=snk(iR,ib,ipar,islice)+1
277 write (iout,*) "Me",me," scount_buff",scount_buff(me)
279 c Master gathers updated numbers of conformations written by all procs.
280 c call MPI_AllGather(MPI_IN_PLACE,1,MPI_DATATYPE_NULL,scount(0),1,
281 c & MPI_INTEGER, WHAM_COMM, IERROR)
282 call MPI_AllGather( scount_buff(me), 1, MPI_INTEGER, scount(0), 1,
283 & MPI_INTEGER, WHAM_COMM, IERROR)
288 indstart(i)=indend(i-1)+1
289 indend(i)=indstart(i)+scount(i)-1
292 write (iout,*) "Revised conformation counts"
294 write (iout,'(a,i5,a,i7,a,i7,a,i7)')
295 & "Processor",i," indstart",indstart(i),
296 & " indend",indend(i)," count",scount(i)
299 call MPI_AllReduce(snk_p(1,1,1),snk(1,1,1,islice),
300 & MaxR*MaxT_h*nParmSet,
301 & MPI_INTEGER,MPI_SUM,WHAM_COMM,IERROR)
307 stot(islice)=stot(islice)+snk(i,ib,iparm,islice)
311 write (iout,*) "Revised SNK"
314 write (iout,'("Param",i3," Temp",f6.1,3x,32i8)')
315 & iparm,1.0d0/(1.987D-3*beta_h(ib,iparm)),
316 & (snk(i,ib,iparm,islice),i=1,nR(ib,iparm))
317 write (iout,*) "snk_p",(snk_p(i,ib,iparm),i=1,nR(ib,iparm))
320 write (iout,'("Total",i10)') stot(islice)
323 101 write (iout,*) "Error in scratchfile."
327 c------------------------------------------------------------------------------
328 subroutine write_dbase(islice,*)
331 include "DIMENSIONS.ZSCOPT"
332 include "DIMENSIONS.FREE"
333 include "DIMENSIONS.COMPAR"
336 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
339 include "COMMON.CONTROL"
340 include "COMMON.CHAIN"
341 include "COMMON.IOUNITS"
342 include "COMMON.PROTFILES"
343 include "COMMON.NAMES"
345 include "COMMON.SBRIDGE"
347 include "COMMON.FFIELD"
348 include "COMMON.ENEPS"
349 include "COMMON.LOCAL"
350 include "COMMON.WEIGHTS"
351 include "COMMON.INTERACT"
352 include "COMMON.FREE"
353 include "COMMON.ENERGIES"
354 include "COMMON.COMPAR"
355 include "COMMON.PROT"
356 include "COMMON.CONTACTS1"
358 character*80 bxname,cxname
359 character*64 bprotfile_temp
360 character*3 liczba,licz
362 integer i,itj,ii,iii,j,k,l
365 double precision rmsdev,efree,eini
366 real*4 csingle(3,maxres2)
367 double precision energ
370 integer ir,ib,iparm, scount_buff(0:99)
371 integer isecstr(maxres)
372 write (licz2,'(bz,i2.2)') islice
373 call opentmp(islice,ientout,bprotfile_temp)
374 write (iout,*) "bprotfile_temp ",bprotfile_temp
376 if (.not.bxfile .and. .not. cxfile .and. indpdb.eq.0
377 & .and. ensembles.eq.0) then
378 close(ientout,status="delete")
382 write (liczba,'(bz,i3.3)') me
383 if (bxfile .or. cxfile .or. ensembles.gt.0) then
384 if (.not.separate_parset) then
385 bxname = prefix(:ilen(prefix))//liczba//".bx"
387 write (licz,'(bz,i3.3)') myparm
388 bxname = prefix(:ilen(prefix))//liczba//"_par"//licz//".bx"
390 open (ientin,file=bxname,status="unknown",
391 & form="unformatted",access="direct",recl=lenrec1)
394 if (bxfile .or. cxfile .or. ensembles.gt.0) then
395 if (nslice.eq.1) then
396 bxname = prefix(:ilen(prefix))//".bx"
398 bxname = prefix(:ilen(prefix))//
399 & "_slice_"//licz2//".bx"
401 open (ientin,file=bxname,status="unknown",
402 & form="unformatted",access="direct",recl=lenrec1)
403 write (iout,*) "Calculating energies; writing geometry",
404 & " and energy components to ",bxname(:ilen(bxname))
406 #if (defined(AIX) && !defined(JUBL))
407 call xdrfopen_(ixdrf,cxname, "w", iret)
409 call xdrfopen(ixdrf,cxname, "w", iret)
412 write (iout,*) "Error opening cxfile ",cxname(:ilen(cxname))
417 if (indpdb.gt.0) then
418 if (nslice.eq.1) then
420 if (.not.separate_parset) then
421 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))
424 write (licz,'(bz,i3.3)') myparm
425 statname=prefix(:ilen(prefix))//'_par'//licz//'_'//
426 & pot(:ilen(pot))//liczba//'.stat'
430 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//'.stat'
434 if (.not.separate_parset) then
435 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//
436 & "_slice_"//licz2//liczba//'.stat'
438 write (licz,'(bz,i3.3)') myparm
439 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//
440 & '_par'//licz//"_slice_"//licz2//liczba//'.stat'
443 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))
444 & //"_slice_"//licz2//'.stat'
447 open(istat,file=statname,status="unknown")
455 read(ientout,rec=i,err=101)
456 & ((csingle(l,k),l=1,3),k=1,nres),
457 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
458 & nss,(ihpb(k),jhpb(k),k=1,nss),
459 & eini,efree,rmsdev,(q(k,i),k=1,nQ),iR,ib,iparm
460 c write (iout,*) iR,ib,iparm,eini,efree
466 call int_from_cart1(.false.)
468 c write (iout,*) "Calling conf_compar",i
470 anatemp= 1.0d0/(beta_h(ib,iparm)*1.987D-3)
471 if (indpdb.gt.0) then
472 call conf_compar(i,.false.,.true.)
474 c call elecont(.false.,ncont,icont,nnt,nct)
475 c call secondary2(.false.,.false.,ncont,icont,isecstr)
477 c write (iout,*) "Exit conf_compar",i
479 if (bxfile .or.cxfile .or. ensembles.gt.0) write (ientin,rec=i)
480 & ((csingle(l,k),l=1,3),k=1,nres),
481 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
482 & nss,(ihpb(k),jhpb(k),k=1,nss),
483 c & potE(i,iparm),-entfac(i),rms_nat,iscore
484 & potE(i,nparmset),-entfac(i),rms_nat,iscore
485 c write (iout,'(2i5,3e15.5)') i,me,potE(i,iparm),-entfac(i)
487 if (cxfile) call cxwrite(ixdrf,csingle,potE(i,nparmset),
488 & -entfac(i),rms_nat,iscore)
491 close(ientout,status="delete")
493 if (bxfile .or. cxfile .or. ensembles.gt.0) close(ientin)
495 call MPI_Barrier(WHAM_COMM,IERROR)
496 if (me.ne.Master .or. .not.bxfile .and. .not. cxfile
497 & .and. ensembles.eq.0) return
499 if (bxfile .or. ensembles.gt.0) then
500 if (nslice.eq.1) then
501 if (.not.separate_parset) then
502 bxname = prefix(:ilen(prefix))//".bx"
504 write (licz,'(bz,i3.3)') myparm
505 bxname = prefix(:ilen(prefix))//"_par"//licz//".bx"
508 if (.not.separate_parset) then
509 bxname = prefix(:ilen(prefix))//"_slice_"//licz2//".bx"
511 write (licz,'(bz,i3.3)') myparm
512 bxname = prefix(:ilen(prefix))//"par_"//licz//
513 & "_slice_"//licz2//".bx"
516 open (ientout,file=bxname,status="unknown",
517 & form="unformatted",access="direct",recl=lenrec1)
518 write (iout,*) "Master is creating binary database ",
519 & bxname(:ilen(bxname))
522 if (nslice.eq.1) then
523 if (.not.separate_parset) then
524 cxname = prefix(:ilen(prefix))//".cx"
526 cxname = prefix(:ilen(prefix))//"_par"//licz//".cx"
529 if (.not.separate_parset) then
530 cxname = prefix(:ilen(prefix))//
531 & "_slice_"//licz2//".cx"
533 cxname = prefix(:ilen(prefix))//"_par"//licz//
534 & "_slice_"//licz2//".cx"
537 #if (defined(AIX) && !defined(JUBL))
538 call xdrfopen_(ixdrf,cxname, "w", iret)
540 call xdrfopen(ixdrf,cxname, "w", iret)
543 write (iout,*) "Error opening cxfile ",cxname(:ilen(cxname))
548 write (liczba,'(bz,i3.3)') j
549 if (separate_parset) then
550 write (licz,'(bz,i3.3)') myparm
551 bxname = prefix(:ilen(prefix))//liczba//"_par"//licz//".bx"
553 bxname = prefix(:ilen(prefix))//liczba//".bx"
555 open (ientin,file=bxname,status="unknown",
556 & form="unformatted",access="direct",recl=lenrec1)
557 write (iout,*) "Master is reading conformations from ",
558 & bxname(:ilen(bxname))
560 c write (iout,*) "j",j," indstart",indstart(j)," indend",indend(j)
562 do i=indstart(j),indend(j)
564 read(ientin,rec=iii,err=101)
565 & ((csingle(l,k),l=1,3),k=1,nres),
566 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
567 & nss,(ihpb(k),jhpb(k),k=1,nss),
568 & eini,efree,rmsdev,iscor
569 if (bxfile .or. ensembles.gt.0) then
570 write (ientout,rec=i)
571 & ((csingle(l,k),l=1,3),k=1,nres),
572 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
573 & nss,(ihpb(k),jhpb(k),k=1,nss),
574 & eini,efree,rmsdev,iscor
576 if(cxfile)call cxwrite(ixdrf,csingle,eini,efree,rmsdev,iscor)
583 call int_from_cart1(.false.)
584 write (iout,'(2i5,3e15.5)') i,iii,eini,efree
585 write (iout,*) "The Cartesian geometry is:"
586 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
587 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
588 write (iout,*) "The internal geometry is:"
589 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
590 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
591 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
592 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
593 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
594 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
595 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
596 write (iout,'(f10.5,i5)') rmsdev,iscor
599 write (iout,*) iii," conformations (from",indstart(j)," to",
600 & indend(j),") read from ",
601 & bxname(:ilen(bxname))
602 close (ientin,status="delete")
604 if (bxfile .or. cxfile .or. ensembles.gt.0) close (ientout)
605 #if (defined(AIX) && !defined(JUBL))
606 if (cxfile) call xdrfclose_(ixdrf,cxname,iret)
608 if (cxfile) call xdrfclose(ixdrf,cxname,iret)
612 101 write (iout,*) "Error in scratchfile."
616 c-------------------------------------------------------------------------------
617 subroutine cxwrite(ixdrf,csingle,eini,efree,rmsdev,iscor)
620 include "DIMENSIONS.ZSCOPT"
621 include "DIMENSIONS.FREE"
622 include "DIMENSIONS.COMPAR"
625 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
628 include "COMMON.CONTROL"
629 include "COMMON.CHAIN"
630 include "COMMON.IOUNITS"
631 include "COMMON.PROTFILES"
632 include "COMMON.NAMES"
634 include "COMMON.SBRIDGE"
636 include "COMMON.FFIELD"
637 include "COMMON.ENEPS"
638 include "COMMON.LOCAL"
639 include "COMMON.WEIGHTS"
640 include "COMMON.INTERACT"
641 include "COMMON.FREE"
642 include "COMMON.ENERGIES"
643 include "COMMON.COMPAR"
644 include "COMMON.PROT"
645 integer i,j,itmp,iscor,iret,ixdrf
646 double precision rmsdev,efree,eini
647 real*4 csingle(3,maxres2),xoord(3,maxres2+2)
650 c write (iout,*) "cxwrite"
655 xoord(j,i)=csingle(j,i)
660 xoord(j,nres+i-nnt+1)=csingle(j,i+nres)
666 c write (iout,*) "itmp",itmp
668 #if (defined(AIX) && !defined(JUBL))
669 call xdrf3dfcoord_(ixdrf, xoord, itmp, prec, iret)
671 c write (iout,*) "xdrf3dfcoord"
673 call xdrfint_(ixdrf, nss, iret)
676 call xdrfint(ixdrf, idssb(j)+nres, iret)
677 call xdrfint(ixdrf, jdssb(j)+nres, iret)
679 call xdrfint_(ixdrf, ihpb(j), iret)
680 call xdrfint_(ixdrf, jhpb(j), iret)
683 call xdrffloat_(ixdrf,real(eini),iret)
684 call xdrffloat_(ixdrf,real(efree),iret)
685 call xdrffloat_(ixdrf,real(rmsdev),iret)
686 call xdrfint_(ixdrf,iscor,iret)
688 call xdrf3dfcoord(ixdrf, xoord, itmp, prec, iret)
690 call xdrfint(ixdrf, nss, iret)
693 call xdrfint(ixdrf, idssb(j)+nres, iret)
694 call xdrfint(ixdrf, jdssb(j)+nres, iret)
696 call xdrfint(ixdrf, ihpb(j), iret)
697 call xdrfint(ixdrf, jhpb(j), iret)
700 call xdrffloat(ixdrf,real(eini),iret)
701 call xdrffloat(ixdrf,real(efree),iret)
702 call xdrffloat(ixdrf,real(rmsdev),iret)
703 call xdrfint(ixdrf,iscor,iret)
708 c------------------------------------------------------------------------------
709 logical function conf_check(ii,iprint)
712 include "DIMENSIONS.ZSCOPT"
713 include "DIMENSIONS.FREE"
716 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
719 include "COMMON.CHAIN"
720 include "COMMON.IOUNITS"
721 include "COMMON.PROTFILES"
722 include "COMMON.NAMES"
724 include "COMMON.SBRIDGE"
726 include "COMMON.FFIELD"
727 include "COMMON.ENEPS"
728 include "COMMON.LOCAL"
729 include "COMMON.WEIGHTS"
730 include "COMMON.INTERACT"
731 include "COMMON.FREE"
732 include "COMMON.ENERGIES"
733 include "COMMON.CONTROL"
734 include "COMMON.TORCNSTR"
735 integer j,k,l,ii,itj,iprint
736 if (.not.check_conf) then
740 call int_from_cart1(.false.)
742 if (itype(j-1).ne.ntyp1 .and. itype(j).ne.ntyp1 .and.
743 & (vbld(j).lt.2.0d0 .or. vbld(j).gt.5.0d0)) then
745 & write (iout,*) "Bad CA-CA bond length",j," ",vbld(j),
746 & " for conformation",ii
747 if (iprint.gt.1) then
748 write (iout,*) "The Cartesian geometry is:"
749 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
750 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
751 write (iout,*) "The internal geometry is:"
752 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
753 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
754 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
755 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
756 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
757 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
759 if (iprint.gt.0) write (iout,*)
760 & "This conformation WILL NOT be added to the database."
767 if (itype(j).ne.10 .and.itype(j).ne.ntyp1 .and.
768 & (vbld(nres+j)-dsc(iabs(itj))).gt.2.0d0) then
770 & write (iout,*) "Bad CA-SC bond length",j," ",vbld(nres+j),
771 & " for conformation",ii
772 if (iprint.gt.1) then
773 write (iout,*) "The Cartesian geometry is:"
774 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
775 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
776 write (iout,*) "The internal geometry is:"
777 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
778 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
779 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
780 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
781 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
782 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
784 if (iprint.gt.0) write (iout,*)
785 & "This conformation WILL NOT be added to the database."
791 if (theta(j).le.0.0d0) then
793 & write (iout,*) "Zero theta angle(s) in conformation",ii
794 if (iprint.gt.1) then
795 write (iout,*) "The Cartesian geometry is:"
796 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
797 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
798 write (iout,*) "The internal geometry is:"
799 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
800 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
801 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
802 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
803 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
804 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
806 if (iprint.gt.0) write (iout,*)
807 & "This conformation WILL NOT be added to the database."
811 if (theta(j).gt.179.97*deg2rad) theta(j)=179.97*deg2rad
814 c write (iout,*) "conf_check passed",ii