Merge branch 'multichain' into lipid
authorAdam Sieradzan <adasko@piasek4.chem.univ.gda.pl>
Thu, 25 Jun 2015 10:31:05 +0000 (12:31 +0200)
committerAdam Sieradzan <adasko@piasek4.chem.univ.gda.pl>
Thu, 25 Jun 2015 10:31:05 +0000 (12:31 +0200)
Conflicts:
source/unres/src_MD-M/MREMD.F

1  2 
PARAM/scinter_GB_ext_lip.parm
source/unres/src_MD-M/chainbuild.F
source/unres/src_MD-M/initialize_p.F

index cae5b65,0000000..f4b894d
mode 100644,000000..100644
--- /dev/null
@@@ -1,245 -1,0 +1,245 @@@
 +4  6
 +        5.6053537261        6.2200032154        6.2159898496        6.4386968963
 +        6.2098101231        5.9596374798        5.4310222662        4.8790085257
 +        5.2638423822        5.4961954124        4.2928124162        4.3582250540
 +        4.2667755921        3.6813845958        3.5405429647        3.7026985912
 +        4.7177596156        3.3811992227        3.7936085458        4.5157490585
 +        6.2200032154        6.2159898496        5.2638423822        5.2638423822
 +
 +        6.6296746680        6.6717260508        6.8168876945        6.8378960152
 +        6.3512039986        6.1425192423        5.5200206406        5.4858936024
 +        4.9382573262        4.2795129166        4.0534857018        4.2086428525
 +        3.5388086279        3.4209730327        2.7995744193        4.8164268553
 +        3.8790755071        3.5878262177        4.6457432555        6.6296746680
 +        6.6717260508        5.4858936024        5.4858936024
 +
 +        6.6424306340        6.9715947250        6.9241225787        6.5291325353
 +        6.1394821460        5.4415971840        5.2914044780        4.7881880526
 +        4.1302408718        3.9405275117        3.9022731880        3.6078928145
 +        3.0809713206        3.0182595342        4.7935507272        3.8711928134
 +        3.6826168780        4.4872661030        6.6717260508        6.6424306340
 +        5.2914044780        5.2914044780
 +
 +        7.3271707934        7.2970176793        7.0494948235        6.2565687662
 +        5.8133715113        5.8845382769        5.3463553241        4.7146928716
 +        4.4864793359        4.3092352779        3.6928361281        4.0100566871
 +        3.6584608489        4.5901676001        4.4681844010        4.6334334282
 +        4.9023945082        6.8168876945        6.9715947250        5.8845382769
 +        5.8845382769
 +
 +        7.0106342493        6.8341607204        6.2047876082        5.5802122247
 +        5.6716968726        5.2011344932        4.1966522349        4.2383931955
 +        3.8954073453        3.5679086118        3.1136348127        2.7622561241
 +        4.5092053374        4.0238412606        3.9799853578        4.8087180377
 +        6.8378960152        6.9241225787        5.6716968726        5.6716968726
 +
 +        6.5353606708        5.8844482033        5.1100976261        5.5515360893
 +        4.9587559238        4.2030790774        4.0351600709        3.6506289806
 +        3.4640416936        3.1611022087        2.7976192835        4.0422832763
 +        3.4415952740        3.8620694983        4.5934246009        6.3512039986
 +        6.5291325353        5.5515360893        5.5515360893
 +
 +        5.2828811325        4.8298466315        4.7575327777        4.7249779042
 +        3.5656384285        3.5613366567        3.9273045564        3.7664779118
 +        3.5861699761        3.5523191627        4.6508672463        4.2424308260
 +        4.0987727783        4.5079669929        6.1425192423        6.1394821460
 +        4.7575327777        4.7575327777
 +
 +        4.2222645754        4.1627149417        3.9786372270        3.1623319201 
 +        2.9379696734        3.1365985188        2.8025851476        2.6576343487
 +        2.8733395837        3.8785891655        3.4443068252        3.4405132673
 +        4.0915305763        5.5200206406        5.4415971840        4.1627149417
 +        4.1627149417
 +
 +        4.3860654351        3.6520014167        3.0264937881        2.5680579493
 +        2.5001857370        2.1393094782        1.4707077389        1.7373181916
 +        3.1045342752        2.0152329038        1.8196209136        3.6395852546
 +        5.4858936024        5.2914044780        4.3860654351        4.3860654351
 +
 +        2.5016557935        2.7879606493        2.1424756816        1.0741544747
 +        1.3236438850        -.2712356678         .7613312181        2.8627348285
 +        1.5002127649        -.2392577636        3.5381128985        4.9382573262
 +        4.7881880526        3.6520014167        3.6520014167
 +
 +        2.2903847447        2.2466771550        1.5053607856        1.4031797188
 +         .9676209687        1.3075541842        2.8595118604        1.9833053538
 +        -.0085773647        2.9557553666        4.2795129166        4.1302408718
 +        3.0264937881        3.0264937881
 +
 +        1.2800038243         .7689806100         .9119606366        -.0744371793
 +         .3669965427        2.4288563200        1.4975482174        -.2134101897
 +        2.9415021479        4.0534857018        3.9405275117        2.5680579493
 +        2.5680579493
 +
 +        -.6792428859         .4532383239        -.7590387660        -.3617034846
 +        1.6803275058         .6775209988        -.5354837468        2.6208591363
 +        4.2086428525        3.9022731880        2.5001857370        2.5001857370
 +
 +         .4136122500        -.1637152873         .2212564728        2.1287126020 
 +         .3896388275        -.2354089650        2.3255326077        3.5388086279
 +        3.6078928145        2.1393094782        2.1393094782
 +
 +       -3.5193531074       -2.0157307929        1.8355926160        2.7489174124
 +        2.0098391558        1.7975718667        3.4209730327        3.0809713206
 +        1.4707077389        1.4707077389
 +
 +       -1.3532688232        2.5504275249        2.8202873790        1.6253609671
 +        1.8625091247        2.7995744193        3.0182595342        1.7373181916
 +        1.7373181916
 +
 +        3.7292778697        2.2944436481        -.0303565255        3.1115776177
 +        4.8164268553        4.7935507272        3.1045342752        3.1045342752
 +
 +        -.0827362961       -1.6043113182        2.4439837435        3.8790755071
 +        3.8711928134        2.0152329038        2.0152329038
 +
 +       -4.3897783280        2.3664634533        3.5878262177        3.6826168780
 +        1.8196209136        1.8196209136
 +
 +        4.1927969260        4.6457432555        4.4872661030        3.6395852546
 +        3.6395852546
 +
 +        6.6296746680        6.6717260508        5.4858936024        5.4858936024
 +
 +        6.6424306340        5.2914044780        5.2914044780
 +
 +        4.3860654351        4.3860654351
 +    
 +        4.3860654351       
 +
 +        2.6748060017        2.7338810145        2.9664647229        2.8819636737
 +        3.0210738150        2.8414286152        2.4773438660        2.4611943788
 +        2.4653201213        2.4925087371        2.5734767751        2.4564026744
 +        2.4847825281        2.4889289233        2.5089517645        2.5083338383
 +        2.4220622723        2.2714609770        2.4520703089        2.7026129788 
 +        2.7338810145        2.9664647229        2.4653201213        2.4653201213 
 +
 +        4.9272154761        5.1054284230        4.2073516165        4.8513972837
 +        2.7848875293        3.5829861634        7.8660217576        7.4299209847
 +        1.9625939832         .7987769569        4.0580899681        1.8889021032  
 +        3.1987197026        3.2673274538        2.6848131904        2.0043027404
 +        6.2446341910        8.1959452095       13.4748295858        2.6632376837
 +        5.1054284230        4.2073516165        1.9625939832        1.9625939832
 +
 +         .8699023011        1.0540660014         .9385909298        1.0263274101
 +        1.0835277045        1.0543183886         .7888686996         .8989305833
 +        1.0039962875        1.2427518128         .8932801724         .9173928990
 +        1.6157695657        1.4315860373        2.0498317879        1.4199615546
 +         .9933677971        1.4319625600       27.4951763288         .7788025286
 +        1.0540660014         .9385909298        1.0039962875        1.0039962875
 +
 +         .0103697556         .0611385674         .0448303346         .0392831782
 +         .0854166338         .0398896619         .0249496569         .0232410908
 +         .0861379100        -.0754794185        -.0266146021        -.0163429099
 +         .0572167103        -.0468608825         .0151048455         .0084963678
 +         .0278930397         .0076922911         .1033536738        -.0098256036
 +         .0611385674         .0448303346         .0861379100         .0861379100
