1 subroutine etotal_long(energia)
5 c Compute the long-range slow-varying contributions to the energy
10 cMS$ATTRIBUTES C :: proc_proc
15 double precision weights_(n_ene)
16 double precision time00,time_Bcast,time_BcastW
19 include 'COMMON.SETUP'
20 include 'COMMON.IOUNITS'
21 double precision energia(0:n_ene)
22 include 'COMMON.FFIELD'
23 include 'COMMON.DERIV'
24 include 'COMMON.INTERACT'
25 include 'COMMON.SBRIDGE'
26 include 'COMMON.CHAIN'
28 include 'COMMON.LOCAL'
29 include 'COMMON.QRESTR'
31 include 'COMMON.CONTROL'
32 double precision evdw,evdw1,evdw2,evdw2_14,ees,eel_loc,
33 & eello_turn3,eello_turn4,edfadis,estr,ehpb,ebe,ethetacnstr,
34 & escloc,etors,edihcnstr,etors_d,esccor,ecorr,ecorr5,ecorr6,eturn6,
35 & eliptran,Eafmforce,Etube,
36 & esaxs_constr,ehomology_constr,edfator,edfanei,edfabet
37 integer i,n_corr,n_corr1
38 c write(iout,'(a,i2)')'Calling etotal_long ipot=',ipot
39 if (modecalc.eq.12.or.modecalc.eq.14) then
41 c if (fg_rank.eq.0) call int_from_cart1(.false.)
43 call int_from_cart1(.false.)
47 c write(iout,*) "ETOTAL_LONG Processor",fg_rank,
48 c & " absolute rank",myrank," nfgtasks",nfgtasks
50 if (nfgtasks.gt.1) then
52 C FG slaves call the following matching MPI_Bcast in ERGASTULUM
53 if (fg_rank.eq.0) then
54 call MPI_Bcast(3,1,MPI_INTEGER,king,FG_COMM,IERROR)
55 c write (iout,*) "Processor",myrank," BROADCAST iorder"
57 C FG master sets up the WEIGHTS_ array which will be broadcast to the
58 C FG slaves as WEIGHTS array.
79 C FG Master broadcasts the WEIGHTS_ array
80 call MPI_Bcast(weights_(1),n_ene,
81 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
83 C FG slaves receive the WEIGHTS array
84 call MPI_Bcast(weights(1),n_ene,
85 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
107 call MPI_Bcast(dc(1,1),6*nres,MPI_DOUBLE_PRECISION,
109 time_Bcast=time_Bcast+MPI_Wtime()-time00
110 time_Bcastw=time_Bcastw+MPI_Wtime()-time00
111 c call chainbuild_cart
112 c call int_from_cart1(.false.)
114 c write (iout,*) 'Processor',myrank,
115 c & ' calling etotal_short ipot=',ipot
117 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
119 cd print *,'nnt=',nnt,' nct=',nct
121 C Compute the side-chain and electrostatic interaction energy
123 goto (101,102,103,104,105,106) ipot
124 C Lennard-Jones potential.
125 101 call elj_long(evdw)
126 cd print '(a)','Exit ELJ'
128 C Lennard-Jones-Kihara potential (shifted).
129 102 call eljk_long(evdw)
131 C Berne-Pechukas potential (dilated LJ, angular dependence).
132 103 call ebp_long(evdw)
134 C Gay-Berne potential (shifted LJ, angular dependence).
135 104 call egb_long(evdw)
137 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
138 105 call egbv_long(evdw)
140 C Soft-sphere potential
141 106 call e_softsphere(evdw)
143 C Calculate electrostatic (H-bonding) energy of the main chain.
147 c write (iout,*) "etotal_long: shield_mode",shield_mode
148 if (shield_mode.eq.1) then
150 else if (shield_mode.eq.2) then
156 if (welec.gt.0d0.or.wvdwpp.gt.0d0.or.wel_loc.gt.0d0.or.
157 & wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
158 & .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
159 & .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
161 if (welec.gt.0d0.or.wel_loc.gt.0d0.or.
162 & wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
163 & .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
164 & .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
166 call eelec_scale(ees,evdw1,eel_loc,eello_turn3,eello_turn4)
175 c write (iout,*) "Soft-spheer ELEC potential"
176 call eelec_soft_sphere(ees,evdw1,eel_loc,eello_turn3,
180 C Calculate excluded-volume interaction energy between peptide groups
185 call escp_long(evdw2,evdw2_14)
191 call escp_soft_sphere(evdw2,evdw2_14)
195 C 12/1/95 Multi-body terms
199 if ((wcorr4.gt.0.0d0 .or. wcorr5.gt.0.0d0 .or. wcorr6.gt.0.0d0
200 & .or. wturn6.gt.0.0d0) .and. ipot.lt.6) then
201 call multibody_eello(ecorr,ecorr5,ecorr6,eturn6,n_corr,n_corr1)
202 c write (2,*) 'n_corr=',n_corr,' n_corr1=',n_corr1,
203 c &" ecorr",ecorr," ecorr5",ecorr5," ecorr6",ecorr6," eturn6",eturn6
210 if ((wcorr4.eq.0.0d0 .and. wcorr.gt.0.0d0) .and. ipot.lt.6) then
211 call multibody_hb(ecorr,ecorr5,ecorr6,n_corr,n_corr1)
215 C If performing constraint dynamics, call the constraint energy
216 C after the equilibration time
217 if(usampl.and.totT.gt.eq_time) then
220 call Econstr_back_qlike
236 energia(2)=evdw2-evdw2_14
253 energia(8)=eello_turn3
254 energia(9)=eello_turn4
256 energia(20)=Uconst+Uconst_back
257 energia(27)=ehomology_constr
262 call sum_energy(energia,.true.)
263 c write (iout,*) "Exit ETOTAL_LONG"
267 c------------------------------------------------------------------------------
268 subroutine etotal_short(energia)
269 implicit real*8 (a-h,o-z)
272 c Compute the short-range fast-varying contributions to the energy
277 cMS$ATTRIBUTES C :: proc_proc
282 double precision weights_(n_ene)
283 double precision time00
286 include 'COMMON.SETUP'
287 include 'COMMON.IOUNITS'
288 double precision energia(0:n_ene)
289 include 'COMMON.FFIELD'
290 include 'COMMON.DERIV'
291 include 'COMMON.INTERACT'
292 include 'COMMON.SBRIDGE'
293 include 'COMMON.CHAIN'
295 include 'COMMON.LOCAL'
296 include 'COMMON.CONTROL'
297 include 'COMMON.SAXS'
298 include 'COMMON.TORCNSTR'
299 double precision evdw,evdw1,evdw2,evdw2_14,ees,eel_loc,
300 & eello_turn3,eello_turn4,edfadis,estr,ehpb,ebe,ethetacnstr,
301 & escloc,etors,edihcnstr,etors_d,esccor,ecorr,ecorr5,ecorr6,eturn6,
302 & eliptran,Eafmforce,Etube,
303 & esaxs_constr,ehomology_constr,edfator,edfanei,edfabet
304 integer i,n_corr,n_corr1
305 c write(iout,'(a,i2)')'Calling etotal_short ipot=',ipot
307 if (modecalc.eq.12.or.modecalc.eq.14) then
309 if (fg_rank.eq.0) call int_from_cart1(.false.)
311 call int_from_cart1(.false.)
321 c write(iout,*) "ETOTAL_SHORT Processor",fg_rank,
322 c & " absolute rank",myrank," nfgtasks",nfgtasks
324 if (nfgtasks.gt.1) then
326 C FG slaves call the following matching MPI_Bcast in ERGASTULUM
327 if (fg_rank.eq.0) then
328 call MPI_Bcast(2,1,MPI_INTEGER,king,FG_COMM,IERROR)
329 c write (iout,*) "Processor",myrank," BROADCAST iorder"
331 C FG master sets up the WEIGHTS_ array which will be broadcast to the
332 C FG slaves as WEIGHTS array.
353 weights_(29)=wdfa_tor
354 weights_(30)=wdfa_nei
355 weights_(31)=wdfa_beta
356 C FG Master broadcasts the WEIGHTS_ array
357 call MPI_Bcast(weights_(1),n_ene,
358 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
360 C FG slaves receive the WEIGHTS array
361 call MPI_Bcast(weights(1),n_ene,
362 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
384 c write (iout,*),"Processor",myrank," BROADCAST weights"
385 call MPI_Bcast(c(1,1),maxres6,MPI_DOUBLE_PRECISION,
387 c write (iout,*) "Processor",myrank," BROADCAST c"
388 call MPI_Bcast(dc(1,1),maxres6,MPI_DOUBLE_PRECISION,
390 c write (iout,*) "Processor",myrank," BROADCAST dc"
391 call MPI_Bcast(dc_norm(1,1),maxres6,MPI_DOUBLE_PRECISION,
393 c write (iout,*) "Processor",myrank," BROADCAST dc_norm"
394 call MPI_Bcast(theta(1),nres,MPI_DOUBLE_PRECISION,
396 c write (iout,*) "Processor",myrank," BROADCAST theta"
397 call MPI_Bcast(phi(1),nres,MPI_DOUBLE_PRECISION,
399 c write (iout,*) "Processor",myrank," BROADCAST phi"
400 call MPI_Bcast(alph(1),nres,MPI_DOUBLE_PRECISION,
402 c write (iout,*) "Processor",myrank," BROADCAST alph"
403 call MPI_Bcast(omeg(1),nres,MPI_DOUBLE_PRECISION,
405 c write (iout,*) "Processor",myrank," BROADCAST omeg"
406 call MPI_Bcast(vbld(1),2*nres,MPI_DOUBLE_PRECISION,
408 c write (iout,*) "Processor",myrank," BROADCAST vbld"
409 call MPI_Bcast(vbld_inv(1),2*nres,MPI_DOUBLE_PRECISION,
411 time_Bcast=time_Bcast+MPI_Wtime()-time00
412 c write (iout,*) "Processor",myrank," BROADCAST vbld_inv"
414 c write (iout,*) 'Processor',myrank,
415 c & ' calling etotal_short ipot=',ipot
417 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
419 c call int_from_cart1(.false.)
421 C Compute the side-chain and electrostatic interaction energy
423 goto (101,102,103,104,105,106) ipot
424 C Lennard-Jones potential.
425 101 call elj_short(evdw)
426 cd print '(a)','Exit ELJ'
428 C Lennard-Jones-Kihara potential (shifted).
429 102 call eljk_short(evdw)
431 C Berne-Pechukas potential (dilated LJ, angular dependence).
432 103 call ebp_short(evdw)
434 C Gay-Berne potential (shifted LJ, angular dependence).
435 104 call egb_short(evdw)
437 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
438 105 call egbv_short(evdw)
440 C Soft-sphere potential - already dealt with in the long-range part
442 c 106 call e_softsphere_short(evdw)
444 C Calculate electrostatic (H-bonding) energy of the main chain.
448 c Calculate the short-range part of Evdwpp
450 call evdwpp_short(evdw1)
452 c Calculate the short-range part of ESCp
455 call escp_short(evdw2,evdw2_14)
458 c Calculate the bond-stretching energy
462 C Calculate the disulfide-bridge and other energy and the contributions
463 C from other distance constraints.
466 C Calculate the virtual-bond-angle energy.
468 if (wang.gt.0d0) then
469 if (tor_mode.eq.0) then
472 C ebend kcc is Kubo cumulant clustered rigorous attemp to derive the
480 if (with_theta_constr) call etheta_constr(ethetacnstr)
482 C Calculate the SC local energy.
487 C Calculate the virtual-bond torsional energy.
489 if (wtor.gt.0.0d0) then
490 if (tor_mode.eq.0) then
493 C etor kcc is Kubo cumulant clustered rigorous attemp to derive the
501 if (ndih_constr.gt.0) call etor_constr(edihcnstr)
502 c print *,"Processor",myrank," computed Utor"
504 C 6/23/01 Calculate double-torsional energy
506 if ((wtor_d.gt.0.0d0).and.(tor_mode.eq.0)) then
512 c Homology restraints
514 if (constr_homology.ge.1) then
515 call e_modeller(ehomology_constr)
517 ehomology_constr=0.0d0
520 C BARTEK for dfa test!
521 if (wdfa_dist.gt.0) then
526 c print*, 'edfad is finished!', edfadis
527 if (wdfa_tor.gt.0) then
532 c print*, 'edfat is finished!', edfator
533 if (wdfa_nei.gt.0) then
538 c print*, 'edfan is finished!', edfanei
539 if (wdfa_beta.gt.0) then
544 c print*, 'edfab is finished!', edfabet
547 C 21/5/07 Calculate local sicdechain correlation energy
549 if (wsccor.gt.0.0d0) then
550 call eback_sc_corr(esccor)
554 c write (iout,*) "nsaxs",nsaxs," saxs_mode",saxs_mode
555 if (nsaxs.gt.0 .and. saxs_mode.eq.0) then
556 call e_saxs(Esaxs_constr)
557 c write (iout,*) "From Esaxs: Esaxs_constr",Esaxs_constr
558 else if (nsaxs.gt.0 .and. saxs_mode.gt.0) then
559 call e_saxsC(Esaxs_constr)
560 c write (iout,*) "From EsaxsC: Esaxs_constr",Esaxs_constr
565 C Put energy components into an array
572 energia(2)=evdw2-evdw2_14
589 energia(8)=eello_turn3
590 energia(9)=eello_turn4
598 energia(19)=edihcnstr
601 energia(24)=ethetacnstr
603 energia(26)=Esaxs_constr
604 energia(27)=ehomology_constr
609 c write (iout,*) "ETOTAL_SHORT before SUM_ENERGY"
611 call sum_energy(energia,.true.)
612 c write (iout,*) "Exit ETOTAL_SHORT"