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 c if (modecalc.eq.-2) then
74 c else if (modecalc.eq.-1) then
75 c 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 c else if (modecalc.eq.1) then
88 c call exec_regularize
89 c else if (modecalc.eq.2) then
91 c else if (modecalc.eq.3 .or. modecalc .eq.6) then
93 c else if (modecalc.eq.4) then
94 c call exec_mult_eeval_or_minim
95 else if (modecalc.eq.5) then
97 c else if (ModeCalc.eq.7) then
99 c else if (ModeCalc.eq.8) then
101 c else if (modecalc.eq.11) then
103 c else if (modecalc.eq.12) then
105 c 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---------------------------------------------------------------------------
127 subroutine exec_eeval_or_minim
128 implicit real*8 (a-h,o-z)
133 include 'COMMON.SETUP'
134 include 'COMMON.TIME1'
135 include 'COMMON.INTERACT'
136 include 'COMMON.NAMES'
138 include 'COMMON.HEADER'
139 include 'COMMON.CONTROL'
140 include 'COMMON.CONTACTS'
141 include 'COMMON.CHAIN'
143 include 'COMMON.IOUNITS'
144 include 'COMMON.FFIELD'
145 c include 'COMMON.REMD'
146 c include 'COMMON.MD'
147 include 'COMMON.SBRIDGE'
149 double precision energy(0:n_ene)
150 double precision energy_long(0:n_ene),energy_short(0:n_ene)
151 if (indpdb.eq.0) call chainbuild
154 c if (split_ene) then
155 c print *,"Processor",myrank," after chainbuild"
157 c call etotal_long(energy_long(0))
158 c write (iout,*) "Printing long range energy"
159 c call enerprint(energy_long(0))
160 c call etotal_short(energy_short(0))
161 c write (iout,*) "Printing short range energy"
162 c call enerprint(energy_short(0))
164 c energy(i)=energy_long(i)+energy_short(i)
165 c write (iout,*) i,energy_long(i),energy_short(i),energy(i)
167 c write (iout,*) "Printing long+short range energy"
168 c call enerprint(energy(0))
170 call etotal(energy(0))
171 c time_ene=MPI_Wtime()-time00
172 write (iout,*) "Time for energy evaluation",time_ene
173 print *,"after etotal"
176 call enerprint(energy(0))
177 c call hairpin(.true.,nharp,iharp)
178 c call secondary2(.true.)
182 print *, 'Calling MINIM_DC'
184 call minim_dc(etot,iretcode,nfun)
186 if (indpdb.ne.0) then
190 call geom_to_var(nvar,varia)
191 print *,'Calling MINIMIZE.'
193 call minimize(etot,varia,iretcode,nfun)
195 print *,'SUMSL return code is',iretcode,' eval ',nfun
196 c evals=nfun/(MPI_WTIME()-time1)
197 print *,'# eval/s',evals
198 print *,'refstr=',refstr
199 c call hairpin(.true.,nharp,iharp)
200 c call secondary2(.true.)
201 call etotal(energy(0))
203 call enerprint(energy(0))
206 call briefout(0,etot)
207 c if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
208 write (iout,'(a,i3)') 'SUMSL return code:',iretcode
209 write (iout,'(a,i20)') '# of energy evaluations:',nfun+1
210 write (iout,'(a,f16.3)')'# of energy evaluations/sec:',evals
212 c print *,'refstr=',refstr
213 c if (refstr) call rms_nac_nnc(rms,frac,frac_nn,co,.true.)
214 c call briefout(0,etot)
216 if (outpdb) call pdbout(etot,titel(:32),ipdb)
217 if (outmol2) call mol2out(etot,titel(:32))
221 subroutine exec_checkgrad
222 implicit real*8 (a-h,o-z)
227 include 'COMMON.SETUP'
228 include 'COMMON.TIME1'
229 include 'COMMON.INTERACT'
230 include 'COMMON.NAMES'
232 include 'COMMON.HEADER'
233 include 'COMMON.CONTROL'
234 include 'COMMON.CONTACTS'
235 include 'COMMON.CHAIN'
237 include 'COMMON.IOUNITS'
238 include 'COMMON.FFIELD'
239 c include 'COMMON.REMD'
241 include 'COMMON.SBRIDGE'
243 double precision energy(0:max_ene)
245 c vbld(i)=vbld(i)+ran_number(-0.1d0,0.1d0)
246 c if (itype(i).ne.10)
247 c & vbld(i+nres)=vbld(i+nres)+ran_number(-0.001d0,0.001d0)
249 if (indpdb.eq.0) call chainbuild
252 c dc(j,i)=dc(j,i)+ran_number(-0.2d0,0.2d0)
256 c if (itype(i).ne.10) then
258 c dc(j,i+nres)=dc(j,i+nres)+ran_number(-0.2d0,0.2d0)
263 c dc(j,0)=ran_number(-0.2d0,0.2d0)
268 c call read_fragments
270 call rescale_weights(t_bath)
275 call etotal(energy(0))
277 call enerprint(energy(0))
278 write (iout,*) "Uconst",Uconst," Uconst_back",uconst_back
279 print *,'icheckgrad=',icheckgrad
280 goto (10,20,30) icheckgrad
281 10 call check_ecartint
283 20 call check_cartgrad