respa cleaning (my bug) and shielding MPI and previous bug cleaning
authorAdam Sieradzan <adasko@piasek4.chem.univ.gda.pl>
Thu, 21 Apr 2016 08:05:24 +0000 (10:05 +0200)
committerAdam Sieradzan <adasko@piasek4.chem.univ.gda.pl>
Thu, 21 Apr 2016 08:05:24 +0000 (10:05 +0200)
source/unres/src_MD-M/COMMON.SETUP
source/unres/src_MD-M/COMMON.SHIELD
source/unres/src_MD-M/DIMENSIONS
source/unres/src_MD-M/energy_p_new-sep_barrier.F
source/unres/src_MD-M/energy_p_new_barrier.F
source/unres/src_MD-M/energy_split-sep.F
source/unres/src_MD-M/gradient_p.F
source/unres/src_MD-M/initialize_p.F

index 5039116..d3ff6af 100644 (file)
      & max_gs_size,kolor,koniec,WhatsUp,ifinish,CG_COMM,FG_COMM,
      & FG_COMM1,CONT_FROM_COMM,CONT_TO_COMM,lentyp
       integer MPI_UYZ,MPI_UYZGRAD,MPI_MU,MPI_MAT1,MPI_MAT2,
-     & MPI_THET,MPI_GAM,
+     & MPI_THET,MPI_GAM,MPI_I50,MPI_SHI,
      & MPI_ROTAT1(0:1),MPI_ROTAT2(0:1),MPI_ROTAT_OLD(0:1),
      & MPI_PRECOMP11(0:1),MPI_PRECOMP12(0:1),MPI_PRECOMP22(0:1),
      & MPI_PRECOMP23(0:1)
       common /types/ MPI_UYZ,MPI_UYZGRAD,MPI_MU,MPI_MAT1,MPI_MAT2,
-     & MPI_THET,MPI_GAM,
+     & MPI_THET,MPI_GAM,MPI_I50,MPI_SHI,
      & MPI_ROTAT1,MPI_ROTAT2,MPI_ROTAT_OLD,MPI_PRECOMP11,MPI_PRECOMP12,
      & MPI_PRECOMP22,MPI_PRECOMP23
index a8110d5..6cbf5a8 100644 (file)
@@ -5,10 +5,11 @@
        common /shield/ VSolvSphere,VSolvSphere_div,buff_shield,
      & long_r_sidechain(ntyp),
      & short_r_sidechain(ntyp),fac_shield(maxres),wshield,
-     & grad_shield_side(3,maxcont,-1:maxres),grad_shield(3,-1:maxres),
-     &  grad_shield_loc(3,maxcont,-1:maxres),
-     & ishield_list(maxres),shield_list(maxcont,maxres),
-     & ees0plist(maxcont,maxres)
+     & grad_shield_side(3,maxcontsshi,-1:maxres),
+     &  grad_shield(3,-1:maxres),
+     &  grad_shield_loc(3,maxcontsshi,-1:maxres),
+     & ishield_list(maxres),shield_list(maxcontsshi,maxres),
+     & ees0plist(maxconts,maxres)
 
 
        
index 4c9a85c..90fdb7d 100644 (file)
@@ -40,9 +40,9 @@ C Max. number of SC contacts
       integer maxcont
       parameter (maxcont=12*maxres)
 C Max. number of contacts per residue
-      integer maxconts
+      integer maxconts,maxcontsshi
       parameter (maxconts=maxres)
