- Timestamp:
- 11/19/09 11:29:41 (14 years ago)
- Branches:
- master
- Children:
- 38d77eb
- Parents:
- 6650a56
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
enylun.f
r6650a56 r32289cd 1 1 ! ******************************************************************* 2 2 ! SMMP version of Anders Irback's force field, to be called the Lund 3 ! force field. This file contains the function enylun, which in turn 4 ! calls all the terms in the energy function. The terms Bias (ebias), 5 ! Hydrogen bonds (ehbmm and ehbms), Hydrophobicity (ehp) and the 6 ! Excluded volume (eexvol and eloexv) are also implemented in this 3 ! force field. This file contains the function enylun, which in turn 4 ! calls all the terms in the energy function. The terms Bias (ebias), 5 ! Hydrogen bonds (ehbmm and ehbms), Hydrophobicity (ehp) and the 6 ! Excluded volume (eexvol and eloexv) are also implemented in this 7 7 ! file. 8 8 ! … … 13 13 include 'INCL.H' 14 14 include 'incl_lund.h' 15 integer iat1, iat2 16 15 17 integer ires,frst,lst,root 16 18 do iat1=iCa(ires)+frst,iCa(ires)+lst … … 30 32 include 'INCL.H' 31 33 include 'incl_lund.h' 34 double precision eunit, csacc 35 36 integer i, j, iml, iat1, iat2, k, iat3, l, iat4, m, iat3p, irs 37 integer iatoff, iatmrg, ilp, lci 38 32 39 character mynm*4 33 40 logical prlvr … … 83 90 prlvr=.true. ! residue i is a proline variant 84 91 print *, 'proline variant ',mynm,i 85 else 92 else 86 93 prlvr=.false. 87 endif 88 89 if (mynm.eq.'ala') then 94 endif 95 96 if (mynm.eq.'ala') then 90 97 nhpat(i)=1 91 98 ihpat(i,1)=iCa(i)+2 … … 193 200 194 201 ! Initialization of the connections matrix matcon(i,j). The index 195 ! i runs from -mxconr to +mxconr, and j from 1 to mxat. 202 ! i runs from -mxconr to +mxconr, and j from 1 to mxat. 196 203 ! matcon(i2-i1,i1) = 0, if the distance between atoms i1 and i2 is fixed 197 204 ! = 2, if atoms i1 and i2 are separated by 3 covalent 198 205 ! bonds and their distance can change 199 206 ! = 1, for all other pairs 200 ! if abs(i2-i1) > mxconr, the atoms are assumed to be separated by 201 ! many bonds, and with no restriction on their distances. On a protein 207 ! if abs(i2-i1) > mxconr, the atoms are assumed to be separated by 208 ! many bonds, and with no restriction on their distances. On a protein 202 209 ! molecule made of natural amino acids, atoms with indices separated 203 210 ! by more than 35 can not be connected by three covalent bonds. … … 228 235 do m=1,nbdat(iat2) 229 236 iat3p=ibdat(m,iat2) 230 if (iat3p.ne.iat3) then 237 if (iat3p.ne.iat3) then 231 238 matcon(iat4-iat3p,iat3p)=2 ! 3 covalent bonds 232 239 matcon(iat3p-iat4,iat4)=2 ! … … 255 262 matcon(iat2-iat1,iat1)=0 256 263 matcon(iat1-iat2,iat2)=0 257 enddo 264 enddo 258 265 matcon(iat1-iCa(irsml1(iml))-1,iCa(irsml1(iml))+1)=2 259 266 matcon(iCa(irsml1(iml))+1-iat1,iat1)=2 … … 266 273 ! Below: for certain residues, some atoms separated by 3 or more bonds 267 274 ! do not change distance. So, the connection matrix term for such pairs 268 ! should be zero. 275 ! should be zero. 269 276 270 277 do irs=irsml1(iml),irsml2(iml) 271 278 if (irs.eq.irsml1(iml)) then 272 279 iatoff=1 273 else 280 else 274 281 iatoff=0 275 282 endif … … 283 290 if ((mynm.eq.'pro')) then 284 291 prlvr=.true. ! residue i is a proline variant 285 else 292 else 286 293 prlvr=.false. 287 endif 288 if ((mynm.eq.'asn')) then 294 endif 295 if ((mynm.eq.'asn')) then 289 296 call set_local_constr(irs,5,9,2) 290 else if ((mynm.eq.'gln')) then 297 else if ((mynm.eq.'gln')) then 291 298 call set_local_constr(irs,8,12,5) 292 299 else if ((mynm.eq.'arg')) then … … 294 301 else if ((mynm.eq.'his')) then 295 302 call set_local_constr(irs,5,12,2) 296 else if (mynm.eq.'phe') then 303 else if (mynm.eq.'phe') then 297 304 call set_local_constr(irs,5,15,2) 298 305 else if (mynm.eq.'tyr') then … … 308 315 call set_local_constr(irs,5,19,2) 309 316 else if (prlvr) then 310 ! Proline. Many more distances are fixed because of the fixed 317 ! Proline. Many more distances are fixed because of the fixed 311 318 ! phi angle 312 319 call set_local_constr(irs,-3,11,-3) … … 347 354 do iat1=iatrs1(irsml1(iml)),iatrs2(irsml2(iml)) 348 355 do iat2=iat1+1,iatrs2(irsml2(iml)) 349 if (iat2-iat1.le.mxconr) then 350 if (matcon(iat2-iat1,iat1).eq.2) then 351 ilp=ilp+1 352 lcp1(ilp)=iat1 353 lcp2(ilp)=iat2 354 endif 356 if ((iat2-iat1.le.mxconr).and. 357 & matcon(iat2-iat1,iat1).eq.2) then 358 ilp=ilp+1 359 lcp1(ilp)=iat1 360 lcp2(ilp)=iat2 355 361 endif 356 362 enddo … … 358 364 359 365 ilpnd(iml)=ilp 360 if (iml.lt.ntlml) then 366 if (iml.lt.ntlml) then 361 367 ilpst(iml+1)=ilp+1 362 368 endif … … 369 375 enddo 370 376 enddo 377 371 378 print *,'finished initializing Lund force field' 372 379 end … … 374 381 integer function ihptype(iaa) 375 382 include 'INCL.H' 383 integer iaa, ityp 384 376 385 character mynm*4 377 386 mynm=seq(iaa) … … 383 392 & .or.(mynm.eq.'met').or.(mynm.eq.'pro')) then 384 393 ityp=2 385 else if ((mynm.eq.'phe').or.(mynm.eq.'tyr').or.(mynm.eq.'trp')) 394 else if ((mynm.eq.'phe').or.(mynm.eq.'tyr').or.(mynm.eq.'trp')) 386 395 & then 387 396 ityp=3 388 397 endif 389 398 ihptype=ityp 390 return 399 return 391 400 end 392 401 … … 394 403 include 'INCL.H' 395 404 include 'incl_lund.h' 405 double precision q1, q2, et, xij, yij, zij 406 407 integer i, iat1, irsd, j, iat2 408 396 409 dimension q1(2),q2(2) 397 410 data q1/-0.2,0.2/ 398 data q2/0.42,-0.42/ 411 data q2/0.42,-0.42/ 399 412 400 413 et=0.0 … … 412 425 return 413 426 end 414 ! Evaluates backbone backbone hydrogen bond strength for residues 427 ! Evaluates backbone backbone hydrogen bond strength for residues 415 428 ! i and j, taking the donor from residue i and acceptor from residue j 416 429 real*8 function ehbmmrs(i,j) 417 430 include 'INCL.H' 418 431 include 'incl_lund.h' 432 double precision rdon2, racc2, evlu 433 434 integer i, j 435 419 436 double precision r2,r4,r6,dx,dy,dz,ca,cb 420 437 integer d1,d2,a1,a2 … … 427 444 dz=zat(a1)-zat(d2) 428 445 r2=dx*dx+dy*dy+dz*dz 429 if (r2.gt.cthb2) then 446 if (r2.gt.cthb2) then 430 447 ! print *,'hbmm = 0 ',cthb2,r2,a1,a2,d1,d2 431 448 ! print *,'a1,a2,d1,d2,r2 = ',a1,a2,d1,d2,r2,sighb2,cthb … … 464 481 include 'INCL.H' 465 482 include 'incl_lund.h' 483 double precision ebiasrs, shbm1, shbm2, etmp, ehbmmrs, ehp, etmp1 484 double precision xij, yij, zij, r2, r6 485 486 integer istres, nml, indres, i, j, ihpi, ihptype, ihpj, i1, i2 487 integer iat1, iat2, iatt1, iatt2 488 466 489 character mynm*4 467 490 logical prlvr … … 485 508 & .or.(mynm.eq.'pron').or.(mynm.eq.'pro+')) then 486 509 prlvr=.true. ! residue i is a proline variant 487 else 510 else 488 511 prlvr=.false. 489 endif 512 endif 490 513 491 514 ! Bias, or local electrostatic term. Excluded from the list are … … 502 525 ! j run over the whole set of amino acids. 503 526 ! No terms for residue i, if it is a proline variant. 504 if (.not.prlvr) then 527 if (.not.prlvr) then 505 528 do j=istres,indres 506 if ((j.lt.(i-2)).or.(j.gt.(i+1))) then 529 if ((j.lt.(i-2)).or.(j.gt.(i+1))) then 507 530 shbm2=1.0 508 531 if ((j.eq.istres).or.(j.eq.indres)) shbm2=0.5 509 532 etmp=ehbmmrs(i,j) 510 533 eyhb=eyhb+shbm1*shbm2*etmp 511 endif 534 endif 512 535 enddo 513 536 endif 514 537 ! Hydrophobicity, only if residue i is hydrophobic to start with 515 538 ihpi=ihptype(i) 516 if (ihpi.ge.0) then 539 if (ihpi.ge.0) then 517 540 ! Unlike hydrogen bonds, the hydrophobicity potential is symmetric 518 541 ! in i and j. So, the loop for j runs from i+1 to the end. … … 526 549 ! print *, 'hydrophobicity contribution ',etmp,i,j 527 550 eysl=eysl+etmp 528 endif 551 endif 529 552 enddo 530 553 endif … … 535 558 ! Local pair or third-neighbour excluded volume 536 559 ! Numerically this is normally the term with largest positive 537 ! contribution to the energy in an equilibrated stystem. 560 ! contribution to the energy in an equilibrated stystem. 538 561 539 562 i1=ilpst(nml) … … 551 574 r2=(xij*xij + yij*yij + zij*zij) 552 575 if (r2.le.exvcut2) then 553 r6=sig2lcp(iatt1,iatt2)/r2 576 r6=sig2lcp(iatt1,iatt2)/r2 554 577 r6=r6*r6*r6 555 578 etmp1=(r6*r6+asalcp(iatt1,iatt2)+bsalcp(iatt1,iatt2)*r2) … … 560 583 etmp=etmp+etmp1 561 584 endif 562 ! print *,'pair : ',iat1,iat2,' contribution ',etmp1 585 ! print *,'pair : ',iat1,iat2,' contribution ',etmp1 563 586 ! print *,exvcut2,r2 564 587 enddo … … 579 602 include 'INCL.H' 580 603 include 'incl_lund.h' 604 double precision b2, a2, r2min, xij, yij, zij, dtmp, ssum 605 606 integer ihp1, ihp2, ni, i1, nj, i2, i, k, j, l 607 581 608 dimension r2min(12) 582 609 … … 608 635 ssum=0 609 636 do i=1,ni+nj 610 if (r2min(i).le.b2) then 611 if (r2min(i).lt.a2) then 637 if (r2min(i).le.b2) then 638 if (r2min(i).lt.a2) then 612 639 ssum=ssum+1 613 else 640 else 614 641 ssum=ssum+(b2-r2min(i))/(b2-a2) 615 642 endif … … 626 653 include 'incl_lund.h' 627 654 ! For multi-chain systems it makes little sense to split the calculation 628 ! of this term into an 'interaction part' and a contribution from 655 ! of this term into an 'interaction part' and a contribution from 629 656 ! individual molecules. So, normally this should always be called with 630 657 ! argument nml=0. Only for diagnostic reasons, you might want to find 631 ! the contribution from one molecule in a multi-chain system assuming 658 ! the contribution from one molecule in a multi-chain system assuming 632 659 ! there was no other molecule. 660 double precision xmin, ymin, zmin, xmax, ymax, zmax, sizex, sizey 661 double precision sizez, shiftx, shifty, shiftz, etmp, xij, yij 662 double precision zij, r2, r6, etmp1 663 664 integer nml, istat, indat, i, incell, ndx, ndy, ndz, nxy, ncell 665 integer nocccl, locccl, j, mx, my, mz, icellj, icell, jj, isort 666 integer icl, lcell, ix, iz, iy, nex, ney, nez, nsame, nngbr, jx 667 integer jy, jz, jcl, ii, ngbr, i1, iat1, i2, iat2, iatt1, iatt2 668 633 669 dimension isort(mxat),ngbr(mxat),locccl(mxat),incell(mxcell) 634 670 dimension icell(mxat) 635 671 integer :: jx1, jy1, jz1 636 logical doit 637 638 if (nml.eq.0) then 672 673 if (nml.eq.0) then 639 674 istat=iatrs1(irsml1(1)) 640 675 indat=iatrs2(irsml2(ntlml)) 641 else 676 else 642 677 istat=iatrs1(irsml1(nml)) 643 678 indat=iatrs2(irsml2(nml)) … … 645 680 646 681 eyvw=0.0 647 ! The beginning part of this implementation is very similar to the 648 ! assignment of cells to the atoms during calculation of solvent 649 ! accessible surface area. So, much of that part is similar. But 682 ! The beginning part of this implementation is very similar to the 683 ! assignment of cells to the atoms during calculation of solvent 684 ! accessible surface area. So, much of that part is similar. But 650 685 ! unlike the accessible surface calculations, this term is symmetric 651 686 ! in any two participating atoms. So, the part after the assignment … … 724 759 icellj=mx+my*ndx+mz*nxy+1 725 760 icell(j)=icellj 726 if (icellj.gt.mxcell) then 761 if (icellj.gt.mxcell) then 727 762 print *,'exvlun> bad cell index ',icellj,' for atom ',j 728 763 stop 729 else 730 if (incell(icellj).eq.0) then 764 else 765 if (incell(icellj).eq.0) then 731 766 ! previously unoccupied cell 732 767 nocccl=nocccl+1 … … 756 791 ix=mod(lcell-1,ndx) 757 792 iz = (lcell - 1) / nxy 758 iy = ((lcell - 1) - iz * nxy) / ndx 793 iy = ((lcell - 1) - iz * nxy) / ndx 759 794 760 795 c print *,'icl=',icl,'absolute index of cell = ',lcell … … 767 802 nngbr=0 768 803 do jx=ix,nex 769 if (jx.ge.ndx) then 804 if (jx.ge.ndx) then 770 805 jx1=0 771 else 806 else 772 807 jx1=jx 773 808 endif 774 809 do jy=iy,ney 775 if (jy.ge.ndy) then 810 if (jy.ge.ndy) then 776 811 jy1=0 777 else 812 else 778 813 jy1=jy 779 endif 814 endif 780 815 do jz=iz,nez 781 if (jz.ge.ndz) then 816 if (jz.ge.ndz) then 782 817 jz1=0 783 else 818 else 784 819 jz1=jz 785 820 endif 786 821 jcl=jx1 + ndx*jy1 + nxy*jz1 + 1 787 ! write (*,*)'jcl,jx1,jy1,jz1:', jcl,jx1,jy1,jz1822 ! write (logString, *)'jcl,jx1,jy1,jz1:', jcl,jx1,jy1,jz1 788 823 do ii=incell(jcl)+1,incell(jcl+1) 789 824 ! count the total number of neighbours … … 799 834 enddo 800 835 ! A few more cells need to be searched, so that we cover 13 of the 26 801 ! neighbouring cells. 836 ! neighbouring cells. 802 837 ! 1 803 838 jx=ix+1 804 if (jx.ge.ndx) jx=0 839 if (jx.ge.ndx) jx=0 805 840 jy=iy 806 841 jz=iz-1 … … 883 918 r2=(xij*xij+yij*yij+zij*zij) 884 919 885 if (r2.le.exvcutg2) then 886 doit=.false. 887 if (abs(iat2-iat1).gt.mxconr ) then 888 doit=.true. 889 else if (matcon(iat2-iat1,iat1).eq.1) then 890 doit=.true. 891 endif 892 if (doit) then 920 if (r2.le.exvcutg2) then 921 if (abs(iat2-iat1).gt.mxconr.or. 922 & matcon(iat2-iat1,iat1).eq.1) then 893 923 iatt1=ityat(iat1) 894 924 iatt2=ityat(iat2) … … 931 961 include 'incl_lund.h' 932 962 963 double precision etmp, etmp1, xij, yij, zij, r2, r6 964 965 integer iat1, iat2, iatt1, iatt2 966 933 967 etmp=0.0 934 968 etmp1=0.0 … … 941 975 r2=(xij*xij+yij*yij+zij*zij) 942 976 943 if (r2.le.exvcutg2) then 977 if (r2.le.exvcutg2) then 944 978 if (abs(iat2-iat1).gt.mxconr.or. 945 979 & matcon(iat2-iat1,iat1).eq.1) then … … 951 985 & +bsaexv(iatt1,iatt2)*r2 952 986 etmp=etmp+etmp1 953 else 987 else 954 988 ! print *,'atoms ', iat1,' and ',iat2,' were close', 955 989 ! # 'but matcon is ',matcon(iat2-iat1,iat1)
Note:
See TracChangeset
for help on using the changeset viewer.