edis ctest multichain
[unres.git] / source / unres / src_MD-M / energy_p_new_barrier.F
index 332f1ee..37f648f 100644 (file)
@@ -5203,6 +5203,7 @@ c      write(iout,*)'link_start=',link_start,' link_end=',link_end,
 c     &  " constr_dist",constr_dist," link_start_peak",link_start_peak,
 c     &  " link_end_peak",link_end_peak
       if (link_end.eq.0.and.link_end_peak.eq.0) return
+      if (link_end_peak.ne.0) then
       do i=link_start_peak,link_end_peak
         ehpb_peak=0.0d0
 c        print *,"i",i," link_end_peak",link_end_peak," ipeak",
@@ -5261,6 +5262,7 @@ C iii and jjj point to the residues for which the distance is assigned.
           enddo
         enddo
       enddo
+      endif
       do i=link_start,link_end
 C If ihpb(i) and jhpb(i) > NRES, this is a SC-SC distance, otherwise a
 C CA-CA distance used in regularization of structure.
@@ -5287,7 +5289,7 @@ C 15/02/13 CC dynamic SSbond - additional check
           if (ii.gt.nres .and. iabs(itype(iii)).eq.1 .and.
      &        iabs(itype(jjj)).eq.1) then
            call ssbond_ene(iii,jjj,eij)
-           ehpb=ehpb+2*eij
+           ehpb=ehpb+eij
          endif
 cd          write (iout,*) "eij",eij
 cd   &   ' waga=',waga,' fac=',fac