Merge branch 'devel' of mmka.chem.univ.gda.pl:unres into devel
[unres.git] / source / unres / src_MD / parmread.F
index be5f8b8..4729ca5 100644 (file)
@@ -553,33 +553,59 @@ C
       enddo
       endif
 #endif
+C Read of Side-chain backbone correlation parameters
+C Modified 11 May 2012 by Adasko
+CCC
 C
-C 5/21/07 (AL) Read coefficients of the backbone-local sidechain-local
-C         correlation energies.
-C
-      read (isccor,*,end=119,err=119) nterm_sccor
-      do i=1,20
-       do j=1,20
-          read (isccor,'(a)')
-         do k=1,nterm_sccor
-           read (isccor,*,end=119,err=119) kk,v1sccor(k,i,j),
-     &        v2sccor(k,i,j) 
+      read (isccor,*,end=113,err=113) nsccortyp
+      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)
+      
       if (lprint) then
-       write (iout,'(/a/)') 'Torsional constants of SCCORR:'
-       do i=1,20
-         do j=1,20
+       write (iout,'(/a/)') 'Torsional constants:'
+       do i=1,nsccortyp
+         do j=1,nsccortyp
             write (iout,*) 'ityp',i,' jtyp',j
-            do k=1,nterm_sccor
-             write (iout,'(2(1pe15.5))') v1sccor(k,i,j),v2sccor(k,i,j)
+            write (iout,*) 'Fourier constants'
+            do k=1,nterm_sccor(i,j)
+      write (iout,'(2(1pe15.5))') v1sccor(k,l,i,j),v2sccor(k,l,i,j)
+            enddo
+            write (iout,*) 'Lorenz constants'
+            do k=1,nlor_sccor(i,j)
+             write (iout,'(3(1pe15.5))') 
+     &         vlor1sccor(k,i,j),vlor2sccor(k,i,j),vlor3sccor(k,i,j)
             enddo
           enddo
         enddo
       endif
 C
+C
 C 9/18/99 (AL) Read coefficients of the Fourier expansion of the local
 C         interaction energy of the Gly, Ala, and Pro prototypes.
 C