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)
194 C 12/1/95 Multi-body terms
198 if ((wcorr4.gt.0.0d0 .or. wcorr5.gt.0.0d0 .or. wcorr6.gt.0.0d0
199 & .or. wturn6.gt.0.0d0) .and. ipot.lt.6) then
200 call multibody_eello(ecorr,ecorr5,ecorr6,eturn6,n_corr,n_corr1)
201 c write (2,*) 'n_corr=',n_corr,' n_corr1=',n_corr1,
202 c &" ecorr",ecorr," ecorr5",ecorr5," ecorr6",ecorr6," eturn6",eturn6
209 if ((wcorr4.eq.0.0d0 .and. wcorr.gt.0.0d0) .and. ipot.lt.6) then
210 call multibody_hb(ecorr,ecorr5,ecorr6,n_corr,n_corr1)
213 C If performing constraint dynamics, call the constraint energy
214 C after the equilibration time
215 if(usampl.and.totT.gt.eq_time) then
218 call Econstr_back_qlike
234 energia(2)=evdw2-evdw2_14
251 energia(8)=eello_turn3
252 energia(9)=eello_turn4
254 energia(20)=Uconst+Uconst_back
255 energia(27)=ehomology_constr
260 call sum_energy(energia,.true.)
261 c write (iout,*) "Exit ETOTAL_LONG"
265 c------------------------------------------------------------------------------
266 subroutine etotal_short(energia)
267 implicit real*8 (a-h,o-z)
270 c Compute the short-range fast-varying contributions to the energy
275 cMS$ATTRIBUTES C :: proc_proc
280 double precision weights_(n_ene)
281 double precision time00
284 include 'COMMON.SETUP'
285 include 'COMMON.IOUNITS'
286 double precision energia(0:n_ene)
287 include 'COMMON.FFIELD'
288 include 'COMMON.DERIV'
289 include 'COMMON.INTERACT'
290 include 'COMMON.SBRIDGE'
291 include 'COMMON.CHAIN'
293 include 'COMMON.LOCAL'
294 include 'COMMON.CONTROL'
295 include 'COMMON.SAXS'
296 include 'COMMON.TORCNSTR'
297 double precision evdw,evdw1,evdw2,evdw2_14,ees,eel_loc,
298 & eello_turn3,eello_turn4,edfadis,estr,ehpb,ebe,ethetacnstr,
299 & escloc,etors,edihcnstr,etors_d,esccor,ecorr,ecorr5,ecorr6,eturn6,
300 & eliptran,Eafmforce,Etube,
301 & esaxs_constr,ehomology_constr,edfator,edfanei,edfabet
302 integer i,n_corr,n_corr1
303 c write(iout,'(a,i2)')'Calling etotal_short ipot=',ipot
305 if (modecalc.eq.12.or.modecalc.eq.14) then
307 if (fg_rank.eq.0) call int_from_cart1(.false.)
309 call int_from_cart1(.false.)
319 c write(iout,*) "ETOTAL_SHORT Processor",fg_rank,
320 c & " absolute rank",myrank," nfgtasks",nfgtasks
322 if (nfgtasks.gt.1) then
324 C FG slaves call the following matching MPI_Bcast in ERGASTULUM
325 if (fg_rank.eq.0) then
326 call MPI_Bcast(2,1,MPI_INTEGER,king,FG_COMM,IERROR)
327 c write (iout,*) "Processor",myrank," BROADCAST iorder"
329 C FG master sets up the WEIGHTS_ array which will be broadcast to the
330 C FG slaves as WEIGHTS array.
351 weights_(29)=wdfa_tor
352 weights_(30)=wdfa_nei
353 weights_(31)=wdfa_beta
354 C FG Master broadcasts the WEIGHTS_ array
355 call MPI_Bcast(weights_(1),n_ene,
356 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
358 C FG slaves receive the WEIGHTS array
359 call MPI_Bcast(weights(1),n_ene,
360 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
382 c write (iout,*),"Processor",myrank," BROADCAST weights"
383 call MPI_Bcast(c(1,1),maxres6,MPI_DOUBLE_PRECISION,
385 c write (iout,*) "Processor",myrank," BROADCAST c"
386 call MPI_Bcast(dc(1,1),maxres6,MPI_DOUBLE_PRECISION,
388 c write (iout,*) "Processor",myrank," BROADCAST dc"
389 call MPI_Bcast(dc_norm(1,1),maxres6,MPI_DOUBLE_PRECISION,
391 c write (iout,*) "Processor",myrank," BROADCAST dc_norm"
392 call MPI_Bcast(theta(1),nres,MPI_DOUBLE_PRECISION,
394 c write (iout,*) "Processor",myrank," BROADCAST theta"
395 call MPI_Bcast(phi(1),nres,MPI_DOUBLE_PRECISION,
397 c write (iout,*) "Processor",myrank," BROADCAST phi"
398 call MPI_Bcast(alph(1),nres,MPI_DOUBLE_PRECISION,
400 c write (iout,*) "Processor",myrank," BROADCAST alph"
401 call MPI_Bcast(omeg(1),nres,MPI_DOUBLE_PRECISION,
403 c write (iout,*) "Processor",myrank," BROADCAST omeg"
404 call MPI_Bcast(vbld(1),2*nres,MPI_DOUBLE_PRECISION,
406 c write (iout,*) "Processor",myrank," BROADCAST vbld"
407 call MPI_Bcast(vbld_inv(1),2*nres,MPI_DOUBLE_PRECISION,
409 time_Bcast=time_Bcast+MPI_Wtime()-time00
410 c write (iout,*) "Processor",myrank," BROADCAST vbld_inv"
412 c write (iout,*) 'Processor',myrank,
413 c & ' calling etotal_short ipot=',ipot
415 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
417 c call int_from_cart1(.false.)
419 C Compute the side-chain and electrostatic interaction energy
421 goto (101,102,103,104,105,106) ipot
422 C Lennard-Jones potential.
423 101 call elj_short(evdw)
424 cd print '(a)','Exit ELJ'
426 C Lennard-Jones-Kihara potential (shifted).
427 102 call eljk_short(evdw)
429 C Berne-Pechukas potential (dilated LJ, angular dependence).
430 103 call ebp_short(evdw)
432 C Gay-Berne potential (shifted LJ, angular dependence).
433 104 call egb_short(evdw)
435 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
436 105 call egbv_short(evdw)
438 C Soft-sphere potential - already dealt with in the long-range part
440 c 106 call e_softsphere_short(evdw)
442 C Calculate electrostatic (H-bonding) energy of the main chain.
446 c Calculate the short-range part of Evdwpp
448 call evdwpp_short(evdw1)
450 c Calculate the short-range part of ESCp
453 call escp_short(evdw2,evdw2_14)
456 c Calculate the bond-stretching energy
460 C Calculate the disulfide-bridge and other energy and the contributions
461 C from other distance constraints.
464 C Calculate the virtual-bond-angle energy.
466 if (wang.gt.0d0) then
467 if (tor_mode.eq.0) then
470 C ebend kcc is Kubo cumulant clustered rigorous attemp to derive the
478 if (with_theta_constr) call etheta_constr(ethetacnstr)
480 C Calculate the SC local energy.
485 C Calculate the virtual-bond torsional energy.
487 if (wtor.gt.0.0d0) then
488 if (tor_mode.eq.0) then
491 C etor kcc is Kubo cumulant clustered rigorous attemp to derive the
499 if (ndih_constr.gt.0) call etor_constr(edihcnstr)
500 c print *,"Processor",myrank," computed Utor"
502 C 6/23/01 Calculate double-torsional energy
504 if ((wtor_d.gt.0.0d0).and.(tor_mode.eq.0)) then
510 c Homology restraints
512 if (constr_homology.ge.1) then
513 call e_modeller(ehomology_constr)
515 ehomology_constr=0.0d0
518 C BARTEK for dfa test!
519 if (wdfa_dist.gt.0) then
524 c print*, 'edfad is finished!', edfadis
525 if (wdfa_tor.gt.0) then
530 c print*, 'edfat is finished!', edfator
531 if (wdfa_nei.gt.0) then
536 c print*, 'edfan is finished!', edfanei
537 if (wdfa_beta.gt.0) then
542 c print*, 'edfab is finished!', edfabet
545 C 21/5/07 Calculate local sicdechain correlation energy
547 if (wsccor.gt.0.0d0) then
548 call eback_sc_corr(esccor)
552 c write (iout,*) "nsaxs",nsaxs," saxs_mode",saxs_mode
553 if (nsaxs.gt.0 .and. saxs_mode.eq.0) then
554 call e_saxs(Esaxs_constr)
555 c write (iout,*) "From Esaxs: Esaxs_constr",Esaxs_constr
556 else if (nsaxs.gt.0 .and. saxs_mode.gt.0) then
557 call e_saxsC(Esaxs_constr)
558 c write (iout,*) "From EsaxsC: Esaxs_constr",Esaxs_constr
563 C Put energy components into an array
570 energia(2)=evdw2-evdw2_14
587 energia(8)=eello_turn3
588 energia(9)=eello_turn4
596 energia(19)=edihcnstr
599 energia(24)=ethetacnstr
601 energia(26)=Esaxs_constr
602 energia(27)=ehomology_constr
607 c write (iout,*) "ETOTAL_SHORT before SUM_ENERGY"
609 call sum_energy(energia,.true.)
610 c write (iout,*) "Exit ETOTAL_SHORT"