& +ft(2)*wturn3*eello_turn3
& +ft(5)*wturn6*eturn6+ft(2)*wel_loc*eel_loc
& +edihcnstr+ft(2)*wtor_d*etors_d+ft(1)*wsccor*esccor
- & +wbond*estr+ehomology_constr+wdfa_dist*edfadis
+ & +wbond*estr+wdfa_dist*edfadis
& +wdfa_tor*edfator+wdfa_nei*edfanei+wdfa_beta*edfabet
#else
etot=wsc*(evdw+ft(6)*evdw_t)+wscp*evdw2
& +ft(2)*wturn3*eello_turn3
& +ft(5)*wturn6*eturn6+ft(2)*wel_loc*eel_loc+edihcnstr
& +ft(2)*wtor_d*etors_d+ft(1)*wsccor*esccor
- & +wbond*estr+ehomology_constr+wdfa_dist*edfadis
+ & +wbond*estr+wdfa_dist*edfadis
& +wdfa_tor*edfator+wdfa_nei*edfanei+wdfa_beta*edfabet
#endif
#ifdef DEBUG
call enerprint(energia(0),fT)
endif
#endif
+#ifdef DEBUG
+ write (iout,*) "homol_nset",homol_nset,nR(ib,iparm)
+#endif
+ if (homol_nset.gt.1) then
+
+ do kk=1,nR(ib,iparm)
+ Econstr=waga_homology(kk)*ehomology_constr
+ v(i,kk,ib,iparm)=
+ & -beta_h(ib,iparm)*(etot+Econstr)
+#ifdef DEBUG
+ write (iout,'(4i5,4e15.5)') i,kk,ib,iparm,
+ & etot,Econstr,v(i,kk,ib,iparm)
+#endif
+ enddo ! kk
+
+ else
+
+ etot=etot+ehomology_constr
do kk=1,nR(ib,iparm)
Econstr=0.0d0
do j=1,nQ
& etot,v(i,kk,ib,iparm)
#endif
enddo ! kk
+
+ endif
enddo ! ib
enddo ! iparm
enddo ! i
esccor=enetb(19,i,iparm)
edihcnstr=enetb(20,i,iparm)
ehomology_constr=enetb(22,i,iparm)
+ if (homol_nset.gt.1)
+ & ehomology_constr=waga_homology(homol_nset)*ehomology_constr
edfadis=enetb(23,i,iparm)
edfator=enetb(24,i,iparm)
edfanei=enetb(25,i,iparm)
esccor=enetb(19,t,iparm)
edihcnstr=enetb(20,t,iparm)
ehomology_constr=enetb(22,t,iparm)
+ if (homol_nset.gt.1)
+ & ehomology_constr=waga_homology(homol_nset)*ehomology_constr
edfadis=enetb(23,t,iparm)
edfator=enetb(24,t,iparm)
edfanei=enetb(25,t,iparm)