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))
290 if (minim .and. iretcode.ne.4) call check_ecartint
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)
329 if (outx) call cartout(0.0d0)
331 if (outx) call cartoutx(0.0d0)
333 if (outpdb) call pdbout(etot,titel(:32),ipdb)
334 if (outmol2) call mol2out(etot,titel(:32))
335 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
336 write (iout,'(a,i3)') 'SUMSL return code:',iretcode
339 c---------------------------------------------------------------------------
340 subroutine exec_thread
345 include "COMMON.SETUP"
349 c---------------------------------------------------------------------------
351 implicit real*8 (a-h,o-z)
353 character*10 nodeinfo
354 double precision varia(maxvar)
358 include "COMMON.SETUP"
359 include 'COMMON.CONTROL'
363 if (modecalc.eq.3) then
369 if (modecalc.eq.3) then
380 c---------------------------------------------------------------------------
381 subroutine exec_mult_eeval_or_minim
382 implicit real*8 (a-h,o-z)
386 dimension muster(mpi_status_size)
388 include 'COMMON.SETUP'
389 include 'COMMON.TIME1'
390 include 'COMMON.INTERACT'
391 include 'COMMON.NAMES'
393 include 'COMMON.HEADER'
394 include 'COMMON.CONTROL'
395 include 'COMMON.CONTACTS'
396 include 'COMMON.CHAIN'
398 include 'COMMON.IOUNITS'
399 include 'COMMON.FFIELD'
400 include 'COMMON.REMD'
402 include 'COMMON.SBRIDGE'
403 double precision varia(maxvar)
405 double precision energy(0:n_ene)
415 open(intin,file=intinname,status='old')
416 write (istat,'(a5,30a12)')"# ",
417 & (wname(print_order(i)),i=1,nprint_ene)
419 write (istat,'(a5,30a12)')"# ",
420 & (ename(print_order(i)),i=1,nprint_ene),
421 & "ETOT total","RMSD","nat.contact","nnt.contact","cont.order"
423 write (istat,'(a5,30a12)')"# ",
424 & (ename(print_order(i)),i=1,nprint_ene),"ETOT total"
430 read (intin,'(e15.10,e15.5)',end=1100,err=1100) time,ene
431 call read_x(intin,*11)
433 c Broadcast the order to compute internal coordinates to the slaves.
435 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
437 call int_from_cart1(.false.)
439 read (intin,'(i5)',end=1100,err=1100) iconf
440 call read_angles(intin,*11)
441 call geom_to_var(nvar,varia)
444 write (iout,'(a,i7)') 'Conformation #',iconf
445 call etotal(energy(0))
446 call briefout(iconf,energy(0))
447 call enerprint(energy(0))
450 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
451 write (istat,'(i5,30(f12.3))') iconf,
452 & (energy(print_order(i)),i=1,nprint_ene),etot,
453 & rms,frac,frac_nn,co
456 write (istat,'(i5,30(f12.3))') iconf,
457 & (energy(print_order(i)),i=1,nprint_ene),etot
473 if (mm.lt.nodes) then
475 read (intin,'(e15.10,e15.5)',end=11,err=11) time,ene
476 call read_x(intin,*11)
478 c Broadcast the order to compute internal coordinates to the slaves.
480 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
482 call int_from_cart1(.false.)
484 read (intin,'(i5)',end=11,err=11) iconf
485 call read_angles(intin,*11)
486 call geom_to_var(nvar,varia)
491 write (iout,*) 'Conformation #',iconf,' read'
500 call mpi_send(ind,6,mpi_integer,mm,idint,CG_COMM,
502 call mpi_send(varia,nvar,mpi_double_precision,mm,
503 * idreal,CG_COMM,ierr)
504 call mpi_send(ene0,1,mpi_double_precision,mm,
505 * idreal,CG_COMM,ierr)
506 c print *,'task ',n,' sent to worker ',mm,nvar
508 call mpi_recv(ind,6,mpi_integer,mpi_any_source,idint,
509 * CG_COMM,muster,ierr)
510 man=muster(mpi_source)
511 c print *,'receiving result from worker ',man,' (',iii1,iii,')'
512 call mpi_recv(varia,nvar,mpi_double_precision,
513 * man,idreal,CG_COMM,muster,ierr)
515 * mpi_double_precision,man,idreal,
516 * CG_COMM,muster,ierr)
517 call mpi_recv(ene0,1,
518 * mpi_double_precision,man,idreal,
519 * CG_COMM,muster,ierr)
520 c print *,'result received from worker ',man,' sending now'
522 call var_to_geom(nvar,varia)
524 call etotal(energy(0))
528 write (iout,*) 'Conformation #',iconf," sumsl return code ",
532 call enerprint(energy(0))
533 call briefout(it,etot)
534 c if (minim) call briefout(it,etot)
536 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
537 write (istat,'(i5,30(f12.3))') iconf,
538 & (energy(print_order(i)),i=1,nprint_ene),etot,
539 & rms,frac,frac_nn,co
541 write (istat,'(i5,30(f12.3))') iconf,
542 & (energy(print_order(i)),i=1,nprint_ene),etot
547 read (intin,'(e15.10,e15.5)',end=11,err=11) time,ene
548 call read_x(intin,*11)
550 c Broadcast the order to compute internal coordinates to the slaves.
552 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
554 call int_from_cart1(.false.)
556 read (intin,'(i5)',end=11,err=11) iconf
557 call read_angles(intin,*11)
558 call geom_to_var(nvar,varia)
562 write (iout,*) 'Conformation #',iconf,' read'
570 call mpi_send(ind,6,mpi_integer,man,idint,CG_COMM,
572 call mpi_send(varia,nvar,mpi_double_precision,man,
573 * idreal,CG_COMM,ierr)
574 call mpi_send(ene0,1,mpi_double_precision,man,
575 * idreal,CG_COMM,ierr)
576 nf_mcmf=nf_mcmf+ind(4)
582 call mpi_recv(ind,6,mpi_integer,mpi_any_source,idint,
583 * CG_COMM,muster,ierr)
584 man=muster(mpi_source)
585 call mpi_recv(varia,nvar,mpi_double_precision,
586 * man,idreal,CG_COMM,muster,ierr)
588 * mpi_double_precision,man,idreal,
589 * CG_COMM,muster,ierr)
590 call mpi_recv(ene0,1,
591 * mpi_double_precision,man,idreal,
592 * CG_COMM,muster,ierr)
594 call var_to_geom(nvar,varia)
596 call etotal(energy(0))
600 write (iout,*) 'Conformation #',iconf," sumsl return code ",
604 call enerprint(energy(0))
605 call briefout(it,etot)
607 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
608 write (istat,'(i5,30(f12.3))') iconf,
609 & (energy(print_order(i)),i=1,nprint_ene),etot,
610 & rms,frac,frac_nn,co
612 write (istat,'(i5,30(f12.3))') iconf,
613 & (energy(print_order(i)),i=1,nprint_ene),etot
625 call mpi_send(ind,6,mpi_integer,i,idint,CG_COMM,
630 open(intin,file=intinname,status='old')
631 write (istat,'(a5,20a12)')"# ",
632 & (wname(print_order(i)),i=1,nprint_ene)
633 write (istat,'("# ",20(1pe12.4))')
634 & (weights(print_order(i)),i=1,nprint_ene)
636 write (istat,'(a5,20a12)')"# ",
637 & (ename(print_order(i)),i=1,nprint_ene),
638 & "ETOT total","RMSD","nat.contact","nnt.contact"
640 write (istat,'(a5,14a12)')"# ",
641 & (ename(print_order(i)),i=1,nprint_ene),"ETOT total"
645 read (intin,'(e15.10,e15.5)',end=1100,err=1100) time,ene
646 call read_x(intin,*11)
648 c Broadcast the order to compute internal coordinates to the slaves.
650 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
652 call int_from_cart1(.false.)
654 read (intin,'(i5)',end=1100,err=1100) iconf
655 call read_angles(intin,*11)
656 call geom_to_var(nvar,varia)
659 write (iout,'(a,i7)') 'Conformation #',iconf
660 if (minim) call minimize(etot,varia,iretcode,nfun)
661 call etotal(energy(0))
664 call enerprint(energy(0))
665 if (minim) call briefout(it,etot)
667 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
668 write (istat,'(i5,18(f12.3))') iconf,
669 & (energy(print_order(i)),i=1,nprint_ene),
670 & etot,rms,frac,frac_nn,co
673 write (istat,'(i5,14(f12.3))') iconf,
674 & (energy(print_order(i)),i=1,nprint_ene),etot
682 c---------------------------------------------------------------------------
683 subroutine exec_checkgrad
684 implicit real*8 (a-h,o-z)
689 include 'COMMON.SETUP'
690 include 'COMMON.TIME1'
691 include 'COMMON.INTERACT'
692 include 'COMMON.NAMES'
694 include 'COMMON.HEADER'
695 include 'COMMON.CONTROL'
696 include 'COMMON.CONTACTS'
697 include 'COMMON.CHAIN'
699 include 'COMMON.IOUNITS'
700 include 'COMMON.FFIELD'
701 include 'COMMON.REMD'
703 include 'COMMON.SBRIDGE'
705 double precision energy(0:max_ene)
707 c vbld(i)=vbld(i)+ran_number(-0.1d0,0.1d0)
708 c if (itype(i).ne.10)
709 c & vbld(i+nres)=vbld(i+nres)+ran_number(-0.001d0,0.001d0)
711 if (indpdb.eq.0) call chainbuild
714 c dc(j,i)=dc(j,i)+ran_number(-0.2d0,0.2d0)
718 c if (itype(i).ne.10) then
720 c dc(j,i+nres)=dc(j,i+nres)+ran_number(-0.2d0,0.2d0)
725 c dc(j,0)=ran_number(-0.2d0,0.2d0)
732 call rescale_weights(t_bath)
737 call etotal(energy(0))
739 call enerprint(energy(0))
740 write (iout,*) "Uconst",Uconst," Uconst_back",uconst_back
741 print *,'icheckgrad=',icheckgrad
742 goto (10,20,30) icheckgrad
743 10 call check_ecartint
745 20 call check_cartgrad
750 c---------------------------------------------------------------------------
757 c---------------------------------------------------------------------------
763 include 'COMMON.IOUNITS'
764 C Conformational Space Annealling programmed by Jooyoung Lee.
765 C This method works only with parallel machines!
768 write (iout,*) "CSA is not supported in this version"
770 csa write (iout,*) "CSA works on parallel machines only"
771 write (iout,*) "CSA is not supported in this version"
775 c---------------------------------------------------------------------------
776 subroutine exec_softreg
777 implicit real*8 (a-h,o-z)
779 include 'COMMON.IOUNITS'
780 include 'COMMON.CONTROL'
781 double precision energy(0:max_ene)
782 logical debug /.false./
784 call etotal(energy(0))
785 call enerprint(energy(0))
786 if (.not.lsecondary) then
787 write(iout,*) 'Calling secondary structure recognition'
788 call secondary2(debug)
790 write(iout,*) 'Using secondary structure supplied in pdb'
795 call etotal(energy(0))
797 call enerprint(energy(0))
799 call briefout(0,etot)
800 call secondary2(.true.)
801 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)