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 03/28/12 23:29 by czarek'
56 if (me.eq.king) call cinfo
57 C Read force field parameters and job setup data
59 if (me.eq.king .or. .not. out1file) then
61 & text_mode_calc(modecalc)(:ilen(text_mode_calc(modecalc))),
63 if (minim) write (iout,'(a)')
64 & 'Conformations will be energy-minimized.'
65 write (iout,'(80(1h*)/)')
69 if (modecalc.eq.-2) then
72 else if (modecalc.eq.-1) then
73 write(iout,*) "call check_sc_map next"
78 if (fg_rank.gt.0) then
79 C Fine-grain slaves just do energy and gradient components.
80 call ergastulum ! slave workhouse in Latin
83 if (modecalc.eq.0) then
84 call exec_eeval_or_minim
85 else if (modecalc.eq.1) then
87 else if (modecalc.eq.2) then
89 else if (modecalc.eq.3 .or. modecalc .eq.6) then
91 else if (modecalc.eq.4) then
92 call exec_mult_eeval_or_minim
93 else if (modecalc.eq.5) then
95 else if (ModeCalc.eq.7) then
97 else if (ModeCalc.eq.8) then
99 else if (modecalc.eq.11) then
101 else if (modecalc.eq.12) then
103 else if (modecalc.eq.14) then
106 write (iout,'(a)') 'This calculation type is not supported',
112 if (fg_rank.eq.0) call finish_task
113 c call memmon_print_usage()
115 call print_detailed_timing
117 call MPI_Finalize(ierr)
120 call dajczas(tcpu(),hrtime,mintime,sectime)
121 stop '********** Program terminated normally.'
124 c--------------------------------------------------------------------------
130 include 'COMMON.SETUP'
131 include 'COMMON.CONTROL'
132 include 'COMMON.IOUNITS'
133 if (me.eq.king .or. .not. out1file)
134 & write (iout,*) "Calling chainbuild"
139 c---------------------------------------------------------------------------
140 subroutine exec_MREMD
144 include 'COMMON.SETUP'
145 include 'COMMON.CONTROL'
146 include 'COMMON.IOUNITS'
147 include 'COMMON.REMD'
148 if (me.eq.king .or. .not. out1file)
149 & write (iout,*) "Calling chainbuild"
151 if (me.eq.king .or. .not. out1file)
152 & write (iout,*) "Calling REMD"
162 write (iout,*) "MREMD works on parallel machines only"
166 c---------------------------------------------------------------------------
167 subroutine exec_eeval_or_minim
168 implicit real*8 (a-h,o-z)
173 include 'COMMON.SETUP'
174 include 'COMMON.TIME1'
175 include 'COMMON.INTERACT'
176 include 'COMMON.NAMES'
178 include 'COMMON.HEADER'
179 include 'COMMON.CONTROL'
180 include 'COMMON.CONTACTS'
181 include 'COMMON.CHAIN'
183 include 'COMMON.IOUNITS'
184 include 'COMMON.FFIELD'
185 include 'COMMON.REMD'
187 include 'COMMON.SBRIDGE'
189 double precision energy(0:n_ene)
190 double precision energy_long(0:n_ene),energy_short(0:n_ene)
191 double precision varia(maxvar)
192 if (indpdb.eq.0) call chainbuild
200 print *,"Processor",myrank," after chainbuild"
202 call etotal_long(energy_long(0))
203 write (iout,*) "Printing long range energy"
204 call enerprint(energy_long(0))
205 call etotal_short(energy_short(0))
206 write (iout,*) "Printing short range energy"
207 call enerprint(energy_short(0))
209 energy(i)=energy_long(i)+energy_short(i)
210 write (iout,*) i,energy_long(i),energy_short(i),energy(i)
212 write (iout,*) "Printing long+short range energy"
213 call enerprint(energy(0))
215 call etotal(energy(0))
217 time_ene=MPI_Wtime()-time00
219 time_ene=tcpu()-time00
221 write (iout,*) "Time for energy evaluation",time_ene
224 call enerprint(energy(0))
225 call hairpin(.true.,nharp,iharp)
226 call secondary2(.true.)
230 call overlap_sc(fail)
234 call sc_move(2,nres-1,10,1d10,nft_sc,etot)
243 call minim_dc(etot,iretcode,nfun)
245 if (indpdb.ne.0) then
249 call geom_to_var(nvar,varia)
255 call minimize(etot,varia,iretcode,nfun)
257 print *,'SUMSL return code is',iretcode,' eval ',nfun
259 evals=nfun/(MPI_WTIME()-time1)
261 evals=nfun/(tcpu()-time1)
263 print *,'# eval/s',evals
264 print *,'refstr=',refstr
265 call hairpin(.true.,nharp,iharp)
266 call secondary2(.true.)
267 call etotal(energy(0))
269 call enerprint(energy(0))
272 call briefout(0,etot)
273 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
274 write (iout,'(a,i3)') 'SUMSL return code:',iretcode
275 write (iout,'(a,i20)') '# of energy evaluations:',nfun+1
276 write (iout,'(a,f16.3)')'# of energy evaluations/sec:',evals
278 print *,'refstr=',refstr
279 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
280 call briefout(0,etot)
284 if (outx) call cartout(0.0d0)
286 if (outx) call cartoutx(0.0d0)
288 if (outpdb) call pdbout(etot,titel(:32),ipdb)
289 if (outmol2) call mol2out(etot,titel(:32))
292 c---------------------------------------------------------------------------
293 subroutine exec_regularize
294 implicit real*8 (a-h,o-z)
299 include 'COMMON.SETUP'
300 include 'COMMON.TIME1'
301 include 'COMMON.INTERACT'
302 include 'COMMON.NAMES'
304 include 'COMMON.HEADER'
305 include 'COMMON.CONTROL'
306 include 'COMMON.CONTACTS'
307 include 'COMMON.CHAIN'
309 include 'COMMON.IOUNITS'
310 include 'COMMON.FFIELD'
311 include 'COMMON.REMD'
313 include 'COMMON.SBRIDGE'
314 double precision energy(0:n_ene)
319 call regularize(nct-nnt+1,etot,rms,cref(1,nnt),iretcode)
320 call etotal(energy(0))
321 energy(0)=energy(0)-energy(14)
323 call enerprint(energy(0))
325 call briefout(0,etot)
328 if (outx) call cartout(0.0d0)
330 if (outx) call cartoutx(0.0d0)
332 if (outpdb) call pdbout(etot,titel(:32),ipdb)
333 if (outmol2) call mol2out(etot,titel(:32))
334 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
335 write (iout,'(a,i3)') 'SUMSL return code:',iretcode
338 c---------------------------------------------------------------------------
339 subroutine exec_thread
344 include "COMMON.SETUP"
348 c---------------------------------------------------------------------------
350 implicit real*8 (a-h,o-z)
352 character*10 nodeinfo
353 double precision varia(maxvar)
357 include "COMMON.SETUP"
358 include 'COMMON.CONTROL'
362 if (modecalc.eq.3) then
368 if (modecalc.eq.3) then
379 c---------------------------------------------------------------------------
380 subroutine exec_mult_eeval_or_minim
381 implicit real*8 (a-h,o-z)
385 dimension muster(mpi_status_size)
387 include 'COMMON.SETUP'
388 include 'COMMON.TIME1'
389 include 'COMMON.INTERACT'
390 include 'COMMON.NAMES'
392 include 'COMMON.HEADER'
393 include 'COMMON.CONTROL'
394 include 'COMMON.CONTACTS'
395 include 'COMMON.CHAIN'
397 include 'COMMON.IOUNITS'
398 include 'COMMON.FFIELD'
399 include 'COMMON.REMD'
401 include 'COMMON.SBRIDGE'
402 double precision varia(maxvar)
404 double precision energy(0:n_ene)
414 open(intin,file=intinname,status='old')
415 write (istat,'(a5,30a12)')"# ",
416 & (wname(print_order(i)),i=1,nprint_ene)
418 write (istat,'(a5,30a12)')"# ",
419 & (ename(print_order(i)),i=1,nprint_ene),
420 & "ETOT total","RMSD","nat.contact","nnt.contact","cont.order"
422 write (istat,'(a5,30a12)')"# ",
423 & (ename(print_order(i)),i=1,nprint_ene),"ETOT total"
429 read (intin,'(e15.10,e15.5)',end=1100,err=1100) time,ene
430 call read_x(intin,*11)
432 c Broadcast the order to compute internal coordinates to the slaves.
434 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
436 call int_from_cart1(.false.)
438 read (intin,'(i5)',end=1100,err=1100) iconf
439 call read_angles(intin,*11)
440 call geom_to_var(nvar,varia)
443 write (iout,'(a,i7)') 'Conformation #',iconf
444 call etotal(energy(0))
445 call briefout(iconf,energy(0))
446 call enerprint(energy(0))
449 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
450 write (istat,'(i5,30(f12.3))') iconf,
451 & (energy(print_order(i)),i=1,nprint_ene),etot,
452 & rms,frac,frac_nn,co
455 write (istat,'(i5,30(f12.3))') iconf,
456 & (energy(print_order(i)),i=1,nprint_ene),etot
472 if (mm.lt.nodes) then
474 read (intin,'(e15.10,e15.5)',end=11,err=11) time,ene
475 call read_x(intin,*11)
477 c Broadcast the order to compute internal coordinates to the slaves.
479 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
481 call int_from_cart1(.false.)
483 read (intin,'(i5)',end=11,err=11) iconf
484 call read_angles(intin,*11)
485 call geom_to_var(nvar,varia)
490 write (iout,*) 'Conformation #',iconf,' read'
499 call mpi_send(ind,6,mpi_integer,mm,idint,CG_COMM,
501 call mpi_send(varia,nvar,mpi_double_precision,mm,
502 * idreal,CG_COMM,ierr)
503 call mpi_send(ene0,1,mpi_double_precision,mm,
504 * idreal,CG_COMM,ierr)
505 c print *,'task ',n,' sent to worker ',mm,nvar
507 call mpi_recv(ind,6,mpi_integer,mpi_any_source,idint,
508 * CG_COMM,muster,ierr)
509 man=muster(mpi_source)
510 c print *,'receiving result from worker ',man,' (',iii1,iii,')'
511 call mpi_recv(varia,nvar,mpi_double_precision,
512 * man,idreal,CG_COMM,muster,ierr)
514 * mpi_double_precision,man,idreal,
515 * CG_COMM,muster,ierr)
516 call mpi_recv(ene0,1,
517 * mpi_double_precision,man,idreal,
518 * CG_COMM,muster,ierr)
519 c print *,'result received from worker ',man,' sending now'
521 call var_to_geom(nvar,varia)
523 call etotal(energy(0))
527 write (iout,*) 'Conformation #',iconf," sumsl return code ",
531 call enerprint(energy(0))
532 call briefout(it,etot)
533 c if (minim) call briefout(it,etot)
535 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
536 write (istat,'(i5,30(f12.3))') iconf,
537 & (energy(print_order(i)),i=1,nprint_ene),etot,
538 & rms,frac,frac_nn,co
540 write (istat,'(i5,30(f12.3))') iconf,
541 & (energy(print_order(i)),i=1,nprint_ene),etot
546 read (intin,'(e15.10,e15.5)',end=11,err=11) time,ene
547 call read_x(intin,*11)
549 c Broadcast the order to compute internal coordinates to the slaves.
551 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
553 call int_from_cart1(.false.)
555 read (intin,'(i5)',end=11,err=11) iconf
556 call read_angles(intin,*11)
557 call geom_to_var(nvar,varia)
561 write (iout,*) 'Conformation #',iconf,' read'
569 call mpi_send(ind,6,mpi_integer,man,idint,CG_COMM,
571 call mpi_send(varia,nvar,mpi_double_precision,man,
572 * idreal,CG_COMM,ierr)
573 call mpi_send(ene0,1,mpi_double_precision,man,
574 * idreal,CG_COMM,ierr)
575 nf_mcmf=nf_mcmf+ind(4)
581 call mpi_recv(ind,6,mpi_integer,mpi_any_source,idint,
582 * CG_COMM,muster,ierr)
583 man=muster(mpi_source)
584 call mpi_recv(varia,nvar,mpi_double_precision,
585 * man,idreal,CG_COMM,muster,ierr)
587 * mpi_double_precision,man,idreal,
588 * CG_COMM,muster,ierr)
589 call mpi_recv(ene0,1,
590 * mpi_double_precision,man,idreal,
591 * CG_COMM,muster,ierr)
593 call var_to_geom(nvar,varia)
595 call etotal(energy(0))
599 write (iout,*) 'Conformation #',iconf," sumsl return code ",
603 call enerprint(energy(0))
604 call briefout(it,etot)
606 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
607 write (istat,'(i5,30(f12.3))') iconf,
608 & (energy(print_order(i)),i=1,nprint_ene),etot,
609 & rms,frac,frac_nn,co
611 write (istat,'(i5,30(f12.3))') iconf,
612 & (energy(print_order(i)),i=1,nprint_ene),etot
624 call mpi_send(ind,6,mpi_integer,i,idint,CG_COMM,
629 open(intin,file=intinname,status='old')
630 write (istat,'(a5,20a12)')"# ",
631 & (wname(print_order(i)),i=1,nprint_ene)
632 write (istat,'("# ",20(1pe12.4))')
633 & (weights(print_order(i)),i=1,nprint_ene)
635 write (istat,'(a5,20a12)')"# ",
636 & (ename(print_order(i)),i=1,nprint_ene),
637 & "ETOT total","RMSD","nat.contact","nnt.contact"
639 write (istat,'(a5,14a12)')"# ",
640 & (ename(print_order(i)),i=1,nprint_ene),"ETOT total"
644 read (intin,'(e15.10,e15.5)',end=1100,err=1100) time,ene
645 call read_x(intin,*11)
647 c Broadcast the order to compute internal coordinates to the slaves.
649 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
651 call int_from_cart1(.false.)
653 read (intin,'(i5)',end=1100,err=1100) iconf
654 call read_angles(intin,*11)
655 call geom_to_var(nvar,varia)
658 write (iout,'(a,i7)') 'Conformation #',iconf
659 if (minim) call minimize(etot,varia,iretcode,nfun)
660 call etotal(energy(0))
663 call enerprint(energy(0))
664 if (minim) call briefout(it,etot)
666 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
667 write (istat,'(i5,18(f12.3))') iconf,
668 & (energy(print_order(i)),i=1,nprint_ene),
669 & etot,rms,frac,frac_nn,co
672 write (istat,'(i5,14(f12.3))') iconf,
673 & (energy(print_order(i)),i=1,nprint_ene),etot
681 c---------------------------------------------------------------------------
682 subroutine exec_checkgrad
683 implicit real*8 (a-h,o-z)
688 include 'COMMON.SETUP'
689 include 'COMMON.TIME1'
690 include 'COMMON.INTERACT'
691 include 'COMMON.NAMES'
693 include 'COMMON.HEADER'
694 include 'COMMON.CONTROL'
695 include 'COMMON.CONTACTS'
696 include 'COMMON.CHAIN'
698 include 'COMMON.IOUNITS'
699 include 'COMMON.FFIELD'
700 include 'COMMON.REMD'
702 include 'COMMON.SBRIDGE'
704 double precision energy(0:max_ene)
706 c vbld(i)=vbld(i)+ran_number(-0.1d0,0.1d0)
707 c if (itype(i).ne.10)
708 c & vbld(i+nres)=vbld(i+nres)+ran_number(-0.001d0,0.001d0)
710 if (indpdb.eq.0) call chainbuild
713 c dc(j,i)=dc(j,i)+ran_number(-0.2d0,0.2d0)
717 c if (itype(i).ne.10) then
719 c dc(j,i+nres)=dc(j,i+nres)+ran_number(-0.2d0,0.2d0)
724 c dc(j,0)=ran_number(-0.2d0,0.2d0)
731 call rescale_weights(t_bath)
736 call etotal(energy(0))
738 call enerprint(energy(0))
739 write (iout,*) "Uconst",Uconst," Uconst_back",uconst_back
740 print *,'icheckgrad=',icheckgrad
741 goto (10,20,30) icheckgrad
742 10 call check_ecartint
744 20 call check_cartgrad
749 c---------------------------------------------------------------------------
756 c---------------------------------------------------------------------------
762 include 'COMMON.IOUNITS'
763 C Conformational Space Annealling programmed by Jooyoung Lee.
764 C This method works only with parallel machines!
767 write (iout,*) "CSA is not supported in this version"
769 csa write (iout,*) "CSA works on parallel machines only"
770 write (iout,*) "CSA is not supported in this version"
774 c---------------------------------------------------------------------------
775 subroutine exec_softreg
776 implicit real*8 (a-h,o-z)
778 include 'COMMON.IOUNITS'
779 include 'COMMON.CONTROL'
780 double precision energy(0:max_ene)
781 logical debug /.false./
783 call etotal(energy(0))
784 call enerprint(energy(0))
785 if (.not.lsecondary) then
786 write(iout,*) 'Calling secondary structure recognition'
787 call secondary2(debug)
789 write(iout,*) 'Using secondary structure supplied in pdb'
794 call etotal(energy(0))
796 call enerprint(energy(0))
798 call briefout(0,etot)
799 call secondary2(.true.)
800 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)