++C From here are lipid
 +        5.6053537261        6.2200032154        6.2159898496        6.4386968963
 +        6.2098101231        5.9596374798        5.4310222662        4.8790085257
 +        5.2638423822        5.4961954124        4.2928124162        4.3582250540
 +        4.2667755921        3.6813845958        3.5405429647        3.7026985912
 +        4.7177596156        3.3811992227        3.7936085458        4.5157490585
 +        6.2200032154        6.2159898496        5.2638423822        5.2638423822
 +
 +        6.6296746680        6.6717260508        6.8168876945        6.8378960152
 +        6.3512039986        6.1425192423        5.5200206406        5.4858936024
 +        4.9382573262        4.2795129166        4.0534857018        4.2086428525
 +        3.5388086279        3.4209730327        2.7995744193        4.8164268553
 +        3.8790755071        3.5878262177        4.6457432555        6.6296746680
 +        6.6717260508        5.4858936024        5.4858936024
 +
 +        6.6424306340        6.9715947250        6.9241225787        6.5291325353
 +        6.1394821460        5.4415971840        5.2914044780        4.7881880526
 +        4.1302408718        3.9405275117        3.9022731880        3.6078928145
 +        3.0809713206        3.0182595342        4.7935507272        3.8711928134
 +        3.6826168780        4.4872661030        6.6717260508        6.6424306340
 +        5.2914044780        5.2914044780
 +
 +        7.3271707934        7.2970176793        7.0494948235        6.2565687662
 +        5.8133715113        5.8845382769        5.3463553241        4.7146928716
 +        4.4864793359        4.3092352779        3.6928361281        4.0100566871
 +        3.6584608489        4.5901676001        4.4681844010        4.6334334282
 +        4.9023945082        6.8168876945        6.9715947250        5.8845382769
 +        5.8845382769
 +
 +        7.0106342493        6.8341607204        6.2047876082        5.5802122247
 +        5.6716968726        5.2011344932        4.1966522349        4.2383931955
 +        3.8954073453        3.5679086118        3.1136348127        2.7622561241
 +        4.5092053374        4.0238412606        3.9799853578        4.8087180377
 +        6.8378960152        6.9241225787        5.6716968726        5.6716968726
 +
 +        6.5353606708        5.8844482033        5.1100976261        5.5515360893
 +        4.9587559238        4.2030790774        4.0351600709        3.6506289806
 +        3.4640416936        3.1611022087        2.7976192835        4.0422832763
 +        3.4415952740        3.8620694983        4.5934246009        6.3512039986
 +        6.5291325353        5.5515360893        5.5515360893
 +
 +        5.2828811325        4.8298466315        4.7575327777        4.7249779042
 +        3.5656384285        3.5613366567        3.9273045564        3.7664779118
 +        3.5861699761        3.5523191627        4.6508672463        4.2424308260
 +        4.0987727783        4.5079669929        6.1425192423        6.1394821460
 +        4.7575327777        4.7575327777
 +
 +        4.2222645754        4.1627149417        3.9786372270        3.1623319201
 +        2.9379696734        3.1365985188        2.8025851476        2.6576343487
 +        2.8733395837        3.8785891655        3.4443068252        3.4405132673
 +        4.0915305763        5.5200206406        5.4415971840        4.1627149417
 +        4.1627149417
 +
 +        4.3860654351        3.6520014167        3.0264937881        2.5680579493
 +        2.5001857370        2.1393094782        1.4707077389        1.7373181916
 +        3.1045342752        2.0152329038        1.8196209136        3.6395852546
 +        5.4858936024        5.2914044780        4.3860654351        4.3860654351
 +
 +        2.5016557935        2.7879606493        2.1424756816        1.0741544747
 +        1.3236438850        -.2712356678         .7613312181        2.8627348285
 +        1.5002127649        -.2392577636        3.5381128985        4.9382573262
 +        4.7881880526        3.6520014167        3.6520014167
 +
 +        2.2903847447        2.2466771550        1.5053607856        1.4031797188
 +         .9676209687        1.3075541842        2.8595118604        1.9833053538
 +        -.0085773647        2.9557553666        4.2795129166        4.1302408718
 +        3.0264937881        3.0264937881
 +
 +        1.2800038243         .7689806100         .9119606366        -.0744371793
 +         .3669965427        2.4288563200        1.4975482174        -.2134101897
 +        2.9415021479        4.0534857018        3.9405275117        2.5680579493
 +        2.5680579493
 +
 +        -.6792428859         .4532383239        -.7590387660        -.3617034846
 +        1.6803275058         .6775209988        -.5354837468        2.6208591363
 +        4.2086428525        3.9022731880        2.5001857370        2.5001857370
 +
 +         .4136122500        -.1637152873         .2212564728        2.1287126020
 +         .3896388275        -.2354089650        2.3255326077        3.5388086279
 +        3.6078928145        2.1393094782        2.1393094782
 +
 +       -3.5193531074       -2.0157307929        1.8355926160        2.7489174124
 +        2.0098391558        1.7975718667        3.4209730327        3.0809713206
 +        1.4707077389        1.4707077389
 +
 +       -1.3532688232        2.5504275249        2.8202873790        1.6253609671
 +        1.8625091247        2.7995744193        3.0182595342        1.7373181916
 +        1.7373181916
 +
 +        3.7292778697        2.2944436481        -.0303565255        3.1115776177
 +        4.8164268553        4.7935507272        3.1045342752        3.1045342752
 +
 +        -.0827362961       -1.6043113182        2.4439837435        3.8790755071
 +        3.8711928134        2.0152329038        2.0152329038
 +
 +       -4.3897783280        2.3664634533        3.5878262177        3.6826168780
 +        1.8196209136        1.8196209136
 +
 +        4.1927969260        4.6457432555        4.4872661030        3.6395852546
 +        3.6395852546
 +
 +        6.6296746680        6.6717260508        5.4858936024        5.4858936024
 +
 +        6.6424306340        5.2914044780        5.2914044780
 +
 +        4.3860654351        4.3860654351
 +
 +        4.3860654351
 +
