ctest checkgrad ref ene and limits
[unres.git] / source / cluster / wham / src-M / readrtns.F
index 8895326..ae8f8a8 100644 (file)
@@ -1103,7 +1103,7 @@ c
         tpl_k_rescore="template"//kic2//".sco"
 
         unres_pdb=.false.
-        call readpdb
+        call readpdb_template(k)
         do i=1,2*nres
           do j=1,3
             crefjlee(j,i)=c(j,i)
@@ -1347,8 +1347,13 @@ c
             liiflag=.false.
             iistart=ii
           endif
-          if (ii_in_use(ii).ne.0.and..not.liiflag) then
-             iishift=ii-iistart
+          if (ii_in_use(ii).ne.0.and..not.liiflag.or.
+     &                   .not.liiflag.and.ii.eq.lim_odl) then
+             if (ii.eq.lim_odl) then
+              iishift=ii-iistart+1
+             else
+              iishift=ii-iistart
+             endif
              liiflag=.true.
              do ki=iistart,lim_odl-iishift
               ires_homo(ki)=ires_homo(ki+iishift)