Running D-aminoacid after passed tests. Still problem with
authorAdam Kazimierz Sieradzan <adasko@sun1.chem.univ.gda.pl>
Tue, 7 Aug 2012 08:34:18 +0000 (04:34 -0400)
committerAdam Kazimierz Sieradzan <adasko@sun1.chem.univ.gda.pl>
Tue, 7 Aug 2012 08:34:18 +0000 (04:34 -0400)
gamsc(21)=1.00d0

24 files changed:
bin/unres/MD-M/unres_Tc_procor_oldparm_em64-D-symetr.exe
source/unres/src_MD-M/COMMON.LOCAL
source/unres/src_MD-M/COMMON.NAMES
source/unres/src_MD-M/COMMON.TORSION
source/unres/src_MD-M/MD_A-MTS.F
source/unres/src_MD-M/Makefile
source/unres/src_MD-M/cinfo.f
source/unres/src_MD-M/contact.f
source/unres/src_MD-M/energy_p_new_barrier.F
source/unres/src_MD-M/gen_rand_conf.F
source/unres/src_MD-M/initialize_p.F
source/unres/src_MD-M/kinetic_lesyng.f
source/unres/src_MD-M/moments.f
source/unres/src_MD-M/parmread.F
source/unres/src_MD-M/readrtns_CSA.F
source/unres/src_MD-M/rescode.f
source/unres/src_MD-M/sc_move.F
source/unres/src_MD-M/stochfric.F
source/unres/src_MD-M/tmptmp [deleted file]
source/unres/src_MD/energy_p_new_barrier.F
source/unres/src_MD/parmread.F
source/unres/src_MD/stochfric.F
source/wham/src/initialize_p.F
source/wham/src/parmread.F

index 3c8a551..2d46a6f 100755 (executable)
Binary files a/bin/unres/MD-M/unres_Tc_procor_oldparm_em64-D-symetr.exe and b/bin/unres/MD-M/unres_Tc_procor_oldparm_em64-D-symetr.exe differ
index 837a7a3..e1e13f4 100644 (file)
@@ -2,12 +2,14 @@
      &  sigc0,dsc,dsc_inv,bsc,censc,gaussc,dsc0
       integer nlob
 C Parameters of the virtual-bond-angle probability distribution
-      common /thetas/ a0thet(ntyp),athet(2,ntyp),bthet(2,ntyp),
-     &  polthet(0:3,ntyp),gthet(3,ntyp),theta0(ntyp),sig0(ntyp),
-     &  sigc0(ntyp)
+      common /thetas/ a0thet(-ntyp:ntyp),athet(2,-ntyp:ntyp,-1:1,-1:1),
+     &  bthet(2,-ntyp:ntyp,-1:1,-1:1),polthet(0:3,-ntyp:ntyp),
+     & gthet(3,-ntyp:ntyp),theta0(-ntyp:ntyp),sig0(-ntyp:ntyp),
+     &  sigc0(-ntyp:ntyp)
 C Parameters of the side-chain probability distribution
       common /sclocal/ dsc(ntyp1),dsc_inv(ntyp1),bsc(maxlob,ntyp),
-     &  censc(3,maxlob,ntyp),gaussc(3,3,maxlob,ntyp),dsc0(ntyp1),
+     &  censc(3,maxlob,-ntyp:ntyp),gaussc(3,3,maxlob,-ntyp:ntyp),
+     &d sc0(ntyp1),
      &    nlob(ntyp1)
 C Parameters of ab initio-derived potential of virtual-bond-angle bending
       integer nthetyp,ntheterm,ntheterm2,ntheterm3,nsingle,ndouble,
index e6f926b..13dde91 100644 (file)
@@ -1,6 +1,7 @@
       character*3 restyp
       character*1 onelet
-      common /names/ restyp(ntyp+1),onelet(ntyp+1)
+      common /names/ restyp(-ntyp1:ntyp1),
+     &               onelet(-ntyp1:ntyp1)
       character*10 ename,wname
       integer nprint_ene,print_order
       common /namterm/ ename(n_ene),wname(n_ene),nprint_ene,
index 6b6605f..f6837cf 100644 (file)
@@ -1,23 +1,33 @@
 C Torsional constants of the rotation about virtual-bond dihedral angles
       double precision v1,v2,vlor1,vlor2,vlor3,v0
       integer itortyp,ntortyp,nterm,nlor,nterm_old
-      common/torsion/v0(maxtor,maxtor),v1(maxterm,maxtor,maxtor),
-     &    v2(maxterm,maxtor,maxtor),vlor1(maxlor,maxtor,maxtor),
+      common/torsion/v0(-maxtor:maxtor,-maxtor:maxtor,2),
+     &    v1(maxterm,-maxtor:maxtor,-maxtor:maxtor,2),
+     &    v2(maxterm,-maxtor:maxtor,-maxtor:maxtor,2),
+     &    vlor1(maxlor,-maxtor:maxtor,-maxtor:maxtor),
      &    vlor2(maxlor,maxtor,maxtor),vlor3(maxlor,maxtor,maxtor),
-     &    itortyp(ntyp),ntortyp,nterm(maxtor,maxtor),nlor(maxtor,maxtor) 
+     &    itortyp(-ntyp:ntyp),ntortyp,
+     &    nterm(-maxtor:maxtor,-maxtor:maxtor,2),
+     &    nlor(-maxtor:maxtor,-maxtor:maxtor,2) 
      &    ,nterm_old
 C 6/23/01 - constants for double torsionals
       double precision v1c,v1s,v2c,v2s
       integer ntermd_1,ntermd_2
-      common /torsiond/ v1c(2,maxtermd_1,maxtor,maxtor,maxtor),
-     &    v1s(2,maxtermd_1,maxtor,maxtor,maxtor),
-     &    v2c(maxtermd_2,maxtermd_2,maxtor,maxtor,maxtor),
-     &    v2s(maxtermd_2,maxtermd_2,maxtor,maxtor,maxtor),
-     &    ntermd_1(maxtor,maxtor,maxtor),ntermd_2(maxtor,maxtor,maxtor)
+      common /torsiond/ 
+     &v1c(2,maxtermd_1,-maxtor:maxtor,-maxtor:maxtor,-maxtor:maxtor,2),
+     &v1s(2,maxtermd_1,-maxtor:maxtor,-maxtor:maxtor,-maxtor:maxtor,2),
+     &v2c(maxtermd_2,maxtermd_2,-maxtor:maxtor,-maxtor:maxtor,
+     &    -maxtor:maxtor,2),
+     &v2s(maxtermd_2,maxtermd_2,-maxtor:maxtor,-maxtor:maxtor,
+     &    -maxtor:maxtor,2),
+     &    ntermd_1(-maxtor:maxtor,-maxtor:maxtor,-maxtor:maxtor,2),
+     &    ntermd_2(-maxtor:maxtor,-maxtor:maxtor,-maxtor:maxtor,2)
 C 9/18/99 - added Fourier coeffficients of the expansion of local energy 
 C           surface
       double precision b1,b2,cc,dd,ee,ctilde,dtilde,b2tilde
       integer nloctyp
-      common/fourier/ b1(2,maxtor),b2(2,maxtor),cc(2,2,maxtor),
-     &    dd(2,2,maxtor),ee(2,2,maxtor),ctilde(2,2,maxtor),
-     &    dtilde(2,2,maxtor),b1tilde(2,maxtor),nloctyp
+      common/fourier/ b1(2,-maxtor:maxtor),b2(2,-maxtor:maxtor)
+     &    ,cc(2,2,-maxtor:maxtor),
+     &    dd(2,2,-maxtor:maxtor),ee(2,2,-maxtor:maxtor),
+     &    ctilde(2,2,-maxtor:maxtor),
+     &    dtilde(2,2,-maxtor:maxtor),b1tilde(2,-maxtor:maxtor),nloctyp
index 6c6fb14..d7537ad 100644 (file)
@@ -1433,7 +1433,8 @@ c if the friction coefficients do not depend on surface area
           stdforcp(i)=stdfp*dsqrt(gamp)
         enddo
         do i=nnt,nct
-          stdforcsc(i)=stdfsc(itype(i))*dsqrt(gamsc(itype(i)))
+          stdforcsc(i)=stdfsc(iabs(itype(i)))
+     &                *dsqrt(gamsc(iabs(itype(i))))
         enddo
       endif
 c Open the pdb file for snapshotshots
index d3206a8..e09600e 100644 (file)
@@ -15,7 +15,7 @@ INSTALL_DIR = /users/software/mpich-1.2.7p1_intel-10.1_em64_ssh
 FC= ifort
 
 OPT =  -O3 -ip -w
-
+#OPT = -g -CB
 CFLAGS = -DSGI -c
 
 FFLAGS = -c ${OPT} -I$(INSTALL_DIR)/include
@@ -26,7 +26,7 @@ FFLAGSE = -c -w -O3 -ipo -ipo_obj  -opt_report -I$(INSTALL_DIR)/include
 BIN = ../../../bin/unres/MD-M/unres_Tc_procor_oldparm_em64-D-symetr.exe
 #LIBS = -L$(INSTALL_DIR)/lib_pgi -lmpich xdrf/libxdrf.a
 #LIBS = -L$(INSTALL_DIR)/lib_ifort -lmpich xdrf/libxdrf.a
-LIBS = -L$(INSTALL_DIR)/lib -lmpich xdrf_em64/libxdrf.a -g -d2 -CA -CB
+LIBS = -L$(INSTALL_DIR)/lib -lmpich ../../lib/xdrf_em64/libxdrf.a -g -d2 -CA -CB
 
 ARCH = LINUX
 PP = /lib/cpp -P
