Merge branch 'prerelease-3.2.1'
authorCezary Czaplewski <czarek@chem.univ.gda.pl>
Thu, 7 May 2015 00:35:28 +0000 (02:35 +0200)
committerCezary Czaplewski <czarek@chem.univ.gda.pl>
Thu, 7 May 2015 00:35:28 +0000 (02:35 +0200)
source/unres/src_MD-M/lagrangian_lesyng.F
source/unres/src_MD/COMMON.DERIV
source/unres/src_MD/COMMON.SCCOR
source/unres/src_MD/checkder_p.F
source/unres/src_MD/energy_p_new_barrier.F
source/unres/src_MD/initialize_p.F
source/unres/src_MD/intcartderiv.F
source/unres/src_MD/lagrangian_lesyng.F
source/unres/src_MD/unres.F

index 89fde29..3398091 100644 (file)
@@ -476,7 +476,7 @@ c---------------------------------------------------------------------------
       include 'COMMON.TIME1'
       include 'COMMON.MD'
       double precision z(dimen3),d_a_tmp(dimen3),temp(maxres6),time00
-     &time01
+     &,time01,zcopy(dimen3)
 #ifdef MPI
       if (nfgtasks.gt.1) then
         if (fg_rank.eq.0) then
@@ -497,7 +497,10 @@ c        call MPI_Barrier(FG_COMM,IERROR)
         time00=MPI_Wtime()
         call MPI_Scatterv(z,ng_counts(0),ng_start(0),
      &    MPI_DOUBLE_PRECISION,
-     &    z,3*my_ng_count,MPI_DOUBLE_PRECISION,king,FG_COMM,IERR)
+     &    zcopy,3*my_ng_count,MPI_DOUBLE_PRECISION,king,FG_COMM,IERR)
+         do i=1,3*my_ng_count
+           z(i)=zcopy(i)
+         enddo
 c        write (2,*) "My chunk of z"
 c        do i=1,3*my_ng_count
 c          write (2,*) i,z(i)
@@ -628,7 +631,7 @@ c---------------------------------------------------------------------------
       include 'COMMON.LANGEVIN.lang0'
 #endif
       double precision z(dimen3),d_a_tmp(dimen3),temp(maxres6),time00
-     &time01
+     &,time01,zcopy(dimen3)
 #ifdef MPI
       if (nfgtasks.gt.1) then
         if (fg_rank.eq.0) then
@@ -642,7 +645,11 @@ c        call MPI_Barrier(FG_COMM,IERROR)
         time00=MPI_Wtime()
         call MPI_Scatterv(z,ng_counts(0),ng_start(0),
      &    MPI_DOUBLE_PRECISION,
-     &    z,3*my_ng_count,MPI_DOUBLE_PRECISION,king,FG_COMM,IERR)
+     &    zcopy,3*my_ng_count,MPI_DOUBLE_PRECISION,king,FG_COMM,IERR)
+
+         do i=1,3*my_ng_count
+          z(i)=zcopy(i)
+         enddo
 c        write (2,*) "My chunk of z"
 c        do i=1,3*my_ng_count
 c          write (2,*) i,z(i)
index 6fdb1aa..e4c39c5 100644 (file)
@@ -2,7 +2,9 @@
      & gvdwpp,gel_loc,gel_loc_long,gvdwc_scpp,
      & gradx_scp,gvdwc_scp,ghpbx,ghpbc,gloc,gloc_x,dtheta,dphi,dalpha,
      & domega,gscloc,gsclocx,gradcorr,gradcorr_long,gradcorr5_long,
-     & gradcorr6_long,gcorr6_turn_long,gvdwcT,gvdwxT,gvdwx
+     & gradcorr6_long,gcorr6_turn_long,gvdwcT,gvdwxT,gvdwx,gloc_sc,
+     &                 dcostau,dsintau,dtauangle,dcosomicron,
+     &                 domicron
       integer nfl,icg
       common /derivatT/ gvdwcT(3,maxres),gvdwxT(3,maxres)
       common /derivat/ dcdv(6,maxdim),dxdv(6,maxdim),dxds(6,maxres),
      & gel_loc_turn4(maxvar),gel_loc_turn6(maxvar),gcorr_loc(maxvar),
      & g_corr5_loc(maxvar),g_corr6_loc(maxvar),gsccorc(3,maxres),
      & gsccorx(3,maxres),gsccor_loc(maxres),dtheta(3,2,maxres),
