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)
94 c write (iout,*),"Processor",myrank," BROADCAST weights"
95 call MPI_Bcast(c(1,1),maxres6,MPI_DOUBLE_PRECISION,
97 c write (iout,*) "Processor",myrank," BROADCAST c"
98 call MPI_Bcast(dc(1,1),maxres6,MPI_DOUBLE_PRECISION,
100 c write (iout,*) "Processor",myrank," BROADCAST dc"
101 call MPI_Bcast(dc_norm(1,1),maxres6,MPI_DOUBLE_PRECISION,
103 c write (iout,*) "Processor",myrank," BROADCAST dc_norm"
104 call MPI_Bcast(theta(1),nres,MPI_DOUBLE_PRECISION,
106 c write (iout,*) "Processor",myrank," BROADCAST theta"
107 call MPI_Bcast(phi(1),nres,MPI_DOUBLE_PRECISION,
109 c write (iout,*) "Processor",myrank," BROADCAST phi"
110 call MPI_Bcast(alph(1),nres,MPI_DOUBLE_PRECISION,
112 c write (iout,*) "Processor",myrank," BROADCAST alph"
113 call MPI_Bcast(omeg(1),nres,MPI_DOUBLE_PRECISION,
115 c write (iout,*) "Processor",myrank," BROADCAST omeg"
116 call MPI_Bcast(vbld(1),2*nres,MPI_DOUBLE_PRECISION,
118 c write (iout,*) "Processor",myrank," BROADCAST vbld"
119 call MPI_Bcast(vbld_inv(1),2*nres,MPI_DOUBLE_PRECISION,
121 time_Bcast=time_Bcast+MPI_Wtime()-time00
122 c write (iout,*) "Processor",myrank," BROADCAST vbld_inv"
124 c write (iout,*) 'Processor',myrank,
125 c & ' calling etotal_short ipot=',ipot
127 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
129 c call int_from_cart1(.false.)
131 cd print *,'nnt=',nnt,' nct=',nct
133 C Compute the side-chain and electrostatic interaction energy
135 goto (101,102,103,104,105,106) ipot
136 C Lennard-Jones potential.
138 cd print '(a)','Exit ELJ'
140 C Lennard-Jones-Kihara potential (shifted).
143 C Berne-Pechukas potential (dilated LJ, angular dependence).
146 C Gay-Berne potential (shifted LJ, angular dependence).
149 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
152 C Soft-sphere potential
153 106 call e_softsphere(evdw)
155 C Calculate electrostatic (H-bonding) energy of the main chain.
158 c print *,"Processor",myrank," computed USCSC"
160 c print *,"Processor",myrank," left VEC_AND_DERIV"
163 if (welec.gt.0d0.or.wvdwpp.gt.0d0.or.wel_loc.gt.0d0.or.
164 & wturn3.gt.0d0.or.wturn4.gt.0d0) then
166 if (welec.gt.0d0.or.wel_loc.gt.0d0.or.
167 & wturn3.gt.0d0.or.wturn4.gt.0d0) then
169 call eelec(ees,evdw1,eel_loc,eello_turn3,eello_turn4)
178 c write (iout,*) "Soft-spheer ELEC potential"
179 call eelec_soft_sphere(ees,evdw1,eel_loc,eello_turn3,
183 C Calculate excluded-volume interaction energy between peptide groups
187 call escp(evdw2,evdw2_14)
189 c write (iout,*) "Soft-sphere SCP potential"
190 call escp_soft_sphere(evdw2,evdw2_14)
193 C 12/1/95 Multi-body terms
197 if ((wcorr4.gt.0.0d0 .or. wcorr5.gt.0.0d0 .or. wcorr6.gt.0.0d0
198 & .or. wturn6.gt.0.0d0) .and. ipot.lt.6) then
199 call multibody_eello(ecorr,ecorr5,ecorr6,eturn6,n_corr,n_corr1)
200 c write (2,*) 'n_corr=',n_corr,' n_corr1=',n_corr1,
201 c &" ecorr",ecorr," ecorr5",ecorr5," ecorr6",ecorr6," eturn6",eturn6
208 if ((wcorr4.eq.0.0d0 .and. wcorr.gt.0.0d0) .and. ipot.lt.6) then
209 call multibody_hb(ecorr,ecorr5,ecorr6,n_corr,n_corr1)
219 energia(2)=evdw2-evdw2_14
236 energia(8)=eello_turn3
237 energia(9)=eello_turn4
240 call sum_energy(energia,.true.)
241 c write (iout,*) "Exit ETOTAL_LONG"
245 c------------------------------------------------------------------------------
246 subroutine etotal_short(energia)
247 implicit real*8 (a-h,o-z)
250 c Compute the short-range fast-varying contributions to the energy
255 cMS$ATTRIBUTES C :: proc_proc
260 double precision weights_(n_ene)
262 include 'COMMON.SETUP'
263 include 'COMMON.IOUNITS'
264 double precision energia(0:n_ene)
265 include 'COMMON.FFIELD'
266 include 'COMMON.DERIV'
267 include 'COMMON.INTERACT'
268 include 'COMMON.SBRIDGE'
269 include 'COMMON.CHAIN'
271 include 'COMMON.LOCAL'
273 c write(iout,'(a,i2)')'Calling etotal_short ipot=',ipot
275 if (modecalc.eq.12.or.modecalc.eq.14) then
277 if (fg_rank.eq.0) call int_from_cart1(.false.)
279 call int_from_cart1(.false.)
283 c write(iout,*) "ETOTAL_SHORT Processor",fg_rank,
284 c & " absolute rank",myrank," nfgtasks",nfgtasks
286 if (nfgtasks.gt.1) then
288 C FG slaves call the following matching MPI_Bcast in ERGASTULUM
289 if (fg_rank.eq.0) then
290 call MPI_Bcast(2,1,MPI_INTEGER,king,FG_COMM,IERROR)
291 c write (iout,*) "Processor",myrank," BROADCAST iorder"
293 C FG master sets up the WEIGHTS_ array which will be broadcast to the
294 C FG slaves as WEIGHTS array.
314 C FG Master broadcasts the WEIGHTS_ array
315 call MPI_Bcast(weights_(1),n_ene,
316 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
318 C FG slaves receive the WEIGHTS array
319 call MPI_Bcast(weights(1),n_ene,
320 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
341 c write (iout,*),"Processor",myrank," BROADCAST weights"
342 call MPI_Bcast(c(1,1),maxres6,MPI_DOUBLE_PRECISION,
344 c write (iout,*) "Processor",myrank," BROADCAST c"
345 call MPI_Bcast(dc(1,1),maxres6,MPI_DOUBLE_PRECISION,
347 c write (iout,*) "Processor",myrank," BROADCAST dc"
348 call MPI_Bcast(dc_norm(1,1),maxres6,MPI_DOUBLE_PRECISION,
350 c write (iout,*) "Processor",myrank," BROADCAST dc_norm"
351 call MPI_Bcast(theta(1),nres,MPI_DOUBLE_PRECISION,
353 c write (iout,*) "Processor",myrank," BROADCAST theta"
354 call MPI_Bcast(phi(1),nres,MPI_DOUBLE_PRECISION,
356 c write (iout,*) "Processor",myrank," BROADCAST phi"
357 call MPI_Bcast(alph(1),nres,MPI_DOUBLE_PRECISION,
359 c write (iout,*) "Processor",myrank," BROADCAST alph"
360 call MPI_Bcast(omeg(1),nres,MPI_DOUBLE_PRECISION,
362 c write (iout,*) "Processor",myrank," BROADCAST omeg"
363 call MPI_Bcast(vbld(1),2*nres,MPI_DOUBLE_PRECISION,
365 c write (iout,*) "Processor",myrank," BROADCAST vbld"
366 call MPI_Bcast(vbld_inv(1),2*nres,MPI_DOUBLE_PRECISION,
368 time_Bcast=time_Bcast+MPI_Wtime()-time00
369 c write (iout,*) "Processor",myrank," BROADCAST vbld_inv"
371 c write (iout,*) 'Processor',myrank,
372 c & ' calling etotal_short ipot=',ipot
374 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
376 c call int_from_cart1(.false.)
378 c Calculate the bond-stretching energy
382 C Calculate the disulfide-bridge and other energy and the contributions
383 C from other distance constraints.
386 C Calculate the virtual-bond-angle energy.
390 C Calculate the SC local energy.
395 C Calculate the virtual-bond torsional energy.
397 call etor(etors,edihcnstr)
399 C 6/23/01 Calculate double-torsional energy
411 c write (iout,*) "ETOTAL_SHORT before SUM_ENERGY"
413 call sum_energy(energia,.true.)
414 c write (iout,*) "Exit ETOTAL_SHORT"