index 9f45b51..9fda361 100644 (file)
@@ -1,14 +1,15 @@
 C DO NOT EDIT THIS FILE - IT HAS BEEN GENERATED BY COMPINFO.C
-C 2 3 3386
+C 2 3 3401
       subroutine cinfo
       include 'COMMON.IOUNITS'
       write(iout,*)'++++ Compile info ++++'
-      write(iout,*)'Version 2.3 build 3386'
-      write(iout,*)'compiled Thu Jun 14 07:00:49 2012'
-      write(iout,*)'compiled by adam@matrix.chem.cornell.edu'
+      write(iout,*)'Version 2.3 build 3401'
+      write(iout,*)'compiled Mon Aug  6 05:26:44 2012'
+      write(iout,*)'compiled by aks255@matrix.chem.cornell.edu'
       write(iout,*)'OS name:    Linux '
       write(iout,*)'OS release: 2.6.34.9-69.fc13.x86_64 '
-      write(iout,*)'OS version: #1 SMP Tue May 3 09:23:03 UTC 2011 '
+      write(iout,*)'OS version:',
+     & ' #1 SMP Tue May 3 09:23:03 UTC 2011 '
       write(iout,*)'flags:'
       write(iout,*)'CPPFLAGS = -DLINUX -DUNRES -DMP -DMPI \\'
       write(iout,*)'           -DPGI -DSPLITELE -DISNAN -DAMD64 \\'
@@ -23,7 +24,7 @@ C 2 3 3386
       write(iout,*)'FFLAGS2 = -c -w -O0 -I$(INSTALL_DIR)/include'
       write(iout,*)'FFLAGSE = -c -w -O3 -ipo -ipo_obj  -opt_report ...'
       write(iout,*)'BIN = ../../../bin/unres/MD-M/unres_Tc_procor_o...'
-      write(iout,*)'LIBS = -L$(INSTALL_DIR)/lib -lmpich xdrf_em64/l...'
+      write(iout,*)'LIBS = -L$(INSTALL_DIR)/lib -lmpich ../../lib/x...'
       write(iout,*)'ARCH = LINUX'
       write(iout,*)'PP = /lib/cpp -P'
       write(iout,*)'object = unres.o arcos.o cartprint.o chainbuild...'
index a244d86..24b11d6 100644 (file)
@@ -12,9 +12,9 @@
       ncont=0
       kkk=3
       do i=nnt+kkk,nct
-        iti=itype(i)
+        iti=iabs(itype(i))
         do j=nnt,i-kkk
-          itj=itype(j)
+          itj=iabs(itype(j))
           if (ipot.ne.4) then
 c           rcomp=sigmaii(iti,itj)+1.0D0
             rcomp=facont*sigmaii(iti,itj)
index 379fef0..734acc1 100644 (file)
@@ -1025,9 +1025,9 @@ C
 c      write(iout,*)'Entering ELJ nnt=',nnt,' nct=',nct,' expon=',expon
       evdw=0.0D0
       do i=iatsc_s,iatsc_e
-        itypi=itype(i)
+        itypi=iabs(itype(i))
         if (itypi.eq.21) cycle
-        itypi1=itype(i+1)
+        itypi1=iabs(itype(i+1))
         xi=c(1,nres+i)
         yi=c(2,nres+i)
         zi=c(3,nres+i)
@@ -1040,7 +1040,7 @@ C
 cd        write (iout,*) 'i=',i,' iint=',iint,' istart=',istart(i,iint),
 cd   &                  'iend=',iend(i,iint)
           do j=istart(i,iint),iend(i,iint)
-            itypj=itype(j)
+            itypj=iabs(itype(j)) 
             if (itypj.eq.21) cycle
             xj=c(1,nres+j)-xi
             yj=c(2,nres+j)-yi
@@ -1178,9 +1178,9 @@ C
 c     print *,'Entering ELJK nnt=',nnt,' nct=',nct,' expon=',expon
       evdw=0.0D0
       do i=iatsc_s,iatsc_e
-        itypi=itype(i)
+        itypi=iabs(itype(i))
         if (itypi.eq.21) cycle
-        itypi1=itype(i+1)
+        itypi1=iabs(itype(i+1))
         xi=c(1,nres+i)
         yi=c(2,nres+i)
         zi=c(3,nres+i)
@@ -1189,7 +1189,7 @@ C Calculate SC interaction energy.
 C
         do iint=1,nint_gr(i)
           do j=istart(i,iint),iend(i,iint)
-            itypj=itype(j)
+            itypj=iabs(itype(j))
             if (itypj.eq.21) cycle
             xj=c(1,nres+j)-xi
             yj=c(2,nres+j)-yi
@@ -1271,9 +1271,9 @@ c     else
 c     endif
       ind=0
       do i=iatsc_s,iatsc_e
-        itypi=itype(i)
+        itypi=iabs(itype(i))
         if (itypi.eq.21) cycle
-        itypi1=itype(i+1)
+        itypi1=iabs(itype(i+1))
         xi=c(1,nres+i)
         yi=c(2,nres+i)
         zi=c(3,nres+i)
@@ -1288,7 +1288,7 @@ C
         do iint=1,nint_gr(i)
           do j=istart(i,iint),iend(i,iint)
             ind=ind+1
-            itypj=itype(j)
+            itypj=iabs(itype(j))
             if (itypj.eq.21) cycle
 c            dscj_inv=dsc_inv(itypj)
             dscj_inv=vbld_inv(j+nres)
@@ -1391,9 +1391,9 @@ c     print *,'Entering EGB nnt=',nnt,' nct=',nct,' expon=',expon
 c     if (icall.eq.0) lprn=.false.
       ind=0
       do i=iatsc_s,iatsc_e
-        itypi=itype(i)
+        itypi=iabs(itype(i))
         if (itypi.eq.21) cycle
-        itypi1=itype(i+1)
+        itypi1=iabs(itype(i+1))
         xi=c(1,nres+i)
         yi=c(2,nres+i)
         zi=c(3,nres+i)
@@ -1410,7 +1410,7 @@ C
         do iint=1,nint_gr(i)
           do j=istart(i,iint),iend(i,iint)
             ind=ind+1
-            itypj=itype(j)
+            itypj=iabs(itype(j))
             if (itypj.eq.21) cycle
 c            dscj_inv=dsc_inv(itypj)
             dscj_inv=vbld_inv(j+nres)
@@ -1536,9 +1536,9 @@ c     print *,'Entering EGB nnt=',nnt,' nct=',nct,' expon=',expon
 c     if (icall.eq.0) lprn=.true.
       ind=0
       do i=iatsc_s,iatsc_e
-        itypi=itype(i)
+        itypi=iabs(itype(i))
         if (itypi.eq.21) cycle
-        itypi1=itype(i+1)
+        itypi1=iabs(itype(i+1))
         xi=c(1,nres+i)
         yi=c(2,nres+i)
         zi=c(3,nres+i)
@@ -1553,7 +1553,7 @@ C
         do iint=1,nint_gr(i)
           do j=istart(i,iint),iend(i,iint)
             ind=ind+1
-            itypj=itype(j)
+            itypj=iabs(itype(j))
             if (itypj.eq.21) cycle
 c            dscj_inv=dsc_inv(itypj)
             dscj_inv=vbld_inv(j+nres)
@@ -1784,9 +1784,9 @@ C
 cd    print *,'Entering Esoft_sphere nnt=',nnt,' nct=',nct
       evdw=0.0D0
       do i=iatsc_s,iatsc_e
-        itypi=itype(i)
+        itypi=iabs(itype(i))
         if (itypi.eq.21) cycle
-        itypi1=itype(i+1)
+        itypi1=iabs(itype(i+1))
         xi=c(1,nres+i)
         yi=c(2,nres+i)
         zi=c(3,nres+i)
@@ -1797,7 +1797,7 @@ C
 cd        write (iout,*) 'i=',i,' iint=',iint,' istart=',istart(i,iint),
 cd   &                  'iend=',iend(i,iint)
           do j=istart(i,iint),iend(i,iint)
-            itypj=itype(j)
+            itypj=iabs(itype(j))
             if (itypj.eq.21) cycle
             xj=c(1,nres+j)-xi
             yj=c(2,nres+j)-yi
@@ -3812,7 +3812,7 @@ cd    write (iout,*) 'iatscp_s=',iatscp_s,' iatscp_e=',iatscp_e
 
         do j=iscpstart(i,iint),iscpend(i,iint)
           if (itype(j).eq.21) cycle
-          itypj=itype(j)
+          itypj=iabs(itype(j))
 C Uncomment following three lines for SC-p interactions
 c         xj=c(1,nres+j)-xi
 c         yj=c(2,nres+j)-yi
@@ -3907,7 +3907,7 @@ cd    write (iout,*) 'iatscp_s=',iatscp_s,' iatscp_e=',iatscp_e
         do iint=1,nscp_gr(i)
 
         do j=iscpstart(i,iint),iscpend(i,iint)
-          itypj=itype(j)
+          itypj=iabs(itype(j))
           if (itypj.eq.21) cycle
 C Uncomment following three lines for SC-p interactions
 c         xj=c(1,nres+j)-xi
@@ -4024,7 +4024,8 @@ C iii and jjj point to the residues for which the distance is assigned.
 cd        write (iout,*) "i",i," ii",ii," iii",iii," jj",jj," jjj",jjj
 C 24/11/03 AL: SS bridges handled separately because of introducing a specific
 C    distance and angle dependent SS bond potential.