-     & gscloc(3,maxres),gsclocx(3,maxres),
+     & gscloc(3,maxres),gsclocx(3,maxres),gloc_sc(3,0:maxres2,10),
+     &    dcostau(3,3,3,maxres2),dsintau(3,3,3,maxres2),
+     &    dtauangle(3,3,3,maxres2),dcosomicron(3,3,3,maxres2),
+     &    domicron(3,3,3,maxres2),
      & dphi(3,3,maxres),dalpha(3,3,maxres),domega(3,3,maxres),nfl,icg
       double precision derx,derx_turn
       common /deriv_loc/ derx(3,5,2),derx_turn(3,5,2)
index 208d60b..623bbad 100644 (file)
@@ -1,18 +1,20 @@
 cc Parameters of the SCCOR term
       double precision v1sccor,v2sccor,vlor1sccor,
-     &                 vlor2sccor,vlor3sccor,gloc_sc,
-     &                 dcostau,dsintau,dtauangle,dcosomicron,
-     &                 domicron,v0sccor
+     &                 vlor2sccor,vlor3sccor,v0sccor
+C,gloc_sc,
+C     &                 dcostau,dsintau,dtauangle,dcosomicron,
+C     &                 domicron,v0sccor
       integer nterm_sccor,isccortyp,nsccortyp,nlor_sccor
       common/sccor/v1sccor(maxterm_sccor,3,-ntyp:ntyp,-ntyp:ntyp),
      &    v2sccor(maxterm_sccor,3,-ntyp:ntyp,-ntyp:ntyp),
-     &    v0sccor(maxterm_sccor,-ntyp:ntyp),
+     &    v0sccor(-ntyp:ntyp,-ntyp:ntyp),
      &    nterm_sccor(-ntyp:ntyp,-ntyp:ntyp),isccortyp(-ntyp:ntyp),
      &    nsccortyp,
      &    nlor_sccor(-ntyp:ntyp,-ntyp:ntyp),
      &    vlor1sccor(maxterm_sccor,20,20),
      &    vlor2sccor(maxterm_sccor,20,20),
-     &    vlor3sccor(maxterm_sccor,20,20),gloc_sc(3,0:maxres2,10),
-     &    dcostau(3,3,3,maxres2),dsintau(3,3,3,maxres2),
-     &    dtauangle(3,3,3,maxres2),dcosomicron(3,3,3,maxres2),
-     &    domicron(3,3,3,maxres2)
+     &    vlor3sccor(maxterm_sccor,20,20)
+C,gloc_sc(3,0:maxres2,10),
+C     &    dcostau(3,3,3,maxres2),dsintau(3,3,3,maxres2),
+C     &    dtauangle(3,3,3,maxres2),dcosomicron(3,3,3,maxres2),
+C     &    domicron(3,3,3,maxres2)
index 4d0379e..fda3a7b 100644 (file)
@@ -284,7 +284,7 @@ C Check the gradient of the energy in Cartesian coordinates.
 c      call intcartderiv
 c      call checkintcartgrad
       call zerograd
-      aincr=1.0D-5
+      aincr=1.0D-6
       write(iout,*) 'Calling CHECK_ECARTINT.'
       nf=0
       icall=0
@@ -534,6 +534,7 @@ c-------------------------------------------------------------------------
          tauangle(1,i+1)=beta(i-1+nres,i-1,i,i+1)
          omicron(1,i)=alpha(i-2,i-1,i-1+nres)
          omicron(2,i)=alpha(i-1+nres,i-1,i)
+C        print *,i,omicron(1,i),omicron(2,i)
         endif
         if (itype(i).ne.10) then
          tauangle(2,i+1)=beta(i-2,i-1,i,i+nres)
index 0bcd6f3..945c363 100644 (file)
@@ -3023,6 +3023,9 @@ C
 C Loop over i,i+2 and i,i+3 pairs of the peptide groups
 C
       do i=iturn3_start,iturn3_end
+C        if (itype(i).eq.21 .or. itype(i+1).eq.21
+C     &  .or. itype(i+2).eq.21 .or. itype(i+3).eq.21.or.itype(i+4).eq.21)
+C     &  cycle
         dxi=dc(1,i)
         dyi=dc(2,i)
         dzi=dc(3,i)
