Changeset bd2278d for getmol.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
  • getmol.f

    r2ebb8b6 rbd2278d  
    1 c **************************
    2 c **************************************************************
    3 c
    4 c This file contains the subroutines: getmol,redres
    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!
     4! This file contains the subroutines: getmol,redres
     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 getmol(nml)
    1515
    16 c ...................................................................
    17 c PURPOSE:  assemble data for molecule 'nml' according to
    18 c           its sequence using residue library 'reslib'
    19 c
    20 c ! Molecules must be assembled in sequential order (1 -> ntlml)
    21 c            (or number of atoms & variables must remain the same)
    22 c
    23 c INPUT:    irsml1(nml),irsml2(nml),seq(irsml1()...irsml2())
    24 c           nml>1: irsml1(nml-1),iatrs2(irsml2(nml-1))
    25 c                  ivrrs1(irsml2(nml-1)),nvrrs(irsml2(nml-1))
    26 c
    27 c OUTPUT:   molecule  - ivrml1,nvrml
    28 c           residues  - iatrs1,ixatrs,iatrs2,ivrrs1,nvrrs
    29 c           atoms     - nmat,ityat,cgat,blat,baat,csbaat,snbaat,
    30 c                       toat,cstoat,sntoat
    31 c           bonds     - nbdat,iowat,iyowat,ibdat(1-mxbd,),iybdat(1-mxbd,)
    32 c                       ! 1st atom of 'nml': iowat indicates 1st bond
    33 c                          to a FOLLOWING atom (not previous) !
    34 c           variables - ityvr,iclvr,iatvr,nmvr
    35 c                                   
    36 c CALLS:    iopfil,redres,iendst
    37 c ...................................................................
     16! ...................................................................
     17! PURPOSE:  assemble data for molecule 'nml' according to
     18!           its sequence using residue library 'reslib'
     19!
     20! ! Molecules must be assembled in sequential order (1 -> ntlml)
     21!            (or number of atoms & variables must remain the same)
     22!
     23! INPUT:    irsml1(nml),irsml2(nml),seq(irsml1()...irsml2())
     24!           nml>1: irsml1(nml-1),iatrs2(irsml2(nml-1))
     25!                  ivrrs1(irsml2(nml-1)),nvrrs(irsml2(nml-1))
     26!
     27! OUTPUT:   molecule  - ivrml1,nvrml
     28!           residues  - iatrs1,ixatrs,iatrs2,ivrrs1,nvrrs
     29!           atoms     - nmat,ityat,cgat,blat,baat,csbaat,snbaat,
     30!                       toat,cstoat,sntoat
     31!           bonds     - nbdat,iowat,iyowat,ibdat(1-mxbd,),iybdat(1-mxbd,)
     32!                       ! 1st atom of 'nml': iowat indicates 1st bond
     33!                          to a FOLLOWING atom (not previous) !
     34!           variables - ityvr,iclvr,iatvr,nmvr
     35!                                   
     36! CALLS:    iopfil,redres,iendst
     37! ...................................................................
    3838
    3939      include 'INCL.H'
     
    4343      if (iopfil(lunlib,reslib,'old','formatted').le.izero) then
    4444        write (*,'(a,/,a,i3,2a)')
    45      #    ' getmol> ERROR opening library of residues:',
    46      #    ' LUN=',lunlib,' FILE=',reslib(1:iendst(reslib))
     45     &    ' getmol> ERROR opening library of residues:',
     46     &    ' LUN=',lunlib,' FILE=',reslib(1:iendst(reslib))
    4747        stop
    4848      endif
     
    6868        if (res(:3).eq.'nme'.and.nrs.ne.ilars) then
    6969          write (*,'(3a)') ' getmol> residue >',res,
    70      #                     '< allowed at C-terminus only !'
     70     &                     '< allowed at C-terminus only !'
    7171          close(lunlib)
    7272          stop
    7373        elseif (res(:3).eq.'ace'.and.nrs.ne.ifirs) then
    7474          write (*,'(3a)') ' getmol> residue >',res,
    75      #                     '< allowed at N-terminus only !'
     75     &                     '< allowed at N-terminus only !'
    7676          close(lunlib)
    7777          stop
     
    9393        rewind lunlib
    9494
    95 c ___________________________________________________________ Atoms
     95! ___________________________________________________________ Atoms
    9696        do i=1,nat
    9797          n=i+ntlat
     
    108108          cstoat(n)=cos(to)
    109109          sntoat(n)=sin(to)
    110 c ______________________________ bonds to previous & following atoms
     110! ______________________________ bonds to previous & following atoms
    111111          iow=iowath(i)
    112112          if (iow.eq.0) then          ! 1st atom of residue
     
    129129              iyowat(n)=1         !!! only single bonds assumed !!!
    130130
    131 c ___________________________ correct atom to 'next' res.
     131! ___________________________ correct atom to 'next' res.
    132132              nbd=nbdat(nh)
    133133              if (nbd.eq.mxbd) then
    134134                write(*,'(a,i2,a,i4,2a,i4,a)')
    135      #           ' getmol> need ',(mxbd+2),
    136      #           'th bond to connect residues ',
    137      #           nrs-1,seq(nrs-1),' and ',nrs,seq(nrs)
     135     &           ' getmol> need ',(mxbd+2),
     136     &           'th bond to connect residues ',
     137     &           nrs-1,seq(nrs-1),' and ',nrs,seq(nrs)
    138138                close(lunlib)
    139139                stop
    140140              else  !  correct atom to 'next' res.
    141 c _______________________________!! dihedrals for atoms bound to 'nh'
    142 c                                   are assumed to be phase angles !!
     141! _______________________________!! dihedrals for atoms bound to 'nh'
     142!                                   are assumed to be phase angles !!
    143143                do j=1,nbd
    144144
     
    148148                  if (t.eq.0.0) then
    149149                    write (*,'(3a,/,2a)')
    150      #               ' getmol> DIHEDRAL for atom ',nmat(nj),
    151      #               ' should be PHASE angle with respect to atom ',
    152      #               nmat(n),' & therefore must be not 0.0 !!'
     150     &               ' getmol> DIHEDRAL for atom ',nmat(nj),
     151     &               ' should be PHASE angle with respect to atom ',
     152     &               nmat(n),' & therefore must be not 0.0 !!'
    153153                    close(lunlib)
    154154                    stop
     
    197197        enddo  ! ... atoms
    198198
    199 c ________________________________________________________ Variables
     199! ________________________________________________________ Variables
    200200        ivrrs1(nrs)=ntlvr+1
    201201        mvr=0
     
    206206
    207207            iat=iatvrh(i)
    208 c ____________________________________ Exclude all variables for 1st atom
    209 c                                       & torsion for atoms bound to it
     208! ____________________________________ Exclude all variables for 1st atom
     209!                                       & torsion for atoms bound to it
    210210            if ( iat.eq.1.or.
    211      #        (iowath(iat).eq.1.and.ityvrh(i).eq.3)) goto 1
     211     &        (iowath(iat).eq.1.and.ityvrh(i).eq.3)) goto 1
    212212
    213213          endif
     
    233233      close(lunlib)
    234234
    235 c _______________________________ Variables
     235! _______________________________ Variables
    236236      if (nml.eq.1) then
    237237        nvrml(nml)=ntlvr
     
    242242      return
    243243      end
    244 c **************************************
     244! **************************************
    245245      subroutine redres(res,nat,nxt,nvrr)
    246246
    247 c .......................................................
    248 c PURPOSE:  read atom data for residue 'res' from library
    249 c           (file 'lunlib' 'reslib' opened in routine calling
    250 c            this one)
    251 c
    252 c OUTPUT:   nat   - number of atoms in residue
    253 c           nxt   - atom which may bind to following residue
    254 c           nvrr  - number of variables in residue
    255 c           for atoms     - nmath,blath,baath(rad),toath(rad),
    256 c                           ityath,iyowath,iowath (INSIDE residue,
    257 c                                                  =0 if 1st atom)
    258 c           for variables - ityvrh (1=bl/2=ba/3=to),iclvrh,iatvrh,nmvrh
    259 c
    260 c LIBRARY:  residue-lines:
    261 c            '#', res, nat, nxt;  Format: a1,a4,2i4
    262 c           atom-lines:
    263 c           nmat,3{"fix" =' ', clvr,nmvr, blat/baat(deg)/toat(deg)},
    264 c             cgat, ityat, iowat,ibdat1,ibdat2,ibdat3;
    265 c           Format: a4, 3(1x,i2,a1,a3,f9.3), f7.4, i4,4i4
    266 c
    267 C CALLS: iendst,tolost
    268 c
    269 c .......................................................
     247! .......................................................
     248! PURPOSE:  read atom data for residue 'res' from library
     249!           (file 'lunlib' 'reslib' opened in routine calling
     250!            this one)
     251!
     252! OUTPUT:   nat   - number of atoms in residue
     253!           nxt   - atom which may bind to following residue
     254!           nvrr  - number of variables in residue
     255!           for atoms     - nmath,blath,baath(rad),toath(rad),
     256!                           ityath,iyowath,iowath (INSIDE residue,
     257!                                                  =0 if 1st atom)
     258!           for variables - ityvrh (1=bl/2=ba/3=to),iclvrh,iatvrh,nmvrh
     259!
     260! LIBRARY:  residue-lines:
     261!            '#', res, nat, nxt;  Format: a1,a4,2i4
     262!           atom-lines:
     263!           nmat,3{"fix" =' ', clvr,nmvr, blat/baat(deg)/toat(deg)},
     264!             cgat, ityat, iowat,ibdat1,ibdat2,ibdat3;
     265!           Format: a4, 3(1x,i2,a1,a3,f9.3), f7.4, i4,4i4
     266!
     267! CALLS: iendst,tolost
     268!
     269! .......................................................
    270270
    271271      include 'INCL.H'
     
    285285      call tolost(resl)  ! ensure lower case for residue name
    286286
    287 c ________________________________ find residue 'resl'
     287! ________________________________ find residue 'resl'
    288288    1 line=blnk
    289289      nln=nln+1
     
    293293
    294294      if (lg.ge.13.and.line(1:1).eq.'#'.and.line(2:5).eq.resl) then
    295 c _____________________________________________ read atom data for 'resl'
     295! _____________________________________________ read atom data for 'resl'
    296296        read (line(6:13),'(2i4)',err=3) nat,nxt
    297297
     
    308308
    309309          read (lunlib,'(a4,3(1x,i2,a1,a3,d9.3),d7.4,i4,4i4)',
    310      #                 end=3,err=3)
    311      #     nmath(i),icl(1),fix(1),nm(1),blath(i),icl(2),fix(2),nm(2),ba,
    312      #     icl(3),fix(3),nm(3),to,cgath(i),ity,iow,(ibd(j),j=1,mxbd)
     310     &                 end=3,err=3)
     311     &     nmath(i),icl(1),fix(1),nm(1),blath(i),icl(2),fix(2),nm(2),ba,
     312     &     icl(3),fix(3),nm(3),to,cgath(i),ity,iow,(ibd(j),j=1,mxbd)
    313313
    314314          if (ity.le.0.or.ity.gt.mxtyat) goto 6
     
    326326            if (i.eq.jow) then
    327327              write (*,'(5a)') ' redres> atom ',nmath(i),' of ',
    328      #                          resl,' cannot preceed itself '
     328     &                          resl,' cannot preceed itself '
    329329            else
    330330              write (*,'(5a,i4)') ' redres> atom ',nmath(i),' of ',
    331      #                    resl,' should be placed AFTER atom #',jow
     331     &                    resl,' should be placed AFTER atom #',jow
    332332            endif
    333333            goto 5
     
    336336          iowath(i)=jow
    337337          iyowath(i)=sign(1,iow)
    338 c ____________________________________ check order & find number of bonds
    339 c                                      (bonds closing ring must be last !)
     338! ____________________________________ check order & find number of bonds
     339!                                      (bonds closing ring must be last !)
    340340          ib1=abs(ibd(1))
    341341          ib2=abs(ibd(2))
     
    354354            else
    355355              if ( ib2.eq.jow.or.ib2.eq.ib1.or.
    356      #            (ib2.gt.i.and.ib2.lt.ib1) ) goto 4
     356     &            (ib2.gt.i.and.ib2.lt.ib1) ) goto 4
    357357              if (ib3.eq.0) then
    358358                nbdath(i)=2
    359359              else
    360360                if (ib3.eq.jow.or.ib3.eq.ib1.or.ib3.eq.ib2.or.
    361      #              (ib3.gt.i.and.(ib3.lt.ib1.or.ib3.lt.ib2)) ) goto 4
     361     &              (ib3.gt.i.and.(ib3.lt.ib1.or.ib3.lt.ib2)) ) goto 4
    362362                nbdath(i)=3
    363363              endif
     
    373373          toath(i)=to*cdr
    374374
    375 c ______________________________ internal degrees of freedom
     375! ______________________________ internal degrees of freedom
    376376          do j=1,3
    377377            if (fix(j).ne.blnk) then
     
    380380              if (nvrr.gt.mxvrh) then
    381381                write (*,'(a,i5)') ' redres> number of variables > ',
    382      #                             mxvrh
     382     &                             mxvrh
    383383                close(lunlib)
    384384                stop
     
    388388
    389389              if ( ic.le.0   
    390      #         .or.(j.eq.3.and.ic.gt.mxtyto)           ! dihedral
    391      #         .or.(j.eq.2.and.ic.gt.mxtyba)           ! bond angle
    392      #         .or.(j.eq.1.and.ic.gt.mxtybl) ) goto 7  ! b. length
     390     &         .or.(j.eq.3.and.ic.gt.mxtyto)           ! dihedral
     391     &         .or.(j.eq.2.and.ic.gt.mxtyba)           ! bond angle
     392     &         .or.(j.eq.1.and.ic.gt.mxtybl) ) goto 7  ! b. length
    393393
    394394              ityvrh(nvrr)=j
     
    407407      goto 1
    408408
    409 c ____________________________________________________________ ERRORS
     409! ____________________________________________________________ ERRORS
    410410    2 write (*,'(4a)') ' redres> residue >',resl,'< NOT FOUND in ',
    411      #reslib(1:iendst(reslib))
     411     &reslib(1:iendst(reslib))
    412412      close(lunlib)
    413413      stop
    414414
    415415    3 write (*,'(a,i4,2a)') ' redres> ERROR reading line No. ',nln,
    416      #' in ',reslib(1:iendst(reslib))
     416     &' in ',reslib(1:iendst(reslib))
    417417      close(lunlib)
    418418      stop
    419419
    420420    4 write (*,'(4a)') ' redres> Incorrect order of bonds for atom ',
    421      #                      nmath(i),' of ',resl
     421     &                      nmath(i),' of ',resl
    422422
    423423    5 write (*,'(8x,2a)') '... must correct ',
    424      #                      reslib(1:iendst(reslib))
     424     &                      reslib(1:iendst(reslib))
    425425      close(lunlib)
    426426      stop
    427427
    428428    6 write (*,'(a,i2,4a)') ' redres> unknown type :',ity,
    429      #                   ': for atom ',nmath(i),' in residue ',resl
     429     &                   ': for atom ',nmath(i),' in residue ',resl
    430430      close(lunlib)
    431431      stop
    432432
    433433    7 write (*,'(a,i2,4a)') ' redres> unknown class :',ic,
    434      #                   ': for variable ',nm(j),' in residue ',resl
     434     &                   ': for variable ',nm(j),' in residue ',resl
    435435      close(lunlib)
    436436      stop
Note: See TracChangeset for help on using the changeset viewer.