-c      parameter (maxconts=50)
+      parameter (maxcontsshi=50)
 C Number of AA types (at present only natural AA's will be handled
       integer ntyp,ntyp1
       parameter (ntyp=24,ntyp1=ntyp+1)
index e0b1f44..3815c13 100644 (file)
@@ -1455,8 +1455,8 @@ C
       do i=iturn3_start,iturn3_end
         if (itype(i).eq.ntyp1.or. itype(i+1).eq.ntyp1
      &  .or. itype(i+2).eq.ntyp1 .or. itype(i+3).eq.ntyp1
-     &  .or. itype(i-1).eq.ntyp1
-     &  .or. itype(i+4).eq.ntyp1
+C     &  .or. itype(i-1).eq.ntyp1
+C     &  .or. itype(i+4).eq.ntyp1
      &   ) cycle
         dxi=dc(1,i)
         dyi=dc(2,i)
@@ -1482,8 +1482,8 @@ C
         if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1
      &    .or. itype(i+3).eq.ntyp1
      &    .or. itype(i+4).eq.ntyp1
-     &    .or. itype(i+5).eq.ntyp1
-     &    .or. itype(i-1).eq.ntyp1
+C     &    .or. itype(i+5).eq.ntyp1
+C     &    .or. itype(i-1).eq.ntyp1
      &    ) cycle
         dxi=dc(1,i)
         dyi=dc(2,i)
@@ -1511,8 +1511,8 @@ c Loop over all pairs of interacting peptide groups except i,i+2 and i,i+3
 c
       do i=iatel_s,iatel_e
         if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1
-     &  .or. itype(i+2).eq.ntyp1
-     &  .or. itype(i-1).eq.ntyp1
+C     &  .or. itype(i+2).eq.ntyp1
+C     &  .or. itype(i-1).eq.ntyp1
      &) cycle
         dxi=dc(1,i)
         dyi=dc(2,i)
@@ -1533,8 +1533,8 @@ c        write (iout,*) 'i',i,' ielstart',ielstart(i),' ielend',ielend(i)
         num_conti=num_cont_hb(i)
         do j=ielstart(i),ielend(i)
           if (itype(j).eq.ntyp1 .or. itype(j+1).eq.ntyp1
-     & .or.itype(j+2).eq.ntyp1
-     & .or.itype(j-1).eq.ntyp1
+C     & .or.itype(j+2).eq.ntyp1
+C     & .or.itype(j-1).eq.ntyp1
      &) cycle
           call eelecij_scale(i,j,ees,evdw1,eel_loc)
         enddo ! j
index f557ebc..934bfb9 100644 (file)
@@ -10,6 +10,8 @@ cMS$ATTRIBUTES C ::  proc_proc
 #ifdef MPI
       include "mpif.h"
       double precision weights_(n_ene)
+      integer IERR
+      integer status(MPI_STATUS_SIZE)
 #endif
       include 'COMMON.SETUP'
       include 'COMMON.IOUNITS'
@@ -25,6 +27,7 @@ cMS$ATTRIBUTES C ::  proc_proc
       include 'COMMON.CONTROL'
       include 'COMMON.TIME1'
       include 'COMMON.SPLITELE'
+      include 'COMMON.SHIELD'
 #ifdef MPI      
 c      print*,"ETOTAL Processor",fg_rank," absolute rank",myrank,
 c     & " nfgtasks",nfgtasks
@@ -149,6 +152,63 @@ C      write (iout,*) "shield_mode",shield_mode
        call set_shield_fac
       else if  (shield_mode.eq.2) then
        call set_shield_fac2