-        if (ii.gt.nres .and. itype(iii).eq.1 .and. itype(jjj).eq.1) then
+        if (ii.gt.nres .and. iabs(itype(iii)).eq.1 .and.
+     & iabs(itype(jjj)).eq.1) then
           call ssbond_ene(iii,jjj,eij)
           ehpb=ehpb+2*eij
 cd          write (iout,*) "eij",eij
@@ -4088,7 +4089,7 @@ C
       include 'COMMON.VAR'
       include 'COMMON.IOUNITS'
       double precision erij(3),dcosom1(3),dcosom2(3),gg(3)
-      itypi=itype(i)
+      itypi=iabs(itype(i))
       xi=c(1,nres+i)
       yi=c(2,nres+i)
       zi=c(3,nres+i)
@@ -4097,7 +4098,7 @@ C
       dzi=dc_norm(3,nres+i)
 c      dsci_inv=dsc_inv(itypi)
       dsci_inv=vbld_inv(nres+i)
-      itypj=itype(j)
+      itypj=iabs(itype(j))
 c      dscj_inv=dsc_inv(itypj)
       dscj_inv=vbld_inv(nres+j)
       xj=c(1,nres+j)-xi
@@ -4203,7 +4204,7 @@ c
 c 09/18/07 AL: multimodal bond potential based on AM1 CA-SC PMF's included
 c
       do i=ibond_start,ibond_end
-        iti=itype(i)
+        iti=iabs(itype(i))
         if (iti.ne.10 .and. iti.ne.21) then
           nbi=nbondterm(iti)
           if (nbi.eq.1) then
@@ -4281,6 +4282,19 @@ c     write (*,'(a,i2)') 'EBEND ICG=',icg
 C Zero the energy function and its derivative at 0 or pi.
         call splinthet(theta(i),0.5d0*delta,ss,ssd)
         it=itype(i-1)
+        ichir1=isign(1,itype(i-2))
+        ichir2=isign(1,itype(i))
+         if (itype(i-2).eq.10) ichir1=isign(1,itype(i-1))
+         if (itype(i).eq.10) ichir2=isign(1,itype(i-1))
+         if (itype(i-1).eq.10) then
+          itype1=isign(10,itype(i-2))
+          ichir11=isign(1,itype(i-2))
+          ichir12=isign(1,itype(i-2))
+          itype2=isign(10,itype(i))
+          ichir21=isign(1,itype(i))
+          ichir22=isign(1,itype(i))
+         endif
+
         if (i.gt.3 .and. itype(i-2).ne.21) then
 #ifdef OSF
          phii=phi(i)
@@ -4314,15 +4328,27 @@ C dependent on the adjacent virtual-bond-valence angles (gamma1 & gamma2).
 C In following comments this theta will be referred to as t_c.
         thet_pred_mean=0.0d0
         do k=1,2
-          athetk=athet(k,it)
-          bthetk=bthet(k,it)
-          thet_pred_mean=thet_pred_mean+athetk*y(k)+bthetk*z(k)
+            athetk=athet(k,it,ichir1,ichir2)
+            bthetk=bthet(k,it,ichir1,ichir2)
+          if (it.eq.10) then
+             athetk=athet(k,itype1,ichir11,ichir12)
+             bthetk=bthet(k,itype2,ichir21,ichir22)
+          endif
+         thet_pred_mean=thet_pred_mean+athetk*y(k)+bthetk*z(k)
         enddo
         dthett=thet_pred_mean*ssd
         thet_pred_mean=thet_pred_mean*ss+a0thet(it)
 C Derivatives of the "mean" values in gamma1 and gamma2.
-        dthetg1=(-athet(1,it)*y(2)+athet(2,it)*y(1))*ss
-        dthetg2=(-bthet(1,it)*z(2)+bthet(2,it)*z(1))*ss
+        dthetg1=(-athet(1,it,ichir1,ichir2)*y(2)
+     &+athet(2,it,ichir1,ichir2)*y(1))*ss
+         dthetg2=(-bthet(1,it,ichir1,ichir2)*z(2)
+     &          +bthet(2,it,ichir1,ichir2)*z(1))*ss
+         if (it.eq.10) then
+      dthetg1=(-athet(1,itype1,ichir11,ichir12)*y(2)
+     &+athet(2,itype1,ichir11,ichir12)*y(1))*ss
+        dthetg2=(-bthet(1,itype2,ichir21,ichir22)*z(2)
+     &         +bthet(2,itype2,ichir21,ichir22)*z(1))*ss
+         endif
         if (theta(i).gt.pi-delta) then
           call theteng(pi-delta,thet_pred_mean,theta0(it),f0,fprim0,
      &         E_tc0)
@@ -4495,7 +4521,7 @@ C
         dephii=0.0d0
         dephii1=0.0d0
         theti2=0.5d0*theta(i)
-        ityp2=ithetyp(itype(i-1))
+        ityp2=ithetyp(iabs(itype(i-1)))
         do k=1,nntheterm
           coskt(k)=dcos(k*theti2)
           sinkt(k)=dsin(k*theti2)
@@ -4507,7 +4533,7 @@ C
 #else
           phii=phi(i)
 #endif
-          ityp1=ithetyp(itype(i-2))
+          ityp1=ithetyp(iabs(itype(i-2)))
           do k=1,nsingle
             cosph1(k)=dcos(k*phii)
             sinph1(k)=dsin(k*phii)
@@ -4528,7 +4554,7 @@ C
 #else
           phii1=phi(i+1)
 #endif
-          ityp3=ithetyp(itype(i))
+          ityp3=ithetyp(iabs(itype(i)))
           do k=1,nsingle
             cosph2(k)=dcos(k*phii1)
             sinph2(k)=dsin(k*phii1)
@@ -4680,7 +4706,7 @@ c     write (iout,'(a)') 'ESC'
         it=itype(i)
         if (it.eq.21) cycle
         if (it.eq.10) goto 1
-        nlobit=nlob(it)
+        nlobit=nlob(iabs(it))
 c       print *,'i=',i,' it=',it,' nlobit=',nlobit
 c       write (iout,*) 'i=',i,' ssa=',ssa,' ssad=',ssad
         theti=theta(i+1)-pipol
@@ -4837,11 +4863,11 @@ C Compute the contribution to SC energy and derivatives
 
           do j=1,nlobit
 #ifdef OSF
-            adexp=bsc(j,it)-0.5D0*contr(j,iii)+emin
+            adexp=bsc(j,iabs(it))-0.5D0*contr(j,iii)+emin
             if(adexp.ne.adexp) adexp=1.0
             expfac=dexp(adexp)
 #else
-            expfac=dexp(bsc(j,it)-0.5D0*contr(j,iii)+emin)
+            expfac=dexp(bsc(j,iabs(it))-0.5D0*contr(j,iii)+emin)
 #endif
 cd          print *,'j=',j,' expfac=',expfac
             escloc_i=escloc_i+expfac
@@ -4923,7 +4949,7 @@ C Compute the contribution to SC energy and derivatives
 
       dersc12=0.0d0
       do j=1,nlobit
-        expfac=dexp(bsc(j,it)-0.5D0*contr(j)+emin)
+        expfac=dexp(bsc(j,iabs(it))-0.5D0*contr(j)+emin)
         escloc_i=escloc_i+expfac
         do k=1,2
           dersc(k)=dersc(k)+Ax(k,j)*expfac
@@ -5505,14 +5531,19 @@ c     lprn=.true.
         if (itype(i-2).eq.21 .or. itype(i-1).eq.21 
      &       .or. itype(i).eq.21) cycle
         etors_ii=0.0D0
+         if (iabs(itype(i)).eq.20) then
+         iblock=2
+         else
+         iblock=1
+         endif
         itori=itortyp(itype(i-2))
         itori1=itortyp(itype(i-1))
         phii=phi(i)
         gloci=0.0D0
 C Regular cosine and sine terms
-        do j=1,nterm(itori,itori1)
-          v1ij=v1(j,itori,itori1)
-          v2ij=v2(j,itori,itori1)
+        do j=1,nterm(itori,itori1,iblock)
+          v1ij=v1(j,itori,itori1,iblock)
+          v2ij=v2(j,itori,itori1,iblock)
           cosphi=dcos(j*phii)
           sinphi=dsin(j*phii)
           etors=etors+v1ij*cosphi+v2ij*sinphi
@@ -5527,7 +5558,7 @@ C          [v2 cos(phi/2)+v3 sin(phi/2)]^2 + 1
 C
         cosphi=dcos(0.5d0*phii)
         sinphi=dsin(0.5d0*phii)
-        do j=1,nlor(itori,itori1)
+        do j=1,nlor(itori,itori1,iblock)
           vl1ij=vlor1(j,itori,itori1)
           vl2ij=vlor2(j,itori,itori1)
           vl3ij=vlor3(j,itori,itori1)
           gloci=gloci+vl1ij*(vl3ij*cosphi-vl2ij*sinphi)*pom
         enddo
 C Subtract the constant term
-        etors=etors-v0(itori,itori1)
+        etors=etors-v0(itori,itori1,iblock)
           if (energy_dec) write (iout,'(a6,i5,0pf7.3)')
-     &         'etor',i,etors_ii-v0(itori,itori1)
+     &         'etor',i,etors_ii-v0(itori,itori1,iblock)
         if (lprn)
      &  write (iout,'(2(a3,2x,i3,2x),2i3,6f8.3/26x,6f8.3/)')
      &  restyp(itype(i-2)),i-2,restyp(itype(i-1)),i-1,itori,itori1,
