intoduction of quartic restrains in multichain, bugfix in single chain
[unres.git] / source / unres / src_MD / parmread.F
index 0bcea2c..bfb4c22 100644 (file)
@@ -28,6 +28,7 @@ C
       include 'COMMON.SETUP'
       character*1 t1,t2,t3
       character*1 onelett(4) /"G","A","P","D"/
+      character*1 toronelet(-2:2) /"p","a","G","A","P"/
       logical lprint,LaTeX
       dimension blower(3,3,maxlob)
       dimension b(13)
@@ -102,13 +103,48 @@ C Read the parameters of the probability distribution/energy expression
 C of the virtual-bond valence angles theta
 C
       do i=1,ntyp
-        read (ithep,*,err=111,end=111) a0thet(i),(athet(j,i),j=1,2),
-     &    (bthet(j,i),j=1,2)
+        read (ithep,*,err=111,end=111) a0thet(i),(athet(j,i,1,1),j=1,2),
+     &    (bthet(j,i,1,1),j=1,2)
         read (ithep,*,err=111,end=111) (polthet(j,i),j=0,3)
-       read (ithep,*,err=111,end=111) (gthet(j,i),j=1,3)
-       read (ithep,*,err=111,end=111) theta0(i),sig0(i),sigc0(i)
-       sigc0(i)=sigc0(i)**2
+        read (ithep,*,err=111,end=111) (gthet(j,i),j=1,3)
+        read (ithep,*,err=111,end=111) theta0(i),sig0(i),sigc0(i)
+        sigc0(i)=sigc0(i)**2
       enddo
+      do i=1,ntyp
+      athet(1,i,1,-1)=athet(1,i,1,1)
+      athet(2,i,1,-1)=athet(2,i,1,1)
+      bthet(1,i,1,-1)=-bthet(1,i,1,1)
+      bthet(2,i,1,-1)=-bthet(2,i,1,1)
+      athet(1,i,-1,1)=-athet(1,i,1,1)
+      athet(2,i,-1,1)=-athet(2,i,1,1)
+      bthet(1,i,-1,1)=bthet(1,i,1,1)
+      bthet(2,i,-1,1)=bthet(2,i,1,1)
+      enddo
+      do i=-ntyp,-1
+      a0thet(i)=a0thet(-i)
+      athet(1,i,-1,-1)=athet(1,-i,1,1)
+      athet(2,i,-1,-1)=-athet(2,-i,1,1)
+      bthet(1,i,-1,-1)=bthet(1,-i,1,1)
+      bthet(2,i,-1,-1)=-bthet(2,-i,1,1)
+      athet(1,i,-1,1)=athet(1,-i,1,1)
+      athet(2,i,-1,1)=-athet(2,-i,1,1)
+      bthet(1,i,-1,1)=-bthet(1,-i,1,1)
+      bthet(2,i,-1,1)=bthet(2,-i,1,1)
+      athet(1,i,1,-1)=-athet(1,-i,1,1)
+      athet(2,i,1,-1)=athet(2,-i,1,1)
+      bthet(1,i,1,-1)=bthet(1,-i,1,1)
+      bthet(2,i,1,-1)=-bthet(2,-i,1,1)
+      theta0(i)=theta0(-i)
+      sig0(i)=sig0(-i)
+      sigc0(i)=sigc0(-i)
+       do j=0,3
+        polthet(j,i)=polthet(j,-i)
+       enddo
+       do j=1,3
+         gthet(j,i)=gthet(j,-i)
+       enddo
+      enddo
+
       close (ithep)
       if (lprint) then
       if (.not.LaTeX) then
@@ -119,7 +155,7 @@ C
      & '        B1    ','         B2   '        
         do i=1,ntyp
           write(iout,'(a3,i4,2x,5(1pe14.5))') restyp(i),i,