+      if (nfgtasks.gt.1) then
+C#define DEBUG
+#ifdef DEBUG
+       write(iout,*) "befor reduce fac_shield reduce"
+       do i=1,nres
+        write(2,*) "fac",itype(i),fac_shield(i),grad_shield(1,i)
+        write(2,*) "list", shield_list(1,i),ishield_list(i),
+     &  grad_shield_side(1,1,i),grad_shield_loc(1,1,i)
+       enddo
+#endif
+       call MPI_Allgatherv(fac_shield(ivec_start),ivec_count(fg_rank1),
+     &  MPI_DOUBLE_PRECISION,fac_shield(1),ivec_count(0),ivec_displ(0),
+     &  MPI_DOUBLE_PRECISION,FG_COMM,IERR)
+       call MPI_Allgatherv(shield_list(1,ivec_start),
+     &  ivec_count(fg_rank1),
+     &  MPI_I50,shield_list(1,1),ivec_count(0),
+     &  ivec_displ(0),
+     &  MPI_I50,FG_COMM,IERR)
+       call MPI_Allgatherv(ishield_list(ivec_start),
+     &  ivec_count(fg_rank1),
+     &  MPI_INTEGER,ishield_list(1),ivec_count(0),
+     &  ivec_displ(0),
+     &  MPI_INTEGER,FG_COMM,IERR)
+       call MPI_Allgatherv(grad_shield(1,ivec_start),
+     &  ivec_count(fg_rank1),
+     &  MPI_UYZ,grad_shield(1,1),ivec_count(0),
+     &  ivec_displ(0),
+     &  MPI_UYZ,FG_COMM,IERR)
+       call MPI_Allgatherv(grad_shield_side(1,1,ivec_start),
+     &  ivec_count(fg_rank1),
+     &  MPI_SHI,grad_shield_side(1,1,1),ivec_count(0),
+     &  ivec_displ(0),
+     &  MPI_SHI,FG_COMM,IERR)
+       call MPI_Allgatherv(grad_shield_loc(1,1,ivec_start),
+     &  ivec_count(fg_rank1),
+     &  MPI_SHI,grad_shield_loc(1,1,1),ivec_count(0),
+     &  ivec_displ(0),
+     &  MPI_SHI,FG_COMM,IERR)
+#ifdef DEBUG
+       write(iout,*) "after reduce fac_shield reduce"
+       do i=1,nres
+        write(2,*) "fac",itype(i),fac_shield(i),grad_shield(1,i)
+        write(2,*) "list", shield_list(1,i),ishield_list(i),
+     &  grad_shield_side(1,1,i),grad_shield_loc(1,1,i)
+       enddo
+#endif
+C#undef DEBUG
+      endif
+#ifdef DEBUG
+      do i=1,nres
+      write(iout,*) fac_shield(i),ishield_list(i),i,grad_shield(1,i)
+        do j=1,ishield_list(i)
+         write(iout,*) "grad", grad_shield_side(1,j,i),
+     &   grad_shield_loc(1,j,i)
+        enddo
+      enddo
+#endif
       endif
 c      print *,"Processor",myrank," left VEC_AND_DERIV"
       if (ipot.lt.6) then
@@ -300,6 +360,8 @@ C based on partition function
 C      print *,"przed lipidami"
       if (wliptran.gt.0) then
         call Eliptransfer(eliptran)
+      else
+       eliptran=0.0d0
       endif
 C      print *,"za lipidami"
       if (AFMlog.gt.0) then
@@ -413,11 +475,11 @@ cMS$ATTRIBUTES C ::  proc_proc
         time00=MPI_Wtime()
         call MPI_Reduce(enebuff(0),energia(0),n_ene+1,
      &    MPI_DOUBLE_PRECISION,MPI_SUM,king,FG_COMM,IERR)
-#ifdef DEBUG
+C#ifdef DEBUG
         write (iout,*) "energies after REDUCE"
         call enerprint(energia)
         call flush(iout)
-#endif
+C#endif
         time_Reduce=time_Reduce+MPI_Wtime()-time00
       endif
       if (fg_rank.eq.0) then
@@ -4696,11 +4758,13 @@ C        else
 C        fac_shield(i)=0.4
 C        fac_shield(j)=0.6
         endif
+C         if (j.eq.78)
+C     &   write(iout,*) i,j,fac_shield(i),fac_shield(j)
         eello_turn3=eello_turn3+0.5d0*(pizda(1,1)+pizda(2,2))
      &  *fac_shield(i)*fac_shield(j)
         eello_t3=0.5d0*(pizda(1,1)+pizda(2,2))
      &  *fac_shield(i)*fac_shield(j)
-C#ifdef NEWCORR
+#ifdef NEWCORR
 C Derivatives in theta
         gloc(nphi+i,icg)=gloc(nphi+i,icg)
      &  +0.5d0*(gpizda1(1,1)+gpizda1(2,2))*wturn3
@@ -4708,7 +4772,7 @@ C Derivatives in theta
         gloc(nphi+i+1,icg)=gloc(nphi+i+1,icg)
      &  +0.5d0*(gpizda2(1,1)+gpizda2(2,2))*wturn3
      &   *fac_shield(i)*fac_shield(j)
