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.)
51 ehomology_constr=0.0d0
54 c write(iout,*) "ETOTAL_LONG Processor",fg_rank,
55 c & " absolute rank",myrank," nfgtasks",nfgtasks
57 if (nfgtasks.gt.1) then
59 C FG slaves call the following matching MPI_Bcast in ERGASTULUM
60 if (fg_rank.eq.0) then
61 call MPI_Bcast(3,1,MPI_INTEGER,king,FG_COMM,IERROR)
62 c write (iout,*) "Processor",myrank," BROADCAST iorder"
64 C FG master sets up the WEIGHTS_ array which will be broadcast to the
65 C FG slaves as WEIGHTS array.
88 weights_(28)=wdfa_dist
91 weights_(31)=wdfa_beta
92 C FG Master broadcasts the WEIGHTS_ array
93 call MPI_Bcast(weights_(1),n_ene,
94 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
96 C FG slaves receive the WEIGHTS array
97 call MPI_Bcast(weights(1),n_ene,
98 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
121 wdfa_dist=weights(28)
124 wdfa_beta=weights(31)
126 call MPI_Bcast(dc(1,1),6*nres,MPI_DOUBLE_PRECISION,
128 time_Bcast=time_Bcast+MPI_Wtime()-time00
129 time_Bcastw=time_Bcastw+MPI_Wtime()-time00
130 c call chainbuild_cart
131 c call int_from_cart1(.false.)
133 c write (iout,*) 'Processor',myrank,
134 c & ' calling etotal_short ipot=',ipot
136 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
137 if (nfgtasks.gt.1) then
138 call MPI_Bcast(itime_mat,1,MPI_INT,king,FG_COMM,IERROR)
140 if (mod(itime_mat,imatupdate).eq.0) then
141 call make_SCp_inter_list
142 call make_SCSC_inter_list
143 call make_pp_inter_list
144 call make_pp_vdw_inter_list
147 cd print *,'nnt=',nnt,' nct=',nct
149 C Compute the side-chain and electrostatic interaction energy
151 goto (101,102,103,104,105,106) ipot
152 C Lennard-Jones potential.
153 101 call elj_long(evdw)
154 cd print '(a)','Exit ELJ'
156 C Lennard-Jones-Kihara potential (shifted).
157 102 call eljk_long(evdw)
159 C Berne-Pechukas potential (dilated LJ, angular dependence).
160 103 call ebp_long(evdw)
162 C Gay-Berne potential (shifted LJ, angular dependence).
163 104 call egb_long(evdw)
165 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
166 105 call egbv_long(evdw)
168 C Soft-sphere potential
169 106 call e_softsphere(evdw)
171 C Calculate electrostatic (H-bonding) energy of the main chain.
175 c write (iout,*) "etotal_long: shield_mode",shield_mode
176 if (shield_mode.eq.1) then
178 else if (shield_mode.eq.2) then
184 if (welec.gt.0d0.or.wvdwpp.gt.0d0.or.wel_loc.gt.0d0.or.
185 & wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
186 & .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
187 & .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
189 if (welec.gt.0d0.or.wel_loc.gt.0d0.or.
190 & wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
191 & .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
192 & .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
194 call eelec_scale(ees,evdw1,eel_loc,eello_turn3,eello_turn4)
203 c write (iout,*) "Soft-spheer ELEC potential"
204 call eelec_soft_sphere(ees,evdw1,eel_loc,eello_turn3,
208 C Calculate excluded-volume interaction energy between peptide groups
213 call escp_long(evdw2,evdw2_14)
219 call escp_soft_sphere(evdw2,evdw2_14)
223 C 12/1/95 Multi-body terms
227 if ((wcorr4.gt.0.0d0 .or. wcorr5.gt.0.0d0 .or. wcorr6.gt.0.0d0
228 & .or. wturn6.gt.0.0d0) .and. ipot.lt.6) then
229 call multibody_eello(ecorr,ecorr5,ecorr6,eturn6,n_corr,n_corr1)
230 c write (2,*) 'n_corr=',n_corr,' n_corr1=',n_corr1,
231 c &" ecorr",ecorr," ecorr5",ecorr5," ecorr6",ecorr6," eturn6",eturn6
238 if ((wcorr4.eq.0.0d0 .and. wcorr.gt.0.0d0) .and. ipot.lt.6) then
239 call multibody_hb(ecorr,ecorr5,ecorr6,n_corr,n_corr1)
253 C If performing constraint dynamics, call the constraint energy
254 C after the equilibration time
255 if(usampl.and.totT.gt.eq_time) then
258 call Econstr_back_qlike
274 energia(2)=evdw2-evdw2_14
291 energia(8)=eello_turn3
292 energia(9)=eello_turn4
294 energia(20)=Uconst+Uconst_back
295 energia(27)=ehomology_constr
300 call sum_energy(energia,.true.)
301 c write (iout,*) "Exit ETOTAL_LONG"
305 c------------------------------------------------------------------------------
306 subroutine etotal_short(energia)
307 implicit real*8 (a-h,o-z)
310 c Compute the short-range fast-varying contributions to the energy
315 cMS$ATTRIBUTES C :: proc_proc
320 double precision weights_(n_ene)
321 double precision time00
324 include 'COMMON.SETUP'
325 include 'COMMON.IOUNITS'
326 double precision energia(0:n_ene)
327 include 'COMMON.FFIELD'
328 include 'COMMON.DERIV'
329 include 'COMMON.INTERACT'
330 include 'COMMON.SBRIDGE'
331 include 'COMMON.CHAIN'
333 include 'COMMON.LOCAL'
334 include 'COMMON.CONTROL'
335 include 'COMMON.SAXS'
336 include 'COMMON.TORCNSTR'
337 double precision evdw,evdw1,evdw2,evdw2_14,ees,eel_loc,
338 & eello_turn3,eello_turn4,edfadis,estr,ehpb,ebe,ethetacnstr,
339 & escloc,etors,edihcnstr,etors_d,esccor,ecorr,ecorr5,ecorr6,eturn6,
340 & eliptran,Eafmforce,Etube,
341 & esaxs_constr,ehomology_constr,edfator,edfanei,edfabet
342 integer i,n_corr,n_corr1
343 c write(iout,'(a,i2)')'Calling etotal_short ipot=',ipot
345 if (modecalc.eq.12.or.modecalc.eq.14) then
347 if (fg_rank.eq.0) call int_from_cart1(.false.)
349 call int_from_cart1(.false.)
371 c write(iout,*) "ETOTAL_SHORT Processor",fg_rank,
372 c & " absolute rank",myrank," nfgtasks",nfgtasks
374 if (nfgtasks.gt.1) then
376 C FG slaves call the following matching MPI_Bcast in ERGASTULUM
377 if (fg_rank.eq.0) then
378 call MPI_Bcast(2,1,MPI_INTEGER,king,FG_COMM,IERROR)
379 c write (iout,*) "Processor",myrank," BROADCAST iorder"
381 C FG master sets up the WEIGHTS_ array which will be broadcast to the
382 C FG slaves as WEIGHTS array.
403 weights_(29)=wdfa_tor
404 weights_(30)=wdfa_nei
405 weights_(31)=wdfa_beta
406 C FG Master broadcasts the WEIGHTS_ array
407 call MPI_Bcast(weights_(1),n_ene,
408 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
410 C FG slaves receive the WEIGHTS array
411 call MPI_Bcast(weights(1),n_ene,
412 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
434 c write (iout,*),"Processor",myrank," BROADCAST weights"
435 call MPI_Bcast(c(1,1),maxres6,MPI_DOUBLE_PRECISION,
437 c write (iout,*) "Processor",myrank," BROADCAST c"
438 call MPI_Bcast(dc(1,1),maxres6,MPI_DOUBLE_PRECISION,
440 c write (iout,*) "Processor",myrank," BROADCAST dc"
441 call MPI_Bcast(dc_norm(1,1),maxres6,MPI_DOUBLE_PRECISION,
443 c write (iout,*) "Processor",myrank," BROADCAST dc_norm"
444 call MPI_Bcast(theta(1),nres,MPI_DOUBLE_PRECISION,
446 c write (iout,*) "Processor",myrank," BROADCAST theta"
447 call MPI_Bcast(phi(1),nres,MPI_DOUBLE_PRECISION,
449 c write (iout,*) "Processor",myrank," BROADCAST phi"
450 call MPI_Bcast(alph(1),nres,MPI_DOUBLE_PRECISION,
452 c write (iout,*) "Processor",myrank," BROADCAST alph"
453 call MPI_Bcast(omeg(1),nres,MPI_DOUBLE_PRECISION,
455 c write (iout,*) "Processor",myrank," BROADCAST omeg"
456 call MPI_Bcast(vbld(1),2*nres,MPI_DOUBLE_PRECISION,
458 c write (iout,*) "Processor",myrank," BROADCAST vbld"
459 call MPI_Bcast(vbld_inv(1),2*nres,MPI_DOUBLE_PRECISION,
461 time_Bcast=time_Bcast+MPI_Wtime()-time00
462 c write (iout,*) "Processor",myrank," BROADCAST vbld_inv"
464 c write (iout,*) 'Processor',myrank,
465 c & ' calling etotal_short ipot=',ipot
467 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
469 c call int_from_cart1(.false.)
471 C Compute the side-chain and electrostatic interaction energy
473 goto (101,102,103,104,105,106) ipot
474 C Lennard-Jones potential.
475 101 call elj_short(evdw)
476 cd print '(a)','Exit ELJ'
478 C Lennard-Jones-Kihara potential (shifted).
479 102 call eljk_short(evdw)
481 C Berne-Pechukas potential (dilated LJ, angular dependence).
482 103 call ebp_short(evdw)
484 C Gay-Berne potential (shifted LJ, angular dependence).
485 104 call egb_short(evdw)
487 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
488 105 call egbv_short(evdw)
490 C Soft-sphere potential - already dealt with in the long-range part
492 c 106 call e_softsphere_short(evdw)
494 C Calculate electrostatic (H-bonding) energy of the main chain.
498 c Calculate the short-range part of Evdwpp
500 call evdwpp_short(evdw1)
502 c Calculate the short-range part of ESCp
505 call escp_short(evdw2,evdw2_14)
508 c Calculate the bond-stretching energy
512 C Calculate the disulfide-bridge and other energy and the contributions
513 C from other distance constraints.
516 C Calculate the virtual-bond-angle energy.
518 if (wang.gt.0d0) then
519 if (tor_mode.eq.0) then
522 C ebend kcc is Kubo cumulant clustered rigorous attemp to derive the
530 if (with_theta_constr) call etheta_constr(ethetacnstr)
532 C Calculate the SC local energy.
537 C Calculate the virtual-bond torsional energy.
539 if (wtor.gt.0.0d0) then
540 if (tor_mode.eq.0) then
543 C etor kcc is Kubo cumulant clustered rigorous attemp to derive the
552 if (wliptran.gt.0) then
553 call Eliptransfer(eliptran)
557 if (AFMlog.gt.0) then
558 call AFMforce(Eafmforce)
559 else if (selfguide.gt.0) then
560 call AFMvel(Eafmforce)
564 if (TUBElog.eq.1) then
565 C print *,"just before call"
567 elseif (TUBElog.eq.2) then
568 call calctube2(Etube)
573 if (ndih_constr.gt.0) call etor_constr(edihcnstr)
574 c print *,"Processor",myrank," computed Utor"
576 C 6/23/01 Calculate double-torsional energy
578 if ((wtor_d.gt.0.0d0).and.(tor_mode.eq.0)) then
584 c Homology restraints
586 if (constr_homology.ge.1) then
587 call e_modeller(ehomology_constr)
589 ehomology_constr=0.0d0
592 C BARTEK for dfa test!
593 if (wdfa_dist.gt.0) then
598 c print*, 'edfad is finished!', edfadis
599 if (wdfa_tor.gt.0) then
604 c print*, 'edfat is finished!', edfator
605 if (wdfa_nei.gt.0) then
610 c print*, 'edfan is finished!', edfanei
611 if (wdfa_beta.gt.0) then
616 c print*, 'edfab is finished!', edfabet
619 C 21/5/07 Calculate local sicdechain correlation energy
621 if (wsccor.gt.0.0d0) then
622 call eback_sc_corr(esccor)
626 c write (iout,*) "nsaxs",nsaxs," saxs_mode",saxs_mode
627 if (nsaxs.gt.0 .and. saxs_mode.eq.0) then
628 call e_saxs(Esaxs_constr)
629 c write (iout,*) "From Esaxs: Esaxs_constr",Esaxs_constr
630 else if (nsaxs.gt.0 .and. saxs_mode.gt.0) then
631 call e_saxsC(Esaxs_constr)
632 c write (iout,*) "From EsaxsC: Esaxs_constr",Esaxs_constr
637 C Put energy components into an array
644 energia(2)=evdw2-evdw2_14
661 energia(8)=eello_turn3
662 energia(9)=eello_turn4
670 energia(19)=edihcnstr
673 energia(24)=ethetacnstr
675 energia(26)=Esaxs_constr
676 energia(27)=ehomology_constr
681 c write (iout,*) "ETOTAL_SHORT before SUM_ENERGY"
683 call sum_energy(energia,.true.)
684 c write (iout,*) "Exit ETOTAL_SHORT"