@@ -3038,6 +3041,10 @@ C
         num_cont_hb(i)=num_conti
       enddo
       do i=iturn4_start,iturn4_end
+C        if (itype(i).eq.21 .or. itype(i+1).eq.21
+C     &  .or. itype(i+2).eq.21 .or. itype(i+3).eq.21.or.itype(i+4).eq.21
+C     &  .or. itype(i+5).eq.21)
+C     & cycle
         dxi=dc(1,i)
         dyi=dc(2,i)
         dzi=dc(3,i)
@@ -3056,6 +3063,8 @@ c
 c Loop over all pairs of interacting peptide groups except i,i+2 and i,i+3
 c
       do i=iatel_s,iatel_e
+C          if (itype(i).eq.21 .or. itype(i+1).eq.21
+C     &.or.itype(i+2)) cycle
         dxi=dc(1,i)
         dyi=dc(2,i)
         dzi=dc(3,i)
@@ -3068,6 +3077,8 @@ c
 c        write (iout,*) 'i',i,' ielstart',ielstart(i),' ielend',ielend(i)
         num_conti=num_cont_hb(i)
         do j=ielstart(i),ielend(i)
+C          if (itype(j).eq.21 .or. itype(j+1).eq.21
+C     &.or.itype(j+2)) cycle
           call eelecij(i,j,ees,evdw1,eel_loc)
         enddo ! j
         num_cont_hb(i)=num_conti
@@ -5959,17 +5970,19 @@ c      lprn=.true.
 c      write (iout,*) "EBACK_SC_COR",iphi_start,iphi_end,nterm_sccor
       esccor=0.0D0
       do i=itau_start,itau_end
+C        do i=42,42
         esccor_ii=0.0D0
         if ((itype(i-2).eq.ntyp1).or.(itype(i-1).eq.ntyp1)) cycle
         isccori=isccortyp(itype(i-2))
         isccori1=isccortyp(itype(i-1))
         phii=phi(i)
+
 cccc  Added 9 May 2012
 cc Tauangle is torsional engle depending on the value of first digit 
 c(see comment below)
 cc Omicron is flat angle depending on the value of first digit 
 c(see comment below)
-
+C        print *,i,tauangle(1,i)
         
         do intertyp=1,3 !intertyp
 cc Added 09 May 2012 (Adasko)
@@ -5996,6 +6009,7 @@ c   3 = SC...Ca...Ca...SCi
           esccor=esccor+v1ij*cosphi+v2ij*sinphi
           gloci=gloci+j*(v2ij*cosphi-v1ij*sinphi)
         enddo
+C        print *,i,tauangle(1,i),gloci
         gloc_sc(intertyp,i-3,icg)=gloc_sc(intertyp,i-3,icg)+wsccor*gloci
 c        write (iout,*) "WTF",intertyp,i,itype(i),v1ij*cosphi+v2ij*sinphi
 c     &gloc_sc(intertyp,i-3,icg)
index 565ccaf..a7ee3b7 100644 (file)
@@ -565,9 +565,9 @@ C Partition local interactions
       iphi_end=iturn3_end+2
       iturn3_start=iturn3_start-1
       iturn3_end=iturn3_end-1
-      call int_bounds(nres-3,itau_start,itau_end) 
-      itau_start=itau_start+3
-      itau_end=itau_end+3
+      call int_bounds(nres-2,itau_start,itau_end) 
+      itau_start=itau_start+2
+      itau_end=itau_end+2
       call int_bounds(nres-3,iphi1_start,iphi1_end)
       iphi1_start=iphi1_start+3
       iphi1_end=iphi1_end+3
@@ -1094,7 +1094,7 @@ c        write (iout,*) "MPI_ROTAT2",MPI_ROTAT2
       idihconstr_end=ndih_constr
       iphid_start=iphi_start
       iphid_end=iphi_end-1
-      itau_start=4
+      itau_start=3
       itau_end=nres
       ibond_start=2
       ibond_end=nres-1
index 889bedd..fcc2e86 100644 (file)
@@ -35,7 +35,7 @@ c We need dtheta(:,:,i-1) to compute dphi(:,:,i)
       do i=3,nres
 #endif
         cost=dcos(theta(i))