-C#endif
+#endif
 
 C        if (energy_dec) write (iout,'(a6,2i5,0pf7.3)')
 C Derivatives in shield mode
@@ -11527,19 +11591,29 @@ C first for shielding is setting of function of side-chains
       include 'COMMON.IOUNITS'
       include 'COMMON.SHIELD'
       include 'COMMON.INTERACT'
+      include 'COMMON.LOCAL'
+
 C this is the squar root 77 devided by 81 the epislion in lipid (in protein)
       double precision div77_81/0.974996043d0/,
      &div4_81/0.2222222222d0/,sh_frac_dist_grad(3)
-
+  
 C the vector between center of side_chain and peptide group
        double precision pep_side(3),long,side_calf(3),
      &pept_group(3),costhet_grad(3),cosphi_grad_long(3),
      &cosphi_grad_loc(3),pep_side_norm(3),side_calf_norm(3)
+C      write(2,*) "ivec",ivec_start,ivec_end
+      do i=1,nres
+        fac_shield(i)=0.0d0
+        do j=1,3
+        grad_shield(j,i)=0.0d0
+        enddo
+      enddo
 C the line belowe needs to be changed for FGPROC>1
-      do i=iatscp_s,iatscp_e
+      do i=ivec_start,ivec_end
 C      do i=1,nres-1
-      if ((itype(i).eq.ntyp1).and.itype(i+1).eq.ntyp1) cycle
+C      if ((itype(i).eq.ntyp1).and.itype(i+1).eq.ntyp1) cycle
       ishield_list(i)=0
+      if ((itype(i).eq.ntyp1).and.itype(i+1).eq.ntyp1) cycle
 Cif there two consequtive dummy atoms there is no peptide group between them
 C the line below has to be changed for FGPROC>1
       VolumeTotal=0.0
@@ -11572,6 +11646,7 @@ C now sscale fraction
 C       print *,buff_shield,"buff"
 C now sscale
         if (sh_frac_dist.le.0.0) cycle
+C        print *,ishield_list(i),i
 C If we reach here it means that this side chain reaches the shielding sphere
 C Lets add him to the list for gradient       
         ishield_list(i)=ishield_list(i)+1
@@ -11686,7 +11761,7 @@ C grad_shield_side is Cbeta sidechain gradient
       VolumeTotal=VolumeTotal+VofOverlap*scale_fac_dist
       enddo
       fac_shield(i)=VolumeTotal*wshield+(1.0d0-wshield)
-C      write(2,*) "TOTAL VOLUME",i,VolumeTotal,fac_shield(i)
+C      write(2,*) "TOTAL VOLUME",i,itype(i),fac_shield(i)
       enddo
       return
       end
@@ -11861,6 +11936,7 @@ C first sugare-phosphate group for NARES this would be peptide group
 C for UNRES
       do i=1,nres
 C lets ommit dummy atoms for now
+       
        if ((itype(i).eq.ntyp1).or.(itype(i+1).eq.ntyp1)) cycle
 C now calculate distance from center of tube and direction vectors
       vectube(1)=mod((c(1,i)+c(1,i+1))/2.0d0,boxxsize)
index 43f9baa..e15ab61 100644 (file)
@@ -26,6 +26,7 @@ cMS$ATTRIBUTES C ::  proc_proc
       include 'COMMON.LOCAL'
       include 'COMMON.MD'
       include 'COMMON.CONTROL'
+      include 'COMMON.SHIELD'
 c      write(iout,'(a,i2)')'Calling etotal_long ipot=',ipot
       if (modecalc.eq.12.or.modecalc.eq.14) then
 #ifdef MPI
@@ -133,10 +134,60 @@ C Calculate electrostatic (H-bonding) energy of the main chain.
 C
   107 continue
       call vec_and_deriv
-      if (shield_mode.gt.0) then
+      if (shield_mode.eq.1) then
        call set_shield_fac
