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)
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)
199 call pdbout(iii+1,beta_h(ib,ipar),
200 & eini,energia(0),0.0d0,rmsdev)
203 errmsg_count=errmsg_count+1
204 call pdbout(indstart(me1)+iii,
205 & 1.0d0/(1.987D-3*beta_h(ib,ipar)),
206 &energia(0),eini,0.0d0,0.0d0)
207 call enerprint(energia(0),fT)
208 if (errmsg_count.gt.maxerrmsg_count)
209 & write (iout,*) "Too many warning messages"
210 if (einicheck.gt.1) then
211 write (iout,*) "Calculation stopped."
214 call MPI_Abort(WHAM_COMM,IERROR,ERRCODE)
221 potE(iii+1,iparm)=energia(0)
223 enetb(k,iii+1,iparm)=energia(k)
225 c write(iout,*) "iCHUJ TU STRZELI",i,iii,entfac(i)
226 c call enerprint(energia(0),fT)
228 write (iout,'(2i5,f10.1,3e15.5)') i,iii,
229 & 1.0d0/(beta_h(ib,ipar)*1.987D-3),energia(0),eini,efree
230 call enerprint(energia(0),fT)
231 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
232 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
233 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
234 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
235 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
236 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
237 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
238 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
239 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
240 write (iout,'(8f10.5)') (q(k,iii+1),k=1,nQ)
241 write (iout,'(f10.5,i10)') rmsdev,iscor
242 call enerprint(energia(0),fT)
243 write(liczba,'(bz,i3.3)') me
244 nazwa="test"//liczba//".pdb"
245 write (iout,*) "pdb file",nazwa
246 open (ipdb,file=nazwa,position="append")
247 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",scount(me)
279 c Master gathers updated numbers of conformations written by all procs.
280 call MPI_AllGather( scount(me), 1, MPI_INTEGER, scount(0), 1,
281 & MPI_INTEGER, WHAM_COMM, IERROR)
285 indstart(i)=indend(i-1)+1
286 indend(i)=indstart(i)+scount(i)-1
289 write (iout,*) "Revised conformation counts"
291 write (iout,'(a,i5,a,i7,a,i7,a,i7)')
292 & "Processor",i," indstart",indstart(i),
293 & " indend",indend(i)," count",scount(i)
296 call MPI_AllReduce(snk_p(1,1,1),snk(1,1,1,islice),
297 & MaxR*MaxT_h*nParmSet,
298 & MPI_INTEGER,MPI_SUM,WHAM_COMM,IERROR)
304 stot(islice)=stot(islice)+snk(i,ib,iparm,islice)
308 write (iout,*) "Revised SNK"
311 write (iout,'("Param",i3," Temp",f6.1,3x,32i8)')
312 & iparm,1.0d0/(1.987D-3*beta_h(ib,iparm)),
313 & (snk(i,ib,iparm,islice),i=1,nR(ib,iparm))
314 write (iout,*) "snk_p",(snk_p(i,ib,iparm),i=1,nR(ib,iparm))
317 write (iout,'("Total",i10)') stot(islice)
320 101 write (iout,*) "Error in scratchfile."
324 c------------------------------------------------------------------------------
325 subroutine write_dbase(islice,*)
328 include "DIMENSIONS.ZSCOPT"
329 include "DIMENSIONS.FREE"
330 include "DIMENSIONS.COMPAR"
333 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
336 include "COMMON.CONTROL"
337 include "COMMON.CHAIN"
338 include "COMMON.IOUNITS"
339 include "COMMON.PROTFILES"
340 include "COMMON.NAMES"
342 include "COMMON.SBRIDGE"
344 include "COMMON.FFIELD"
345 include "COMMON.ENEPS"
346 include "COMMON.LOCAL"
347 include "COMMON.WEIGHTS"
348 include "COMMON.INTERACT"
349 include "COMMON.FREE"
350 include "COMMON.ENERGIES"
351 include "COMMON.COMPAR"
352 include "COMMON.PROT"
354 character*80 bxname,cxname
355 character*64 bprotfile_temp
356 character*3 liczba,licz
358 integer i,itj,ii,iii,j,k,l
361 double precision rmsdev,efree,eini
362 real*4 csingle(3,maxres2)
363 double precision energ
367 write (licz2,'(bz,i2.2)') islice
368 call opentmp(islice,ientout,bprotfile_temp)
369 write (iout,*) "bprotfile_temp ",bprotfile_temp
371 if (.not.bxfile .and. .not. cxfile .and. indpdb.eq.0
372 & .and. ensembles.eq.0) then
373 close(ientout,status="delete")
377 write (liczba,'(bz,i3.3)') me
378 if (bxfile .or. cxfile .or. ensembles.gt.0) then
379 if (.not.separate_parset) then
380 bxname = prefix(:ilen(prefix))//liczba//".bx"
382 write (licz,'(bz,i3.3)') myparm
383 bxname = prefix(:ilen(prefix))//liczba//"_par"//licz//".bx"
385 open (ientin,file=bxname,status="unknown",
386 & form="unformatted",access="direct",recl=lenrec1)
389 if (bxfile .or. cxfile .or. ensembles.gt.0) then
390 if (nslice.eq.1) then
391 bxname = prefix(:ilen(prefix))//".bx"
393 bxname = prefix(:ilen(prefix))//
394 & "_slice_"//licz2//".bx"
396 open (ientin,file=bxname,status="unknown",
397 & form="unformatted",access="direct",recl=lenrec1)
398 write (iout,*) "Calculating energies; writing geometry",
399 & " and energy components to ",bxname(:ilen(bxname))
401 #if (defined(AIX) && !defined(JUBL))
402 call xdrfopen_(ixdrf,cxname, "w", iret)
404 call xdrfopen(ixdrf,cxname, "w", iret)
407 write (iout,*) "Error opening cxfile ",cxname(:ilen(cxname))
412 if (indpdb.gt.0) then
413 if (nslice.eq.1) then
415 if (.not.separate_parset) then
416 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))
419 write (licz,'(bz,i3.3)') myparm
420 statname=prefix(:ilen(prefix))//'_par'//licz//'_'//
421 & pot(:ilen(pot))//liczba//'.stat'
425 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//'.stat'
429 if (.not.separate_parset) then
430 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//
431 & "_slice_"//licz2//liczba//'.stat'
433 write (licz,'(bz,i3.3)') myparm
434 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))//
435 & '_par'//licz//"_slice_"//licz2//liczba//'.stat'
438 statname=prefix(:ilen(prefix))//'_'//pot(:ilen(pot))
439 & //"_slice_"//licz2//'.stat'
442 open(istat,file=statname,status="unknown")
451 cc read(ientout,rec=i,err=101)
452 cc & ((csingle(l,k),l=1,3),k=1,nres),
453 cc & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
454 cc & nss,(idssb(k),jdssb(k),k=1,nss),
455 cc & eini,efree,rmsdev,(q(k,i),k=1,nQ),iR,ib,iparm
456 cc idssb(k)=idssb(k)-nres
457 cc jdssb(k)=jdssb(k)-nres
459 read(ientout,rec=i,err=101)
460 & ((csingle(l,k),l=1,3),k=1,nres),
461 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
462 & nss,(ihpb(k),jhpb(k),k=1,nss),
463 & eini,efree,rmsdev,(q(k,i),k=1,nQ),iR,ib,iparm
465 cc write (iout,*) 'CC', iR,ib,iparm,eini,efree
471 call int_from_cart1(.false.)
473 if (indpdb.gt.0) then
474 call conf_compar(i,.false.,.true.)
477 if (bxfile .or.cxfile .or. ensembles.gt.0) write (ientin,rec=i)
478 & ((csingle(l,k),l=1,3),k=1,nres),
479 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
480 & nss,(ihpb(k),jhpb(k),k=1,nss),
481 c & potE(i,iparm),-entfac(i),rms_nat,iscore
482 & potE(i,nparmset),-entfac(i),rms_nat,iscore
484 if (bxfile .or.cxfile .or. ensembles.gt.0) write
486 & ((csingle(l,k),l=1,3),k=1,nres),
487 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
488 & nss,(ihpb(k),jhpb(k),k=1,nss),
489 c & potE(i,iparm),-entfac(i),rms_nat,iscore
490 & potE(i,nparmset),-entfac(i),rms_nat,iscore
492 write (iout,'(2i5,3e15.5)') i,me,potE(i,iparm),-entfac(i)
494 if (cxfile) call cxwrite(ixdrf,csingle,potE(i,nparmset),
495 & -entfac(i),rms_nat,iscore)
498 close(ientout,status="delete")
500 if (bxfile .or. cxfile .or. ensembles.gt.0) close(ientin)
502 call MPI_Barrier(WHAM_COMM,IERROR)
503 if (me.ne.Master .or. .not.bxfile .and. .not. cxfile
504 & .and. ensembles.eq.0) return
506 if (bxfile .or. ensembles.gt.0) then
507 if (nslice.eq.1) then
508 if (.not.separate_parset) then
509 bxname = prefix(:ilen(prefix))//".bx"
511 write (licz,'(bz,i3.3)') myparm
512 bxname = prefix(:ilen(prefix))//"_par"//licz//".bx"
515 if (.not.separate_parset) then
516 bxname = prefix(:ilen(prefix))//"_slice_"//licz2//".bx"
518 write (licz,'(bz,i3.3)') myparm
519 bxname = prefix(:ilen(prefix))//"par_"//licz//
520 & "_slice_"//licz2//".bx"
523 open (ientout,file=bxname,status="unknown",
524 & form="unformatted",access="direct",recl=lenrec1)
525 write (iout,*) "Master is creating binary database ",
526 & bxname(:ilen(bxname))
529 if (nslice.eq.1) then
530 if (.not.separate_parset) then
531 cxname = prefix(:ilen(prefix))//".cx"
533 cxname = prefix(:ilen(prefix))//"_par"//licz//".cx"
536 if (.not.separate_parset) then
537 cxname = prefix(:ilen(prefix))//
538 & "_slice_"//licz2//".cx"
540 cxname = prefix(:ilen(prefix))//"_par"//licz//
541 & "_slice_"//licz2//".cx"
544 #if (defined(AIX) && !defined(JUBL))
545 call xdrfopen_(ixdrf,cxname, "w", iret)
547 call xdrfopen(ixdrf,cxname, "w", iret)
550 write (iout,*) "Error opening cxfile ",cxname(:ilen(cxname))
555 write (liczba,'(bz,i3.3)') j
556 if (separate_parset) then
557 write (licz,'(bz,i3.3)') myparm
558 bxname = prefix(:ilen(prefix))//liczba//"_par"//licz//".bx"
560 bxname = prefix(:ilen(prefix))//liczba//".bx"
562 open (ientin,file=bxname,status="unknown",
563 & form="unformatted",access="direct",recl=lenrec1)
564 write (iout,*) "Master is reading conformations from ",
565 & bxname(:ilen(bxname))
567 c write (iout,*) "j",j," indstart",indstart(j)," indend",indend(j)
569 do i=indstart(j),indend(j)
572 cc read(ientin,rec=iii,err=101)
573 cc & ((csingle(l,k),l=1,3),k=1,nres),
574 cc & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
575 cc & nss,(idssb(k),jdssb(k),k=1,nss),
576 cc & eini,efree,rmsdev,iscor
577 cc idssb(k)=idssb(k)-nres
578 cc jdssb(k)=jdssb(k)-nres
580 read(ientin,rec=iii,err=101)
581 & ((csingle(l,k),l=1,3),k=1,nres),
582 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
583 & nss,(ihpb(k),jhpb(k),k=1,nss),
584 & eini,efree,rmsdev,iscor
586 if (bxfile .or. ensembles.gt.0) then
588 cc write (ientout,rec=i)
589 cc & ((csingle(l,k),l=1,3),k=1,nres),
590 cc & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
591 cc & nss,(idssb(k)+nres,jdssb(k)+nres,k=1,nss),
592 cc & eini,efree,rmsdev,iscor
594 write (ientout,rec=i)
595 & ((csingle(l,k),l=1,3),k=1,nres),
596 & ((csingle(l,k+nres),l=1,3),k=nnt,nct),
597 & nss,(ihpb(k),jhpb(k),k=1,nss),
598 & eini,efree,rmsdev,iscor
599 cc write(iout,*) "W poszukiwaniu zlotych galotow"
600 cc write(iout,*) "efree=",efree,iii
603 if(cxfile)call cxwrite(ixdrf,csingle,eini,efree,rmsdev,iscor)
610 call int_from_cart1(.false.)
611 write (iout,'(2i5,3e15.5)') i,iii,eini,efree
612 write (iout,*) "The Cartesian geometry is:"
613 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
614 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
615 write (iout,*) "The internal geometry is:"
616 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
617 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
618 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
619 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
620 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
621 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
622 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
623 write (iout,'(f10.5,i5)') rmsdev,iscor
626 write (iout,*) iii," conformations (from",indstart(j)," to",
627 & indend(j),") read from ",
628 & bxname(:ilen(bxname))
629 close (ientin,status="delete")
631 if (bxfile .or. cxfile .or. ensembles.gt.0) close (ientout)
632 #if (defined(AIX) && !defined(JUBL))
633 if (cxfile) call xdrfclose_(ixdrf,cxname,iret)
635 if (cxfile) call xdrfclose(ixdrf,cxname,iret)
639 101 write (iout,*) "Error in scratchfile."
643 c-------------------------------------------------------------------------------
644 subroutine cxwrite(ixdrf,csingle,eini,efree,rmsdev,iscor)
647 include "DIMENSIONS.ZSCOPT"
648 include "DIMENSIONS.FREE"
649 include "DIMENSIONS.COMPAR"
652 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
655 include "COMMON.CONTROL"
656 include "COMMON.CHAIN"
657 include "COMMON.IOUNITS"
658 include "COMMON.PROTFILES"
659 include "COMMON.NAMES"
661 include "COMMON.SBRIDGE"
663 include "COMMON.FFIELD"
664 include "COMMON.ENEPS"
665 include "COMMON.LOCAL"
666 include "COMMON.WEIGHTS"
667 include "COMMON.INTERACT"
668 include "COMMON.FREE"
669 include "COMMON.ENERGIES"
670 include "COMMON.COMPAR"
671 include "COMMON.PROT"
672 integer i,j,itmp,iscor,iret,ixdrf
673 double precision rmsdev,efree,eini
674 real*4 csingle(3,maxres2),xoord(3,maxres2+2)
677 c write (iout,*) "cxwrite"
682 xoord(j,i)=csingle(j,i)
687 xoord(j,nres+i-nnt+1)=csingle(j,i+nres)
693 c write (iout,*) "itmp",itmp
695 c write (iout,*) "CNZ",eini,dyn_ss
696 #if (defined(AIX) && !defined(JUBL))
697 call xdrf3dfcoord_(ixdrf, xoord, itmp, prec, iret)
699 c write (iout,*) "xdrf3dfcoord"
701 call xdrfint_(ixdrf, nss, iret)
704 cc call xdrfint_(ixdrf, idssb(j)+nres, iret)
705 cc call xdrfint_(ixdrf, jdssb(j)+nres, iret)
707 call xdrfint_(ixdrf, ihpb(j), iret)
708 call xdrfint_(ixdrf, jhpb(j), iret)
711 call xdrffloat_(ixdrf,real(eini),iret)
712 call xdrffloat_(ixdrf,real(efree),iret)
713 call xdrffloat_(ixdrf,real(rmsdev),iret)
714 call xdrfint_(ixdrf,iscor,iret)
716 call xdrf3dfcoord(ixdrf, xoord, itmp, prec, iret)
718 call xdrfint(ixdrf, nss, iret)
721 cc call xdrfint(ixdrf, idssb(j), iret)
722 cc call xdrfint(ixdrf, jdssb(j), iret)
723 cc idssb(j)=idssb(j)-nres
724 cc jdssb(j)=jdssb(j)-nres
726 call xdrfint(ixdrf, ihpb(j), iret)
727 call xdrfint(ixdrf, jhpb(j), iret)
730 call xdrffloat(ixdrf,real(eini),iret)
731 call xdrffloat(ixdrf,real(efree),iret)
732 call xdrffloat(ixdrf,real(rmsdev),iret)
733 call xdrfint(ixdrf,iscor,iret)
738 c------------------------------------------------------------------------------
739 logical function conf_check(ii,iprint)
742 include "DIMENSIONS.ZSCOPT"
743 include "DIMENSIONS.FREE"
746 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
749 include "COMMON.CHAIN"
750 include "COMMON.IOUNITS"
751 include "COMMON.PROTFILES"
752 include "COMMON.NAMES"
754 include "COMMON.SBRIDGE"
756 include "COMMON.FFIELD"
757 include "COMMON.ENEPS"
758 include "COMMON.LOCAL"
759 include "COMMON.WEIGHTS"
760 include "COMMON.INTERACT"
761 include "COMMON.FREE"
762 include "COMMON.ENERGIES"
763 include "COMMON.CONTROL"
764 include "COMMON.TORCNSTR"
765 integer j,k,l,ii,itj,iprint
766 if (.not.check_conf) then
770 call int_from_cart1(.false.)
772 if (vbld(j).lt.2.0d0 .or. vbld(j).gt.5.0d0) then
774 & write (iout,*) "Bad CA-CA bond length",j," ",vbld(j),
775 & " for conformation",ii
776 if (iprint.gt.1) then
777 write (iout,*) "The Cartesian geometry is:"
778 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
779 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
780 write (iout,*) "The internal geometry is:"
781 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
782 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
783 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
784 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
785 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
786 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
788 if (iprint.gt.0) write (iout,*)
789 & "This conformation WILL NOT be added to the database."
796 if (itype(j).ne.10 .and.(vbld(nres+j)-dsc(iabs(itj))).gt.2.0d0)
799 & write (iout,*) "Bad CA-SC bond length",j," ",vbld(nres+j),
800 & " for conformation",ii
801 if (iprint.gt.1) then
802 write (iout,*) "The Cartesian geometry is:"
803 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
804 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
805 write (iout,*) "The internal geometry is:"
806 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
807 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
808 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
809 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
810 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
811 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
813 if (iprint.gt.0) write (iout,*)
814 & "This conformation WILL NOT be added to the database."
820 if (theta(j).le.0.0d0) then
822 & write (iout,*) "Zero theta angle(s) in conformation",ii
823 if (iprint.gt.1) then
824 write (iout,*) "The Cartesian geometry is:"
825 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
826 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
827 write (iout,*) "The internal geometry is:"
828 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
829 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
830 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
831 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
832 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
833 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
835 if (iprint.gt.0) write (iout,*)
836 & "This conformation WILL NOT be added to the database."
840 if (theta(j).gt.179.97*deg2rad) theta(j)=179.97*deg2rad
843 c write (iout,*) "conf_check passed",ii