Merge branch 'prerelease-3.2.1'
[unres.git] / source / unres / src_MD-M / parmread.F
index 64203a2..183da9d 100644 (file)
@@ -276,6 +276,17 @@ C
       enddo
       call flush(iout)
       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)
+       sigc0(i)=sigc0(i)**2
+      enddo
+      write (2,*) "End reading THETA_PDB"
+      close (ithep_pdb)
 #endif
       close(ithep)
 #ifdef CRYST_SC
@@ -363,6 +374,48 @@ C
          enddo  
        endif
       enddo
+C
+C Read the parameters of the probability distribution/energy expression
+C of the side chains.
+C
+      do i=1,ntyp
+       read (irotam_pdb,'(3x,i3,f8.3)',end=112,err=112) nlob(i),dsc(i)
+        if (i.eq.10) then
+          dsc_inv(i)=0.0D0
+        else
+          dsc_inv(i)=1.0D0/dsc(i)
+        endif
+       if (i.ne.10) then
+        do j=1,nlob(i)
+          do k=1,3
+            do l=1,3
+              blower(l,k,j)=0.0D0
+            enddo
+          enddo
+        enddo  
+       bsc(1,i)=0.0D0
+        read(irotam_pdb,*,end=112,err=112)(censc(k,1,i),k=1,3),
+     &    ((blower(k,l,1),l=1,k),k=1,3)
+       do j=2,nlob(i)
+         read (irotam_pdb,*,end=112,err=112) bsc(j,i)
+         read (irotam_pdb,*,end=112,err=112) (censc(k,j,i),k=1,3),
+     &                                 ((blower(k,l,j),l=1,k),k=1,3)
+        enddo
+       do j=1,nlob(i)
+         do k=1,3
+           do l=1,k
+             akl=0.0D0
+             do m=1,3
+               akl=akl+blower(k,m,j)*blower(l,m,j)
+              enddo
+             gaussc(k,l,j,i)=akl
+             gaussc(l,k,j,i)=akl
+            enddo
+          enddo 
+       enddo
+       endif
+      enddo
+      close (irotam_pdb)
 #endif
       close(irotam)
 
@@ -590,23 +643,23 @@ cc maxinter is maximum interaction sites
 c      write (iout,*) 'ntortyp',ntortyp
       maxinter=3
 cc maxinter is maximum interaction sites
-      do l=1,maxinter
+      do l=1,maxinter    
       do i=1,nsccortyp
-        do j=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)
+  
+         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) 
             v0ijsccor=v0ijsccor+si*v1sccor(k,l,i,j)
             si=-si
           enddo
-          do k=1,nlor_sccor(i,j)
+         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)
+     &        vlor2sccor(k,i,j),vlor3sccor(k,i,j) 
             v0ijsccor=v0ijsccor+vlor1sccor(k,i,j)/
      &(1+vlor3sccor(k,i,j)**2)
           enddo
@@ -615,12 +668,12 @@ cc maxinter is maximum interaction sites
       enddo
       enddo
       close (isccor)
-
+      
 #endif      
       if (lprint) then
-        write (iout,'(/a/)') 'Torsional constants:'
-        do i=1,nsccortyp
-          do j=1,nsccortyp
+       write (iout,'(/a/)') 'Torsional constants:'
+       do i=1,nsccortyp
+         do j=1,nsccortyp
             write (iout,*) 'ityp',i,' jtyp',j
             write (iout,*) 'Fourier constants'
             do k=1,nterm_sccor(i,j)
@@ -628,7 +681,7 @@ cc maxinter is maximum interaction sites
             enddo
             write (iout,*) 'Lorenz constants'
             do k=1,nlor_sccor(i,j)
-              write (iout,'(3(1pe15.5))')
+             write (iout,'(3(1pe15.5))') 
      &         vlor1sccor(k,i,j),vlor2sccor(k,i,j),vlor3sccor(k,i,j)
             enddo
           enddo