+      else if  (shield_mode.eq.2) then
+       call set_shield_fac2
+      if (nfgtasks.gt.1) then
+C#define DEBUG
+#ifdef DEBUG
+       write(iout,*) "befor reduce fac_shield reduce"
+       do i=1,nres
+        write(2,*) "fac",itype(i),fac_shield(i),grad_shield(1,i)
+        write(2,*) "list", shield_list(1,i),ishield_list(i),
+     &  grad_shield_side(1,1,i),grad_shield_loc(1,1,i)
+       enddo
+#endif
+       call MPI_Allgatherv(fac_shield(ivec_start),ivec_count(fg_rank1),
+     &  MPI_DOUBLE_PRECISION,fac_shield(1),ivec_count(0),ivec_displ(0),
+     &  MPI_DOUBLE_PRECISION,FG_COMM,IERR)
+       call MPI_Allgatherv(shield_list(1,ivec_start),
+     &  ivec_count(fg_rank1),
+     &  MPI_I50,shield_list(1,1),ivec_count(0),
+     &  ivec_displ(0),
+     &  MPI_I50,FG_COMM,IERR)
+       call MPI_Allgatherv(ishield_list(ivec_start),
+     &  ivec_count(fg_rank1),
+     &  MPI_INTEGER,ishield_list(1),ivec_count(0),
+     &  ivec_displ(0),
+     &  MPI_INTEGER,FG_COMM,IERR)
+       call MPI_Allgatherv(grad_shield(1,ivec_start),
+     &  ivec_count(fg_rank1),
+     &  MPI_UYZ,grad_shield(1,1),ivec_count(0),
+     &  ivec_displ(0),
+     &  MPI_UYZ,FG_COMM,IERR)
+       call MPI_Allgatherv(grad_shield_side(1,1,ivec_start),
+     &  ivec_count(fg_rank1),
+     &  MPI_SHI,grad_shield_side(1,1,1),ivec_count(0),
+     &  ivec_displ(0),
+     &  MPI_SHI,FG_COMM,IERR)
+       call MPI_Allgatherv(grad_shield_loc(1,1,ivec_start),
+     &  ivec_count(fg_rank1),
+     &  MPI_SHI,grad_shield_loc(1,1,1),ivec_count(0),
+     &  ivec_displ(0),
+     &  MPI_SHI,FG_COMM,IERR)
+#ifdef DEBUG
+       write(iout,*) "after reduce fac_shield reduce"
+       do i=1,nres
+        write(2,*) "fac",itype(i),fac_shield(i),grad_shield(1,i)
+        write(2,*) "list", shield_list(1,i),ishield_list(i),
+     &  grad_shield_side(1,1,i),grad_shield_loc(1,1,i)
+       enddo
+#endif
+C#undef DEBUG
       endif
 
