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
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)
47 integer scount_(0:MaxProcs)
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
79 cc write(iout,*), 'NAWEJ',i,eini
88 c(l,k+nres)=csingle(l,k+nres)
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 call enerprint(energia(0),fT)
161 c write (iout,'(2i5,21f8.2)') i,iparm,(energia(k),k=1,21)
162 c write (iout,*) "ftors",ftors
165 if (energia(0).ge.1.0d20) then
166 write (iout,*) "NaNs detected in some of the energy",
167 & " components for conformation",ii+1
168 write (iout,*) "The Cartesian geometry is:"
169 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
170 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
171 write (iout,*) "The internal geometry is:"
173 c call pdbout(ii+1,beta_h(ib,ipar),efree,energia(0),0.0d0,rmsdev)
174 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
175 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
176 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
177 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
178 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
179 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
180 write (iout,*) "The components of the energy are:"
181 call enerprint(energia(0),fT)
183 & "This conformation WILL NOT be added to the database."
188 if (ipar.eq.iparm) write (iout,*) i,iparm,
189 & 1.0d0/(beta_h(ib,ipar)*1.987D-3),eini,energia(0)
191 if (ipar.eq.iparm .and. einicheck.gt.0 .and.
192 & dabs(eini-energia(0)).gt.tole) then
193 if (errmsg_count.le.maxerrmsg_count) then
194 write (iout,'(2a,2e15.5,a,2i8,a,f8.1)')
195 & "Warning: energy differs remarkably from ",
196 & " the value read in: ",energia(0),eini," point",
197 & iii+1,indstart(me1)+iii," T",
198 & 1.0d0/(1.987D-3*beta_h(ib,ipar))
199 call enerprint(energia(0),fT)
200 call pdbout(iii+1,beta_h(ib,ipar),
201 & eini,energia(0),0.0d0,rmsdev)
204 errmsg_count=errmsg_count+1
205 if (errmsg_count.gt.maxerrmsg_count)
206 & write (iout,*) "Too many warning messages"
207 if (einicheck.gt.1) then
208 write (iout,*) "Calculation stopped."
211 call MPI_Abort(WHAM_COMM,IERROR,ERRCODE)
218 potE(iii+1,iparm)=energia(0)
220 enetb(k,iii+1,iparm)=energia(k)
222 c write(iout,*) "iCHUJ TU STRZELI",i,iii,entfac(i)
223 c call enerprint(energia(0),fT)
225 write (iout,'(2i5,f10.1,3e15.5)') i,iii,
226 & 1.0d0/(beta_h(ib,ipar)*1.987D-3),energia(0),eini,efree
227 call enerprint(energia(0),fT)
228 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
229 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
230 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
231 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
232 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
233 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
234 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
235 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
236 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
237 write (iout,'(8f10.5)') (q(k,iii+1),k=1,nQ)
238 write (iout,'(f10.5,i10)') rmsdev,iscor
239 call enerprint(energia(0),fT)
240 write(liczba,'(bz,i3.3)') me
241 nazwa="test"//liczba//".pdb"
242 write (iout,*) "pdb file",nazwa
243 open (ipdb,file=nazwa,position="append")
244 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
275 write (iout,*) "Me",me," scount",scount(me)
277 c Master gathers updated numbers of conformations written by all procs.
278 call MPI_AllGather( scount_(me), 1, MPI_INTEGER, scount(0), 1,
279 & MPI_INTEGER, WHAM_COMM, IERROR)
283 indstart(i)=indend(i-1)+1
284 indend(i)=indstart(i)+scount(i)-1
287 write (iout,*) "Revised conformation counts"
289 write (iout,'(a,i5,a,i7,a,i7,a,i7)')
290 & "Processor",i," indstart",indstart(i),
291 & " indend",indend(i)," count",scount(i)
294 call MPI_AllReduce(snk_p(1,1,1),snk(1,1,1,islice),
295 & MaxR*MaxT_h*nParmSet,
296 & MPI_INTEGER,MPI_SUM,WHAM_COMM,IERROR)
302 stot(islice)=stot(islice)+snk(i,ib,iparm,islice)
306 write (iout,*) "Revised SNK"
309 write (iout,'("Param",i3," Temp",f6.1,3x,32i8)')
310 & iparm,1.0d0/(1.987D-3*beta_h(ib,iparm)),
311 & (snk(i,ib,iparm,islice),i=1,nR(ib,iparm))
312 write (iout,*) "snk_p",(snk_p(i,ib,iparm),i=1,nR(ib,iparm))
315 write (iout,'("Total",i10)') stot(islice)
318 101 write (iout,*) "Error in scratchfile."
322 c------------------------------------------------------------------------------
323 subroutine write_dbase(islice,*)
326 include "DIMENSIONS.ZSCOPT"
327 include "DIMENSIONS.FREE"
328 include "DIMENSIONS.COMPAR"
331 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
334 include "COMMON.CONTROL"
335 include "COMMON.CHAIN"
336 include "COMMON.IOUNITS"
337 include "COMMON.PROTFILES"
338 include "COMMON.NAMES"
340 include "COMMON.SBRIDGE"
342 include "COMMON.FFIELD"
343 include "COMMON.ENEPS"
344 include "COMMON.LOCAL"
345 include "COMMON.WEIGHTS"
346 include "COMMON.INTERACT"
347 include "COMMON.FREE"
348 include "COMMON.ENERGIES"
349 include "COMMON.COMPAR"
350 include "COMMON.PROT"
352 character*80 bxname,cxname
353 character*64 bprotfile_temp
354 character*3 liczba,licz
356 integer i,itj,ii,iii,j,k,l
359 double precision rmsdev,efree,eini
360 real*4 csingle(3,maxres2)
361 double precision energ
365 write (licz2,'(bz,i2.2)') islice
366 call opentmp(islice,ientout,bprotfile_temp)
367 write (iout,*) "bprotfile_temp ",bprotfile_temp
369 if (.not.bxfile .and. .not. cxfile .and. indpdb.eq.0
370 & .and. ensembles.eq.0) then
371 close(ientout,status="delete")
375 write (liczba,'(bz,i3.3)') me
376 if (bxfile .or. cxfile .or. ensembles.gt.0) then
377 if (.not.separate_parset) then
378 bxname = prefix(:ilen(prefix))//liczba//".bx"
380 write (licz,'(bz,i3.3)') myparm
381 bxname = prefix(:ilen(prefix))//liczba//"_par"//licz//".bx"
383 open (ientin,file=bxname,status="unknown",
384 & form="unformatted",access="direct",recl=lenrec1)
387 if (bxfile .or. cxfile .or. ensembles.gt.0) then
388 if (nslice.eq.1) then
389 bxname = prefix(:ilen(prefix))//".bx"
391 bxname = prefix(:ilen(prefix))//
392 & "_slice_"//licz2//".bx"
394 open (ientin,file=bxname,status="unknown",
395 & form="unformatted",access="direct",recl=lenrec1)
396 write (iout,*) "Calculating energies; writing geometry",
397 & " and energy components to ",bxname(:ilen(bxname))
399 #if (defined(AIX) && !defined(JUBL))
400 call xdrfopen_(ixdrf,cxname, "w", iret)
402 call xdrfopen(ixdrf,cxname, "w", iret)
405 write (iout,*) "Error opening cxfile ",cxname(:ilen(cxname))
410 if (indpdb.gt.0) then
411 if (nslice.eq.1) then
413 if (.not.separate_parset) then
414 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))
417 write (licz,'(bz,i3.3)') myparm
418 statname=prefix(:ilen(prefix))//'_par'//licz//'_'//
419 & pot(:ilen(pot))//liczba//'.stat'
423 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//'.stat'
427 if (.not.separate_parset) then
428 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//
429 & "_slice_"//licz2//liczba//'.stat'
431 write (licz,'(bz,i3.3)') myparm
432 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//
433 & '_par'//licz//"_slice_"//licz2//liczba//'.stat'
436 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))
437 & //"_slice_"//licz2//'.stat'
440 open(istat,file=statname,status="unknown")
449 cc read(ientout,rec=i,err=101)
450 cc & ((csingle(l,k),l=1,3),k=1,nres),
451 cc & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
452 cc & nss,(idssb(k),jdssb(k),k=1,nss),
453 cc & eini,efree,rmsdev,(q(k,i),k=1,nQ),iR,ib,iparm
454 cc idssb(k)=idssb(k)-nres
455 cc jdssb(k)=jdssb(k)-nres
457 read(ientout,rec=i,err=101)
458 & ((csingle(l,k),l=1,3),k=1,nres),
459 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
460 & nss,(ihpb(k),jhpb(k),k=1,nss),
461 & eini,efree,rmsdev,(q(k,i),k=1,nQ),iR,ib,iparm
463 cc write (iout,*) 'CC', iR,ib,iparm,eini,efree
469 call int_from_cart1(.false.)
471 if (indpdb.gt.0) then
472 call conf_compar(i,.false.,.true.)
475 if (bxfile .or.cxfile .or. ensembles.gt.0) write (ientin,rec=i)
476 & ((csingle(l,k),l=1,3),k=1,nres),
477 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
478 & nss,(ihpb(k),jhpb(k),k=1,nss),
479 c & potE(i,iparm),-entfac(i),rms_nat,iscore
480 & potE(i,nparmset),-entfac(i),rms_nat,iscore
482 if (bxfile .or.cxfile .or. ensembles.gt.0) write
484 & ((csingle(l,k),l=1,3),k=1,nres),
485 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
486 & nss,(ihpb(k),jhpb(k),k=1,nss),
487 c & potE(i,iparm),-entfac(i),rms_nat,iscore
488 & potE(i,nparmset),-entfac(i),rms_nat,iscore
490 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)
570 cc read(ientin,rec=iii,err=101)
571 cc & ((csingle(l,k),l=1,3),k=1,nres),
572 cc & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
573 cc & nss,(idssb(k),jdssb(k),k=1,nss),
574 cc & eini,efree,rmsdev,iscor
575 cc idssb(k)=idssb(k)-nres
576 cc jdssb(k)=jdssb(k)-nres
578 read(ientin,rec=iii,err=101)
579 & ((csingle(l,k),l=1,3),k=1,nres),
580 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
581 & nss,(ihpb(k),jhpb(k),k=1,nss),
582 & eini,efree,rmsdev,iscor
584 if (bxfile .or. ensembles.gt.0) then
586 cc write (ientout,rec=i)
587 cc & ((csingle(l,k),l=1,3),k=1,nres),
588 cc & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
589 cc & nss,(idssb(k)+nres,jdssb(k)+nres,k=1,nss),
590 cc & eini,efree,rmsdev,iscor
592 write (ientout,rec=i)
593 & ((csingle(l,k),l=1,3),k=1,nres),
594 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
595 & nss,(ihpb(k),jhpb(k),k=1,nss),
596 & eini,efree,rmsdev,iscor
597 cc write(iout,*) "W poszukiwaniu zlotych galotow"
598 cc write(iout,*) "efree=",efree,iii
601 if(cxfile)call cxwrite(ixdrf,csingle,eini,efree,rmsdev,iscor)
608 call int_from_cart1(.false.)
609 write (iout,'(2i5,3e15.5)') i,iii,eini,efree
610 write (iout,*) "The Cartesian geometry is:"
611 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
612 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
613 write (iout,*) "The internal geometry is:"
614 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
615 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
616 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
617 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
618 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
619 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
620 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
621 write (iout,'(f10.5,i5)') rmsdev,iscor
624 write (iout,*) iii," conformations (from",indstart(j)," to",
625 & indend(j),") read from ",
626 & bxname(:ilen(bxname))
627 close (ientin,status="delete")
629 if (bxfile .or. cxfile .or. ensembles.gt.0) close (ientout)
630 #if (defined(AIX) && !defined(JUBL))
631 if (cxfile) call xdrfclose_(ixdrf,cxname,iret)
633 if (cxfile) call xdrfclose(ixdrf,cxname,iret)
637 101 write (iout,*) "Error in scratchfile."
641 c-------------------------------------------------------------------------------
642 subroutine cxwrite(ixdrf,csingle,eini,efree,rmsdev,iscor)
645 include "DIMENSIONS.ZSCOPT"
646 include "DIMENSIONS.FREE"
647 include "DIMENSIONS.COMPAR"
650 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
653 include "COMMON.CONTROL"
654 include "COMMON.CHAIN"
655 include "COMMON.IOUNITS"
656 include "COMMON.PROTFILES"
657 include "COMMON.NAMES"
659 include "COMMON.SBRIDGE"
661 include "COMMON.FFIELD"
662 include "COMMON.ENEPS"
663 include "COMMON.LOCAL"
664 include "COMMON.WEIGHTS"
665 include "COMMON.INTERACT"
666 include "COMMON.FREE"
667 include "COMMON.ENERGIES"
668 include "COMMON.COMPAR"
669 include "COMMON.PROT"
670 integer i,j,itmp,iscor,iret,ixdrf
671 double precision rmsdev,efree,eini
672 real*4 csingle(3,maxres2),xoord(3,maxres2+2)
675 c write (iout,*) "cxwrite"
680 xoord(j,i)=csingle(j,i)
685 xoord(j,nres+i-nnt+1)=csingle(j,i+nres)
691 c write (iout,*) "itmp",itmp
693 c write (iout,*) "CNZ",eini,dyn_ss
694 #if (defined(AIX) && !defined(JUBL))
695 call xdrf3dfcoord_(ixdrf, xoord, itmp, prec, iret)
697 c write (iout,*) "xdrf3dfcoord"
699 call xdrfint_(ixdrf, nss, iret)
702 cc call xdrfint_(ixdrf, idssb(j)+nres, iret)
703 cc call xdrfint_(ixdrf, jdssb(j)+nres, iret)
705 call xdrfint_(ixdrf, ihpb(j), iret)
706 call xdrfint_(ixdrf, jhpb(j), iret)
709 call xdrffloat_(ixdrf,real(eini),iret)
710 call xdrffloat_(ixdrf,real(efree),iret)
711 call xdrffloat_(ixdrf,real(rmsdev),iret)
712 call xdrfint_(ixdrf,iscor,iret)
714 call xdrf3dfcoord(ixdrf, xoord, itmp, prec, iret)
716 call xdrfint(ixdrf, nss, iret)
719 cc call xdrfint(ixdrf, idssb(j), iret)
720 cc call xdrfint(ixdrf, jdssb(j), iret)
721 cc idssb(j)=idssb(j)-nres
722 cc jdssb(j)=jdssb(j)-nres
724 call xdrfint(ixdrf, ihpb(j), iret)
725 call xdrfint(ixdrf, jhpb(j), iret)
728 call xdrffloat(ixdrf,real(eini),iret)
729 call xdrffloat(ixdrf,real(efree),iret)
730 call xdrffloat(ixdrf,real(rmsdev),iret)
731 call xdrfint(ixdrf,iscor,iret)
736 c------------------------------------------------------------------------------
737 logical function conf_check(ii,iprint)
740 include "DIMENSIONS.ZSCOPT"
741 include "DIMENSIONS.FREE"
744 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
747 include "COMMON.CHAIN"
748 include "COMMON.IOUNITS"
749 include "COMMON.PROTFILES"
750 include "COMMON.NAMES"
752 include "COMMON.SBRIDGE"
754 include "COMMON.FFIELD"
755 include "COMMON.ENEPS"
756 include "COMMON.LOCAL"
757 include "COMMON.WEIGHTS"
758 include "COMMON.INTERACT"
759 include "COMMON.FREE"
760 include "COMMON.ENERGIES"
761 include "COMMON.CONTROL"
762 include "COMMON.TORCNSTR"
763 integer j,k,l,ii,itj,iprint
764 if (.not.check_conf) then
768 call int_from_cart1(.false.)
770 if (vbld(j).lt.2.0d0 .or. vbld(j).gt.5.0d0) then
772 & write (iout,*) "Bad CA-CA bond length",j," ",vbld(j),
773 & " for conformation",ii
774 if (iprint.gt.1) then
775 write (iout,*) "The Cartesian geometry is:"
776 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
777 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
778 write (iout,*) "The internal geometry is:"
779 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
780 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
781 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
782 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
783 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
784 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
786 if (iprint.gt.0) write (iout,*)
787 & "This conformation WILL NOT be added to the database."
794 if (itype(j).ne.10 .and. (vbld(nres+j)-dsc(itj)).gt.2.0d0) then
796 & write (iout,*) "Bad CA-SC bond length",j," ",vbld(nres+j),
797 & " for conformation",ii
798 if (iprint.gt.1) then
799 write (iout,*) "The Cartesian geometry is:"
800 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
801 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
802 write (iout,*) "The internal geometry is:"
803 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
804 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
805 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
806 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
807 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
808 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
810 if (iprint.gt.0) write (iout,*)
811 & "This conformation WILL NOT be added to the database."
817 if (theta(j).le.0.0d0) then
819 & write (iout,*) "Zero theta angle(s) in conformation",ii
820 if (iprint.gt.1) then
821 write (iout,*) "The Cartesian geometry is:"
822 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
823 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
824 write (iout,*) "The internal geometry is:"
825 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
826 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
827 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
828 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
829 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
830 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
832 if (iprint.gt.0) write (iout,*)
833 & "This conformation WILL NOT be added to the database."
837 if (theta(j).gt.179.97*deg2rad) theta(j)=179.97*deg2rad
840 c write (iout,*) "conf_check passed",ii