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'
27 include 'COMMON.HOMOLOGY'
28 include 'COMMON.QRESTR'
29 include 'COMMON.CONTROL'
30 c write(iout,'(a,i2)')'Calling etotal_long ipot=',ipot
37 if (modecalc.eq.12.or.modecalc.eq.14) then
39 c if (fg_rank.eq.0) call int_from_cart1(.false.)
41 call int_from_cart1(.false.)
45 c write(iout,*) "ETOTAL_LONG Processor",fg_rank,
46 c & " absolute rank",myrank," nfgtasks",nfgtasks
48 if (nfgtasks.gt.1) then
50 C FG slaves call the following matching MPI_Bcast in ERGASTULUM
51 if (fg_rank.eq.0) then
52 call MPI_Bcast(3,1,MPI_INTEGER,king,FG_COMM,IERROR)
53 c write (iout,*) "Processor",myrank," BROADCAST iorder"
55 C FG master sets up the WEIGHTS_ array which will be broadcast to the
56 C FG slaves as WEIGHTS array.
77 C FG Master broadcasts the WEIGHTS_ array
78 call MPI_Bcast(weights_(1),n_ene,
79 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
81 C FG slaves receive the WEIGHTS array
82 call MPI_Bcast(weights(1),n_ene,
83 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
105 call MPI_Bcast(dc(1,1),6*nres,MPI_DOUBLE_PRECISION,
107 time_Bcast=time_Bcast+MPI_Wtime()-time00
108 time_Bcastw=time_Bcastw+MPI_Wtime()-time00
109 c call chainbuild_cart
110 c call int_from_cart1(.false.)
112 c write (iout,*) 'Processor',myrank,
113 c & ' calling etotal_short ipot=',ipot
115 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
117 cd print *,'nnt=',nnt,' nct=',nct
119 C Compute the side-chain and electrostatic interaction energy
121 goto (101,102,103,104,105,106) ipot
122 C Lennard-Jones potential.
123 101 call elj_long(evdw)
124 cd print '(a)','Exit ELJ'
126 C Lennard-Jones-Kihara potential (shifted).
127 102 call eljk_long(evdw)
129 C Berne-Pechukas potential (dilated LJ, angular dependence).
130 103 call ebp_long(evdw)
132 C Gay-Berne potential (shifted LJ, angular dependence).
133 104 call egb_long(evdw)
135 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
136 105 call egbv_long(evdw)
138 C Soft-sphere potential
139 106 call e_softsphere(evdw)
141 C Calculate electrostatic (H-bonding) energy of the main chain.
145 C BARTEK for dfa test!
146 if (wdfa_dist.gt.0) then
151 c print*, 'edfad is finished!', edfadis
152 if (wdfa_tor.gt.0) then
157 c print*, 'edfat is finished!', edfator
158 if (wdfa_nei.gt.0) then
163 c print*, 'edfan is finished!', edfanei
164 if (wdfa_beta.gt.0) then
169 c print*, 'edfab is finished!', edfabet
172 c write (iout,*) "etotal_long: shield_mode",shield_mode
173 if (shield_mode.eq.1) then
175 else if (shield_mode.eq.2) then
181 if (welec.gt.0d0.or.wvdwpp.gt.0d0.or.wel_loc.gt.0d0.or.
182 & wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
183 & .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
184 & .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
186 if (welec.gt.0d0.or.wel_loc.gt.0d0.or.
187 & wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
188 & .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
189 & .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
191 call eelec_scale(ees,evdw1,eel_loc,eello_turn3,eello_turn4)
200 c write (iout,*) "Soft-spheer ELEC potential"
201 call eelec_soft_sphere(ees,evdw1,eel_loc,eello_turn3,
205 C Calculate excluded-volume interaction energy between peptide groups
210 call escp_long(evdw2,evdw2_14)
216 call escp_soft_sphere(evdw2,evdw2_14)
219 C 12/1/95 Multi-body terms
223 if ((wcorr4.gt.0.0d0 .or. wcorr5.gt.0.0d0 .or. wcorr6.gt.0.0d0
224 & .or. wturn6.gt.0.0d0) .and. ipot.lt.6) then
225 call multibody_eello(ecorr,ecorr5,ecorr6,eturn6,n_corr,n_corr1)
226 c write (2,*) 'n_corr=',n_corr,' n_corr1=',n_corr1,
227 c &" ecorr",ecorr," ecorr5",ecorr5," ecorr6",ecorr6," eturn6",eturn6
234 if ((wcorr4.eq.0.0d0 .and. wcorr.gt.0.0d0) .and. ipot.lt.6) then
235 call multibody_hb(ecorr,ecorr5,ecorr6,n_corr,n_corr1)
238 C If performing constraint dynamics, call the constraint energy
239 C after the equilibration time
240 if(usampl.and.totT.gt.eq_time) then
243 call Econstr_back_qlike
259 energia(2)=evdw2-evdw2_14
276 energia(8)=eello_turn3
277 energia(9)=eello_turn4
279 energia(20)=Uconst+Uconst_back
280 energia(27)=ehomology_constr
285 call sum_energy(energia,.true.)
286 c write (iout,*) "Exit ETOTAL_LONG"
290 c------------------------------------------------------------------------------
291 subroutine etotal_short(energia)
292 implicit real*8 (a-h,o-z)
295 c Compute the short-range fast-varying contributions to the energy
300 cMS$ATTRIBUTES C :: proc_proc
305 double precision weights_(n_ene)
307 include 'COMMON.SETUP'
308 include 'COMMON.IOUNITS'
309 double precision energia(0:n_ene)
310 include 'COMMON.FFIELD'
311 include 'COMMON.DERIV'
312 include 'COMMON.INTERACT'
313 include 'COMMON.SBRIDGE'
314 include 'COMMON.CHAIN'
316 include 'COMMON.LOCAL'
317 include 'COMMON.CONTROL'
318 include 'COMMON.TORCNSTR'
320 c write(iout,'(a,i2)')'Calling etotal_short ipot=',ipot
322 if (modecalc.eq.12.or.modecalc.eq.14) then
324 if (fg_rank.eq.0) call int_from_cart1(.false.)
326 call int_from_cart1(.false.)
330 c write(iout,*) "ETOTAL_SHORT Processor",fg_rank,
331 c & " absolute rank",myrank," nfgtasks",nfgtasks
333 if (nfgtasks.gt.1) then
335 C FG slaves call the following matching MPI_Bcast in ERGASTULUM
336 if (fg_rank.eq.0) then
337 call MPI_Bcast(2,1,MPI_INTEGER,king,FG_COMM,IERROR)
338 c write (iout,*) "Processor",myrank," BROADCAST iorder"
340 C FG master sets up the WEIGHTS_ array which will be broadcast to the
341 C FG slaves as WEIGHTS array.
362 C FG Master broadcasts the WEIGHTS_ array
363 call MPI_Bcast(weights_(1),n_ene,
364 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
366 C FG slaves receive the WEIGHTS array
367 call MPI_Bcast(weights(1),n_ene,
368 & MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
390 c write (iout,*),"Processor",myrank," BROADCAST weights"
391 call MPI_Bcast(c(1,1),maxres6,MPI_DOUBLE_PRECISION,
393 c write (iout,*) "Processor",myrank," BROADCAST c"
394 call MPI_Bcast(dc(1,1),maxres6,MPI_DOUBLE_PRECISION,
396 c write (iout,*) "Processor",myrank," BROADCAST dc"
397 call MPI_Bcast(dc_norm(1,1),maxres6,MPI_DOUBLE_PRECISION,
399 c write (iout,*) "Processor",myrank," BROADCAST dc_norm"
400 call MPI_Bcast(theta(1),nres,MPI_DOUBLE_PRECISION,
402 c write (iout,*) "Processor",myrank," BROADCAST theta"
403 call MPI_Bcast(phi(1),nres,MPI_DOUBLE_PRECISION,
405 c write (iout,*) "Processor",myrank," BROADCAST phi"
406 call MPI_Bcast(alph(1),nres,MPI_DOUBLE_PRECISION,
408 c write (iout,*) "Processor",myrank," BROADCAST alph"
409 call MPI_Bcast(omeg(1),nres,MPI_DOUBLE_PRECISION,
411 c write (iout,*) "Processor",myrank," BROADCAST omeg"
412 call MPI_Bcast(vbld(1),2*nres,MPI_DOUBLE_PRECISION,
414 c write (iout,*) "Processor",myrank," BROADCAST vbld"
415 call MPI_Bcast(vbld_inv(1),2*nres,MPI_DOUBLE_PRECISION,
417 time_Bcast=time_Bcast+MPI_Wtime()-time00
418 c write (iout,*) "Processor",myrank," BROADCAST vbld_inv"
420 c write (iout,*) 'Processor',myrank,
421 c & ' calling etotal_short ipot=',ipot
423 c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
425 c call int_from_cart1(.false.)
427 C Compute the side-chain and electrostatic interaction energy
429 goto (101,102,103,104,105,106) ipot
430 C Lennard-Jones potential.
431 101 call elj_short(evdw)
432 cd print '(a)','Exit ELJ'
434 C Lennard-Jones-Kihara potential (shifted).
435 102 call eljk_short(evdw)
437 C Berne-Pechukas potential (dilated LJ, angular dependence).
438 103 call ebp_short(evdw)
440 C Gay-Berne potential (shifted LJ, angular dependence).
441 104 call egb_short(evdw)
443 C Gay-Berne-Vorobjev potential (shifted LJ, angular dependence).
444 105 call egbv_short(evdw)
446 C Soft-sphere potential - already dealt with in the long-range part
448 c 106 call e_softsphere_short(evdw)
450 C Calculate electrostatic (H-bonding) energy of the main chain.
454 c Calculate the short-range part of Evdwpp
456 call evdwpp_short(evdw1)
458 c Calculate the short-range part of ESCp
461 call escp_short(evdw2,evdw2_14)
464 c Calculate the bond-stretching energy
468 C Calculate the disulfide-bridge and other energy and the contributions
469 C from other distance constraints.
472 C Calculate the virtual-bond-angle energy.
474 if (wang.gt.0d0) then
475 if (tor_mode.eq.0) then
478 C ebend kcc is Kubo cumulant clustered rigorous attemp to derive the
486 if (with_theta_constr) call etheta_constr(ethetacnstr)
488 C Calculate the SC local energy.
493 C Calculate the virtual-bond torsional energy.
495 if (wtor.gt.0.0d0) then
496 if (tor_mode.eq.0) then
499 C etor kcc is Kubo cumulant clustered rigorous attemp to derive the
507 if (ndih_constr.gt.0) call etor_constr(edihcnstr)
508 c print *,"Processor",myrank," computed Utor"
510 C 6/23/01 Calculate double-torsional energy
512 if ((wtor_d.gt.0.0d0).and.(tor_mode.eq.0)) then
518 C 21/5/07 Calculate local sicdechain correlation energy
520 if (wsccor.gt.0.0d0) then
521 call eback_sc_corr(esccor)
525 c write (iout,*) "nsaxs",nsaxs," saxs_mode",saxs_mode
526 if (nsaxs.gt.0 .and. saxs_mode.eq.0) then
527 call e_saxs(Esaxs_constr)
528 c write (iout,*) "From Esaxs: Esaxs_constr",Esaxs_constr
529 else if (nsaxs.gt.0 .and. saxs_mode.gt.0) then
530 call e_saxsC(Esaxs_constr)
531 c write (iout,*) "From EsaxsC: Esaxs_constr",Esaxs_constr
536 C Put energy components into an array
543 energia(2)=evdw2-evdw2_14
560 energia(8)=eello_turn3
561 energia(9)=eello_turn4
569 energia(19)=edihcnstr
571 energia(24)=ethetacnstr
572 energia(26)=Esaxs_constr
573 c write (iout,*) "ETOTAL_SHORT before SUM_ENERGY"
575 call sum_energy(energia,.true.)
576 c write (iout,*) "Exit ETOTAL_SHORT"