43c43 < double precision orig_e,cur_e --- > double precision orig_e,cur_e, old_e 89,91c89,92 < cd call chainbuild < cd call etotal(energy) < cd write (iout,*) 'start sc ene',energy(0) --- > call chainbuild > call etotal(energy) > old_e=energy(0) > write (iout,*) 'start sc ene',energy(0) 103,113c104,117 < c Try (one by one) all specified residues, starting from a < c random position in sequence < c Stop early if the energy has decreased by at least e_drop < n_tot=n_end-n_start+1 < n_first=iran_num(0,n_tot-1) < n_steps=0 < n=0 < crc do while (n.lt.n_tot .and. orig_e-etot.lt.e_drop) < do while (n.lt.n_tot) < n_cur=n_start+mod(n_first+n,n_tot) < call single_sc_move(n_cur,n_maxtry,e_drop, --- > c Try (one by one) all specified residues, starting from a > c random position in sequence > c Stop early if the energy has decreased by at least e_drop > CIK Do this multiple times, starting from different random positions > CIK until the energy drop wrt the previous step is < 0.5 kcal/mol > do > n_tot=n_end-n_start+1 > n_first=iran_num(0,n_tot-1) > n_steps=0 > n=0 > crc do while (n.lt.n_tot .and. orig_e-etot.lt.e_drop) > do while (n.lt.n_tot) > n_cur=n_start+mod(n_first+n,n_tot) > call single_sc_move(n_cur,n_maxtry,e_drop, 115,134c119,148 < c If a lower energy was found, update the current structure... < crc if (etot.lt.cur_e) then < crc cur_e=etot < crc do i=2,nres-1 < crc cur_alph(i)=alph(i) < crc cur_omeg(i)=omeg(i) < crc enddo < crc else < c ...else revert to the previous one < crc etot=cur_e < crc do i=2,nres-1 < crc alph(i)=cur_alph(i) < crc omeg(i)=cur_omeg(i) < crc enddo < crc endif < n=n+1 < cd < cd call chainbuild < cd call etotal(energy) < cd print *,'running',n,energy(0) --- > c If a lower energy was found, update the current structure... > crc if (etot.lt.cur_e) then > crc cur_e=etot > crc do i=2,nres-1 > crc cur_alph(i)=alph(i) > crc cur_omeg(i)=omeg(i) > crc enddo > crc else > c ...else revert to the previous one > crc etot=cur_e > crc do i=2,nres-1 > crc alph(i)=cur_alph(i) > crc omeg(i)=cur_omeg(i) > crc enddo > crc endif > n=n+1 > cd > cd call chainbuild > cd call etotal(energy) > cd print *,'running',n,energy(0) > enddo > cik > call chainbuild > call etotal(energy) > write (iout,*) 'running sc ene',j,energy(0) > if (old_e-energy(0).lt.5.0D-1) then > goto 10 > else > old_e=energy(0) > endif 137,139c151,153 < cd call chainbuild < cd call etotal(energy) < cd write (iout,*) 'end sc ene',energy(0) --- > 10 call chainbuild > call etotal(energy) > write (iout,*) 'end sc ene',energy(0) 254a269,271 > cik n_maxtry is used not as max total tries but as max consecuitive > cik tries not producing a lower energy; an indication of convergence > 275,277c292,294 < cv write(*,'(2i3,2f12.5,2i3)') < cv & res_pick,nres_moved,orig_e,e_sc-cur_e, < cv & iretcode,loc_nfun --- > cik write(*,'(2i3,3f12.5,2i3)') > cik & res_pick,nres_moved,orig_e,e_sc,cur_e, > cik & iretcode,loc_nfun 316a334,335 > cik reset n_try on success to lower energy: > n_try=0 325a345,346 > cik increment n_try on failure to lower energy: > n_try=n_try+1 327c348 < n_try=n_try+1 --- > cik n_try=n_try+1