-       sint=sqrt(1-cost*cost)
+       sint=dsqrt(1-cost*cost)
         do j=1,3
           dcostheta(j,1,i)=-(dc_norm(j,i-1)+cost*dc_norm(j,i-2))/
      &   vbld(i-1)
@@ -54,9 +54,9 @@ c We need dtheta(:,:,i-1) to compute dphi(:,:,i)
 #endif
       if ((itype(i-1).ne.10).and.(itype(i-1).ne.21)) then
         cost1=dcos(omicron(1,i))
-       sint1=sqrt(1-cost1*cost1)
+       sint1=dsqrt(1-cost1*cost1)
         cost2=dcos(omicron(2,i))
-        sint2=sqrt(1-cost2*cost2)
+        sint2=dsqrt(1-cost2*cost2)
         do j=1,3
 CC Calculate derivative over first omicron (Cai-2,Cai-1,SCi-1) 
           dcosomicron(j,1,1,i)=-(dc_norm(j,i-1+nres)+
@@ -149,7 +149,7 @@ c   Obtaining the gamma derivatives from cosine derivative
         endif                                                                                           
       enddo
 
-      do i=1,nres-1
+      do i=1,nres
        do j=1,3
         dc_norm2(j,i+nres)=-dc_norm(j,i+nres)
        enddo
@@ -213,15 +213,15 @@ c   Obtaining the gamma derivatives from cosine derivative
            dcostau(j,1,1,i)=fac1*dcosomicron(j,2,2,i-1)+fac3*
      &     dcosomicron(j,2,2,i-1)-fac0*(dc_norm(j,i-1)-scalp*
      &     (dc_norm2(j,i-2+nres)))/vbld(i-2+nres)
-           dtauangle(j,1,1,i)=-1/sing*dcostau(j,1,1,i)
+           dtauangle(j,1,1,i)=-1.0d0/sing*dcostau(j,1,1,i)
            dcostau(j,1,2,i)=fac1*dcosomicron(j,2,1,i-1)+fac2*
      &     dcostheta(j,1,i)+fac3*dcosomicron(j,2,1,i-1)+fac4*
      &     dcostheta(j,1,i)
-           dtauangle(j,1,2,i)=-1/sing*dcostau(j,1,2,i)
+           dtauangle(j,1,2,i)=-1.0d0/sing*dcostau(j,1,2,i)
            dcostau(j,1,3,i)=fac2*dcostheta(j,2,i)+fac4*
      &     dcostheta(j,2,i)-fac0*(-dc_norm(j,i-2+nres)-scalp*
      &     dc_norm(j,i-1))/vbld(i)
-           dtauangle(j,1,3,i)=-1/sing*dcostau(j,1,3,i)
+           dtauangle(j,1,3,i)=-1.0d0/sing*dcostau(j,1,3,i)
 c         write (iout,*) "else",i
          enddo
         endif
@@ -287,15 +287,15 @@ c   Obtaining the gamma derivatives from cosine derivative
            dcostau(j,2,1,i)=fac1*dcostheta(j,1,i-1)+fac3*
      &     dcostheta(j,1,i-1)-fac0*(dc_norm(j,i-1+nres)-scalp*
      &     dc_norm(j,i-3))/vbld(i-2)
-           dtauangle(j,2,1,i)=-1/sing*dcostau(j,2,1,i)
+           dtauangle(j,2,1,i)=-1.0d0/sing*dcostau(j,2,1,i)
            dcostau(j,2,2,i)=fac1*dcostheta(j,2,i-1)+fac2*
      &     dcosomicron(j,1,1,i)+fac3*dcostheta(j,2,i-1)+fac4*
      &     dcosomicron(j,1,1,i)
-           dtauangle(j,2,2,i)=-1/sing*dcostau(j,2,2,i)
+           dtauangle(j,2,2,i)=-1.0d0/sing*dcostau(j,2,2,i)
            dcostau(j,2,3,i)=fac2*dcosomicron(j,1,2,i)+fac4*
      &     dcosomicron(j,1,2,i)-fac0*(dc_norm(j,i-3)-scalp*
      &     dc_norm(j,i-1+nres))/vbld(i-1+nres)
-           dtauangle(j,2,3,i)=-1/sing*dcostau(j,2,3,i)
+           dtauangle(j,2,3,i)=-1.0d0/sing*dcostau(j,2,3,i)
 c        write(iout,*) i,j,"else", dtauangle(j,2,3,i) 
          enddo
         endif                                                                                            
@@ -360,15 +360,15 @@ c   Obtaining the gamma derivatives from cosine derivative
            dcostau(j,3,1,i)=fac1*dcosomicron(j,2,2,i-1)+fac3*
      &     dcosomicron(j,2,2,i-1)-fac0*(dc_norm(j,i-1+nres)-scalp*
      &     dc_norm2(j,i-2+nres))/vbld(i-2+nres)
-           dtauangle(j,3,1,i)=-1/sing*dcostau(j,3,1,i)
+           dtauangle(j,3,1,i)=-1.0d0/sing*dcostau(j,3,1,i)
            dcostau(j,3,2,i)=fac1*dcosomicron(j,2,1,i-1)+fac2*
      &     dcosomicron(j,1,1,i)+fac3*dcosomicron(j,2,1,i-1)+fac4*
      &     dcosomicron(j,1,1,i)
-           dtauangle(j,3,2,i)=-1/sing*dcostau(j,3,2,i)
+           dtauangle(j,3,2,i)=-1.0d0/sing*dcostau(j,3,2,i)
            dcostau(j,3,3,i)=fac2*dcosomicron(j,1,2,i)+fac4*
      &     dcosomicron(j,1,2,i)-fac0*(dc_norm2(j,i-2+nres)-scalp*
      &     dc_norm(j,i-1+nres))/vbld(i-1+nres)
-           dtauangle(j,3,3,i)=-1/sing*dcostau(j,3,3,i)
+           dtauangle(j,3,3,i)=-1.0d0/sing*dcostau(j,3,3,i)
 c          write(iout,*) "else",i 
          enddo
         endif                                                                                            
index 8a9163a..775142b 100644 (file)
@@ -499,7 +499,7 @@ c---------------------------------------------------------------------------
       include 'COMMON.TIME1'
       include 'COMMON.MD'
       double precision z(dimen3),d_a_tmp(dimen3),temp(maxres6),time00
-     &time01
+     &,time01,zcopy(dimen3)
 #ifdef MPI
       if (nfgtasks.gt.1) then
         if (fg_rank.eq.0) then
@@ -520,7 +520,10 @@ c        call MPI_Barrier(FG_COMM,IERROR)
         time00=MPI_Wtime()
         call MPI_Scatterv(z,ng_counts(0),ng_start(0),
      &    MPI_DOUBLE_PRECISION,
-     &    z,3*my_ng_count,MPI_DOUBLE_PRECISION,king,FG_COMM,IERR)
+     &    zcopy,3*my_ng_count,MPI_DOUBLE_PRECISION,king,FG_COMM,IERR)
+         do i=1,3*my_ng_count
+           z(i)=zcopy(i)
+         enddo
 c        write (2,*) "My chunk of z"
 c        do i=1,3*my_ng_count
 c          write (2,*) i,z(i)
