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
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
147 include 'COMMON.SETUP'
148 include 'COMMON.CONTROL'
149 include 'COMMON.IOUNITS'
150 include 'COMMON.REMD'
151 if (me.eq.king .or. .not. out1file)
152 & write (iout,*) "Calling chainbuild"
154 if (me.eq.king .or. .not. out1file)
155 & write (iout,*) "Calling REMD"
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 if (indpdb.eq.0) call chainbuild
195 print *,"Processor",myrank," after chainbuild"
197 call etotal_long(energy_long(0))
198 write (iout,*) "Printing long range energy"
199 call enerprint(energy_long(0))
200 call etotal_short(energy_short(0))
201 write (iout,*) "Printing short range energy"
202 call enerprint(energy_short(0))
204 energy(i)=energy_long(i)+energy_short(i)
205 write (iout,*) i,energy_long(i),energy_short(i),energy(i)
207 write (iout,*) "Printing long+short range energy"
208 call enerprint(energy(0))
210 call etotal(energy(0))
211 time_ene=MPI_Wtime()-time00
212 write (iout,*) "Time for energy evaluation",time_ene
213 print *,"after etotal"
216 call enerprint(energy(0))
217 call hairpin(.true.,nharp,iharp)
218 call secondary2(.true.)
222 print *, 'Calling OVERLAP_SC'
223 call overlap_sc(fail)
227 call sc_move(2,nres-1,10,1d10,nft_sc,etot)
228 print *,'SC_move',nft_sc,etot
229 write(iout,*) 'SC_move',nft_sc,etot
233 print *, 'Calling MINIM_DC'
235 call minim_dc(etot,iretcode,nfun)
237 if (indpdb.ne.0) then
241 call geom_to_var(nvar,varia)
242 print *,'Calling MINIMIZE.'
244 call minimize(etot,varia,iretcode,nfun)
246 print *,'SUMSL return code is',iretcode,' eval ',nfun
247 evals=nfun/(MPI_WTIME()-time1)
248 print *,'# eval/s',evals
249 print *,'refstr=',refstr
250 call hairpin(.true.,nharp,iharp)
251 call secondary2(.true.)
252 call etotal(energy(0))
254 call enerprint(energy(0))
257 call briefout(0,etot)
258 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
259 write (iout,'(a,i3)') 'SUMSL return code:',iretcode
260 write (iout,'(a,i20)') '# of energy evaluations:',nfun+1
261 write (iout,'(a,f16.3)')'# of energy evaluations/sec:',evals
263 print *,'refstr=',refstr
264 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
265 call briefout(0,etot)
267 if (outpdb) call pdbout(etot,titel(:32),ipdb)
268 if (outmol2) call mol2out(etot,titel(:32))
271 c---------------------------------------------------------------------------
272 subroutine exec_regularize
273 implicit real*8 (a-h,o-z)
278 include 'COMMON.SETUP'
279 include 'COMMON.TIME1'
280 include 'COMMON.INTERACT'
281 include 'COMMON.NAMES'
283 include 'COMMON.HEADER'
284 include 'COMMON.CONTROL'
285 include 'COMMON.CONTACTS'
286 include 'COMMON.CHAIN'
288 include 'COMMON.IOUNITS'
289 include 'COMMON.FFIELD'
290 include 'COMMON.REMD'
292 include 'COMMON.SBRIDGE'
293 double precision energy(0:n_ene)
298 call regularize(nct-nnt+1,etot,rms,cref(1,nnt,1),iretcode)
299 call etotal(energy(0))
300 energy(0)=energy(0)-energy(14)
302 call enerprint(energy(0))
304 call briefout(0,etot)
305 if (outpdb) call pdbout(etot,titel(:32),ipdb)
306 if (outmol2) call mol2out(etot,titel(:32))
307 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
308 write (iout,'(a,i3)') 'SUMSL return code:',iretcode
311 c---------------------------------------------------------------------------
312 subroutine exec_thread
317 include "COMMON.SETUP"
321 c---------------------------------------------------------------------------
323 implicit real*8 (a-h,o-z)
325 character*10 nodeinfo
326 double precision varia(maxvar)
330 include "COMMON.SETUP"
331 include 'COMMON.CONTROL'
335 if (modecalc.eq.3) then
341 if (modecalc.eq.3) then
352 c---------------------------------------------------------------------------
353 subroutine exec_mult_eeval_or_minim
354 implicit real*8 (a-h,o-z)
358 dimension muster(mpi_status_size)
360 include 'COMMON.SETUP'
361 include 'COMMON.TIME1'
362 include 'COMMON.INTERACT'
363 include 'COMMON.NAMES'
365 include 'COMMON.HEADER'
366 include 'COMMON.CONTROL'
367 include 'COMMON.CONTACTS'
368 include 'COMMON.CHAIN'
370 include 'COMMON.IOUNITS'
371 include 'COMMON.FFIELD'
372 include 'COMMON.REMD'
374 include 'COMMON.SBRIDGE'
375 double precision varia(maxvar)
377 double precision energy(0:max_ene)
387 open(intin,file=intinname,status='old')
388 write (istat,'(a5,20a12)')"# ",
389 & (wname(print_order(i)),i=1,nprint_ene)
391 write (istat,'(a5,20a12)')"# ",
392 & (ename(print_order(i)),i=1,nprint_ene),
393 & "ETOT total","RMSD","nat.contact","nnt.contact"
395 write (istat,'(a5,20a12)')"# ",
396 & (ename(print_order(i)),i=1,nprint_ene),"ETOT total"
402 read (intin,'(e15.10,e15.5)',end=1100,err=1100) time,ene
403 call read_x(intin,*11)
405 c Broadcast the order to compute internal coordinates to the slaves.
407 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
409 call int_from_cart1(.false.)
411 read (intin,'(i5)',end=1100,err=1100) iconf
412 call read_angles(intin,*11)
413 call geom_to_var(nvar,varia)
416 write (iout,'(a,i7)') 'Conformation #',iconf
417 call etotal(energy(0))
418 call briefout(iconf,energy(0))
419 call enerprint(energy(0))
422 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
423 write (istat,'(i5,20(f12.3))') iconf,
424 & (energy(print_order(i)),i=1,nprint_ene),etot,
425 & rms,frac,frac_nn,co
428 write (istat,'(i5,16(f12.3))') iconf,
429 & (energy(print_order(i)),i=1,nprint_ene),etot
445 if (mm.lt.nodes) then
447 read (intin,'(e15.10,e15.5)',end=11,err=11) time,ene
448 call read_x(intin,*11)
450 c Broadcast the order to compute internal coordinates to the slaves.
452 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
454 call int_from_cart1(.false.)
456 read (intin,'(i5)',end=11,err=11) iconf
457 call read_angles(intin,*11)
458 call geom_to_var(nvar,varia)
461 write (iout,'(a,i7)') 'Conformation #',iconf
471 call mpi_send(ind,6,mpi_integer,mm,idint,CG_COMM,
473 call mpi_send(varia,nvar,mpi_double_precision,mm,
474 * idreal,CG_COMM,ierr)
475 call mpi_send(ene0,1,mpi_double_precision,mm,
476 * idreal,CG_COMM,ierr)
477 c print *,'task ',n,' sent to worker ',mm,nvar
479 call mpi_recv(ind,6,mpi_integer,mpi_any_source,idint,
480 * CG_COMM,muster,ierr)
481 man=muster(mpi_source)
482 c print *,'receiving result from worker ',man,' (',iii1,iii,')'
483 call mpi_recv(varia,nvar,mpi_double_precision,
484 * man,idreal,CG_COMM,muster,ierr)
486 * mpi_double_precision,man,idreal,
487 * CG_COMM,muster,ierr)
488 call mpi_recv(ene0,1,
489 * mpi_double_precision,man,idreal,
490 * CG_COMM,muster,ierr)
491 c print *,'result received from worker ',man,' sending now'
493 call var_to_geom(nvar,varia)
495 call etotal(energy(0))
499 write (iout,'(a,2i7)') 'Conformation #',iconf,ind(5)
502 call enerprint(energy(0))
503 call briefout(it,etot)
504 c if (minim) call briefout(it,etot)
506 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
507 write (istat,'(i5,19(f12.3))') iconf,
508 & (energy(print_order(i)),i=1,nprint_ene),etot,
509 & rms,frac,frac_nn,co
511 write (istat,'(i5,15(f12.3))') iconf,
512 & (energy(print_order(i)),i=1,nprint_ene),etot
517 read (intin,'(e15.10,e15.5)',end=1101,err=1101) time,ene
518 call read_x(intin,*11)
520 c Broadcast the order to compute internal coordinates to the slaves.
522 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
524 call int_from_cart1(.false.)
526 read (intin,'(i5)',end=1101,err=1101) iconf
527 call read_angles(intin,*11)
528 call geom_to_var(nvar,varia)
539 call mpi_send(ind,6,mpi_integer,man,idint,CG_COMM,
541 call mpi_send(varia,nvar,mpi_double_precision,man,
542 * idreal,CG_COMM,ierr)
543 call mpi_send(ene0,1,mpi_double_precision,man,
544 * idreal,CG_COMM,ierr)
545 nf_mcmf=nf_mcmf+ind(4)
551 call mpi_recv(ind,6,mpi_integer,mpi_any_source,idint,
552 * CG_COMM,muster,ierr)
553 man=muster(mpi_source)
554 call mpi_recv(varia,nvar,mpi_double_precision,
555 * man,idreal,CG_COMM,muster,ierr)
557 * mpi_double_precision,man,idreal,
558 * CG_COMM,muster,ierr)
559 call mpi_recv(ene0,1,
560 * mpi_double_precision,man,idreal,
561 * CG_COMM,muster,ierr)
563 call var_to_geom(nvar,varia)
565 call etotal(energy(0))
569 write (iout,'(a,2i7)') 'Conformation #',iconf,ind(5)
572 call enerprint(energy(0))
573 call briefout(it,etot)
575 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
576 write (istat,'(i5,19(f12.3))') iconf,
577 & (energy(print_order(i)),i=1,nprint_ene),etot,
578 & rms,frac,frac_nn,co
580 write (istat,'(i5,15(f12.3))') iconf,
581 & (energy(print_order(i)),i=1,nprint_ene),etot
593 call mpi_send(ind,6,mpi_integer,i,idint,CG_COMM,
598 open(intin,file=intinname,status='old')
599 write (istat,'(a5,20a12)')"# ",
600 & (wname(print_order(i)),i=1,nprint_ene)
601 write (istat,'("# ",20(1pe12.4))')
602 & (weights(print_order(i)),i=1,nprint_ene)
604 write (istat,'(a5,20a12)')"# ",
605 & (ename(print_order(i)),i=1,nprint_ene),
606 & "ETOT total","RMSD","nat.contact","nnt.contact"
608 write (istat,'(a5,14a12)')"# ",
609 & (ename(print_order(i)),i=1,nprint_ene),"ETOT total"
613 read (intin,'(e15.10,e15.5)',end=1100,err=1100) time,ene
614 call read_x(intin,*11)
616 c Broadcast the order to compute internal coordinates to the slaves.
618 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
620 call int_from_cart1(.false.)
622 read (intin,'(i5)',end=1100,err=1100) iconf
623 call read_angles(intin,*11)
624 call geom_to_var(nvar,varia)
627 write (iout,'(a,i7)') 'Conformation #',iconf
628 if (minim) call minimize(etot,varia,iretcode,nfun)
629 call etotal(energy(0))
632 call enerprint(energy(0))
633 if (minim) call briefout(it,etot)
635 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
636 write (istat,'(i5,18(f12.3))') iconf,
637 & (energy(print_order(i)),i=1,nprint_ene),
638 & etot,rms,frac,frac_nn,co
641 write (istat,'(i5,14(f12.3))') iconf,
642 & (energy(print_order(i)),i=1,nprint_ene),etot
649 c---------------------------------------------------------------------------
650 subroutine exec_checkgrad
651 implicit real*8 (a-h,o-z)
656 include 'COMMON.SETUP'
657 include 'COMMON.TIME1'
658 include 'COMMON.INTERACT'
659 include 'COMMON.NAMES'
661 include 'COMMON.HEADER'
662 include 'COMMON.CONTROL'
663 include 'COMMON.CONTACTS'
664 include 'COMMON.CHAIN'
666 include 'COMMON.IOUNITS'
667 include 'COMMON.FFIELD'
668 include 'COMMON.REMD'
670 include 'COMMON.SBRIDGE'
672 double precision energy(0:max_ene)
674 c vbld(i)=vbld(i)+ran_number(-0.1d0,0.1d0)
675 c if (itype(i).ne.10)
676 c & vbld(i+nres)=vbld(i+nres)+ran_number(-0.001d0,0.001d0)
678 if (indpdb.eq.0) call chainbuild
681 c dc(j,i)=dc(j,i)+ran_number(-0.2d0,0.2d0)
685 c if (itype(i).ne.10) then
687 c dc(j,i+nres)=dc(j,i+nres)+ran_number(-0.2d0,0.2d0)
692 c dc(j,0)=ran_number(-0.2d0,0.2d0)
702 call etotal(energy(0))
704 call enerprint(energy(0))
705 write (iout,*) "Uconst",Uconst," Uconst_back",uconst_back
706 print *,'icheckgrad=',icheckgrad
707 goto (10,20,30) icheckgrad
708 10 call check_ecartint
710 20 call check_cartgrad
715 c---------------------------------------------------------------------------
722 c---------------------------------------------------------------------------
728 include 'COMMON.IOUNITS'
729 C Conformational Space Annealling programmed by Jooyoung Lee.
730 C This method works only with parallel machines!
734 write (iout,*) "CSA works on parallel machines only"
738 c---------------------------------------------------------------------------
739 subroutine exec_softreg
741 include 'COMMON.IOUNITS'
742 include 'COMMON.CONTROL'
743 double precision energy(0:max_ene)
745 call etotal(energy(0))
746 call enerprint(energy(0))
747 if (.not.lsecondary) then
748 write(iout,*) 'Calling secondary structure recognition'
749 call secondary2(debug)
751 write(iout,*) 'Using secondary structure supplied in pdb'
756 call etotal(energy(0))
758 call enerprint(energy(0))
760 call briefout(0,etot)
761 call secondary2(.true.)
762 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)