-     &  (v1(j,itori,itori1),j=1,6),(v2(j,itori,itori1),j=1,6)
+     &  (v1(j,itori,itori1,iblock),j=1,6),
+     &  (v2(j,itori,itori1,iblock),j=1,6)
         gloc(i-3,icg)=gloc(i-3,icg)+wtor*gloci
 c       write (iout,*) 'i=',i,' gloc=',gloc(i-3,icg)
       enddo
@@ -5606,12 +5638,15 @@ c     lprn=.true.
         phii1=phi(i+1)
         gloci1=0.0D0
         gloci2=0.0D0
+        iblock=1
+        if (iabs(itype(i+1)).eq.20) iblock=2
+
 C Regular cosine and sine terms
-        do j=1,ntermd_1(itori,itori1,itori2)
-          v1cij=v1c(1,j,itori,itori1,itori2)
-          v1sij=v1s(1,j,itori,itori1,itori2)
-          v2cij=v1c(2,j,itori,itori1,itori2)
-          v2sij=v1s(2,j,itori,itori1,itori2)
+        do j=1,ntermd_1(itori,itori1,itori2,iblock)
+          v1cij=v1c(1,j,itori,itori1,itori2,iblock)
+          v1sij=v1s(1,j,itori,itori1,itori2,iblock)
+          v2cij=v1c(2,j,itori,itori1,itori2,iblock)
+          v2sij=v1s(2,j,itori,itori1,itori2,iblock)
           cosphi1=dcos(j*phii)
           sinphi1=dsin(j*phii)
           cosphi2=dcos(j*phii1)
@@ -5621,12 +5656,12 @@ C Regular cosine and sine terms
           gloci1=gloci1+j*(v1sij*cosphi1-v1cij*sinphi1)
           gloci2=gloci2+j*(v2sij*cosphi2-v2cij*sinphi2)
         enddo
-        do k=2,ntermd_2(itori,itori1,itori2)
+        do k=2,ntermd_2(itori,itori1,itori2,iblock)
           do l=1,k-1
-            v1cdij = v2c(k,l,itori,itori1,itori2)
-            v2cdij = v2c(l,k,itori,itori1,itori2)
-            v1sdij = v2s(k,l,itori,itori1,itori2)
-            v2sdij = v2s(l,k,itori,itori1,itori2)
+            v1cdij = v2c(k,l,itori,itori1,itori2,iblock)
+            v2cdij = v2c(l,k,itori,itori1,itori2,iblock)
+            v1sdij = v2s(k,l,itori,itori1,itori2,iblock)
+            v2sdij = v2s(l,k,itori,itori1,itori2,iblock)
             cosphi1p2=dcos(l*phii+(k-l)*phii1)
             cosphi1m2=dcos(l*phii-(k-l)*phii1)
             sinphi1p2=dsin(l*phii+(k-l)*phii1)
@@ -5676,8 +5711,8 @@ c      write (iout,*) "EBACK_SC_COR",iphi_start,iphi_end,nterm_sccor
       do i=iphi_start,iphi_end
         if (itype(i-2).eq.21 .or. itype(i-1).eq.21) cycle
         esccor_ii=0.0D0
-        itori=itype(i-2)
-        itori1=itype(i-1)
+        itori=iabs(itype(i-2))
+        itori1=iabs(itype(i-1))
         phii=phi(i)
         gloci=0.0D0
         do j=1,nterm_sccor
index d870f55..6caa718 100644 (file)
@@ -15,10 +15,10 @@ cd    print *,' CG Processor',me,' maxgen=',maxgen
       maxsi=100
 cd    write (iout,*) 'Gen_Rand_conf: nstart=',nstart
       if (nstart.lt.5) then
-        it1=itype(2)
-        phi(4)=gen_phi(4,itype(2),itype(3))
+        it1=iabs(itype(2))
+        phi(4)=gen_phi(4,iabs(itype(2)),iabs(itype(3)))
 c       write(iout,*)'phi(4)=',rad2deg*phi(4)
-        if (nstart.lt.3) theta(3)=gen_theta(itype(2),pi,phi(4))
+        if (nstart.lt.3) theta(3)=gen_theta(iabs(itype(2)),pi,phi(4))
 c       write(iout,*)'theta(3)=',rad2deg*theta(3) 
         if (it1.ne.10) then
           nsi=0
@@ -54,9 +54,9 @@ c       write(iout,*)'theta(3)=',rad2deg*theta(3)
           endif
           return1
         endif
-       it1=itype(i-1)
-       it2=itype(i-2)
-       it=itype(i)
+       it1=iabs(itype(i-1))
+       it2=iabs(itype(i-2))
+       it=iabs(itype(i))
 c       print *,'Gen_Rand_Conf: i=',i,' it=',it,' it1=',it1,' it2=',it2,
 c    &    ' nit=',nit,' niter=',niter,' maxgen=',maxgen
        phi(i+1)=gen_phi(i+1,it1,it)
@@ -132,12 +132,12 @@ c-------------------------------------------------------------------------
       include 'COMMON.FFIELD'
       data redfac /0.5D0/
       overlap=.false.
-      iti=itype(i)
+      iti=iabs(itype(i))
       if (iti.gt.ntyp) return
 C Check for SC-SC overlaps.
 cd    print *,'nnt=',nnt,' nct=',nct
       do j=nnt,i-1
-        itj=itype(j)
+        itj=iabs(itype(j))
         if (j.lt.i-1 .or. ipot.ne.4) then
           rcomp=sigmaii(iti,itj)
         else 
@@ -159,7 +159,7 @@ C SCs.
        c(j,maxres2+1)=0.5D0*(c(j,i)+c(j,i+1))
       enddo
       do j=nnt,i-2
-       itj=itype(j)
+       itj=iabs(itype(j))
 cd      print *,'overlap, p-Sc: i=',i,' j=',j,
 cd   &         ' dist=',dist(nres+j,maxres2+1)
        if (dist(nres+j,maxres2+1).lt.4.0D0*redfac) then
@@ -238,7 +238,8 @@ c     print *,'gen_theta: it=',it
       endif  
       thet_pred_mean=a0thet(it)
       do k=1,2
-        thet_pred_mean=thet_pred_mean+athet(k,it)*y(k)+bthet(k,it)*z(k)
+        thet_pred_mean=thet_pred_mean+athet(k,it,1,1)*y(k)
+     &     +bthet(k,it,1,1)*z(k)
       enddo
       sig=polthet(3,it)
       do j=2,0,-1
@@ -779,7 +780,7 @@ c     overlapping residues left, or false otherwise (success)
 
         do ires=1,ioverlap_last 
           i=ioverlap(ires)
-          iti=itype(i)
+          iti=iabs(itype(i))
           if (iti.ne.10) then
             nsi=0
             fail=.true.
@@ -839,8 +840,8 @@ C Check for SC-SC overlaps and mark residues
 c      print *,'>>overlap_sc nnt=',nnt,' nct=',nct
       ind=0
       do i=iatsc_s,iatsc_e
-        itypi=itype(i)
-        itypi1=itype(i+1)
+        itypi=iabs(itype(i))
+        itypi1=iabs(itype(i+1))
         xi=c(1,nres+i)
         yi=c(2,nres+i)
         zi=c(3,nres+i)
@@ -852,7 +853,7 @@ c
        do iint=1,nint_gr(i)
          do j=istart(i,iint),iend(i,iint)
             ind=ind+1
-            itypj=itype(j)
+            itypj=iabs(itype(j))
             dscj_inv=dsc_inv(itypj)
             sig0ij=sigma(itypi,itypj)
             chi1=chi(itypi,itypj)
index 784fd35..aa5dfb9 100644 (file)
@@ -161,10 +161,14 @@ c      call memmon_print_usage()
        rr0(i)=0.0D0
        a0thet(i)=0.0D0
        do j=1,2
-         athet(j,i)=0.0D0
-         bthet(j,i)=0.0D0
+         do ichir1=-1,1
+          do ichir2=-1,1
+          athet(j,i,ichir1,ichir2)=0.0D0
+          bthet(j,i,ichir1,ichir2)=0.0D0
+          enddo
+         enddo
         enddo
-       do j=0,3
+        do j=0,3
          polthet(j,i)=0.0D0
         enddo
        do j=1,3
@@ -188,15 +192,38 @@ c      call memmon_print_usage()
       enddo
       nlob(ntyp1)=0
       dsc(ntyp1)=0.0D0
-      do i=1,maxtor
-       itortyp(i)=0
-       do j=1,maxtor
-         do k=1,maxterm
-           v1(k,j,i)=0.0D0
-           v2(k,j,i)=0.0D0
+      do i=-maxtor,maxtor
+        itortyp(i)=0
+       do iblock=1,2
+        do j=-maxtor,maxtor
+          do k=1,maxterm
+            v1(k,j,i,iblock)=0.0D0
+            v2(k,j,i,iblock)=0.0D0
           enddo
         enddo
+        enddo
       enddo
+      do iblock=1,2
+       do i=-maxtor,maxtor
+        do j=-maxtor,maxtor
+         do k=-maxtor,maxtor
+          do l=1,maxtermd_1
+            v1c(1,l,i,j,k,iblock)=0.0D0
+            v1s(1,l,i,j,k,iblock)=0.0D0
+            v1c(2,l,i,j,k,iblock)=0.0D0
+            v1s(2,l,i,j,k,iblock)=0.0D0
+          enddo !l
+          do l=1,maxtermd_2
+           do m=1,maxtermd_2
+            v2c(m,l,i,j,k,iblock)=0.0D0
+            v2s(m,l,i,j,k,iblock)=0.0D0
+           enddo !m
+          enddo !l
+        enddo !k
+       enddo !j
+      enddo !i
+      enddo !iblock
+
       do i=1,maxres
        itype(i)=0
        itel(i)=0
