1 subroutine etotal_long(energia)
2 implicit real*8 (a-h,o-z)
5 c Compute the long-range slow-varying contributions to the energy
10 cMS$ATTRIBUTES C :: proc_proc
15 double precision weights_(n_ene)
17 include 'COMMON.SETUP'
18 include 'COMMON.IOUNITS'
19 double precision energia(0:n_ene)
20 include 'COMMON.FFIELD'
21 include 'COMMON.DERIV'
22 include 'COMMON.INTERACT'
23 include 'COMMON.SBRIDGE'
24 include 'COMMON.CHAIN'
26 include 'COMMON.LOCAL'
28 c write(iout,'(a,i2)')'Calling etotal_long ipot=',ipot
29 if (modecalc.eq.12.or.modecalc.eq.14) then
31 c if (fg_rank.eq.0) call int_from_cart1(.false.)
33 call int_from_cart1(.false.)
37 c write(iout,*) "ETOTAL_LONG Processor",fg_rank,
38 c & " absolute rank",myrank," nfgtasks",nfgtasks
40 if (nfgtasks.gt.1) then
42 C FG slaves call the following matching MPI_Bcast in ERGASTULUM
43 if (fg_rank.eq.0) then
44 call MPI_Bcast(3,1,MPI_INTEGER,king,FG_COMM,IERROR)
45 c write (iout,*) "Processor",myrank," BROADCAST iorder"
47 C FG master sets up the WEIGHTS_ array which will be broadcast to the
48 C FG slaves as WEIGHTS array.
68 C FG Master broadcasts the WEIGHTS_ array
69 call MPI_Bcast(weights_(1),n_ene,
70 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
72 C FG slaves receive the WEIGHTS array
73 call MPI_Bcast(weights(1),n_ene,
74 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
95 call MPI_Bcast(dc(1,1),6*nres,MPI_DOUBLE_PRECISION,
97 time_Bcast=time_Bcast+MPI_Wtime()-time00
98 time_Bcastw=time_Bcastw+MPI_Wtime()-time00
99 c call chainbuild_cart
100 c call int_from_cart1(.false.)
102 c write (iout,*) 'Processor',myrank,
103 c & ' calling etotal_short ipot=',ipot
105 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
107 cd print *,'nnt=',nnt,' nct=',nct
109 C Compute the side-chain and electrostatic interaction energy
111 goto (101,102,103,104,105,106) ipot
112 C Lennard-Jones potential.
113 101 call elj_long(evdw)
114 cd print '(a)','Exit ELJ'
116 C Lennard-Jones-Kihara potential (shifted).
117 102 call eljk_long(evdw)
119 C Berne-Pechukas potential (dilated LJ, angular dependence).
120 103 call ebp_long(evdw)
122 C Gay-Berne potential (shifted LJ, angular dependence).
123 104 call egb_long(evdw,evdw_p,evdw_m)
125 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
126 105 call egbv_long(evdw)
128 C Soft-sphere potential
129 106 call e_softsphere(evdw)
131 C Calculate electrostatic (H-bonding) energy of the main chain.
137 if (welec.gt.0d0.or.wvdwpp.gt.0d0.or.wel_loc.gt.0d0.or.
138 & wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
139 & .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
140 & .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
142 if (welec.gt.0d0.or.wel_loc.gt.0d0.or.
143 & wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
144 & .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
145 & .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
147 call eelec_scale(ees,evdw1,eel_loc,eello_turn3,eello_turn4)
156 c write (iout,*) "Soft-spheer ELEC potential"
157 call eelec_soft_sphere(ees,evdw1,eel_loc,eello_turn3,
161 C Calculate excluded-volume interaction energy between peptide groups
166 call escp_long(evdw2,evdw2_14)
172 call escp_soft_sphere(evdw2,evdw2_14)
175 C 12/1/95 Multi-body terms
179 if ((wcorr4.gt.0.0d0 .or. wcorr5.gt.0.0d0 .or. wcorr6.gt.0.0d0
180 & .or. wturn6.gt.0.0d0) .and. ipot.lt.6) then
181 call multibody_eello(ecorr,ecorr5,ecorr6,eturn6,n_corr,n_corr1)
182 c write (2,*) 'n_corr=',n_corr,' n_corr1=',n_corr1,
183 c &" ecorr",ecorr," ecorr5",ecorr5," ecorr6",ecorr6," eturn6",eturn6
190 if ((wcorr4.eq.0.0d0 .and. wcorr.gt.0.0d0) .and. ipot.lt.6) then
191 call multibody_hb(ecorr,ecorr5,ecorr6,n_corr,n_corr1)
194 C If performing constraint dynamics, call the constraint energy
195 C after the equilibration time
196 if(usampl.and.totT.gt.eq_time) then
211 energia(2)=evdw2-evdw2_14
228 energia(8)=eello_turn3
229 energia(9)=eello_turn4
231 energia(20)=Uconst+Uconst_back
234 call sum_energy(energia,.true.)
235 c write (iout,*) "Exit ETOTAL_LONG"
239 c------------------------------------------------------------------------------
240 subroutine etotal_short(energia)
241 implicit real*8 (a-h,o-z)
244 c Compute the short-range fast-varying contributions to the energy
249 cMS$ATTRIBUTES C :: proc_proc
254 double precision weights_(n_ene)
256 include 'COMMON.SETUP'
257 include 'COMMON.IOUNITS'
258 double precision energia(0:n_ene)
259 include 'COMMON.FFIELD'
260 include 'COMMON.DERIV'
261 include 'COMMON.INTERACT'
262 include 'COMMON.SBRIDGE'
263 include 'COMMON.CHAIN'
265 include 'COMMON.LOCAL'
267 c write(iout,'(a,i2)')'Calling etotal_short ipot=',ipot
269 if (modecalc.eq.12.or.modecalc.eq.14) then
271 if (fg_rank.eq.0) call int_from_cart1(.false.)
273 call int_from_cart1(.false.)
277 c write(iout,*) "ETOTAL_SHORT Processor",fg_rank,
278 c & " absolute rank",myrank," nfgtasks",nfgtasks
280 if (nfgtasks.gt.1) then
282 C FG slaves call the following matching MPI_Bcast in ERGASTULUM
283 if (fg_rank.eq.0) then
284 call MPI_Bcast(2,1,MPI_INTEGER,king,FG_COMM,IERROR)
285 c write (iout,*) "Processor",myrank," BROADCAST iorder"
287 C FG master sets up the WEIGHTS_ array which will be broadcast to the
288 C FG slaves as WEIGHTS array.
308 C FG Master broadcasts the WEIGHTS_ array
309 call MPI_Bcast(weights_(1),n_ene,
310 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
312 C FG slaves receive the WEIGHTS array
313 call MPI_Bcast(weights(1),n_ene,
314 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
335 c write (iout,*),"Processor",myrank," BROADCAST weights"
336 call MPI_Bcast(c(1,1),maxres6,MPI_DOUBLE_PRECISION,
338 c write (iout,*) "Processor",myrank," BROADCAST c"
339 call MPI_Bcast(dc(1,1),maxres6,MPI_DOUBLE_PRECISION,
341 c write (iout,*) "Processor",myrank," BROADCAST dc"
342 call MPI_Bcast(dc_norm(1,1),maxres6,MPI_DOUBLE_PRECISION,
344 c write (iout,*) "Processor",myrank," BROADCAST dc_norm"
345 call MPI_Bcast(theta(1),nres,MPI_DOUBLE_PRECISION,
347 c write (iout,*) "Processor",myrank," BROADCAST theta"
348 call MPI_Bcast(phi(1),nres,MPI_DOUBLE_PRECISION,
350 c write (iout,*) "Processor",myrank," BROADCAST phi"
351 call MPI_Bcast(alph(1),nres,MPI_DOUBLE_PRECISION,
353 c write (iout,*) "Processor",myrank," BROADCAST alph"
354 call MPI_Bcast(omeg(1),nres,MPI_DOUBLE_PRECISION,
356 c write (iout,*) "Processor",myrank," BROADCAST omeg"
357 call MPI_Bcast(vbld(1),2*nres,MPI_DOUBLE_PRECISION,
359 c write (iout,*) "Processor",myrank," BROADCAST vbld"
360 call MPI_Bcast(vbld_inv(1),2*nres,MPI_DOUBLE_PRECISION,
362 time_Bcast=time_Bcast+MPI_Wtime()-time00
363 c write (iout,*) "Processor",myrank," BROADCAST vbld_inv"
365 c write (iout,*) 'Processor',myrank,
366 c & ' calling etotal_short ipot=',ipot
368 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
370 c call int_from_cart1(.false.)
372 C Compute the side-chain and electrostatic interaction energy
374 goto (101,102,103,104,105,106) ipot
375 C Lennard-Jones potential.
376 101 call elj_short(evdw)
377 cd print '(a)','Exit ELJ'
379 C Lennard-Jones-Kihara potential (shifted).
380 102 call eljk_short(evdw)
382 C Berne-Pechukas potential (dilated LJ, angular dependence).
383 103 call ebp_short(evdw)
385 C Gay-Berne potential (shifted LJ, angular dependence).
386 104 call egb_short(evdw,evdw_p,evdw_m)
388 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
389 105 call egbv_short(evdw)
391 C Soft-sphere potential - already dealt with in the long-range part
393 c 106 call e_softsphere_short(evdw)
395 C Calculate electrostatic (H-bonding) energy of the main chain.
399 c Calculate the short-range part of Evdwpp
401 call evdwpp_short(evdw1)
403 c Calculate the short-range part of ESCp
406 call escp_short(evdw2,evdw2_14)
409 c Calculate the bond-stretching energy
413 C Calculate the disulfide-bridge and other energy and the contributions
414 C from other distance constraints.
417 C Calculate the virtual-bond-angle energy.
421 C Calculate the SC local energy.
426 C Calculate the virtual-bond torsional energy.
428 call etor(etors,edihcnstr)
430 C 6/23/01 Calculate double-torsional energy
434 C 21/5/07 Calculate local sicdechain correlation energy
436 if (wsccor.gt.0.0d0) then
437 call eback_sc_corr(esccor)
442 C Put energy components into an array
449 energia(2)=evdw2-evdw2_14
466 energia(19)=edihcnstr
470 c write (iout,*) "ETOTAL_SHORT before SUM_ENERGY"
472 call sum_energy(energia,.true.)
473 c write (iout,*) "Exit ETOTAL_SHORT"