corrections in wham and clust
[unres.git] / source / unres / src_MD-M / energy_p_new_barrier.F
index ee55c93..00862f2 100644 (file)
@@ -5910,6 +5910,7 @@ C
       logical lprn /.false./, lprn1 /.false./
       etheta=0.0D0
       do i=ithet_start,ithet_end
+        if (i.le.2) cycle
 c        print *,i,itype(i-1),itype(i),itype(i-2)
         if ((itype(i-1).eq.ntyp1).or.itype(i-2).eq.ntyp1
      &  .or.itype(i).eq.ntyp1) cycle
@@ -5926,6 +5927,15 @@ C        print *,i,theta(i)
           sinkt(k)=dsin(k*theti2)
         enddo
 C        print *,ethetai
+        if (i.eq.3) then
+          phii=0.0d0
+          ityp1=nthetyp+1
+          do k=1,nsingle
+            cosph1(k)=0.0d0
+            sinph1(k)=0.0d0
+          enddo
+        else
+
         if (i.gt.3 .and. itype(i-3).ne.ntyp1) then
 #ifdef OSF
           phii=phi(i)
@@ -5947,6 +5957,7 @@ C propagation of chirality for glycine type
             sinph1(k)=0.0d0
           enddo 
         endif
+        endif
         if (i.lt.nres .and. itype(i+1).ne.ntyp1) then
 #ifdef OSF
           phii1=phi(i+1)