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

    r2ebb8b6 rbd2278d  
    1 c**************************************************************
    2 c
    3 c This file contains the subroutines: setmvs,fndbrn
    4 c
    5 c Copyright 2003-2005  Frank Eisenmenger, U.H.E. Hansmann,
    6 c                      Shura Hayryan, Chin-Ku
    7 c Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
    8 c                      Jan H. Meinke, Sandipan Mohanty
    9 c
    10 c **************************************************************
     1!**************************************************************
     2!
     3! This file contains the subroutines: setmvs,fndbrn
     4!
     5! Copyright 2003-2005  Frank Eisenmenger, U.H.E. Hansmann,
     6!                      Shura Hayryan, Chin-Ku
     7! Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
     8!                      Jan H. Meinke, Sandipan Mohanty
     9!
     10! **************************************************************
    1111
    1212
    1313      subroutine setmvs(nml)
    1414
    15 c ......................................................................
    16 c PURPOSE: 1. ORDER variables according to rules:
    17 c             variables with same base: 1st comes TORSION (can be only
    18 c               one with this base, since PHASE a. assumed to be FIXED),
    19 c               after this, for atoms branching from this base:
    20 c               for a b.angle & b.length with common primary moving
    21 c               atom=branch atom - b.angle comes 1st
    22 c
    23 c             iorvr(i), i=i_fivr_ml,i_lavr_ml -> indices of ordered var.
    24 c
    25 c          2. define NON-OVERLAPPING moving sets of atoms in molecule
    26 c             'nml' related to local variables
    27 c
    28 c             nmsml(i_ml) - number of moving sets per molecule
    29 c             imsvr1(i_vr),imsvr2() - indices of 1st/last m.s for var. 'i_vr'
    30 c                                     in 'latms1' & 'latms2'
    31 c             latms1(i_ms),latms2() - range of atoms of i-th m.s
    32 c
    33 c          3. define indices of next-following variables for each var.,
    34 c             which complete its physical moving set ('added' variables)
    35 c         
    36 c             nadml(i_ml) - number of 'added' var.s per molecule
    37 c             iadvr1(i_vr),iadvr2() - indices of 1st/last 'added' var. for
    38 c                                     var. 'i_vr' in 'ladvr'
    39 c             ladvr() - indices of 'added' variables
    40 c
    41 c          4. define index of corresponding variable for each atom
    42 c
    43 c ! routine must be called successively for molecules 1 -> ntlml
    44 c
    45 c CALLS: fndbrn, nursvr
    46 c ......................................................................
     15! ......................................................................
     16! PURPOSE: 1. ORDER variables according to rules:
     17!             variables with same base: 1st comes TORSION (can be only
     18!               one with this base, since PHASE a. assumed to be FIXED),
     19!               after this, for atoms branching from this base:
     20!               for a b.angle & b.length with common primary moving
     21!               atom=branch atom - b.angle comes 1st
     22!
     23!             iorvr(i), i=i_fivr_ml,i_lavr_ml -> indices of ordered var.
     24!
     25!          2. define NON-OVERLAPPING moving sets of atoms in molecule
     26!             'nml' related to local variables
     27!
     28!             nmsml(i_ml) - number of moving sets per molecule
     29!             imsvr1(i_vr),imsvr2() - indices of 1st/last m.s for var. 'i_vr'
     30!                                     in 'latms1' & 'latms2'
     31!             latms1(i_ms),latms2() - range of atoms of i-th m.s
     32!
     33!          3. define indices of next-following variables for each var.,
     34!             which complete its physical moving set ('added' variables)
     35!         
     36!             nadml(i_ml) - number of 'added' var.s per molecule
     37!             iadvr1(i_vr),iadvr2() - indices of 1st/last 'added' var. for
     38!                                     var. 'i_vr' in 'ladvr'
     39!             ladvr() - indices of 'added' variables
     40!
     41!          4. define index of corresponding variable for each atom
     42!
     43! ! routine must be called successively for molecules 1 -> ntlml
     44!
     45! CALLS: fndbrn, nursvr
     46! ......................................................................
    4747
    4848      include 'INCL.H'
     
    7070      if (ntlvr.eq.0) then
    7171        write (*,'(a,i4)')
    72      #           ' setmvs> No variables defined in molecule #',nml
     72     &           ' setmvs> No variables defined in molecule #',nml
    7373        nmsml(nml)=0
    7474        nadml(nml)=0
    7575        return
    7676      endif
    77 c _________________ Take index of primary atom for each variable
    78 c                   (i.e. index of atom moved by variable) to
    79 c                   sort variables, handling variables with same base:
    80 c                   modify indices to obtain appropriate order
     77! _________________ Take index of primary atom for each variable
     78!                   (i.e. index of atom moved by variable) to
     79!                   sort variables, handling variables with same base:
     80!                   modify indices to obtain appropriate order
    8181
    8282      ifirs=irsml1(nml)
     
    108108        enddo  ! ... Variables
    109109      enddo  ! ... Residues
    110 c ___________________________________ Sort variables in ascending order
    111 c                        (i.e. from start of molecule/base of branches)
    112 c array 'iorvr' gives indices of (1st,2nd, ... ,n-th) variables;
    113 c as can be found in arrays for variables (example: ityvr(iorvr())
     110! ___________________________________ Sort variables in ascending order
     111!                        (i.e. from start of molecule/base of branches)
     112! array 'iorvr' gives indices of (1st,2nd, ... ,n-th) variables;
     113! as can be found in arrays for variables (example: ityvr(iorvr())
    114114      k=ilavr
    115115      l=ifivr+ntlvr/2
     
    143143      iorvr(i)=io
    144144      goto 1
    145 c ______________________________ Find non-overlapping ranges of atoms (moving
    146 c                                sets) for each variable
     145! ______________________________ Find non-overlapping ranges of atoms (moving
     146!                                sets) for each variable
    147147   2  nms=imsml1(nml)-1
    148148
     
    152152        ia=iatvr(iv)      ! primary mov. atom
    153153        ib=iowat(ia)      ! base
    154 c __________________________ First, determine complete mov. set for 'iv'
     154! __________________________ First, determine complete mov. set for 'iv'
    155155        it=ityvr(iv)
    156156        if (it.eq.3) then       ! torsion
     
    164164                if (j.gt.(i2+1).or.k.lt.(i1-1)) then
    165165                  write (*,'(3a,/,2a,i4,a,i3)')
    166      #             ' setmvs> Cannot combine disjunct ranges of atom',
    167      #             ' indices for torsion ',nmvr(iv),' in residue ',
    168      #             seq(ir),ir,' of molecule # ',nml
     166     &             ' setmvs> Cannot combine disjunct ranges of atom',
     167     &             ' indices for torsion ',nmvr(iv),' in residue ',
     168     &             seq(ir),ir,' of molecule # ',nml
    169169                  stop
    170170                else
     
    186186        if ((nms+1).gt.mxms) then
    187187          write (*,'(a,i4,a,i5)') ' setmvs> Molecule # ',nml,
    188      #    ': Number of moving sets > ',mxms
     188     &    ': Number of moving sets > ',mxms
    189189          stop
    190190        endif
     
    193193        imsvr2(iv)=nms+1  !        & last m.s for var. 'iv'
    194194
    195 c ______________ Next, exclude overlaps between mov. set for 'iv' and the
    196 c                m.s. for 'previous' variables by reducing/splitting those
     195! ______________ Next, exclude overlaps between mov. set for 'iv' and the
     196!                m.s. for 'previous' variables by reducing/splitting those
    197197
    198198        do jo=ifivr,io-1  ! prev. variables ...
     
    219219                  if (nms.gt.mxms) then
    220220                    write (*,'(a,i4,a,i5)') ' setmvs> Molecule # ',
    221      #               nml,': Number of moving sets > ',mxms
     221     &               nml,': Number of moving sets > ',mxms
    222222                     stop
    223223                  endif
     
    259259
    260260        enddo  ! prev. variables
    261 c _______________________________ Finally, add moving set for 'iv'
     261! _______________________________ Finally, add moving set for 'iv'
    262262        nms=nms+1
    263263        latms1(nms)=i1
     
    265265      enddo  ! variables
    266266      nmsml(nml)=nms-imsml1(nml)+1
    267 c _____________________________ Determine index of moving set for each atom
     267! _____________________________ Determine index of moving set for each atom
    268268      do ia=ifiat,ilaat
    269269        ixmsat(ia)=0
     
    274274        enddo
    275275      enddo
    276 c _____________________________ Determine indices of variables which moving
    277 c                               set sets have to be added (=are related) to
    278 c                               those of a given variable
     276! _____________________________ Determine indices of variables which moving
     277!                               set sets have to be added (=are related) to
     278!                               those of a given variable
    279279
    280280      i=iorvr(ifivr)  ! initialize index of CURRENT var.
     
    300300          jb=iowat(ja)       ! its base
    301301
    302 c _______________ current var. is torsion & shares base with var. 'j'
     302! _______________ current var. is torsion & shares base with var. 'j'
    303303          if (it.eq.3.and.jb.eq.ib) then
    304304            do k=n,nad  !  ? has this branch been registered before ?
     
    308308            if (nad.gt.mxvr) then
    309309              write (*,'(a,i4,a,i5)') ' setmvs> Molecule # ',nml,
    310      #                         ': Number of added variables > ',mxvr
     310     &                         ': Number of added variables > ',mxvr
    311311              stop
    312312            endif
     
    323323                if (nad.gt.mxvr) then
    324324                  write (*,'(a,i4,a,i5)') ' setmvs> Molecule # ',nml,
    325      #                         ': Number of added variables > ',mxvr
     325     &                         ': Number of added variables > ',mxvr
    326326                  stop
    327327                endif
     
    337337              if (nad.gt.mxvr) then
    338338                write (*,'(a,i4,a,i5)') ' setmvs> Molecule # ',nml,
    339      #                       ': Number of added variables > ',mxvr
     339     &                       ': Number of added variables > ',mxvr
    340340                stop
    341341              endif
     
    351351
    352352      nadml(nml)=nad-iadml1(nml)+1
    353 c _____________________________________ Summary
    354 c      do io=ilavr,ifivr,-1
    355 c        iv=iorvr(io)
    356 c        ib=iowat(iatvr(iv))
    357 c        i1s=imsvr1(iv)
    358 c        i2s=imsvr2(iv)
    359 c        if (i1s.le.i2s) then
    360 c          do i=i1s,i2s
    361 c            i1=latms1(i)
    362 c            i2=latms2(i)
    363 c            if (i.eq.i1s) then
    364 c              write (*,'(a,i3,7a,i4,3a,i4,a)') 'res # ',nursvr(iv),
    365 c     #        ' var: ',nmvr(iv),' base:',nmat(ib),'    atoms= ',
    366 c     #        nmat(i1),'(',i1,') - ',nmat(i2),'(',i2,')'
    367 c            else
    368 c              write (*,'(39x,2a,i4,3a,i4,a)')
    369 c     #        nmat(i1),'(',i1,') - ',nmat(i2),'(',i2,')'
    370 c            endif
    371 c          enddo
    372 c        else
    373 c          write (*,'(a,i3,5a)') 'res # ',nursvr(iv),
    374 c     #    ' var: ',nmvr(iv),' base:',nmat(ib),'  No atoms'
    375 c        endif
    376 c        i1a=iadvr1(iv)
    377 c        i2a=iadvr2(iv)
    378 c        if (i1a.le.i2a) then
    379 c          write (*,'(a,30(1x,a))') ' Depending variables:',
    380 c     #                    (nmvr(ladvr(i)),i=i1a,i2a)
    381 c        else
    382 c          write (*,'(a)') ' No dep. variables'
    383 c        endif
    384 c      enddo
    385 c _____________________________________ Summary - End
     353! _____________________________________ Summary
     354!      do io=ilavr,ifivr,-1
     355!        iv=iorvr(io)
     356!        ib=iowat(iatvr(iv))
     357!        i1s=imsvr1(iv)
     358!        i2s=imsvr2(iv)
     359!        if (i1s.le.i2s) then
     360!          do i=i1s,i2s
     361!            i1=latms1(i)
     362!            i2=latms2(i)
     363!            if (i.eq.i1s) then
     364!              write (*,'(a,i3,7a,i4,3a,i4,a)') 'res # ',nursvr(iv),
     365!     #        ' var: ',nmvr(iv),' base:',nmat(ib),'    atoms= ',
     366!     #        nmat(i1),'(',i1,') - ',nmat(i2),'(',i2,')'
     367!            else
     368!              write (*,'(39x,2a,i4,3a,i4,a)')
     369!     #        nmat(i1),'(',i1,') - ',nmat(i2),'(',i2,')'
     370!            endif
     371!          enddo
     372!        else
     373!          write (*,'(a,i3,5a)') 'res # ',nursvr(iv),
     374!     #    ' var: ',nmvr(iv),' base:',nmat(ib),'  No atoms'
     375!        endif
     376!        i1a=iadvr1(iv)
     377!        i2a=iadvr2(iv)
     378!        if (i1a.le.i2a) then
     379!          write (*,'(a,30(1x,a))') ' Depending variables:',
     380!     #                    (nmvr(ladvr(i)),i=i1a,i2a)
     381!        else
     382!          write (*,'(a)') ' No dep. variables'
     383!        endif
     384!      enddo
     385! _____________________________________ Summary - End
    386386 
    387387      return
    388388
    389389    6 write (*,'(a,i4,/,2(a,i5),a)')
    390      # ' setmvs> Error in atom numbering of molecule # ',nml,
    391      # ': atom ranges for variables # ',iv,' and # ',jv,
    392      # ' overlap only PARTLY'
     390     & ' setmvs> Error in atom numbering of molecule # ',nml,
     391     & ': atom ranges for variables # ',iv,' and # ',jv,
     392     & ' overlap only PARTLY'
    393393      stop
    394394
    395395      end
    396 c *******************************************************
     396! *******************************************************
    397397      subroutine fndbrn(nml,nrs,ifirg,ilarg,irg1,irg2,bb)
    398398
    399 c .........................................................
    400 c PURPOSE: determine range [ifirg,ilarg] of atom indices
    401 c          for branch starting from atom 'ifirg' of residue
    402 c          'nrs' in molecule 'nml'
    403 c OUTPUT:  BB          - .t. if 'ifirg' is a backbone atom
    404 c          IRG1 & IRG2 - atom indices of ring-closing bond,
    405 c                        if 'ifirg' is INSIDE a ring, but NOT
    406 c                        its 1st atom ( in 'multiple' rings
    407 c                        only LAST closing bond is given !)
    408 c
    409 c CALLS: none
    410 c
    411 c .........................................................
     399! .........................................................
     400! PURPOSE: determine range [ifirg,ilarg] of atom indices
     401!          for branch starting from atom 'ifirg' of residue
     402!          'nrs' in molecule 'nml'
     403! OUTPUT:  BB          - .t. if 'ifirg' is a backbone atom
     404!          IRG1 & IRG2 - atom indices of ring-closing bond,
     405!                        if 'ifirg' is INSIDE a ring, but NOT
     406!                        its 1st atom ( in 'multiple' rings
     407!                        only LAST closing bond is given !)
     408!
     409! CALLS: none
     410!
     411! .........................................................
    412412
    413413      include 'INCL.H'
Note: See TracChangeset for help on using the changeset viewer.