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'
28 include 'COMMON.CONTROL'
29 c write(iout,'(a,i2)')'Calling etotal_long ipot=',ipot
36 if (modecalc.eq.12.or.modecalc.eq.14) then
38 c if (fg_rank.eq.0) call int_from_cart1(.false.)
40 call int_from_cart1(.false.)
44 c write(iout,*) "ETOTAL_LONG Processor",fg_rank,
45 c & " absolute rank",myrank," nfgtasks",nfgtasks
47 if (nfgtasks.gt.1) then
49 C FG slaves call the following matching MPI_Bcast in ERGASTULUM
50 if (fg_rank.eq.0) then
51 call MPI_Bcast(3,1,MPI_INTEGER,king,FG_COMM,IERROR)
52 c write (iout,*) "Processor",myrank," BROADCAST iorder"
54 C FG master sets up the WEIGHTS_ array which will be broadcast to the
55 C FG slaves as WEIGHTS array.
76 C FG Master broadcasts the WEIGHTS_ array
77 call MPI_Bcast(weights_(1),n_ene,
78 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
80 C FG slaves receive the WEIGHTS array
81 call MPI_Bcast(weights(1),n_ene,
82 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
104 call MPI_Bcast(dc(1,1),6*nres,MPI_DOUBLE_PRECISION,
106 time_Bcast=time_Bcast+MPI_Wtime()-time00
107 time_Bcastw=time_Bcastw+MPI_Wtime()-time00
108 c call chainbuild_cart
109 c call int_from_cart1(.false.)
111 c write (iout,*) 'Processor',myrank,
112 c & ' calling etotal_short ipot=',ipot
114 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
116 cd print *,'nnt=',nnt,' nct=',nct
118 C Compute the side-chain and electrostatic interaction energy
120 goto (101,102,103,104,105,106) ipot
121 C Lennard-Jones potential.
122 101 call elj_long(evdw)
123 cd print '(a)','Exit ELJ'
125 C Lennard-Jones-Kihara potential (shifted).
126 102 call eljk_long(evdw)
128 C Berne-Pechukas potential (dilated LJ, angular dependence).
129 103 call ebp_long(evdw)
131 C Gay-Berne potential (shifted LJ, angular dependence).
132 104 call egb_long(evdw)
134 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
135 105 call egbv_long(evdw)
137 C Soft-sphere potential
138 106 call e_softsphere(evdw)
140 C Calculate electrostatic (H-bonding) energy of the main chain.
144 C BARTEK for dfa test!
145 if (wdfa_dist.gt.0) then
150 c print*, 'edfad is finished!', edfadis
151 if (wdfa_tor.gt.0) then
156 c print*, 'edfat is finished!', edfator
157 if (wdfa_nei.gt.0) then
162 c print*, 'edfan is finished!', edfanei
163 if (wdfa_beta.gt.0) then
168 c print*, 'edfab is finished!', edfabet
171 c write (iout,*) "etotal_long: shield_mode",shield_mode
172 if (shield_mode.eq.1) then
174 else if (shield_mode.eq.2) then
180 if (welec.gt.0d0.or.wvdwpp.gt.0d0.or.wel_loc.gt.0d0.or.
181 & wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
182 & .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
183 & .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
185 if (welec.gt.0d0.or.wel_loc.gt.0d0.or.
186 & wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
187 & .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
188 & .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
190 call eelec_scale(ees,evdw1,eel_loc,eello_turn3,eello_turn4)
199 c write (iout,*) "Soft-spheer ELEC potential"
200 call eelec_soft_sphere(ees,evdw1,eel_loc,eello_turn3,
204 C Calculate excluded-volume interaction energy between peptide groups
209 call escp_long(evdw2,evdw2_14)
215 call escp_soft_sphere(evdw2,evdw2_14)
218 C 12/1/95 Multi-body terms
222 if ((wcorr4.gt.0.0d0 .or. wcorr5.gt.0.0d0 .or. wcorr6.gt.0.0d0
223 & .or. wturn6.gt.0.0d0) .and. ipot.lt.6) then
224 call multibody_eello(ecorr,ecorr5,ecorr6,eturn6,n_corr,n_corr1)
225 c write (2,*) 'n_corr=',n_corr,' n_corr1=',n_corr1,
226 c &" ecorr",ecorr," ecorr5",ecorr5," ecorr6",ecorr6," eturn6",eturn6
233 if ((wcorr4.eq.0.0d0 .and. wcorr.gt.0.0d0) .and. ipot.lt.6) then
234 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)
306 include 'COMMON.SETUP'
307 include 'COMMON.IOUNITS'
308 double precision energia(0:n_ene)
309 include 'COMMON.FFIELD'
310 include 'COMMON.DERIV'
311 include 'COMMON.INTERACT'
312 include 'COMMON.SBRIDGE'
313 include 'COMMON.CHAIN'
315 include 'COMMON.LOCAL'
316 include 'COMMON.CONTROL'
317 include 'COMMON.TORCNSTR'
319 c write(iout,'(a,i2)')'Calling etotal_short ipot=',ipot
321 if (modecalc.eq.12.or.modecalc.eq.14) then
323 if (fg_rank.eq.0) call int_from_cart1(.false.)
325 call int_from_cart1(.false.)
329 c write(iout,*) "ETOTAL_SHORT Processor",fg_rank,
330 c & " absolute rank",myrank," nfgtasks",nfgtasks
332 if (nfgtasks.gt.1) then
334 C FG slaves call the following matching MPI_Bcast in ERGASTULUM
335 if (fg_rank.eq.0) then
336 call MPI_Bcast(2,1,MPI_INTEGER,king,FG_COMM,IERROR)
337 c write (iout,*) "Processor",myrank," BROADCAST iorder"
339 C FG master sets up the WEIGHTS_ array which will be broadcast to the
340 C FG slaves as WEIGHTS array.
361 C FG Master broadcasts the WEIGHTS_ array
362 call MPI_Bcast(weights_(1),n_ene,
363 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
365 C FG slaves receive the WEIGHTS array
366 call MPI_Bcast(weights(1),n_ene,
367 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
389 c write (iout,*),"Processor",myrank," BROADCAST weights"
390 call MPI_Bcast(c(1,1),maxres6,MPI_DOUBLE_PRECISION,
392 c write (iout,*) "Processor",myrank," BROADCAST c"
393 call MPI_Bcast(dc(1,1),maxres6,MPI_DOUBLE_PRECISION,
395 c write (iout,*) "Processor",myrank," BROADCAST dc"
396 call MPI_Bcast(dc_norm(1,1),maxres6,MPI_DOUBLE_PRECISION,
398 c write (iout,*) "Processor",myrank," BROADCAST dc_norm"
399 call MPI_Bcast(theta(1),nres,MPI_DOUBLE_PRECISION,
401 c write (iout,*) "Processor",myrank," BROADCAST theta"
402 call MPI_Bcast(phi(1),nres,MPI_DOUBLE_PRECISION,
404 c write (iout,*) "Processor",myrank," BROADCAST phi"
405 call MPI_Bcast(alph(1),nres,MPI_DOUBLE_PRECISION,
407 c write (iout,*) "Processor",myrank," BROADCAST alph"
408 call MPI_Bcast(omeg(1),nres,MPI_DOUBLE_PRECISION,
410 c write (iout,*) "Processor",myrank," BROADCAST omeg"
411 call MPI_Bcast(vbld(1),2*nres,MPI_DOUBLE_PRECISION,
413 c write (iout,*) "Processor",myrank," BROADCAST vbld"
414 call MPI_Bcast(vbld_inv(1),2*nres,MPI_DOUBLE_PRECISION,
416 time_Bcast=time_Bcast+MPI_Wtime()-time00
417 c write (iout,*) "Processor",myrank," BROADCAST vbld_inv"
419 c write (iout,*) 'Processor',myrank,
420 c & ' calling etotal_short ipot=',ipot
422 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
424 c call int_from_cart1(.false.)
426 C Compute the side-chain and electrostatic interaction energy
428 goto (101,102,103,104,105,106) ipot
429 C Lennard-Jones potential.
430 101 call elj_short(evdw)
431 cd print '(a)','Exit ELJ'
433 C Lennard-Jones-Kihara potential (shifted).
434 102 call eljk_short(evdw)
436 C Berne-Pechukas potential (dilated LJ, angular dependence).
437 103 call ebp_short(evdw)
439 C Gay-Berne potential (shifted LJ, angular dependence).
440 104 call egb_short(evdw)
442 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
443 105 call egbv_short(evdw)
445 C Soft-sphere potential - already dealt with in the long-range part
447 c 106 call e_softsphere_short(evdw)
449 C Calculate electrostatic (H-bonding) energy of the main chain.
453 c Calculate the short-range part of Evdwpp
455 call evdwpp_short(evdw1)
457 c Calculate the short-range part of ESCp
460 call escp_short(evdw2,evdw2_14)
463 c Calculate the bond-stretching energy
467 C Calculate the disulfide-bridge and other energy and the contributions
468 C from other distance constraints.
471 C Calculate the virtual-bond-angle energy.
473 if (wang.gt.0d0) then
474 if (tor_mode.eq.0) then
477 C ebend kcc is Kubo cumulant clustered rigorous attemp to derive the
485 if (with_theta_constr) call etheta_constr(ethetacnstr)
487 C Calculate the SC local energy.
492 C Calculate the virtual-bond torsional energy.
494 if (wtor.gt.0.0d0) then
495 if (tor_mode.eq.0) then
498 C etor kcc is Kubo cumulant clustered rigorous attemp to derive the
506 if (ndih_constr.gt.0) call etor_constr(edihcnstr)
507 c print *,"Processor",myrank," computed Utor"
509 C 6/23/01 Calculate double-torsional energy
511 if ((wtor_d.gt.0.0d0).and.(tor_mode.eq.0)) then
517 C 21/5/07 Calculate local sicdechain correlation energy
519 if (wsccor.gt.0.0d0) then
520 call eback_sc_corr(esccor)
524 c write (iout,*) "nsaxs",nsaxs," saxs_mode",saxs_mode
525 if (nsaxs.gt.0 .and. saxs_mode.eq.0) then
526 call e_saxs(Esaxs_constr)
527 c write (iout,*) "From Esaxs: Esaxs_constr",Esaxs_constr
528 else if (nsaxs.gt.0 .and. saxs_mode.gt.0) then
529 call e_saxsC(Esaxs_constr)
530 c write (iout,*) "From EsaxsC: Esaxs_constr",Esaxs_constr
535 C Put energy components into an array
542 energia(2)=evdw2-evdw2_14
559 energia(8)=eello_turn3
560 energia(9)=eello_turn4
568 energia(19)=edihcnstr
570 energia(24)=ethetacnstr
571 energia(26)=Esaxs_constr
572 c write (iout,*) "ETOTAL_SHORT before SUM_ENERGY"
574 call sum_energy(energia,.true.)
575 c write (iout,*) "Exit ETOTAL_SHORT"