implicit real*8 (a-h,o-z)
include 'DIMENSIONS'
include 'DIMENSIONS.ZSCOPT'
+ include 'DIMENSIONS.FREE'
#ifndef ISNAN
external proc_proc
& +wcorr6*fact(5)*ecorr6+wturn4*fact(3)*eello_turn4
& +wturn3*fact(2)*eello_turn3+wturn6*fact(5)*eturn6
& +wel_loc*fact(2)*eel_loc+edihcnstr+wtor_d*fact(2)*etors_d
- & +wbond*estr+wsccor*fact(1)*esccor+ehomology_constr
+ & +wbond*estr+wsccor*fact(1)*esccor!+ehomology_constr
& +wdfa_dist*edfadis+wdfa_tor*edfator+wdfa_nei*edfanei
& +wdfa_beta*edfabet
#else
& +wcorr6*fact(5)*ecorr6+wturn4*fact(3)*eello_turn4
& +wturn3*fact(2)*eello_turn3+wturn6*fact(5)*eturn6
& +wel_loc*fact(2)*eel_loc+edihcnstr+wtor_d*fact(2)*etors_d
- & +wbond*estr+wsccor*fact(1)*esccor+ehomology_constr
+ & +wbond*estr+wsccor*fact(1)*esccor!+ehomology_constr
& +wdfa_dist*edfadis+wdfa_tor*edfator+wdfa_nei*edfanei
& +wdfa_beta*edfabet
#endif
implicit real*8 (a-h,o-z)
include 'DIMENSIONS'
include 'DIMENSIONS.ZSCOPT'
+ include 'DIMENSIONS.FREE'
include 'COMMON.CONTROL'
include 'COMMON.IOUNITS'
include 'COMMON.GEO'
C
implicit real*8 (a-h,o-z)
include 'DIMENSIONS'
+ include 'DIMENSIONS.FREE'
include 'COMMON.SBRIDGE'
include 'COMMON.CHAIN'
include 'COMMON.DERIV'
include 'COMMON.VAR'
include 'COMMON.INTERACT'
include 'COMMON.IOUNITS'
+ include 'COMMON.CONTROL'
dimension ggg(3)
ehpb=0.0D0
cd write(iout,*)'edis: nhpb=',nhpb,' fbr=',fbr
else if (ii.gt.nres .and. jj.gt.nres) then
c Restraints from contact prediction
dd=dist(ii,jj)
+ if (constr_dist.eq.11) then
+ ehpb=ehpb+fordepth(i)**4.0d0
+ & *rlornmr1(dd,dhpb(i),dhpb1(i),forcon(i))
+ fac=fordepth(i)**4.0d0
+ & *rlornmr1prim(dd,dhpb(i),dhpb1(i),forcon(i))/dd
+ else
if (dhpb1(i).gt.0.0d0) then
ehpb=ehpb+2*forcon(i)*gnmr1(dd,dhpb(i),dhpb1(i))
fac=forcon(i)*gnmr1prim(dd,dhpb(i),dhpb1(i))/dd
C Evaluate gradient.
C
fac=waga*rdis/dd
- endif
+ endif !end dhpb1(i).gt.0
+ endif !end const_dist=11
do j=1,3
ggg(j)=fac*(c(j,jj)-c(j,ii))
enddo
C Calculate the distance between the two points and its difference from the
C target distance.
dd=dist(ii,jj)
+C write(iout,*) "after",dd
+ if (constr_dist.eq.11) then
+ ehpb=ehpb+fordepth(i)**4.0d0
+ & *rlornmr1(dd,dhpb(i),dhpb1(i),forcon(i))
+ fac=fordepth(i)**4.0d0
+ & *rlornmr1prim(dd,dhpb(i),dhpb1(i),forcon(i))/dd
+C ehpb=ehpb+fordepth(i)**4*rlornmr1(dd,dhpb(i),dhpb1(i))
+C fac=fordepth(i)**4*rlornmr1prim(dd,dhpb(i),dhpb1(i))/dd
+C print *,ehpb,"tu?"
+C write(iout,*) ehpb,"btu?",
+C & dd,dhpb(i),dhpb1(i),fordepth(i),forcon(i)
+C write (iout,'(a6,2i5,3f8.3)') "edisl",ii,jj,
+C & ehpb,fordepth(i),dd
+ else
if (dhpb1(i).gt.0.0d0) then
ehpb=ehpb+2*forcon(i)*gnmr1(dd,dhpb(i),dhpb1(i))
fac=forcon(i)*gnmr1prim(dd,dhpb(i),dhpb1(i))/dd
C
fac=waga*rdis/dd
endif
+ endif
cd print *,'i=',i,' ii=',ii,' jj=',jj,' dhpb=',dhpb(i),' dd=',dd,
cd & ' waga=',waga,' fac=',fac
do j=1,3
enddo
endif
enddo
- ehpb=0.5D0*ehpb
+ if (constr_dist.ne.11) ehpb=0.5D0*ehpb
return
end
C--------------------------------------------------------------------------
implicit real*8 (a-h,o-z)
include 'DIMENSIONS'
include 'DIMENSIONS.ZSCOPT'
-
+ include 'DIMENSIONS.FREE'
integer nnn, i, j, k, ki, irec, l
integer katy, odleglosci, test7
real*8 odleg, odleg2, odleg3, kat, kat2, kat3, gdih(max_template)
include 'COMMON.SETUP'
include 'COMMON.NAMES'
- do i=1,19
+ do i=1,max_template
distancek(i)=9999999.9
enddo
dij=dist(i,j)
c write (iout,*) "dij(",i,j,") =",dij
do k=1,constr_homology
+ if(.not.l_homo(k,ii)) cycle
distance(k)=odl(k,ii)-dij
c write (iout,*) "distance(",k,") =",distance(k)
c
endif
enddo
- min_odl=minval(distancek)
+c min_odl=minval(distancek)
+ do kk=1,constr_homology
+ if(l_homo(kk,ii)) then
+ min_odl=distancek(kk)
+ exit
+ endif
+ enddo
+ do kk=1,constr_homology
+ if(l_homo(kk,ii) .and. distancek(kk).lt.min_odl)
+ & min_odl=distancek(kk)
+ enddo
c write (iout,* )"min_odl",min_odl
#ifdef DEBUG
write (iout,*) "ij dij",i,j,dij
c Nie wiem po co to liczycie jeszcze raz!
c odleg3=-waga_dist(iset)*((distance(i,j,k)**2)/
c & (2*(sigma_odl(i,j,k))**2))
+ if(.not.l_homo(k,ii)) cycle
if (waga_dist.ge.0.0d0) then
c
c For Gaussian-type Urestr
c & *waga_dist)+min_odl
c sgodl=-godl(k)*distance(k)*sigma_odl(k,ii)*waga_dist
c
+ if(.not.l_homo(k,ii)) cycle
if (waga_dist.ge.0.0d0) then
c For Gaussian-type Urestr
c
do i=idihconstr_start_homo,idihconstr_end_homo
kat2=0.0d0
c betai=beta(i,i+1,i+2,i+3)
- betai = phi(i+3)
+ betai = phi(i)
c write (iout,*) "betai =",betai
do k=1,constr_homology
dih_diff(k)=pinorm(dih(k,i)-betai)
c
c For Gaussian-type Urestr
c
- ehomology_constr=(waga_dist*odleg+waga_angle*kat+
- & waga_theta*Eval+waga_d*Erot)*waga_homology(iset)
+c ehomology_constr=(waga_dist*odleg+waga_angle*kat+
+c & waga_theta*Eval+waga_d*Erot)*waga_homology(iset)
+ ehomology_constr=waga_dist*odleg+waga_angle*kat+
+ & waga_theta*Eval+waga_d*Erot
c write (iout,*) "ehomology_constr=",ehomology_constr
else
c
c For Lorentzian-type Urestr
c
- ehomology_constr=(-waga_dist*odleg+waga_angle*kat+
- & waga_theta*Eval+waga_d*Erot)*waga_homology(iset)
+c ehomology_constr=(-waga_dist*odleg+waga_angle*kat+
+c & waga_theta*Eval+waga_d*Erot)*waga_homology(iset)
+ ehomology_constr=-waga_dist*odleg+waga_angle*kat+
+ & waga_theta*Eval+waga_d*Erot
c write (iout,*) "ehomology_constr=",ehomology_constr
endif
#ifdef DEBUG
implicit real*8 (a-h,o-z)
include 'DIMENSIONS'
include 'DIMENSIONS.ZSCOPT'
+ include 'DIMENSIONS.FREE'
include 'COMMON.LOCAL'
include 'COMMON.GEO'
include 'COMMON.INTERACT'
implicit real*8 (a-h,o-z)
include 'DIMENSIONS'
include 'DIMENSIONS.ZSCOPT'
+ include 'DIMENSIONS.FREE'
include 'COMMON.LOCAL'
include 'COMMON.GEO'
include 'COMMON.INTERACT'
coskt(k)=dcos(k*theti2)
sinkt(k)=dsin(k*theti2)
enddo
- if (i.gt.3 .and. itype(i-3).ne.ntyp1) then
+ if (i.gt.3 .and. itype(max0(i-3,1)).ne.ntyp1) then
#ifdef OSF
phii=phi(i)
if (phii.ne.phii) phii=150.0
implicit real*8 (a-h,o-z)
include 'DIMENSIONS'
include 'DIMENSIONS.ZSCOPT'
+ include 'DIMENSIONS.FREE'
include 'COMMON.GEO'
include 'COMMON.LOCAL'
include 'COMMON.VAR'
implicit real*8 (a-h,o-z)
include 'DIMENSIONS'
include 'DIMENSIONS.ZSCOPT'
+ include 'DIMENSIONS.FREE'
include 'COMMON.VAR'
include 'COMMON.GEO'
include 'COMMON.LOCAL'
esccor=0.0D0
do i=itau_start,itau_end
esccor_ii=0.0D0
+ if ((itype(i-2).eq.ntyp1).or.(itype(i-1).eq.ntyp1)) cycle
isccori=isccortyp(itype(i-2))
isccori1=isccortyp(itype(i-1))
phii=phi(i)
cosphi=dcos(j*tauangle(intertyp,i))
sinphi=dsin(j*tauangle(intertyp,i))
esccor=esccor+v1ij*cosphi+v2ij*sinphi
+#ifdef DEBUG
+ esccor_ii=esccor_ii+v1ij*cosphi+v2ij*sinphi
+#endif
gloci=gloci+j*(v2ij*cosphi-v1ij*sinphi)
enddo
gloc_sc(intertyp,i-3,icg)=gloc_sc(intertyp,i-3,icg)+wsccor*gloci
& ,(v2sccor(j,intertyp,itori,itori1),j=1,6)
gsccor_loc(i-3)=gsccor_loc(i-3)+gloci
enddo !intertyp
+#ifdef DEBUG
+ write (iout,*) "i",i,(tauangle(j,i),j=1,3),esccor_ii
+#endif
enddo
c do i=1,nres
c write (iout,*) "W@T@F", gloc_sc(1,i,icg),gloc(i,icg)
C Contacts I-J and (I+1)-(J+1) or (I+1)-(J-1) occur simultaneously.
C The system gains extra energy.
ecorr=ecorr+ehbcorr(i,j,i+1,j1,jj,kk,0.72D0,0.32D0)
+#ifdef DEBUG
+ write (iout,*) "ecorr",i,j,i+1,j1,
+ & ehbcorr(i,j,i+1,j1,jj,kk,0.72D0,0.32D0)
+#endif
n_corr=n_corr+1
else if (j1.eq.j) then
C Contacts I-J and I-(J+1) occur simultaneously.
cd ees0pij=1.0D0
cd ees0mkl=0.0D0
cd ees0mij=1.0D0
-c write (iout,*)'Contacts have occurred for peptide groups',i,j,
-c & ' and',k,l
-c write (iout,*)'Contacts have occurred for peptide groups',
-c & i,j,' fcont:',eij,' eij',' eesij',ees0pij,ees0mij,' and ',k,l
-c & ,' fcont ',ekl,' eeskl',ees0pkl,ees0mkl,' ees=',ees
+cd write (iout,*)'Contacts have occurred for peptide groups',i,j,
+cd & ' and',k,l
+cd write (iout,*)'Contacts have occurred for peptide groups',
+cd & i,j,' fcont:',eij,' eij',' eesij',ees0pij,ees0mij,' and ',k,l
+cd & ,' fcont ',ekl,' eeskl',ees0pkl,ees0mkl,' ees=',ees
C Calculate the multi-body contribution to energy.
ecorr=ecorr+ekont*ees
if (calc_grad) then