@@ -251,9 +278,13 @@ c-------------------------------------------------------------------------
       include 'COMMON.NAMES'
       include 'COMMON.FFIELD'
       data restyp /
+     &'DD' ,'DPR','DLY','DAR','DHI','DAS','DGL','DSG','DGN','DSN','DTH',
+     &'DYY','DAL','DTY','DTR','DVA','DLE','DIL','DPN','MED','DCY','ZER',
      &'CYS','MET','PHE','ILE','LEU','VAL','TRP','TYR','ALA','GLY','THR',
      &'SER','GLN','ASN','GLU','ASP','HIS','ARG','LYS','PRO','D'/
       data onelet /
+     &'z','p','k','r','h','d','e','n','q','s','t','g',
+     &'a','y','w','v','l','i','f','m','c','x',
      &'C','M','F','I','L','V','W','Y','A','G','T',
      &'S','Q','N','E','D','H','R','K','P','X'/
       data potname /'LJ','LJK','BP','GB','GBV'/
index 8535f5d..44ea85b 100644 (file)
@@ -81,7 +81,7 @@ c       write(iout,*) 'KEr_p', KEr_p
 c  The rotational part of the side chain virtual bond
        KEr_sc=0.0D0
        do i=nnt,nct
-        iti=itype(i)
+        iti=iabs(itype(i))
         if (itype(i).ne.10) then
         do j=1,3
          incr(j)=d_t(j,nres+i)
index 007c089..50f4d8b 100644 (file)
@@ -42,7 +42,7 @@ c   calculating the center of the mass of the protein
         enddo
         M_SC=0.0d0                             
         do i=nnt,nct
-           iti=itype(i)                 
+           iti=iabs(itype(i))           
           M_SC=M_SC+msc(iti)
            inres=i+nres
            do j=1,3
@@ -66,7 +66,7 @@ c   calculating the center of the mass of the protein
         enddo                  
         
        do i=nnt,nct    
-           iti=itype(i)
+           iti=iabs(itype(i))
            inres=i+nres
            do j=1,3
              pr(j)=c(j,inres)-cm(j)        
@@ -97,7 +97,7 @@ c   calculating the center of the mass of the protein
                                
         do i=nnt,nct
          if (itype(i).ne.10 .and. itype(i).ne.21) then
-           iti=itype(i)                 
+           iti=iabs(itype(i))           
            inres=i+nres
           Im(1,1)=Im(1,1)+Isc(iti)*(1-dc_norm(1,inres)*
      &   dc_norm(1,inres))*vbld(inres)*vbld(inres)
@@ -244,7 +244,7 @@ c  Calculate the angular momentum
           incr(j)=d_t(j,0)
         enddo  
         do i=nnt,nct
-         iti=itype(i)   
+         iti=iabs(itype(i))
          inres=i+nres
          do j=1,3
            pr(j)=c(j,inres)-cm(j)          
@@ -305,7 +305,7 @@ c------------------------------------------------------------------------------
              vcm(j)=vcm(j)+mp*(vv(j)+0.5d0*d_t(j,i))
            enddo
          endif
-         amas=msc(itype(i))
+         amas=msc(iabs(itype(i)))
          summas=summas+amas                     
          if (itype(i).ne.10 .and. itype(i).ne.21) then
            do j=1,3
index b3f26b3..aea1aab 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):',
@@ -301,10 +338,17 @@ C
        bsc(1,i)=0.0D0
         read(irotam,*,end=112,err=112)(censc(k,1,i),k=1,3),
      &    ((blower(k,l,1),l=1,k),k=1,3)
+        censc(1,1,-i)=censc(1,1,i)
+        censc(2,1,-i)=censc(2,1,i)
+        censc(3,1,-i)=-censc(3,1,i)
        do j=2,nlob(i)
          read (irotam,*,end=112,err=112) bsc(j,i)
          read (irotam,*,end=112,err=112) (censc(k,j,i),k=1,3),
      &                                 ((blower(k,l,j),l=1,k),k=1,3)
+        censc(1,j,-i)=censc(1,j,i)
+        censc(2,j,-i)=censc(2,j,i)
+        censc(3,j,-i)=-censc(3,j,i)
+C BSC is amplitude of Gaussian
         enddo
        do j=1,nlob(i)
          do k=1,3
@@ -315,6 +359,14 @@ C
               enddo
              gaussc(k,l,j,i)=akl
              gaussc(l,k,j,i)=akl
+             if (((k.eq.3).and.(l.ne.3))
+     &        .or.((l.eq.3).and.(k.ne.3))) then
+                gaussc(k,l,j,-i)=-akl
+                gaussc(l,k,j,-i)=-akl
+              else
+                gaussc(k,l,j,-i)=akl
+                gaussc(l,k,j,-i)=akl
+              endif
             enddo
           enddo 
        enddo
@@ -397,52 +449,73 @@ C Read torsional parameters
 C
       read (itorp,*,end=113,err=113) ntortyp
       read (itorp,*,end=113,err=113) (itortyp(i),i=1,ntyp)
+      do iblock=1,2
+      do i=-ntyp,-1
+       itortyp(i)=-itortyp(-i)
+      enddo
 c      write (iout,*) 'ntortyp',ntortyp
-      do i=1,ntortyp
-       do j=1,ntortyp
-         read (itorp,*,end=113,err=113) nterm(i,j),nlor(i,j)
+      do i=0,ntortyp-1
+        do j=-ntortyp+1,ntortyp-1
+          read (itorp,*,end=113,err=113) nterm(i,j,iblock),
+     &          nlor(i,j,iblock)
+          nterm(-i,-j,iblock)=nterm(i,j,iblock)
+          nlor(-i,-j,iblock)=nlor(i,j,iblock)
           v0ij=0.0d0
           si=-1.0d0
-         do k=1,nterm(i,j)
-           read (itorp,*,end=113,err=113) kk,v1(k,i,j),v2(k,i,j) 
-            v0ij=v0ij+si*v1(k,i,j)
+          do k=1,nterm(i,j,iblock)
+            read (itorp,*,end=113,err=113) kk,v1(k,i,j,iblock),
+     &      v2(k,i,j,iblock)
+            v1(k,-i,-j,iblock)=v1(k,i,j,iblock)
+            v2(k,-i,-j,iblock)=-v2(k,i,j,iblock)
+            v0ij=v0ij+si*v1(k,i,j,iblock)
             si=-si
+c         write(iout,*) i,j,k,iblock,nterm(i,j,iblock)
+c         write(iout,*) v1(k,-i,-j,iblock),v1(k,i,j,iblock),
+c      &v2(k,-i,-j,iblock),v2(k,i,j,iblock)
           enddo
-         do k=1,nlor(i,j)
+          do k=1,nlor(i,j,iblock)
             read (itorp,*,end=113,err=113) kk,vlor1(k,i,j),
-     &        vlor2(k,i,j),vlor3(k,i,j) 
+     &        vlor2(k,i,j),vlor3(k,i,j)
             v0ij=v0ij+vlor1(k,i,j)/(1+vlor3(k,i,j)**2)
           enddo
-          v0(i,j)=v0ij
+          v0(i,j,iblock)=v0ij
+          v0(-i,-j,iblock)=v0ij
         enddo
       enddo
+      enddo
       close (itorp)
       if (lprint) then
-       write (iout,'(/a/)') 'Torsional constants:'
-       do i=1,ntortyp
-         do j=1,ntortyp
+        write (iout,'(/a/)') 'Torsional constants:'
+        do i=1,ntortyp
+          do j=1,ntortyp
             write (iout,*) 'ityp',i,' jtyp',j
             write (iout,*) 'Fourier constants'
-            do k=1,nterm(i,j)
-             write (iout,'(2(1pe15.5))') v1(k,i,j),v2(k,i,j)
+            do k=1,nterm(i,j,iblock)
+              write (iout,'(2(1pe15.5))') v1(k,i,j,iblock),
+     &        v2(k,i,j,iblock)
             enddo
             write (iout,*) 'Lorenz constants'
-            do k=1,nlor(i,j)
-             write (iout,'(3(1pe15.5))') 
+            do k=1,nlor(i,j,iblock)
+              write (iout,'(3(1pe15.5))')
      &         vlor1(k,i,j),vlor2(k,i,j),vlor3(k,i,j)
             enddo
           enddo
         enddo
       endif
+
 C
 C 6/23/01 Read parameters for double torsionals
 C
-      do i=1,ntortyp
-        do j=1,ntortyp
-          do k=1,ntortyp
+      do iblock=1,2
+      do i=0,ntortyp-1
+        do j=-ntortyp+1,ntortyp-1
+          do k=-ntortyp+1,ntortyp-1
             read (itordp,'(3a1)',end=114,err=114) t1,t2,t3
-            if (t1.ne.onelett(i) .or. t2.ne.onelett(j) 
-     &        .or. t3.ne.onelett(k)) then
+c              write (iout,*) "OK onelett",
+c     &         i,j,k,t1,t2,t3
+
+            if (t1.ne.toronelet(i) .or. t2.ne.toronelet(j)
+     &        .or. t3.ne.toronelet(k)) then
               write (iout,*) "Error in double torsional parameter file",
      &         i,j,k,t1,t2,t3
 #ifdef MPI