-     &        a0thet(i),(athet(j,i),j=1,2),(bthet(j,i),j=1,2)
+     &        a0thet(i),(athet(j,i,1,1),j=1,2),(bthet(j,i,1,1),j=1,2)
         enddo
         write (iout,'(/a/9x,5a/79(1h-))') 
      & 'Parameters of the expression for sigma(theta_c):',
@@ -146,7 +182,8 @@ C
      & '   b1*10^1    ','    b2*10^1   '        
         do i=1,ntyp
           write(iout,'(a3,1h&,2x,5(f8.3,1h&))') restyp(i),
-     &        a0thet(i),(100*athet(j,i),j=1,2),(10*bthet(j,i),j=1,2)
+     &        a0thet(i),(100*athet(j,i,1,1),j=1,2),
+     &        (10*bthet(j,i,1,1),j=1,2)
         enddo
        write (iout,'(/a/9x,5a/79(1h-))') 
      & 'Parameters of the expression for sigma(theta_c):',
@@ -173,6 +210,7 @@ C Kozlowska et al., J. Phys.: Condens. Matter 19 (2007) 285203
 C
       read (ithep,*,err=111,end=111) nthetyp,ntheterm,ntheterm2,
      &  ntheterm3,nsingle,ndouble
+C      print *, "tu"
       nntheterm=max0(ntheterm,ntheterm2,ntheterm3)
       read (ithep,*,err=111,end=111) (ithetyp(i),i=1,ntyp1)
       do i=-ntyp1,-1
@@ -212,6 +250,7 @@ c VAR:ntethtyp is type of theta potentials type currently 0=glycine
 c VAR:1=non-glicyne non-proline 2=proline
 c VAR:negative values for D-aminoacid
       do i=0,nthetyp
+C        print *,i
         do j=-nthetyp,nthetyp
           do k=-nthetyp,nthetyp
             read (ithep,'(6a)',end=111,err=111) res1
@@ -609,16 +648,11 @@ C
         do j=1,ntortyp
           do k=1,ntortyp
             read (itordp,'(3a1)',end=114,err=114) t1,t2,t3
-<<<<<<< HEAD
-c              write (iout,*) "OK onelett",
-c     &         i,j,k,t1,t2,t3
+              write (iout,*) "OK onelett",
+     &         i,j,k,t1,t2,t3
 
-            if (t1.ne.toronelet(i) .or. t2.ne.toronelet(j) 
-     &        .or. t3.ne.toronelet(k)) then
-=======
             if (t1.ne.onelett(i) .or. t2.ne.onelett(j) 
      &        .or. t3.ne.onelett(k)) then
->>>>>>> devel
               write (iout,*) "Error in double torsional parameter file",
      &         i,j,k,t1,t2,t3
 #ifdef MPI
@@ -645,16 +679,10 @@ c     &         i,j,k,t1,t2,t3
       if (lprint) then
       write (iout,*) 
       write (iout,*) 'Constants for double torsionals'
-<<<<<<< HEAD
       do iblock=1,2
       do i=0,ntortyp-1
         do j=-ntortyp+1,ntortyp-1
           do k=-ntortyp+1,ntortyp-1
-=======
-      do i=1,ntortyp
-        do j=1,ntortyp 
-          do k=1,ntortyp
->>>>>>> devel
             write (iout,*) 'ityp',i,' jtyp',j,' ktyp',k,
      &        ' nsingle',ntermd_1(i,j,k),' ndouble',ntermd_2(i,j,k)
             write (iout,*)
@@ -681,36 +709,29 @@ c     &         i,j,k,t1,t2,t3
           enddo
         enddo
       enddo
+      enddo
       endif
 #endif
 C Read of Side-chain backbone correlation parameters
 C Modified 11 May 2012 by Adasko
 CCC
 C
-<<<<<<< HEAD
-      read (isccor,*,end=119,err=119) nsccortyp
+      read (isccor,*,end=1113,err=1113) nsccortyp
 #ifdef SCCORPDB
-      read (isccor,*,end=119,err=119) (isccortyp(i),i=1,ntyp)
+      read (isccor,*,end=1113,err=1113) (isccortyp(i),i=1,ntyp)
       do i=-ntyp,-1
         isccortyp(i)=-isccortyp(-i)
       enddo
       iscprol=isccortyp(20)
