1 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
5 C Program to carry out conformational search of proteins in an united-residue C
8 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
9 implicit real*8 (a-h,o-z)
15 include 'COMMON.SETUP'
17 include 'COMMON.TIME1'
18 include 'COMMON.INTERACT'
19 include 'COMMON.NAMES'
21 include 'COMMON.HEADER'
22 include 'COMMON.CONTROL'
23 include 'COMMON.CONTACTS'
24 include 'COMMON.CHAIN'
26 include 'COMMON.IOUNITS'
27 include 'COMMON.FFIELD'
30 include 'COMMON.SBRIDGE'
31 double precision hrtime,mintime,sectime
32 character*64 text_mode_calc(-2:14) /'test',
33 & 'SC rotamer distribution',
34 & 'Energy evaluation or minimization',
35 & 'Regularization of PDB structure',
36 & 'Threading of a sequence on PDB structures',
37 & 'Monte Carlo (with minimization) ',
38 & 'Energy minimization of multiple conformations',
39 & 'Checking energy gradient',
40 & 'Entropic sampling Monte Carlo (with minimization)',
45 & 'Soft regularization of PDB structure',
46 & 'Mesoscopic molecular dynamics (MD) ',
48 & 'Replica exchange molecular dynamics (REMD)'/
51 c call memmon_print_usage()
55 & write(iout,*)'### LAST MODIFIED 4/25/08 7:29PM by adam'
56 if (me.eq.king) call cinfo
57 C Read force field parameters and job setup data
60 if (me.eq.king .or. .not. out1file) then
62 & text_mode_calc(modecalc)(:ilen(text_mode_calc(modecalc))),
64 if (minim) write (iout,'(a)')
65 & 'Conformations will be energy-minimized.'
66 write (iout,'(80(1h*)/)')
70 if (modecalc.eq.-2) then
73 else if (modecalc.eq.-1) then
74 write(iout,*) "call check_sc_map next"
79 if (fg_rank.gt.0) then
80 C Fine-grain slaves just do energy and gradient components.
81 call ergastulum ! slave workhouse in Latin
84 if (modecalc.eq.0) then
85 call exec_eeval_or_minim
86 else if (modecalc.eq.1) then
88 else if (modecalc.eq.2) then
90 else if (modecalc.eq.3 .or. modecalc .eq.6) then
92 else if (modecalc.eq.4) then
93 call exec_mult_eeval_or_minim
94 else if (modecalc.eq.5) then
96 else if (ModeCalc.eq.7) then
98 else if (ModeCalc.eq.8) then
100 else if (modecalc.eq.11) then
102 else if (modecalc.eq.12) then
104 else if (modecalc.eq.14) then
107 write (iout,'(a)') 'This calculation type is not supported',
113 if (fg_rank.eq.0) call finish_task
114 c call memmon_print_usage()
116 call print_detailed_timing
118 call MPI_Finalize(ierr)
121 call dajczas(tcpu(),hrtime,mintime,sectime)
122 stop '********** Program terminated normally.'
125 c--------------------------------------------------------------------------
131 include 'COMMON.SETUP'
132 include 'COMMON.CONTROL'
133 include 'COMMON.IOUNITS'
134 c if (me.eq.king .or. .not. out1file) then
135 c write (iout,*) "Calling chainbuild"
139 c if (me.eq.king .or. .not. out1file) then
140 c write (iout,*) "Calling MD"
146 c---------------------------------------------------------------------------
147 subroutine exec_MREMD
152 include 'COMMON.SETUP'
153 include 'COMMON.CONTROL'
154 include 'COMMON.IOUNITS'
155 include 'COMMON.REMD'
156 if (me.eq.king .or. .not. out1file)
157 & write (iout,*) "Calling chainbuild"
159 if (me.eq.king .or. .not. out1file)
160 & write (iout,*) "Calling REMD"
171 c---------------------------------------------------------------------------
172 subroutine exec_eeval_or_minim
173 implicit real*8 (a-h,o-z)
178 include 'COMMON.SETUP'
179 include 'COMMON.TIME1'
180 include 'COMMON.INTERACT'
181 include 'COMMON.NAMES'
183 include 'COMMON.HEADER'
184 include 'COMMON.CONTROL'
185 include 'COMMON.CONTACTS'
186 include 'COMMON.CHAIN'
188 include 'COMMON.IOUNITS'
189 include 'COMMON.FFIELD'
190 include 'COMMON.REMD'
192 include 'COMMON.SBRIDGE'
194 double precision energy(0:n_ene)
195 double precision energy_long(0:n_ene),energy_short(0:n_ene)
196 double precision varia(maxvar)
197 if (indpdb.eq.0) call chainbuild
201 print *,"Processor",myrank," after chainbuild"
203 call etotal_long(energy_long(0))
204 write (iout,*) "Printing long range energy"
205 call enerprint(energy_long(0))
206 call etotal_short(energy_short(0))
207 write (iout,*) "Printing short range energy"
208 call enerprint(energy_short(0))
210 energy(i)=energy_long(i)+energy_short(i)
211 write (iout,*) i,energy_long(i),energy_short(i),energy(i)
213 write (iout,*) "Printing long+short range energy"
214 call enerprint(energy(0))
216 call etotal(energy(0))
217 time_ene=MPI_Wtime()-time00
218 write (iout,*) "Time for energy evaluation",time_ene
219 print *,"after etotal"
222 call enerprint(energy(0))
223 call hairpin(.true.,nharp,iharp)
224 call secondary2(.true.)
228 print *, 'Calling OVERLAP_SC'
229 call overlap_sc(fail)
233 call sc_move(2,nres-1,10,1d10,nft_sc,etot)
234 print *,'SC_move',nft_sc,etot
235 write(iout,*) 'SC_move',nft_sc,etot
239 print *, 'Calling MINIM_DC'
241 call minim_dc(etot,iretcode,nfun)
243 if (indpdb.ne.0) then
247 call geom_to_var(nvar,varia)
248 print *,'Calling MINIMIZE.'
250 call minimize(etot,varia,iretcode,nfun)
252 print *,'SUMSL return code is',iretcode,' eval ',nfun
253 evals=nfun/(MPI_WTIME()-time1)
254 print *,'# eval/s',evals
255 print *,'refstr=',refstr
256 call hairpin(.true.,nharp,iharp)
257 call secondary2(.true.)
258 call etotal(energy(0))
260 call enerprint(energy(0))
263 call briefout(0,etot)
264 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
265 write (iout,'(a,i3)') 'SUMSL return code:',iretcode
266 write (iout,'(a,i20)') '# of energy evaluations:',nfun+1
267 write (iout,'(a,f16.3)')'# of energy evaluations/sec:',evals
269 print *,'refstr=',refstr
270 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
271 call briefout(0,etot)
273 if (outpdb) call pdbout(etot,titel(:32),ipdb)
274 if (outmol2) call mol2out(etot,titel(:32))
277 c---------------------------------------------------------------------------
278 subroutine exec_regularize
279 implicit real*8 (a-h,o-z)
284 include 'COMMON.SETUP'
285 include 'COMMON.TIME1'
286 include 'COMMON.INTERACT'
287 include 'COMMON.NAMES'
289 include 'COMMON.HEADER'
290 include 'COMMON.CONTROL'
291 include 'COMMON.CONTACTS'
292 include 'COMMON.CHAIN'
294 include 'COMMON.IOUNITS'
295 include 'COMMON.FFIELD'
296 include 'COMMON.REMD'
298 include 'COMMON.SBRIDGE'
299 double precision energy(0:n_ene)
304 call regularize(nct-nnt+1,etot,rms,cref(1,nnt,1),iretcode)
305 call etotal(energy(0))
306 energy(0)=energy(0)-energy(14)
308 call enerprint(energy(0))
310 call briefout(0,etot)
311 if (outpdb) call pdbout(etot,titel(:32),ipdb)
312 if (outmol2) call mol2out(etot,titel(:32))
313 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
314 write (iout,'(a,i3)') 'SUMSL return code:',iretcode
317 c---------------------------------------------------------------------------
318 subroutine exec_thread
323 include "COMMON.SETUP"
327 c---------------------------------------------------------------------------
329 implicit real*8 (a-h,o-z)
331 character*10 nodeinfo
332 double precision varia(maxvar)
336 include "COMMON.SETUP"
337 include 'COMMON.CONTROL'
341 if (modecalc.eq.3) then
347 if (modecalc.eq.3) then
358 c---------------------------------------------------------------------------
359 subroutine exec_mult_eeval_or_minim
360 implicit real*8 (a-h,o-z)
364 dimension muster(mpi_status_size)
366 include 'COMMON.SETUP'
367 include 'COMMON.TIME1'
368 include 'COMMON.INTERACT'
369 include 'COMMON.NAMES'
371 include 'COMMON.HEADER'
372 include 'COMMON.CONTROL'
373 include 'COMMON.CONTACTS'
374 include 'COMMON.CHAIN'
376 include 'COMMON.IOUNITS'
377 include 'COMMON.FFIELD'
378 include 'COMMON.REMD'
380 include 'COMMON.SBRIDGE'
381 double precision varia(maxvar)
383 double precision energy(0:max_ene)
393 open(intin,file=intinname,status='old')
394 write (istat,'(a5,20a12)')"# ",
395 & (wname(print_order(i)),i=1,nprint_ene)
397 write (istat,'(a5,20a12)')"# ",
398 & (ename(print_order(i)),i=1,nprint_ene),
399 & "ETOT total","RMSD","nat.contact","nnt.contact"
401 write (istat,'(a5,20a12)')"# ",
402 & (ename(print_order(i)),i=1,nprint_ene),"ETOT total"
408 read (intin,'(e15.10,e15.5)',end=1100,err=1100) time,ene
409 call read_x(intin,*11)
411 c Broadcast the order to compute internal coordinates to the slaves.
413 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
415 call int_from_cart1(.false.)
417 read (intin,'(i5)',end=1100,err=1100) iconf
418 call read_angles(intin,*11)
419 call geom_to_var(nvar,varia)
422 write (iout,'(a,i7)') 'Conformation #',iconf
423 call etotal(energy(0))
424 call briefout(iconf,energy(0))
425 call enerprint(energy(0))
428 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
429 write (istat,'(i5,20(f12.3))') iconf,
430 & (energy(print_order(i)),i=1,nprint_ene),etot,
431 & rms,frac,frac_nn,co
434 write (istat,'(i5,16(f12.3))') iconf,
435 & (energy(print_order(i)),i=1,nprint_ene),etot
451 if (mm.lt.nodes) then
453 read (intin,'(e15.10,e15.5)',end=11,err=11) time,ene
454 call read_x(intin,*11)
456 c Broadcast the order to compute internal coordinates to the slaves.
458 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
460 call int_from_cart1(.false.)
462 read (intin,'(i5)',end=11,err=11) iconf
463 call read_angles(intin,*11)
464 call geom_to_var(nvar,varia)
467 write (iout,'(a,i7)') 'Conformation #',iconf
477 call mpi_send(ind,6,mpi_integer,mm,idint,CG_COMM,
479 call mpi_send(varia,nvar,mpi_double_precision,mm,
480 * idreal,CG_COMM,ierr)
481 call mpi_send(ene0,1,mpi_double_precision,mm,
482 * idreal,CG_COMM,ierr)
483 c print *,'task ',n,' sent to worker ',mm,nvar
485 call mpi_recv(ind,6,mpi_integer,mpi_any_source,idint,
486 * CG_COMM,muster,ierr)
487 man=muster(mpi_source)
488 c print *,'receiving result from worker ',man,' (',iii1,iii,')'
489 call mpi_recv(varia,nvar,mpi_double_precision,
490 * man,idreal,CG_COMM,muster,ierr)
492 * mpi_double_precision,man,idreal,
493 * CG_COMM,muster,ierr)
494 call mpi_recv(ene0,1,
495 * mpi_double_precision,man,idreal,
496 * CG_COMM,muster,ierr)
497 c print *,'result received from worker ',man,' sending now'
499 call var_to_geom(nvar,varia)
501 call etotal(energy(0))
505 write (iout,'(a,2i7)') 'Conformation #',iconf,ind(5)
508 call enerprint(energy(0))
509 call briefout(it,etot)
510 c if (minim) call briefout(it,etot)
512 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
513 write (istat,'(i5,19(f12.3))') iconf,
514 & (energy(print_order(i)),i=1,nprint_ene),etot,
515 & rms,frac,frac_nn,co
517 write (istat,'(i5,15(f12.3))') iconf,
518 & (energy(print_order(i)),i=1,nprint_ene),etot
523 read (intin,'(e15.10,e15.5)',end=1101,err=1101) time,ene
524 call read_x(intin,*11)
526 c Broadcast the order to compute internal coordinates to the slaves.
528 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
530 call int_from_cart1(.false.)
532 read (intin,'(i5)',end=1101,err=1101) iconf
533 call read_angles(intin,*11)
534 call geom_to_var(nvar,varia)
545 call mpi_send(ind,6,mpi_integer,man,idint,CG_COMM,
547 call mpi_send(varia,nvar,mpi_double_precision,man,
548 * idreal,CG_COMM,ierr)
549 call mpi_send(ene0,1,mpi_double_precision,man,
550 * idreal,CG_COMM,ierr)
551 nf_mcmf=nf_mcmf+ind(4)
557 call mpi_recv(ind,6,mpi_integer,mpi_any_source,idint,
558 * CG_COMM,muster,ierr)
559 man=muster(mpi_source)
560 call mpi_recv(varia,nvar,mpi_double_precision,
561 * man,idreal,CG_COMM,muster,ierr)
563 * mpi_double_precision,man,idreal,
564 * CG_COMM,muster,ierr)
565 call mpi_recv(ene0,1,
566 * mpi_double_precision,man,idreal,
567 * CG_COMM,muster,ierr)
569 call var_to_geom(nvar,varia)
571 call etotal(energy(0))
575 write (iout,'(a,2i7)') 'Conformation #',iconf,ind(5)
578 call enerprint(energy(0))
579 call briefout(it,etot)
581 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
582 write (istat,'(i5,19(f12.3))') iconf,
583 & (energy(print_order(i)),i=1,nprint_ene),etot,
584 & rms,frac,frac_nn,co
586 write (istat,'(i5,15(f12.3))') iconf,
587 & (energy(print_order(i)),i=1,nprint_ene),etot
599 call mpi_send(ind,6,mpi_integer,i,idint,CG_COMM,
604 open(intin,file=intinname,status='old')
605 write (istat,'(a5,20a12)')"# ",
606 & (wname(print_order(i)),i=1,nprint_ene)
607 write (istat,'("# ",20(1pe12.4))')
608 & (weights(print_order(i)),i=1,nprint_ene)
610 write (istat,'(a5,20a12)')"# ",
611 & (ename(print_order(i)),i=1,nprint_ene),
612 & "ETOT total","RMSD","nat.contact","nnt.contact"
614 write (istat,'(a5,14a12)')"# ",
615 & (ename(print_order(i)),i=1,nprint_ene),"ETOT total"
619 read (intin,'(e15.10,e15.5)',end=1100,err=1100) time,ene
620 call read_x(intin,*11)
622 c Broadcast the order to compute internal coordinates to the slaves.
624 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
626 call int_from_cart1(.false.)
628 read (intin,'(i5)',end=1100,err=1100) iconf
629 call read_angles(intin,*11)
630 call geom_to_var(nvar,varia)
633 write (iout,'(a,i7)') 'Conformation #',iconf
634 if (minim) call minimize(etot,varia,iretcode,nfun)
635 call etotal(energy(0))
638 call enerprint(energy(0))
639 if (minim) call briefout(it,etot)
641 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
642 write (istat,'(i5,18(f12.3))') iconf,
643 & (energy(print_order(i)),i=1,nprint_ene),
644 & etot,rms,frac,frac_nn,co
647 write (istat,'(i5,14(f12.3))') iconf,
648 & (energy(print_order(i)),i=1,nprint_ene),etot
655 c---------------------------------------------------------------------------
656 subroutine exec_checkgrad
657 implicit real*8 (a-h,o-z)
662 include 'COMMON.SETUP'
663 include 'COMMON.TIME1'
664 include 'COMMON.INTERACT'
665 include 'COMMON.NAMES'
667 include 'COMMON.HEADER'
668 include 'COMMON.CONTROL'
669 include 'COMMON.CONTACTS'
670 include 'COMMON.CHAIN'
672 include 'COMMON.IOUNITS'
673 include 'COMMON.FFIELD'
674 include 'COMMON.REMD'
676 include 'COMMON.SBRIDGE'
678 double precision energy(0:max_ene)
681 c vbld(i)=vbld(i)+ran_number(-0.1d0,0.1d0)
682 c if (itype(i).ne.10)
683 c & vbld(i+nres)=vbld(i+nres)+ran_number(-0.001d0,0.001d0)
685 if (indpdb.eq.0) call chainbuild
688 c dc(j,i)=dc(j,i)+ran_number(-0.2d0,0.2d0)
692 c if (itype(i).ne.10) then
694 c dc(j,i+nres)=dc(j,i+nres)+ran_number(-0.2d0,0.2d0)
699 c dc(j,0)=ran_number(-0.2d0,0.2d0)
705 print *, "AFTER read fragments"
707 print *,"chainbuild_cart"
709 print *,"After cartprint"
712 print *,"before ETOT"
713 call etotal(energy(0))
715 call enerprint(energy(0))
716 write (iout,*) "Uconst",Uconst," Uconst_back",uconst_back
717 print *,'icheckgrad=',icheckgrad
718 goto (10,20,30) icheckgrad
719 10 call check_ecartint
722 20 call check_cartgrad
727 c---------------------------------------------------------------------------
734 c---------------------------------------------------------------------------
740 include 'COMMON.IOUNITS'
741 C Conformational Space Annealling programmed by Jooyoung Lee.
742 C This method works only with parallel machines!
746 write (iout,*) "CSA works on parallel machines only"
750 c---------------------------------------------------------------------------
751 subroutine exec_softreg
753 include 'COMMON.IOUNITS'
754 include 'COMMON.CONTROL'
755 double precision energy(0:max_ene)
757 call etotal(energy(0))
758 call enerprint(energy(0))
759 if (.not.lsecondary) then
760 write(iout,*) 'Calling secondary structure recognition'
761 call secondary2(debug)
763 write(iout,*) 'Using secondary structure supplied in pdb'
768 call etotal(energy(0))
770 call enerprint(energy(0))
772 call briefout(0,etot)
773 call secondary2(.true.)
774 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)