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
130 if (nfgtasks.gt.1) then
131 call MPI_Bcast(itime_mat,1,MPI_INT,king,FG_COMM,IERROR)
133 if (mod(itime_mat,imatupdate).eq.0) then
134 call make_SCp_inter_list
135 call make_SCSC_inter_list
136 call make_pp_inter_list
137 call make_pp_vdw_inter_list
141 cd print *,'nnt=',nnt,' nct=',nct
143 C Compute the side-chain and electrostatic interaction energy
145 goto (101,102,103,104,105,106) ipot
146 C Lennard-Jones potential.
147 101 call elj_long(evdw)
148 cd print '(a)','Exit ELJ'
150 C Lennard-Jones-Kihara potential (shifted).
151 102 call eljk_long(evdw)
153 C Berne-Pechukas potential (dilated LJ, angular dependence).
154 103 call ebp_long(evdw)
156 C Gay-Berne potential (shifted LJ, angular dependence).
157 104 call egb_long(evdw)
159 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
160 105 call egbv_long(evdw)
162 C Soft-sphere potential
163 106 call e_softsphere(evdw)
165 C Calculate electrostatic (H-bonding) energy of the main chain.
169 c write (iout,*) "etotal_long: shield_mode",shield_mode
170 if (shield_mode.eq.1) then
172 else if (shield_mode.eq.2) then
178 if (welec.gt.0d0.or.wvdwpp.gt.0d0.or.wel_loc.gt.0d0.or.
179 & wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
180 & .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
181 & .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
183 if (welec.gt.0d0.or.wel_loc.gt.0d0.or.
184 & wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
185 & .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
186 & .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
188 call eelec_scale(ees,evdw1,eel_loc,eello_turn3,eello_turn4)
197 c write (iout,*) "Soft-spheer ELEC potential"
198 call eelec_soft_sphere(ees,evdw1,eel_loc,eello_turn3,
202 C Calculate excluded-volume interaction energy between peptide groups
207 call escp_long(evdw2,evdw2_14)
213 call escp_soft_sphere(evdw2,evdw2_14)
217 C 12/1/95 Multi-body terms
221 if ((wcorr4.gt.0.0d0 .or. wcorr5.gt.0.0d0 .or. wcorr6.gt.0.0d0
222 & .or. wturn6.gt.0.0d0) .and. ipot.lt.6) then
223 call multibody_eello(ecorr,ecorr5,ecorr6,eturn6,n_corr,n_corr1)
224 c write (2,*) 'n_corr=',n_corr,' n_corr1=',n_corr1,
225 c &" ecorr",ecorr," ecorr5",ecorr5," ecorr6",ecorr6," eturn6",eturn6
232 if ((wcorr4.eq.0.0d0 .and. wcorr.gt.0.0d0) .and. ipot.lt.6) then
233 call multibody_hb(ecorr,ecorr5,ecorr6,n_corr,n_corr1)
237 C If performing constraint dynamics, call the constraint energy
238 C after the equilibration time
239 if(usampl.and.totT.gt.eq_time) then
242 call Econstr_back_qlike
258 energia(2)=evdw2-evdw2_14
275 energia(8)=eello_turn3
276 energia(9)=eello_turn4
278 energia(20)=Uconst+Uconst_back
279 energia(27)=ehomology_constr
284 call sum_energy(energia,.true.)
285 c write (iout,*) "Exit ETOTAL_LONG"
289 c------------------------------------------------------------------------------
290 subroutine etotal_short(energia)
291 implicit real*8 (a-h,o-z)
294 c Compute the short-range fast-varying contributions to the energy
299 cMS$ATTRIBUTES C :: proc_proc
304 double precision weights_(n_ene)
305 double precision time00
308 include 'COMMON.SETUP'
309 include 'COMMON.IOUNITS'
310 double precision energia(0:n_ene)
311 include 'COMMON.FFIELD'
312 include 'COMMON.DERIV'
313 include 'COMMON.INTERACT'
314 include 'COMMON.SBRIDGE'
315 include 'COMMON.CHAIN'
317 include 'COMMON.LOCAL'
318 include 'COMMON.CONTROL'
319 include 'COMMON.SAXS'
320 include 'COMMON.TORCNSTR'
321 double precision evdw,evdw1,evdw2,evdw2_14,ees,eel_loc,
322 & eello_turn3,eello_turn4,edfadis,estr,ehpb,ebe,ethetacnstr,
323 & escloc,etors,edihcnstr,etors_d,esccor,ecorr,ecorr5,ecorr6,eturn6,
324 & eliptran,Eafmforce,Etube,
325 & esaxs_constr,ehomology_constr,edfator,edfanei,edfabet
326 integer i,n_corr,n_corr1
327 c write(iout,'(a,i2)')'Calling etotal_short ipot=',ipot
329 if (modecalc.eq.12.or.modecalc.eq.14) then
331 if (fg_rank.eq.0) call int_from_cart1(.false.)
333 call int_from_cart1(.false.)
343 c write(iout,*) "ETOTAL_SHORT Processor",fg_rank,
344 c & " absolute rank",myrank," nfgtasks",nfgtasks
346 if (nfgtasks.gt.1) then
348 C FG slaves call the following matching MPI_Bcast in ERGASTULUM
349 if (fg_rank.eq.0) then
350 call MPI_Bcast(2,1,MPI_INTEGER,king,FG_COMM,IERROR)
351 c write (iout,*) "Processor",myrank," BROADCAST iorder"
353 C FG master sets up the WEIGHTS_ array which will be broadcast to the
354 C FG slaves as WEIGHTS array.
375 weights_(29)=wdfa_tor
376 weights_(30)=wdfa_nei
377 weights_(31)=wdfa_beta
378 C FG Master broadcasts the WEIGHTS_ array
379 call MPI_Bcast(weights_(1),n_ene,
380 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
382 C FG slaves receive the WEIGHTS array
383 call MPI_Bcast(weights(1),n_ene,
384 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
406 c write (iout,*),"Processor",myrank," BROADCAST weights"
407 call MPI_Bcast(c(1,1),maxres6,MPI_DOUBLE_PRECISION,
409 c write (iout,*) "Processor",myrank," BROADCAST c"
410 call MPI_Bcast(dc(1,1),maxres6,MPI_DOUBLE_PRECISION,
412 c write (iout,*) "Processor",myrank," BROADCAST dc"
413 call MPI_Bcast(dc_norm(1,1),maxres6,MPI_DOUBLE_PRECISION,
415 c write (iout,*) "Processor",myrank," BROADCAST dc_norm"
416 call MPI_Bcast(theta(1),nres,MPI_DOUBLE_PRECISION,
418 c write (iout,*) "Processor",myrank," BROADCAST theta"
419 call MPI_Bcast(phi(1),nres,MPI_DOUBLE_PRECISION,
421 c write (iout,*) "Processor",myrank," BROADCAST phi"
422 call MPI_Bcast(alph(1),nres,MPI_DOUBLE_PRECISION,
424 c write (iout,*) "Processor",myrank," BROADCAST alph"
425 call MPI_Bcast(omeg(1),nres,MPI_DOUBLE_PRECISION,
427 c write (iout,*) "Processor",myrank," BROADCAST omeg"
428 call MPI_Bcast(vbld(1),2*nres,MPI_DOUBLE_PRECISION,
430 c write (iout,*) "Processor",myrank," BROADCAST vbld"
431 call MPI_Bcast(vbld_inv(1),2*nres,MPI_DOUBLE_PRECISION,
433 time_Bcast=time_Bcast+MPI_Wtime()-time00
434 c write (iout,*) "Processor",myrank," BROADCAST vbld_inv"
436 c write (iout,*) 'Processor',myrank,
437 c & ' calling etotal_short ipot=',ipot
439 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
441 c call int_from_cart1(.false.)
443 C Compute the side-chain and electrostatic interaction energy
445 goto (101,102,103,104,105,106) ipot
446 C Lennard-Jones potential.
447 101 call elj_short(evdw)
448 cd print '(a)','Exit ELJ'
450 C Lennard-Jones-Kihara potential (shifted).
451 102 call eljk_short(evdw)
453 C Berne-Pechukas potential (dilated LJ, angular dependence).
454 103 call ebp_short(evdw)
456 C Gay-Berne potential (shifted LJ, angular dependence).
457 104 call egb_short(evdw)
459 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
460 105 call egbv_short(evdw)
462 C Soft-sphere potential - already dealt with in the long-range part
464 c 106 call e_softsphere_short(evdw)
466 C Calculate electrostatic (H-bonding) energy of the main chain.
470 c Calculate the short-range part of Evdwpp
472 call evdwpp_short(evdw1)
474 c Calculate the short-range part of ESCp
477 call escp_short(evdw2,evdw2_14)
480 c Calculate the bond-stretching energy
484 C Calculate the disulfide-bridge and other energy and the contributions
485 C from other distance constraints.
488 C Calculate the virtual-bond-angle energy.
490 if (wang.gt.0d0) then
491 if (tor_mode.eq.0) then
494 C ebend kcc is Kubo cumulant clustered rigorous attemp to derive the
502 if (with_theta_constr) call etheta_constr(ethetacnstr)
504 C Calculate the SC local energy.
509 C Calculate the virtual-bond torsional energy.
511 if (wtor.gt.0.0d0) then
512 if (tor_mode.eq.0) then
515 C etor kcc is Kubo cumulant clustered rigorous attemp to derive the
524 if (wliptran.gt.0) then
525 call Eliptransfer(eliptran)
530 if (ndih_constr.gt.0) call etor_constr(edihcnstr)
531 c print *,"Processor",myrank," computed Utor"
533 C 6/23/01 Calculate double-torsional energy
535 if ((wtor_d.gt.0.0d0).and.(tor_mode.eq.0)) then
541 c Homology restraints
543 if (constr_homology.ge.1) then
544 call e_modeller(ehomology_constr)
546 ehomology_constr=0.0d0
549 C BARTEK for dfa test!
550 if (wdfa_dist.gt.0) then
555 c print*, 'edfad is finished!', edfadis
556 if (wdfa_tor.gt.0) then
561 c print*, 'edfat is finished!', edfator
562 if (wdfa_nei.gt.0) then
567 c print*, 'edfan is finished!', edfanei
568 if (wdfa_beta.gt.0) then
573 c print*, 'edfab is finished!', edfabet
576 C 21/5/07 Calculate local sicdechain correlation energy
578 if (wsccor.gt.0.0d0) then
579 call eback_sc_corr(esccor)
583 c write (iout,*) "nsaxs",nsaxs," saxs_mode",saxs_mode
584 if (nsaxs.gt.0 .and. saxs_mode.eq.0) then
585 call e_saxs(Esaxs_constr)
586 c write (iout,*) "From Esaxs: Esaxs_constr",Esaxs_constr
587 else if (nsaxs.gt.0 .and. saxs_mode.gt.0) then
588 call e_saxsC(Esaxs_constr)
589 c write (iout,*) "From EsaxsC: Esaxs_constr",Esaxs_constr
594 C Put energy components into an array
601 energia(2)=evdw2-evdw2_14
618 energia(8)=eello_turn3
619 energia(9)=eello_turn4
627 energia(19)=edihcnstr
630 energia(24)=ethetacnstr
632 energia(26)=Esaxs_constr
633 energia(27)=ehomology_constr
638 c write (iout,*) "ETOTAL_SHORT before SUM_ENERGY"
640 call sum_energy(energia,.true.)
641 c write (iout,*) "Exit ETOTAL_SHORT"