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'
28 c include 'COMMON.REMD'
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 11/03/09 1:19PM 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 (fg_rank.gt.0) then
72 C Fine-grain slaves just do energy and gradient components.
73 call ergastulum ! slave workhouse in Latin
76 if (modecalc.eq.0) then
77 call exec_eeval_or_minim
78 else if (modecalc.eq.5) then
81 write (iout,'(a)') 'This calculation type is not supported',
87 if (fg_rank.eq.0) call finish_task
88 c call memmon_print_usage()
90 call print_detailed_timing
92 call MPI_Finalize(ierr)
95 call dajczas(tcpu(),hrtime,mintime,sectime)
96 stop '********** Program terminated normally.'
99 c---------------------------------------------------------------------------
100 subroutine exec_eeval_or_minim
101 implicit real*8 (a-h,o-z)
106 include 'COMMON.SETUP'
107 include 'COMMON.TIME1'
108 include 'COMMON.INTERACT'
109 include 'COMMON.NAMES'
111 include 'COMMON.HEADER'
112 include 'COMMON.CONTROL'
113 include 'COMMON.CONTACTS'
114 include 'COMMON.CHAIN'
116 include 'COMMON.IOUNITS'
117 include 'COMMON.FFIELD'
118 include 'COMMON.SBRIDGE'
120 double precision energy(0:n_ene),varia(maxvar)
121 double precision energy_long(0:n_ene),energy_short(0:n_ene)
122 if (indpdb.eq.0) call chainbuild
129 call etotal(energy(0))
131 time_ene=MPI_Wtime()-time00
135 write (iout,*) "Time for energy evaluation",time_ene
136 print *,"after etotal"
139 call enerprint(energy(0))
140 c call hairpin(.true.,nharp,iharp)
141 c call secondary2(.true.)
145 print *, 'Calling MINIM_DC'
151 call minim_dc(etot,iretcode,nfun)
153 if (indpdb.ne.0) then
157 call geom_to_var(nvar,varia)
158 print *,'Calling MINIMIZE.'
164 call minimize(etot,varia,iretcode,nfun)
166 print *,'SUMSL return code is',iretcode,' eval ',nfun
168 evals=nfun/(MPI_WTIME()-time1)
170 evals=nfun/(tcpu()-time1)
172 print *,'# eval/s',evals
173 print *,'refstr=',refstr
174 c call hairpin(.true.,nharp,iharp)
175 c call secondary2(.true.)
176 call etotal(energy(0))
178 call enerprint(energy(0))
181 call briefout(0,etot)
182 c if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
183 write (iout,'(a,i3)') 'SUMSL return code:',iretcode
184 write (iout,'(a,i20)') '# of energy evaluations:',nfun+1
185 write (iout,'(a,f16.3)')'# of energy evaluations/sec:',evals
187 c print *,'refstr=',refstr
188 c if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
189 c call briefout(0,etot)
191 if (outpdb) call pdbout(etot,titel(:32),ipdb)
192 if (outmol2) call mol2out(etot,titel(:32))
196 subroutine exec_checkgrad
197 implicit real*8 (a-h,o-z)
202 include 'COMMON.SETUP'
203 include 'COMMON.TIME1'
204 include 'COMMON.INTERACT'
205 include 'COMMON.NAMES'
207 include 'COMMON.HEADER'
208 include 'COMMON.CONTROL'
209 include 'COMMON.CONTACTS'
210 include 'COMMON.CHAIN'
212 include 'COMMON.IOUNITS'
213 include 'COMMON.FFIELD'
214 c include 'COMMON.REMD'
216 include 'COMMON.SBRIDGE'
218 double precision energy(0:max_ene)
220 c vbld(i)=vbld(i)+ran_number(-0.1d0,0.1d0)
221 c if (itype(i).ne.10)
222 c & vbld(i+nres)=vbld(i+nres)+ran_number(-0.001d0,0.001d0)
224 if (indpdb.eq.0) call chainbuild
227 c dc(j,i)=dc(j,i)+ran_number(-0.2d0,0.2d0)
231 c if (itype(i).ne.10) then
233 c dc(j,i+nres)=dc(j,i+nres)+ran_number(-0.2d0,0.2d0)
238 c dc(j,0)=ran_number(-0.2d0,0.2d0)
243 c call read_fragments
248 call etotal(energy(0))
250 call enerprint(energy(0))
251 write (iout,*) "Uconst",Uconst," Uconst_back",uconst_back
252 print *,'icheckgrad=',icheckgrad
253 goto (10,20,30) icheckgrad
254 10 call check_ecartint
256 20 call check_cartgrad