Changeset bd2278d for hbond.f


Ignore:
Timestamp:
09/05/08 11:49:42 (16 years ago)
Author:
baerbaer <baerbaer@…>
Branches:
master
Children:
fafe4d6
Parents:
2ebb8b6
Message:

Reformatting comments and continuation marks.

Fortran 90 and higher use ! to mark comments no matter where they are in the
code. The only valid continuation marker is &.
I also added the SMMP.kdevelop.filelist to the repository to make it easier
to use kdevelop.

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/smmp/trunk@12 26dc1dd8-5c4e-0410-9ffe-d298b4865968

File:
1 edited

Legend:

Unmodified
Added
Removed
  • hbond.f

    r2ebb8b6 rbd2278d  
    1 c**************************************************************
    2 c
    3 c This file contains the subroutines: hbond,chhb,ishybd,
    4 c                                     ishybdo,nursat,interhbond
    5 c
    6 c Copyright 2003-2005  Frank Eisenmenger, U.H.E. Hansmann,
    7 c                      Shura Hayryan, Chin-Ku
    8 c Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
    9 c                      Jan H. Meinke, Sandipan Mohanty
    10 c
    11 c **************************************************************
     1!**************************************************************
     2!
     3! This file contains the subroutines: hbond,chhb,ishybd,
     4!                                     ishybdo,nursat,interhbond
     5!
     6! Copyright 2003-2005  Frank Eisenmenger, U.H.E. Hansmann,
     7!                      Shura Hayryan, Chin-Ku
     8! Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
     9!                      Jan H. Meinke, Sandipan Mohanty
     10!
     11! **************************************************************
    1212
    1313
    1414      subroutine hbond(nml,mhb,ipr)
    15 c .................................................................
    16 c PURPOSE: find hydrogen bonds in molecule 'nml'
    17 c
    18 c          prints HBonds, if ipr > 0
    19 c
    20 c OUTPUT: mhb - number of hyd.bds. of type i->i+4
    21 c 
    22 c   to INCL.H:
    23 c
    24 c         ntyhb  - number of different types of hyd. bds. found
    25 c         nutyhb - number of hyd.bds. found for each type
    26 c         ixtyhb - index for each type of hyd. bd. composed as
    27 c                  (atom idx. of H) * 1000 + atm.idx. of acceptor
    28 c
    29 c CALLS: chhb,ishybd  (ishybdo),nursat
    30 C
    31 c................................................................
    32 
    33       include 'INCL.H'
    34 
    35 cf2py intent(out) mhb 
     15! .................................................................
     16! PURPOSE: find hydrogen bonds in molecule 'nml'
     17!
     18!          prints HBonds, if ipr > 0
     19!
     20! OUTPUT: mhb - number of hyd.bds. of type i->i+4
     21! 
     22!   to INCL.H:
     23!
     24!         ntyhb  - number of different types of hyd. bds. found
     25!         nutyhb - number of hyd.bds. found for each type
     26!         ixtyhb - index for each type of hyd. bd. composed as
     27!                  (atom idx. of H) * 1000 + atm.idx. of acceptor
     28!
     29! CALLS: chhb,ishybd  (ishybdo),nursat
     30!
     31!................................................................
     32
     33      include 'INCL.H'
     34
     35!f2py intent(out) mhb 
    3636      parameter (atbase=mxat)     
    3737      logical ishb
     
    5050        if (ntlvr.eq.0) then
    5151          write (*,'(a,i4)')
    52      #           ' hbond> No variables defined in molecule #',nml
     52     &           ' hbond> No variables defined in molecule #',nml
    5353          return
    5454        endif
    5555
    5656        ifivr=ivrml1(nml)
    57 c Index of last moving set
     57! Index of last moving set
    5858        i1s=imsml1(nml)+nmsml(nml)
    5959      endif
    60 c Loop over all variables
     60! Loop over all variables
    6161      do io=ifivr+ntlvr-1,ifivr,-1 
    62 c Get index of variable
     62! Get index of variable
    6363        iv=iorvr(io)       
    64 c Index of next to last moving set
     64! Index of next to last moving set
    6565        i2s=i1s-1     
    66 c Index of moving set belonging to iv
     66! Index of moving set belonging to iv
    6767        i1s=imsvr1(iv)
    68 c Loop over all moving sets between the one belonging to iv and the
    69 c next to last one
     68! Loop over all moving sets between the one belonging to iv and the
     69! next to last one
    7070        do ims=i1s,i2s 
    71 c First atom in moving set
     71! First atom in moving set
    7272          i1=latms1(ims)
    73 c Last atom in moving set
     73! Last atom in moving set
    7474          i2=latms2(ims)
    75 c Loop over all atoms in moving set.
     75! Loop over all atoms in moving set.
    7676          do i=i1,i2 
    77 c Loop over van der Waals domains of atom i
     77! Loop over van der Waals domains of atom i
    7878            do ivw=ivwat1(i),ivwat2(i)
    79 c Loop over atoms in van der Waals domain. 
     79! Loop over atoms in van der Waals domain. 
    8080              do j=lvwat1(ivw),lvwat2(ivw) 
    8181
     
    111111
    112112              call ishybd(i,j,ishb,ih,ia)   ! Thornton criteria
    113 c              call ishybdo(i,j,ishb,ih,ia) 
     113!              call ishybdo(i,j,ishb,ih,ia) 
    114114
    115115              if (ishb) then
     
    144144      mhb=0
    145145
    146 c     do inhb=1,ntyhb
    147 c      mhb = mhb+nutyhb(inhb)
    148 c     enddo
     146!     do inhb=1,ntyhb
     147!      mhb = mhb+nutyhb(inhb)
     148!     enddo
    149149
    150150      if (ipr.gt.0) write(*,'(1x,a,/)') ' hbond>  Hydrogen Bonds:'
     
    173173              if (n.gt.0) then
    174174                write(*,'(1x,i3,a2,a4,a3,i3,1x,a4,a7,a4,a3,i3,1x,a4,a9,
    175      #                    i2)')
    176      #           ii,') ',nmat(ia),' ( ',na,seq(na),' ) <-- ',nmat(id),
    177      #           ' ( ', nd,seq(nd),' ) = i +',n
     175     &                    i2)')
     176     &           ii,') ',nmat(ia),' ( ',na,seq(na),' ) <-- ',nmat(id),
     177     &           ' ( ', nd,seq(nd),' ) = i +',n
    178178              else
    179179                write(*,'(1x,i3,a2,a4,a3,i3,1x,a4,a7,a4,a3,i3,1x,a4,a9,
    180      #                    i2)')
    181      #           ii,') ',nmat(ia),' ( ',na,seq(na),' ) <-- ',nmat(id),
    182      #           ' ( ', nd,seq(nd),' ) = i -',abs(n)
     180     &                    i2)')
     181     &           ii,') ',nmat(ia),' ( ',na,seq(na),' ) <-- ',nmat(id),
     182     &           ' ( ', nd,seq(nd),' ) = i -',abs(n)
    183183              endif
    184184
     
    192192      return
    193193      end
    194 c .....................................................................
    195 c Calculates hydrogen bonds between different chains.
    196 c
    197 c @return number of intermolecular hydrogen bonds. Returns 0 if only
    198 c         one molecule is present. The value is returned in the
    199 c         variable mhb.
    200 c
    201 c @author Jan H. Meinke <j.meinke@fz-juelich.de>
    202 c                                           
    203 c .....................................................................
     194! .....................................................................
     195! Calculates hydrogen bonds between different chains.
     196!
     197! @return number of intermolecular hydrogen bonds. Returns 0 if only
     198!         one molecule is present. The value is returned in the
     199!         variable mhb.
     200!
     201! @author Jan H. Meinke <j.meinke@fz-juelich.de>
     202!                                           
     203! .....................................................................
    204204      subroutine interhbond(mhb)
    205205
    206206      include 'INCL.H'
    207207     
    208 cf2py intent(out) mhb     
     208!f2py intent(out) mhb     
    209209     
    210210      logical ishb
     
    233233     
    234234      end ! subroutine interhbond
    235 c ************************
     235! ************************
    236236      subroutine chhb(i,j)
    237237
     
    249249
    250250      dah=sqrt((xat(ih)-xat(ia))**2+(yat(ih)-yat(ia))**2+
    251      #          (zat(ih)-zat(ia))**2)
     251     &          (zat(ih)-zat(ia))**2)
    252252
    253253      id=iowat(ih)
    254254
    255255      dad=sqrt((xat(id)-xat(ia))**2+(yat(id)-yat(ia))**2+
    256      #          (zat(id)-zat(ia))**2)
     256     &          (zat(id)-zat(ia))**2)
    257257      adha=valang(id,ih,ia)*crd
    258258
     
    269269      return
    270270      end
    271 c *************************************
     271! *************************************
    272272      subroutine ishybd(i,j,ishb,ih,ia)
    273273     
    274274
    275 c ..........................................................
    276 c  PURPOSE: checks for hydrogen bond between atoms 'i' & 'j'
    277 c           according to geometric criteria
    278 c
    279 c  OUTPUT:  logical 'ishb' - true, if have Hydrogen bond
    280 c           ih - index of Hydrogen atom
    281 c           ia - index of Acceptor atom
    282 c
    283 c  [I.K.McDonald,J.M.Thornton,Satisfying hydrogen bond
    284 c   potential in proteins.J.Mol.Biol.238(5),777-793 (1994)]
    285 c
    286 c  D: hydrogen(=H) donor, A: acceptor, B: atom bound to A
    287 c
    288 c  Dis_HA <= 2.5 & Dis_DA <= 3.9 & Angle(D-H-A) > 90 &
    289 c  Angle(H-A-B) > 90 & Angle(D-A-B) > 90
    290 c ..........................................................
     275! ..........................................................
     276!  PURPOSE: checks for hydrogen bond between atoms 'i' & 'j'
     277!           according to geometric criteria
     278!
     279!  OUTPUT:  logical 'ishb' - true, if have Hydrogen bond
     280!           ih - index of Hydrogen atom
     281!           ia - index of Acceptor atom
     282!
     283!  [I.K.McDonald,J.M.Thornton,Satisfying hydrogen bond
     284!   potential in proteins.J.Mol.Biol.238(5),777-793 (1994)]
     285!
     286!  D: hydrogen(=H) donor, A: acceptor, B: atom bound to A
     287!
     288!  Dis_HA <= 2.5 & Dis_DA <= 3.9 & Angle(D-H-A) > 90 &
     289!  Angle(H-A-B) > 90 & Angle(D-A-B) > 90
     290! ..........................................................
    291291
    292292      include 'INCL.H'
    293293
    294294      parameter (cdad=3.9d0,
    295      #           cdah=2.5d0,
    296      #           cang=110.d0)
    297 c     #           cang=90.d0)
     295     &           cdah=2.5d0,
     296     &           cang=110.d0)
     297!     #           cang=90.d0)
    298298
    299299      logical ishb
     
    318318
    319319      if (sqrt((xat(ih)-xat(ia))**2+(yat(ih)-yat(ia))**2+
    320      #         (zat(ih)-zat(ia))**2).gt.cdah) return
     320     &         (zat(ih)-zat(ia))**2).gt.cdah) return
    321321
    322322      id=iowat(ih)
    323323
    324324      if (id.le.0.or.sqrt((xat(id)-xat(ia))**2+(yat(id)-yat(ia))**2+
    325      #                    (zat(id)-zat(ia))**2).gt.cdad
    326      #           .or.valang(id,ih,ia).lt.cahb) return
     325     &                    (zat(id)-zat(ia))**2).gt.cdad
     326     &           .or.valang(id,ih,ia).lt.cahb) return
    327327
    328328      ib=iowat(ia)
    329329
    330330      if (ib.gt.0.and.valang(ih,ia,ib).ge.cahb
    331      #           .and.valang(id,ia,ib).ge.cahb) ishb=.true.
     331     &           .and.valang(id,ia,ib).ge.cahb) ishb=.true.
    332332
    333333      return
    334334      end
    335 c **************************************
     335! **************************************
    336336
    337337      subroutine ishybdo(i,j,ishb,ih,ia)
    338338
    339 c ..........................................................
    340 c  PURPOSE: checks for hydrogen bond between atoms 'i' & 'j'
    341 c           according to geometric criteria
    342 c
    343 c  OUTPUT:  logical 'ishb' - true, if have Hydrogen bond
    344 c           ih - index of Hydrogen atom
    345 c           ia - index of Acceptor atom
    346 c
    347 c  D: hydrogen(=H) donor, A: acceptor
    348 c
    349 c    Dis_AH <= 2.5 & Angle(D-H-A) >= 160
    350 c ...........................................................
     339! ..........................................................
     340!  PURPOSE: checks for hydrogen bond between atoms 'i' & 'j'
     341!           according to geometric criteria
     342!
     343!  OUTPUT:  logical 'ishb' - true, if have Hydrogen bond
     344!           ih - index of Hydrogen atom
     345!           ia - index of Acceptor atom
     346!
     347!  D: hydrogen(=H) donor, A: acceptor
     348!
     349!    Dis_AH <= 2.5 & Angle(D-H-A) >= 160
     350! ...........................................................
    351351
    352352      include 'INCL.H'
    353353
    354354      parameter (cdah=2.5d0,
    355      #           cang=140.d0)
     355     &           cang=140.d0)
    356356
    357357      logical ishb
     
    377377
    378378      if (sqrt((xat(ih)-xat(ia))**2+(yat(ih)-yat(ia))**2+
    379      #         (zat(ih)-zat(ia))**2).gt.cdah) return
     379     &         (zat(ih)-zat(ia))**2).gt.cdah) return
    380380
    381381      id=iowat(ih)
Note: See TracChangeset for help on using the changeset viewer.