Usuniecie diagnostyki
[unres.git] / source / unres / src_MD / parmread.F
index b1edf11..d6dbc07 100644 (file)
@@ -314,13 +314,47 @@ C
       endif
       write (2,*) "Start reading THETA_PDB"
       do i=1,ntyp
-        read (ithep_pdb,*,err=111,end=111) a0thet(i),(athet(j,i),j=1,2),
-     &    (bthet(j,i),j=1,2)
-        read (ithep_pdb,*,err=111,end=111) (polthet(j,i),j=0,3)
-       read (ithep_pdb,*,err=111,end=111) (gthet(j,i),j=1,3)
-       read (ithep_pdb,*,err=111,end=111) theta0(i),sig0(i),sigc0(i)
+        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
       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
       write (2,*) "End reading THETA_PDB"
       close (ithep_pdb)
 #endif
@@ -659,9 +693,10 @@ C
       read (isccor,*,end=113,err=113) nsccortyp
 #ifdef SCCORPDB
       read (isccor,*,end=113,err=113) (isccortyp(i),i=1,ntyp)
-#else
-      read (isccor,*,end=113,err=113) (isccortyp(i),i=-ntyp,ntyp)
-#endif
+      do i=-ntyp,-1
+        isccortyp(i)=-isccortyp(-i)
+      enddo
+      iscprol=isccortyp(20)
 c      write (iout,*) 'ntortyp',ntortyp
       maxinter=3
 cc maxinter is maximum interaction sites
@@ -670,12 +705,52 @@ cc maxinter is maximum interaction sites
        do j=1,nsccortyp
          read (isccor,*,end=113,err=113) nterm_sccor(i,j),nlor_sccor(i,j)
           v0ijsccor=0.0d0
+          v0ijsccor1=0.0d0
+          v0ijsccor2=0.0d0
+          v0ijsccor3=0.0d0
           si=-1.0d0
-  
+          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)
            read (isccor,*,end=113,err=113) kk,v1sccor(k,l,i,j)
-     &    ,v2sccor(k,l,i,j) 
+     &    ,v2sccor(k,l,i,j)
+            if (j.eq.iscprol) then
+              if (i.eq.isccortyp(10)) then
+              v1sccor(k,l,i,-j)=v1sccor(k,l,i,j)
+              v2sccor(k,l,i,-j)=-v2sccor(k,l,i,j)
+              else
+             v1sccor(k,l,i,-j)=v1sccor(k,l,i,j)*0.5d0
+     &                        +v2sccor(k,l,i,j)*dsqrt(0.75d0)
+             v2sccor(k,l,i,-j)=-v2sccor(k,l,i,j)*0.5d0
+     &                        +v1sccor(k,l,i,j)*dsqrt(0.75d0)
+             v1sccor(k,l,-i,-j)=v1sccor(k,l,i,j)
+             v2sccor(k,l,-i,-j)=-v2sccor(k,l,i,j)
+             v1sccor(k,l,-i,j)=v1sccor(k,l,i,-j)
+             v2sccor(k,l,-i,j)=-v2sccor(k,l,i,-j)          
+             endif
+            else
+              if (i.eq.isccortyp(10)) then
+              v1sccor(k,l,i,-j)=v1sccor(k,l,i,j)
+              v2sccor(k,l,i,-j)=-v2sccor(k,l,i,j)
+              else
+                if (j.eq.isccortyp(10)) then
+              v1sccor(k,l,-i,j)=v1sccor(k,l,i,j)
+              v2sccor(k,l,-i,j)=-v2sccor(k,l,i,j)
+                else
+             v1sccor(k,l,i,-j)=-v1sccor(k,l,i,j)
+             v2sccor(k,l,i,-j)=-v2sccor(k,l,i,j)
+             v1sccor(k,l,-i,-j)=v1sccor(k,l,i,j)
+             v2sccor(k,l,-i,-j)=-v2sccor(k,l,i,j)
+             v1sccor(k,l,-i,j)=v1sccor(k,l,i,-j)
+             v2sccor(k,l,-i,j)=-v2sccor(k,l,i,-j)
+            endif
+             endif
+             endif 
             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)
@@ -684,12 +759,46 @@ cc maxinter is maximum interaction sites
             v0ijsccor=v0ijsccor+vlor1sccor(k,i,j)/
      &(1+vlor3sccor(k,i,j)**2)
           enddo
+          v0sccor(l,i,j)=v0ijsccor
+          v0sccor(l,-i,j)=v0ijsccor1
+          v0sccor(l,i,-j)=v0ijsccor2
+          v0sccor(l,-i,-j)=v0ijsccor3  
+        enddo
+      enddo
+      enddo
+      close (isccor)
+#else
+      read (isccor,*,end=113,err=113) (isccortyp(i),i=1,ntyp)
+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
+          read (isccor,*,end=113,err=113)
+     & nterm_sccor(i,j),nlor_sccor(i,j)
+          v0ijsccor=0.0d0
+          si=-1.0d0
+
+          do k=1,nterm_sccor(i,j)
+            read (isccor,*,end=113,err=113) kk,v1sccor(k,l,i,j)
+     &    ,v2sccor(k,l,i,j)
+            v0ijsccor=v0ijsccor+si*v1sccor(k,l,i,j)
+            si=-si
+          enddo
+          do k=1,nlor_sccor(i,j)
+            read (isccor,*,end=113,err=113) kk,vlor1sccor(k,i,j),
+     &        vlor2sccor(k,i,j),vlor3sccor(k,i,j)
+            v0ijsccor=v0ijsccor+vlor1sccor(k,i,j)/
+     &(1+vlor3sccor(k,i,j)**2)
+          enddo
           v0sccor(i,j)=v0ijsccor
         enddo
       enddo
       enddo
       close (isccor)
-      
+
+#endif      
       if (lprint) then
        write (iout,'(/a/)') 'Torsional constants:'
        do i=1,nsccortyp