-=======
-      read (isccor,*,end=1113,err=1113) nsccortyp
-      read (isccor,*,end=1113,err=1113) (isccortyp(i),i=1,ntyp)
->>>>>>> devel
 c      write (iout,*) 'ntortyp',ntortyp
       maxinter=3
 cc maxinter is maximum interaction sites
       do l=1,maxinter    
       do i=1,nsccortyp
-       do j=1,nsccortyp
-<<<<<<< HEAD
-         read (isccor,*,end=119,err=119) nterm_sccor(i,j),nlor_sccor(i,j)
-=======
-         read (isccor,*,end=1113,err=1113) nterm_sccor(i,j),
+        do j=1,nsccortyp
+         read (isccor,*,end=1113,err=1113) nterm_sccor(i,j),
      &             nlor_sccor(i,j)
->>>>>>> devel
+          print *,i,j,l
           v0ijsccor=0.0d0
           v0ijsccor1=0.0d0
           v0ijsccor2=0.0d0
@@ -719,9 +740,8 @@ cc maxinter is maximum interaction sites
           nterm_sccor(-i,j)=nterm_sccor(i,j)
           nterm_sccor(-i,-j)=nterm_sccor(i,j)
           nterm_sccor(i,-j)=nterm_sccor(i,j)  
-         do k=1,nterm_sccor(i,j)
-<<<<<<< HEAD
-           read (isccor,*,end=119,err=119) kk,v1sccor(k,l,i,j)
+          do k=1,nterm_sccor(i,j)
+           read (isccor,*,end=119,err=119) kk,v1sccor(k,l,i,j)
      &    ,v2sccor(k,l,i,j)
             if (j.eq.iscprol) then
               if (i.eq.isccortyp(10)) then
@@ -755,22 +775,16 @@ cc maxinter is maximum interaction sites
             endif
              endif
              endif 
-=======
-           read (isccor,*,end=1113,err=1113) kk,v1sccor(k,l,i,j)
-     &    ,v2sccor(k,l,i,j) 
->>>>>>> devel
+C         read (isccor,*,end=1113,err=1113) kk,v1sccor(k,l,i,j)
+C     &    ,v2sccor(k,l,i,j) 
             v0ijsccor=v0ijsccor+si*v1sccor(k,l,i,j)
             v0ijsccor1=v0ijsccor+si*v1sccor(k,l,-i,j)
             v0ijsccor2=v0ijsccor+si*v1sccor(k,l,i,-j)
             v0ijsccor3=v0ijsccor+si*v1sccor(k,l,-i,-j)
             si=-si
           enddo
-         do k=1,nlor_sccor(i,j)
-<<<<<<< HEAD
-            read (isccor,*,end=119,err=119) kk,vlor1sccor(k,i,j),
-=======
+         do k=1,nlor_sccor(i,j)
             read (isccor,*,end=1113,err=1113) kk,vlor1sccor(k,i,j),
->>>>>>> devel
      &        vlor2sccor(k,i,j),vlor3sccor(k,i,j) 
             v0ijsccor=v0ijsccor+vlor1sccor(k,i,j)/
      &(1+vlor3sccor(k,i,j)**2)
@@ -854,13 +868,9 @@ C
 c        b1(1,i)=0.0d0
 c        b1(2,i)=0.0d0
         B1tilde(1,i) = b(3)
-<<<<<<< HEAD
         B1tilde(2,i) =-b(5)
-        B1tilde(1,-i) =-b(3)
-        B1tilde(2,-i) =b(5)
-=======
-        B1tilde(2,i) =-b(5) 
->>>>>>> devel
+C        B1tilde(1,-i) =-b(3)
+C        B1tilde(2,-i) =b(5)
 c        b1tilde(1,i)=0.0d0
 c        b1tilde(2,i)=0.0d0
         B2(1,i)  = b(2)