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 include 'COMMON.CONTROL'
29 c write(iout,'(a,i2)')'Calling etotal_long ipot=',ipot
30 if (modecalc.eq.12.or.modecalc.eq.14) then
32 c if (fg_rank.eq.0) call int_from_cart1(.false.)
34 call int_from_cart1(.false.)
38 c write(iout,*) "ETOTAL_LONG Processor",fg_rank,
39 c & " absolute rank",myrank," nfgtasks",nfgtasks
41 if (nfgtasks.gt.1) then
43 C FG slaves call the following matching MPI_Bcast in ERGASTULUM
44 if (fg_rank.eq.0) then
45 call MPI_Bcast(3,1,MPI_INTEGER,king,FG_COMM,IERROR)
46 c write (iout,*) "Processor",myrank," BROADCAST iorder"
48 C FG master sets up the WEIGHTS_ array which will be broadcast to the
49 C FG slaves as WEIGHTS array.
69 C FG Master broadcasts the WEIGHTS_ array
70 call MPI_Bcast(weights_(1),n_ene,
71 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
73 C FG slaves receive the WEIGHTS array
74 call MPI_Bcast(weights(1),n_ene,
75 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
96 call MPI_Bcast(dc(1,1),6*nres,MPI_DOUBLE_PRECISION,
98 time_Bcast=time_Bcast+MPI_Wtime()-time00
99 time_Bcastw=time_Bcastw+MPI_Wtime()-time00
100 c call chainbuild_cart
101 c call int_from_cart1(.false.)
103 c write (iout,*) 'Processor',myrank,
104 c & ' calling etotal_short ipot=',ipot
106 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
108 cd print *,'nnt=',nnt,' nct=',nct
110 C Compute the side-chain and electrostatic interaction energy
112 goto (101,102,103,104,105,106) ipot
113 C Lennard-Jones potential.
114 101 call elj_long(evdw)
115 cd print '(a)','Exit ELJ'
117 C Lennard-Jones-Kihara potential (shifted).
118 102 call eljk_long(evdw)
120 C Berne-Pechukas potential (dilated LJ, angular dependence).
121 103 call ebp_long(evdw)
123 C Gay-Berne potential (shifted LJ, angular dependence).
124 104 call egb_long(evdw)
126 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
127 105 call egbv_long(evdw)
129 C Soft-sphere potential
130 106 call e_softsphere(evdw)
132 C Calculate electrostatic (H-bonding) energy of the main chain.
136 c write (iout,*) "etotal_long: shield_mode",shield_mode
137 if (shield_mode.eq.1) then
139 else if (shield_mode.eq.2) then
145 if (welec.gt.0d0.or.wvdwpp.gt.0d0.or.wel_loc.gt.0d0.or.
146 & wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
147 & .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
148 & .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
150 if (welec.gt.0d0.or.wel_loc.gt.0d0.or.
151 & wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
152 & .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
153 & .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
155 call eelec_scale(ees,evdw1,eel_loc,eello_turn3,eello_turn4)
164 c write (iout,*) "Soft-spheer ELEC potential"
165 call eelec_soft_sphere(ees,evdw1,eel_loc,eello_turn3,
169 C Calculate excluded-volume interaction energy between peptide groups
174 call escp_long(evdw2,evdw2_14)
180 call escp_soft_sphere(evdw2,evdw2_14)
183 C 12/1/95 Multi-body terms
187 if ((wcorr4.gt.0.0d0 .or. wcorr5.gt.0.0d0 .or. wcorr6.gt.0.0d0
188 & .or. wturn6.gt.0.0d0) .and. ipot.lt.6) then
189 call multibody_eello(ecorr,ecorr5,ecorr6,eturn6,n_corr,n_corr1)
190 c write (2,*) 'n_corr=',n_corr,' n_corr1=',n_corr1,
191 c &" ecorr",ecorr," ecorr5",ecorr5," ecorr6",ecorr6," eturn6",eturn6
198 if ((wcorr4.eq.0.0d0 .and. wcorr.gt.0.0d0) .and. ipot.lt.6) then
199 call multibody_hb(ecorr,ecorr5,ecorr6,n_corr,n_corr1)
202 C If performing constraint dynamics, call the constraint energy
203 C after the equilibration time
204 if(usampl.and.totT.gt.eq_time) then
207 call Econstr_back_qlike
223 energia(2)=evdw2-evdw2_14
240 energia(8)=eello_turn3
241 energia(9)=eello_turn4
243 energia(20)=Uconst+Uconst_back
244 call sum_energy(energia,.true.)
245 c write (iout,*) "Exit ETOTAL_LONG"
249 c------------------------------------------------------------------------------
250 subroutine etotal_short(energia)
251 implicit real*8 (a-h,o-z)
254 c Compute the short-range fast-varying contributions to the energy
259 cMS$ATTRIBUTES C :: proc_proc
264 double precision weights_(n_ene)
266 include 'COMMON.SETUP'
267 include 'COMMON.IOUNITS'
268 double precision energia(0:n_ene)
269 include 'COMMON.FFIELD'
270 include 'COMMON.DERIV'
271 include 'COMMON.INTERACT'
272 include 'COMMON.SBRIDGE'
273 include 'COMMON.CHAIN'
275 include 'COMMON.LOCAL'
276 include 'COMMON.CONTROL'
277 include 'COMMON.TORCNSTR'
279 c write(iout,'(a,i2)')'Calling etotal_short ipot=',ipot
281 if (modecalc.eq.12.or.modecalc.eq.14) then
283 if (fg_rank.eq.0) call int_from_cart1(.false.)
285 call int_from_cart1(.false.)
289 c write(iout,*) "ETOTAL_SHORT Processor",fg_rank,
290 c & " absolute rank",myrank," nfgtasks",nfgtasks
292 if (nfgtasks.gt.1) then
294 C FG slaves call the following matching MPI_Bcast in ERGASTULUM
295 if (fg_rank.eq.0) then
296 call MPI_Bcast(2,1,MPI_INTEGER,king,FG_COMM,IERROR)
297 c write (iout,*) "Processor",myrank," BROADCAST iorder"
299 C FG master sets up the WEIGHTS_ array which will be broadcast to the
300 C FG slaves as WEIGHTS array.
320 C FG Master broadcasts the WEIGHTS_ array
321 call MPI_Bcast(weights_(1),n_ene,
322 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
324 C FG slaves receive the WEIGHTS array
325 call MPI_Bcast(weights(1),n_ene,
326 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
347 c write (iout,*),"Processor",myrank," BROADCAST weights"
348 call MPI_Bcast(c(1,1),maxres6,MPI_DOUBLE_PRECISION,
350 c write (iout,*) "Processor",myrank," BROADCAST c"
351 call MPI_Bcast(dc(1,1),maxres6,MPI_DOUBLE_PRECISION,
353 c write (iout,*) "Processor",myrank," BROADCAST dc"
354 call MPI_Bcast(dc_norm(1,1),maxres6,MPI_DOUBLE_PRECISION,
356 c write (iout,*) "Processor",myrank," BROADCAST dc_norm"
357 call MPI_Bcast(theta(1),nres,MPI_DOUBLE_PRECISION,
359 c write (iout,*) "Processor",myrank," BROADCAST theta"
360 call MPI_Bcast(phi(1),nres,MPI_DOUBLE_PRECISION,
362 c write (iout,*) "Processor",myrank," BROADCAST phi"
363 call MPI_Bcast(alph(1),nres,MPI_DOUBLE_PRECISION,
365 c write (iout,*) "Processor",myrank," BROADCAST alph"
366 call MPI_Bcast(omeg(1),nres,MPI_DOUBLE_PRECISION,
368 c write (iout,*) "Processor",myrank," BROADCAST omeg"
369 call MPI_Bcast(vbld(1),2*nres,MPI_DOUBLE_PRECISION,
371 c write (iout,*) "Processor",myrank," BROADCAST vbld"
372 call MPI_Bcast(vbld_inv(1),2*nres,MPI_DOUBLE_PRECISION,
374 time_Bcast=time_Bcast+MPI_Wtime()-time00
375 c write (iout,*) "Processor",myrank," BROADCAST vbld_inv"
377 c write (iout,*) 'Processor',myrank,
378 c & ' calling etotal_short ipot=',ipot
380 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
382 c call int_from_cart1(.false.)
384 C Compute the side-chain and electrostatic interaction energy
386 goto (101,102,103,104,105,106) ipot
387 C Lennard-Jones potential.
388 101 call elj_short(evdw)
389 cd print '(a)','Exit ELJ'
391 C Lennard-Jones-Kihara potential (shifted).
392 102 call eljk_short(evdw)
394 C Berne-Pechukas potential (dilated LJ, angular dependence).
395 103 call ebp_short(evdw)
397 C Gay-Berne potential (shifted LJ, angular dependence).
398 104 call egb_short(evdw)
400 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
401 105 call egbv_short(evdw)
403 C Soft-sphere potential - already dealt with in the long-range part
405 c 106 call e_softsphere_short(evdw)
407 C Calculate electrostatic (H-bonding) energy of the main chain.
411 c Calculate the short-range part of Evdwpp
413 call evdwpp_short(evdw1)
415 c Calculate the short-range part of ESCp
418 call escp_short(evdw2,evdw2_14)
421 c Calculate the bond-stretching energy
425 C Calculate the disulfide-bridge and other energy and the contributions
426 C from other distance constraints.
429 C Calculate the virtual-bond-angle energy.
431 if (wang.gt.0d0) then
432 if (tor_mode.eq.0) then
435 C ebend kcc is Kubo cumulant clustered rigorous attemp to derive the
443 if (with_theta_constr) call etheta_constr(ethetacnstr)
445 C Calculate the SC local energy.
450 C Calculate the virtual-bond torsional energy.
452 if (wtor.gt.0.0d0) then
453 if (tor_mode.eq.0) then
456 C etor kcc is Kubo cumulant clustered rigorous attemp to derive the
464 if (ndih_constr.gt.0) call etor_constr(edihcnstr)
465 c print *,"Processor",myrank," computed Utor"
467 C 6/23/01 Calculate double-torsional energy
469 if ((wtor_d.gt.0.0d0).and.(tor_mode.eq.0)) then
475 C 21/5/07 Calculate local sicdechain correlation energy
477 if (wsccor.gt.0.0d0) then
478 call eback_sc_corr(esccor)
483 C Put energy components into an array
490 energia(2)=evdw2-evdw2_14
507 energia(8)=eello_turn3
508 energia(9)=eello_turn4
516 energia(19)=edihcnstr
518 energia(24)=ethetacnstr
519 c write (iout,*) "ETOTAL_SHORT before SUM_ENERGY"
521 call sum_energy(energia,.true.)
522 c write (iout,*) "Exit ETOTAL_SHORT"