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
61 if (me.eq.king .or. .not. out1file) then
63 & text_mode_calc(modecalc)(:ilen(text_mode_calc(modecalc))),
65 if (minim) write (iout,'(a)')
66 & 'Conformations will be energy-minimized.'
67 write (iout,'(80(1h*)/)')
71 if (modecalc.eq.-2) then
74 else if (modecalc.eq.-1) then
75 write(iout,*) "call check_sc_map next"
80 if (fg_rank.gt.0) then
81 C Fine-grain slaves just do energy and gradient components.
82 call ergastulum ! slave workhouse in Latin
85 if (modecalc.eq.0) then
86 call exec_eeval_or_minim
87 else if (modecalc.eq.1) then
89 else if (modecalc.eq.2) then
91 else if (modecalc.eq.3 .or. modecalc .eq.6) then
93 else if (modecalc.eq.4) then
94 call exec_mult_eeval_or_minim
95 else if (modecalc.eq.5) then
97 else if (ModeCalc.eq.7) then
99 else if (ModeCalc.eq.8) then
101 else if (modecalc.eq.11) then
103 else if (modecalc.eq.12) then
105 else if (modecalc.eq.14) then
108 write (iout,'(a)') 'This calculation type is not supported',
114 if (fg_rank.eq.0) call finish_task
115 c call memmon_print_usage()
117 call print_detailed_timing
119 call MPI_Finalize(ierr)
122 call dajczas(tcpu(),hrtime,mintime,sectime)
123 stop '********** Program terminated normally.'
126 c--------------------------------------------------------------------------
132 include 'COMMON.SETUP'
133 include 'COMMON.CONTROL'
134 include 'COMMON.IOUNITS'
135 if (me.eq.king .or. .not. out1file)
136 & write (iout,*) "Calling chainbuild"
141 c---------------------------------------------------------------------------
142 subroutine exec_MREMD
146 include 'COMMON.SETUP'
147 include 'COMMON.CONTROL'
148 include 'COMMON.IOUNITS'
149 include 'COMMON.REMD'
150 if (me.eq.king .or. .not. out1file)
151 & write (iout,*) "Calling chainbuild"
153 if (me.eq.king .or. .not. out1file)
154 & write (iout,*) "Calling REMD"
164 write (iout,*) "MREMD works on parallel machines only"
168 c---------------------------------------------------------------------------
169 subroutine exec_eeval_or_minim
170 implicit real*8 (a-h,o-z)
175 include 'COMMON.SETUP'
176 include 'COMMON.TIME1'
177 include 'COMMON.INTERACT'
178 include 'COMMON.NAMES'
180 include 'COMMON.HEADER'
181 include 'COMMON.CONTROL'
182 include 'COMMON.CONTACTS'
183 include 'COMMON.CHAIN'
185 include 'COMMON.IOUNITS'
186 include 'COMMON.FFIELD'
187 include 'COMMON.REMD'
189 include 'COMMON.SBRIDGE'
191 double precision energy(0:n_ene)
192 double precision energy_long(0:n_ene),energy_short(0:n_ene)
193 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))
218 time_ene=MPI_Wtime()-time00
220 time_ene=tcpu()-time00
222 write (iout,*) "Time for energy evaluation",time_ene
223 print *,"after etotal"
226 call enerprint(energy(0))
227 call hairpin(.true.,nharp,iharp)
228 call secondary2(.true.)
232 print *, 'Calling OVERLAP_SC'
233 call overlap_sc(fail)
237 call sc_move(2,nres-1,10,1d10,nft_sc,etot)
238 print *,'SC_move',nft_sc,etot
239 write(iout,*) 'SC_move',nft_sc,etot
243 print *, 'Calling MINIM_DC'
249 call minim_dc(etot,iretcode,nfun)
251 if (indpdb.ne.0) then
255 call geom_to_var(nvar,varia)
256 print *,'Calling MINIMIZE.'
262 call minimize(etot,varia,iretcode,nfun)
264 print *,'SUMSL return code is',iretcode,' eval ',nfun
266 evals=nfun/(MPI_WTIME()-time1)
268 evals=nfun/(tcpu()-time1)
270 print *,'# eval/s',evals
271 print *,'refstr=',refstr
272 call hairpin(.true.,nharp,iharp)
273 call secondary2(.true.)
274 call etotal(energy(0))
276 call enerprint(energy(0))
279 call briefout(0,etot)
280 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
281 write (iout,'(a,i3)') 'SUMSL return code:',iretcode
282 write (iout,'(a,i20)') '# of energy evaluations:',nfun+1
283 write (iout,'(a,f16.3)')'# of energy evaluations/sec:',evals
285 print *,'refstr=',refstr
286 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
287 call briefout(0,etot)
289 if (outpdb) call pdbout(etot,titel(:32),ipdb)
290 if (outmol2) call mol2out(etot,titel(:32))
293 c---------------------------------------------------------------------------
294 subroutine exec_regularize
295 implicit real*8 (a-h,o-z)
300 include 'COMMON.SETUP'
301 include 'COMMON.TIME1'
302 include 'COMMON.INTERACT'
303 include 'COMMON.NAMES'
305 include 'COMMON.HEADER'
306 include 'COMMON.CONTROL'
307 include 'COMMON.CONTACTS'
308 include 'COMMON.CHAIN'
310 include 'COMMON.IOUNITS'
311 include 'COMMON.FFIELD'
312 include 'COMMON.REMD'
314 include 'COMMON.SBRIDGE'
315 double precision energy(0:n_ene)
320 call regularize(nct-nnt+1,etot,rms,cref(1,nnt),iretcode)
321 call etotal(energy(0))
322 energy(0)=energy(0)-energy(14)
324 call enerprint(energy(0))
326 call briefout(0,etot)
327 if (outpdb) call pdbout(etot,titel(:32),ipdb)
328 if (outmol2) call mol2out(etot,titel(:32))
329 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
330 write (iout,'(a,i3)') 'SUMSL return code:',iretcode
333 c---------------------------------------------------------------------------
334 subroutine exec_thread
339 include "COMMON.SETUP"
343 c---------------------------------------------------------------------------
345 implicit real*8 (a-h,o-z)
347 character*10 nodeinfo
348 double precision varia(maxvar)
352 include "COMMON.SETUP"
353 include 'COMMON.CONTROL'
357 if (modecalc.eq.3) then
363 if (modecalc.eq.3) then
374 c---------------------------------------------------------------------------
375 subroutine exec_mult_eeval_or_minim
376 implicit real*8 (a-h,o-z)
380 dimension muster(mpi_status_size)
382 include 'COMMON.SETUP'
383 include 'COMMON.TIME1'
384 include 'COMMON.INTERACT'
385 include 'COMMON.NAMES'
387 include 'COMMON.HEADER'
388 include 'COMMON.CONTROL'
389 include 'COMMON.CONTACTS'
390 include 'COMMON.CHAIN'
392 include 'COMMON.IOUNITS'
393 include 'COMMON.FFIELD'
394 include 'COMMON.REMD'
396 include 'COMMON.SBRIDGE'
397 double precision varia(maxvar)
399 double precision energy(0:max_ene)
409 open(intin,file=intinname,status='old')
410 write (istat,'(a5,20a12)')"# ",
411 & (wname(print_order(i)),i=1,nprint_ene)
413 write (istat,'(a5,20a12)')"# ",
414 & (ename(print_order(i)),i=1,nprint_ene),
415 & "ETOT total","RMSD","nat.contact","nnt.contact"
417 write (istat,'(a5,20a12)')"# ",
418 & (ename(print_order(i)),i=1,nprint_ene),"ETOT total"
424 read (intin,'(e15.10,e15.5)',end=1100,err=1100) time,ene
425 call read_x(intin,*11)
427 c Broadcast the order to compute internal coordinates to the slaves.
429 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
431 call int_from_cart1(.false.)
433 read (intin,'(i5)',end=1100,err=1100) iconf
434 call read_angles(intin,*11)
435 call geom_to_var(nvar,varia)
438 write (iout,'(a,i7)') 'Conformation #',iconf
439 call etotal(energy(0))
440 call briefout(iconf,energy(0))
441 call enerprint(energy(0))
444 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
445 write (istat,'(i5,20(f12.3))') iconf,
446 & (energy(print_order(i)),i=1,nprint_ene),etot,
447 & rms,frac,frac_nn,co
450 write (istat,'(i5,16(f12.3))') iconf,
451 & (energy(print_order(i)),i=1,nprint_ene),etot
467 if (mm.lt.nodes) then
469 read (intin,'(e15.10,e15.5)',end=11,err=11) time,ene
470 call read_x(intin,*11)
472 c Broadcast the order to compute internal coordinates to the slaves.
474 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
476 call int_from_cart1(.false.)
478 read (intin,'(i5)',end=11,err=11) iconf
479 call read_angles(intin,*11)
480 call geom_to_var(nvar,varia)
483 write (iout,'(a,i7)') 'Conformation #',iconf
493 call mpi_send(ind,6,mpi_integer,mm,idint,CG_COMM,
495 call mpi_send(varia,nvar,mpi_double_precision,mm,
496 * idreal,CG_COMM,ierr)
497 call mpi_send(ene0,1,mpi_double_precision,mm,
498 * idreal,CG_COMM,ierr)
499 c print *,'task ',n,' sent to worker ',mm,nvar
501 call mpi_recv(ind,6,mpi_integer,mpi_any_source,idint,
502 * CG_COMM,muster,ierr)
503 man=muster(mpi_source)
504 c print *,'receiving result from worker ',man,' (',iii1,iii,')'
505 call mpi_recv(varia,nvar,mpi_double_precision,
506 * man,idreal,CG_COMM,muster,ierr)
508 * mpi_double_precision,man,idreal,
509 * CG_COMM,muster,ierr)
510 call mpi_recv(ene0,1,
511 * mpi_double_precision,man,idreal,
512 * CG_COMM,muster,ierr)
513 c print *,'result received from worker ',man,' sending now'
515 call var_to_geom(nvar,varia)
517 call etotal(energy(0))
521 write (iout,'(a,2i7)') 'Conformation #',iconf,ind(5)
524 call enerprint(energy(0))
525 call briefout(it,etot)
526 c if (minim) call briefout(it,etot)
528 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
529 write (istat,'(i5,19(f12.3))') iconf,
530 & (energy(print_order(i)),i=1,nprint_ene),etot,
531 & rms,frac,frac_nn,co
533 write (istat,'(i5,15(f12.3))') iconf,
534 & (energy(print_order(i)),i=1,nprint_ene),etot
539 read (intin,'(e15.10,e15.5)',end=1101,err=1101) time,ene
540 call read_x(intin,*11)
542 c Broadcast the order to compute internal coordinates to the slaves.
544 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
546 call int_from_cart1(.false.)
548 read (intin,'(i5)',end=1101,err=1101) iconf
549 call read_angles(intin,*11)
550 call geom_to_var(nvar,varia)
561 call mpi_send(ind,6,mpi_integer,man,idint,CG_COMM,
563 call mpi_send(varia,nvar,mpi_double_precision,man,
564 * idreal,CG_COMM,ierr)
565 call mpi_send(ene0,1,mpi_double_precision,man,
566 * idreal,CG_COMM,ierr)
567 nf_mcmf=nf_mcmf+ind(4)
573 call mpi_recv(ind,6,mpi_integer,mpi_any_source,idint,
574 * CG_COMM,muster,ierr)
575 man=muster(mpi_source)
576 call mpi_recv(varia,nvar,mpi_double_precision,
577 * man,idreal,CG_COMM,muster,ierr)
579 * mpi_double_precision,man,idreal,
580 * CG_COMM,muster,ierr)
581 call mpi_recv(ene0,1,
582 * mpi_double_precision,man,idreal,
583 * CG_COMM,muster,ierr)
585 call var_to_geom(nvar,varia)
587 call etotal(energy(0))
591 write (iout,'(a,2i7)') 'Conformation #',iconf,ind(5)
594 call enerprint(energy(0))
595 call briefout(it,etot)
597 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
598 write (istat,'(i5,19(f12.3))') iconf,
599 & (energy(print_order(i)),i=1,nprint_ene),etot,
600 & rms,frac,frac_nn,co
602 write (istat,'(i5,15(f12.3))') iconf,
603 & (energy(print_order(i)),i=1,nprint_ene),etot
615 call mpi_send(ind,6,mpi_integer,i,idint,CG_COMM,
620 open(intin,file=intinname,status='old')
621 write (istat,'(a5,20a12)')"# ",
622 & (wname(print_order(i)),i=1,nprint_ene)
623 write (istat,'("# ",20(1pe12.4))')
624 & (weights(print_order(i)),i=1,nprint_ene)
626 write (istat,'(a5,20a12)')"# ",
627 & (ename(print_order(i)),i=1,nprint_ene),
628 & "ETOT total","RMSD","nat.contact","nnt.contact"
630 write (istat,'(a5,14a12)')"# ",
631 & (ename(print_order(i)),i=1,nprint_ene),"ETOT total"
635 read (intin,'(e15.10,e15.5)',end=1100,err=1100) time,ene
636 call read_x(intin,*11)
638 c Broadcast the order to compute internal coordinates to the slaves.
640 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
642 call int_from_cart1(.false.)
644 read (intin,'(i5)',end=1100,err=1100) iconf
645 call read_angles(intin,*11)
646 call geom_to_var(nvar,varia)
649 write (iout,'(a,i7)') 'Conformation #',iconf
650 if (minim) call minimize(etot,varia,iretcode,nfun)
651 call etotal(energy(0))
654 call enerprint(energy(0))
655 if (minim) call briefout(it,etot)
657 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
658 write (istat,'(i5,18(f12.3))') iconf,
659 & (energy(print_order(i)),i=1,nprint_ene),
660 & etot,rms,frac,frac_nn,co
663 write (istat,'(i5,14(f12.3))') iconf,
664 & (energy(print_order(i)),i=1,nprint_ene),etot
672 c---------------------------------------------------------------------------
673 subroutine exec_checkgrad
674 implicit real*8 (a-h,o-z)
679 include 'COMMON.SETUP'
680 include 'COMMON.TIME1'
681 include 'COMMON.INTERACT'
682 include 'COMMON.NAMES'
684 include 'COMMON.HEADER'
685 include 'COMMON.CONTROL'
686 include 'COMMON.CONTACTS'
687 include 'COMMON.CHAIN'
689 include 'COMMON.IOUNITS'
690 include 'COMMON.FFIELD'
691 include 'COMMON.REMD'
693 include 'COMMON.SBRIDGE'
695 double precision energy(0:max_ene)
697 c vbld(i)=vbld(i)+ran_number(-0.1d0,0.1d0)
698 c if (itype(i).ne.10)
699 c & vbld(i+nres)=vbld(i+nres)+ran_number(-0.001d0,0.001d0)
701 if (indpdb.eq.0) call chainbuild
704 c dc(j,i)=dc(j,i)+ran_number(-0.2d0,0.2d0)
708 c if (itype(i).ne.10) then
710 c dc(j,i+nres)=dc(j,i+nres)+ran_number(-0.2d0,0.2d0)
715 c dc(j,0)=ran_number(-0.2d0,0.2d0)
722 call rescale_weights(t_bath)
727 call etotal(energy(0))
729 call enerprint(energy(0))
730 write (iout,*) "Uconst",Uconst," Uconst_back",uconst_back
731 print *,'icheckgrad=',icheckgrad
732 goto (10,20,30) icheckgrad
733 10 call check_ecartint
735 20 call check_cartgrad
740 c---------------------------------------------------------------------------
747 c---------------------------------------------------------------------------
753 include 'COMMON.IOUNITS'
754 C Conformational Space Annealling programmed by Jooyoung Lee.
755 C This method works only with parallel machines!
758 write (iout,*) "CSA is not supported in this version"
760 csa write (iout,*) "CSA works on parallel machines only"
761 write (iout,*) "CSA is not supported in this version"
765 c---------------------------------------------------------------------------
766 subroutine exec_softreg
767 implicit real*8 (a-h,o-z)
769 include 'COMMON.IOUNITS'
770 include 'COMMON.CONTROL'
771 double precision energy(0:max_ene)
772 logical debug /.false./
774 call etotal(energy(0))
775 call enerprint(energy(0))
776 if (.not.lsecondary) then
777 write(iout,*) 'Calling secondary structure recognition'
778 call secondary2(debug)
780 write(iout,*) 'Using secondary structure supplied in pdb'
785 call etotal(energy(0))
787 call enerprint(energy(0))
789 call briefout(0,etot)
790 call secondary2(.true.)
791 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)