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 double precision varia(maxvar)
194 if (indpdb.eq.0) call chainbuild
202 print *,"Processor",myrank," after chainbuild"
204 call etotal_long(energy_long(0))
205 write (iout,*) "Printing long range energy"
206 call enerprint(energy_long(0))
207 call etotal_short(energy_short(0))
208 write (iout,*) "Printing short range energy"
209 call enerprint(energy_short(0))
211 energy(i)=energy_long(i)+energy_short(i)
212 write (iout,*) i,energy_long(i),energy_short(i),energy(i)
214 write (iout,*) "Printing long+short range energy"
215 call enerprint(energy(0))
217 call etotal(energy(0))
219 time_ene=MPI_Wtime()-time00
221 time_ene=tcpu()-time00
223 write (iout,*) "Time for energy evaluation",time_ene
224 print *,"after etotal"
227 call enerprint(energy(0))
228 call hairpin(.true.,nharp,iharp)
229 call secondary2(.true.)
233 print *, 'Calling OVERLAP_SC'
234 call overlap_sc(fail)
238 call sc_move(2,nres-1,10,1d10,nft_sc,etot)
239 print *,'SC_move',nft_sc,etot
240 write(iout,*) 'SC_move',nft_sc,etot
244 print *, 'Calling MINIM_DC'
250 call minim_dc(etot,iretcode,nfun)
251 if(iretcode.eq.8) call check_ecartint
253 if (indpdb.ne.0) then
257 call geom_to_var(nvar,varia)
258 print *,'Calling MINIMIZE.'
264 call minimize(etot,varia,iretcode,nfun)
266 print *,'SUMSL return code is',iretcode,' eval ',nfun
268 evals=nfun/(MPI_WTIME()-time1)
270 evals=nfun/(tcpu()-time1)
272 print *,'# eval/s',evals
273 print *,'refstr=',refstr
274 call hairpin(.true.,nharp,iharp)
275 call secondary2(.true.)
276 call etotal(energy(0))
278 call enerprint(energy(0))
281 call briefout(0,etot)
282 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
283 write (iout,'(a,i3)') 'SUMSL return code:',iretcode
284 write (iout,'(a,i20)') '# of energy evaluations:',nfun+1
285 write (iout,'(a,f16.3)')'# of energy evaluations/sec:',evals
287 print *,'refstr=',refstr
288 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
289 call briefout(0,etot)
291 if (outpdb) call pdbout(etot,titel(:32),ipdb)
292 if (outmol2) call mol2out(etot,titel(:32))
295 c---------------------------------------------------------------------------
296 subroutine exec_regularize
297 implicit real*8 (a-h,o-z)
302 include 'COMMON.SETUP'
303 include 'COMMON.TIME1'
304 include 'COMMON.INTERACT'
305 include 'COMMON.NAMES'
307 include 'COMMON.HEADER'
308 include 'COMMON.CONTROL'
309 include 'COMMON.CONTACTS'
310 include 'COMMON.CHAIN'
312 include 'COMMON.IOUNITS'
313 include 'COMMON.FFIELD'
314 include 'COMMON.REMD'
316 include 'COMMON.SBRIDGE'
317 double precision energy(0:n_ene)
322 call regularize(nct-nnt+1,etot,rms,cref(1,nnt),iretcode)
323 call etotal(energy(0))
324 energy(0)=energy(0)-energy(14)
326 call enerprint(energy(0))
328 call briefout(0,etot)
329 if (outpdb) call pdbout(etot,titel(:32),ipdb)
330 if (outmol2) call mol2out(etot,titel(:32))
331 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
332 write (iout,'(a,i3)') 'SUMSL return code:',iretcode
335 c---------------------------------------------------------------------------
336 subroutine exec_thread
341 include "COMMON.SETUP"
345 c---------------------------------------------------------------------------
347 implicit real*8 (a-h,o-z)
349 character*10 nodeinfo
350 double precision varia(maxvar)
354 include "COMMON.SETUP"
355 include 'COMMON.CONTROL'
359 if (modecalc.eq.3) then
365 if (modecalc.eq.3) then
376 c---------------------------------------------------------------------------
377 subroutine exec_mult_eeval_or_minim
378 implicit real*8 (a-h,o-z)
382 dimension muster(mpi_status_size)
384 include 'COMMON.SETUP'
385 include 'COMMON.TIME1'
386 include 'COMMON.INTERACT'
387 include 'COMMON.NAMES'
389 include 'COMMON.HEADER'
390 include 'COMMON.CONTROL'
391 include 'COMMON.CONTACTS'
392 include 'COMMON.CHAIN'
394 include 'COMMON.IOUNITS'
395 include 'COMMON.FFIELD'
396 include 'COMMON.REMD'
398 include 'COMMON.SBRIDGE'
399 double precision varia(maxvar)
401 double precision energy(0:n_ene)
411 open(intin,file=intinname,status='old')
412 write (istat,'(a5,30a12)')"# ",
413 & (wname(print_order(i)),i=1,nprint_ene)
415 write (istat,'(a5,30a12)')"# ",
416 & (ename(print_order(i)),i=1,nprint_ene),
417 & "ETOT total","RMSD","nat.contact","nnt.contact","cont.order"
419 write (istat,'(a5,30a12)')"# ",
420 & (ename(print_order(i)),i=1,nprint_ene),"ETOT total"
426 read (intin,'(e15.10,e15.5)',end=1100,err=1100) time,ene
427 call read_x(intin,*11)
429 c Broadcast the order to compute internal coordinates to the slaves.
431 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
433 call int_from_cart1(.false.)
435 read (intin,'(i5)',end=1100,err=1100) iconf
436 call read_angles(intin,*11)
437 call geom_to_var(nvar,varia)
440 write (iout,'(a,i7)') 'Conformation #',iconf
441 call etotal(energy(0))
442 call briefout(iconf,energy(0))
443 call enerprint(energy(0))
446 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
447 write (istat,'(i5,30(f12.3))') iconf,
448 & (energy(print_order(i)),i=1,nprint_ene),etot,
449 & rms,frac,frac_nn,co
452 write (istat,'(i5,30(f12.3))') iconf,
453 & (energy(print_order(i)),i=1,nprint_ene),etot
469 if (mm.lt.nodes) then
471 read (intin,'(e15.10,e15.5)',end=11,err=11) time,ene
472 call read_x(intin,*11)
474 c Broadcast the order to compute internal coordinates to the slaves.
476 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
478 call int_from_cart1(.false.)
480 read (intin,'(i5)',end=11,err=11) iconf
481 call read_angles(intin,*11)
482 call geom_to_var(nvar,varia)
487 write (iout,*) 'Conformation #',iconf,' read'
496 call mpi_send(ind,6,mpi_integer,mm,idint,CG_COMM,
498 call mpi_send(varia,nvar,mpi_double_precision,mm,
499 * idreal,CG_COMM,ierr)
500 call mpi_send(ene0,1,mpi_double_precision,mm,
501 * idreal,CG_COMM,ierr)
502 c print *,'task ',n,' sent to worker ',mm,nvar
504 call mpi_recv(ind,6,mpi_integer,mpi_any_source,idint,
505 * CG_COMM,muster,ierr)
506 man=muster(mpi_source)
507 c print *,'receiving result from worker ',man,' (',iii1,iii,')'
508 call mpi_recv(varia,nvar,mpi_double_precision,
509 * man,idreal,CG_COMM,muster,ierr)
511 * mpi_double_precision,man,idreal,
512 * CG_COMM,muster,ierr)
513 call mpi_recv(ene0,1,
514 * mpi_double_precision,man,idreal,
515 * CG_COMM,muster,ierr)
516 c print *,'result received from worker ',man,' sending now'
518 call var_to_geom(nvar,varia)
520 call etotal(energy(0))
524 write (iout,*) 'Conformation #',iconf," sumsl return code ",
528 call enerprint(energy(0))
529 call briefout(it,etot)
530 c if (minim) call briefout(it,etot)
532 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
533 write (istat,'(i5,30(f12.3))') iconf,
534 & (energy(print_order(i)),i=1,nprint_ene),etot,
535 & rms,frac,frac_nn,co
537 write (istat,'(i5,30(f12.3))') iconf,
538 & (energy(print_order(i)),i=1,nprint_ene),etot
543 read (intin,'(e15.10,e15.5)',end=11,err=11) time,ene
544 call read_x(intin,*11)
546 c Broadcast the order to compute internal coordinates to the slaves.
548 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
550 call int_from_cart1(.false.)
552 read (intin,'(i5)',end=11,err=11) iconf
553 call read_angles(intin,*11)
554 call geom_to_var(nvar,varia)
558 write (iout,*) 'Conformation #',iconf,' read'
566 call mpi_send(ind,6,mpi_integer,man,idint,CG_COMM,
568 call mpi_send(varia,nvar,mpi_double_precision,man,
569 * idreal,CG_COMM,ierr)
570 call mpi_send(ene0,1,mpi_double_precision,man,
571 * idreal,CG_COMM,ierr)
572 nf_mcmf=nf_mcmf+ind(4)
578 call mpi_recv(ind,6,mpi_integer,mpi_any_source,idint,
579 * CG_COMM,muster,ierr)
580 man=muster(mpi_source)
581 call mpi_recv(varia,nvar,mpi_double_precision,
582 * man,idreal,CG_COMM,muster,ierr)
584 * mpi_double_precision,man,idreal,
585 * CG_COMM,muster,ierr)
586 call mpi_recv(ene0,1,
587 * mpi_double_precision,man,idreal,
588 * CG_COMM,muster,ierr)
590 call var_to_geom(nvar,varia)
592 call etotal(energy(0))
596 write (iout,*) 'Conformation #',iconf," sumsl return code ",
600 call enerprint(energy(0))
601 call briefout(it,etot)
603 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
604 write (istat,'(i5,30(f12.3))') iconf,
605 & (energy(print_order(i)),i=1,nprint_ene),etot,
606 & rms,frac,frac_nn,co
608 write (istat,'(i5,30(f12.3))') iconf,
609 & (energy(print_order(i)),i=1,nprint_ene),etot
621 call mpi_send(ind,6,mpi_integer,i,idint,CG_COMM,
626 open(intin,file=intinname,status='old')
627 write (istat,'(a5,20a12)')"# ",
628 & (wname(print_order(i)),i=1,nprint_ene)
629 write (istat,'("# ",20(1pe12.4))')
630 & (weights(print_order(i)),i=1,nprint_ene)
632 write (istat,'(a5,20a12)')"# ",
633 & (ename(print_order(i)),i=1,nprint_ene),
634 & "ETOT total","RMSD","nat.contact","nnt.contact"
636 write (istat,'(a5,14a12)')"# ",
637 & (ename(print_order(i)),i=1,nprint_ene),"ETOT total"
641 read (intin,'(e15.10,e15.5)',end=1100,err=1100) time,ene
642 call read_x(intin,*11)
644 c Broadcast the order to compute internal coordinates to the slaves.
646 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
648 call int_from_cart1(.false.)
650 read (intin,'(i5)',end=1100,err=1100) iconf
651 call read_angles(intin,*11)
652 call geom_to_var(nvar,varia)
655 write (iout,'(a,i7)') 'Conformation #',iconf
656 if (minim) call minimize(etot,varia,iretcode,nfun)
657 call etotal(energy(0))
660 call enerprint(energy(0))
661 if (minim) call briefout(it,etot)
663 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
664 write (istat,'(i5,18(f12.3))') iconf,
665 & (energy(print_order(i)),i=1,nprint_ene),
666 & etot,rms,frac,frac_nn,co
669 write (istat,'(i5,14(f12.3))') iconf,
670 & (energy(print_order(i)),i=1,nprint_ene),etot
678 c---------------------------------------------------------------------------
679 subroutine exec_checkgrad
680 implicit real*8 (a-h,o-z)
685 include 'COMMON.SETUP'
686 include 'COMMON.TIME1'
687 include 'COMMON.INTERACT'
688 include 'COMMON.NAMES'
690 include 'COMMON.HEADER'
691 include 'COMMON.CONTROL'
692 include 'COMMON.CONTACTS'
693 include 'COMMON.CHAIN'
695 include 'COMMON.IOUNITS'
696 include 'COMMON.FFIELD'
697 include 'COMMON.REMD'
699 include 'COMMON.SBRIDGE'
701 double precision energy(0:max_ene)
703 c vbld(i)=vbld(i)+ran_number(-0.1d0,0.1d0)
704 c if (itype(i).ne.10)
705 c & vbld(i+nres)=vbld(i+nres)+ran_number(-0.001d0,0.001d0)
707 if (indpdb.eq.0) call chainbuild
710 c dc(j,i)=dc(j,i)+ran_number(-0.2d0,0.2d0)
714 c if (itype(i).ne.10) then
716 c dc(j,i+nres)=dc(j,i+nres)+ran_number(-0.2d0,0.2d0)
721 c dc(j,0)=ran_number(-0.2d0,0.2d0)
728 call rescale_weights(t_bath)
733 call etotal(energy(0))
735 call enerprint(energy(0))
736 write (iout,*) "Uconst",Uconst," Uconst_back",uconst_back
737 print *,'icheckgrad=',icheckgrad
738 goto (10,20,30) icheckgrad
739 10 call check_ecartint
742 20 call check_cartgrad
747 c---------------------------------------------------------------------------
754 c---------------------------------------------------------------------------
760 include 'COMMON.IOUNITS'
761 C Conformational Space Annealling programmed by Jooyoung Lee.
762 C This method works only with parallel machines!
765 write (iout,*) "CSA is not supported in this version"
767 csa write (iout,*) "CSA works on parallel machines only"
768 write (iout,*) "CSA is not supported in this version"
772 c---------------------------------------------------------------------------
773 subroutine exec_softreg
774 implicit real*8 (a-h,o-z)
776 include 'COMMON.IOUNITS'
777 include 'COMMON.CONTROL'
778 double precision energy(0:max_ene)
779 logical debug /.false./
781 call etotal(energy(0))
782 call enerprint(energy(0))
783 if (.not.lsecondary) then
784 write(iout,*) 'Calling secondary structure recognition'
785 call secondary2(debug)
787 write(iout,*) 'Using secondary structure supplied in pdb'
792 call etotal(energy(0))
794 call enerprint(energy(0))
796 call briefout(0,etot)
797 call secondary2(.true.)
798 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)