@@ -450,54 +523,81 @@ C
 #endif
                stop "Error in double torsional parameter file"
             endif
-            read (itordp,*,end=114,err=114) ntermd_1(i,j,k),
-     &         ntermd_2(i,j,k)
-            read (itordp,*,end=114,err=114) (v1c(1,l,i,j,k),l=1,
-     &         ntermd_1(i,j,k))
-            read (itordp,*,end=114,err=114) (v1s(1,l,i,j,k),l=1,
-     &         ntermd_1(i,j,k))
-            read (itordp,*,end=114,err=114) (v1c(2,l,i,j,k),l=1,
-     &         ntermd_1(i,j,k))
-            read (itordp,*,end=114,err=114) (v1s(2,l,i,j,k),l=1,
-     &         ntermd_1(i,j,k))
-            read (itordp,*,end=114,err=114) ((v2c(l,m,i,j,k),
-     &         v2c(m,l,i,j,k),v2s(l,m,i,j,k),v2s(m,l,i,j,k),
-     &         m=1,l-1),l=1,ntermd_2(i,j,k))
-          enddo
-        enddo
-      enddo
+           read (itordp,*,end=114,err=114) ntermd_1(i,j,k,iblock),
+     &         ntermd_2(i,j,k,iblock)
+            ntermd_1(-i,-j,-k,iblock)=ntermd_1(i,j,k,iblock)
+            ntermd_2(-i,-j,-k,iblock)=ntermd_2(i,j,k,iblock)
+            read (itordp,*,end=114,err=114) (v1c(1,l,i,j,k,iblock),l=1,
+     &         ntermd_1(i,j,k,iblock))
+            read (itordp,*,end=114,err=114) (v1s(1,l,i,j,k,iblock),l=1,
+     &         ntermd_1(i,j,k,iblock))
+            read (itordp,*,end=114,err=114) (v1c(2,l,i,j,k,iblock),l=1,
+     &         ntermd_1(i,j,k,iblock))
+            read (itordp,*,end=114,err=114) (v1s(2,l,i,j,k,iblock),l=1,
+     &         ntermd_1(i,j,k,iblock))
+C Martix of D parameters for one dimesional foureir series
+            do l=1,ntermd_1(i,j,k,iblock)
+             v1c(1,l,-i,-j,-k,iblock)=v1c(1,l,i,j,k,iblock)
+             v1s(1,l,-i,-j,-k,iblock)=-v1s(1,l,i,j,k,iblock)
+             v1c(2,l,-i,-j,-k,iblock)=v1c(2,l,i,j,k,iblock)
+             v1s(2,l,-i,-j,-k,iblock)=-v1s(2,l,i,j,k,iblock)
+c            write(iout,*) "whcodze" ,
+c     & v1s(2,l,-i,-j,-k,iblock),v1s(2,l,i,j,k,iblock)
+            enddo
+            read (itordp,*,end=114,err=114) ((v2c(l,m,i,j,k,iblock),
+     &         v2c(m,l,i,j,k,iblock),v2s(l,m,i,j,k,iblock),
+     &         v2s(m,l,i,j,k,iblock),
+     &         m=1,l-1),l=1,ntermd_2(i,j,k,iblock))
+C Martix of D parameters for two dimesional fourier series
+            do l=1,ntermd_2(i,j,k,iblock)
+             do m=1,l-1
+             v2c(l,m,-i,-j,-k,iblock)=v2c(l,m,i,j,k,iblock)
+             v2c(m,l,-i,-j,-k,iblock)=v2c(m,l,i,j,k,iblock)
+             v2s(l,m,-i,-j,-k,iblock)=-v2s(l,m,i,j,k,iblock)
+             v2s(m,l,-i,-j,-k,iblock)=-v2s(m,l,i,j,k,iblock)
+             enddo!m
+            enddo!l
+          enddo!k
+        enddo!j
+      enddo!i
+      enddo!iblock
       if (lprint) then
-      write (iout,*) 
+      write (iout,*)
       write (iout,*) 'Constants for double torsionals'
+      do iblock=1,2
       do i=1,ntortyp
-        do j=1,ntortyp 
-          do k=1,ntortyp
+        do j=-ntortyp,ntortyp
+          do k=-ntortyp,ntortyp
             write (iout,*) 'ityp',i,' jtyp',j,' ktyp',k,
-     &        ' nsingle',ntermd_1(i,j,k),' ndouble',ntermd_2(i,j,k)
+     &        ' nsingle',ntermd_1(i,j,k,iblock),
+     &        ' ndouble',ntermd_2(i,j,k,iblock)
             write (iout,*)
             write (iout,*) 'Single angles:'
-            do l=1,ntermd_1(i,j,k)
-              write (iout,'(i5,2f10.5,5x,2f10.5)') l,
-     &           v1c(1,l,i,j,k),v1s(1,l,i,j,k),
-     &           v1c(2,l,i,j,k),v1s(2,l,i,j,k)
+            do l=1,ntermd_1(i,j,k,iblock)
+              write (iout,'(i5,2f10.5,5x,2f10.5,5x,2f10.5)') l,
+     &           v1c(1,l,i,j,k,iblock),v1s(1,l,i,j,k,iblock),
+     &           v1c(2,l,i,j,k,iblock),v1s(2,l,i,j,k,iblock),
+     &           v1s(1,l,-i,-j,-k,iblock),v1s(2,l,-i,-j,-k,iblock)
             enddo
             write (iout,*)
             write (iout,*) 'Pairs of angles:'
-            write (iout,'(3x,20i10)') (l,l=1,ntermd_2(i,j,k))
-            do l=1,ntermd_2(i,j,k)
-              write (iout,'(i5,20f10.5)') 
-     &         l,(v2c(l,m,i,j,k),m=1,ntermd_2(i,j,k))
+            write (iout,'(3x,20i10)') (l,l=1,ntermd_2(i,j,k,iblock))
+            do l=1,ntermd_2(i,j,k,iblock)
+              write (iout,'(i5,20f10.5)')
+     &         l,(v2c(l,m,i,j,k,iblock),m=1,ntermd_2(i,j,k,iblock))
             enddo
             write (iout,*)
-            write (iout,'(3x,20i10)') (l,l=1,ntermd_2(i,j,k))
-            do l=1,ntermd_2(i,j,k)
-              write (iout,'(i5,20f10.5)') 
-     &         l,(v2s(l,m,i,j,k),m=1,ntermd_2(i,j,k))
+            write (iout,'(3x,20i10)') (l,l=1,ntermd_2(i,j,k,iblock))
+            do l=1,ntermd_2(i,j,k,iblock)
+              write (iout,'(i5,20f10.5)')
+     &         l,(v2s(l,m,i,j,k,iblock),m=1,ntermd_2(i,j,k,iblock)),
+     &         (v2s(l,m,-i,-j,-k,iblock),m=1,ntermd_2(i,j,k,iblock))
             enddo
             write (iout,*)
           enddo
         enddo
       enddo
+      enddo
       endif
 #endif
 C
@@ -535,7 +635,7 @@ C
         write (iout,*) "Coefficients of the cumulants"
       endif
       read (ifourier,*) nloctyp
-      do i=1,nloctyp
+      do i=0,nloctyp-1
         read (ifourier,*,end=115,err=115)
         read (ifourier,*,end=115,err=115) (b(ii),ii=1,13)
         if (lprint) then
@@ -544,20 +644,31 @@ C
         endif
         B1(1,i)  = b(3)
         B1(2,i)  = b(5)
+        B1(1,-i) = b(3)
+        B1(2,-i) = -b(5)
 c        b1(1,i)=0.0d0
 c        b1(2,i)=0.0d0
         B1tilde(1,i) = b(3)
-        B1tilde(2,i) =-b(5) 
+        B1tilde(2,i) =-b(5)
+        B1tilde(1,-i) =-b(3)
+        B1tilde(2,-i) =b(5)
 c        b1tilde(1,i)=0.0d0
 c        b1tilde(2,i)=0.0d0
         B2(1,i)  = b(2)
         B2(2,i)  = b(4)
+        B2(1,-i)  =b(2)
+        B2(2,-i)  =-b(4)
+
 c        b2(1,i)=0.0d0
 c        b2(2,i)=0.0d0
         CC(1,1,i)= b(7)
         CC(2,2,i)=-b(7)
         CC(2,1,i)= b(9)
         CC(1,2,i)= b(9)
+        CC(1,1,-i)= b(7)
+        CC(2,2,-i)=-b(7)
+        CC(2,1,-i)=-b(9)
+        CC(1,2,-i)=-b(9)
 c        CC(1,1,i)=0.0d0
 c        CC(2,2,i)=0.0d0
 c        CC(2,1,i)=0.0d0
@@ -566,6 +677,11 @@ c        CC(1,2,i)=0.0d0
         Ctilde(1,2,i)=b(9)
         Ctilde(2,1,i)=-b(9)
         Ctilde(2,2,i)=b(7)
+        Ctilde(1,1,-i)=b(7)
+        Ctilde(1,2,-i)=-b(9)
+        Ctilde(2,1,-i)=b(9)
+        Ctilde(2,2,-i)=b(7)
+
 c        Ctilde(1,1,i)=0.0d0
 c        Ctilde(1,2,i)=0.0d0
 c        Ctilde(2,1,i)=0.0d0
@@ -574,6 +690,10 @@ c        Ctilde(2,2,i)=0.0d0
         DD(2,2,i)=-b(6)
         DD(2,1,i)= b(8)
         DD(1,2,i)= b(8)