@@ -651,7 +654,7 @@ c---------------------------------------------------------------------------
       include 'COMMON.LANGEVIN.lang0'
 #endif
       double precision z(dimen3),d_a_tmp(dimen3),temp(maxres6),time00
-     &time01
+     &,time01,zcopy(dimen3)
 #ifdef MPI
       if (nfgtasks.gt.1) then
         if (fg_rank.eq.0) then
@@ -665,7 +668,11 @@ c        call MPI_Barrier(FG_COMM,IERROR)
         time00=MPI_Wtime()
         call MPI_Scatterv(z,ng_counts(0),ng_start(0),
      &    MPI_DOUBLE_PRECISION,
-     &    z,3*my_ng_count,MPI_DOUBLE_PRECISION,king,FG_COMM,IERR)
+     &    zcopy,3*my_ng_count,MPI_DOUBLE_PRECISION,king,FG_COMM,IERR)
+
+         do i=1,3*my_ng_count
+          z(i)=zcopy(i)
+         enddo
 c        write (2,*) "My chunk of z"
 c        do i=1,3*my_ng_count
 c          write (2,*) i,z(i)
index b14c040..a63047f 100644 (file)
@@ -736,6 +736,7 @@ c      enddo
       print *,'icheckgrad=',icheckgrad
       goto (10,20,30) icheckgrad
   10  call check_ecartint
+      call check_ecartint
       return
   20  call check_cartgrad
       return