subroutine sc_minimize(etot,iretcode,nfun) c Minimizes side-chains only, leaving backbone frozen crc implicit none c Includes implicit real*8 (a-h,o-z) include 'DIMENSIONS' include 'COMMON.VAR' include 'COMMON.CHAIN' include 'COMMON.FFIELD' c Output arguments double precision etot integer iretcode,nfun c Local variables integer i double precision orig_w(n_ene),energy(0:n_ene) double precision var(maxvar) c Set non side-chain weights to zero (minimization is faster) c NOTE: e(2) does not actually depend on the side-chain, only CA orig_w(2)=wscp orig_w(3)=welec orig_w(4)=wcorr orig_w(5)=wcorr5 orig_w(6)=wcorr6 orig_w(7)=wel_loc orig_w(8)=wturn3 orig_w(9)=wturn4 orig_w(10)=wturn6 orig_w(11)=wang orig_w(13)=wtor orig_w(14)=wtor_d wscp=0.D0 welec=0.D0 wcorr=0.D0 wcorr5=0.D0 wcorr6=0.D0 wel_loc=0.D0 wturn3=0.D0 wturn4=0.D0 wturn6=0.D0 wang=0.D0 wtor=0.D0 wtor_d=0.D0 c Prepare to freeze backbone do i=1,nres mask_phi(i)=0 mask_theta(i)=0 mask_side(i)=1 enddo c Minimize the side-chains mask_r=.true. call geom_to_var(nvar,var) call minimize(etot,var,iretcode,nfun) call var_to_geom(nvar,var) mask_r=.false. c Put the original weights back and calculate the full energy wscp=orig_w(2) welec=orig_w(3) wcorr=orig_w(4) wcorr5=orig_w(5) wcorr6=orig_w(6) wel_loc=orig_w(7) wturn3=orig_w(8) wturn4=orig_w(9) wturn6=orig_w(10) wang=orig_w(11) wtor=orig_w(13) wtor_d=orig_w(14) call chainbuild_extconf call etotal(energy) etot=energy(0) return end