1 C-----------------------------------------------------------------------
2 double precision function sscale(r)
3 double precision r,gamm
4 include "COMMON.SPLITELE"
6 if(r.lt.r_cut-rlamb) then
8 else if(r.le.r_cut.and.r.ge.r_cut-rlamb) then
9 gamm=(r-(r_cut-rlamb))/rlamb
10 sscale=1.0d0+gamm*gamm*(2*gamm-3.0d0)
16 C-----------------------------------------------------------------------
17 C-----------------------------------------------------------------------
18 double precision function sscagrad(r)
19 double precision r,gamm
20 include "COMMON.SPLITELE"
21 include "COMMON.CHAIN"
22 if(r.lt.r_cut-rlamb) then
24 else if(r.le.r_cut.and.r.ge.r_cut-rlamb) then
25 gamm=(r-(r_cut-rlamb))/rlamb
26 sscagrad=gamm*(6*gamm-6.0d0)/rlamb
32 C-----------------------------------------------------------------------
34 subroutine elj_long(evdw)
36 C This subroutine calculates the interaction energy of nonbonded side chains
37 C assuming the LJ potential of interaction.
39 implicit real*8 (a-h,o-z)
41 parameter (accur=1.0d-10)
44 include 'COMMON.LOCAL'
45 include 'COMMON.CHAIN'
46 include 'COMMON.DERIV'
47 include 'COMMON.INTERACT'
48 include 'COMMON.TORSION'
49 include 'COMMON.SBRIDGE'
50 include 'COMMON.NAMES'
51 include 'COMMON.IOUNITS'
52 include 'COMMON.CONTACTS'
54 c write(iout,*)'Entering ELJ nnt=',nnt,' nct=',nct,' expon=',expon
63 C Calculate SC interaction energy.
66 cd write (iout,*) 'i=',i,' iint=',iint,' istart=',istart(i,iint),
67 cd & 'iend=',iend(i,iint)
68 do j=istart(i,iint),iend(i,iint)
74 sss=sscale(dsqrt(rij)/sigma(itypi,itypj))
75 if (sss.lt.1.0d0) then
78 e1=fac*fac*aa(itypi,itypj)
79 e2=fac*bb(itypi,itypj)
81 evdw=evdw+(1.0d0-sss)*evdwij
83 C Calculate the components of the gradient in DC and X
85 fac=-rrij*(e1+evdwij)*(1.0d0-sss)
90 gvdwx(k,i)=gvdwx(k,i)-gg(k)
91 gvdwx(k,j)=gvdwx(k,j)+gg(k)
95 gvdwc(l,k)=gvdwc(l,k)+gg(l)
104 gvdwc(j,i)=expon*gvdwc(j,i)
105 gvdwx(j,i)=expon*gvdwx(j,i)
108 C******************************************************************************
112 C To save time, the factor of EXPON has been extracted from ALL components
113 C of GVDWC and GRADX. Remember to multiply them by this factor before further
116 C******************************************************************************
119 C-----------------------------------------------------------------------
120 subroutine elj_short(evdw)
122 C This subroutine calculates the interaction energy of nonbonded side chains
123 C assuming the LJ potential of interaction.
125 implicit real*8 (a-h,o-z)
127 parameter (accur=1.0d-10)
130 include 'COMMON.LOCAL'
131 include 'COMMON.CHAIN'
132 include 'COMMON.DERIV'
133 include 'COMMON.INTERACT'
134 include 'COMMON.TORSION'
135 include 'COMMON.SBRIDGE'
136 include 'COMMON.NAMES'
137 include 'COMMON.IOUNITS'
138 include 'COMMON.CONTACTS'
140 c write(iout,*)'Entering ELJ nnt=',nnt,' nct=',nct,' expon=',expon
149 C Calculate SC interaction energy.
152 cd write (iout,*) 'i=',i,' iint=',iint,' istart=',istart(i,iint),
153 cd & 'iend=',iend(i,iint)
154 do j=istart(i,iint),iend(i,iint)
159 rij=xj*xj+yj*yj+zj*zj
160 sss=sscale(dsqrt(rij)/sigma(itypi,itypj))
161 if (sss.gt.0.0d0) then
164 e1=fac*fac*aa(itypi,itypj)
165 e2=fac*bb(itypi,itypj)
169 C Calculate the components of the gradient in DC and X
171 fac=-rrij*(e1+evdwij)*sss
176 gvdwx(k,i)=gvdwx(k,i)-gg(k)
177 gvdwx(k,j)=gvdwx(k,j)+gg(k)
181 gvdwc(l,k)=gvdwc(l,k)+gg(l)
190 gvdwc(j,i)=expon*gvdwc(j,i)
191 gvdwx(j,i)=expon*gvdwx(j,i)
194 C******************************************************************************
198 C To save time, the factor of EXPON has been extracted from ALL components
199 C of GVDWC and GRADX. Remember to multiply them by this factor before further
202 C******************************************************************************
205 C-----------------------------------------------------------------------------
206 subroutine eljk_long(evdw)
208 C This subroutine calculates the interaction energy of nonbonded side chains
209 C assuming the LJK potential of interaction.
211 implicit real*8 (a-h,o-z)
215 include 'COMMON.LOCAL'
216 include 'COMMON.CHAIN'
217 include 'COMMON.DERIV'
218 include 'COMMON.INTERACT'
219 include 'COMMON.IOUNITS'
220 include 'COMMON.NAMES'
223 c print *,'Entering ELJK nnt=',nnt,' nct=',nct,' expon=',expon
232 C Calculate SC interaction energy.
235 do j=istart(i,iint),iend(i,iint)
240 rrij=1.0D0/(xj*xj+yj*yj+zj*zj)
242 e_augm=augm(itypi,itypj)*fac_augm
245 sss=sscale(rij/sigma(itypi,itypj))
247 if (sss.lt.1.0d0) then
249 r_shift_inv=1.0D0/(rij+r0(itypi,itypj)-sigma(itypi,itypj))
250 fac=r_shift_inv**expon
251 e1=fac*fac*aa(itypi,itypj)
252 e2=fac*bb(itypi,itypj)
254 cd sigm=dabs(aa(itypi,itypj)/bb(itypi,itypj))**(1.0D0/6.0D0)
255 cd epsi=bb(itypi,itypj)**2/aa(itypi,itypj)
256 cd write (iout,'(2(a3,i3,2x),8(1pd12.4)/2(3(1pd12.4),5x)/)')
257 cd & restyp(itypi),i,restyp(itypj),j,aa(itypi,itypj),
258 cd & bb(itypi,itypj),augm(itypi,itypj),epsi,sigm,
259 cd & sigma(itypi,itypj),1.0D0/dsqrt(rrij),evdwij,
260 cd & (c(k,i),k=1,3),(c(k,j),k=1,3)
261 evdw=evdw+evdwij*(1.0d0-sss)
263 C Calculate the components of the gradient in DC and X
265 fac=-2.0D0*rrij*e_augm-r_inv_ij*r_shift_inv*(e1+e1+e2)
271 gvdwx(k,i)=gvdwx(k,i)-gg(k)
272 gvdwx(k,j)=gvdwx(k,j)+gg(k)
276 gvdwc(l,k)=gvdwc(l,k)+gg(l)
287 gvdwc(j,i)=expon*gvdwc(j,i)
288 gvdwx(j,i)=expon*gvdwx(j,i)
293 C-----------------------------------------------------------------------------
294 subroutine eljk_short(evdw)
296 C This subroutine calculates the interaction energy of nonbonded side chains
297 C assuming the LJK potential of interaction.
299 implicit real*8 (a-h,o-z)
303 include 'COMMON.LOCAL'
304 include 'COMMON.CHAIN'
305 include 'COMMON.DERIV'
306 include 'COMMON.INTERACT'
307 include 'COMMON.IOUNITS'
308 include 'COMMON.NAMES'
311 c print *,'Entering ELJK nnt=',nnt,' nct=',nct,' expon=',expon
320 C Calculate SC interaction energy.
323 do j=istart(i,iint),iend(i,iint)
328 rrij=1.0D0/(xj*xj+yj*yj+zj*zj)
330 e_augm=augm(itypi,itypj)*fac_augm
333 sss=sscale(rij/sigma(itypi,itypj))
335 if (sss.gt.0.0d0) then
337 r_shift_inv=1.0D0/(rij+r0(itypi,itypj)-sigma(itypi,itypj))
338 fac=r_shift_inv**expon
339 e1=fac*fac*aa(itypi,itypj)
340 e2=fac*bb(itypi,itypj)
342 cd sigm=dabs(aa(itypi,itypj)/bb(itypi,itypj))**(1.0D0/6.0D0)
343 cd epsi=bb(itypi,itypj)**2/aa(itypi,itypj)
344 cd write (iout,'(2(a3,i3,2x),8(1pd12.4)/2(3(1pd12.4),5x)/)')
345 cd & restyp(itypi),i,restyp(itypj),j,aa(itypi,itypj),
346 cd & bb(itypi,itypj),augm(itypi,itypj),epsi,sigm,
347 cd & sigma(itypi,itypj),1.0D0/dsqrt(rrij),evdwij,
348 cd & (c(k,i),k=1,3),(c(k,j),k=1,3)
351 C Calculate the components of the gradient in DC and X
353 fac=-2.0D0*rrij*e_augm-r_inv_ij*r_shift_inv*(e1+e1+e2)
359 gvdwx(k,i)=gvdwx(k,i)-gg(k)
360 gvdwx(k,j)=gvdwx(k,j)+gg(k)
364 gvdwc(l,k)=gvdwc(l,k)+gg(l)
375 gvdwc(j,i)=expon*gvdwc(j,i)
376 gvdwx(j,i)=expon*gvdwx(j,i)
381 C-----------------------------------------------------------------------------
382 subroutine ebp_long(evdw)
384 C This subroutine calculates the interaction energy of nonbonded side chains
385 C assuming the Berne-Pechukas potential of interaction.
387 implicit real*8 (a-h,o-z)
391 include 'COMMON.LOCAL'
392 include 'COMMON.CHAIN'
393 include 'COMMON.DERIV'
394 include 'COMMON.NAMES'
395 include 'COMMON.INTERACT'
396 include 'COMMON.IOUNITS'
397 include 'COMMON.CALC'
399 c double precision rrsave(maxdim)
402 c print *,'Entering EBP nnt=',nnt,' nct=',nct,' expon=',expon
404 c if (icall.eq.0) then
416 dxi=dc_norm(1,nres+i)
417 dyi=dc_norm(2,nres+i)
418 dzi=dc_norm(3,nres+i)
419 c dsci_inv=dsc_inv(itypi)
420 dsci_inv=vbld_inv(i+nres)
422 C Calculate SC interaction energy.
425 do j=istart(i,iint),iend(i,iint)
428 c dscj_inv=dsc_inv(itypj)
429 dscj_inv=vbld_inv(j+nres)
430 chi1=chi(itypi,itypj)
431 chi2=chi(itypj,itypi)
438 alf12=0.5D0*(alf1+alf2)
439 C For diagnostics only!!!
452 dxj=dc_norm(1,nres+j)
453 dyj=dc_norm(2,nres+j)
454 dzj=dc_norm(3,nres+j)
455 rrij=1.0D0/(xj*xj+yj*yj+zj*zj)
456 cd if (icall.eq.0) then
462 sss=sscale(1.0d0/(rij*sigmaii(itypi,itypj)))
464 if (sss.lt.1.0d0) then
466 C Calculate the angle-dependent terms of energy & contributions to derivatives.
468 C Calculate whole angle-dependent part of epsilon and contributions
470 fac=(rrij*sigsq)**expon2
471 e1=fac*fac*aa(itypi,itypj)
472 e2=fac*bb(itypi,itypj)
473 evdwij=eps1*eps2rt*eps3rt*(e1+e2)
474 eps2der=evdwij*eps3rt
475 eps3der=evdwij*eps2rt
476 evdwij=evdwij*eps2rt*eps3rt
477 evdw=evdw+evdwij*(1.0d0-sss)
479 sigm=dabs(aa(itypi,itypj)/bb(itypi,itypj))**(1.0D0/6.0D0)
480 epsi=bb(itypi,itypj)**2/aa(itypi,itypj)
481 cd write (iout,'(2(a3,i3,2x),15(0pf7.3))')
482 cd & restyp(itypi),i,restyp(itypj),j,
483 cd & epsi,sigm,chi1,chi2,chip1,chip2,
484 cd & eps1,eps2rt**2,eps3rt**2,1.0D0/dsqrt(sigsq),
485 cd & om1,om2,om12,1.0D0/dsqrt(rrij),
488 C Calculate gradient components.
489 e1=e1*eps1*eps2rt**2*eps3rt**2
490 fac=-expon*(e1+evdwij)
493 C Calculate radial part of the gradient
497 C Calculate the angular part of the gradient and sum add the contributions
498 C to the appropriate components of the Cartesian gradient.
499 call sc_grad_scale(1.0d0-sss)
509 C-----------------------------------------------------------------------------
510 subroutine ebp_short(evdw)
512 C This subroutine calculates the interaction energy of nonbonded side chains
513 C assuming the Berne-Pechukas potential of interaction.
515 implicit real*8 (a-h,o-z)
519 include 'COMMON.LOCAL'
520 include 'COMMON.CHAIN'
521 include 'COMMON.DERIV'
522 include 'COMMON.NAMES'
523 include 'COMMON.INTERACT'
524 include 'COMMON.IOUNITS'
525 include 'COMMON.CALC'
527 c double precision rrsave(maxdim)
530 c print *,'Entering EBP nnt=',nnt,' nct=',nct,' expon=',expon
532 c if (icall.eq.0) then
544 dxi=dc_norm(1,nres+i)
545 dyi=dc_norm(2,nres+i)
546 dzi=dc_norm(3,nres+i)
547 c dsci_inv=dsc_inv(itypi)
548 dsci_inv=vbld_inv(i+nres)
550 C Calculate SC interaction energy.
553 do j=istart(i,iint),iend(i,iint)
556 c dscj_inv=dsc_inv(itypj)
557 dscj_inv=vbld_inv(j+nres)
558 chi1=chi(itypi,itypj)
559 chi2=chi(itypj,itypi)
566 alf12=0.5D0*(alf1+alf2)
567 C For diagnostics only!!!
580 dxj=dc_norm(1,nres+j)
581 dyj=dc_norm(2,nres+j)
582 dzj=dc_norm(3,nres+j)
583 rrij=1.0D0/(xj*xj+yj*yj+zj*zj)
584 cd if (icall.eq.0) then
590 sss=sscale(1.0d0/(rij*sigmaii(itypi,itypj)))
592 if (sss.gt.0.0d0) then
594 C Calculate the angle-dependent terms of energy & contributions to derivatives.
596 C Calculate whole angle-dependent part of epsilon and contributions
598 fac=(rrij*sigsq)**expon2
599 e1=fac*fac*aa(itypi,itypj)
600 e2=fac*bb(itypi,itypj)
601 evdwij=eps1*eps2rt*eps3rt*(e1+e2)
602 eps2der=evdwij*eps3rt
603 eps3der=evdwij*eps2rt
604 evdwij=evdwij*eps2rt*eps3rt
607 sigm=dabs(aa(itypi,itypj)/bb(itypi,itypj))**(1.0D0/6.0D0)
608 epsi=bb(itypi,itypj)**2/aa(itypi,itypj)
609 cd write (iout,'(2(a3,i3,2x),15(0pf7.3))')
610 cd & restyp(itypi),i,restyp(itypj),j,
611 cd & epsi,sigm,chi1,chi2,chip1,chip2,
612 cd & eps1,eps2rt**2,eps3rt**2,1.0D0/dsqrt(sigsq),
613 cd & om1,om2,om12,1.0D0/dsqrt(rrij),
616 C Calculate gradient components.
617 e1=e1*eps1*eps2rt**2*eps3rt**2
618 fac=-expon*(e1+evdwij)
621 C Calculate radial part of the gradient
625 C Calculate the angular part of the gradient and sum add the contributions
626 C to the appropriate components of the Cartesian gradient.
627 call sc_grad_scale(sss)
637 C-----------------------------------------------------------------------------
638 subroutine egb_long(evdw)
640 C This subroutine calculates the interaction energy of nonbonded side chains
641 C assuming the Gay-Berne potential of interaction.
643 implicit real*8 (a-h,o-z)
647 include 'COMMON.LOCAL'
648 include 'COMMON.CHAIN'
649 include 'COMMON.DERIV'
650 include 'COMMON.NAMES'
651 include 'COMMON.INTERACT'
652 include 'COMMON.IOUNITS'
653 include 'COMMON.CALC'
654 include 'COMMON.CONTROL'
657 ccccc energy_dec=.false.
658 c print *,'Entering EGB nnt=',nnt,' nct=',nct,' expon=',expon
661 c if (icall.eq.0) lprn=.false.
669 dxi=dc_norm(1,nres+i)
670 dyi=dc_norm(2,nres+i)
671 dzi=dc_norm(3,nres+i)
672 c dsci_inv=dsc_inv(itypi)
673 dsci_inv=vbld_inv(i+nres)
674 c write (iout,*) "i",i,dsc_inv(itypi),dsci_inv,1.0d0/vbld(i+nres)
675 c write (iout,*) "dcnori",dxi*dxi+dyi*dyi+dzi*dzi
677 C Calculate SC interaction energy.
680 do j=istart(i,iint),iend(i,iint)
683 c dscj_inv=dsc_inv(itypj)
684 dscj_inv=vbld_inv(j+nres)
685 c write (iout,*) "j",j,dsc_inv(itypj),dscj_inv,
686 c & 1.0d0/vbld(j+nres)
687 c write (iout,*) "i",i," j", j," itype",itype(i),itype(j)
688 sig0ij=sigma(itypi,itypj)
689 chi1=chi(itypi,itypj)
690 chi2=chi(itypj,itypi)
697 alf12=0.5D0*(alf1+alf2)
698 C For diagnostics only!!!
711 dxj=dc_norm(1,nres+j)
712 dyj=dc_norm(2,nres+j)
713 dzj=dc_norm(3,nres+j)
714 c write (iout,*) "dcnorj",dxi*dxi+dyi*dyi+dzi*dzi
715 c write (iout,*) "j",j," dc_norm",
716 c & dc_norm(1,nres+j),dc_norm(2,nres+j),dc_norm(3,nres+j)
717 rrij=1.0D0/(xj*xj+yj*yj+zj*zj)
719 sss=sscale(1.0d0/(rij*sigmaii(itypi,itypj)))
720 c write(iout,*) "long",i,itypi,j,itypj," rij",1.0d0/rij,
721 c & " sigmaii",sigmaii(itypi,itypj)," sss",sss
723 if (sss.lt.1.0d0) then
725 C Calculate angle-dependent terms of energy and contributions to their
729 sig=sig0ij*dsqrt(sigsq)
730 rij_shift=1.0D0/rij-sig+sig0ij
731 c for diagnostics; uncomment
732 c rij_shift=1.2*sig0ij
733 C I hate to put IF's in the loops, but here don't have another choice!!!!
734 if (rij_shift.le.0.0D0) then
736 cd write (iout,'(2(a3,i3,2x),17(0pf7.3))')
737 cd & restyp(itypi),i,restyp(itypj),j,
738 cd & rij_shift,1.0D0/rij,sig,sig0ij,sigsq,1-dsqrt(sigsq)
742 c---------------------------------------------------------------
743 rij_shift=1.0D0/rij_shift
745 e1=fac*fac*aa(itypi,itypj)
746 e2=fac*bb(itypi,itypj)
747 evdwij=eps1*eps2rt*eps3rt*(e1+e2)
748 eps2der=evdwij*eps3rt
749 eps3der=evdwij*eps2rt
750 c write (iout,*) "sigsq",sigsq," sig",sig," eps2rt",eps2rt,
751 c & " eps3rt",eps3rt," eps1",eps1," e1",e1," e2",e2
752 evdwij=evdwij*eps2rt*eps3rt
753 evdw=evdw+evdwij*(1.0d0-sss)
754 c write (iout,*) "evdwij",evdwij," evdw",evdw
756 sigm=dabs(aa(itypi,itypj)/bb(itypi,itypj))**(1.0D0/6.0D0)
757 epsi=bb(itypi,itypj)**2/aa(itypi,itypj)
758 write (iout,'(2(a3,i3,2x),17(0pf7.3))')
759 & restyp(itypi),i,restyp(itypj),j,
760 & epsi,sigm,chi1,chi2,chip1,chip2,
761 & eps1,eps2rt**2,eps3rt**2,sig,sig0ij,
762 & om1,om2,om12,1.0D0/rij,1.0D0/rij_shift,
766 if (energy_dec) write (iout,'(a6,2i5,0pf7.3)')
769 C Calculate gradient components.
770 e1=e1*eps1*eps2rt**2*eps3rt**2
771 fac=-expon*(e1+evdwij)*rij_shift
775 C Calculate the radial part of the gradient
779 C Calculate angular part of the gradient.
780 call sc_grad_scale(1.0d0-sss)
787 cccc energy_dec=.false.
790 C-----------------------------------------------------------------------------
791 subroutine egb_short(evdw)
793 C This subroutine calculates the interaction energy of nonbonded side chains
794 C assuming the Gay-Berne potential of interaction.
796 implicit real*8 (a-h,o-z)
800 include 'COMMON.LOCAL'
801 include 'COMMON.CHAIN'
802 include 'COMMON.DERIV'
803 include 'COMMON.NAMES'
804 include 'COMMON.INTERACT'
805 include 'COMMON.IOUNITS'
806 include 'COMMON.CALC'
807 include 'COMMON.CONTROL'
810 ccccc energy_dec=.false.
811 c print *,'Entering EGB nnt=',nnt,' nct=',nct,' expon=',expon
814 c if (icall.eq.0) lprn=.false.
822 dxi=dc_norm(1,nres+i)
823 dyi=dc_norm(2,nres+i)
824 dzi=dc_norm(3,nres+i)
825 c dsci_inv=dsc_inv(itypi)
826 dsci_inv=vbld_inv(i+nres)
827 c write (iout,*) "i",i,dsc_inv(itypi),dsci_inv,1.0d0/vbld(i+nres)
828 c write (iout,*) "dcnori",dxi*dxi+dyi*dyi+dzi*dzi
830 C Calculate SC interaction energy.
833 do j=istart(i,iint),iend(i,iint)
836 c dscj_inv=dsc_inv(itypj)
837 dscj_inv=vbld_inv(j+nres)
838 c write (iout,*) "j",j,dsc_inv(itypj),dscj_inv,
839 c & 1.0d0/vbld(j+nres)
840 c write (iout,*) "i",i," j", j," itype",itype(i),itype(j)
841 sig0ij=sigma(itypi,itypj)
842 chi1=chi(itypi,itypj)
843 chi2=chi(itypj,itypi)
850 alf12=0.5D0*(alf1+alf2)
851 C For diagnostics only!!!
864 dxj=dc_norm(1,nres+j)
865 dyj=dc_norm(2,nres+j)
866 dzj=dc_norm(3,nres+j)
867 c write (iout,*) "dcnorj",dxi*dxi+dyi*dyi+dzi*dzi
868 c write (iout,*) "j",j," dc_norm",
869 c & dc_norm(1,nres+j),dc_norm(2,nres+j),dc_norm(3,nres+j)
870 rrij=1.0D0/(xj*xj+yj*yj+zj*zj)
872 sss=sscale(1.0d0/(rij*sigmaii(itypi,itypj)))
873 c write(iout,*) "short",i,itypi,j,itypj," rij",1.0d0/rij,
874 c & " sigmaii",sigmaii(itypi,itypj)," sss",sss
875 if (sss.gt.0.0d0) then
877 C Calculate angle-dependent terms of energy and contributions to their
881 sig=sig0ij*dsqrt(sigsq)
882 rij_shift=1.0D0/rij-sig+sig0ij
883 c for diagnostics; uncomment
884 c rij_shift=1.2*sig0ij
885 C I hate to put IF's in the loops, but here don't have another choice!!!!
886 if (rij_shift.le.0.0D0) then
888 cd write (iout,'(2(a3,i3,2x),17(0pf7.3))')
889 cd & restyp(itypi),i,restyp(itypj),j,
890 cd & rij_shift,1.0D0/rij,sig,sig0ij,sigsq,1-dsqrt(sigsq)
894 c---------------------------------------------------------------
895 rij_shift=1.0D0/rij_shift
897 e1=fac*fac*aa(itypi,itypj)
898 e2=fac*bb(itypi,itypj)
899 evdwij=eps1*eps2rt*eps3rt*(e1+e2)
900 eps2der=evdwij*eps3rt
901 eps3der=evdwij*eps2rt
902 c write (iout,*) "sigsq",sigsq," sig",sig," eps2rt",eps2rt,
903 c & " eps3rt",eps3rt," eps1",eps1," e1",e1," e2",e2
904 evdwij=evdwij*eps2rt*eps3rt
906 c write (iout,*) "evdwij",evdwij," evdw",evdw
908 sigm=dabs(aa(itypi,itypj)/bb(itypi,itypj))**(1.0D0/6.0D0)
909 epsi=bb(itypi,itypj)**2/aa(itypi,itypj)
910 write (iout,'(2(a3,i3,2x),17(0pf7.3))')
911 & restyp(itypi),i,restyp(itypj),j,
912 & epsi,sigm,chi1,chi2,chip1,chip2,
913 & eps1,eps2rt**2,eps3rt**2,sig,sig0ij,
914 & om1,om2,om12,1.0D0/rij,1.0D0/rij_shift,
918 if (energy_dec) write (iout,'(a6,2i5,0pf7.3)')
921 C Calculate gradient components.
922 e1=e1*eps1*eps2rt**2*eps3rt**2
923 fac=-expon*(e1+evdwij)*rij_shift
927 C Calculate the radial part of the gradient
931 C Calculate angular part of the gradient.
932 call sc_grad_scale(sss)
939 cccc energy_dec=.false.
942 C-----------------------------------------------------------------------------
943 subroutine egbv_long(evdw)
945 C This subroutine calculates the interaction energy of nonbonded side chains
946 C assuming the Gay-Berne-Vorobjev potential of interaction.
948 implicit real*8 (a-h,o-z)
952 include 'COMMON.LOCAL'
953 include 'COMMON.CHAIN'
954 include 'COMMON.DERIV'
955 include 'COMMON.NAMES'
956 include 'COMMON.INTERACT'
957 include 'COMMON.IOUNITS'
958 include 'COMMON.CALC'
962 c print *,'Entering EGB nnt=',nnt,' nct=',nct,' expon=',expon
965 c if (icall.eq.0) lprn=.true.
973 dxi=dc_norm(1,nres+i)
974 dyi=dc_norm(2,nres+i)
975 dzi=dc_norm(3,nres+i)
976 c dsci_inv=dsc_inv(itypi)
977 dsci_inv=vbld_inv(i+nres)
979 C Calculate SC interaction energy.
982 do j=istart(i,iint),iend(i,iint)
985 c dscj_inv=dsc_inv(itypj)
986 dscj_inv=vbld_inv(j+nres)
987 sig0ij=sigma(itypi,itypj)
989 chi1=chi(itypi,itypj)
990 chi2=chi(itypj,itypi)
997 alf12=0.5D0*(alf1+alf2)
998 C For diagnostics only!!!
1011 dxj=dc_norm(1,nres+j)
1012 dyj=dc_norm(2,nres+j)
1013 dzj=dc_norm(3,nres+j)
1014 rrij=1.0D0/(xj*xj+yj*yj+zj*zj)
1017 sss=sscale(1.0d0/(rij*sigmaii(itypi,itypj)))
1019 if (sss.lt.1.0d0) then
1021 C Calculate angle-dependent terms of energy and contributions to their
1025 sig=sig0ij*dsqrt(sigsq)
1026 rij_shift=1.0D0/rij-sig+r0ij
1027 C I hate to put IF's in the loops, but here don't have another choice!!!!
1028 if (rij_shift.le.0.0D0) then
1033 c---------------------------------------------------------------
1034 rij_shift=1.0D0/rij_shift
1035 fac=rij_shift**expon
1036 e1=fac*fac*aa(itypi,itypj)
1037 e2=fac*bb(itypi,itypj)
1038 evdwij=eps1*eps2rt*eps3rt*(e1+e2)
1039 eps2der=evdwij*eps3rt
1040 eps3der=evdwij*eps2rt
1041 fac_augm=rrij**expon
1042 e_augm=augm(itypi,itypj)*fac_augm
1043 evdwij=evdwij*eps2rt*eps3rt
1044 evdw=evdw+(evdwij+e_augm)*(1.0d0-sss)
1046 sigm=dabs(aa(itypi,itypj)/bb(itypi,itypj))**(1.0D0/6.0D0)
1047 epsi=bb(itypi,itypj)**2/aa(itypi,itypj)
1048 write (iout,'(2(a3,i3,2x),17(0pf7.3))')
1049 & restyp(itypi),i,restyp(itypj),j,
1050 & epsi,sigm,sig,(augm(itypi,itypj)/epsi)**(1.0D0/12.0D0),
1051 & chi1,chi2,chip1,chip2,
1052 & eps1,eps2rt**2,eps3rt**2,
1053 & om1,om2,om12,1.0D0/rij,1.0D0/rij_shift,
1056 C Calculate gradient components.
1057 e1=e1*eps1*eps2rt**2*eps3rt**2
1058 fac=-expon*(e1+evdwij)*rij_shift
1060 fac=rij*fac-2*expon*rrij*e_augm
1061 C Calculate the radial part of the gradient
1065 C Calculate angular part of the gradient.
1066 call sc_grad_scale(1.0d0-sss)
1074 C-----------------------------------------------------------------------------
1075 subroutine egbv_short(evdw)
1077 C This subroutine calculates the interaction energy of nonbonded side chains
1078 C assuming the Gay-Berne-Vorobjev potential of interaction.
1080 implicit real*8 (a-h,o-z)
1081 include 'DIMENSIONS'
1082 include 'COMMON.GEO'
1083 include 'COMMON.VAR'
1084 include 'COMMON.LOCAL'
1085 include 'COMMON.CHAIN'
1086 include 'COMMON.DERIV'
1087 include 'COMMON.NAMES'
1088 include 'COMMON.INTERACT'
1089 include 'COMMON.IOUNITS'
1090 include 'COMMON.CALC'
1091 common /srutu/ icall
1094 c print *,'Entering EGB nnt=',nnt,' nct=',nct,' expon=',expon
1097 c if (icall.eq.0) lprn=.true.
1099 do i=iatsc_s,iatsc_e
1105 dxi=dc_norm(1,nres+i)
1106 dyi=dc_norm(2,nres+i)
1107 dzi=dc_norm(3,nres+i)
1108 c dsci_inv=dsc_inv(itypi)
1109 dsci_inv=vbld_inv(i+nres)
1111 C Calculate SC interaction energy.
1113 do iint=1,nint_gr(i)
1114 do j=istart(i,iint),iend(i,iint)
1117 c dscj_inv=dsc_inv(itypj)
1118 dscj_inv=vbld_inv(j+nres)
1119 sig0ij=sigma(itypi,itypj)
1120 r0ij=r0(itypi,itypj)
1121 chi1=chi(itypi,itypj)
1122 chi2=chi(itypj,itypi)
1129 alf12=0.5D0*(alf1+alf2)
1130 C For diagnostics only!!!
1143 dxj=dc_norm(1,nres+j)
1144 dyj=dc_norm(2,nres+j)
1145 dzj=dc_norm(3,nres+j)
1146 rrij=1.0D0/(xj*xj+yj*yj+zj*zj)
1149 sss=sscale(1.0d0/(rij*sigmaii(itypi,itypj)))
1151 if (sss.gt.0.0d0) then
1153 C Calculate angle-dependent terms of energy and contributions to their
1157 sig=sig0ij*dsqrt(sigsq)
1158 rij_shift=1.0D0/rij-sig+r0ij
1159 C I hate to put IF's in the loops, but here don't have another choice!!!!
1160 if (rij_shift.le.0.0D0) then
1165 c---------------------------------------------------------------
1166 rij_shift=1.0D0/rij_shift
1167 fac=rij_shift**expon
1168 e1=fac*fac*aa(itypi,itypj)
1169 e2=fac*bb(itypi,itypj)
1170 evdwij=eps1*eps2rt*eps3rt*(e1+e2)
1171 eps2der=evdwij*eps3rt
1172 eps3der=evdwij*eps2rt
1173 fac_augm=rrij**expon
1174 e_augm=augm(itypi,itypj)*fac_augm
1175 evdwij=evdwij*eps2rt*eps3rt
1176 evdw=evdw+(evdwij+e_augm)*sss
1178 sigm=dabs(aa(itypi,itypj)/bb(itypi,itypj))**(1.0D0/6.0D0)
1179 epsi=bb(itypi,itypj)**2/aa(itypi,itypj)
1180 write (iout,'(2(a3,i3,2x),17(0pf7.3))')
1181 & restyp(itypi),i,restyp(itypj),j,
1182 & epsi,sigm,sig,(augm(itypi,itypj)/epsi)**(1.0D0/12.0D0),
1183 & chi1,chi2,chip1,chip2,
1184 & eps1,eps2rt**2,eps3rt**2,
1185 & om1,om2,om12,1.0D0/rij,1.0D0/rij_shift,
1188 C Calculate gradient components.
1189 e1=e1*eps1*eps2rt**2*eps3rt**2
1190 fac=-expon*(e1+evdwij)*rij_shift
1192 fac=rij*fac-2*expon*rrij*e_augm
1193 C Calculate the radial part of the gradient
1197 C Calculate angular part of the gradient.
1198 call sc_grad_scale(sss)
1206 C----------------------------------------------------------------------------
1207 subroutine sc_grad_scale(scalfac)
1208 implicit real*8 (a-h,o-z)
1209 include 'DIMENSIONS'
1210 include 'COMMON.CHAIN'
1211 include 'COMMON.DERIV'
1212 include 'COMMON.CALC'
1213 include 'COMMON.IOUNITS'
1214 double precision dcosom1(3),dcosom2(3)
1215 double precision scalfac
1216 eom1=eps2der*eps2rt_om1-2.0D0*alf1*eps3der+sigder*sigsq_om1
1217 eom2=eps2der*eps2rt_om2+2.0D0*alf2*eps3der+sigder*sigsq_om2
1218 eom12=evdwij*eps1_om12+eps2der*eps2rt_om12
1219 & -2.0D0*alf12*eps3der+sigder*sigsq_om12
1223 c eom12=evdwij*eps1_om12
1225 c write (iout,*) "eps2der",eps2der," eps3der",eps3der,
1226 c & " sigder",sigder
1227 c write (iout,*) "eps1_om12",eps1_om12," eps2rt_om12",eps2rt_om12
1228 c write (iout,*) "eom1",eom1," eom2",eom2," eom12",eom12
1230 dcosom1(k)=rij*(dc_norm(k,nres+i)-om1*erij(k))
1231 dcosom2(k)=rij*(dc_norm(k,nres+j)-om2*erij(k))
1234 gg(k)=(gg(k)+eom1*dcosom1(k)+eom2*dcosom2(k))*scalfac
1236 c write (iout,*) "gg",(gg(k),k=1,3)
1238 gvdwx(k,i)=gvdwx(k,i)-gg(k)
1239 & +((eom12*(dc_norm(k,nres+j)-om12*dc_norm(k,nres+i))
1240 & +eom1*(erij(k)-om1*dc_norm(k,nres+i)))*dsci_inv)*scalfac
1241 gvdwx(k,j)=gvdwx(k,j)+gg(k)
1242 & +((eom12*(dc_norm(k,nres+i)-om12*dc_norm(k,nres+j))
1243 & +eom2*(erij(k)-om2*dc_norm(k,nres+j)))*dscj_inv)*scalfac
1244 c write (iout,*)(eom12*(dc_norm(k,nres+j)-om12*dc_norm(k,nres+i))
1245 c & +eom1*(erij(k)-om1*dc_norm(k,nres+i)))*dsci_inv
1246 c write (iout,*)(eom12*(dc_norm(k,nres+i)-om12*dc_norm(k,nres+j))
1247 c & +eom2*(erij(k)-om2*dc_norm(k,nres+j)))*dscj_inv
1250 C Calculate the components of the gradient in DC and X
1254 gvdwc(l,k)=gvdwc(l,k)+gg(l)
1259 C--------------------------------------------------------------------------
1260 subroutine eelec_scale(ees,evdw1,eel_loc,eello_turn3,eello_turn4)
1262 C This subroutine calculates the average interaction energy and its gradient
1263 C in the virtual-bond vectors between non-adjacent peptide groups, based on
1264 C the potential described in Liwo et al., Protein Sci., 1993, 2, 1715.
1265 C The potential depends both on the distance of peptide-group centers and on
1266 C the orientation of the CA-CA virtual bonds.
1268 implicit real*8 (a-h,o-z)
1269 include 'DIMENSIONS'
1270 include 'COMMON.CONTROL'
1271 include 'COMMON.IOUNITS'
1272 include 'COMMON.GEO'
1273 include 'COMMON.VAR'
1274 include 'COMMON.LOCAL'
1275 include 'COMMON.CHAIN'
1276 include 'COMMON.DERIV'
1277 include 'COMMON.INTERACT'
1278 include 'COMMON.CONTACTS'
1279 include 'COMMON.TORSION'
1280 include 'COMMON.VECTORS'
1281 include 'COMMON.FFIELD'
1282 dimension ggg(3),gggp(3),gggm(3),erij(3),dcosb(3),dcosg(3),
1283 & erder(3,3),uryg(3,3),urzg(3,3),vryg(3,3),vrzg(3,3)
1284 double precision acipa(2,2),agg(3,4),aggi(3,4),aggi1(3,4),
1285 & aggj(3,4),aggj1(3,4),a_temp(2,2),muij(4)
1286 common /locel/ a_temp,agg,aggi,aggi1,aggj,aggj1,j1,j2
1287 c 4/26/02 - AL scaling factor for 1,4 repulsive VDW interactions
1289 double precision scal_el /1.0d0/
1291 double precision scal_el /0.5d0/
1294 C 13-go grudnia roku pamietnego...
1295 double precision unmat(3,3) /1.0d0,0.0d0,0.0d0,
1296 & 0.0d0,1.0d0,0.0d0,
1297 & 0.0d0,0.0d0,1.0d0/
1298 cd write(iout,*) 'In EELEC'
1300 cd write(iout,*) 'Type',i
1301 cd write(iout,*) 'B1',B1(:,i)
1302 cd write(iout,*) 'B2',B2(:,i)
1303 cd write(iout,*) 'CC',CC(:,:,i)
1304 cd write(iout,*) 'DD',DD(:,:,i)
1305 cd write(iout,*) 'EE',EE(:,:,i)
1307 cd call check_vecgrad
1309 if (icheckgrad.eq.1) then
1311 fac=1.0d0/dsqrt(scalar(dc(1,i),dc(1,i)))
1313 dc_norm(k,i)=dc(k,i)*fac
1315 c write (iout,*) 'i',i,' fac',fac
1318 if (wel_loc.gt.0.0d0 .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.0d0
1319 & .or. wcorr6.gt.0.0d0 .or. wturn3.gt.0.0d0 .or.
1320 & wturn4.gt.0.0d0 .or. wturn6.gt.0.0d0) then
1321 c call vec_and_deriv
1325 cd write (iout,*) 'i=',i
1327 cd write (iout,'(i5,2f10.5)') k,uy(k,i),uz(k,i)
1330 cd write (iout,'(f10.5,2x,3f10.5,2x,3f10.5)')
1331 cd & uz(k,i),(uzgrad(k,l,1,i),l=1,3),(uzgrad(k,l,2,i),l=1,3)
1344 cd print '(a)','Enter EELEC'
1345 cd write (iout,*) 'iatel_s=',iatel_s,' iatel_e=',iatel_e
1347 gel_loc_loc(i)=0.0d0
1351 cd write (iout,'(i3,3f10.5,5x,3f10.5)')
1352 cd & i,(gel_loc(k,i),k=1,3),gel_loc_loc(i)
1355 c 9/27/08 AL Split the interaction loop to ensure load balancing of turn terms
1357 C Loop over i,i+2 and i,i+3 pairs of the peptide groups
1359 do i=iturn3_start,iturn3_end
1363 dx_normi=dc_norm(1,i)
1364 dy_normi=dc_norm(2,i)
1365 dz_normi=dc_norm(3,i)
1366 xmedi=c(1,i)+0.5d0*dxi
1367 ymedi=c(2,i)+0.5d0*dyi
1368 zmedi=c(3,i)+0.5d0*dzi
1370 call eelecij_scale(i,i+2,ees,evdw1,eel_loc)
1371 if (wturn3.gt.0.0d0) call eturn3(i,eello_turn3)
1372 num_cont_hb(i)=num_conti
1374 do i=iturn4_start,iturn4_end
1378 dx_normi=dc_norm(1,i)
1379 dy_normi=dc_norm(2,i)
1380 dz_normi=dc_norm(3,i)
1381 xmedi=c(1,i)+0.5d0*dxi
1382 ymedi=c(2,i)+0.5d0*dyi
1383 zmedi=c(3,i)+0.5d0*dzi
1385 call eelecij_scale(i,i+3,ees,evdw1,eel_loc)
1386 if (wturn4.gt.0.0d0) call eturn4(i,eello_turn4)
1387 num_cont_hb(i)=num_cont_hb(i)+num_conti
1390 c Loop over all pairs of interacting peptide groups except i,i+2 and i,i+3
1392 do i=iatel_s,iatel_e
1396 dx_normi=dc_norm(1,i)
1397 dy_normi=dc_norm(2,i)
1398 dz_normi=dc_norm(3,i)
1399 xmedi=c(1,i)+0.5d0*dxi
1400 ymedi=c(2,i)+0.5d0*dyi
1401 zmedi=c(3,i)+0.5d0*dzi
1403 c write (iout,*) 'i',i,' ielstart',ielstart(i),' ielend',ielend(i)
1404 do j=ielstart(i),ielend(i)
1405 call eelecij_scale(i,j,ees,evdw1,eel_loc)
1407 num_cont_hb(i)=num_cont_hb(i)+num_conti
1411 C-------------------------------------------------------------------------------
1412 subroutine eelecij_scale(i,j,ees,evdw1,eel_loc)
1414 C This subroutine calculates the average interaction energy and its gradient
1415 C in the virtual-bond vectors between non-adjacent peptide groups, based on
1416 C the potential described in Liwo et al., Protein Sci., 1993, 2, 1715.
1417 C The potential depends both on the distance of peptide-group centers and on
1418 C the orientation of the CA-CA virtual bonds.
1420 implicit real*8 (a-h,o-z)
1421 include 'DIMENSIONS'
1422 include 'COMMON.CONTROL'
1423 include 'COMMON.IOUNITS'
1424 include 'COMMON.GEO'
1425 include 'COMMON.VAR'
1426 include 'COMMON.LOCAL'
1427 include 'COMMON.CHAIN'
1428 include 'COMMON.DERIV'
1429 include 'COMMON.INTERACT'
1430 include 'COMMON.CONTACTS'
1431 include 'COMMON.TORSION'
1432 include 'COMMON.VECTORS'
1433 include 'COMMON.FFIELD'
1434 dimension ggg(3),gggp(3),gggm(3),erij(3),dcosb(3),dcosg(3),
1435 & erder(3,3),uryg(3,3),urzg(3,3),vryg(3,3),vrzg(3,3)
1436 double precision acipa(2,2),agg(3,4),aggi(3,4),aggi1(3,4),
1437 & aggj(3,4),aggj1(3,4),a_temp(2,2),muij(4)
1438 common /locel/ a_temp,agg,aggi,aggi1,aggj,aggj1,a22,a23,a32,a33,
1439 & dxi,dyi,dzi,dx_normi,dy_normi,dz_normi,xmedi,ymedi,zmedi,
1441 c 4/26/02 - AL scaling factor for 1,4 repulsive VDW interactions
1443 double precision scal_el /1.0d0/
1445 double precision scal_el /0.5d0/
1448 C 13-go grudnia roku pamietnego...
1449 double precision unmat(3,3) /1.0d0,0.0d0,0.0d0,
1450 & 0.0d0,1.0d0,0.0d0,
1451 & 0.0d0,0.0d0,1.0d0/
1455 if (j.eq.i+2 .and. itelj.eq.2) iteli=2
1456 aaa=app(iteli,itelj)
1457 bbb=bpp(iteli,itelj)
1458 ael6i=ael6(iteli,itelj)
1459 ael3i=ael3(iteli,itelj)
1460 C Diagnostics only!!!
1469 dx_normj=dc_norm(1,j)
1470 dy_normj=dc_norm(2,j)
1471 dz_normj=dc_norm(3,j)
1472 xj=c(1,j)+0.5D0*dxj-xmedi
1473 yj=c(2,j)+0.5D0*dyj-ymedi
1474 zj=c(3,j)+0.5D0*dzj-zmedi
1475 rij=xj*xj+yj*yj+zj*zj
1479 c For extracting the short-range part of Evdwpp
1480 sss=sscale(rij/rpp(iteli,itelj))
1484 cosa=dx_normi*dx_normj+dy_normi*dy_normj+dz_normi*dz_normj
1485 cosb=(xj*dx_normi+yj*dy_normi+zj*dz_normi)*rmij
1486 cosg=(xj*dx_normj+yj*dy_normj+zj*dz_normj)*rmij
1487 fac=cosa-3.0D0*cosb*cosg
1489 c 4/26/02 - AL scaling down 1,4 repulsive VDW interactions
1490 if (j.eq.i+2) ev1=scal_el*ev1
1495 el1=fac3*(4.0D0+fac*fac-3.0D0*(cosb*cosb+cosg*cosg))
1498 C 12/26/95 - for the evaluation of multi-body H-bonding interactions
1499 ees0ij=4.0D0+fac*fac-3.0D0*(cosb*cosb+cosg*cosg)
1501 evdw1=evdw1+evdwij*(1.0d0-sss)
1502 cd write(iout,'(2(2i3,2x),7(1pd12.4)/2(3(1pd12.4),5x)/)')
1503 cd & iteli,i,itelj,j,aaa,bbb,ael6i,ael3i,
1504 cd & 1.0D0/dsqrt(rrmij),evdwij,eesij,
1505 cd & xmedi,ymedi,zmedi,xj,yj,zj
1507 if (energy_dec) then
1508 write (iout,'(a6,2i5,0pf7.3)') 'evdw1',i,j,evdwij
1509 write (iout,'(a6,2i5,0pf7.3)') 'ees',i,j,eesij
1513 C Calculate contributions to the Cartesian gradient.
1516 facvdw=-6*rrmij*(ev1+evdwij)*(1.0d0-sss)
1517 facel=-3*rrmij*(el1+eesij)
1523 * Radial derivatives. First process both termini of the fragment (i,j)
1530 gelc(k,i)=gelc(k,i)+ghalf
1531 gelc(k,j)=gelc(k,j)+ghalf
1534 * Loop over residues i+1 thru j-1.
1538 gelc(l,k)=gelc(l,k)+ggg(l)
1546 gvdwpp(k,i)=gvdwpp(k,i)+ghalf
1547 gvdwpp(k,j)=gvdwpp(k,j)+ghalf
1550 * Loop over residues i+1 thru j-1.
1554 gvdwpp(l,k)=gvdwpp(l,k)+ggg(l)
1558 facvdw=(ev1+evdwij)*(1.0d0-sss)
1561 fac=-3*rrmij*(facvdw+facvdw+facel)
1566 * Radial derivatives. First process both termini of the fragment (i,j)
1573 gelc(k,i)=gelc(k,i)+ghalf
1574 gelc(k,j)=gelc(k,j)+ghalf
1577 * Loop over residues i+1 thru j-1.
1581 gelc(l,k)=gelc(l,k)+ggg(l)
1588 ecosa=2.0D0*fac3*fac1+fac4
1591 ecosb=(fac3*(fac1*cosg+cosb)+cosg*fac4)
1592 ecosg=(fac3*(fac1*cosb+cosg)+cosb*fac4)
1594 dcosb(k)=rmij*(dc_norm(k,i)-erij(k)*cosb)
1595 dcosg(k)=rmij*(dc_norm(k,j)-erij(k)*cosg)
1597 cd print '(2i3,2(3(1pd14.5),3x))',i,j,(dcosb(k),k=1,3),
1598 cd & (dcosg(k),k=1,3)
1600 ggg(k)=ecosb*dcosb(k)+ecosg*dcosg(k)
1604 gelc(k,i)=gelc(k,i)+ghalf
1605 & +(ecosa*(dc_norm(k,j)-cosa*dc_norm(k,i))
1606 & + ecosb*(erij(k)-cosb*dc_norm(k,i)))*vbld_inv(i+1)
1607 gelc(k,j)=gelc(k,j)+ghalf
1608 & +(ecosa*(dc_norm(k,i)-cosa*dc_norm(k,j))
1609 & + ecosg*(erij(k)-cosg*dc_norm(k,j)))*vbld_inv(j+1)
1613 gelc(l,k)=gelc(l,k)+ggg(l)
1617 IF (wel_loc.gt.0.0d0 .or. wcorr4.gt.0.0d0 .or. wcorr5.gt.0.0d0
1618 & .or. wcorr6.gt.0.0d0 .or. wturn3.gt.0.0d0
1619 & .or. wturn4.gt.0.0d0 .or. wturn6.gt.0.0d0) THEN
1621 C 9/25/99 Mixed third-order local-electrostatic terms. The local-interaction
1622 C energy of a peptide unit is assumed in the form of a second-order
1623 C Fourier series in the angles lambda1 and lambda2 (see Nishikawa et al.
1624 C Macromolecules, 1974, 7, 797-806 for definition). This correlation terms
1625 C are computed for EVERY pair of non-contiguous peptide groups.
1627 if (j.lt.nres-1) then
1638 muij(kkk)=mu(k,i)*mu(l,j)
1641 cd write (iout,*) 'EELEC: i',i,' j',j
1642 cd write (iout,*) 'j',j,' j1',j1,' j2',j2
1643 cd write(iout,*) 'muij',muij
1644 ury=scalar(uy(1,i),erij)
1645 urz=scalar(uz(1,i),erij)
1646 vry=scalar(uy(1,j),erij)
1647 vrz=scalar(uz(1,j),erij)
1648 a22=scalar(uy(1,i),uy(1,j))-3*ury*vry
1649 a23=scalar(uy(1,i),uz(1,j))-3*ury*vrz
1650 a32=scalar(uz(1,i),uy(1,j))-3*urz*vry
1651 a33=scalar(uz(1,i),uz(1,j))-3*urz*vrz
1652 C For diagnostics only
1657 fac=dsqrt(-ael6i)*r3ij
1658 cd write (2,*) 'fac=',fac
1659 C For diagnostics only
1665 cd write (iout,'(4i5,4f10.5)')
1666 cd & i,itortyp(itype(i)),j,itortyp(itype(j)),a22,a23,a32,a33
1667 cd write (iout,'(6f10.5)') (muij(k),k=1,4),fac,eel_loc_ij
1668 cd write (iout,'(2(3f10.5,5x)/2(3f10.5,5x))') uy(:,i),uz(:,i),
1669 cd & uy(:,j),uz(:,j)
1670 cd write (iout,'(4f10.5)')
1671 cd & scalar(uy(1,i),uy(1,j)),scalar(uy(1,i),uz(1,j)),
1672 cd & scalar(uz(1,i),uy(1,j)),scalar(uz(1,i),uz(1,j))
1673 cd write (iout,'(4f10.5)') ury,urz,vry,vrz
1674 cd write (iout,'(9f10.5/)')
1675 cd & fac22,a22,fac23,a23,fac32,a32,fac33,a33,eel_loc_ij
1676 C Derivatives of the elements of A in virtual-bond vectors
1677 call unormderiv(erij(1),unmat(1,1),rmij,erder(1,1))
1684 uryg(k,1)=scalar(erder(1,k),uy(1,i))
1685 uryg(k,2)=scalar(uygrad(1,k,1,i),erij(1))
1686 uryg(k,3)=scalar(uygrad(1,k,2,i),erij(1))
1687 urzg(k,1)=scalar(erder(1,k),uz(1,i))
1688 urzg(k,2)=scalar(uzgrad(1,k,1,i),erij(1))
1689 urzg(k,3)=scalar(uzgrad(1,k,2,i),erij(1))
1690 vryg(k,1)=scalar(erder(1,k),uy(1,j))
1691 vryg(k,2)=scalar(uygrad(1,k,1,j),erij(1))
1692 vryg(k,3)=scalar(uygrad(1,k,2,j),erij(1))
1693 vrzg(k,1)=scalar(erder(1,k),uz(1,j))
1694 vrzg(k,2)=scalar(uzgrad(1,k,1,j),erij(1))
1695 vrzg(k,3)=scalar(uzgrad(1,k,2,j),erij(1))
1705 C Compute radial contributions to the gradient
1727 C Add the contributions coming from er
1730 agg(k,1)=agg(k,1)+fac3*(uryg(k,1)*vry+vryg(k,1)*ury)
1731 agg(k,2)=agg(k,2)+fac3*(uryg(k,1)*vrz+vrzg(k,1)*ury)
1732 agg(k,3)=agg(k,3)+fac3*(urzg(k,1)*vry+vryg(k,1)*urz)
1733 agg(k,4)=agg(k,4)+fac3*(urzg(k,1)*vrz+vrzg(k,1)*urz)
1736 C Derivatives in DC(i)
1737 ghalf1=0.5d0*agg(k,1)
1738 ghalf2=0.5d0*agg(k,2)
1739 ghalf3=0.5d0*agg(k,3)
1740 ghalf4=0.5d0*agg(k,4)
1741 aggi(k,1)=fac*(scalar(uygrad(1,k,1,i),uy(1,j))
1742 & -3.0d0*uryg(k,2)*vry)+ghalf1
1743 aggi(k,2)=fac*(scalar(uygrad(1,k,1,i),uz(1,j))
1744 & -3.0d0*uryg(k,2)*vrz)+ghalf2
1745 aggi(k,3)=fac*(scalar(uzgrad(1,k,1,i),uy(1,j))
1746 & -3.0d0*urzg(k,2)*vry)+ghalf3
1747 aggi(k,4)=fac*(scalar(uzgrad(1,k,1,i),uz(1,j))
1748 & -3.0d0*urzg(k,2)*vrz)+ghalf4
1749 C Derivatives in DC(i+1)
1750 aggi1(k,1)=fac*(scalar(uygrad(1,k,2,i),uy(1,j))
1751 & -3.0d0*uryg(k,3)*vry)+agg(k,1)
1752 aggi1(k,2)=fac*(scalar(uygrad(1,k,2,i),uz(1,j))
1753 & -3.0d0*uryg(k,3)*vrz)+agg(k,2)
1754 aggi1(k,3)=fac*(scalar(uzgrad(1,k,2,i),uy(1,j))
1755 & -3.0d0*urzg(k,3)*vry)+agg(k,3)
1756 aggi1(k,4)=fac*(scalar(uzgrad(1,k,2,i),uz(1,j))
1757 & -3.0d0*urzg(k,3)*vrz)+agg(k,4)
1758 C Derivatives in DC(j)
1759 aggj(k,1)=fac*(scalar(uygrad(1,k,1,j),uy(1,i))
1760 & -3.0d0*vryg(k,2)*ury)+ghalf1
1761 aggj(k,2)=fac*(scalar(uzgrad(1,k,1,j),uy(1,i))
1762 & -3.0d0*vrzg(k,2)*ury)+ghalf2
1763 aggj(k,3)=fac*(scalar(uygrad(1,k,1,j),uz(1,i))
1764 & -3.0d0*vryg(k,2)*urz)+ghalf3
1765 aggj(k,4)=fac*(scalar(uzgrad(1,k,1,j),uz(1,i))
1766 & -3.0d0*vrzg(k,2)*urz)+ghalf4
1767 C Derivatives in DC(j+1) or DC(nres-1)
1768 aggj1(k,1)=fac*(scalar(uygrad(1,k,2,j),uy(1,i))
1769 & -3.0d0*vryg(k,3)*ury)
1770 aggj1(k,2)=fac*(scalar(uzgrad(1,k,2,j),uy(1,i))
1771 & -3.0d0*vrzg(k,3)*ury)
1772 aggj1(k,3)=fac*(scalar(uygrad(1,k,2,j),uz(1,i))
1773 & -3.0d0*vryg(k,3)*urz)
1774 aggj1(k,4)=fac*(scalar(uzgrad(1,k,2,j),uz(1,i))
1775 & -3.0d0*vrzg(k,3)*urz)
1780 C Derivatives in DC(i+1)
1781 cd aggi1(k,1)=agg(k,1)
1782 cd aggi1(k,2)=agg(k,2)
1783 cd aggi1(k,3)=agg(k,3)
1784 cd aggi1(k,4)=agg(k,4)
1785 C Derivatives in DC(j)
1790 C Derivatives in DC(j+1)
1795 if (j.eq.nres-1 .and. i.lt.j-2) then
1797 aggj1(k,l)=aggj1(k,l)+agg(k,l)
1798 cd aggj1(k,l)=agg(k,l)
1803 C Check the loc-el terms by numerical integration
1813 aggi(k,l)=-aggi(k,l)
1814 aggi1(k,l)=-aggi1(k,l)
1815 aggj(k,l)=-aggj(k,l)
1816 aggj1(k,l)=-aggj1(k,l)
1819 if (j.lt.nres-1) then
1825 aggi(k,l)=-aggi(k,l)
1826 aggi1(k,l)=-aggi1(k,l)
1827 aggj(k,l)=-aggj(k,l)
1828 aggj1(k,l)=-aggj1(k,l)
1839 aggi(k,l)=-aggi(k,l)
1840 aggi1(k,l)=-aggi1(k,l)
1841 aggj(k,l)=-aggj(k,l)
1842 aggj1(k,l)=-aggj1(k,l)
1848 IF (wel_loc.gt.0.0d0) THEN
1849 C Contribution to the local-electrostatic energy coming from the i-j pair
1850 eel_loc_ij=a22*muij(1)+a23*muij(2)+a32*muij(3)
1852 cd write (iout,*) 'i',i,' j',j,' eel_loc_ij',eel_loc_ij
1854 if (energy_dec) write (iout,'(a6,2i5,0pf7.3)')
1855 & 'eelloc',i,j,eel_loc_ij
1857 eel_loc=eel_loc+eel_loc_ij
1858 C Partial derivatives in virtual-bond dihedral angles gamma
1860 & gel_loc_loc(i-1)=gel_loc_loc(i-1)+
1861 & a22*muder(1,i)*mu(1,j)+a23*muder(1,i)*mu(2,j)
1862 & +a32*muder(2,i)*mu(1,j)+a33*muder(2,i)*mu(2,j)
1863 gel_loc_loc(j-1)=gel_loc_loc(j-1)+
1864 & a22*mu(1,i)*muder(1,j)+a23*mu(1,i)*muder(2,j)
1865 & +a32*mu(2,i)*muder(1,j)+a33*mu(2,i)*muder(2,j)
1866 cd call checkint3(i,j,mu1,mu2,a22,a23,a32,a33,acipa,eel_loc_ij)
1867 cd write(iout,*) 'agg ',agg
1868 cd write(iout,*) 'aggi ',aggi
1869 cd write(iout,*) 'aggi1',aggi1
1870 cd write(iout,*) 'aggj ',aggj
1871 cd write(iout,*) 'aggj1',aggj1
1873 C Derivatives of eello in DC(i+1) thru DC(j-1) or DC(nres-2)
1875 ggg(l)=agg(l,1)*muij(1)+
1876 & agg(l,2)*muij(2)+agg(l,3)*muij(3)+agg(l,4)*muij(4)
1880 gel_loc(l,k)=gel_loc(l,k)+ggg(l)
1883 C Remaining derivatives of eello
1885 gel_loc(l,i)=gel_loc(l,i)+aggi(l,1)*muij(1)+
1886 & aggi(l,2)*muij(2)+aggi(l,3)*muij(3)+aggi(l,4)*muij(4)
1887 gel_loc(l,i+1)=gel_loc(l,i+1)+aggi1(l,1)*muij(1)+
1888 & aggi1(l,2)*muij(2)+aggi1(l,3)*muij(3)+aggi1(l,4)*muij(4)
1889 gel_loc(l,j)=gel_loc(l,j)+aggj(l,1)*muij(1)+
1890 & aggj(l,2)*muij(2)+aggj(l,3)*muij(3)+aggj(l,4)*muij(4)
1891 gel_loc(l,j1)=gel_loc(l,j1)+aggj1(l,1)*muij(1)+
1892 & aggj1(l,2)*muij(2)+aggj1(l,3)*muij(3)+aggj1(l,4)*muij(4)
1895 C Change 12/26/95 to calculate four-body contributions to H-bonding energy
1896 if (j.gt.i+1 .and. num_conti.le.maxconts) then
1898 C Calculate the contact function. The ith column of the array JCONT will
1899 C contain the numbers of atoms that make contacts with the atom I (of numbers
1900 C greater than I). The arrays FACONT and GACONT will contain the values of
1901 C the contact function and its derivative.
1902 c r0ij=1.02D0*rpp(iteli,itelj)
1903 c r0ij=1.11D0*rpp(iteli,itelj)
1904 r0ij=2.20D0*rpp(iteli,itelj)
1905 c r0ij=1.55D0*rpp(iteli,itelj)
1906 call gcont(rij,r0ij,1.0D0,0.2d0*r0ij,fcont,fprimcont)
1907 if (fcont.gt.0.0D0) then
1908 num_conti=num_conti+1
1909 if (num_conti.gt.maxconts) then
1910 write (iout,*) 'WARNING - max. # of contacts exceeded;',
1911 & ' will skip next contacts for this conf.'
1913 jcont_hb(num_conti,i)=j
1914 IF (wcorr4.gt.0.0d0 .or. wcorr5.gt.0.0d0 .or.
1915 & wcorr6.gt.0.0d0 .or. wturn6.gt.0.0d0) THEN
1916 C 9/30/99 (AL) - store components necessary to evaluate higher-order loc-el
1918 d_cont(num_conti,i)=rij
1919 cd write (2,'(3e15.5)') rij,r0ij+0.2d0*r0ij,rij
1920 C --- Electrostatic-interaction matrix ---
1921 a_chuj(1,1,num_conti,i)=a22
1922 a_chuj(1,2,num_conti,i)=a23
1923 a_chuj(2,1,num_conti,i)=a32
1924 a_chuj(2,2,num_conti,i)=a33
1925 C --- Gradient of rij
1927 grij_hb_cont(kkk,num_conti,i)=erij(kkk)
1930 c a_chuj(1,1,num_conti,i)=-0.61d0
1931 c a_chuj(1,2,num_conti,i)= 0.4d0
1932 c a_chuj(2,1,num_conti,i)= 0.65d0
1933 c a_chuj(2,2,num_conti,i)= 0.50d0
1934 c else if (i.eq.2) then
1935 c a_chuj(1,1,num_conti,i)= 0.0d0
1936 c a_chuj(1,2,num_conti,i)= 0.0d0
1937 c a_chuj(2,1,num_conti,i)= 0.0d0
1938 c a_chuj(2,2,num_conti,i)= 0.0d0
1940 C --- and its gradients
1941 cd write (iout,*) 'i',i,' j',j
1943 cd write (iout,*) 'iii 1 kkk',kkk
1944 cd write (iout,*) agg(kkk,:)
1947 cd write (iout,*) 'iii 2 kkk',kkk
1948 cd write (iout,*) aggi(kkk,:)
1951 cd write (iout,*) 'iii 3 kkk',kkk
1952 cd write (iout,*) aggi1(kkk,:)
1955 cd write (iout,*) 'iii 4 kkk',kkk
1956 cd write (iout,*) aggj(kkk,:)
1959 cd write (iout,*) 'iii 5 kkk',kkk
1960 cd write (iout,*) aggj1(kkk,:)
1967 a_chuj_der(k,l,m,1,num_conti,i)=agg(m,kkll)
1968 a_chuj_der(k,l,m,2,num_conti,i)=aggi(m,kkll)
1969 a_chuj_der(k,l,m,3,num_conti,i)=aggi1(m,kkll)
1970 a_chuj_der(k,l,m,4,num_conti,i)=aggj(m,kkll)
1971 a_chuj_der(k,l,m,5,num_conti,i)=aggj1(m,kkll)
1973 c a_chuj_der(k,l,m,mm,num_conti,i)=0.0d0
1979 IF (wcorr4.eq.0.0d0 .and. wcorr.gt.0.0d0) THEN
1980 C Calculate contact energies
1982 wij=cosa-3.0D0*cosb*cosg
1985 c fac3=dsqrt(-ael6i)/r0ij**3
1986 fac3=dsqrt(-ael6i)*r3ij
1987 c ees0pij=dsqrt(4.0D0+cosa4+wij*wij-3.0D0*cosbg1*cosbg1)
1988 ees0tmp=4.0D0+cosa4+wij*wij-3.0D0*cosbg1*cosbg1
1989 if (ees0tmp.gt.0) then
1990 ees0pij=dsqrt(ees0tmp)
1994 c ees0mij=dsqrt(4.0D0-cosa4+wij*wij-3.0D0*cosbg2*cosbg2)
1995 ees0tmp=4.0D0-cosa4+wij*wij-3.0D0*cosbg2*cosbg2
1996 if (ees0tmp.gt.0) then
1997 ees0mij=dsqrt(ees0tmp)
2002 ees0p(num_conti,i)=0.5D0*fac3*(ees0pij+ees0mij)
2003 ees0m(num_conti,i)=0.5D0*fac3*(ees0pij-ees0mij)
2004 C Diagnostics. Comment out or remove after debugging!
2005 c ees0p(num_conti,i)=0.5D0*fac3*ees0pij
2006 c ees0m(num_conti,i)=0.5D0*fac3*ees0mij
2007 c ees0m(num_conti,i)=0.0D0
2009 c write (iout,*) 'i=',i,' j=',j,' rij=',rij,' r0ij=',r0ij,
2010 c & ' ees0ij=',ees0p(num_conti,i),ees0m(num_conti,i),' fcont=',fcont
2011 C Angular derivatives of the contact function
2012 ees0pij1=fac3/ees0pij
2013 ees0mij1=fac3/ees0mij
2014 fac3p=-3.0D0*fac3*rrmij
2015 ees0pijp=0.5D0*fac3p*(ees0pij+ees0mij)
2016 ees0mijp=0.5D0*fac3p*(ees0pij-ees0mij)
2018 ecosa1= ees0pij1*( 1.0D0+0.5D0*wij)
2019 ecosb1=-1.5D0*ees0pij1*(wij*cosg+cosbg1)
2020 ecosg1=-1.5D0*ees0pij1*(wij*cosb+cosbg1)
2021 ecosa2= ees0mij1*(-1.0D0+0.5D0*wij)
2022 ecosb2=-1.5D0*ees0mij1*(wij*cosg+cosbg2)
2023 ecosg2=-1.5D0*ees0mij1*(wij*cosb-cosbg2)
2024 ecosap=ecosa1+ecosa2
2025 ecosbp=ecosb1+ecosb2
2026 ecosgp=ecosg1+ecosg2
2027 ecosam=ecosa1-ecosa2
2028 ecosbm=ecosb1-ecosb2
2029 ecosgm=ecosg1-ecosg2
2038 facont_hb(num_conti,i)=fcont
2039 fprimcont=fprimcont/rij
2040 cd facont_hb(num_conti,i)=1.0D0
2041 C Following line is for diagnostics.
2044 dcosb(k)=rmij*(dc_norm(k,i)-erij(k)*cosb)
2045 dcosg(k)=rmij*(dc_norm(k,j)-erij(k)*cosg)
2048 gggp(k)=ecosbp*dcosb(k)+ecosgp*dcosg(k)
2049 gggm(k)=ecosbm*dcosb(k)+ecosgm*dcosg(k)
2051 gggp(1)=gggp(1)+ees0pijp*xj
2052 gggp(2)=gggp(2)+ees0pijp*yj
2053 gggp(3)=gggp(3)+ees0pijp*zj
2054 gggm(1)=gggm(1)+ees0mijp*xj
2055 gggm(2)=gggm(2)+ees0mijp*yj
2056 gggm(3)=gggm(3)+ees0mijp*zj
2057 C Derivatives due to the contact function
2058 gacont_hbr(1,num_conti,i)=fprimcont*xj
2059 gacont_hbr(2,num_conti,i)=fprimcont*yj
2060 gacont_hbr(3,num_conti,i)=fprimcont*zj
2062 ghalfp=0.5D0*gggp(k)
2063 ghalfm=0.5D0*gggm(k)
2064 gacontp_hb1(k,num_conti,i)=ghalfp
2065 & +(ecosap*(dc_norm(k,j)-cosa*dc_norm(k,i))
2066 & + ecosbp*(erij(k)-cosb*dc_norm(k,i)))*vbld_inv(i+1)
2067 gacontp_hb2(k,num_conti,i)=ghalfp
2068 & +(ecosap*(dc_norm(k,i)-cosa*dc_norm(k,j))
2069 & + ecosgp*(erij(k)-cosg*dc_norm(k,j)))*vbld_inv(j+1)
2070 gacontp_hb3(k,num_conti,i)=gggp(k)
2071 gacontm_hb1(k,num_conti,i)=ghalfm
2072 & +(ecosam*(dc_norm(k,j)-cosa*dc_norm(k,i))
2073 & + ecosbm*(erij(k)-cosb*dc_norm(k,i)))*vbld_inv(i+1)
2074 gacontm_hb2(k,num_conti,i)=ghalfm
2075 & +(ecosam*(dc_norm(k,i)-cosa*dc_norm(k,j))
2076 & + ecosgm*(erij(k)-cosg*dc_norm(k,j)))*vbld_inv(j+1)
2077 gacontm_hb3(k,num_conti,i)=gggm(k)
2079 C Diagnostics. Comment out or remove after debugging!
2081 cdiag gacontp_hb1(k,num_conti,i)=0.0D0
2082 cdiag gacontp_hb2(k,num_conti,i)=0.0D0
2083 cdiag gacontp_hb3(k,num_conti,i)=0.0D0
2084 cdiag gacontm_hb1(k,num_conti,i)=0.0D0
2085 cdiag gacontm_hb2(k,num_conti,i)=0.0D0
2086 cdiag gacontm_hb3(k,num_conti,i)=0.0D0
2089 endif ! num_conti.le.maxconts
2094 C-----------------------------------------------------------------------
2095 subroutine evdwpp_long(evdw1)
2099 implicit real*8 (a-h,o-z)
2100 include 'DIMENSIONS'
2101 include 'COMMON.CONTROL'
2102 include 'COMMON.IOUNITS'
2103 include 'COMMON.GEO'
2104 include 'COMMON.VAR'
2105 include 'COMMON.LOCAL'
2106 include 'COMMON.CHAIN'
2107 include 'COMMON.DERIV'
2108 include 'COMMON.INTERACT'
2109 include 'COMMON.CONTACTS'
2110 include 'COMMON.TORSION'
2111 include 'COMMON.VECTORS'
2112 include 'COMMON.FFIELD'
2114 c 4/26/02 - AL scaling factor for 1,4 repulsive VDW interactions
2116 double precision scal_el /1.0d0/
2118 double precision scal_el /0.5d0/
2121 do i=iatel_s,iatel_e
2125 dx_normi=dc_norm(1,i)
2126 dy_normi=dc_norm(2,i)
2127 dz_normi=dc_norm(3,i)
2128 xmedi=c(1,i)+0.5d0*dxi
2129 ymedi=c(2,i)+0.5d0*dyi
2130 zmedi=c(3,i)+0.5d0*dzi
2131 xmedi=mod(xmedi,boxysize)
2132 if (xmedi.lt.0) xmedi=xmedi+boxxsize
2133 ymedi=mod(ymedi,boxysize)
2134 if (ymedi.lt.0) ymedi=ymedi+boxysize
2135 zmedi=mod(zmedi,boxzsize)
2136 if (zmedi.lt.0) zmedi=zmedi+boxzsize
2138 c write (iout,*) 'i',i,' ielstart',ielstart(i),' ielend',ielend(i)
2139 do j=ielstart(i),ielend(i)
2143 if (j.eq.i+2 .and. itelj.eq.2) iteli=2
2144 aaa=app(iteli,itelj)
2145 bbb=bpp(iteli,itelj)
2149 dx_normj=dc_norm(1,j)
2150 dy_normj=dc_norm(2,j)
2151 dz_normj=dc_norm(3,j)
2156 if (xj.lt.0) xj=xj+boxxsize
2158 if (yj.lt.0) yj=yj+boxysize
2160 dist_init=(xj-xi)**2+(yj-yi)**2+(zj-zi)**2
2168 xj=xj_safe+xshift*boxxsize
2169 yj=yj_safe+yshift*boxysize
2170 zj=zj_safe+zshift*boxzsize
2171 dist_temp=(xj-xi)**2+(yj-yi)**2+(zj-zi)**2
2172 if(dist_temp.lt.dist_init) then
2182 if (isubchap.eq.1) then
2191 rij=xj*xj+yj*yj+zj*zj
2194 sss=sscale(rij/rpp(iteli,itelj))
2195 sssgrad=sscagrad(sqrt(rij))
2196 if (sss.lt.1.0d0) then
2201 c 4/26/02 - AL scaling down 1,4 repulsive VDW interactions
2202 if (j.eq.i+2) ev1=scal_el*ev1
2205 if (energy_dec) then
2206 write (iout,'(a6,2i5,0pf7.3)') 'evdw1',i,j,evdwij
2207 write (iout,'(a6,2i5,0pf7.3)') 'ees',i,j,eesij
2209 evdw1=evdw1+evdwij*(1.0d0-sss)
2211 C Calculate contributions to the Cartesian gradient.
2213 facvdw=-6*rrmij*(ev1+evdwij)*(1.0d0-sss)
2214 ggg(1)=facvdw*xj-sssgrad*rmij*evdwij*xj
2215 ggg(2)=facvdw*yj-sssgrad*rmij*evdwij*yj
2216 ggg(3)=facvdw*zj-sssgrad*rmij*evdwij*zj
2220 gvdwpp(k,i)=gvdwpp(k,i)+ghalf
2221 gvdwpp(k,j)=gvdwpp(k,j)+ghalf
2224 * Loop over residues i+1 thru j-1.
2228 gvdwpp(l,k)=gvdwpp(l,k)+ggg(l)
2236 C-----------------------------------------------------------------------
2237 subroutine evdwpp_short(evdw1)
2241 implicit real*8 (a-h,o-z)
2242 include 'DIMENSIONS'
2243 include 'COMMON.CONTROL'
2244 include 'COMMON.IOUNITS'
2245 include 'COMMON.GEO'
2246 include 'COMMON.VAR'
2247 include 'COMMON.LOCAL'
2248 include 'COMMON.CHAIN'
2249 include 'COMMON.DERIV'
2250 include 'COMMON.INTERACT'
2251 include 'COMMON.CONTACTS'
2252 include 'COMMON.TORSION'
2253 include 'COMMON.VECTORS'
2254 include 'COMMON.FFIELD'
2256 c 4/26/02 - AL scaling factor for 1,4 repulsive VDW interactions
2258 double precision scal_el /1.0d0/
2260 double precision scal_el /0.5d0/
2263 do i=iatel_s,iatel_e
2267 dx_normi=dc_norm(1,i)
2268 dy_normi=dc_norm(2,i)
2269 dz_normi=dc_norm(3,i)
2270 xmedi=c(1,i)+0.5d0*dxi
2271 ymedi=c(2,i)+0.5d0*dyi
2272 zmedi=c(3,i)+0.5d0*dzi
2273 xmedi=mod(xmedi,boxysize)
2274 if (xmedi.lt.0) xmedi=xmedi+boxxsize
2275 ymedi=mod(ymedi,boxysize)
2276 if (ymedi.lt.0) ymedi=ymedi+boxysize
2277 zmedi=mod(zmedi,boxzsize)
2278 if (zmedi.lt.0) zmedi=zmedi+boxzsize
2280 c write (iout,*) 'i',i,' ielstart',ielstart(i),' ielend',ielend(i)
2281 do j=ielstart(i),ielend(i)
2285 if (j.eq.i+2 .and. itelj.eq.2) iteli=2
2286 aaa=app(iteli,itelj)
2287 bbb=bpp(iteli,itelj)
2291 dx_normj=dc_norm(1,j)
2292 dy_normj=dc_norm(2,j)
2293 dz_normj=dc_norm(3,j)
2298 if (xj.lt.0) xj=xj+boxxsize
2300 if (yj.lt.0) yj=yj+boxysize
2302 dist_init=(xj-xi)**2+(yj-yi)**2+(zj-zi)**2
2310 xj=xj_safe+xshift*boxxsize
2311 yj=yj_safe+yshift*boxysize
2312 zj=zj_safe+zshift*boxzsize
2313 dist_temp=(xj-xi)**2+(yj-yi)**2+(zj-zi)**2
2314 if(dist_temp.lt.dist_init) then
2324 if (isubchap.eq.1) then
2333 rij=xj*xj+yj*yj+zj*zj
2336 sss=sscale(rij/rpp(iteli,itelj))
2337 sssgrad=sscagrad(sqrt(rij))
2338 if (sss.gt.0.0d0) then
2343 c 4/26/02 - AL scaling down 1,4 repulsive VDW interactions
2344 if (j.eq.i+2) ev1=scal_el*ev1
2347 if (energy_dec) then
2348 write (iout,'(a6,2i5,0pf7.3)') 'evdw1',i,j,evdwij
2349 write (iout,'(a6,2i5,0pf7.3)') 'ees',i,j,eesij
2351 evdw1=evdw1+evdwij*sss
2353 C Calculate contributions to the Cartesian gradient.
2355 facvdw=-6*rrmij*(ev1+evdwij)*sss
2356 ggg(1)=facvdw*xj+sssgrad*rmij*evdwij*xj
2357 ggg(2)=facvdw*yj+sssgrad*rmij*evdwij*yj
2358 ggg(3)=facvdw*zj+sssgrad*rmij*evdwij*zj
2362 gvdwpp(k,i)=gvdwpp(k,i)+ghalf
2363 gvdwpp(k,j)=gvdwpp(k,j)+ghalf
2366 * Loop over residues i+1 thru j-1.
2370 gvdwpp(l,k)=gvdwpp(l,k)+ggg(l)
2378 C-----------------------------------------------------------------------------
2379 subroutine escp_long(evdw2,evdw2_14)
2381 C This subroutine calculates the excluded-volume interaction energy between
2382 C peptide-group centers and side chains and its gradient in virtual-bond and
2383 C side-chain vectors.
2385 implicit real*8 (a-h,o-z)
2386 include 'DIMENSIONS'
2387 include 'COMMON.GEO'
2388 include 'COMMON.VAR'
2389 include 'COMMON.LOCAL'
2390 include 'COMMON.CHAIN'
2391 include 'COMMON.DERIV'
2392 include 'COMMON.INTERACT'
2393 include 'COMMON.FFIELD'
2394 include 'COMMON.IOUNITS'
2395 include 'COMMON.CONTROL'
2399 cd print '(a)','Enter ESCP'
2400 cd write (iout,*) 'iatscp_s=',iatscp_s,' iatscp_e=',iatscp_e
2401 do i=iatscp_s,iatscp_e
2403 xi=0.5D0*(c(1,i)+c(1,i+1))
2404 yi=0.5D0*(c(2,i)+c(2,i+1))
2405 zi=0.5D0*(c(3,i)+c(3,i+1))
2407 do iint=1,nscp_gr(i)
2409 do j=iscpstart(i,iint),iscpend(i,iint)
2411 C Uncomment following three lines for SC-p interactions
2415 C Uncomment following three lines for Ca-p interactions
2419 rrij=1.0D0/(xj*xj+yj*yj+zj*zj)
2421 sss=sscale(1.0d0/(dsqrt(rrij)*rscp(itypj,iteli)))
2423 if (sss.lt.1.0d0) then
2426 e1=fac*fac*aad(itypj,iteli)
2427 e2=fac*bad(itypj,iteli)
2428 if (iabs(j-i) .le. 2) then
2431 evdw2_14=evdw2_14+(e1+e2)*(1.0d0-sss)
2434 evdw2=evdw2+evdwij*(1.0d0-sss)
2435 if (energy_dec) write (iout,'(a6,2i5,0pf7.3)')
2436 & 'evdw2',i,j,evdwij
2438 C Calculate contributions to the gradient in the virtual-bond and SC vectors.
2440 fac=-(evdwij+e1)*rrij*(1.0d0-sss)
2445 cd write (iout,*) 'j<i'
2446 C Uncomment following three lines for SC-p interactions
2448 c gradx_scp(k,j)=gradx_scp(k,j)+ggg(k)
2451 cd write (iout,*) 'j>i'
2454 C Uncomment following line for SC-p interactions
2455 c gradx_scp(k,j)=gradx_scp(k,j)-ggg(k)
2459 gvdwc_scp(k,i)=gvdwc_scp(k,i)-0.5D0*ggg(k)
2463 cd write (iout,*) 'i=',i,' j=',j,' kstart=',kstart,' kend=',kend
2464 cd write (iout,*) ggg(1),ggg(2),ggg(3)
2467 gvdwc_scp(l,k)=gvdwc_scp(l,k)-ggg(l)
2479 gvdwc_scp(j,i)=expon*gvdwc_scp(j,i)
2480 gradx_scp(j,i)=expon*gradx_scp(j,i)
2483 C******************************************************************************
2487 C To save time the factor EXPON has been extracted from ALL components
2488 C of GVDWC and GRADX. Remember to multiply them by this factor before further
2491 C******************************************************************************
2494 C-----------------------------------------------------------------------------
2495 subroutine escp_short(evdw2,evdw2_14)
2497 C This subroutine calculates the excluded-volume interaction energy between
2498 C peptide-group centers and side chains and its gradient in virtual-bond and
2499 C side-chain vectors.
2501 implicit real*8 (a-h,o-z)
2502 include 'DIMENSIONS'
2503 include 'COMMON.GEO'
2504 include 'COMMON.VAR'
2505 include 'COMMON.LOCAL'
2506 include 'COMMON.CHAIN'
2507 include 'COMMON.DERIV'
2508 include 'COMMON.INTERACT'
2509 include 'COMMON.FFIELD'
2510 include 'COMMON.IOUNITS'
2511 include 'COMMON.CONTROL'
2515 cd print '(a)','Enter ESCP'
2516 cd write (iout,*) 'iatscp_s=',iatscp_s,' iatscp_e=',iatscp_e
2517 do i=iatscp_s,iatscp_e
2519 xi=0.5D0*(c(1,i)+c(1,i+1))
2520 yi=0.5D0*(c(2,i)+c(2,i+1))
2521 zi=0.5D0*(c(3,i)+c(3,i+1))
2523 do iint=1,nscp_gr(i)
2525 do j=iscpstart(i,iint),iscpend(i,iint)
2527 C Uncomment following three lines for SC-p interactions
2531 C Uncomment following three lines for Ca-p interactions
2535 rrij=1.0D0/(xj*xj+yj*yj+zj*zj)
2537 sss=sscale(1.0d0/(dsqrt(rrij)*rscp(itypj,iteli)))
2539 if (sss.gt.0.0d0) then
2542 e1=fac*fac*aad(itypj,iteli)
2543 e2=fac*bad(itypj,iteli)
2544 if (iabs(j-i) .le. 2) then
2547 evdw2_14=evdw2_14+(e1+e2)*sss
2550 evdw2=evdw2+evdwij*sss
2551 if (energy_dec) write (iout,'(a6,2i5,0pf7.3)')
2552 & 'evdw2',i,j,evdwij
2554 C Calculate contributions to the gradient in the virtual-bond and SC vectors.
2556 fac=-(evdwij+e1)*rrij*sss
2561 cd write (iout,*) 'j<i'
2562 C Uncomment following three lines for SC-p interactions
2564 c gradx_scp(k,j)=gradx_scp(k,j)+ggg(k)
2567 cd write (iout,*) 'j>i'
2570 C Uncomment following line for SC-p interactions
2571 c gradx_scp(k,j)=gradx_scp(k,j)-ggg(k)
2575 gvdwc_scp(k,i)=gvdwc_scp(k,i)-0.5D0*ggg(k)
2579 cd write (iout,*) 'i=',i,' j=',j,' kstart=',kstart,' kend=',kend
2580 cd write (iout,*) ggg(1),ggg(2),ggg(3)
2583 gvdwc_scp(l,k)=gvdwc_scp(l,k)-ggg(l)
2595 gvdwc_scp(j,i)=expon*gvdwc_scp(j,i)
2596 gradx_scp(j,i)=expon*gradx_scp(j,i)
2599 C******************************************************************************
2603 C To save time the factor EXPON has been extracted from ALL components
2604 C of GVDWC and GRADX. Remember to multiply them by this factor before further
2607 C******************************************************************************