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'
27 c write(iout,'(a,i2)')'Calling etotal_long ipot=',ipot
28 if (modecalc.eq.12.or.modecalc.eq.14) then
30 if (fg_rank.eq.0) call int_from_cart1(.false.)
32 call int_from_cart1(.false.)
36 c write(iout,*) "ETOTAL_LONG Processor",fg_rank,
37 c & " absolute rank",myrank," nfgtasks",nfgtasks
39 if (nfgtasks.gt.1) then
41 C FG slaves call the following matching MPI_Bcast in ERGASTULUM
42 if (fg_rank.eq.0) then
43 call MPI_Bcast(3,1,MPI_INTEGER,king,FG_COMM,IERROR)
44 c write (iout,*) "Processor",myrank," BROADCAST iorder"
46 C FG master sets up the WEIGHTS_ array which will be broadcast to the
47 C FG slaves as WEIGHTS array.
67 C FG Master broadcasts the WEIGHTS_ array
68 call MPI_Bcast(weights_(1),n_ene,
69 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
71 C FG slaves receive the WEIGHTS array
72 call MPI_Bcast(weights(1),n_ene,
73 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
75 c write (iout,*),"Processor",myrank," BROADCAST weights"
76 call MPI_Bcast(c(1,1),maxres6,MPI_DOUBLE_PRECISION,
78 c write (iout,*) "Processor",myrank," BROADCAST c"
79 call MPI_Bcast(dc(1,1),maxres6,MPI_DOUBLE_PRECISION,
81 c write (iout,*) "Processor",myrank," BROADCAST dc"
82 call MPI_Bcast(dc_norm(1,1),maxres6,MPI_DOUBLE_PRECISION,
84 c write (iout,*) "Processor",myrank," BROADCAST dc_norm"
85 call MPI_Bcast(theta(1),nres,MPI_DOUBLE_PRECISION,
87 c write (iout,*) "Processor",myrank," BROADCAST theta"
88 call MPI_Bcast(phi(1),nres,MPI_DOUBLE_PRECISION,
90 c write (iout,*) "Processor",myrank," BROADCAST phi"
91 call MPI_Bcast(alph(1),nres,MPI_DOUBLE_PRECISION,
93 c write (iout,*) "Processor",myrank," BROADCAST alph"
94 call MPI_Bcast(omeg(1),nres,MPI_DOUBLE_PRECISION,
96 c write (iout,*) "Processor",myrank," BROADCAST omeg"
97 call MPI_Bcast(vbld(1),2*nres,MPI_DOUBLE_PRECISION,
99 c write (iout,*) "Processor",myrank," BROADCAST vbld"
100 call MPI_Bcast(vbld_inv(1),2*nres,MPI_DOUBLE_PRECISION,
102 time_Bcast=time_Bcast+MPI_Wtime()-time00
103 c write (iout,*) "Processor",myrank," BROADCAST vbld_inv"
105 c write (iout,*) 'Processor',myrank,
106 c & ' calling etotal_short ipot=',ipot
108 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
110 c call int_from_cart1(.false.)
112 cd print *,'nnt=',nnt,' nct=',nct
113 c print *,"Processor",myrank," computed USCSC"
115 c print *,"Processor",myrank," left VEC_AND_DERIV"
118 if (welec.gt.0d0.or.wvdwpp.gt.0d0.or.wel_loc.gt.0d0.or.
119 & wturn3.gt.0d0.or.wturn4.gt.0d0) then
121 if (welec.gt.0d0.or.wel_loc.gt.0d0.or.
122 & wturn3.gt.0d0.or.wturn4.gt.0d0) then
124 call eelec(ees,evdw1,eel_loc,eello_turn3,eello_turn4)
133 c write (iout,*) "Soft-spheer ELEC potential"
134 call eelec_soft_sphere(ees,evdw1,eel_loc,eello_turn3,
138 C Calculate excluded-volume interaction energy between peptide groups
142 call escp(evdw2,evdw2_14)
144 c write (iout,*) "Soft-sphere SCP potential"
145 call escp_soft_sphere(evdw2,evdw2_14)
148 C 12/1/95 Multi-body terms
152 if ((wcorr4.gt.0.0d0 .or. wcorr5.gt.0.0d0 .or. wcorr6.gt.0.0d0
153 & .or. wturn6.gt.0.0d0) .and. ipot.lt.6) then
154 call multibody_eello(ecorr,ecorr5,ecorr6,eturn6,n_corr,n_corr1)
155 c write (2,*) 'n_corr=',n_corr,' n_corr1=',n_corr1,
156 c &" ecorr",ecorr," ecorr5",ecorr5," ecorr6",ecorr6," eturn6",eturn6
163 if ((wcorr4.eq.0.0d0 .and. wcorr.gt.0.0d0) .and. ipot.lt.6) then
164 call multibody_hb(ecorr,ecorr5,ecorr6,n_corr,n_corr1)
173 energia(2)=evdw2-evdw2_14
190 energia(8)=eello_turn3
191 energia(9)=eello_turn4
194 call sum_energy(energia,.true.)
195 c write (iout,*) "Exit ETOTAL_LONG"
199 c------------------------------------------------------------------------------
200 subroutine etotal_short(energia)
201 implicit real*8 (a-h,o-z)
204 c Compute the short-range fast-varying contributions to the energy
209 cMS$ATTRIBUTES C :: proc_proc
214 double precision weights_(n_ene)
216 include 'COMMON.SETUP'
217 include 'COMMON.IOUNITS'
218 double precision energia(0:n_ene)
219 include 'COMMON.FFIELD'
220 include 'COMMON.DERIV'
221 include 'COMMON.INTERACT'
222 include 'COMMON.SBRIDGE'
223 include 'COMMON.CHAIN'
225 include 'COMMON.LOCAL'
227 c write(iout,'(a,i2)')'Calling etotal_short ipot=',ipot
229 if (modecalc.eq.12.or.modecalc.eq.14) then
231 if (fg_rank.eq.0) call int_from_cart1(.false.)
233 call int_from_cart1(.false.)
237 c write(iout,*) "ETOTAL_SHORT Processor",fg_rank,
238 c & " absolute rank",myrank," nfgtasks",nfgtasks
240 if (nfgtasks.gt.1) then
242 C FG slaves call the following matching MPI_Bcast in ERGASTULUM
243 if (fg_rank.eq.0) then
244 call MPI_Bcast(2,1,MPI_INTEGER,king,FG_COMM,IERROR)
245 c write (iout,*) "Processor",myrank," BROADCAST iorder"
247 C FG master sets up the WEIGHTS_ array which will be broadcast to the
248 C FG slaves as WEIGHTS array.
268 C FG Master broadcasts the WEIGHTS_ array
269 call MPI_Bcast(weights_(1),n_ene,
270 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
272 C FG slaves receive the WEIGHTS array
273 call MPI_Bcast(weights(1),n_ene,
274 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
276 c write (iout,*),"Processor",myrank," BROADCAST weights"
277 call MPI_Bcast(c(1,1),maxres6,MPI_DOUBLE_PRECISION,
279 c write (iout,*) "Processor",myrank," BROADCAST c"
280 call MPI_Bcast(dc(1,1),maxres6,MPI_DOUBLE_PRECISION,
282 c write (iout,*) "Processor",myrank," BROADCAST dc"
283 call MPI_Bcast(dc_norm(1,1),maxres6,MPI_DOUBLE_PRECISION,
285 c write (iout,*) "Processor",myrank," BROADCAST dc_norm"
286 call MPI_Bcast(theta(1),nres,MPI_DOUBLE_PRECISION,
288 c write (iout,*) "Processor",myrank," BROADCAST theta"
289 call MPI_Bcast(phi(1),nres,MPI_DOUBLE_PRECISION,
291 c write (iout,*) "Processor",myrank," BROADCAST phi"
292 call MPI_Bcast(alph(1),nres,MPI_DOUBLE_PRECISION,
294 c write (iout,*) "Processor",myrank," BROADCAST alph"
295 call MPI_Bcast(omeg(1),nres,MPI_DOUBLE_PRECISION,
297 c write (iout,*) "Processor",myrank," BROADCAST omeg"
298 call MPI_Bcast(vbld(1),2*nres,MPI_DOUBLE_PRECISION,
300 c write (iout,*) "Processor",myrank," BROADCAST vbld"
301 call MPI_Bcast(vbld_inv(1),2*nres,MPI_DOUBLE_PRECISION,
303 time_Bcast=time_Bcast+MPI_Wtime()-time00
304 c write (iout,*) "Processor",myrank," BROADCAST vbld_inv"
306 c write (iout,*) 'Processor',myrank,
307 c & ' calling etotal_short ipot=',ipot
309 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
311 c call int_from_cart1(.false.)
313 C Compute the side-chain and electrostatic interaction energy
315 goto (101,102,103,104,105,106) ipot
316 C Lennard-Jones potential.
318 cd print '(a)','Exit ELJ'
320 C Lennard-Jones-Kihara potential (shifted).
323 C Berne-Pechukas potential (dilated LJ, angular dependence).
326 C Gay-Berne potential (shifted LJ, angular dependence).
329 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
332 C Soft-sphere potential
333 106 call e_softsphere(evdw)
335 C Calculate electrostatic (H-bonding) energy of the main chain.
339 c Calculate the bond-stretching energy
343 C Calculate the disulfide-bridge and other energy and the contributions
344 C from other distance constraints.
347 C Calculate the virtual-bond-angle energy.
351 C Calculate the SC local energy.
356 C Calculate the virtual-bond torsional energy.
358 call etor(etors,edihcnstr)
360 C 6/23/01 Calculate double-torsional energy
373 c write (iout,*) "ETOTAL_SHORT before SUM_ENERGY"
375 call sum_energy(energia,.true.)
376 c write (iout,*) "Exit ETOTAL_SHORT"