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.
81 weights_(28)=wdfa_dist
84 weights_(31)=wdfa_beta
85 C FG Master broadcasts the WEIGHTS_ array
86 call MPI_Bcast(weights_(1),n_ene,
87 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
89 C FG slaves receive the WEIGHTS array
90 call MPI_Bcast(weights(1),n_ene,
91 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
114 wdfa_dist=weights_(28)
115 wdfa_tor=weights_(29)
116 wdfa_nei=weights_(30)
117 wdfa_beta=weights_(31)
119 call MPI_Bcast(dc(1,1),6*nres,MPI_DOUBLE_PRECISION,
121 time_Bcast=time_Bcast+MPI_Wtime()-time00
122 time_Bcastw=time_Bcastw+MPI_Wtime()-time00
123 c call chainbuild_cart
124 c call int_from_cart1(.false.)
126 c write (iout,*) 'Processor',myrank,
127 c & ' calling etotal_short ipot=',ipot
129 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
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.
137 101 call elj_long(evdw)
138 cd print '(a)','Exit ELJ'
140 C Lennard-Jones-Kihara potential (shifted).
141 102 call eljk_long(evdw)
143 C Berne-Pechukas potential (dilated LJ, angular dependence).
144 103 call ebp_long(evdw)
146 C Gay-Berne potential (shifted LJ, angular dependence).
147 104 call egb_long(evdw)
149 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
150 105 call egbv_long(evdw)
152 C Soft-sphere potential
153 106 call e_softsphere(evdw)
155 C Calculate electrostatic (H-bonding) energy of the main chain.
159 c write (iout,*) "etotal_long: shield_mode",shield_mode
160 if (shield_mode.eq.1) then
162 else if (shield_mode.eq.2) then
168 if (welec.gt.0d0.or.wvdwpp.gt.0d0.or.wel_loc.gt.0d0.or.
169 & wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
170 & .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
171 & .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
173 if (welec.gt.0d0.or.wel_loc.gt.0d0.or.
174 & wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
175 & .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
176 & .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
178 call eelec_scale(ees,evdw1,eel_loc,eello_turn3,eello_turn4)
187 c write (iout,*) "Soft-spheer ELEC potential"
188 call eelec_soft_sphere(ees,evdw1,eel_loc,eello_turn3,
192 C Calculate excluded-volume interaction energy between peptide groups
197 call escp_long(evdw2,evdw2_14)
203 call escp_soft_sphere(evdw2,evdw2_14)
207 C 12/1/95 Multi-body terms
211 if ((wcorr4.gt.0.0d0 .or. wcorr5.gt.0.0d0 .or. wcorr6.gt.0.0d0
212 & .or. wturn6.gt.0.0d0) .and. ipot.lt.6) then
213 call multibody_eello(ecorr,ecorr5,ecorr6,eturn6,n_corr,n_corr1)
214 c write (2,*) 'n_corr=',n_corr,' n_corr1=',n_corr1,
215 c &" ecorr",ecorr," ecorr5",ecorr5," ecorr6",ecorr6," eturn6",eturn6
222 if ((wcorr4.eq.0.0d0 .and. wcorr.gt.0.0d0) .and. ipot.lt.6) then
223 call multibody_hb(ecorr,ecorr5,ecorr6,n_corr,n_corr1)
227 C If performing constraint dynamics, call the constraint energy
228 C after the equilibration time
229 if(usampl.and.totT.gt.eq_time) then
232 call Econstr_back_qlike
248 energia(2)=evdw2-evdw2_14
265 energia(8)=eello_turn3
266 energia(9)=eello_turn4
268 energia(20)=Uconst+Uconst_back
269 energia(27)=ehomology_constr
274 call sum_energy(energia,.true.)
275 c write (iout,*) "Exit ETOTAL_LONG"
279 c------------------------------------------------------------------------------
280 subroutine etotal_short(energia)
281 implicit real*8 (a-h,o-z)
284 c Compute the short-range fast-varying contributions to the energy
289 cMS$ATTRIBUTES C :: proc_proc
294 double precision weights_(n_ene)
295 double precision time00
298 include 'COMMON.SETUP'
299 include 'COMMON.IOUNITS'
300 double precision energia(0:n_ene)
301 include 'COMMON.FFIELD'
302 include 'COMMON.DERIV'
303 include 'COMMON.INTERACT'
304 include 'COMMON.SBRIDGE'
305 include 'COMMON.CHAIN'
307 include 'COMMON.LOCAL'
308 include 'COMMON.CONTROL'
309 include 'COMMON.SAXS'
310 include 'COMMON.TORCNSTR'
311 double precision evdw,evdw1,evdw2,evdw2_14,ees,eel_loc,
312 & eello_turn3,eello_turn4,edfadis,estr,ehpb,ebe,ethetacnstr,
313 & escloc,etors,edihcnstr,etors_d,esccor,ecorr,ecorr5,ecorr6,eturn6,
314 & eliptran,Eafmforce,Etube,
315 & esaxs_constr,ehomology_constr,edfator,edfanei,edfabet
316 integer i,n_corr,n_corr1
317 c write(iout,'(a,i2)')'Calling etotal_short ipot=',ipot
319 if (modecalc.eq.12.or.modecalc.eq.14) then
321 if (fg_rank.eq.0) call int_from_cart1(.false.)
323 call int_from_cart1(.false.)
333 c write(iout,*) "ETOTAL_SHORT Processor",fg_rank,
334 c & " absolute rank",myrank," nfgtasks",nfgtasks
336 if (nfgtasks.gt.1) then
338 C FG slaves call the following matching MPI_Bcast in ERGASTULUM
339 if (fg_rank.eq.0) then
340 call MPI_Bcast(2,1,MPI_INTEGER,king,FG_COMM,IERROR)
341 c write (iout,*) "Processor",myrank," BROADCAST iorder"
343 C FG master sets up the WEIGHTS_ array which will be broadcast to the
344 C FG slaves as WEIGHTS array.
365 weights_(29)=wdfa_tor
366 weights_(30)=wdfa_nei
367 weights_(31)=wdfa_beta
368 C FG Master broadcasts the WEIGHTS_ array
369 call MPI_Bcast(weights_(1),n_ene,
370 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
372 C FG slaves receive the WEIGHTS array
373 call MPI_Bcast(weights(1),n_ene,
374 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
396 c write (iout,*),"Processor",myrank," BROADCAST weights"
397 call MPI_Bcast(c(1,1),maxres6,MPI_DOUBLE_PRECISION,
399 c write (iout,*) "Processor",myrank," BROADCAST c"
400 call MPI_Bcast(dc(1,1),maxres6,MPI_DOUBLE_PRECISION,
402 c write (iout,*) "Processor",myrank," BROADCAST dc"
403 call MPI_Bcast(dc_norm(1,1),maxres6,MPI_DOUBLE_PRECISION,
405 c write (iout,*) "Processor",myrank," BROADCAST dc_norm"
406 call MPI_Bcast(theta(1),nres,MPI_DOUBLE_PRECISION,
408 c write (iout,*) "Processor",myrank," BROADCAST theta"
409 call MPI_Bcast(phi(1),nres,MPI_DOUBLE_PRECISION,
411 c write (iout,*) "Processor",myrank," BROADCAST phi"
412 call MPI_Bcast(alph(1),nres,MPI_DOUBLE_PRECISION,
414 c write (iout,*) "Processor",myrank," BROADCAST alph"
415 call MPI_Bcast(omeg(1),nres,MPI_DOUBLE_PRECISION,
417 c write (iout,*) "Processor",myrank," BROADCAST omeg"
418 call MPI_Bcast(vbld(1),2*nres,MPI_DOUBLE_PRECISION,
420 c write (iout,*) "Processor",myrank," BROADCAST vbld"
421 call MPI_Bcast(vbld_inv(1),2*nres,MPI_DOUBLE_PRECISION,
423 time_Bcast=time_Bcast+MPI_Wtime()-time00
424 c write (iout,*) "Processor",myrank," BROADCAST vbld_inv"
426 c write (iout,*) 'Processor',myrank,
427 c & ' calling etotal_short ipot=',ipot
429 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
431 c call int_from_cart1(.false.)
433 C Compute the side-chain and electrostatic interaction energy
435 goto (101,102,103,104,105,106) ipot
436 C Lennard-Jones potential.
437 101 call elj_short(evdw)
438 cd print '(a)','Exit ELJ'
440 C Lennard-Jones-Kihara potential (shifted).
441 102 call eljk_short(evdw)
443 C Berne-Pechukas potential (dilated LJ, angular dependence).
444 103 call ebp_short(evdw)
446 C Gay-Berne potential (shifted LJ, angular dependence).
447 104 call egb_short(evdw)
449 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
450 105 call egbv_short(evdw)
452 C Soft-sphere potential - already dealt with in the long-range part
454 c 106 call e_softsphere_short(evdw)
456 C Calculate electrostatic (H-bonding) energy of the main chain.
460 c Calculate the short-range part of Evdwpp
462 call evdwpp_short(evdw1)
464 c Calculate the short-range part of ESCp
467 call escp_short(evdw2,evdw2_14)
470 c Calculate the bond-stretching energy
474 C Calculate the disulfide-bridge and other energy and the contributions
475 C from other distance constraints.
478 C Calculate the virtual-bond-angle energy.
480 if (wang.gt.0d0) then
481 if (tor_mode.eq.0) then
484 C ebend kcc is Kubo cumulant clustered rigorous attemp to derive the
492 if (with_theta_constr) call etheta_constr(ethetacnstr)
494 C Calculate the SC local energy.
499 C Calculate the virtual-bond torsional energy.
501 if (wtor.gt.0.0d0) then
502 if (tor_mode.eq.0) then
505 C etor kcc is Kubo cumulant clustered rigorous attemp to derive the
514 if (wliptran.gt.0) then
515 call Eliptransfer(eliptran)
520 if (ndih_constr.gt.0) call etor_constr(edihcnstr)
521 c print *,"Processor",myrank," computed Utor"
523 C 6/23/01 Calculate double-torsional energy
525 if ((wtor_d.gt.0.0d0).and.(tor_mode.eq.0)) then
531 c Homology restraints
533 if (constr_homology.ge.1) then
534 call e_modeller(ehomology_constr)
536 ehomology_constr=0.0d0
539 C BARTEK for dfa test!
540 if (wdfa_dist.gt.0) then
545 c print*, 'edfad is finished!', edfadis
546 if (wdfa_tor.gt.0) then
551 c print*, 'edfat is finished!', edfator
552 if (wdfa_nei.gt.0) then
557 c print*, 'edfan is finished!', edfanei
558 if (wdfa_beta.gt.0) then
563 c print*, 'edfab is finished!', edfabet
566 C 21/5/07 Calculate local sicdechain correlation energy
568 if (wsccor.gt.0.0d0) then
569 call eback_sc_corr(esccor)
573 c write (iout,*) "nsaxs",nsaxs," saxs_mode",saxs_mode
574 if (nsaxs.gt.0 .and. saxs_mode.eq.0) then
575 call e_saxs(Esaxs_constr)
576 c write (iout,*) "From Esaxs: Esaxs_constr",Esaxs_constr
577 else if (nsaxs.gt.0 .and. saxs_mode.gt.0) then
578 call e_saxsC(Esaxs_constr)
579 c write (iout,*) "From EsaxsC: Esaxs_constr",Esaxs_constr
584 C Put energy components into an array
591 energia(2)=evdw2-evdw2_14
608 energia(8)=eello_turn3
609 energia(9)=eello_turn4
617 energia(19)=edihcnstr
620 energia(24)=ethetacnstr
622 energia(26)=Esaxs_constr
623 energia(27)=ehomology_constr
628 c write (iout,*) "ETOTAL_SHORT before SUM_ENERGY"
630 call sum_energy(energia,.true.)
631 c write (iout,*) "Exit ETOTAL_SHORT"