@@@ -19,10 -19,6 +19,10 @@@ C Set lprn=.true. for debuggin
        perbox=.false.
        fail=.false.
        print *, 'enter chainbuild' 
 +      call chainbuild_cart
 +      return
 +      end
 +#ifdef DEBUG
        if (perbox) then
        cost=dcos(theta(3))
        sint=dsin(theta(3))
        endif
        return
        end
 +#endif
  c-------------------------------------------------------------------------
        subroutine orig_frame
  C
@@@ -390,3 -385,230 +390,230 @@@ cd   &   xp,yp,zp,(xx(k),k=1,3
        enddo
        return
        end
+ c------------------------------------------
+       subroutine returnbox
+       include 'DIMENSIONS'
+ #ifdef MPI
+       include 'mpif.h'
+ #endif
+       include 'COMMON.CONTROL'
+       include 'COMMON.VAR'
+       include 'COMMON.MD'
+ #ifndef LANG0
+       include 'COMMON.LANGEVIN'
+ #else
+       include 'COMMON.LANGEVIN.lang0'
+ #endif
+       include 'COMMON.CHAIN'
+       include 'COMMON.DERIV'
+       include 'COMMON.GEO'
+       include 'COMMON.LOCAL'
+       include 'COMMON.INTERACT'
+       include 'COMMON.IOUNITS'
+       include 'COMMON.NAMES'
+       include 'COMMON.TIME1'
+       include 'COMMON.REMD'
+       include 'COMMON.SETUP'
+       include 'COMMON.MUCA'
+       include 'COMMON.HAIRPIN'
+         j=1
+         chain_beg=1
+ C        do i=1,nres
+ C       write(*,*) 'initial', i,j,c(j,i)
+ C        enddo
+         do i=1,nres-1
+          if ((itype(i).eq.ntyp1).and.(itype(i+1).eq.ntyp1)) then
+           chain_end=i
+           if (allareout.eq.1) then
+             ireturnval=int(c(j,i)/boxxsize)
+             if (c(j,i).le.0) ireturnval=ireturnval-1
+             do k=chain_beg,chain_end
+               c(j,k)=c(j,k)-ireturnval*boxxsize
+               c(j,k+nres)=c(j,k+nres)-ireturnval*boxxsize
+             enddo
+            endif
+            chain_beg=i+1
+            allareout=1
+          else
+           if (int(c(j,i)/boxxsize).eq.0) allareout=0
+          endif
+         enddo
+          if (allareout.eq.1) then
+             ireturnval=int(c(j,i)/boxxsize)
+             if (c(j,i).le.0) ireturnval=ireturnval-1
+             do k=chain_beg,nres
+               c(j,k)=c(j,k)-ireturnval*boxxsize
+               c(j,k+nres)=c(j,k+nres)-ireturnval*boxxsize
+             enddo
+           endif
+ C NO JUMP 
+ C        do i=1,nres
+ C        write(*,*) 'befor no jump', i,j,c(j,i)
+ C        enddo
+         nojumpval=0
+         do i=2,nres
+            if (itype(i).eq.ntyp1 .and. itype(i-1).eq.ntyp1) then
+              difference=abs(c(j,i-1)-c(j,i))
+ C             print *,'diff', difference
+              if (difference.gt.boxxsize/2.0) then
+                 if (c(j,i-1).gt.c(j,i)) then
+                   nojumpval=1
+                  else
+                    nojumpval=-1
+                  endif
+               else
+               nojumpval=0
+               endif
+               endif
+               c(j,i)=c(j,i)+nojumpval*boxxsize
+               c(j,i+nres)=c(j,i+nres)+nojumpval*boxxsize
+          enddo
+        nojumpval=0
+         do i=2,nres
+            if (itype(i).eq.ntyp1 .and. itype(i-1).eq.ntyp1) then
+              difference=abs(c(j,i-1)-c(j,i))
+              if (difference.gt.boxxsize/2.0) then
+                 if (c(j,i-1).gt.c(j,i)) then
+                   nojumpval=1
+                  else
+                    nojumpval=-1
+                  endif
+               else
+               nojumpval=0
+               endif
+              endif
+               c(j,i)=c(j,i)+nojumpval*boxxsize
+               c(j,i+nres)=c(j,i+nres)+nojumpval*boxxsize
+          enddo
+ C        do i=1,nres
+ C        write(*,*) 'after no jump', i,j,c(j,i)
+ C        enddo
+ C NOW Y dimension
+         j=2
+         chain_beg=1
+         do i=1,nres-1
+          if ((itype(i).eq.ntyp1).and.(itype(i+1).eq.ntyp1)) then
+           chain_end=i
+           if (allareout.eq.1) then
+             ireturnval=int(c(j,i)/boxysize)
+             if (c(j,i).le.0) ireturnval=ireturnval-1
+             do k=chain_beg,chain_end
+               c(j,k)=c(j,k)-ireturnval*boxysize
+              c(j,k+nres)=c(j,k+nres)-ireturnval*boxysize
+             enddo
+            endif
+            chain_beg=i+1
+            allareout=1
+          else
+           if (int(c(j,i)/boxysize).eq.0) allareout=0
+          endif
+         enddo
+          if (allareout.eq.1) then
+             ireturnval=int(c(j,i)/boxysize)
+             if (c(j,i).le.0) ireturnval=ireturnval-1
+             do k=chain_beg,nres
+               c(j,k)=c(j,k)-ireturnval*boxysize
+               c(j,k+nres)=c(j,k+nres)-ireturnval*boxysize
+             enddo
+           endif
+         nojumpval=0
+         do i=2,nres
+            if (itype(i).eq.ntyp1 .and. itype(i-1).eq.ntyp1) then
+              difference=abs(c(j,i-1)-c(j,i))
+              if (difference.gt.boxysize/2.0) then
+                 if (c(j,i-1).gt.c(j,i)) then
+                   nojumpval=1
+                  else
+                    nojumpval=-1
+                  endif
+              else
+               nojumpval=0
+               endif
+            endif
+               c(j,i)=c(j,i)+nojumpval*boxysize
+               c(j,i+nres)=c(j,i+nres)+nojumpval*boxysize
+          enddo
+       nojumpval=0
+         do i=2,nres
+            if (itype(i).eq.ntyp1 .and. itype(i-1).eq.ntyp1) then
+              difference=abs(c(j,i-1)-c(j,i))
+              if (difference.gt.boxysize/2.0) then
+                 if (c(j,i-1).gt.c(j,i)) then
+                   nojumpval=1
+                  else
+                    nojumpval=-1
+                  endif
+               else
+               nojumpval=0
+               endif
+             endif
+               c(j,i)=c(j,i)+nojumpval*boxysize
+               c(j,i+nres)=c(j,i+nres)+nojumpval*boxysize
+          enddo
+        j=3
+         chain_beg=1
+         do i=1,nres-1
+          if ((itype(i).eq.ntyp1).and.(itype(i+1).eq.ntyp1)) then
+           chain_end=i
+           if (allareout.eq.1) then
+             ireturnval=int(c(j,i)/boxysize)
+             if (c(j,i).le.0) ireturnval=ireturnval-1
+             do k=chain_beg,chain_end
+               c(j,k)=c(j,k)-ireturnval*boxzsize
+               c(j,k+nres)=c(j,k+nres)-ireturnval*boxzsize
+             enddo
+            endif
+            chain_beg=i+1
+            allareout=1
+          else
+           if (int(c(j,i)/boxzsize).eq.0) allareout=0
+          endif
+         enddo
+          if (allareout.eq.1) then
+             ireturnval=int(c(j,i)/boxzsize)
+             if (c(j,i).le.0) ireturnval=ireturnval-1
+             do k=chain_beg,nres
+               c(j,k)=c(j,k)-ireturnval*boxzsize
+               c(j,k+nres)=c(j,k+nres)-ireturnval*boxzsize
+             enddo
+           endif
+         nojumpval=0
+         do i=2,nres
+            if (itype(i).eq.ntyp1 .and. itype(i-1).eq.ntyp1) then
+              difference=abs(c(j,i-1)-c(j,i))
+              if (difference.gt.(boxzsize/2.0)) then
+                 if (c(j,i-1).gt.c(j,i)) then
+                   nojumpval=1
+                  else
+                    nojumpval=-1
+                  endif
+               else
+               nojumpval=0
+               endif
+             endif
+               c(j,i)=c(j,i)+nojumpval*boxzsize
+               c(j,i+nres)=c(j,i+nres)+nojumpval*boxzsize
+          enddo
+        nojumpval=0
+         do i=2,nres
+            if (itype(i).eq.ntyp1 .and. itype(i-1).eq.ntyp1) then
+              difference=abs(c(j,i-1)-c(j,i))
+              if (difference.gt.boxzsize/2.0) then
+                 if (c(j,i-1).gt.c(j,i)) then
+                   nojumpval=1
+                  else
+                    nojumpval=-1
+                  endif
+               else
+               nojumpval=0
+               endif
+             endif
+              c(j,i)=c(j,i)+nojumpval*boxzsize
+               c(j,i+nres)=c(j,i+nres)+nojumpval*boxzsize
+          enddo
+         return
+         end
        icsa_in=40
  crc for ifc error 118
        icsa_pdb=42
 +C Lipidic input file for parameters range 60-79
 +      iliptranpar=60
 +C input file for transfer sidechain and peptide group inside the
 +C lipidic environment if lipid is implicite
 +
 +C DNA input files for parameters range 80-99
 +C Suger input files for parameters range 100-119
 +C All-atom input files for parameters range 120-149
  C
  C Set default weights of the energy terms.
  C
@@@ -154,10 -146,8 +154,10 @@@ c      call memmon_print_usage(
        enddo
        do i=1,ntyp
        do j=1,ntyp
 -        aa(i,j)=0.0D0
 -        bb(i,j)=0.0D0
 +        aa_aq(i,j)=0.0D0
 +        bb_aq(i,j)=0.0D0
 +          aa_lip(i,j)=0.0D0
 +          bb_lip(i,j)=0.0D0
          augm(i,j)=0.0D0
          sigma(i,j)=0.0D0
          r0(i,j)=0.0D0
@@@ -256,30 -246,20 +256,30 @@@ C Initialize the bridge array
        jhpb(i)=0
        enddo
  C Initialize correlation arrays
 -      do i=-maxtor,maxtor
 +      do i=1,maxres
         do k=1,2
          b1(k,i)=0.0
          b2(k,i)=0.0
          b1tilde(k,i)=0.0
  c        b2tilde(k,i)=0.0
          do j=1,2
 +C        CC(j,k,i)=0.0
 +C        Ctilde(j,k,i)=0.0
 +C        DD(j,k,i)=0.0
 +C        Dtilde(j,k,i)=0.0
 +        EE(j,k,i)=0.0
 +        enddo
 +       enddo
 +      enddo
 +      do i=-maxtor,maxtor
 +       do k=1,2
 +        do j=1,2
          CC(j,k,i)=0.0
          Ctilde(j,k,i)=0.0
          DD(j,k,i)=0.0
          Dtilde(j,k,i)=0.0
 -        EE(j,k,i)=0.0
          enddo
 -       enddo
 +      enddo
        enddo
  C
  C Initialize timing.
@@@ -652,8 -632,6 +652,8 @@@ C Partition local interaction
        call int_bounds(nct-nnt,ibondp_start,ibondp_end) 
        ibondp_start=ibondp_start+nnt
        ibondp_end=ibondp_end+nnt
 +      call int_bounds(nres,ilip_start,ilip_end)
 +      ilip_start=ilip_start
        call int_bounds1(nres-1,ivec_start,ivec_end) 
  c      print *,"Processor",myrank,fg_rank,fg_rank1,
  c     &  " ivec_start",ivec_start," ivec_end",ivec_end
@@@ -1171,15 -1149,14 +1171,16 @@@ c        write (iout,*) "MPI_ROTAT2",MP
        ibond_start=2
        ibond_end=nres-1
        ibondp_start=nnt
-       ibondp_end=nct-1
+ C      ibondp_end=nct-1
+       ibondp_end=nct
        ivec_start=1
        ivec_end=nres-1
        iset_start=3
        iset_end=nres+1
        iint_start=2
        iint_end=nres-1
 +      ilip_start=1
 +      ilip_end=nres
  #endif
        return
        end