+        DD(1,1,-i)= b(6)
+        DD(2,2,-i)=-b(6)
+        DD(2,1,-i)=-b(8)
+        DD(1,2,-i)=-b(8)
 c        DD(1,1,i)=0.0d0
 c        DD(2,2,i)=0.0d0
 c        DD(2,1,i)=0.0d0
@@ -582,6 +702,11 @@ c        DD(1,2,i)=0.0d0
         Dtilde(1,2,i)=b(8)
         Dtilde(2,1,i)=-b(8)
         Dtilde(2,2,i)=b(6)
+        Dtilde(1,1,-i)=b(6)
+        Dtilde(1,2,-i)=-b(8)
+        Dtilde(2,1,-i)=b(8)
+        Dtilde(2,2,-i)=b(6)
+
 c        Dtilde(1,1,i)=0.0d0
 c        Dtilde(1,2,i)=0.0d0
 c        Dtilde(2,1,i)=0.0d0
@@ -590,6 +715,11 @@ c        Dtilde(2,2,i)=0.0d0
         EE(2,2,i)=-b(10)+b(11)
         EE(2,1,i)= b(12)-b(13)
         EE(1,2,i)= b(12)+b(13)
+        EE(1,1,-i)= b(10)+b(11)
+        EE(2,2,-i)=-b(10)+b(11)
+        EE(2,1,-i)=-b(12)+b(13)
+        EE(1,2,-i)=-b(12)-b(13)
+
 c        ee(1,1,i)=1.0d0
 c        ee(2,2,i)=1.0d0
 c        ee(2,1,i)=0.0d0
@@ -617,6 +747,7 @@ c        ee(2,1,i)=ee(1,2,i)
         enddo
       enddo
       endif
+
 C 
 C Read electrostatic-interaction parameters
 C
index 68ae6f4..75c418a 100644 (file)
@@ -749,8 +749,8 @@ C Assign initial virtual bond lengths
           vbld_inv(i)=vblinv
         enddo
         do i=2,nres-1
-          vbld(i+nres)=dsc(itype(i))
-          vbld_inv(i+nres)=dsc_inv(itype(i))
+          vbld(i+nres)=dsc(iabs(itype(i)))
+          vbld_inv(i+nres)=dsc_inv(iabs(itype(i)))
 c          write (iout,*) "i",i," itype",itype(i),
 c     &      " dsc",dsc(itype(i))," vbld",vbld(i),vbld(i+nres)
         enddo
@@ -765,9 +765,9 @@ c      print '(20i4)',(itype(i),i=1,nres)
 #endif
           itel(i)=0
 #ifdef PROCOR
-        else if (itype(i+1).ne.20) then
+        else if (iabs(itype(i+1)).ne.20) then
 #else
-        else if (itype(i).ne.20) then
+        else if (iabs(itype(i)).ne.20) then
 #endif
          itel(i)=1
         else
@@ -974,6 +974,7 @@ C initial geometry.
          enddo
          do i=2,nres-1
           omeg(i)=-120d0*deg2rad
+          if (itype(i).le.0) omeg(i)=-omeg(i)
          enddo
         else
           if(me.eq.king.or..not.out1file)
index 2973ef9..bc79489 100644 (file)
@@ -7,7 +7,7 @@
 
       if (itype.eq.0) then
 
-      do i=1,ntyp1
+      do i=-ntyp1,ntyp1
         if (ucase(nam).eq.restyp(i)) then
           rescode=i
           return
@@ -16,7 +16,7 @@
 
       else
 
-      do i=1,ntyp1
+      do i=-ntyp1,ntyp1
         if (nam(1:1).eq.onelet(i)) then
           rescode=i
           return  
