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,scme,itmp
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
78 cc write(iout,*), 'NAWEJ',i,eini
87 c(l,k+nres)=csingle(l,k+nres)
90 q(nQ+1,iii+1)=rmsnat(iii+1)
92 q(nQ+2,iii+1)=gyrate(iii+1)
93 c fT=T0*beta_h(ib,ipar)*1.987D-3
94 c ft=2.0d0/(1.0d0+1.0d0/(T0*beta_h(ib,ipar)*1.987D-3))
95 if (rescale_mode.eq.1) then
96 quot=1.0d0/(T0*beta_h(ib,ipar)*1.987D-3)
98 tt = 1.0d0/(beta_h(ib,ipar)*1.987D-3)
99 ft(6)=(320.0+80.0*dtanh((tt-320.0)/80.0))/320.0
110 fT(l)=kfacl/(kfacl-1.0d0+quotl)
112 else if (rescale_mode.eq.2) then
113 quot=1.0d0/(T0*beta_h(ib,ipar)*1.987D-3)
115 tt = 1.0d0/(beta_h(ib,ipar)*1.987D-3)
116 ft(6)=(320.0+80.0*dtanh((tt-320.0)/80.0))/320.0
125 fT(l)=1.12692801104297249644d0/
126 & dlog(dexp(quotl)+dexp(-quotl))
128 else if (rescale_mode.eq.0) then
133 write (iout,*) "Error in ECECALC: wrong RESCALE_MODE",
139 c write (iout,*) "T",1.0d0/(beta_h(ib,ipar)*1.987D-3)," T0",T0,
140 c & " kfac",kfac,"quot",quot," fT",fT
146 call int_from_cart1(.false.)
150 call restore_parm(iparm)
152 write (iout,*) wsc,wscp,welec,wvdwpp,wang,wtor,wscloc,
153 & wcorr,wcorr5,wcorr6,wturn4,wturn3,wturn6,wel_loc,
154 & wtor_d,wsccor,wbond
156 call etotal(energia(0),fT)
158 write (iout,*) "Conformation",i
159 call enerprint(energia(0),fT)
160 c write (iout,'(2i5,21f8.2)') i,iparm,(energia(k),k=1,21)
161 c write (iout,*) "ftors",ftors
164 if (energia(0).ge.1.0d20) then
165 write (iout,*) "NaNs detected in some of the energy",
166 & " components for conformation",ii+1
167 write (iout,*) "The Cartesian geometry is:"
168 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
169 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
170 write (iout,*) "The internal geometry is:"
172 c call pdbout(ii+1,beta_h(ib,ipar),efree,energia(0),0.0d0,rmsdev)
173 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
174 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
175 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
176 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
177 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
178 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
179 write (iout,*) "The components of the energy are:"
180 call enerprint(energia(0),fT)
182 & "This conformation WILL NOT be added to the database."
187 if (ipar.eq.iparm) write (iout,*) i,iparm,
188 & 1.0d0/(beta_h(ib,ipar)*1.987D-3),eini,energia(0)
190 if (ipar.eq.iparm .and. einicheck.gt.0 .and.
191 & dabs(eini-energia(0)).gt.tole) then
192 if (errmsg_count.le.maxerrmsg_count) then
193 write (iout,'(2a,2e15.5,a,2i8,a,f8.1)')
194 & "Warning: energy differs remarkably from ",
195 & " the value read in: ",energia(0),eini," point",
196 & iii+1,indstart(me1)+iii," T",
197 & 1.0d0/(1.987D-3*beta_h(ib,ipar))
198 call enerprint(energia(0),fT)
201 c call pdbout(iii+1,beta_h(ib,ipar),
202 c & eini,energia(0),0.0d0,rmsdev)
210 errmsg_count=errmsg_count+1
211 if (errmsg_count.gt.maxerrmsg_count)
212 & write (iout,*) "Too many warning messages"
213 if (einicheck.gt.1) then
214 write (iout,*) "Calculation stopped."
217 call MPI_Abort(WHAM_COMM,IERROR,ERRCODE)
224 potE(iii+1,iparm)=energia(0)
226 enetb(k,iii+1,iparm)=energia(k)
228 c write(iout,*) "iCHUJ TU STRZELI",i,iii,entfac(i)
229 c call enerprint(energia(0),fT)
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 call enerprint(energia(0),fT)
234 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
235 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
236 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
237 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
238 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
239 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
240 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
241 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
242 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
243 write (iout,'(8f10.5)') (q(k,iii+1),k=1,nQ)
244 write (iout,'(f10.5,i10)') rmsdev,iscor
245 call enerprint(energia(0),fT)
246 write(liczba,'(bz,i3.3)') me
247 nazwa="test"//liczba//".pdb"
248 write (iout,*) "pdb file",nazwa
249 open (ipdb,file=nazwa,position="append")
250 call pdbout(ii+1,beta_h(ib,ipar),efree,energia(0),0.0d0,rmsdev)
258 if (q(1,iii).le.0.0d0 .and. indpdb.gt.0) q(1,iii)=qwolynes(0,0)
259 write (ientout,rec=iii)
260 & ((csingle(l,k),l=1,3),k=1,nres),
261 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
262 & nss,(ihpb(k),jhpb(k),k=1,nss),
263 & potE(iii,ipar),efree,rmsdev,(q(k,iii),k=1,nQ),iR,ib,ipar
264 c write (iout,'(2i5,2e15.5)') ii,iii,potE(iii,ipar),efree
266 if (separate_parset) then
267 snk_p(iR,ib,1)=snk_p(iR,ib,1)+1
269 snk_p(iR,ib,ipar)=snk_p(iR,ib,ipar)+1
271 c write (iout,*) "iii",iii," iR",iR," ib",ib," ipar",ipar,
272 c & " snk",snk_p(iR,ib,ipar)
274 snk(iR,ib,ipar,islice)=snk(iR,ib,ipar,islice)+1
280 write (iout,*) "Me",me," scount",scount(me)
282 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"
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
371 write (licz2,'(bz,i2.2)') islice
372 call opentmp(islice,ientout,bprotfile_temp)
373 write (iout,*) "bprotfile_temp ",bprotfile_temp
375 if (.not.bxfile .and. .not. cxfile .and. indpdb.eq.0
376 & .and. ensembles.eq.0) then
377 close(ientout,status="delete")
381 write (liczba,'(bz,i3.3)') me
382 if (bxfile .or. cxfile .or. ensembles.gt.0) then
383 if (.not.separate_parset) then
384 bxname = prefix(:ilen(prefix))//liczba//".bx"
386 write (licz,'(bz,i3.3)') myparm
387 bxname = prefix(:ilen(prefix))//liczba//"_par"//licz//".bx"
389 open (ientin,file=bxname,status="unknown",
390 & form="unformatted",access="direct",recl=lenrec1)
393 if (bxfile .or. cxfile .or. ensembles.gt.0) then
394 if (nslice.eq.1) then
395 bxname = prefix(:ilen(prefix))//".bx"
397 bxname = prefix(:ilen(prefix))//
398 & "_slice_"//licz2//".bx"
400 open (ientin,file=bxname,status="unknown",
401 & form="unformatted",access="direct",recl=lenrec1)
402 write (iout,*) "Calculating energies; writing geometry",
403 & " and energy components to ",bxname(:ilen(bxname))
405 #if (defined(AIX) && !defined(JUBL))
406 call xdrfopen_(ixdrf,cxname, "w", iret)
408 call xdrfopen(ixdrf,cxname, "w", iret)
411 write (iout,*) "Error opening cxfile ",cxname(:ilen(cxname))
416 if (indpdb.gt.0) then
417 if (nslice.eq.1) then
419 if (.not.separate_parset) then
420 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))
423 write (licz,'(bz,i3.3)') myparm
424 statname=prefix(:ilen(prefix))//'_par'//licz//'_'//
425 & pot(:ilen(pot))//liczba//'.stat'
429 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//'.stat'
433 if (.not.separate_parset) then
434 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//
435 & "_slice_"//licz2//liczba//'.stat'
437 write (licz,'(bz,i3.3)') myparm
438 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//
439 & '_par'//licz//"_slice_"//licz2//liczba//'.stat'
442 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))
443 & //"_slice_"//licz2//'.stat'
446 open(istat,file=statname,status="unknown")
455 cc read(ientout,rec=i,err=101)
456 cc & ((csingle(l,k),l=1,3),k=1,nres),
457 cc & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
458 cc & nss,(idssb(k),jdssb(k),k=1,nss),
459 cc & eini,efree,rmsdev,(q(k,i),k=1,nQ),iR,ib,iparm
460 cc idssb(k)=idssb(k)-nres
461 cc jdssb(k)=jdssb(k)-nres
463 read(ientout,rec=i,err=101)
464 & ((csingle(l,k),l=1,3),k=1,nres),
465 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
466 & nss,(ihpb(k),jhpb(k),k=1,nss),
467 & eini,efree,rmsdev,(q(k,i),k=1,nQ),iR,ib,iparm
469 cc write (iout,*) 'CC', iR,ib,iparm,eini,efree
475 call int_from_cart1(.false.)
477 if (indpdb.gt.0) then
478 call conf_compar(i,.false.,.true.)
481 if (bxfile .or.cxfile .or. ensembles.gt.0) write (ientin,rec=i)
482 & ((csingle(l,k),l=1,3),k=1,nres),
483 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
484 & nss,(ihpb(k),jhpb(k),k=1,nss),
485 c & potE(i,iparm),-entfac(i),rms_nat,iscore
486 & potE(i,nparmset),-entfac(i),rms_nat,iscore
488 if (bxfile .or.cxfile .or. ensembles.gt.0) write
490 & ((csingle(l,k),l=1,3),k=1,nres),
491 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
492 & nss,(ihpb(k),jhpb(k),k=1,nss),
493 c & potE(i,iparm),-entfac(i),rms_nat,iscore
494 & potE(i,nparmset),-entfac(i),rms_nat,iscore
496 write (iout,'(2i5,3e15.5)') i,me,potE(i,iparm),-entfac(i)
498 if (cxfile) call cxwrite(ixdrf,csingle,potE(i,nparmset),
499 & -entfac(i),rms_nat,iscore)
502 close(ientout,status="delete")
504 if (bxfile .or. cxfile .or. ensembles.gt.0) close(ientin)
506 call MPI_Barrier(WHAM_COMM,IERROR)
507 if (me.ne.Master .or. .not.bxfile .and. .not. cxfile
508 & .and. ensembles.eq.0) return
510 if (bxfile .or. ensembles.gt.0) then
511 if (nslice.eq.1) then
512 if (.not.separate_parset) then
513 bxname = prefix(:ilen(prefix))//".bx"
515 write (licz,'(bz,i3.3)') myparm
516 bxname = prefix(:ilen(prefix))//"_par"//licz//".bx"
519 if (.not.separate_parset) then
520 bxname = prefix(:ilen(prefix))//"_slice_"//licz2//".bx"
522 write (licz,'(bz,i3.3)') myparm
523 bxname = prefix(:ilen(prefix))//"par_"//licz//
524 & "_slice_"//licz2//".bx"
527 open (ientout,file=bxname,status="unknown",
528 & form="unformatted",access="direct",recl=lenrec1)
529 write (iout,*) "Master is creating binary database ",
530 & bxname(:ilen(bxname))
533 if (nslice.eq.1) then
534 if (.not.separate_parset) then
535 cxname = prefix(:ilen(prefix))//".cx"
537 cxname = prefix(:ilen(prefix))//"_par"//licz//".cx"
540 if (.not.separate_parset) then
541 cxname = prefix(:ilen(prefix))//
542 & "_slice_"//licz2//".cx"
544 cxname = prefix(:ilen(prefix))//"_par"//licz//
545 & "_slice_"//licz2//".cx"
548 #if (defined(AIX) && !defined(JUBL))
549 call xdrfopen_(ixdrf,cxname, "w", iret)
551 call xdrfopen(ixdrf,cxname, "w", iret)
554 write (iout,*) "Error opening cxfile ",cxname(:ilen(cxname))
559 write (liczba,'(bz,i3.3)') j
560 if (separate_parset) then
561 write (licz,'(bz,i3.3)') myparm
562 bxname = prefix(:ilen(prefix))//liczba//"_par"//licz//".bx"
564 bxname = prefix(:ilen(prefix))//liczba//".bx"
566 open (ientin,file=bxname,status="unknown",
567 & form="unformatted",access="direct",recl=lenrec1)
568 write (iout,*) "Master is reading conformations from ",
569 & bxname(:ilen(bxname))
571 c write (iout,*) "j",j," indstart",indstart(j)," indend",indend(j)
573 do i=indstart(j),indend(j)
576 cc read(ientin,rec=iii,err=101)
577 cc & ((csingle(l,k),l=1,3),k=1,nres),
578 cc & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
579 cc & nss,(idssb(k),jdssb(k),k=1,nss),
580 cc & eini,efree,rmsdev,iscor
581 cc idssb(k)=idssb(k)-nres
582 cc jdssb(k)=jdssb(k)-nres
584 read(ientin,rec=iii,err=101)
585 & ((csingle(l,k),l=1,3),k=1,nres),
586 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
587 & nss,(ihpb(k),jhpb(k),k=1,nss),
588 & eini,efree,rmsdev,iscor
590 if (bxfile .or. ensembles.gt.0) then
592 cc write (ientout,rec=i)
593 cc & ((csingle(l,k),l=1,3),k=1,nres),
594 cc & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
595 cc & nss,(idssb(k)+nres,jdssb(k)+nres,k=1,nss),
596 cc & eini,efree,rmsdev,iscor
598 write (ientout,rec=i)
599 & ((csingle(l,k),l=1,3),k=1,nres),
600 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
601 & nss,(ihpb(k),jhpb(k),k=1,nss),
602 & eini,efree,rmsdev,iscor
603 cc write(iout,*) "W poszukiwaniu zlotych galotow"
604 cc write(iout,*) "efree=",efree,iii
607 if(cxfile)call cxwrite(ixdrf,csingle,eini,efree,rmsdev,iscor)
614 call int_from_cart1(.false.)
615 write (iout,'(2i5,3e15.5)') i,iii,eini,efree
616 write (iout,*) "The Cartesian geometry is:"
617 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
618 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
619 write (iout,*) "The internal geometry is:"
620 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
621 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
622 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
623 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
624 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
625 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
626 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
627 write (iout,'(f10.5,i5)') rmsdev,iscor
630 write (iout,*) iii," conformations (from",indstart(j)," to",
631 & indend(j),") read from ",
632 & bxname(:ilen(bxname))
633 close (ientin,status="delete")
635 if (bxfile .or. cxfile .or. ensembles.gt.0) close (ientout)
636 #if (defined(AIX) && !defined(JUBL))
637 if (cxfile) call xdrfclose_(ixdrf,cxname,iret)
639 if (cxfile) call xdrfclose(ixdrf,cxname,iret)
643 101 write (iout,*) "Error in scratchfile."
647 c-------------------------------------------------------------------------------
648 subroutine cxwrite(ixdrf,csingle,eini,efree,rmsdev,iscor)
651 include "DIMENSIONS.ZSCOPT"
652 include "DIMENSIONS.FREE"
653 include "DIMENSIONS.COMPAR"
656 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
659 include "COMMON.CONTROL"
660 include "COMMON.CHAIN"
661 include "COMMON.IOUNITS"
662 include "COMMON.PROTFILES"
663 include "COMMON.NAMES"
665 include "COMMON.SBRIDGE"
667 include "COMMON.FFIELD"
668 include "COMMON.ENEPS"
669 include "COMMON.LOCAL"
670 include "COMMON.WEIGHTS"
671 include "COMMON.INTERACT"
672 include "COMMON.FREE"
673 include "COMMON.ENERGIES"
674 include "COMMON.COMPAR"
675 include "COMMON.PROT"
676 integer i,j,itmp,iscor,iret,ixdrf
677 double precision rmsdev,efree,eini
678 real*4 csingle(3,maxres2),xoord(3,maxres2+2)
681 c write (iout,*) "cxwrite"
686 xoord(j,i)=csingle(j,i)
691 xoord(j,nres+i-nnt+1)=csingle(j,i+nres)
697 c write (iout,*) "itmp",itmp
699 c write (iout,*) "CNZ",eini,dyn_ss
700 #if (defined(AIX) && !defined(JUBL))
701 call xdrf3dfcoord_(ixdrf, xoord, itmp, prec, iret)
703 c write (iout,*) "xdrf3dfcoord"
705 call xdrfint_(ixdrf, nss, iret)
708 cc call xdrfint_(ixdrf, idssb(j)+nres, iret)
709 cc call xdrfint_(ixdrf, jdssb(j)+nres, iret)
711 call xdrfint_(ixdrf, ihpb(j), iret)
712 call xdrfint_(ixdrf, jhpb(j), iret)
715 call xdrffloat_(ixdrf,real(eini),iret)
716 call xdrffloat_(ixdrf,real(efree),iret)
717 call xdrffloat_(ixdrf,real(rmsdev),iret)
718 call xdrfint_(ixdrf,iscor,iret)
720 call xdrf3dfcoord(ixdrf, xoord, itmp, prec, iret)
722 call xdrfint(ixdrf, nss, iret)
725 cc call xdrfint(ixdrf, idssb(j), iret)
726 cc call xdrfint(ixdrf, jdssb(j), iret)
727 cc idssb(j)=idssb(j)-nres
728 cc jdssb(j)=jdssb(j)-nres
730 call xdrfint(ixdrf, ihpb(j), iret)
731 call xdrfint(ixdrf, jhpb(j), iret)
734 call xdrffloat(ixdrf,real(eini),iret)
735 call xdrffloat(ixdrf,real(efree),iret)
736 call xdrffloat(ixdrf,real(rmsdev),iret)
737 call xdrfint(ixdrf,iscor,iret)
742 c------------------------------------------------------------------------------
743 logical function conf_check(ii,iprint)
746 include "DIMENSIONS.ZSCOPT"
747 include "DIMENSIONS.FREE"
750 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
753 include "COMMON.CHAIN"
754 include "COMMON.IOUNITS"
755 include "COMMON.PROTFILES"
756 include "COMMON.NAMES"
758 include "COMMON.SBRIDGE"
760 include "COMMON.FFIELD"
761 include "COMMON.ENEPS"
762 include "COMMON.LOCAL"
763 include "COMMON.WEIGHTS"
764 include "COMMON.INTERACT"
765 include "COMMON.FREE"
766 include "COMMON.ENERGIES"
767 include "COMMON.CONTROL"
768 include "COMMON.TORCNSTR"
769 integer j,k,l,ii,itj,iprint
770 if (.not.check_conf) then
774 call int_from_cart1(.false.)
776 if (vbld(j).lt.2.0d0 .or. vbld(j).gt.5.0d0) then
778 & write (iout,*) "Bad CA-CA bond length",j," ",vbld(j),
779 & " for conformation",ii
780 if (iprint.gt.1) then
781 write (iout,*) "The Cartesian geometry is:"
782 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
783 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
784 write (iout,*) "The internal geometry is:"
785 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
786 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
787 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
788 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
789 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
790 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
792 if (iprint.gt.0) write (iout,*)
793 & "This conformation WILL NOT be added to the database."
800 if (itype(j).ne.10 .and. (vbld(nres+j)-dsc(itj)).gt.2.0d0) then
802 & write (iout,*) "Bad CA-SC bond length",j," ",vbld(nres+j),
803 & " for conformation",ii
804 if (iprint.gt.1) then
805 write (iout,*) "The Cartesian geometry is:"
806 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
807 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
808 write (iout,*) "The internal geometry is:"
809 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
810 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
811 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
812 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
813 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
814 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
816 if (iprint.gt.0) write (iout,*)
817 & "This conformation WILL NOT be added to the database."
823 if (theta(j).le.0.0d0) then
825 & write (iout,*) "Zero theta angle(s) in conformation",ii
826 if (iprint.gt.1) then
827 write (iout,*) "The Cartesian geometry is:"
828 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
829 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
830 write (iout,*) "The internal geometry is:"
831 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
832 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
833 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
834 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
835 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
836 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
838 if (iprint.gt.0) write (iout,*)
839 & "This conformation WILL NOT be added to the database."
843 if (theta(j).gt.179.97*deg2rad) theta(j)=179.97*deg2rad
846 c write (iout,*) "conf_check passed",ii