endif
c write (iout,*) 'Processor',myrank,
c & ' calling etotal_short ipot=',ipot
- call flush(iout)
+c call flush(iout)
c print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
#endif
c call int_from_cart1(.false.)
C
C Calculate the virtual-bond-angle energy.
C
- call ebend(ebe)
+ if (wang.gt.0d0) then
+ if (tor_mode.eq.0) then
+ call ebend(ebe)
+ else
+C ebend kcc is Kubo cumulant clustered rigorous attemp to derive the
+C energy function
+ call ebend_kcc(ebe)
+ endif
+ else
+ ebe=0.0d0
+ endif
+ ethetacnstr=0.0d0
+ if (with_theta_constr) call etheta_constr(ethetacnstr)
C
C Calculate the SC local energy.
C
C
C Calculate the virtual-bond torsional energy.
C
- call etor(etors,edihcnstr)
+ if (wtor.gt.0.0d0) then
+ if (tor_mode.eq.0) then
+ call etor(etors)
+ else
+C etor kcc is Kubo cumulant clustered rigorous attemp to derive the
+C energy function
+ call etor_kcc(etors)
+ endif
+ else
+ etors=0.0d0
+ endif
+ edihcnstr=0.0d0
+ if (ndih_constr.gt.0) call etor_constr(edihcnstr)
+c print *,"Processor",myrank," computed Utor"
C
C 6/23/01 Calculate double-torsional energy
C
- call etor_d(etors_d)
+ if ((wtor_d.gt.0.0d0).and.(tor_mode.eq.0)) then
+ call etor_d(etors_d)
+ else
+ etors_d=0
+ endif
+
do i=1,n_ene
energia(i)=0.0d0
enddo