index a7a4f64..5287de8 100644 (file)
@@ -253,7 +253,7 @@ cd      print *,'new       ',(energy(k),k=0,n_ene)
       n_try=0
       do while (n_try.lt.n_maxtry .and. orig_e-cur_e.lt.e_drop)
 c     Move the selected residue (don't worry if it fails)
-        call gen_side(itype(res_pick),theta(res_pick+1),
+        call gen_side(iabs(itype(res_pick)),theta(res_pick+1),
      +       alph(res_pick),omeg(res_pick),fail)
 
 c     Minimize the side-chains starting from the new arrangement
@@ -717,8 +717,8 @@ c     if (icall.eq.0) lprn=.true.
       do i=iatsc_s,iatsc_e
 
 
-        itypi=itype(i)
-        itypi1=itype(i+1)
+        itypi=iabs(itype(i))
+        itypi1=iabs(itype(i+1))
         xi=c(1,nres+i)
         yi=c(2,nres+i)
         zi=c(3,nres+i)
@@ -733,7 +733,7 @@ C
           do j=istart(i,iint),iend(i,iint)
           IF (mask_side(j).eq.1.or.mask_side(i).eq.1) THEN
             ind=ind+1
-            itypj=itype(j)
+            itypj=iabs(itype(j))
             dscj_inv=dsc_inv(itypj)
             sig0ij=sigma(itypi,itypj)
             chi1=chi(itypi,itypj)
index 8faecc2..3ad7650 100644 (file)
@@ -360,7 +360,7 @@ c  Load the friction coefficients corresponding to side chains
         ind=ind+1
         ii = ind+m
         iti=itype(i)
-        gamvec(ii)=gamsc(iti)
+        gamvec(ii)=gamsc(iabs(iti))
       enddo
       if (surfarea) call sdarea(gamvec)
 c      if (lprn) then
diff --git a/source/unres/src_MD-M/tmptmp b/source/unres/src_MD-M/tmptmp
deleted file mode 100644 (file)
index 54e7a36..0000000
+++ /dev/null
@@ -1 +0,0 @@
-adam
index e943ce5..0e4a3bf 100644 (file)
@@ -1447,7 +1447,7 @@ C
         do iint=1,nint_gr(i)
           do j=istart(i,iint),iend(i,iint)
             ind=ind+1
-            itypj=itype(j)
+            itypj=iabs(itype(j))
 c            dscj_inv=dsc_inv(itypj)
             dscj_inv=vbld_inv(j+nres)
             chi1=chi(itypi,itypj)
index 19ff5c1..b1edf11 100644 (file)
@@ -563,8 +563,8 @@ C
         do j=-ntortyp+1,ntortyp-1
           do k=-ntortyp+1,ntortyp-1
             read (itordp,'(3a1)',end=114,err=114) t1,t2,t3
-              write (iout,*) "OK onelett",
-     &         i,j,k,t1,t2,t3
+c              write (iout,*) "OK onelett",
+c     &         i,j,k,t1,t2,t3
 
             if (t1.ne.toronelet(i) .or. t2.ne.toronelet(j) 
      &        .or. t3.ne.toronelet(k)) then
@@ -733,7 +733,7 @@ c        b1(2,i)=0.0d0
         B1tilde(1,i) = b(3)
         B1tilde(2,i) =-b(5)
         B1tilde(1,-i) =-b(3)
-        B1tilde(2,-i) =b(5) 
+        B1tilde(2,-i) =b(5)
 c        b1tilde(1,i)=0.0d0
 c        b1tilde(2,i)=0.0d0
         B2(1,i)  = b(2)
index 85c171f..e1d3c26 100644 (file)
@@ -369,7 +369,7 @@ c  Load the friction coefficients corresponding to side chains
         ind=ind+1
         ii = ind+m
         iti=itype(i)
-        gamvec(ii)=gamsc(iti)
+        gamvec(ii)=gamsc(iabs(iti))
       enddo
       if (surfarea) call sdarea(gamvec)
 c      if (lprn) then
index 7ca29e0..b27cd2d 100644 (file)
@@ -104,9 +104,13 @@ C
        sigii(i)=0.0D0
        rr0(i)=0.0D0
        a0thet(i)=0.0D0
-       do j=1,2
-         athet(j,i)=0.0D0
-         bthet(j,i)=0.0D0
+        do j=1,2
+         do ichir1=-1,1
+          do ichir2=-1,1
+          athet(j,i,ichir1,ichir2)=0.0D0
+          bthet(j,i,ichir1,ichir2)=0.0D0
+          enddo
+         enddo
         enddo
        do j=0,3
          polthet(j,i)=0.0D0
@@ -132,15 +136,37 @@ C
       enddo
       nlob(ntyp1)=0
       dsc(ntyp1)=0.0D0
-      do i=1,maxtor
-       itortyp(i)=0
-       do j=1,maxtor
-         do k=1,maxterm
-           v1(k,j,i)=0.0D0
-           v2(k,j,i)=0.0D0
+      do i=-maxtor,maxtor
+        itortyp(i)=0
+       do iblock=1,2
+        do j=-maxtor,maxtor
+          do k=1,maxterm
+            v1(k,j,i,iblock)=0.0D0
+            v2(k,j,i,iblock)=0.0D0
           enddo
         enddo
+        enddo
       enddo
+      do iblock=1,2
+       do i=-maxtor,maxtor
+        do j=-maxtor,maxtor
+         do k=-maxtor,maxtor
+          do l=1,maxtermd_1
+            v1c(1,l,i,j,k,iblock)=0.0D0
+            v1s(1,l,i,j,k,iblock)=0.0D0
+            v1c(2,l,i,j,k,iblock)=0.0D0
+            v1s(2,l,i,j,k,iblock)=0.0D0
+          enddo !l
+          do l=1,maxtermd_2
+           do m=1,maxtermd_2
+            v2c(m,l,i,j,k,iblock)=0.0D0
+            v2s(m,l,i,j,k,iblock)=0.0D0
+           enddo !m
+          enddo !l
+        enddo !k
+       enddo !j
+      enddo !i
+      enddo !iblock
       do i=1,maxres
        itype(i)=0
        itel(i)=0
@@ -219,9 +245,13 @@ c-------------------------------------------------------------------------
       include 'COMMON.WEIGHTS'
       include 'COMMON.FFIELD'
       data restyp /
+     &'DD' ,'DPR','DLY','DAR','DHI','DAS','DGL','DSG','DGN','DSN','DTH',
+     &'DYY','DAL','DTY','DTR','DVA','DLE','DIL','DPN','MED','DCY','ZER',
      &'CYS','MET','PHE','ILE','LEU','VAL','TRP','TYR','ALA','GLY','THR',
      &'SER','GLN','ASN','GLU','ASP','HIS','ARG','LYS','PRO','D'/
       data onelet /
+     &'z','p','k','r','h','d','e','n','q','s','t','g',
+     &'a','y','w','v','l','i','f','m','c','x',
      &'C','M','F','I','L','V','W','Y','A','G','T',
      &'S','Q','N','E','D','H','R','K','P','X'/
       data potname /'LJ','LJK','BP','GB','GBV'/
@@ -349,7 +379,7 @@ cd      write (iout,*) 'i=',i,' scheck=',scheck,' jj=',jj
           nint_gr(i)=1
           istart(i,1)=i+1
           iend(i,1)=nct
-          ind_scint=int_scint+nct-i
+          ind_scint=ind_scint+nct-i
 #endif
         endif
 #ifdef MPL
index d8d7817..dc5a97b 100644 (file)
@@ -194,12 +194,47 @@ 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,*) a0thet(i),(athet(j,i),j=1,2),(bthet(j,i),j=1,2)
+        read (ithep,*) a0thet(i),(athet(j,i,1,1),j=1,2),
+     &    (bthet(j,i,1,1),j=1,2)
         read (ithep,*) (polthet(j,i),j=0,3)
        read (ithep,*) (gthet(j,i),j=1,3)
        read (ithep,*) 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
 c       write (iout,'(a)') 
@@ -235,7 +270,8 @@ c       enddo
      & '   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):',
@@ -388,10 +424,16 @@ C
         enddo  
        bsc(1,i)=0.0D0
         read(irotam,*)(censc(k,1,i),k=1,3),((blower(k,l,1),l=1,k),k=1,3)
+         censc(1,1,-i)=censc(1,1,i)
+         censc(2,1,-i)=censc(2,1,i)
+         censc(3,1,-i)=-censc(3,1,i)
        do j=2,nlob(i)
          read (irotam,*) bsc(j,i)
          read (irotam,*) (censc(k,j,i),k=1,3),
      &                                 ((blower(k,l,j),l=1,k),k=1,3)
+          censc(1,j,-i)=censc(1,j,i)
+          censc(2,j,-i)=censc(2,j,i)
+          censc(3,j,-i)=-censc(3,j,i)
         enddo
        do j=1,nlob(i)
          do k=1,3
@@ -402,6 +444,14 @@ C
               enddo
              gaussc(k,l,j,i)=akl
              gaussc(l,k,j,i)=akl
+               if (((k.eq.3).and.(l.ne.3))
+     &        .or.((l.eq.3).and.(k.ne.3))) then
+                 gaussc(k,l,j,-i)=-akl
+                 gaussc(l,k,j,-i)=-akl
+               else
+                 gaussc(k,l,j,-i)=akl
+                 gaussc(l,k,j,-i)=akl
+               endif
             enddo
           enddo 
        enddo
@@ -640,39 +690,96 @@ 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
       read (ifourier,*) nloctyp
-      do i=1,nloctyp
-        read (ifourier,*)
-        read (ifourier,*) (b(ii,i),ii=1,13)
+      do i=0,nloctyp-1
+        read (ifourier,*,end=115,err=115)
+        read (ifourier,*,end=115,err=115) (b(ii),ii=1,13)
         if (lprint) then
         write (iout,*) 'Type',i
-        write (iout,'(a,i2,a,f10.5)') ('b(',ii,')=',b(ii,i),ii=1,13)
+        write (iout,'(a,i2,a,f10.5)') ('b(',ii,')=',b(ii),ii=1,13)
         endif
-        B1(1,i)  = b(3,i)
-        B1(2,i)  = b(5,i)
-        B1tilde(1,i) = b(3,i)
-        B1tilde(2,i) =-b(5,i) 
-        B2(1,i)  = b(2,i)
-        B2(2,i)  = b(4,i)
-        CC(1,1,i)= b(7,i)
-        CC(2,2,i)=-b(7,i)
-        CC(2,1,i)= b(9,i)
-        CC(1,2,i)= b(9,i)
-        Ctilde(1,1,i)=b(7,i)
-        Ctilde(1,2,i)=b(9,i)
-        Ctilde(2,1,i)=-b(9,i)
-        Ctilde(2,2,i)=b(7,i)
-        DD(1,1,i)= b(6,i)
-        DD(2,2,i)=-b(6,i)
-        DD(2,1,i)= b(8,i)
-        DD(1,2,i)= b(8,i)
-        Dtilde(1,1,i)=b(6,i)
-        Dtilde(1,2,i)=b(8,i)
-        Dtilde(2,1,i)=-b(8,i)
-        Dtilde(2,2,i)=b(6,i)
-        EE(1,1,i)= b(10,i)+b(11,i)
-        EE(2,2,i)=-b(10,i)+b(11,i)
-        EE(2,1,i)= b(12,i)-b(13,i)
-        EE(1,2,i)= b(12,i)+b(13,i)
+        B1(1,i)  = b(3)
+        B1(2,i)  = b(5)
+        B1(1,-i) = b(3)
+        B1(2,-i) = -b(5)
+c        b1(1,i)=0.0d0
+c        b1(2,i)=0.0d0
+        B1tilde(1,i) = b(3)
+        B1tilde(2,i) =-b(5)
+        B1tilde(1,-i) =-b(3)
+        B1tilde(2,-i) =b(5)
+c        b1tilde(1,i)=0.0d0
+c        b1tilde(2,i)=0.0d0
+        B2(1,i)  = b(2)
+        B2(2,i)  = b(4)
+        B2(1,-i)  =b(2)
+        B2(2,-i)  =-b(4)
+
+c        b2(1,i)=0.0d0
+c        b2(2,i)=0.0d0
+        CC(1,1,i)= b(7)
+        CC(2,2,i)=-b(7)
+        CC(2,1,i)= b(9)
+        CC(1,2,i)= b(9)
+        CC(1,1,-i)= b(7)
+        CC(2,2,-i)=-b(7)
+        CC(2,1,-i)=-b(9)
+        CC(1,2,-i)=-b(9)
+c        CC(1,1,i)=0.0d0
+c        CC(2,2,i)=0.0d0
+c        CC(2,1,i)=0.0d0
+c        CC(1,2,i)=0.0d0
+        Ctilde(1,1,i)=b(7)
+        Ctilde(1,2,i)=b(9)
+        Ctilde(2,1,i)=-b(9)
+        Ctilde(2,2,i)=b(7)
+        Ctilde(1,1,-i)=b(7)
+        Ctilde(1,2,-i)=-b(9)
+        Ctilde(2,1,-i)=b(9)
+        Ctilde(2,2,-i)=b(7)
+
+c        Ctilde(1,1,i)=0.0d0
+c        Ctilde(1,2,i)=0.0d0
+c        Ctilde(2,1,i)=0.0d0
+c        Ctilde(2,2,i)=0.0d0
+        DD(1,1,i)= b(6)
+        DD(2,2,i)=-b(6)
+        DD(2,1,i)= b(8)
+        DD(1,2,i)= b(8)
+        DD(1,1,-i)= b(6)
+        DD(2,2,-i)=-b(6)
+        DD(2,1,-i)=-b(8)
+        DD(1,2,-i)=-b(8)
+c        DD(1,1,i)=0.0d0
+c        DD(2,2,i)=0.0d0
+c        DD(2,1,i)=0.0d0
+c        DD(1,2,i)=0.0d0
+        Dtilde(1,1,i)=b(6)
+        Dtilde(1,2,i)=b(8)
+        Dtilde(2,1,i)=-b(8)
+        Dtilde(2,2,i)=b(6)
+        Dtilde(1,1,-i)=b(6)
+        Dtilde(1,2,-i)=-b(8)
+        Dtilde(2,1,-i)=b(8)
+        Dtilde(2,2,-i)=b(6)
+
+c        Dtilde(1,1,i)=0.0d0
+c        Dtilde(1,2,i)=0.0d0
+c        Dtilde(2,1,i)=0.0d0
+c        Dtilde(2,2,i)=0.0d0
+        EE(1,1,i)= b(10)+b(11)
+        EE(2,2,i)=-b(10)+b(11)
+        EE(2,1,i)= b(12)-b(13)
+        EE(1,2,i)= b(12)+b(13)
+        EE(1,1,-i)= b(10)+b(11)
+        EE(2,2,-i)=-b(10)+b(11)
+        EE(2,1,-i)=-b(12)+b(13)
+        EE(1,2,-i)=-b(12)-b(13)
+
+c        ee(1,1,i)=1.0d0
+c        ee(2,2,i)=1.0d0
+c        ee(2,1,i)=0.0d0
+c        ee(1,2,i)=0.0d0
+c        ee(2,1,i)=ee(1,2,i)
       enddo
       if (lprint) then
       do i=1,nloctyp