+      endif
       if (ipot.lt.6) then
 #ifdef SPLITELE
          if (welec.gt.0d0.or.wvdwpp.gt.0d0.or.wel_loc.gt.0d0.or.
@@ -235,7 +286,8 @@ C
       energia(10)=eturn6
       energia(20)=Uconst+Uconst_back
       call sum_energy(energia,.true.)
-c      write (iout,*) "Exit ETOTAL_LONG"
+C      call enerprint
+      write (iout,*) "Exit ETOTAL_LONG"
       call flush(iout)
       return
       end
@@ -267,7 +319,7 @@ cMS$ATTRIBUTES C ::  proc_proc
       include 'COMMON.VAR'
       include 'COMMON.LOCAL'
       include 'COMMON.CONTROL'
-
+      include 'COMMON.SHIELD'
 c      write(iout,'(a,i2)')'Calling etotal_short ipot=',ipot
 c      call flush(iout)
       if (modecalc.eq.12.or.modecalc.eq.14) then
@@ -399,36 +451,86 @@ C
 C Calculate electrostatic (H-bonding) energy of the main chain.
 C
   107 continue
-      call vec_and_deriv
-      if (shield_mode.gt.0) then
-       call set_shield_fac
-      endif
-
-      if (ipot.lt.6) then
-#ifdef SPLITELE
-         if (welec.gt.0d0.or.wvdwpp.gt.0d0.or.wel_loc.gt.0d0.or.
-     &       wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
-     &       .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
-     &       .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
-#else
-         if (welec.gt.0d0.or.wel_loc.gt.0d0.or.
-     &       wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
-     &       .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
-     &       .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
-#endif
-           call eelec_scale(ees,evdw1,eel_loc,eello_turn3,eello_turn4)
-         else
-            ees=0
-            evdw1=0
-            eel_loc=0
-            eello_turn3=0
-            eello_turn4=0
-         endif
-      else
+C     call vec_and_deriv
+C     if (shield_mode.eq.1) then
+C       call set_shield_fac
+C      else if  (shield_mode.eq.2) then
+C       call set_shield_fac2
+C      if (nfgtasks.gt.1) then
+C#define DEBUG
+C#ifdef DEBUG
+C       write(iout,*) "befor reduce fac_shield reduce"
+C       do i=1,nres
+C        write(2,*) "fac",itype(i),fac_shield(i),grad_shield(1,i)
+C        write(2,*) "list", shield_list(1,i),ishield_list(i),
+C     &  grad_shield_side(1,1,i),grad_shield_loc(1,1,i)
+C       enddo
+C#endif
+C       call MPI_Allgatherv(fac_shield(ivec_start),ivec_count(fg_rank1),
+C     &  MPI_DOUBLE_PRECISION,fac_shield(1),ivec_count(0),ivec_displ(0),
+C     &  MPI_DOUBLE_PRECISION,FG_COMM,IERR)
+C       call MPI_Allgatherv(shield_list(1,ivec_start),
+C     &  ivec_count(fg_rank1),
+C     &  MPI_I50,shield_list(1,1),ivec_count(0),
+C     &  ivec_displ(0),
+C     &  MPI_I50,FG_COMM,IERR)
+C       call MPI_Allgatherv(ishield_list(ivec_start),
+C     &  ivec_count(fg_rank1),
+C     &  MPI_INTEGER,ishield_list(1),ivec_count(0),
+C     &  ivec_displ(0),
+C     &  MPI_INTEGER,FG_COMM,IERR)
+C       call MPI_Allgatherv(grad_shield(1,ivec_start),
+C     &  ivec_count(fg_rank1),
+C     &  MPI_UYZ,grad_shield(1,1),ivec_count(0),
+C     &  ivec_displ(0),
+C     &  MPI_UYZ,FG_COMM,IERR)
+C       call MPI_Allgatherv(grad_shield_side(1,1,ivec_start),
+C     &  ivec_count(fg_rank1),
+C     &  MPI_SHI,grad_shield_side(1,1,1),ivec_count(0),
+C     &  ivec_displ(0),
+C     &  MPI_SHI,FG_COMM,IERR)
+C       call MPI_Allgatherv(grad_shield_loc(1,1,ivec_start),
+C     &  ivec_count(fg_rank1),
+C     &  MPI_SHI,grad_shield_loc(1,1,1),ivec_count(0),
+C     &  ivec_displ(0),
+C     &  MPI_SHI,FG_COMM,IERR)
+C#ifdef DEBUG
+C       write(iout,*) "after reduce fac_shield reduce"
+C       do i=1,nres
+C        write(2,*) "fac",itype(i),fac_shield(i),grad_shield(1,i)
+C        write(2,*) "list", shield_list(1,i),ishield_list(i),
+C     &  grad_shield_side(1,1,i),grad_shield_loc(1,1,i)
+C       enddo
+C#endif
+C#undef DEBUG
+C      endif
+C
+C      endif
+C      if (ipot.lt.6) then
+C#ifdef SPLITELE
+C         if (welec.gt.0d0.or.wvdwpp.gt.0d0.or.wel_loc.gt.0d0.or.
+C     &       wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
+C     &       .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
+C     &       .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
+C#else
+C         if (welec.gt.0d0.or.wel_loc.gt.0d0.or.
+C     &       wturn3.gt.0d0.or.wturn4.gt.0d0 .or. wcorr.gt.0.0d0
+C     &       .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.d0
+C     &       .or. wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0 ) then
+C#endif
+C           call eelec_scale(ees,evdw1,eel_loc,eello_turn3,eello_turn4)
+C         else
+C            ees=0
+C            evdw1=0
+C            eel_loc=0
+C            eello_turn3=0
+C            eello_turn4=0
+C         endif
+C      else
 c        write (iout,*) "Soft-spheer ELEC potential"
-        call eelec_soft_sphere(ees,evdw1,eel_loc,eello_turn3,
-     &   eello_turn4)
-      endif
+C        call eelec_soft_sphere(ees,evdw1,eel_loc,eello_turn3,
+C     &   eello_turn4)
+C      endif
 
 c
 c Calculate the short-range part of Evdwpp
@@ -509,10 +611,10 @@ C
       energia(17)=estr
       energia(19)=edihcnstr
       energia(21)=esccor
-c      write (iout,*) "ETOTAL_SHORT before SUM_ENERGY"
+      write (iout,*) "ETOTAL_SHORT before SUM_ENERGY"
       call flush(iout)
       call sum_energy(energia,.true.)
-c      write (iout,*) "Exit ETOTAL_SHORT"
+      write (iout,*) "Exit ETOTAL_SHORT"
       call flush(iout)
       return
       end
index 1d8f3d1..131c57f 100644 (file)
@@ -408,20 +408,31 @@ C end of zero grad for shielding
           gg_tube(j,i)=0.0d0
           gg_tube_sc(j,i)=0.0d0
 C grad_shield_side is Cbeta sidechain gradient
-          do kk=1,maxshieldlist
-           grad_shield_side(j,kk,i)=0.0d0
-           grad_shield_loc(j,kk,i)=0.0d0
+C          do kk=1,maxcontsshi
+C           grad_shield_side(j,kk,i)=0.0d0
+C           grad_shield_loc(j,kk,i)=0.0d0
 
 C grad_shield_side_ca is Calfa sidechain gradient
 
 
 C           grad_shield_side_ca(j,kk,i)=0.0d0
-          enddo
+C          enddo
           do intertyp=1,3
            gloc_sc(intertyp,i,icg)=0.0d0
           enddo
         enddo
       enddo
+      do i=1,nres
+       do j=1,maxcontsshi
+       shield_list(j,i)=0
+        do k=1,3
+C           print *,i,j,k
+           grad_shield_side(k,j,i)=0.0d0
+           grad_shield_loc(k,j,i)=0.0d0
+         enddo
+       enddo
+       ishield_list(i)=0
+      enddo
 C
 C Initialize the gradient of local energy terms.
 C
index 6eafc7d..e9af07a 100644 (file)
@@ -1001,9 +1001,15 @@ c          call flush(iout)
         call MPI_Group_free(cont_to_group,ierr)
         call MPI_Type_contiguous(3,MPI_DOUBLE_PRECISION,MPI_UYZ,IERROR)
         call MPI_Type_commit(MPI_UYZ,IERROR)
+        call MPI_Type_contiguous(maxcontsshi,MPI_INTEGER,MPI_I50,IERROR)
+        call MPI_Type_commit(MPI_I50,IERROR)
         call MPI_Type_contiguous(18,MPI_DOUBLE_PRECISION,MPI_UYZGRAD,
      &    IERROR)
         call MPI_Type_commit(MPI_UYZGRAD,IERROR)
+         impishi=maxcontsshi*3
+        call MPI_Type_contiguous(impishi,MPI_DOUBLE_PRECISION,
+     &   MPI_SHI,IERROR)
+        call MPI_Type_commit(MPI_SHI,IERROR)
         call MPI_Type_contiguous(2,MPI_DOUBLE_PRECISION,MPI_MU,IERROR)
         call MPI_Type_commit(MPI_MU,IERROR)
         call MPI_Type_contiguous(4,MPI_DOUBLE_PRECISION,MPI_MAT1,IERROR)