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 double precision varia(maxvar)
192 if (indpdb.eq.0) call chainbuild
196 print *,"Processor",myrank," after chainbuild"
198 call etotal_long(energy_long(0))
199 write (iout,*) "Printing long range energy"
200 call enerprint(energy_long(0))
201 call etotal_short(energy_short(0))
202 write (iout,*) "Printing short range energy"
203 call enerprint(energy_short(0))
205 energy(i)=energy_long(i)+energy_short(i)
206 write (iout,*) i,energy_long(i),energy_short(i),energy(i)
208 write (iout,*) "Printing long+short range energy"
209 call enerprint(energy(0))
211 call etotal(energy(0))
212 time_ene=MPI_Wtime()-time00
213 write (iout,*) "Time for energy evaluation",time_ene
214 print *,"after etotal"
217 call enerprint(energy(0))
218 call hairpin(.true.,nharp,iharp)
219 call secondary2(.true.)
223 print *, 'Calling OVERLAP_SC'
224 call overlap_sc(fail)
228 call sc_move(2,nres-1,10,1d10,nft_sc,etot)
229 print *,'SC_move',nft_sc,etot
230 write(iout,*) 'SC_move',nft_sc,etot
234 print *, 'Calling MINIM_DC'
236 call minim_dc(etot,iretcode,nfun)
238 if (indpdb.ne.0) then
242 call geom_to_var(nvar,varia)
243 print *,'Calling MINIMIZE.'
245 call minimize(etot,varia,iretcode,nfun)
247 print *,'SUMSL return code is',iretcode,' eval ',nfun
248 evals=nfun/(MPI_WTIME()-time1)
249 print *,'# eval/s',evals
250 print *,'refstr=',refstr
251 call hairpin(.true.,nharp,iharp)
252 call secondary2(.true.)
253 call etotal(energy(0))
255 call enerprint(energy(0))
258 call briefout(0,etot)
259 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
260 write (iout,'(a,i3)') 'SUMSL return code:',iretcode
261 write (iout,'(a,i20)') '# of energy evaluations:',nfun+1
262 write (iout,'(a,f16.3)')'# of energy evaluations/sec:',evals
264 print *,'refstr=',refstr
265 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
266 call briefout(0,etot)
268 if (outpdb) call pdbout(etot,titel(:32),ipdb)
269 if (outmol2) call mol2out(etot,titel(:32))
272 c---------------------------------------------------------------------------
273 subroutine exec_regularize
274 implicit real*8 (a-h,o-z)
279 include 'COMMON.SETUP'
280 include 'COMMON.TIME1'
281 include 'COMMON.INTERACT'
282 include 'COMMON.NAMES'
284 include 'COMMON.HEADER'
285 include 'COMMON.CONTROL'
286 include 'COMMON.CONTACTS'
287 include 'COMMON.CHAIN'
289 include 'COMMON.IOUNITS'
290 include 'COMMON.FFIELD'
291 include 'COMMON.REMD'
293 include 'COMMON.SBRIDGE'
294 double precision energy(0:n_ene)
299 call regularize(nct-nnt+1,etot,rms,cref(1,nnt,1),iretcode)
300 call etotal(energy(0))
301 energy(0)=energy(0)-energy(14)
303 call enerprint(energy(0))
305 call briefout(0,etot)
306 if (outpdb) call pdbout(etot,titel(:32),ipdb)
307 if (outmol2) call mol2out(etot,titel(:32))
308 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
309 write (iout,'(a,i3)') 'SUMSL return code:',iretcode
312 c---------------------------------------------------------------------------
313 subroutine exec_thread
318 include "COMMON.SETUP"
322 c---------------------------------------------------------------------------
324 implicit real*8 (a-h,o-z)
326 character*10 nodeinfo
327 double precision varia(maxvar)
331 include "COMMON.SETUP"
332 include 'COMMON.CONTROL'
336 if (modecalc.eq.3) then
342 if (modecalc.eq.3) then
353 c---------------------------------------------------------------------------
354 subroutine exec_mult_eeval_or_minim
355 implicit real*8 (a-h,o-z)
359 dimension muster(mpi_status_size)
361 include 'COMMON.SETUP'
362 include 'COMMON.TIME1'
363 include 'COMMON.INTERACT'
364 include 'COMMON.NAMES'
366 include 'COMMON.HEADER'
367 include 'COMMON.CONTROL'
368 include 'COMMON.CONTACTS'
369 include 'COMMON.CHAIN'
371 include 'COMMON.IOUNITS'
372 include 'COMMON.FFIELD'
373 include 'COMMON.REMD'
375 include 'COMMON.SBRIDGE'
376 double precision varia(maxvar)
378 double precision energy(0:max_ene)
388 open(intin,file=intinname,status='old')
389 write (istat,'(a5,20a12)')"# ",
390 & (wname(print_order(i)),i=1,nprint_ene)
392 write (istat,'(a5,20a12)')"# ",
393 & (ename(print_order(i)),i=1,nprint_ene),
394 & "ETOT total","RMSD","nat.contact","nnt.contact"
396 write (istat,'(a5,20a12)')"# ",
397 & (ename(print_order(i)),i=1,nprint_ene),"ETOT total"
403 read (intin,'(e15.10,e15.5)',end=1100,err=1100) time,ene
404 call read_x(intin,*11)
406 c Broadcast the order to compute internal coordinates to the slaves.
408 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
410 call int_from_cart1(.false.)
412 read (intin,'(i5)',end=1100,err=1100) iconf
413 call read_angles(intin,*11)
414 call geom_to_var(nvar,varia)
417 write (iout,'(a,i7)') 'Conformation #',iconf
418 call etotal(energy(0))
419 call briefout(iconf,energy(0))
420 call enerprint(energy(0))
423 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
424 write (istat,'(i5,20(f12.3))') iconf,
425 & (energy(print_order(i)),i=1,nprint_ene),etot,
426 & rms,frac,frac_nn,co
429 write (istat,'(i5,16(f12.3))') iconf,
430 & (energy(print_order(i)),i=1,nprint_ene),etot
446 if (mm.lt.nodes) then
448 read (intin,'(e15.10,e15.5)',end=11,err=11) time,ene
449 call read_x(intin,*11)
451 c Broadcast the order to compute internal coordinates to the slaves.
453 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
455 call int_from_cart1(.false.)
457 read (intin,'(i5)',end=11,err=11) iconf
458 call read_angles(intin,*11)
459 call geom_to_var(nvar,varia)
462 write (iout,'(a,i7)') 'Conformation #',iconf
472 call mpi_send(ind,6,mpi_integer,mm,idint,CG_COMM,
474 call mpi_send(varia,nvar,mpi_double_precision,mm,
475 * idreal,CG_COMM,ierr)
476 call mpi_send(ene0,1,mpi_double_precision,mm,
477 * idreal,CG_COMM,ierr)
478 c print *,'task ',n,' sent to worker ',mm,nvar
480 call mpi_recv(ind,6,mpi_integer,mpi_any_source,idint,
481 * CG_COMM,muster,ierr)
482 man=muster(mpi_source)
483 c print *,'receiving result from worker ',man,' (',iii1,iii,')'
484 call mpi_recv(varia,nvar,mpi_double_precision,
485 * man,idreal,CG_COMM,muster,ierr)
487 * mpi_double_precision,man,idreal,
488 * CG_COMM,muster,ierr)
489 call mpi_recv(ene0,1,
490 * mpi_double_precision,man,idreal,
491 * CG_COMM,muster,ierr)
492 c print *,'result received from worker ',man,' sending now'
494 call var_to_geom(nvar,varia)
496 call etotal(energy(0))
500 write (iout,'(a,2i7)') 'Conformation #',iconf,ind(5)
503 call enerprint(energy(0))
504 call briefout(it,etot)
505 c if (minim) call briefout(it,etot)
507 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
508 write (istat,'(i5,19(f12.3))') iconf,
509 & (energy(print_order(i)),i=1,nprint_ene),etot,
510 & rms,frac,frac_nn,co
512 write (istat,'(i5,15(f12.3))') iconf,
513 & (energy(print_order(i)),i=1,nprint_ene),etot
518 read (intin,'(e15.10,e15.5)',end=1101,err=1101) time,ene
519 call read_x(intin,*11)
521 c Broadcast the order to compute internal coordinates to the slaves.
523 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
525 call int_from_cart1(.false.)
527 read (intin,'(i5)',end=1101,err=1101) iconf
528 call read_angles(intin,*11)
529 call geom_to_var(nvar,varia)
540 call mpi_send(ind,6,mpi_integer,man,idint,CG_COMM,
542 call mpi_send(varia,nvar,mpi_double_precision,man,
543 * idreal,CG_COMM,ierr)
544 call mpi_send(ene0,1,mpi_double_precision,man,
545 * idreal,CG_COMM,ierr)
546 nf_mcmf=nf_mcmf+ind(4)
552 call mpi_recv(ind,6,mpi_integer,mpi_any_source,idint,
553 * CG_COMM,muster,ierr)
554 man=muster(mpi_source)
555 call mpi_recv(varia,nvar,mpi_double_precision,
556 * man,idreal,CG_COMM,muster,ierr)
558 * mpi_double_precision,man,idreal,
559 * CG_COMM,muster,ierr)
560 call mpi_recv(ene0,1,
561 * mpi_double_precision,man,idreal,
562 * CG_COMM,muster,ierr)
564 call var_to_geom(nvar,varia)
566 call etotal(energy(0))
570 write (iout,'(a,2i7)') 'Conformation #',iconf,ind(5)
573 call enerprint(energy(0))
574 call briefout(it,etot)
576 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
577 write (istat,'(i5,19(f12.3))') iconf,
578 & (energy(print_order(i)),i=1,nprint_ene),etot,
579 & rms,frac,frac_nn,co
581 write (istat,'(i5,15(f12.3))') iconf,
582 & (energy(print_order(i)),i=1,nprint_ene),etot
594 call mpi_send(ind,6,mpi_integer,i,idint,CG_COMM,
599 open(intin,file=intinname,status='old')
600 write (istat,'(a5,20a12)')"# ",
601 & (wname(print_order(i)),i=1,nprint_ene)
602 write (istat,'("# ",20(1pe12.4))')
603 & (weights(print_order(i)),i=1,nprint_ene)
605 write (istat,'(a5,20a12)')"# ",
606 & (ename(print_order(i)),i=1,nprint_ene),
607 & "ETOT total","RMSD","nat.contact","nnt.contact"
609 write (istat,'(a5,14a12)')"# ",
610 & (ename(print_order(i)),i=1,nprint_ene),"ETOT total"
614 read (intin,'(e15.10,e15.5)',end=1100,err=1100) time,ene
615 call read_x(intin,*11)
617 c Broadcast the order to compute internal coordinates to the slaves.
619 & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR)
621 call int_from_cart1(.false.)
623 read (intin,'(i5)',end=1100,err=1100) iconf
624 call read_angles(intin,*11)
625 call geom_to_var(nvar,varia)
628 write (iout,'(a,i7)') 'Conformation #',iconf
629 if (minim) call minimize(etot,varia,iretcode,nfun)
630 call etotal(energy(0))
633 call enerprint(energy(0))
634 if (minim) call briefout(it,etot)
636 call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
637 write (istat,'(i5,18(f12.3))') iconf,
638 & (energy(print_order(i)),i=1,nprint_ene),
639 & etot,rms,frac,frac_nn,co
642 write (istat,'(i5,14(f12.3))') iconf,
643 & (energy(print_order(i)),i=1,nprint_ene),etot
650 c---------------------------------------------------------------------------
651 subroutine exec_checkgrad
652 implicit real*8 (a-h,o-z)
657 include 'COMMON.SETUP'
658 include 'COMMON.TIME1'
659 include 'COMMON.INTERACT'
660 include 'COMMON.NAMES'
662 include 'COMMON.HEADER'
663 include 'COMMON.CONTROL'
664 include 'COMMON.CONTACTS'
665 include 'COMMON.CHAIN'
667 include 'COMMON.IOUNITS'
668 include 'COMMON.FFIELD'
669 include 'COMMON.REMD'
671 include 'COMMON.SBRIDGE'
673 double precision energy(0:max_ene)
675 c vbld(i)=vbld(i)+ran_number(-0.1d0,0.1d0)
676 c if (itype(i).ne.10)
677 c & vbld(i+nres)=vbld(i+nres)+ran_number(-0.001d0,0.001d0)
679 if (indpdb.eq.0) call chainbuild
682 c dc(j,i)=dc(j,i)+ran_number(-0.2d0,0.2d0)
686 c if (itype(i).ne.10) then
688 c dc(j,i+nres)=dc(j,i+nres)+ran_number(-0.2d0,0.2d0)
693 c dc(j,0)=ran_number(-0.2d0,0.2d0)
703 call etotal(energy(0))
705 call enerprint(energy(0))
706 write (iout,*) "Uconst",Uconst," Uconst_back",uconst_back
707 print *,'icheckgrad=',icheckgrad
708 goto (10,20,30) icheckgrad
709 10 call check_ecartint
711 20 call check_cartgrad
716 c---------------------------------------------------------------------------
723 c---------------------------------------------------------------------------
729 include 'COMMON.IOUNITS'
730 C Conformational Space Annealling programmed by Jooyoung Lee.
731 C This method works only with parallel machines!
735 write (iout,*) "CSA works on parallel machines only"
739 c---------------------------------------------------------------------------
740 subroutine exec_softreg
742 include 'COMMON.IOUNITS'
743 include 'COMMON.CONTROL'
744 double precision energy(0:max_ene)
746 call etotal(energy(0))
747 call enerprint(energy(0))
748 if (.not.lsecondary) then
749 write(iout,*) 'Calling secondary structure recognition'
750 call secondary2(debug)
752 write(iout,*) 'Using secondary structure supplied in pdb'
757 call etotal(energy(0))
759 call enerprint(energy(0))
761 call briefout(0,etot)
762 call secondary2(.true.)
763 if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)