Changeset bd2278d


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

Files:
1 added
62 edited

Legend:

Unmodified
Added
Removed
  • EXAMPLES/parallel_tempering_s.f

    r2ebb8b6 rbd2278d  
    2020      integer switch
    2121
    22 c =================================================== Energy setup
     22! =================================================== Energy setup
    2323
    24 c            Directory for SMMP libraries
    25 c     Change the following directory path to where you want to put SMMP
    26 c     libraries of residues.
     24!            Directory for SMMP libraries
     25!     Change the following directory path to where you want to put SMMP
     26!     libraries of residues.
    2727      libdir='../SMMP/'
    2828
    29 c      The switch in the following line is now not used.
     29!      The switch in the following line is now not used.
    3030      flex=.false.        ! .true. for Flex  / .false. for ECEPP
    3131
    32 c     Choose energy type with the following switch instead ...
     32!     Choose energy type with the following switch instead ...
    3333      ientyp = 0
    34 c        0  => ECEPP2 or ECEPP3 depending on the value of sh2
    35 c        1  => FLEX
    36 c        2  => Lund force field
    37 c        3  => ECEPP with Abagyan corrections
    38 c
     34!        0  => ECEPP2 or ECEPP3 depending on the value of sh2
     35!        1  => FLEX
     36!        2  => Lund force field
     37!        3  => ECEPP with Abagyan corrections
     38!
    3939
    4040      sh2=.false.         ! .true. for ECEPP/2; .false. for ECEPP3
     
    4848      call init_energy(libdir)
    4949
    50 c ================================================= Structure setup
     50! ================================================= Structure setup
    5151
    5252      grpn = 'nh2' ! N-terminal group
     
    5959      ntlml = 0
    6060      write (*,*) 'Solvent: ', itysol
    61 c     Initialize random number generator.
     61!     Initialize random number generator.
    6262      call sgrnd(31433)
    6363     
     
    6969
    7070      call init_molecule(iabin,grpn,grpc,seqfile,varfile)
    71 c Decide if and when to use BGS, and initialize Lund data structures
     71! Decide if and when to use BGS, and initialize Lund data structures
    7272      bgsprob=0.75   ! Prob for BGS, given that it is possible
    73 c upchswitch= 0 => No BGS 1 => BGS with probability bgsprob
    74 c 2 => temperature dependent choice
     73! upchswitch= 0 => No BGS 1 => BGS with probability bgsprob
     74! 2 => temperature dependent choice
    7575      upchswitch=1
    7676      rndord=.true.
     
    8080     
    8181
    82 c ========================================  Add your task down here
     82! ========================================  Add your task down here
    8383      num_rep = 5
    8484      nequi = 100
     
    8787      newsta = .true.
    8888      switch = 1
    89 c     parallel tempering on a single CPU
     89!     parallel tempering on a single CPU
    9090      eol = energy()
    9191      write (*,*) "Energy before randomization:", eol
     
    9494      write (*,*) "Final energy:", eol
    9595
    96 c ========================================  End of main     
     96! ========================================  End of main     
    9797       end
  • EXAMPLES/partem_p.f

    r2ebb8b6 rbd2278d  
    1 c**************************************************************
    2 c     
    3 c This file contains the subroutines: partem_p
    4 C Compared to the version in the main distribution, this
    5 C routine doesn't write the rmsd nor native contacts to the time
    6 C series.
    7 c     
    8 c Copyright 2003-2005  Frank Eisenmenger, U.H.E. Hansmann,
    9 c                      Shura Hayryan, Chin-Ku Hu
    10 c Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
    11 c                      Jan H. Meinke, Sandipan Mohanty
    12 c     
    13 c     **************************************************************
     1!**************************************************************
     2!     
     3! This file contains the subroutines: partem_p
     4! Compared to the version in the main distribution, this
     5! routine doesn't write the rmsd nor native contacts to the time
     6! series.
     7!     
     8! Copyright 2003-2005  Frank Eisenmenger, U.H.E. Hansmann,
     9!                      Shura Hayryan, Chin-Ku Hu
     10! Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
     11!                      Jan H. Meinke, Sandipan Mohanty
     12!     
     13!     **************************************************************
    1414
    1515      subroutine  partem_p(num_rep, nequi, nswp, nmes, nsave, newsta,
    1616     &                     switch, rep_id, partem_comm)
    17 C     
    18 C     PURPOSE: SIMULATION OF PROTEINS BY PARALLEL TEMPERING ALGORITHM
    19 C     ON PARALLEL COMPUTERS USING MPI
    20 C     
    21 C     switch: Choses the starting configuration:
    22 C     -1 - stretched configuration
    23 C     0 - don't change anything
    24 C     1 - random start configuration
    25 C     
    26 c     CALLS:  addang,contacts,energy,hbond,helix,iendst,metropolis,
    27 c     outvar,(rand),rgyr
    28 C     
     17!     
     18!     PURPOSE: SIMULATION OF PROTEINS BY PARALLEL TEMPERING ALGORITHM
     19!     ON PARALLEL COMPUTERS USING MPI
     20!     
     21!     switch: Choses the starting configuration:
     22!     -1 - stretched configuration
     23!     0 - don't change anything
     24!     1 - random start configuration
     25!     
     26!     CALLS:  addang,contacts,energy,hbond,helix,iendst,metropolis,
     27!     outvar,(rand),rgyr
     28!     
    2929      include '../INCL.H'
    3030      include '../INCP.H'
     
    3737      external can_weight
    3838
    39 C     nequi:  number of Monte Carlo sweeps for thermalization
    40 C     nswp:   number of Monte Carlo sweeps
    41 C     nmes:   number of Monte Carlo sweeps between measurments
    42 C     newsta: .true. for new simulations, .false. for re-start
     39!     nequi:  number of Monte Carlo sweeps for thermalization
     40!     nswp:   number of Monte Carlo sweeps
     41!     nmes:   number of Monte Carlo sweeps between measurments
     42!     newsta: .true. for new simulations, .false. for re-start
    4343
    4444      dimension  eavm(MAX_PROC),sph(MAX_PROC),intem(MAX_PROC),
     
    5050      double precision    e_min, e_minp(MAX_PROC), e_minpt(MAX_PROC)
    5151      integer   h_max, h_maxp(MAX_PROC)
    52 c     Order of replica exchange
     52!     Order of replica exchange
    5353      integer   odd
    5454!     Counter to keep random number generators in sync
    5555      integer randomCount
    5656     
    57 c     Collect partial energies. Only the root writes to disk. We have to
    58 c     collect the information from the different replicas and provide
    59 c     arrays to store them.
    60 c     eyslr    storage array for solvent energy
    61 c     eyelp     -      "        - coulomb energy
    62 c     eyvwp     -      "        - van-der-Waals energy
    63 c     eyhbp     -      "        - hydrogen bonding energy
    64 c     eysmi    -      "        - intermolecular interaction energy
     57!     Collect partial energies. Only the root writes to disk. We have to
     58!     collect the information from the different replicas and provide
     59!     arrays to store them.
     60!     eyslr    storage array for solvent energy
     61!     eyelp     -      "        - coulomb energy
     62!     eyvwp     -      "        - van-der-Waals energy
     63!     eyhbp     -      "        - hydrogen bonding energy
     64!     eysmi    -      "        - intermolecular interaction energy
    6565      double precision eyslr(MAX_PROC)
    6666      double precision eyelp(MAX_PROC),eyvwp(MAX_PROC),eyhbp(MAX_PROC),
    6767     &     eyvrp(MAX_PROC),eysmip(MAX_PROC)
    68 c     Collect information about accessible surface and van-der-Waals volume
    69 c     asap      storage array for solvent accessible surface
    70 c     vdvolp     storage array for van-der-Waals volume
     68!     Collect information about accessible surface and van-der-Waals volume
     69!     asap      storage array for solvent accessible surface
     70!     vdvolp     storage array for van-der-Waals volume
    7171      double precision asap(MAX_PROC), vdvolp(MAX_PROC)
    7272
     
    7575      integer imhbp(MAX_PROC)
    7676      character*80 filebase, fileNameMP, tbase0,tbase1
    77 c     frame     frame number for writing configurations
    78 c     trackID   configuration that should be tracked and written out
    79 c     dir          direction in random walk
    80 c     -1 - visited highest temperature last
    81 c     1 - visited lowest temperature last
    82 c     0 - haven't visited the boundaries yet.
    83 c     dirp      storage array for directions.
     77!     frame     frame number for writing configurations
     78!     trackID   configuration that should be tracked and written out
     79!     dir          direction in random walk
     80!     -1 - visited highest temperature last
     81!     1 - visited lowest temperature last
     82!     0 - haven't visited the boundaries yet.
     83!     dirp      storage array for directions.
    8484      integer frame, trackID, dir
    8585      integer dirp(MAX_PROC)
     
    9292     &            rep_id, num_rep, partem_comm, myrank
    9393      call flush(6)
    94 C     
    95 c     
    96 C     File with temperatures
     94!     
     95!     
     96!     File with temperatures
    9797      open(11,file='temperatures_abeta',status='old')
    9898     
     
    100100      open(18,file=fileNameMP(tbase0,5,9,rep_id),status='unknown')
    101101      if (rep_id.eq.0.and.myrank.eq.0) then
    102 c     File with time series of simulation
     102!     File with time series of simulation
    103103         open(14,file='ts.d',status='unknown')
    104104      endif
    105105     
    106 C     READ IN TEMPERATURES
     106!     READ IN TEMPERATURES
    107107      do i=1,num_rep
    108108         read(11,*) j,temp
     
    111111      close(11)
    112112
    113 c     nresi:  number of residues
     113!     nresi:  number of residues
    114114      nresi=irsml2(1)-irsml1(1)+1
    115 C     
    116 C     Initialize variables
     115!     
     116!     Initialize variables
    117117      do i=1,num_rep     
    118118         acx1(i) = 0.0d0
     
    132132      dir = dirp(rep_id + 1)
    133133
    134 c     _________________________________ Initialize Variables
     134!     _________________________________ Initialize Variables
    135135      if(newsta) then
    136136         iold=0
     
    139139            intem(i) = i
    140140         end do
    141 c     _________________________________ initialize starting configuration
     141!     _________________________________ initialize starting configuration
    142142         if (switch.ne.0) then
    143143            do i=1,nvr
     
    173173         CALL MPI_BCAST(INODE,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD,IERR)
    174174         CALL MPI_BCAST(YOL,num_rep,MPI_DOUBLE_PRECISION,0,
    175      #        MPI_COMM_WORLD,IERR)
     175     &        MPI_COMM_WORLD,IERR)
    176176         CALL MPI_BCAST(E_MINP, num_rep, MPI_DOUBLE_PRECISION, 0,
    177      #        MPI_COMM_WORLD, IERR)
     177     &        MPI_COMM_WORLD, IERR)
    178178         CALL MPI_BCAST(h_maxp,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD,
    179      $        IERR)
     179     &        IERR)
    180180      end if
    181181     
     
    189189         write(*,*) rep_id, yol(rep_id + 1), eol
    190190      endif
    191 C     Start of simulation
     191!     Start of simulation
    192192      write (*,*) '[',rep_id, myrank, beta, partem_comm,
    193193     &            '] Energy before equilibration:', eol
    194 c     =====================Equilibration by canonical Metropolis
     194!     =====================Equilibration by canonical Metropolis
    195195      do nsw=1,nequi
    196196         call metropolis(eol,acz,can_weight)
     
    199199      write (*,*) '[',rep_id,'] Energy after equilibration:', eol
    200200      call flush(6)
    201 C     
    202 C======================Multiple Markov Chains
     201!     
     202!======================Multiple Markov Chains
    203203      acz = 0
    204204      do nsw=1,nswp
    205 c------------First ordinary Metropolis
     205!------------First ordinary Metropolis
    206206         call metropolis(eol,acz,can_weight)
    207207         iold = iold + 1       
     
    214214            endif
    215215            acz0 = acz
    216 C     Measure global radius of gyration
     216!     Measure global radius of gyration
    217217            call rgyr(0,rgy,ee) 
    218218            rgyp = rgy
    219 C     Measure Helicity and Sheetness
     219!     Measure Helicity and Sheetness
    220220            call helix(nhel,mhel,nbet,mbet)
    221 C     Measure Number of hydrogen bonds
     221!     Measure Number of hydrogen bonds
    222222            mhb = 0
    223223            do i = 1, ntlml
     
    226226            enddo
    227227            call interhbond(imhb)
    228 C     Measure total number of contacts (NCTOT) and number of
    229 C     native contacts (NCNAT)
     228!     Measure total number of contacts (NCTOT) and number of
     229!     native contacts (NCNAT)
    230230            call contacts(nctot,ncnat,dham)
    231 c     Add tracking of lowest energy configuration
     231!     Add tracking of lowest energy configuration
    232232            if (eol.lt.e_min) then
    233 c     Write out configuration
     233!     Write out configuration
    234234               i=rep_id+1
    235235               j=inode(i)
     
    248248               close(15)
    249249            endif
    250 c     Add tracking of configuration with larges hydrogen contents.
     250!     Add tracking of configuration with larges hydrogen contents.
    251251            if ((mhb + imhb).gt.h_max) then
    252 c     Write out configuration
     252!     Write out configuration
    253253               i = rep_id + 1
    254254               j = inode(i)
     
    268268            endif
    269269
    270 C     
    271 C--------------------Gather measurement data
     270!     
     271!--------------------Gather measurement data
    272272! I only use the master node of each replica for data collection. The
    273273! variable partem_comm provides the appropriate communicator.
     
    310310     &              MPI_DOUBLE_PRECISION,0,partem_comm,IERR)
    311311
    312 c     Write trajectory
     312!     Write trajectory
    313313               write (18,*) '@@@',iold,inode(rep_id+1)
    314314               call outvbs(0,18)
    315315               write (18,*) '###'
    316316!                call flush(18)
    317 c     Write current configuration
     317!     Write current configuration
    318318               if ((mod(iold, nsave).eq.0)) then
    319319                  filebase = "conf_0000.var"
     
    324324            if(rep_id.eq.0.and.myrank.eq.0) then
    325325               randomCount = 0
    326 c  Update acceptance, temperature wise average of E and E^2 used to calculate
    327 c  specific heat.
     326!  Update acceptance, temperature wise average of E and E^2 used to calculate
     327!  specific heat.
    328328               do i=1,num_rep
    329329                  j=intem(i)
    330330                  acy(i)=0.0
    331 c  Above: contents of acy1 are added to acy(i) a few lines down.
    332 c  acy1(intem(i)) contains information received from the node at temperature
    333 c  i, on how many updates have been accepted in node intem(i). Since acz
    334 c  is not reset to 0 every cycle, acy(i) must be set to 0 here. Else, there
    335 c  will be serious double counting and the values of acceptance printed
    336 c  will be simply wrong.
     331!  Above: contents of acy1 are added to acy(i) a few lines down.
     332!  acy1(intem(i)) contains information received from the node at temperature
     333!  i, on how many updates have been accepted in node intem(i). Since acz
     334!  is not reset to 0 every cycle, acy(i) must be set to 0 here. Else, there
     335!  will be serious double counting and the values of acceptance printed
     336!  will be simply wrong.
    337337                  e_minpt(i)=e_minp(intem(i))
    338338               end do
     
    346346
    347347
    348 C     Write measurements to the time series file ts.d
     348!     Write measurements to the time series file ts.d
    349349               do i=1,num_rep
    350350                  j=intem(i)
     
    354354                     
    355355               end do
    356 c     Write the current parallel tempering information into par_R.in
     356!     Write the current parallel tempering information into par_R.in
    357357               if ((mod(iold, nsave).eq.0))
    358358     &         then
     
    363363     &                    h_maxp(i)
    364364                  end do
    365 C     -------------------------- Various statistics of current run
    366 c               swp=nswp-nequi
     365!     -------------------------- Various statistics of current run
     366!               swp=nswp-nequi
    367367                  swp=nsw
    368368                  write(13,*) 'Acceptance rate for change of chains:'
     
    370370                     temp=1.0d0/pbe(k1)/0.00198773
    371371                     write(13,*) temp, acx1(k1)*2.0d0*nmes/swp
    372 c  Above: it's the acceptance rate of exchange of replicas. Since a
    373 c  replica exchange is attempted only once every nmes sweeps, the
    374 c  rate should be normalized with (nmes/swp).
     372!  Above: it's the acceptance rate of exchange of replicas. Since a
     373!  replica exchange is attempted only once every nmes sweeps, the
     374!  rate should be normalized with (nmes/swp).
    375375                  end do
    376376                  write(13,*)
     
    381381                     geavm(k1) = nmes*eavm(k1)/swp
    382382                     gsph(k1)  = (nmes*sph(k1)/swp-geavm(k1)**2)
    383      #                    *beta*beta/nresi
     383     &                    *beta*beta/nresi
    384384                     write(13,'(a,2f9.2,i4,f12.3)')
    385385     &                    'Temperature, Node,local acceptance rate:',
    386386     &                    beta,temp,k,acy(k1)/dble(nsw*nvr)
    387 c  Above: Changed (nswp-nequi) in the denominator of acceptance as
    388 c  acceptance values are initialized to 0 after equilibration cycles are
    389 c  finished. Note also that since this is being written in the middle of
    390 c  the simulation, it is normalized to nsw instead of nswp.
     387!  Above: Changed (nswp-nequi) in the denominator of acceptance as
     388!  acceptance values are initialized to 0 after equilibration cycles are
     389!  finished. Note also that since this is being written in the middle of
     390!  the simulation, it is normalized to nsw instead of nswp.
    391391                     write(13,'(a,3f12.2)')
    392392     &                    'Last Energy, Average Energy, Spec. Heat:',
     
    401401               end if   
    402402
    403 C--------------------Parallel Tempering  update
    404 c     Swap with right neighbor (odd, even)           
     403!--------------------Parallel Tempering  update
     404!     Swap with right neighbor (odd, even)           
    405405               if(odd.eq.1) then
    406406                  nu=1
    407407                  no1 = num_rep-1
    408 c     Swap with left neighbor (even, odd)
     408!     Swap with left neighbor (even, odd)
    409409               else
    410410                  nu = 2
     
    413413               do i=nu,no1,2
    414414                  j=i+1
    415 c     Periodic bc for swaps
     415!     Periodic bc for swaps
    416416                  if(i.eq.num_rep) j=1
    417417                  iidx=intem(i)
     
    429429                  end if
    430430               end do
    431 c     ---------------- End Loop over nodes which creates a new temperature
    432 c     map for all nodes, at the node with rank 0.
    433 c     
     431!     ---------------- End Loop over nodes which creates a new temperature
     432!     map for all nodes, at the node with rank 0.
     433!     
    434434               odd = 1 - odd
    435435            end if
    436 c     End of "if (myrank.eq.0) ...". The block above includes PT update and
    437 c     writing of observables into the time series file etc.
     436!     End of "if (myrank.eq.0) ...". The block above includes PT update and
     437!     writing of observables into the time series file etc.
    438438           
    439 c     Below: Communicate new temperature-node map to all nodes
     439!     Below: Communicate new temperature-node map to all nodes
    440440            CALL MPI_BCAST(INTEM,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD,
    441441     &           IERR)
     
    446446            CALL MPI_BCAST(H_MAXP,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD,
    447447     &           IERR)
    448 c Synchronize random number generators for replica 0
     448! Synchronize random number generators for replica 0
    449449            if (rep_id.eq.0) then
    450450               CALL MPI_BCAST(randomCount,1,MPI_INTEGER,0,my_mpi_comm,
     
    467467
    468468         endif
    469 c        End of "if (mod(iold,nmes).eq.0) ..."
     469!        End of "if (mod(iold,nmes).eq.0) ..."
    470470      end do
    471 c-----------End Loop over sweeps
    472 c     
    473 C     OUTPUT:
    474 C--------------------For Re-starts:
     471!-----------End Loop over sweeps
     472!     
     473!     OUTPUT:
     474!--------------------For Re-starts:
    475475      nu = rep_id + 1
    476476      filebase = "conf_0000.var"
     
    484484      if (partem_comm.ne.MPI_COMM_NULL) then
    485485         CALL MPI_GATHER(EOL0,1,MPI_DOUBLE_PRECISION,YOL,1,
    486      #        MPI_DOUBLE_PRECISION,0,partem_comm,IERR)
     486     &        MPI_DOUBLE_PRECISION,0,partem_comm,IERR)
    487487         CALL MPI_GATHER(acz0,1,MPI_DOUBLE_PRECISION,acy1,1,
    488      #     MPI_DOUBLE_PRECISION,0,partem_comm,IERR)
     488     &     MPI_DOUBLE_PRECISION,0,partem_comm,IERR)
    489489      endif
    490490     
     
    496496            write(13,*) i,inode(i),intem(i),yol(i),e_minp(i),h_maxp(i)
    497497         end do
    498 C     -------------------------- Various statistics of current run
     498!     -------------------------- Various statistics of current run
    499499         swp=nswp
    500500         write(13,*) 'Acceptance rate for change of chains:'
     
    519519         end do
    520520         close(13)
    521 c         close(16)
     521!         close(16)
    522522      end if
    523523      close(18)
    524524
    525 c     =====================
     525!     =====================
    526526      CALL MPI_BARRIER(MPI_COMM_WORLD,IERR)
    527527
  • INCP.H

    r2ebb8b6 rbd2278d  
    1 c ......................
    2 c contents of a PDB file
    3 c ......................
     1! ......................
     2! contents of a PDB file
     3! ......................
    44
    55      parameter (MXCHP =100,    ! max. no. of polypeptide chains
    6      #           MXRSP =1000,   ! max. no. of residues
    7      #           MXATP =10000)  ! max. no. of atoms
     6     &           MXRSP =1000,   ! max. no. of residues
     7     &           MXATP =10000)  ! max. no. of atoms
    88
    9 c   nchp      - no. of polypeptide chains
    10 c   nchrsp()  - no. of residues / chain
    11 c   nrsp      - total no. of residues
    12 c   irsatp()  - index of 1st atom / res.
    13 c   nrsatp()  - no. of atoms / res.
    14 c   natp      - total no. of selected atoms
    15 c   noatp()   - atom numbers
     9!   nchp      - no. of polypeptide chains
     10!   nchrsp()  - no. of residues / chain
     11!   nrsp      - total no. of residues
     12!   irsatp()  - index of 1st atom / res.
     13!   nrsatp()  - no. of atoms / res.
     14!   natp      - total no. of selected atoms
     15!   noatp()   - atom numbers
    1616
    1717      common /pdb_i/ nchp,nchrsp(MXCHP),
    18      #               nrsp,irsatp(MXRSP),nrsatp(MXRSP),
    19      #               natp,noatp(MXATP)
     18     &               nrsp,irsatp(MXRSP),nrsatp(MXRSP),
     19     &               natp,noatp(MXATP)
    2020      save /pdb_i/
    2121
    22 c   chnp()  - chain identifiers
    23 c   rsidp() - residue identifiers (number + insertion code)
    24 c   rsnmp() - residues (sequence, 3-letter code)
    25 c   atnmp() - atom names
     22!   chnp()  - chain identifiers
     23!   rsidp() - residue identifiers (number + insertion code)
     24!   rsnmp() - residues (sequence, 3-letter code)
     25!   atnmp() - atom names
    2626
    2727      character chnp(MXCHP),
    28      #          rsidp(MXRSP)*5,rsnmp(MXRSP)*3,
    29      #          atnmp(MXATP)*4
     28     &          rsidp(MXRSP)*5,rsnmp(MXRSP)*3,
     29     &          atnmp(MXATP)*4
    3030
    3131      common /pdb_c/ chnp,rsnmp,rsidp,atnmp
    3232      save /pdb_c/
    3333
    34 c     xatp,yatp,zatp - atom coordinates
     34!     xatp,yatp,zatp - atom coordinates
    3535
    3636      common /pdb_r/ xatp(MXATP),yatp(MXATP),zatp(MXATP)
    3737      save /pdb_r/
    3838
    39 c ------------------- code to list all PDB information
    40 c      ir=0
    41 c      do i=1,nchp
    42 c        write(*,*) ' ===== chain |',chnp(i),'|'
    43 c        do j=1,nchrsp(i)
    44 c          ir=ir+1
    45 c          write(*,*) ' ----- ',rsidp(ir),' ',rsnmp(ir),' ',nrsatp(ir)
    46 c          k1=irsatp(ir)
    47 c          k2=k1+nrsatp(ir)-1
    48 c          do k=k1,k2
    49 c            write(*,*) ' ',noatp(k),' ',atnmp(k),' ',(xyzp(l,k),l=1,3)
    50 c          enddo
    51 c        enddo
    52 c      enddo
     39! ------------------- code to list all PDB information
     40!      ir=0
     41!      do i=1,nchp
     42!        write(*,*) ' ===== chain |',chnp(i),'|'
     43!        do j=1,nchrsp(i)
     44!          ir=ir+1
     45!          write(*,*) ' ----- ',rsidp(ir),' ',rsnmp(ir),' ',nrsatp(ir)
     46!          k1=irsatp(ir)
     47!          k2=k1+nrsatp(ir)-1
     48!          do k=k1,k2
     49!            write(*,*) ' ',noatp(k),' ',atnmp(k),' ',(xyzp(l,k),l=1,3)
     50!          enddo
     51!        enddo
     52!      enddo
  • SMMP.kdevelop

    r2ebb8b6 rbd2278d  
    132132      <filetype>*.h</filetype>
    133133      <filetype>*.H</filetype>
    134       <filetype>*.hh</filetype>
     134      <filetype>*.f90</filetype>
    135135      <filetype>*.hxx</filetype>
    136136      <filetype>*.hpp</filetype>
     
    143143      <filetype>Makefile</filetype>
    144144      <filetype>CMakeLists.txt</filetype>
     145      <filetype>*.py</filetype>
     146      <filetype>*.f</filetype>
    145147    </filetypes>
    146148    <blacklist/>
  • addend.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c
    4 c This file contains the subroutines:  addend, redchg, rplgrp
    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 $Id: addend.f 334 2007-08-07 09:23:59Z meinke $
    12 c **************************************************************
     1! **************************************************************
     2!
     3!
     4! This file contains the subroutines:  addend, redchg, rplgrp
     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! $Id: addend.f 334 2007-08-07 09:23:59Z meinke $
     12! **************************************************************
    1313      subroutine addend(nml,grpn,grpc)
    1414
    15 c ..............................................................
    16 c  PURPOSE:  modify terminal residues to complete bonding scheme
    17 c            with residue 'grpn' at N- and residue 'grpc' at C-terminus
    18 c            ! need initial co-ordinates for residues to modify
    19 c            ! for N-terminus: may add only simple groups
    20 c
    21 c  CALLS:  rplgrp,tolost,redchg
    22 c ..............................................................
     15! ..............................................................
     16!  PURPOSE:  modify terminal residues to complete bonding scheme
     17!            with residue 'grpn' at N- and residue 'grpc' at C-terminus
     18!            ! need initial co-ordinates for residues to modify
     19!            ! for N-terminus: may add only simple groups
     20!
     21!  CALLS:  rplgrp,tolost,redchg
     22! ..............................................................
    2323 
    2424      include 'INCL.H'
     
    3535
    3636      if (grn(:3).eq.'ace'.or.grc(:3).eq.'ace'
    37      #.or.grn(:3).eq.'nme'.or.grc(:3).eq.'nme') then
     37     &.or.grn(:3).eq.'nme'.or.grc(:3).eq.'nme') then
    3838
    3939        write(*,'(2a)') ' addend> N-Acetyl (ace) or N-Methylamide (nme)'
    40      #   ,' should be put in SEQUENCE file, not added as end groups'
     40     &   ,' should be put in SEQUENCE file, not added as end groups'
    4141
    4242        stop
    4343      endif
    4444
    45 c __________________________________________ N-terminus
     45! __________________________________________ N-terminus
    4646      ifirs=irsml1(nml)
    4747      rpat='n   '
     
    5555            else
    5656              write (*,'(2a)') ' addend> ',
    57      #         ' No N-terminal Hyp possible with ECEPP/3 dataset'
     57     &         ' No N-terminal Hyp possible with ECEPP/3 dataset'
    5858              stop
    5959            endif
     
    8383
    8484          write(*,'(2a)') ' addend> Can add only ',
    85      *     'nh2 or nh3+ to N-terminus'
     85     &     'nh2 or nh3+ to N-terminus'
    8686          stop
    8787
     
    9494
    9595        write(*,'(2a)') ' addend> Acetyl group',
    96      #     ' at N-terminus not modified'
    97       endif
    98 
    99 c __________________________________________ C-terminus
     96     &     ' at N-terminus not modified'
     97      endif
     98
     99! __________________________________________ C-terminus
    100100      ilars=irsml2(nml)
    101101      rpat='c   '
     
    124124
    125125          write(*,'(2a)') ' addend> Can add only ',
    126      #     'cooh or coo- to C-terminus'
     126     &     'cooh or coo- to C-terminus'
    127127          stop
    128128
     
    135135
    136136        write(*,'(2a)') ' addend> N-Methylamide',
    137      #     ' at C-terminus not modified'
    138 
    139       endif
    140 
    141 c ----------------------------- net charge of molecule
     137     &     ' at C-terminus not modified'
     138
     139      endif
     140
     141! ----------------------------- net charge of molecule
    142142      cg = 0.d0
    143143      do i=iatrs1(irsml1(nml)),iatrs2(irsml2(nml))
     
    145145      enddo
    146146      if (abs(cg).gt.1.d-5) write(*,'(a,i2,a,f7.3,/)')
    147      #        ' addend> Net charge of molecule #'
    148      #        ,nml,': ',cg
     147     &        ' addend> Net charge of molecule #'
     148     &        ,nml,': ',cg
    149149
    150150      return
    151151      end
    152 c ****************************************
     152! ****************************************
    153153      subroutine rplgrp(nml,nrs,rpat,sbrs)
    154154
    155 c ...............................................................
    156 c PURPOSE: replace atom(s) rooted at atom 'rpat' in residue
    157 c          'nrs' of molecule 'nml' by atom(s) rooted at
    158 c          'rpat' of residue 'sbrs' (same name of root
    159 c          atom 'rpat' maintains bonding geometry for
    160 c          preceeding atoms in 'nrs')
    161 c
    162 c          is NOT performed if 'rpat' is within mainchain,
    163 c          except it is first/last mainchain atom of 'nml'
    164 c
    165 c CALLS: dihedr,iopfil,iendst,eyring,fndbrn,redres,setsys,valang
    166 c ...............................................................
     155! ...............................................................
     156! PURPOSE: replace atom(s) rooted at atom 'rpat' in residue
     157!          'nrs' of molecule 'nml' by atom(s) rooted at
     158!          'rpat' of residue 'sbrs' (same name of root
     159!          atom 'rpat' maintains bonding geometry for
     160!          preceeding atoms in 'nrs')
     161!
     162!          is NOT performed if 'rpat' is within mainchain,
     163!          except it is first/last mainchain atom of 'nml'
     164!
     165! CALLS: dihedr,iopfil,iendst,eyring,fndbrn,redres,setsys,valang
     166! ...............................................................
    167167
    168168      include 'INCL.H'
     
    180180      nfi=iatrs1(nrs)
    181181      nla=iatrs2(nrs)
    182 c __________________________ indices of atoms to be replaced
     182! __________________________ indices of atoms to be replaced
    183183      do i=nfi,nla
    184184        if (rpat.eq.nmat(i)) then
     
    188188      enddo
    189189      write (*,'(4a,i4,a,i4)') ' rplgrp> cannot find atom >',rpat,
    190      #'< to be replaced in residue ',seq(nrs),nrs,' of molecule ',nml
     190     &'< to be replaced in residue ',seq(nrs),nrs,' of molecule ',nml
    191191      stop
    192192
     
    218218              if (ibdrg.ne.0) then
    219219                write (*,'(2a,i3)')
    220      #             ' rplgrp> Can handle only simple ring at 1st',
    221      #             ' atom of molecule #',nml
     220     &             ' rplgrp> Can handle only simple ring at 1st',
     221     &             ' atom of molecule #',nml
    222222                stop
    223223              endif
     
    245245        else
    246246          write (*,'(4a,i4,a,i4)')
    247      #      ' rplgrp> Cannot replace BACKBONE atom ',rpat,
    248      #      ' of residue ',seq(nrs),nrs,' in molecule #',nml
     247     &      ' rplgrp> Cannot replace BACKBONE atom ',rpat,
     248     &      ' of residue ',seq(nrs),nrs,' in molecule #',nml
    249249          stop
    250250        endif
    251251
    252252      endif  ! N-terminus
    253 c _________________________________ previous atoms
     253! _________________________________ previous atoms
    254254    2 if (nfirp.eq.nfi.and.nrs.eq.ifirs) goto 11
    255255      nxtbb1=iowat(nfirp)
    256256      if (nxtbb1.eq.nfi.and.nrs.eq.ifirs) goto 11
    257257      nxtbb2=iowat(nxtbb1)
    258 c _______________________________ get data for substituent atoms
     258! _______________________________ get data for substituent atoms
    259259    3 if (iopfil(lunlib,reslib,'old','formatted').le.izero) then
    260260        write (*,'(a,/,a,i3,2a)')
    261      #    ' rplgrp> ERROR opening library of residues:',
    262      #    ' LUN=',lunlib,' FILE=',reslib(1:iendst(reslib))
     261     &    ' rplgrp> ERROR opening library of residues:',
     262     &    ' LUN=',lunlib,' FILE=',reslib(1:iendst(reslib))
    263263        stop
    264264      endif
    265265      call redres(sbrs,natsb,nxtsb,nvrsb)
    266266      close (lunlib)
    267 c __________________________ indices of substituent atoms
     267! __________________________ indices of substituent atoms
    268268      do i=1,natsb
    269269        if (rpat.eq.nmath(i)) then
     
    273273      enddo
    274274      write (*,'(4a)') ' rplgrp> Cannot find atom >',rpat,
    275      #'< in substituent residue ',sbrs
     275     &'< in substituent residue ',sbrs
    276276      stop
    277277
     
    288288        enddo  ! ... branch atoms
    289289    5 enddo  ! ... branches
    290 c _________________________________________________ local axes at 'nfirp'
     290! _________________________________________________ local axes at 'nfirp'
    291291      call setsys(nxtbb1,nfirp,nxtbb2,x1,x2,x3,y1,y2,y3,z1,z2,z3)
    292292
     
    298298      zbaat(nfirp)=z3
    299299
    300 c _____________________ add virtual atoms
     300! _____________________ add virtual atoms
    301301      if (ntbb) then
    302302
     
    306306        sa=snbaat(nxtbb1)
    307307
    308 c ------------------- Eyring
     308! ------------------- Eyring
    309309        h2=-sa*ct
    310310        h3=-sa*st
     
    331331        st=sntoat(nxtbb1)
    332332
    333 c -------------------- Eyring with b.angle = 90 deg.
     333! -------------------- Eyring with b.angle = 90 deg.
    334334        xat(-ione)=xat(izero)-ct*(z2*x3-z3*x2)-st*z1
    335335        yat(-ione)=yat(izero)-ct*(z3*x1-z1*x3)-st*z2
     
    337337
    338338      endif
    339 c _____________________________________________ Shift atom data
     339! _____________________________________________ Shift atom data
    340340      nrp=nlarp-nfirp
    341341      nsb=nlasb-nfisb
     
    407407
    408408        enddo
    409 c ____________________________________________ Shift residue data
     409! ____________________________________________ Shift residue data
    410410        do i=nrs+1,irsml2(ntlml)
    411411          iatrs1(i)=iatrs1(i)+nsh
     
    418418        nsh=0
    419419      endif
    420 c _________________________________________ Correct data of 'nfirp'
     420! _________________________________________ Correct data of 'nfirp'
    421421      ish=nfirp-nfisb
    422422      ityat(nfirp)=ityath(nfisb)
     
    450450          if (nb.gt.mxbd) then
    451451            write (*,'(6a,/,2a,3(i4,a))')
    452      #      ' rplgrp> Cannot add atoms following ',rpat,
    453      #      ' from group ',sbrs,' to atom ',rpat,
    454      #      ' of residue ',seq(nrs),nrs,' in molecule #',nml,
    455      #      ' because need >',(mxbd+1),' bonds'
     452     &      ' rplgrp> Cannot add atoms following ',rpat,
     453     &      ' from group ',sbrs,' to atom ',rpat,
     454     &      ' of residue ',seq(nrs),nrs,' in molecule #',nml,
     455     &      ' because need >',(mxbd+1),' bonds'
    456456            stop
    457457          endif
     
    474474      endif
    475475      nbdat(nfirp)=nb
    476 c _________________________________________ Add data for substituent
     476! _________________________________________ Add data for substituent
    477477      ii=nfirp
    478478      do i=nfisb+1,nlasb
     
    527527
    528528      enddo  ! substituent atoms
    529 c ___________________________________________________ Take care of Variables
    530 c (assume variables of replaced group/substituent to be stored CONSECUTIVELY)
     529! ___________________________________________________ Take care of Variables
     530! (assume variables of replaced group/substituent to be stored CONSECUTIVELY)
    531531
    532532      ilavr=ivrml1(ntlml)+nvrml(ntlml)-1
     
    610610
    611611      return
    612 c __________________________________________ Errors
     612! __________________________________________ Errors
    613613   10 write (*,'(3a,/,2a,i4,a,i4,/,2a)')
    614      #   ' rplgrp> Cannot replace atom(s) following ',rpat,
    615      #   ' from INSIDE a ring','    in residue: ',seq(nrs),nrs,
    616      #   ' in molecule #',nml,' or in substitute: ',sbrs
     614     &   ' rplgrp> Cannot replace atom(s) following ',rpat,
     615     &   ' from INSIDE a ring','    in residue: ',seq(nrs),nrs,
     616     &   ' in molecule #',nml,' or in substitute: ',sbrs
    617617      stop
    618618   11 write (*,'(4a,i4,a,i4,/,a)')
    619      #   ' rplgrp> Cannot replace atom(s) following ',rpat,
    620      #   ' of residue ',seq(nrs),nrs,' in molecule #',nml,
    621      #   ' since necessary 2 previous atoms are not available'
     619     &   ' rplgrp> Cannot replace atom(s) following ',rpat,
     620     &   ' of residue ',seq(nrs),nrs,' in molecule #',nml,
     621     &   ' since necessary 2 previous atoms are not available'
    622622      stop
    623623
    624624      end
    625 c ****************************************
     625! ****************************************
    626626      subroutine redchg(nml,nrs,rpat,sbrs)
    627627
    628 c .........................................................
    629 c PURPOSE: read and place atomic point charges from residue
    630 c          'sbrs' to residue 'nrs' of molecule 'nml'
    631 c          from library 'chglib' with LUN=lunchg, if ilib=1
    632 c                       'reslib' with LUN=lunlib, if ilib=2
    633 c
    634 c CALLS: iopfil,iendst,tolost
    635 c ........................................................
     628! .........................................................
     629! PURPOSE: read and place atomic point charges from residue
     630!          'sbrs' to residue 'nrs' of molecule 'nml'
     631!          from library 'chglib' with LUN=lunchg, if ilib=1
     632!                       'reslib' with LUN=lunlib, if ilib=2
     633!
     634! CALLS: iopfil,iendst,tolost
     635! ........................................................
    636636
    637637      include 'INCL.H'
     
    677677        if (iopfil(lunchg,chgfil,'old','formatted').le.izero) then
    678678          write (*,'(a,/,a,i3,2a)')
    679      #      ' redchg> ERROR opening library of charges:',
    680      #      ' LUN=',lunchg,' FILE=',chgfil(1:iendst(chgfil))
     679     &      ' redchg> ERROR opening library of charges:',
     680     &      ' LUN=',lunchg,' FILE=',chgfil(1:iendst(chgfil))
    681681          stop
    682682        endif
     
    701701              enddo
    702702              write (*,'(6a)') ' redchg> Cannot find atom: ',atnm,
    703      #                        ' for entry: ',cgty,' in library: ',
    704      #                        chgfil(1:iendst(chgfil))
     703     &                        ' for entry: ',cgty,' in library: ',
     704     &                        chgfil(1:iendst(chgfil))
    705705              stop
    706706    2       enddo
     
    708708          else
    709709            write (*,'(4a)')
    710      #       ' redchg> must increase MXATH to read data for entry: ',
    711      #        cgty,' in library: ',chgfil(1:iendst(chgfil))
     710     &       ' redchg> must increase MXATH to read data for entry: ',
     711     &        cgty,' in library: ',chgfil(1:iendst(chgfil))
    712712            close(lunchg)
    713713            stop
     
    716716        goto 1
    717717    3   write (*,'(4a)')
    718      #   ' redchg> Cannot find entry: ',cgty,' in library: ',
    719      #      chgfil(1:iendst(chgfil))
     718     &   ' redchg> Cannot find entry: ',cgty,' in library: ',
     719     &      chgfil(1:iendst(chgfil))
    720720        close(lunchg)
    721721        stop
     
    725725        if (iopfil(lunlib,reslib,'old','formatted').le.izero) then
    726726          write (*,'(a,/,a,i3,2a)')
    727      #      ' redchg> ERROR opening library of residues:',
    728      #      ' LUN=',lunlib,' FILE=',reslib(1:iendst(reslib))
     727     &      ' redchg> ERROR opening library of residues:',
     728     &      ' LUN=',lunlib,' FILE=',reslib(1:iendst(reslib))
    729729          stop
    730730        endif
     
    748748              enddo
    749749              write (*,'(6a)') ' redchg> Cannot find atom: ',atnm,
    750      #                        ' for entry: ',cgty,' in library: ',
    751      #                        reslib(1:iendst(reslib))
     750     &                        ' for entry: ',cgty,' in library: ',
     751     &                        reslib(1:iendst(reslib))
    752752              stop
    753753    5       enddo
     
    755755          else
    756756            write (*,'(4a)')
    757      #       ' redchg> must increase MXATH to read data for entry: ',
    758      #        cgty,' in library: ',reslib(1:iendst(reslib))
     757     &       ' redchg> must increase MXATH to read data for entry: ',
     758     &        cgty,' in library: ',reslib(1:iendst(reslib))
    759759            close(lunchg)
    760760            stop
     
    763763        goto 4
    764764    6   write (*,'(4a)')
    765      #   ' redchg> Cannot find entry: ',cgty,' in library: ',
    766      #      reslib(1:iendst(reslib))
     765     &   ' redchg> Cannot find entry: ',cgty,' in library: ',
     766     &      reslib(1:iendst(reslib))
    767767        close(lunchg)
    768768        stop
     
    771771
    772772   10 write (*,'(4a)')
    773      #    ' redchg> Do not have charges for N/C-terminal residue ',
    774      #    res,' modified with group :',sbrs
     773     &    ' redchg> Do not have charges for N/C-terminal residue ',
     774     &    res,' modified with group :',sbrs
    775775      stop
    776776
  • anneal.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines:  anneal
    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 $Id: anneal.f 334 2007-08-07 09:23:59Z meinke $
    11 c **************************************************************
     1! **************************************************************
     2!
     3! This file contains the subroutines:  anneal
     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! $Id: anneal.f 334 2007-08-07 09:23:59Z meinke $
     11! **************************************************************
    1212
    1313      subroutine  anneal(nequi, nswp, nmes, tmax, tmin, lrand)
    1414
    15 C --------------------------------------------------------------
    16 C PURPOSE: SIMULATED ANNEALING SEARCH OF LOWEST-POTENTIAL-ENERGY
    17 C          CONFORMATIONS OF PROTEINS
    18 C
    19 C CALLS: addang,energy,metropolis,outvar,outpdb,rgyr,setvar,zimmer
    20 C
    21 C ---------------------------------------------------------------
     15! --------------------------------------------------------------
     16! PURPOSE: SIMULATED ANNEALING SEARCH OF LOWEST-POTENTIAL-ENERGY
     17!          CONFORMATIONS OF PROTEINS
     18!
     19! CALLS: addang,energy,metropolis,outvar,outpdb,rgyr,setvar,zimmer
     20!
     21! ---------------------------------------------------------------
    2222 
    2323      include 'INCL.H'
    2424
    25 cf2py intent(in) nequi
    26 cf2py intent(in) nswp
    27 cf2py intent(in) nmes
    28 cf2py intent(in) Tmax
    29 cf2py intent(in) Tmin
    30 cf2py logical optional, intent(in):: lrand = 1
     25!f2py intent(in) nequi
     26!f2py intent(in) nswp
     27!f2py intent(in) nmes
     28!f2py intent(in) Tmax
     29!f2py intent(in) Tmin
     30!f2py logical optional, intent(in):: lrand = 1
    3131
    32 c     external rand
     32!     external rand
    3333      external can_weight
    34 c      parameter(lrand=.true.)
    35 c      parameter(nequi=100, nswp=100000,nmes=1000)
    36 c      parameter(tmax=1000.0,tmin=100.0)
    37 C     lrand=.true.: creates random start configuration
     34!      parameter(lrand=.true.)
     35!      parameter(nequi=100, nswp=100000,nmes=1000)
     36!      parameter(tmax=1000.0,tmin=100.0)
     37!     lrand=.true.: creates random start configuration
    3838      logical lrand
    39 C     nequi: Number of sweeps for equilibrisation of system
     39!     nequi: Number of sweeps for equilibrisation of system
    4040      integer nequi
    41 C     nswp:  Number of sweeps for simulation run
     41!     nswp:  Number of sweeps for simulation run
    4242      integer nswp
    43 c     nmes:  Number of sweeps between measurments
     43!     nmes:  Number of sweeps between measurments
    4444      integer nmes
    45 C     tmax: Start temperature
     45!     tmax: Start temperature
    4646      double precision tmax
    47 C     tmin: Final temperature
     47!     tmin: Final temperature
    4848      double precision tmin
    4949     
    5050     
    5151!      common/bet/beta
    52 C
     52!
    5353      dimension vlvrm(mxvr)
    5454
    5555     
    5656 
    57 c     Define files for output:
     57!     Define files for output:
    5858      open(14,file='time.d')
    5959      write(14, *) '# $Id: anneal.f 334 2007-08-07 09:23:59Z meinke $'
     
    6464      db = exp(log(bmax/bmin)/nswp)
    6565
    66 c     nresi: Number of residues
    67 c FIXME: Should loop over all proteins
     66!     nresi: Number of residues
     67! FIXME: Should loop over all proteins
    6868      nresi=irsml2(ntlml)-irsml1(1)+1
    69 c _________________________________ random start
     69! _________________________________ random start
    7070      if(lrand) then
    7171       do i=1,nvr
     
    8080      write (*,'(a,e12.5,/)')  'energy of start configuration: ',eol
    8181
    82 C Write start configuration in pdb-format into file
     82! Write start configuration in pdb-format into file
    8383        call outpdb(0, "start.pdb")
    8484
    85 c =====================Equilibration by  Metropolis
     85! =====================Equilibration by  Metropolis
    8686      beta =  bmin
    8787      do nsw=1,nequi
     
    9090      write(*,*) 'Energy after  equilibration:',eol
    9191
    92 C======================Simulation by simulated annealing
     92!======================Simulation by simulated annealing
    9393      acz = 0.0d0
    9494      ymin = eol
     
    9696        beta = bmin*db**nsw
    9797        call metropolis(eol,acz,can_weight)
    98 c Store lowest-energy conformation
     98! Store lowest-energy conformation
    9999        if(eol.lt.ymin) then
    100100         ymin = eol
    101101         nemin = nsw
    102102         call outvar(0,'global.var')
    103 C     Output of lowest-energy conformation as pdb-file
     103!     Output of lowest-energy conformation as pdb-file
    104104         call outpdb(0,"global.pdb")
    105105         do j=1,nvr
     
    108108         end do
    109109        end if
    110 c
     110!
    111111        if(mod(nsw,nmes).eq.0) then
    112 C Measure radius of gyration and end-to-end distance
     112! Measure radius of gyration and end-to-end distance
    113113         call rgyr(1, rgy, ee)
    114 C Determine Zimmerman code of actual conformation
     114! Determine Zimmerman code of actual conformation
    115115         call zimmer(nresi)
    116 C Write down information on actual conformation
     116! Write down information on actual conformation
    117117         temp =  1.0d0/beta/0.00198773
    118118         write(14,'(i6,13f12.3,1x,a)') 
     
    121121     &   eyhb, eyvw, eyel, eyvr, zimm(1:nresi)
    122122        end if
    123 C
     123!
    124124      end do
    125125
     
    127127      write(*,*) 'acceptance rate:',acz
    128128      write(*,*)
    129 c ------------ Output Dihedreals of final configuration
     129! ------------ Output Dihedreals of final configuration
    130130      write(*,*) 'last energy',eol
    131131      call outvar(0,' ')
    132 C     Output final conformation as pdb-file
     132!     Output final conformation as pdb-file
    133133      call outpdb(0,"final.pdb")
    134134      write(*,*)
    135135
    136 c ------------ Output Dihedreals of conformation with lowest energy
     136! ------------ Output Dihedreals of conformation with lowest energy
    137137      write(*,*) 'lowest energy ever found:',nemin,ymin
    138138      close(14)
    139 c =====================
     139! =====================
    140140
    141141
  • bgs.f

    r2ebb8b6 rbd2278d  
    156156            bv(nph,3)=xiv(nph,3)-zat(iN(icurraa))
    157157            ab(nph)=bv(nph,1)*bv(nph,1)+bv(nph,2)*bv(nph,2)
    158      #           +bv(nph,3)*bv(nph,3)
     158     &           +bv(nph,3)*bv(nph,3)
    159159            iph(nph)=iphi(icurraa)
    160160         endif
     
    168168            bv(nph,3)=xiv(nph,3)-zat(iCa(icurraa))
    169169            ab(nph)=bv(nph,1)*bv(nph,1)+bv(nph,2)*bv(nph,2)
    170      #           +bv(nph,3)*bv(nph,3)
     170     &           +bv(nph,3)*bv(nph,3)
    171171            iph(nph)=ipsi(icurraa)
    172172         endif
     
    185185         do j=1,nph
    186186            dv(i,j,1)=(1.0/ab(j))*(bv(j,2)*(rv(i,3)-xiv(j,3))-
    187      c           bv(j,3)*(rv(i,2)-xiv(j,2)))
     187     &           bv(j,3)*(rv(i,2)-xiv(j,2)))
    188188            dv(i,j,2)=(-1.0/ab(j))*(bv(j,1)*(rv(i,3)-xiv(j,3))-
    189      c           bv(j,3)*(rv(i,1)-xiv(j,1)))
     189     &           bv(j,3)*(rv(i,1)-xiv(j,1)))
    190190            dv(i,j,3)=(1.0/ab(j))*(bv(j,1)*(rv(i,2)-xiv(j,2))-
    191      c           bv(j,2)*(rv(i,1)-xiv(j,1)))
     191     &           bv(j,2)*(rv(i,1)-xiv(j,1)))
    192192         enddo
    193193      enddo
     
    273273            bv(nph,3)=xiv(nph,3)-zat(iN(icurraa))
    274274            ab(nph)=bv(nph,1)*bv(nph,1)+bv(nph,2)*bv(nph,2)
    275      #           +bv(nph,3)*bv(nph,3)
     275     &           +bv(nph,3)*bv(nph,3)
    276276            iph(nph)=iphi(icurraa)
    277277         endif
     
    285285            bv(nph,3)=xiv(nph,3)-zat(iCa(icurraa))
    286286            ab(nph)=bv(nph,1)*bv(nph,1)+bv(nph,2)*bv(nph,2)
    287      #           +bv(nph,3)*bv(nph,3)
     287     &           +bv(nph,3)*bv(nph,3)
    288288            iph(nph)=ipsi(icurraa)
    289289         endif
     
    302302         do j=1,nph
    303303            dv(i,j,1)=(1.0/ab(j))*(bv(j,2)*(rv(i,3)-xiv(j,3))-
    304      c           bv(j,3)*(rv(i,2)-xiv(j,2)))
     304     &           bv(j,3)*(rv(i,2)-xiv(j,2)))
    305305            dv(i,j,2)=(-1.0/ab(j))*(bv(j,1)*(rv(i,3)-xiv(j,3))-
    306      c           bv(j,3)*(rv(i,1)-xiv(j,1)))
     306     &           bv(j,3)*(rv(i,1)-xiv(j,1)))
    307307            dv(i,j,3)=(1.0/ab(j))*(bv(j,1)*(rv(i,2)-xiv(j,2))-
    308      c           bv(j,2)*(rv(i,1)-xiv(j,1)))
     308     &           bv(j,2)*(rv(i,1)-xiv(j,1)))
    309309         enddo
    310310      enddo
  • bldmol.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines:  bldmol, fnd3ba,eyring,
    4 c                                      setsys,setgbl
    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:  bldmol, fnd3ba,eyring,
     4!                                      setsys,setgbl
     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      subroutine bldmol(nml)
    1414
    15 c .................................................
    16 c PURPOSE: calculate coordinates for molecule 'nml'
    17 c
    18 c OUTPUT:  xat,yat,zat,xbaat,ybaat,zbaat,xtoat,ytoat,
    19 c          ztoat (via 'eyring')
    20 c
    21 c          1st backbone atom of 1st residue of 'nml':
    22 c
    23 c          - it's position: from 'gbpr(1-3,nml)'
    24 c          - it's axes: from 'setgbl' according to
    25 c            global angles 'gbpr(4-5,nml)'
    26 c
    27 c CALLS: eyring, fnd3ba,setgbl,setsys
    28 c .................................................
     15! .................................................
     16! PURPOSE: calculate coordinates for molecule 'nml'
     17!
     18! OUTPUT:  xat,yat,zat,xbaat,ybaat,zbaat,xtoat,ytoat,
     19!          ztoat (via 'eyring')
     20!
     21!          1st backbone atom of 1st residue of 'nml':
     22!
     23!          - it's position: from 'gbpr(1-3,nml)'
     24!          - it's axes: from 'setgbl' according to
     25!            global angles 'gbpr(4-5,nml)'
     26!
     27! CALLS: eyring, fnd3ba,setgbl,setsys
     28! .................................................
    2929
    3030      include 'INCL.H'
     
    3434
    3535      call fnd3ba(nml,i1,i2,i3)
    36 c ------------------------------ first 3 bb atoms of 'nml'
     36! ------------------------------ first 3 bb atoms of 'nml'
    3737      ixrfpt(1,nml)=i1
    3838      ixrfpt(2,nml)=i2
    3939      ixrfpt(3,nml)=i3
    4040
    41 c ------------------------------ position of 1st bb atom
     41! ------------------------------ position of 1st bb atom
    4242      xat(i1) = gbpr(1,nml)
    4343      yat(i1) = gbpr(2,nml)
     
    8686      return
    8787      end
    88 c ***********************************
     88! ***********************************
    8989      subroutine fnd3ba(nml,i1,i2,i3)
    9090 
    91 c .................................................
    92 c PURPOSE: return indices 'i1,i2,i3' of
    93 c          first 3 backbone atoms in molecule 'nml'
    94 c
    95 c CALLS:   fndbrn
    96 c .................................................
     91! .................................................
     92! PURPOSE: return indices 'i1,i2,i3' of
     93!          first 3 backbone atoms in molecule 'nml'
     94!
     95! CALLS:   fndbrn
     96! .................................................
    9797 
    9898      include 'INCL.H'
     
    104104      irs=irsml1(nml)
    105105
    106 c --------------------------- 1st bb atom
     106! --------------------------- 1st bb atom
    107107      i1=iatrs1(irs)
    108108
    109109      call fndbrn(nml,irs,i1,i,ix,i2,bb)
    110110
    111 c --------------------------- 2nd bb atom
     111! --------------------------- 2nd bb atom
    112112      i2=i+1
    113113
    114 c ------------------------ check for ring
     114! ------------------------ check for ring
    115115
    116116      ibd(1)=iowat(i1)
     
    126126          if (ix.ne.0) then
    127127            write (*,'(2a,i3)')
    128      #         ' fnd3ba> Can handle only simple ring at 1st',
    129      #         ' atom of molecule #',nml
     128     &         ' fnd3ba> Can handle only simple ring at 1st',
     129     &         ' atom of molecule #',nml
    130130            stop
    131131          endif
     
    135135      enddo
    136136
    137 c --------------------------- 3rd bb atom
     137! --------------------------- 3rd bb atom
    138138
    139139      ix=ixatrs(irs)
     
    158158
    159159      write (*,'(4a,i4,a,i4)')
    160      #   ' fnd3ba> Cannot find backbone atom following ',nmat(i2),
    161      #   ' of residue ',seq(irs),irs,' in molecule #',nml
     160     &   ' fnd3ba> Cannot find backbone atom following ',nmat(i2),
     161     &   ' of residue ',seq(irs),irs,' in molecule #',nml
    162162      stop
    163163
    164164      end
    165 c ***************************
     165! ***************************
    166166      subroutine eyring(i,ia)
    167167
    168 c .........................................................
    169 c PURPOSE:  calculate cartesian coordinates of atom 'i'
    170 c           using EYRING's algorithm
    171 c INPUT:    i - index of atom to be constructed
    172 c               for 'i': blat,csbaat,snbaat,cstoat,sntoat
    173 c           ia- index of atom from which 'i' is to be built
    174 c OUTPUT:   for 'i': xat,yat,zat,xbaat,ybaat,zbaat,xtoat,ytoat,ztoat
    175 c
    176 c CALLS: none
    177 c .........................................................
     168! .........................................................
     169! PURPOSE:  calculate cartesian coordinates of atom 'i'
     170!           using EYRING's algorithm
     171! INPUT:    i - index of atom to be constructed
     172!               for 'i': blat,csbaat,snbaat,cstoat,sntoat
     173!           ia- index of atom from which 'i' is to be built
     174! OUTPUT:   for 'i': xat,yat,zat,xbaat,ybaat,zbaat,xtoat,ytoat,ztoat
     175!
     176! CALLS: none
     177! .........................................................
    178178
    179179      include 'INCL.H'
     
    228228      return
    229229      end
    230 c ***********************************************************
     230! ***********************************************************
    231231      subroutine setsys(i1,i2,i3, x1,x2,x3,y1,y2,y3,z1,z2,z3)
    232232
    233 c ..........................................................
    234 c  PURPOSE:  calculate axes X,Y,Z of right-handed orthogonal
    235 c            system given by three atom positions R1, R2, R3
    236 c
    237 c            X = (R2-R1)/ |( )|
    238 c            Z = {X x (R2-R3)} / |{ }|
    239 c            Y = Z x X
    240 c
    241 c  INPUT:    i1, i2, i3 - indices of three atoms
    242 c  OUTPUT:   x1,x2,x3 |
    243 c            y1,y2,y3 | -direction cosines of X,Y,Z
    244 c            z1,z2,z3 |
    245 c
    246 c  CALLS:    none
    247 c ...................................................
     233! ..........................................................
     234!  PURPOSE:  calculate axes X,Y,Z of right-handed orthogonal
     235!            system given by three atom positions R1, R2, R3
     236!
     237!            X = (R2-R1)/ |( )|
     238!            Z = {X x (R2-R3)} / |{ }|
     239!            Y = Z x X
     240!
     241!  INPUT:    i1, i2, i3 - indices of three atoms
     242!  OUTPUT:   x1,x2,x3 |
     243!            y1,y2,y3 | -direction cosines of X,Y,Z
     244!            z1,z2,z3 |
     245!
     246!  CALLS:    none
     247! ...................................................
    248248
    249249
     
    283283      end
    284284
    285 c *****************************************
     285! *****************************************
    286286      subroutine setgbl(nml,i1,i2,i3,xg,zg)
    287287
    288 c ...................................................
    289 c
    290 c PURPOSE: 1. Obtain global axes (J,K,L)
    291 c             related to x(1 0 0),y(0 1 0),z(0 0 1)
    292 c             by 3 rotations (gbl. parameters #4-#6):
    293 c
    294 c             - round z by angle alpha
    295 c             - round x' by a. beta
    296 c             - round y" by a. gamma
    297 c
    298 c          2. Return x-axis (xg) & z-axis (zg)
    299 c             for atom #1 in order to orientate J
    300 c             along the bond from backbone atom #1
    301 c             to bb.a. #2 and L according to the
    302 c             cross product [ bond(#1->#2) x
    303 c             bond(#2->#3) ] when using Eyring's
    304 c             algorithm to get the coordinates
    305 c
    306 c CALLS:   none
    307 c ..............................................
     288! ...................................................
     289!
     290! PURPOSE: 1. Obtain global axes (J,K,L)
     291!             related to x(1 0 0),y(0 1 0),z(0 0 1)
     292!             by 3 rotations (gbl. parameters #4-#6):
     293!
     294!             - round z by angle alpha
     295!             - round x' by a. beta
     296!             - round y" by a. gamma
     297!
     298!          2. Return x-axis (xg) & z-axis (zg)
     299!             for atom #1 in order to orientate J
     300!             along the bond from backbone atom #1
     301!             to bb.a. #2 and L according to the
     302!             cross product [ bond(#1->#2) x
     303!             bond(#2->#3) ] when using Eyring's
     304!             algorithm to get the coordinates
     305!
     306! CALLS:   none
     307! ..............................................
    308308
    309309      include 'INCL.H'
     
    319319      sg = sin(gbpr(6,nml))
    320320
    321 c ----------------------------- J
     321! ----------------------------- J
    322322      x1 =  ca*cg - sa*sb*sg
    323323      x2 =  sa*cg + ca*sb*sg
     
    328328      ag(2,1) = x2/d
    329329      ag(3,1) = x3/d
    330 c ----------------------------- K
     330! ----------------------------- K
    331331      y1 = -sa*cb
    332332      y2 =  ca*cb
     
    337337      ag(2,2) = y2/d
    338338      ag(3,2) = y3/d
    339 c ----------------------------- L
     339! ----------------------------- L
    340340      z1 =  ca*sg + sa*sb*cg
    341341      z2 =  sa*sg - ca*sb*cg
     
    347347      ag(3,3) = z3/d
    348348
    349 c ------------------------------------ X1
     349! ------------------------------------ X1
    350350      ct2 = cstoat(i2)
    351351      st2 = sntoat(i2)
     
    360360      x2 = x2/dx
    361361      x3 = x3/dx
    362 c ------------------------------------- Z1
     362! ------------------------------------- Z1
    363363      st3 = sntoat(i3)
    364364      ct3 = cstoat(i3)
     
    372372      z2 = z2/dz
    373373      z3 = z3/dz
    374 c ------------------------------------- Y1
     374! ------------------------------------- Y1
    375375      y1 = z2 * x3 - z3 * x2
    376376      y3 = z1 * x2 - z2 * x1  ! do not need y2
    377377
    378 c ----------------------------- into global system
     378! ----------------------------- into global system
    379379
    380380      xg(1) = ag(1,1)*x1 + ag(1,2)*y1 + ag(1,3)*z1
  • callbacktest.f

    r2ebb8b6 rbd2278d  
    11      subroutine metropolis(eol,enw,dummy)
    2 cf2py real*8 intent(in,out) eol
    3 cf2py real*8 intent(in,out) enw
     2!f2py real*8 intent(in,out) eol
     3!f2py real*8 intent(in,out) enw
    44        external dummy
    55        delta =  dummy(enw) - dummy(eol)
  • canon.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: canon,can_weight
    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: canon,can_weight
     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      subroutine  canon(nequi, nswp, nmes, temp, lrand)
    13 C -----------------------------------------------------------------
    14 C PURPOSE: CANONICAL SIMULATION OF PROTEINS USING METROPOLIS UPDATES
    15 C
    16 C CALLS:  addang,energy,metropolis,hbond,helix,outvar,outpdb,rgyr
    17 C
    18 C-------------------------------------------------------------------
     13! -----------------------------------------------------------------
     14! PURPOSE: CANONICAL SIMULATION OF PROTEINS USING METROPOLIS UPDATES
     15!
     16! CALLS:  addang,energy,metropolis,hbond,helix,outvar,outpdb,rgyr
     17!
     18!-------------------------------------------------------------------
    1919      include 'INCL.H'
    2020
    21 cf2py intent(in) nequi
    22 cf2py intent(in) nswp
    23 cf2py intent(in) nmes
    24 cf2py intent(in) temp
    25 cf2py logical optional, intent(in):: lrand = 1
     21!f2py intent(in) nequi
     22!f2py intent(in) nswp
     23!f2py intent(in) nmes
     24!f2py intent(in) temp
     25!f2py logical optional, intent(in):: lrand = 1
    2626
    27 c     external rand
     27!     external rand
    2828      external can_weight
    2929     
    3030      logical lrand
    31 c      parameter(lrand=.false.)
    32 c      parameter(nequi=10, nswp=1000,nmes=10)
    33 c      parameter(temp=300.0)
    34 C     lrand=.true.: creates random start configuration
    35 C     nequi: Number of sweeps for equilibrisation of system
     31!      parameter(lrand=.false.)
     32!      parameter(nequi=10, nswp=1000,nmes=10)
     33!      parameter(temp=300.0)
     34!     lrand=.true.: creates random start configuration
     35!     nequi: Number of sweeps for equilibrisation of system
    3636      integer nequi
    37 C     nswp:  Number of sweeps for simulation run
     37!     nswp:  Number of sweeps for simulation run
    3838      integer nswp
    39 c     nmes:  Number of sweeps between measurments
     39!     nmes:  Number of sweeps between measurments
    4040      integer nmes
    41 C     temp:  Temperature of simulation
     41!     temp:  Temperature of simulation
    4242      double precision temp
    43 C
     43!
    4444!      common/bet/beta
    4545
    4646      character*80 file
    4747
    48 c     Define files for output:
     48!     Define files for output:
    4949      open(13,file='time.d')
    5050
     
    5252      beta=1.0/ ( temp * 1.98773d-3 )
    5353
    54 c _________________________________ random start
     54! _________________________________ random start
    5555      if(lrand) then
    5656       do i=1,nvr
     
    6565      write (*,'(a,e12.5,/)')  'energy of start configuration:',eol
    6666
    67 C Write start configuration in pdb-format into file
     67! Write start configuration in pdb-format into file
    6868      call outpdb(0,'start.pdb')
    6969
    70 c =====================Equilibration by  Metropolis
     70! =====================Equilibration by  Metropolis
    7171      acz = 0.0d0
    7272      do nsw=1,nequi
     
    7575      write(*,*) 'Energy after equilibration:',eol
    7676
    77 C======================Simulation in canonical ensemble
     77!======================Simulation in canonical ensemble
    7878      acz = 0.0d0
    7979      do nsw=0,nswp
    8080        call metropolis(eol,acz,can_weight)
    81 c
     81!
    8282        if(mod(nsw,nmes).eq.0) then
    83 C Measure radius of gyration and end-to-end distance
    84 C rgy: radius of gyration
    85 C ee:  end-to-end distance
     83! Measure radius of gyration and end-to-end distance
     84! rgy: radius of gyration
     85! ee:  end-to-end distance
    8686         call rgyr(1,rgy,ee)
    87 C Measure helicity
    88 C nhel: number of helical residues
    89 c mhel: number of helical segments
    90 c nbet: number of sheet-like residues
    91 c mbet: number of sheet-like segments
     87! Measure helicity
     88! nhel: number of helical residues
     89! mhel: number of helical segments
     90! nbet: number of sheet-like residues
     91! mbet: number of sheet-like segments
    9292         call helix(nhel,mhel,nbet,mbet)
    93 C Measure number of hydrogen bonds (mhb)
     93! Measure number of hydrogen bonds (mhb)
    9494        do i=1,ntlml
    9595         call hbond(i,mhb,0)
    9696        end do
    97 C Write down information on actual conformation
     97! Write down information on actual conformation
    9898         write(13,'(i5,2f12.3,5i7)')  nsw,  eol, rgy,
    9999     &                              nhel,mhel,nbet,mbet,mhb
    100100        end if
    101 C
     101!
    102102      end do
    103103
     
    105105      write(*,*) 'acceptance rate:',acz
    106106      write(*,*)
    107 c ------------ Output Dihedreals of final configuration
     107! ------------ Output Dihedreals of final configuration
    108108      write(*,*) 'last energy',eol
    109109      call outvar(0,'lastconf.var')
    110 C     Output final conformation as pdb-file
     110!     Output final conformation as pdb-file
    111111      call outpdb(0,'final.pdb')
    112112
     
    114114      close(12)
    115115      close(13)
    116 c =====================
     116! =====================
    117117
    118118
    119119       end
    120120
    121 c ********************************************************
     121! ********************************************************
    122122      real*8 function can_weight(x)
    123 c
    124 c CALLS: none
    125 c
     123!
     124! CALLS: none
     125!
    126126
    127127      implicit real*8 (a-h,o-z)
  • cnteny.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: cnteny
    4 c
    5 c Copyright 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: cnteny
     4!
     5! Copyright 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      subroutine cnteny(nml)
    1313
    14 c ................................................................................
    15 c PURPOSE: Calculate atomic contact energy of molecule 'nml' with ECEPP parameters
    16 c
    17 c CALLS: nursat
    18 c ................................................................................
     14! ................................................................................
     15! PURPOSE: Calculate atomic contact energy of molecule 'nml' with ECEPP parameters
     16!
     17! CALLS: nursat
     18! ................................................................................
    1919
    2020      include 'INCL.H'
     
    3131      if (ntlvr.eq.0) then
    3232        write (*,'(a,i4)')
    33      #           ' cnteny> No variables defined in molecule #',nml
     33     &           ' cnteny> No variables defined in molecule #',nml
    3434        return
    3535      endif
     
    178178          ir=nursat(i)
    179179          write(*,'(1x,i4,1x,a4,1x,a4,a2,e11.4)') ir,seq(ir),nmat(i),
    180      #                                            ': ',ey
     180     &                                            ': ',ey
    181181        endif
    182182      enddo
  • contacts.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: contacts,c_alfa,c_cont
    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: contacts,c_alfa,c_cont
     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       subroutine contacts(ncn,nham2,dham)
    1313
    14 c ..............................................................
    15 c
    16 c CALCULATES NUMBER OF CONTACTS IN GIVEN CONFORMATION, NUMBER OF
    17 c CONTACTS WHICH ARE THE SAME IN GIVEN AND REFERENCE ONFORMATION,
    18 c AND THE HAMMING DISTANCE BETWEEN GIVEN  CONFORMATION AND THE
    19 c REFERENCE CONFORMATIONa
    20 c
    21 c CALLS: c_cont
    22 c ..............................................................
     14! ..............................................................
     15!
     16! CALCULATES NUMBER OF CONTACTS IN GIVEN CONFORMATION, NUMBER OF
     17! CONTACTS WHICH ARE THE SAME IN GIVEN AND REFERENCE ONFORMATION,
     18! AND THE HAMMING DISTANCE BETWEEN GIVEN  CONFORMATION AND THE
     19! REFERENCE CONFORMATIONa
     20!
     21! CALLS: c_cont
     22! ..............................................................
    2323
    2424      include 'INCL.H'
     
    5555
    5656
    57 c *********************************
     57! *********************************
    5858      subroutine c_alfa(nmol,ncode)
    5959
    60 c ......................................................
    61 c    Calculates the indices of C-alpha atoms and
    62 c    stores in the array ind_alf(mxrs)
    63 c                       
    64 c    Usage: call c_alfa(nmol,ncode)
    65 c
    66 c           nmol - index of the molecule
    67 c           ncode ---> not in use in the current version
    68 c
    69 c    OUTPUT:  ind_alf(mxrs)
    70 c
    71 c CALLS: none
    72 c ......................................................
     60! ......................................................
     61!    Calculates the indices of C-alpha atoms and
     62!    stores in the array ind_alf(mxrs)
     63!                       
     64!    Usage: call c_alfa(nmol,ncode)
     65!
     66!           nmol - index of the molecule
     67!           ncode ---> not in use in the current version
     68!
     69!    OUTPUT:  ind_alf(mxrs)
     70!
     71! CALLS: none
     72! ......................................................
    7373
    7474      include 'INCL.H'
     
    7777        do ia=iatrs1(n_res),iatrs2(n_res) ! Over the atoms of res.
    7878
    79 c     Check for C_alpha atoms
     79!     Check for C_alpha atoms
    8080
    8181         if (nmat(ia)(1:2).eq.'ca') then
     
    8989      end
    9090
    91 c **********************************
     91! **********************************
    9292      subroutine c_cont (nmol,ncode)
    9393
    94 c..............................................................
    95 c  Calculates the matrix of contacts between aminoacid residues
    96 c  of the molecule "nmol" according to  L.Mirny and E.Domany,
    97 c  PROTEINS:Structure, Function, and Genetics 26:391-410 (1996)
    98 c               
    99 c  Two residues are in contact if their C_alpha atoms are
    100 c  closer than 8.5 Angstrem
    101 c
    102 c  Usage: call c_cont(nmol,ncode)
    103 c
    104 c       Where nmol is the index of the molecule (always 1, in the
    105 c       current version of SMM)
    106 c       ncode ---> not in use in the current version
    107 c
    108 c  IMPORTANT: Before the first call of this subroutine  "c_alfa"
    109 c          must be called to calculate the inices of C_alpha atoms.
    110 c          (ONLY ONCE)
    111 c
    112 c   OUTPUT: The output of this routine is the contact matrix
    113 c          ijcont(mxrs,mxrs)
    114 c
    115 c              ijcont(i,j)=0---> residues i and j are not in contact
    116 c              ijcont(i,j)=1---> ---------''----- are in contact
    117 c              ijcont(i,j)=2---> residues i and j are adjacent
    118 c
    119 c    NOTE:  Adjacent residues are always in contact (and therefore not
    120 c           counted)
    121 c
    122 c         Here "mxrs" is the maximum number of residues for SMM
    123 c         Obviously, this subroutine calculates only NxN part
    124 c         of that matrix, N -is the number of res. in "nmol"
    125 c
    126 c CALLS:  none
    127 c..............................................................
     94!..............................................................
     95!  Calculates the matrix of contacts between aminoacid residues
     96!  of the molecule "nmol" according to  L.Mirny and E.Domany,
     97!  PROTEINS:Structure, Function, and Genetics 26:391-410 (1996)
     98!               
     99!  Two residues are in contact if their C_alpha atoms are
     100!  closer than 8.5 Angstrem
     101!
     102!  Usage: call c_cont(nmol,ncode)
     103!
     104!       Where nmol is the index of the molecule (always 1, in the
     105!       current version of SMM)
     106!       ncode ---> not in use in the current version
     107!
     108!  IMPORTANT: Before the first call of this subroutine  "c_alfa"
     109!          must be called to calculate the inices of C_alpha atoms.
     110!          (ONLY ONCE)
     111!
     112!   OUTPUT: The output of this routine is the contact matrix
     113!          ijcont(mxrs,mxrs)
     114!
     115!              ijcont(i,j)=0---> residues i and j are not in contact
     116!              ijcont(i,j)=1---> ---------''----- are in contact
     117!              ijcont(i,j)=2---> residues i and j are adjacent
     118!
     119!    NOTE:  Adjacent residues are always in contact (and therefore not
     120!           counted)
     121!
     122!         Here "mxrs" is the maximum number of residues for SMM
     123!         Obviously, this subroutine calculates only NxN part
     124!         of that matrix, N -is the number of res. in "nmol"
     125!
     126! CALLS:  none
     127!..............................................................
    128128
    129129       include 'INCL.H'
     
    146146           do nr_j=nr_i+3,irsml2(nmol) ! Over res. j
    147147
    148 c             write(*,'(2i3)'),nr_i,nr_j
     148!             write(*,'(2i3)'),nr_i,nr_j
    149149
    150150              ic=0
     
    154154
    155155              rij2=(xat(ialf)-xat(jalf))**2
    156      #              +(yat(ialf)-yat(jalf))**2
    157      #                   + (zat(ialf)-zat(jalf))**2
     156     &              +(yat(ialf)-yat(jalf))**2
     157     &                   + (zat(ialf)-zat(jalf))**2
    158158              if(sqrt(rij2).lt.rcut) ic=1
    159159
    160 c             write(*,'(2i3)'),nr_i,nr_j
     160!             write(*,'(2i3)'),nr_i,nr_j
    161161
    162162              ijcont(nr_i,nr_j)=ic
  • difang.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: difang,addang
    4 c
    5 c Copyright 2003       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: difang,addang
     4!
     5! Copyright 2003       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      real*8 function difang(a1,a2)
    1313
    14 c ......................................................
    15 c  PURPOSE:  difang = a2 - a1  with:  -pi < difang <= pi
    16 c           
    17 c  INPUT:    a1,a2-two angles [rad.]
    18 c
    19 c  CALLS: none
    20 c
    21 c ......................................................
     14! ......................................................
     15!  PURPOSE:  difang = a2 - a1  with:  -pi < difang <= pi
     16!           
     17!  INPUT:    a1,a2-two angles [rad.]
     18!
     19!  CALLS: none
     20!
     21! ......................................................
    2222
    2323      implicit real*8 (a-h,o-z)
    2424
    2525      parameter (pi=3.141592653589793d0,
    26      #           pi2=2.d0*pi)
     26     &           pi2=2.d0*pi)
    2727
    2828      d=mod((a2-a1),pi2)
     
    3535      return
    3636      end
    37 c *********************************
     37! *********************************
    3838      real*8 function addang(a1,a2)
    3939
    40 c ......................................................
    41 c  PURPOSE:  addang = a1 + a2  with:  -pi < addang <= pi
    42 c           
    43 c  INPUT:    a1,a2-two angles [rad.]
    44 c
    45 c  CALLS: none
    46 c
    47 c ......................................................
     40! ......................................................
     41!  PURPOSE:  addang = a1 + a2  with:  -pi < addang <= pi
     42!           
     43!  INPUT:    a1,a2-two angles [rad.]
     44!
     45!  CALLS: none
     46!
     47! ......................................................
    4848
    4949      implicit real*8 (a-h,o-z)
    5050
    5151      parameter (pi=3.141592653589793d0,
    52      #           pi2=2.d0*pi)
     52     &           pi2=2.d0*pi)
    5353
    5454      d=mod((a1+a2),pi2)
  • dihedr.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: dihedr,valang
    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: dihedr,valang
     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      real*8 function dihedr(i1,i2,i3,i4)
    1313
    14 c .............................................
    15 c  PURPOSE: return dihedral angle (i1,i2,i3,i4)
    16 c           [in rad.]
    17 c
    18 c  INPUT:   i1,i2,i3,i4 - indices of four atoms
    19 c
    20 c  CALLS:   none
    21 c .............................................
     14! .............................................
     15!  PURPOSE: return dihedral angle (i1,i2,i3,i4)
     16!           [in rad.]
     17!
     18!  INPUT:   i1,i2,i3,i4 - indices of four atoms
     19!
     20!  CALLS:   none
     21! .............................................
    2222
    2323      include 'INCL.H'
     
    4949        dihedr=acos(a)
    5050        if (ux1*(uy2*z2-uz2*y2)+uy1*(uz2*x2-ux2*z2)+
    51      #      uz1*(ux2*y2-uy2*x2).lt.zero) dihedr =-dihedr
     51     &      uz1*(ux2*y2-uy2*x2).lt.zero) dihedr =-dihedr
    5252        return
    5353      else
    5454        write (*,'(a,4i5)')' dihedr> Error in coordinates of atoms #: '
    55      #                     ,i1,i2,i3,i4
     55     &                     ,i1,i2,i3,i4
    5656
    5757        write (*,*) 'stored coordinates are xvals :',
    58      #       xat(i1),xat(i2),xat(i3),xat(i4)
     58     &       xat(i1),xat(i2),xat(i3),xat(i4)
    5959        write (*,*) 'yvals:', yat(i1),yat(i2),yat(i3),yat(i4)
    6060        write (*,*) 'zvals:', zat(i1),zat(i2),zat(i3),zat(i4)
     
    6464
    6565      end
    66 c ************************************
     66! ************************************
    6767      real*8 function valang(i1,i2,i3)
    6868
    69 c .........................................
    70 c  PURPOSE: return valence angle (i1,i2,i3)
    71 c           [in rad.] with 'i2' as vertex
    72 c
    73 c  INPUT:   i1,i2,i3 - indices of 3 atoms
    74 c
    75 c  CALLS:   none
    76 c .............................................
     69! .........................................
     70!  PURPOSE: return valence angle (i1,i2,i3)
     71!           [in rad.] with 'i2' as vertex
     72!
     73!  INPUT:   i1,i2,i3 - indices of 3 atoms
     74!
     75!  CALLS:   none
     76! .............................................
    7777
    7878      include 'INCL.H'
     
    101101      else
    102102        write (*,'(a,3i5)')' valang> Error in coordinates of atoms #: '
    103      #                     ,i1,i2,i3
     103     &                     ,i1,i2,i3
    104104        write (*,*) 'stored coordinates are xvals :',
    105      #       xat(i1),xat(i2),xat(i3)
     105     &       xat(i1),xat(i2),xat(i3)
    106106        write (*,*) 'yvals:', yat(i1),yat(i2),yat(i3)
    107107        write (*,*) 'zvals:', zat(i1),zat(i2),zat(i3)
  • eninteract.f

    r2ebb8b6 rbd2278d  
    1 c *********************************************************************
    2 c This file contains eninteract
    3 c
    4 c Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
    5 c                      Jan H. Meinke, Sandipan Mohanty
    6 c
    7 c
    8 c Description: Calculates the interaction energy between molecules
    9 c The function assumes that all molecules are up-to-date. If in doubt
    10 c call energy first.
    11 c The energy function is based on the ECEPP/3 dataset.
    12 c
    13 c TODO: Intermolecular interaction energy for FLEX and ECEPP/2
     1! *********************************************************************
     2! This file contains eninteract
     3!
     4! Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
     5!                      Jan H. Meinke, Sandipan Mohanty
     6!
     7!
     8! Description: Calculates the interaction energy between molecules
     9! The function assumes that all molecules are up-to-date. If in doubt
     10! call energy first.
     11! The energy function is based on the ECEPP/3 dataset.
     12!
     13! TODO: Intermolecular interaction energy for FLEX and ECEPP/2
    1414      real*8 function eninteract()
    1515
     
    2626              do jres= irsml1(jml), irsml2(jml)
    2727                do iat = iatrs1(ires), iatrs2(ires)
    28 c Atom class of current atom
     28! Atom class of current atom
    2929                  ity=ityat(iat)
    30 c Point charge at current atom
     30! Point charge at current atom
    3131                  cqi=conv*cgat(iat)
    32 c Cartesian coordinates of current atom
     32! Cartesian coordinates of current atom
    3333                  xi=xat(iat)
    3434                  yi=yat(iat)
     
    3636
    3737                  do jat = iatrs1(jres), iatrs2(jres)
    38 c Atom type of partner
     38! Atom type of partner
    3939                    jty=ityat(jat)
    40 c Differences in cartesian coordinates
     40! Differences in cartesian coordinates
    4141                    xj=xat(jat)
    4242                    yj=yat(jat)
     
    4646                    yij=yat(jat)-yi
    4747                    zij=zat(jat)-zi
    48 c Cartesian distance and higher powers
     48! Cartesian distance and higher powers
    4949                    rij2=xij*xij+yij*yij+zij*zij
    5050                    rij4=rij2*rij2
    5151                    rij6=rij4*rij2
    5252                    rij=sqrt(rij2)
    53 c Are we using a distance dependent dielectric constant?
     53! Are we using a distance dependent dielectric constant?
    5454                    if(epsd) then
    5555                      sr=slp*rij
     
    5858                      ep = 1.0d0
    5959                    end if
    60 c Coulomb interaction
     60! Coulomb interaction
    6161                    eyeli=eyeli+cqi*cgat(jat)/(rij*ep)
    62 c If the two atoms cannot form a hydrogen bond use 6-12 Lennard-Jones potential
     62! If the two atoms cannot form a hydrogen bond use 6-12 Lennard-Jones potential
    6363                    if (ihbty(ity,jty).eq.0) then
    6464                      eyvwi=eyvwi+aij(ity,jty)/(rij6*rij6)
    65      #                          -cij(ity,jty)/rij6
     65     &                          -cij(ity,jty)/rij6
    6666                    else
    67 c For hydrogen bonding use 10-12 Lennard-Jones potential
     67! For hydrogen bonding use 10-12 Lennard-Jones potential
    6868                      eyhbi=eyhbi+ahb(ity,jty)/(rij6*rij6)
    69      #                          -chb(ity,jty)/(rij6*rij4)
     69     &                          -chb(ity,jty)/(rij6*rij4)
    7070                    endif
    7171                  enddo
  • enyflx.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: enyflx
    4 c
    5 c Copyright 2003       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: enyflx
     4!
     5! Copyright 2003       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      real*8 function enyflx(nml)
    1414
    15 c .......................................................................
    16 c
    17 c  PURPOSE: Calculate internal energy of molecule 'nml' with FLEX dataset
    18 c
    19 c  CALLS: none
    20 c
    21 c .......................................................................
     15! .......................................................................
     16!
     17!  PURPOSE: Calculate internal energy of molecule 'nml' with FLEX dataset
     18!
     19!  CALLS: none
     20!
     21! .......................................................................
    2222
    2323      include 'INCL.H'
     
    2626      if (ntlvr.eq.0) then
    2727        write (*,'(a,i4)')
    28      #           ' enyflx> No variables defined in molecule #',nml
     28     &           ' enyflx> No variables defined in molecule #',nml
    2929        return
    3030      endif
     
    9292                rij=sqrt(rij2)
    9393                if(epsd) then
    94 c --------------------------------- distance dependent dielectric constant
     94! --------------------------------- distance dependent dielectric constant
    9595                sr=slp_f*rij
    9696                ep=plt-(sr*sr+2.0*sr+2.0)*(plt-1.0)*exp(-sr)/2.0
     
    119119
    120120                  cth=(xij*px+yij*py+zij*pz)/(rij*
    121      #                 sqrt(px*px+py*py+pz*pz))
     121     &                 sqrt(px*px+py*py+pz*pz))
    122122
    123123                  if (cth.gt.0.0) then
    124124                    eyhb=eyhb+ evw + cth*(
    125      #                   (ahb(ity,jty)-aij(ity,jty))/rij12-
    126      #                   (chb(ity,jty)-cij(ity,jty))/rij6 )
     125     &                   (ahb(ity,jty)-aij(ity,jty))/rij12-
     126     &                   (chb(ity,jty)-cij(ity,jty))/rij6 )
    127127                  else                             ! No Hydrogen Bond
    128128                    eyvw=eyvw + evw
     
    153153              rij=sqrt(rij2)
    154154              if(epsd) then
    155 c --------------------------------- distance dependent dielectric constant
     155! --------------------------------- distance dependent dielectric constant
    156156              sr=slp_f*rij
    157157              ep=plt-(sr*sr+2.0*sr+2.0)*(plt-1.)*exp(-sr)/2.0
     
    180180
    181181                cth=(xij*px+yij*py+zij*pz)/(rij*
    182      #               sqrt(px*px+py*py+pz*pz))
     182     &               sqrt(px*px+py*py+pz*pz))
    183183
    184184                if (cth.gt.0.0) then
    185185                  eyhb=eyhb+ evw + cth*(
    186      #                 (ahb(ity,jty)-a14(ity,jty))/rij12-
    187      #                 (chb(ity,jty)-cij(ity,jty))/rij6 )
     186     &                 (ahb(ity,jty)-a14(ity,jty))/rij12-
     187     &                 (chb(ity,jty)-cij(ity,jty))/rij6 )
    188188                else                             ! No Hydrogen Bond
    189189                  eyvw=eyvw + evw
  • enylun.f

    r2ebb8b6 rbd2278d  
    1 c *******************************************************************
    2 c SMMP version of Anders Irback's force field, to be called the Lund
    3 c force field. This file contains the function enylun, which in turn
    4 c calls all the terms in the energy function. The terms Bias (ebias),
    5 c Hydrogen bonds (ehbmm and ehbms), Hydrophobicity (ehp) and the
    6 c Excluded volume (eexvol and eloexv) are also implemented in this
    7 c file.
    8 c
    9 c Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
    10 c                      Jan H. Meinke, Sandipan Mohanty
    11 c
     1! *******************************************************************
     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
     7! file.
     8!
     9! Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
     10!                      Jan H. Meinke, Sandipan Mohanty
     11!
    1212      subroutine init_lundff
    1313      include 'INCL.H'
     
    1717
    1818      print *,'initializing Lund forcefield'
    19 c     Some parameters in the Lund force field.
    20 c     The correspondence between internal energy scale and kcal/mol
     19!     Some parameters in the Lund force field.
     20!     The correspondence between internal energy scale and kcal/mol
    2121      eunit=1.3315
    22 c     Bias
     22!     Bias
    2323      kbias=100.0*eunit
    24 c      print *,'Bias'
    25 c     Hydrogen bonds
     24!      print *,'Bias'
     25!     Hydrogen bonds
    2626      epshb1=3.1*eunit
    2727      epshb2=2.0*eunit
     
    3737      cacc=(1.0/1.23)**powb
    3838      csacc=(1.0/1.25)**powb
    39 c      print *,'Hydrogen bonds'
    40 c     Hydrophobicity
    41 c      print *,'Hydrophobicity with nhptyp = ',nhptyp
     39!      print *,'Hydrogen bonds'
     40!     Hydrophobicity
     41!      print *,'Hydrophobicity with nhptyp = ',nhptyp
    4242
    4343      hpstrg(1)=0.0*eunit
     
    6161         call tolost(mynm)
    6262         if ((mynm.eq.'pro').or.(mynm.eq.'cpro')
    63      #           .or.(mynm.eq.'cpru').or.(mynm.eq.'prou')
    64      #           .or.(mynm.eq.'pron').or.(mynm.eq.'pro+')) then
     63     &           .or.(mynm.eq.'cpru').or.(mynm.eq.'prou')
     64     &           .or.(mynm.eq.'pron').or.(mynm.eq.'pro+')) then
    6565            prlvr=.true.        ! residue i is a proline variant
    6666         else
     
    125125         endif
    126126      enddo
    127 c      print *,'Hydrophobicity'
    128 
    129 c     Excluded volume and local pair excluded volume terms
     127!      print *,'Hydrophobicity'
     128
     129!     Excluded volume and local pair excluded volume terms
    130130      exvk=0.1*eunit
    131131      exvcut=4.3
     
    158158         enddo
    159159      enddo
    160 c      print *,'Local pair excluded volume constants'
     160!      print *,'Local pair excluded volume constants'
    161161
    162162      exvlam=0.75
     
    171171         enddo
    172172      enddo
    173 c      print *,'General excluded volume constants'
    174 
    175 c     Initialization of the connections matrix matcon(i,j). The index
    176 c     i runs from -mxconr to +mxconr, and j from 1 to mxat.
    177 c     matcon(i2-i1,i1) = 0, if the distance between atoms i1 and i2 is fixed
    178 c                      = 2, if atoms i1 and i2 are separated by 3 covalent
    179 c                           bonds and their distance can change
    180 c                      = 1, for all other pairs
    181 c     if abs(i2-i1) > mxconr, the atoms are assumed to be separated by
    182 c     many bonds, and with no restriction on their distances. On a protein
    183 c     molecule made of natural amino acids, atoms with indices separated
    184 c     by more than 35 can not be connected by three covalent bonds.
     173!      print *,'General excluded volume constants'
     174
     175!     Initialization of the connections matrix matcon(i,j). The index
     176!     i runs from -mxconr to +mxconr, and j from 1 to mxat.
     177!     matcon(i2-i1,i1) = 0, if the distance between atoms i1 and i2 is fixed
     178!                      = 2, if atoms i1 and i2 are separated by 3 covalent
     179!                           bonds and their distance can change
     180!                      = 1, for all other pairs
     181!     if abs(i2-i1) > mxconr, the atoms are assumed to be separated by
     182!     many bonds, and with no restriction on their distances. On a protein
     183!     molecule made of natural amino acids, atoms with indices separated
     184!     by more than 35 can not be connected by three covalent bonds.
    185185
    186186      do i=1,mxat
     
    190190         matcon(0,i)=0
    191191      enddo
    192 c     continued...
     192!     continued...
    193193      do iml=1,ntlml
    194194         do iat1=iatrs1(irsml1(iml)),iatrs2(irsml2(iml))
     
    224224         enddo
    225225
    226 c         print *,'going to initialize connections for first residue'
    227 c         print *,'iN,iCa,iC =',iN(irsml1(iml)),
    228 c     #        iCa(irsml1(iml)),iC(irsml1(iml))
     226!         print *,'going to initialize connections for first residue'
     227!         print *,'iN,iCa,iC =',iN(irsml1(iml)),
     228!     #        iCa(irsml1(iml)),iC(irsml1(iml))
    229229         do iat1=iN(irsml1(iml))+1,iCa(irsml1(iml))-1
    230 c            print *,'connections for iat1 = ',iat1
     230!            print *,'connections for iat1 = ',iat1
    231231            matcon(iat1-iN(irsml1(iml)),iN(irsml1(iml)))=0
    232232            matcon(iN(irsml1(iml))-iat1,iat1)=0
     
    242242         enddo
    243243
    244 c     Below: for certain residues, some atoms separated by 3 or more bonds
    245 c     do not change distance. So, the connection matrix term for such pairs
    246 c     should be zero.
     244!     Below: for certain residues, some atoms separated by 3 or more bonds
     245!     do not change distance. So, the connection matrix term for such pairs
     246!     should be zero.
    247247
    248248         do irs=irsml1(iml),irsml2(iml)
     
    260260            call tolost(mynm)
    261261            if ((mynm.eq.'pro').or.(mynm.eq.'cpro')
    262      #              .or.(mynm.eq.'cpru').or.(mynm.eq.'prou')
    263      #              .or.(mynm.eq.'pron').or.(mynm.eq.'pro+')) then
     262     &              .or.(mynm.eq.'cpru').or.(mynm.eq.'prou')
     263     &              .or.(mynm.eq.'pron').or.(mynm.eq.'pro+')) then
    264264               prlvr=.true.     ! residue i is a proline variant
    265265            else
     
    275275               enddo
    276276            else if ((mynm.eq.'his').or.(mynm.eq.'hise')
    277      #              .or.(mynm.eq.'hisd').or.(mynm.eq.'his+')) then
     277     &              .or.(mynm.eq.'hisd').or.(mynm.eq.'his+')) then
    278278               do iat1=iatoff+iatrs1(irs)+7,iatrs2(irs)-2-iatmrg
    279279                  do iat2=iat1+1,iatrs2(irs)-2-iatmrg
     
    306306               enddo
    307307            else if (prlvr) then
    308 c           Proline. Many more distances are fixed because of the fixed
    309 c           phi angle
     308!           Proline. Many more distances are fixed because of the fixed
     309!           phi angle
    310310               do iat1=iatoff+iatrs1(irs),iatrs2(irs)-2-iatmrg
    311311                  do iat2=iat1+1,iatrs2(irs)-2-iatmrg
     
    314314                  enddo
    315315               enddo
    316 c           distances to the C' atom of the previous residue are also fixed
     316!           distances to the C' atom of the previous residue are also fixed
    317317               if (irs.ne.irsml1(iml)) then
    318318                  iat1=iowat(iatrs1(irs))
     
    325325         enddo
    326326      enddo
    327 c     finished initializing matrix conmat
    328 c      print *,'Connections matrix'
    329 
    330 c     Local pair excluded volume
     327!     finished initializing matrix conmat
     328!      print *,'Connections matrix'
     329
     330!     Local pair excluded volume
    331331      do i=1,mxml
    332332         ilpst(i)=1
     
    342342            do iat2=iat1+1,iatrs2(irsml2(iml))
    343343               if ((iat2-iat1.le.mxconr).and.
    344      #                 matcon(iat2-iat1,iat1).eq.2) then
     344     &                 matcon(iat2-iat1,iat1).eq.2) then
    345345                  ilp=ilp+1
    346346                  lcp1(ilp)=iat1
     
    354354            ilpst(iml+1)=ilp+1
    355355         endif
    356 c         print *,'molecule ',iml,' lc pair range ',ilpst(iml),ilpnd(iml)
    357 c         print *,'local pair list'
     356!         print *,'molecule ',iml,' lc pair range ',ilpst(iml),ilpnd(iml)
     357!         print *,'local pair list'
    358358         do lci=ilpst(iml),ilpnd(iml)
    359359            iat1=lcp1(lci)
    360360            iat2=lcp2(lci)
    361 c            print *,lci,iat1,iat2,matcon(iat2-iat1,iat1)
     361!            print *,lci,iat1,iat2,matcon(iat2-iat1,iat1)
    362362         enddo
    363363      enddo
     
    375375         ityp=1
    376376      else if ((mynm.eq.'val').or.(mynm.eq.'leu').or.(mynm.eq.'ile')
    377      #        .or.(mynm.eq.'met').or.(mynm.eq.'pro').or.(mynm.eq.'cpro')
    378      #        .or.(mynm.eq.'cpru').or.(mynm.eq.'prou')
    379      #        .or.(mynm.eq.'pron').or.(mynm.eq.'pro+')) then
     377     &        .or.(mynm.eq.'met').or.(mynm.eq.'pro').or.(mynm.eq.'cpro')
     378     &        .or.(mynm.eq.'cpru').or.(mynm.eq.'prou')
     379     &        .or.(mynm.eq.'pron').or.(mynm.eq.'pro+')) then
    380380         ityp=2
    381381      else if ((mynm.eq.'phe').or.(mynm.eq.'tyr').or.(mynm.eq.'trp'))
    382      #        then
     382     &        then
    383383         ityp=3
    384384      endif
     
    408408      return
    409409      end
    410 c     Evaluates backbone backbone hydrogen bond strength for residues
    411 c     i and j, taking the donor from residue i and acceptor from residue j
     410!     Evaluates backbone backbone hydrogen bond strength for residues
     411!     i and j, taking the donor from residue i and acceptor from residue j
    412412      real*8 function ehbmmrs(i,j)
    413413      include 'INCL.H'
     
    424424      r2=dx*dx+dy*dy+dz*dz
    425425      if (r2.gt.cthb2) then
    426 c         print *,'hbmm = 0 ',cthb2,r2,a1,a2,d1,d2
    427 c         print *,'a1,a2,d1,d2,r2 = ',a1,a2,d1,d2,r2,sighb2,cthb
     426!         print *,'hbmm = 0 ',cthb2,r2,a1,a2,d1,d2
     427!         print *,'a1,a2,d1,d2,r2 = ',a1,a2,d1,d2,r2,sighb2,cthb
    428428         ehbmmrs=0
    429429         return
     
    432432      cb=(xat(a2)-xat(a1))*dx+(yat(a2)-yat(a1))*dy+(zat(a2)-zat(a1))*dz
    433433      if (powa.gt.0.and.ca.le.0) then
    434 c         print *,'hbmm, returning 0 because of angle a'
     434!         print *,'hbmm, returning 0 because of angle a'
    435435         ehbmmrs=0
    436436         return
    437437      endif
    438438      if (powb.gt.0.and.cb.le.0) then
    439 c         print *,'hbmm, returning 0 because of angle b'
     439!         print *,'hbmm, returning 0 because of angle b'
    440440         ehbmmrs=0
    441441         return
     
    446446      evlu=((ca*ca/r2)**(0.5*powa))*((cb*cb/r2)**(0.5*powb))
    447447      evlu=evlu*(r6*(5*r6-6*r4)+alhb+blhb*r2)
    448 c      print *,'found hbmm contribution ',evlu
     448!      print *,'found hbmm contribution ',evlu
    449449      ehbmmrs=epshb1*evlu
    450450      return
    451451      end
    452452      real*8 function enylun(nml)
    453 c     nml = 1 .. ntlml. No provision exists to handle out of range values
    454 c     for nml inside this function.
     453!     nml = 1 .. ntlml. No provision exists to handle out of range values
     454!     for nml inside this function.
    455455      include 'INCL.H'
    456456      include 'incl_lund.h'
     
    462462      eyvr=0.0   ! Local pair excluded volume, in a sense a variable potential
    463463      eyvw=0.0   ! atom-atom repulsion, excluded volume
    464 c     atom-atom repulsion is calculated on a system wide basis, instead of
    465 c     molecule by molecule for efficiency. Look into function exvlun.
     464!     atom-atom repulsion is calculated on a system wide basis, instead of
     465!     molecule by molecule for efficiency. Look into function exvlun.
    466466
    467467      istres=irsml1(nml)
    468468      indres=irsml2(nml)
    469469
    470 c     First, all terms that can be calculated on a residue by residue basis
     470!     First, all terms that can be calculated on a residue by residue basis
    471471      do i=istres,indres
    472472         mynm=seq(i)
    473473         call tolost(mynm)
    474474         if ((mynm.eq.'pro').or.(mynm.eq.'cpro')
    475      #           .or.(mynm.eq.'cpru').or.(mynm.eq.'prou')
    476      #           .or.(mynm.eq.'pron').or.(mynm.eq.'pro+')) then
     475     &           .or.(mynm.eq.'cpru').or.(mynm.eq.'prou')
     476     &           .or.(mynm.eq.'pron').or.(mynm.eq.'pro+')) then
    477477            prlvr=.true.        ! residue i is a proline variant
    478478         else
     
    480480         endif
    481481
    482 c     Bias, or local electrostatic term. Excluded from the list are
    483 c     residues at the ends of the chain, glycine and all proline variants
     482!     Bias, or local electrostatic term. Excluded from the list are
     483!     residues at the ends of the chain, glycine and all proline variants
    484484         if ((i.ne.istres).and.(i.ne.indres).and.
    485      #           .not.prlvr.and.mynm.ne.'gly') then
     485     &           .not.prlvr.and.mynm.ne.'gly') then
    486486            eyel=eyel+ebiasrs(i)
    487487         endif
    488 c     Backbone--backbone hydrogen bonds
     488!     Backbone--backbone hydrogen bonds
    489489         shbm1=1.0
    490490         shbm2=1.0
    491491         if ((i.eq.istres).or.(i.eq.indres)) shbm1=0.5
    492 c     Residue i contributes the donor, and j, the acceptor, so both i and
    493 c     j run over the whole set of amino acids.
    494 c     No terms for residue i, if it is a proline variant.
     492!     Residue i contributes the donor, and j, the acceptor, so both i and
     493!     j run over the whole set of amino acids.
     494!     No terms for residue i, if it is a proline variant.
    495495         if (.not.prlvr) then 
    496496            do j=istres,indres
     
    500500            enddo
    501501         endif
    502 c     Hydrophobicity, only if residue i is hydrophobic to start with
     502!     Hydrophobicity, only if residue i is hydrophobic to start with
    503503         ihpi=ihptype(i)
    504504         if (ihpi.ge.0) then
    505 c        Unlike hydrogen bonds, the hydrophobicity potential is symmetric
    506 c        in i and j. So, the loop for j runs from i+1 to the end.
     505!        Unlike hydrogen bonds, the hydrophobicity potential is symmetric
     506!        in i and j. So, the loop for j runs from i+1 to the end.
    507507
    508508            do j=i+1,indres
     
    518518      enddo
    519519
    520 c     Terms that are not calculated residue by residue ...
    521 
    522 c     Local pair or third-neighbour excluded volume
    523 c     Numerically this is normally the term with largest positive
    524 c     contribution to the energy in an equilibrated stystem.
     520!     Terms that are not calculated residue by residue ...
     521
     522!     Local pair or third-neighbour excluded volume
     523!     Numerically this is normally the term with largest positive
     524!     contribution to the energy in an equilibrated stystem.
    525525
    526526      i1=ilpst(nml)
     
    546546            etmp=etmp+etmp1
    547547         endif
    548 c         print *,'pair : ',iat1,iat2,' contribution ',etmp1
    549 c         print *,exvcut2,r2
     548!         print *,'pair : ',iat1,iat2,' contribution ',etmp1
     549!         print *,exvcut2,r2
    550550      enddo
    551551      eyvr=exvk*etmp
     
    569569      b2=20.25
    570570      a2=12.25
    571 c      ihp1=ihptype(i1)
    572 c      ihp2=ihptype(i2)
     571!      ihp1=ihptype(i1)
     572!      ihp2=ihptype(i2)
    573573      if ((ihp1.le.0).or.(ihp2.le.0)) then
    574574         ehp=0.0
     
    609609      include 'INCL.H'
    610610      include 'incl_lund.h'
    611 c     For multi-chain systems it makes little sense to split the calculation
    612 c     of this term into an 'interaction part' and a contribution from
    613 c     individual molecules. So, normally this should always be called with
    614 c     argument nml=0. Only for diagnostic reasons, you might want to find
    615 c     the contribution from one molecule in a multi-chain system assuming
    616 c     there was no other molecule.
     611!     For multi-chain systems it makes little sense to split the calculation
     612!     of this term into an 'interaction part' and a contribution from
     613!     individual molecules. So, normally this should always be called with
     614!     argument nml=0. Only for diagnostic reasons, you might want to find
     615!     the contribution from one molecule in a multi-chain system assuming
     616!     there was no other molecule.
    617617      dimension isort(mxat),ngbr(mxat),locccl(mxat),incell(mxcell)
    618618      dimension icell(mxat)
     
    626626
    627627      eyvw=0.0
    628 c     The beginning part of this implementation is very similar to the
    629 c     assignment of cells to the atoms during calculation of solvent
    630 c     accessible surface area. So, much of that part is similar. But
    631 c     unlike the accessible surface calculations, this term is symmetric
    632 c     in any two participating atoms. So, the part after the assignment
    633 c     of cells differs even in the structure of the code.
     628!     The beginning part of this implementation is very similar to the
     629!     assignment of cells to the atoms during calculation of solvent
     630!     accessible surface area. So, much of that part is similar. But
     631!     unlike the accessible surface calculations, this term is symmetric
     632!     in any two participating atoms. So, the part after the assignment
     633!     of cells differs even in the structure of the code.
    634634
    635635      do i=1,mxcell
    636636         incell(i)=0
    637637      enddo
    638 c      print *,'evaluating general excluded volume :',istat,',',indat
    639 c     Find minimal containing box
     638!      print *,'evaluating general excluded volume :',istat,',',indat
     639!     Find minimal containing box
    640640      xmin=xat(istat)
    641641      ymin=yat(istat)
     
    666666      sizey=ymax-ymin
    667667      sizez=zmax-zmin
    668 c     Number of cells along each directions that fit into the box.
     668!     Number of cells along each directions that fit into the box.
    669669      ndx=int(sizex/exvcutg)+1
    670670      ndy=int(sizey/exvcutg)+1
     
    673673      nxy=ndx*ndy
    674674      ncell=nxy*ndz
    675 c      print *,'Number of cells along x,y,z = ',ndx,',',ndy,',',ndz
     675!      print *,'Number of cells along x,y,z = ',ndx,',',ndy,',',ndz
    676676      if (ncell.ge.mxcell) then
    677677         print *,'exvlun> required number of cells',ncell,
    678      #        ' exceeded the limit ',mxcell
     678     &        ' exceeded the limit ',mxcell
    679679         print *,'recompile with a higher mxcell.'
    680680         stop
    681681      endif
    682 c     Expand box to contain an integral number of cells along each direction
     682!     Expand box to contain an integral number of cells along each direction
    683683      shiftx=(dble(ndx)*exvcutg-sizex)/2.0
    684684      shifty=(dble(ndy)*exvcutg-sizey)/2.0
     
    691691      zmax=zmax+shiftz
    692692
    693 c     Set occupied cells to zero. Note that the maximum number of occupied
    694 c     cells is the number of atoms in the system.
     693!     Set occupied cells to zero. Note that the maximum number of occupied
     694!     cells is the number of atoms in the system.
    695695      nocccl=0
    696696      do i=1,mxat
     
    698698      enddo
    699699
    700 c     Put atoms in cells
     700!     Put atoms in cells
    701701      do j=istat,indat
    702702         mx=min(int(max((xat(j)-xmin)/exvcutg,0.0d0)),ndx-1)
     
    710710         else
    711711            if (incell(icellj).eq.0) then
    712 c           previously unoccupied cell
     712!           previously unoccupied cell
    713713               nocccl=nocccl+1
    714714               locccl(nocccl)=icellj
     
    717717         endif
    718718      enddo
    719 c      print *,'finished assigning cells. nocccl = ',nocccl
    720 c     Cummulative occupancy of i'th cell
     719!      print *,'finished assigning cells. nocccl = ',nocccl
     720!     Cummulative occupancy of i'th cell
    721721      do i=1,ncell
    722722         incell(i+1)=incell(i+1)+incell(i)
    723723      enddo
    724 c      print *,'finished making cumulative cell sums'
    725 c     Sorting atoms by their cell index
     724!      print *,'finished making cumulative cell sums'
     725!     Sorting atoms by their cell index
    726726      do i=istat,indat
    727727         j=icell(i)
     
    730730         incell(j)=jj-1
    731731      enddo
    732 c      print *,'sorted atoms by cell index'
     732!      print *,'sorted atoms by cell index'
    733733      etmp=0.0
    734734      do icl=1,nocccl
    735 c     loop through occupied cells
     735!     loop through occupied cells
    736736         lcell=locccl(icl)
    737737         ix=mod(lcell-1,ndx)
    738738         iy=(mod(lcell-1,nxy)-ix)/ndx
    739739         iz=(lcell-1-ix-ndx*iy)/nxy
    740 c         print *,'icl=',icl,'absolute index of cell = ',lcell
    741 c         print *,'iz,iy,ix = ',iz,iy,ix
    742 c     find all atoms in current cell and all its forward-going neighbours
     740!         print *,'icl=',icl,'absolute index of cell = ',lcell
     741!         print *,'iz,iy,ix = ',iz,iy,ix
     742!     find all atoms in current cell and all its forward-going neighbours
    743743         nex=min(ix+1,ndx-1)
    744744         ney=min(iy+1,ndy-1)
     
    751751                  jcl=jx+ndx*jy+nxy*jz+1
    752752                  do ii=incell(jcl)+1,incell(jcl+1)
    753 c                    count the total number of neighbours
     753!                    count the total number of neighbours
    754754                     nngbr=nngbr+1
    755755                     if (jx.eq.ix.and.jy.eq.iy.and.jz.eq.iz) then
    756 c                    count how many neighbours are from the same cell
     756!                    count how many neighbours are from the same cell
    757757                        nsame=nsame+1
    758758                     endif
     
    762762            enddo
    763763         enddo
    764 c     A few more cells need to be searched, so that we cover 13 of the 26
    765 c     neighbouring cells.
    766 c        1
     764!     A few more cells need to be searched, so that we cover 13 of the 26
     765!     neighbouring cells.
     766!        1
    767767         jx=ix+1
    768768         jy=iy
     
    773773            ngbr(nngbr)=isort(ii)
    774774         enddo
    775 c        2
     775!        2
    776776         jx=ix
    777777         jy=iy-1
     
    782782            ngbr(nngbr)=isort(ii)
    783783         enddo
    784 c        3
     784!        3
    785785         jx=ix-1
    786786         jy=iy+1
     
    791791            ngbr(nngbr)=isort(ii)
    792792         enddo
    793 c        4
     793!        4
    794794         jx=ix+1
    795795         jy=iy+1
     
    800800            ngbr(nngbr)=isort(ii)
    801801         enddo
    802 c        5
     802!        5
    803803         jx=ix+1
    804804         jy=iy-1
     
    809809            ngbr(nngbr)=isort(ii)
    810810         enddo
    811 c        6
     811!        6
    812812         jx=ix+1
    813813         jy=iy-1
     
    819819         enddo
    820820
    821 c         print *,'atoms in same cell ',nsame
    822 c         print *,'atoms in neighbouring cells ',nngbr
     821!         print *,'atoms in same cell ',nsame
     822!         print *,'atoms in neighbouring cells ',nngbr
    823823         do i1=1,nsame
    824 c        Over all atoms from the original cell
     824!        Over all atoms from the original cell
    825825            iat1=ngbr(i1)
    826826            do i2=i1,nngbr
    827 c           Over all atoms in the original+neighbouring cells
     827!           Over all atoms in the original+neighbouring cells
    828828               iat2=ngbr(i2)
    829829               xij=xat(iat1)-xat(iat2)
     
    834834               if (r2.le.exvcutg2) then
    835835                  if (abs(iat2-iat1).gt.mxconr.or.
    836      #                 matcon(iat2-iat1,iat1).eq.1) then
     836     &                 matcon(iat2-iat1,iat1).eq.1) then
    837837                     iatt1=ityat(iat1)
    838838                     iatt2=ityat(iat2)
     
    840840                     r6=r6*r6*r6
    841841                     etmp1=r6*r6+asaexv(iatt1,iatt2)
    842      #                    +bsaexv(iatt1,iatt2)*r2
     842     &                    +bsaexv(iatt1,iatt2)*r2
    843843                     etmp=etmp+etmp1
    844 c                     if (etmp1.ge.2000) then
    845 c                        print *,'contribution ',iat1,iat2,etmp1
    846 c                        call outpdb(1,'EXAMPLES/clash.pdb')
    847 c                        stop
    848 c                     endif
     844!                     if (etmp1.ge.2000) then
     845!                        print *,'contribution ',iat1,iat2,etmp1
     846!                        call outpdb(1,'EXAMPLES/clash.pdb')
     847!                        stop
     848!                     endif
    849849                  endif
    850850               endif
     
    852852         enddo
    853853      enddo
    854 c      irs=1
    855 c      do iat=iatrs1(irs),iatrs2(irs)
    856 c         do j=-mxconr,mxconr
    857 c            print *,iat,j,':',matcon(j,iat)
    858 c         enddo
    859 c      enddo
    860 c      irs=irsml2(1)
    861 c      do iat=iatrs1(irs),iatrs2(irs)
    862 c         do j=-mxconr,mxconr
    863 c            print *,iat,j,':',matcon(j,iat)
    864 c         enddo
    865 c      enddo
     854!      irs=1
     855!      do iat=iatrs1(irs),iatrs2(irs)
     856!         do j=-mxconr,mxconr
     857!            print *,iat,j,':',matcon(j,iat)
     858!         enddo
     859!      enddo
     860!      irs=irsml2(1)
     861!      do iat=iatrs1(irs),iatrs2(irs)
     862!         do j=-mxconr,mxconr
     863!            print *,iat,j,':',matcon(j,iat)
     864!         enddo
     865!      enddo
    866866
    867867      eyvw=exvk*etmp
     
    871871
    872872      real*8 function exvbrfc()
    873 c     Brute force excluded volume evaluation
     873!     Brute force excluded volume evaluation
    874874      include 'INCL.H'
    875875      include 'incl_lund.h'
     
    887887            if (r2.le.exvcutg2) then
    888888               if (abs(iat2-iat1).gt.mxconr.or.
    889      #                 matcon(iat2-iat1,iat1).eq.1) then
     889     &                 matcon(iat2-iat1,iat1).eq.1) then
    890890                  iatt1=ityat(iat1)
    891891                  iatt2=ityat(iat2)
     
    893893                  r6=r6*r6*r6
    894894                  etmp1=r6*r6+asaexv(iatt1,iatt2)
    895      #                 +bsaexv(iatt1,iatt2)*r2
     895     &                 +bsaexv(iatt1,iatt2)*r2
    896896                  etmp=etmp+etmp1
    897897                  if (iat1.eq.43.and.iat2.eq.785) then
     
    903903                     print *,'bsa = ',bsaexv(iatt1,iatt2)
    904904
    905 c     call outpdb(1,'EXAMPLES/clash.pdb')
    906 c     stop
     905!     call outpdb(1,'EXAMPLES/clash.pdb')
     906!     stop
    907907                  endif
    908908               else
    909 c                  print *,'atoms ', iat1,' and ',iat2,' were close',
    910 c     #                 'but matcon is ',matcon(iat2-iat1,iat1)
     909!                  print *,'atoms ', iat1,' and ',iat2,' were close',
     910!     #                 'but matcon is ',matcon(iat2-iat1,iat1)
    911911               endif
    912912            endif
  • enyreg.f

    r2ebb8b6 rbd2278d  
    33! Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
    44!                      Jan H. Meinke, Sandipan Mohanty
    5 c *******************************
     5! *******************************
    66      real*8 function enyreg(nml)
    77
    8 c ----------------------------------------------------
    9 c
    10 c PURPOSE: sum( ( R_i - R^ref_j )**2 )
    11 c
    12 c    with: R_i     - atom position i in SMMP structure
    13 c          R^ref_j - corresponding atom j in PDB str.
    14 c
    15 c CALLS: none
    16 c
    17 c ----------------------------------------------------
     8! ----------------------------------------------------
     9!
     10! PURPOSE: sum( ( R_i - R^ref_j )**2 )
     11!
     12!    with: R_i     - atom position i in SMMP structure
     13!          R^ref_j - corresponding atom j in PDB str.
     14!
     15! CALLS: none
     16!
     17! ----------------------------------------------------
    1818
    1919      include 'INCL.H'
     
    2929
    3030          eny = eny + (xat(i)-xatp(j))**2+(yat(i)-yatp(j))**2+
    31      #                (zat(i)-zatp(j))**2
     31     &                (zat(i)-zatp(j))**2
    3232        endif
    3333      enddo   ! atoms
  • enyshe.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: enyshe
    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: enyshe
     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      real*8 function enyshe(nml)
    1414
    15 c ............................................................................
    16 c
    17 c PURPOSE: Calculate internal energy of molecule 'nml' with ECEPP parameters
    18 c
    19 c CALLS: none
    20 c
    21 c The function loops over all moving sets within the molecule. Within
    22 c this loop it loops over the van-der-Waals domains of each atom in the
    23 c moving set and finally over the atoms that belong to the 1-4 interaction
    24 c set.
    25 c ............................................................................
     15! ............................................................................
     16!
     17! PURPOSE: Calculate internal energy of molecule 'nml' with ECEPP parameters
     18!
     19! CALLS: none
     20!
     21! The function loops over all moving sets within the molecule. Within
     22! this loop it loops over the van-der-Waals domains of each atom in the
     23! moving set and finally over the atoms that belong to the 1-4 interaction
     24! set.
     25! ............................................................................
    2626
    2727      include 'INCL.H'
    2828
    29 c If nml == 0 calculate the interaction between all pairs.
     29! If nml == 0 calculate the interaction between all pairs.
    3030      if (nml.eq.0) then
    3131          ntlvr = nvr
     
    3636      if (ntlvr.eq.0) then
    3737        write (*,'(a,i4)')
    38      #           ' enyshe> No variables defined in molecule #',nml
     38     &           ' enyshe> No variables defined in molecule #',nml
    3939        return
    4040      endif
     
    4949        i1s = imsml1(ntlml) + nmsml(ntlml)
    5050      else
    51 c Index of first variable in molecule.
     51! Index of first variable in molecule.
    5252        ifivr=ivrml1(nml)
    53 c Index of last moving set in molecule
     53! Index of last moving set in molecule
    5454        i1s=imsml1(nml)+nmsml(nml)
    5555      endif
    56 c Loop over moving sets/variables in reverse order     
     56! Loop over moving sets/variables in reverse order     
    5757      do io=ifivr+ntlvr-1,ifivr,-1 
    58 c The array iorvr contains the variables in an "apropriate" order.
     58! The array iorvr contains the variables in an "apropriate" order.
    5959        iv=iorvr(io)       
    60 c Index of the primary moving atom for the variable with index iv
     60! Index of the primary moving atom for the variable with index iv
    6161        ia=iatvr(iv)       
    62 c Get the type of variable iv (valence length, valence angle, dihedral angle)
     62! Get the type of variable iv (valence length, valence angle, dihedral angle)
    6363        it=ityvr(iv)       
    64 c Class of variable iv's potential  (Q: What are they)
     64! Class of variable iv's potential  (Q: What are they)
    6565        ic=iclvr(iv)       
    66 c If iv is a dihedral angle ...
     66! If iv is a dihedral angle ...
    6767        if (it.eq.3) then     
    68 c Barrier height * 1/2 of the potential of iv.
     68! Barrier height * 1/2 of the potential of iv.
    6969          e0=e0to(ic)
    70 c Calculate the periodic potential term. sgto is the sign of the barrier, rnto is
    71 c the periodicity and toat is torsion angle(?) associate with atom ia.
     70! Calculate the periodic potential term. sgto is the sign of the barrier, rnto is
     71! the periodicity and toat is torsion angle(?) associate with atom ia.
    7272          if (e0.ne.0.)
    73      #         eyvr=eyvr+e0*(1.0+sgto(ic)*cos(toat(ia)*rnto(ic)))
    74 c else if iv is a valence angle ...
     73     &         eyvr=eyvr+e0*(1.0+sgto(ic)*cos(toat(ia)*rnto(ic)))
     74! else if iv is a valence angle ...
    7575        elseif (it.eq.2) then 
    76 c vr is the valence angle of ia
     76! vr is the valence angle of ia
    7777          vr=baat(ia)
    78 c else if iv is a valence length...
     78! else if iv is a valence length...
    7979        elseif (it.eq.1) then 
    80 c vr is the length of the valence bond
     80! vr is the length of the valence bond
    8181          vr=blat(ia)
    8282        endif
    8383
    84 c ============================================ Energies & Atomic forces
    85 c index of next to last moving set
     84! ============================================ Energies & Atomic forces
     85! index of next to last moving set
    8686        i2s=i1s-1
    87 c index of first moving set associated with iv
     87! index of first moving set associated with iv
    8888        i1s=imsvr1(iv)
    89 c Loop over all moving sets starting from the one associated with vr to the end.
     89! Loop over all moving sets starting from the one associated with vr to the end.
    9090        do ims=i1s,i2s 
    91 c First atom of the current moving set
     91! First atom of the current moving set
    9292          i1=latms1(ims)
    93 c Last atom of the current moving set
     93! Last atom of the current moving set
    9494          i2=latms2(ims)
    95 c Loop over all atoms of the current moving set.
     95! Loop over all atoms of the current moving set.
    9696          do i=i1,i2 
    97 c Atom class of current atom
     97! Atom class of current atom
    9898            ity=ityat(i)
    99 c Point charge at current atom
     99! Point charge at current atom
    100100            cqi=conv*cgat(i)
    101 c Cartesian coordinates of current atom
     101! Cartesian coordinates of current atom
    102102            xi=xat(i)
    103103            yi=yat(i)
    104104            zi=zat(i)
    105 c Loop over the atoms of the van der Waals domain belonging to atom i
     105! Loop over the atoms of the van der Waals domain belonging to atom i
    106106            do ivw=ivwat1(i),ivwat2(i) 
    107 c Loop over the atoms of the van der Waals domain of the atoms of the
    108 c van der Waals domain of atom i
    109 c Q: Which atoms are in these domains?
     107! Loop over the atoms of the van der Waals domain of the atoms of the
     108! van der Waals domain of atom i
     109! Q: Which atoms are in these domains?
    110110              do j=lvwat1(ivw),lvwat2(ivw) 
    111 c Atom type of partner
     111! Atom type of partner
    112112                jty=ityat(j)
    113 c Differences in cartesian coordinates
     113! Differences in cartesian coordinates
    114114                xij=xat(j)-xi
    115115                yij=yat(j)-yi
    116116                zij=zat(j)-zi
    117 c Cartesian distance and higher powers
     117! Cartesian distance and higher powers
    118118                rij2=xij*xij+yij*yij+zij*zij
    119119                rij4=rij2*rij2
    120120                rij6=rij4*rij2
    121121                rij=sqrt(rij2)
    122 c Are we using a distance dependent dielectric constant?
     122! Are we using a distance dependent dielectric constant?
    123123                if(epsd) then
    124124                 sr=slp*rij
     
    127127                 ep = 1.0d0
    128128                end if
    129 c Coulomb interaction
     129! Coulomb interaction
    130130                eyel=eyel+cqi*cgat(j)/(rij*ep)
    131 c If the two atoms cannot form a hydrogen bond use 6-12 Lennard-Jones potential
     131! If the two atoms cannot form a hydrogen bond use 6-12 Lennard-Jones potential
    132132                if (ihbty(ity,jty).eq.0) then
    133133                  eyvw=eyvw+aij(ity,jty)/(rij6*rij6)
    134      #                     -cij(ity,jty)/rij6
     134     &                     -cij(ity,jty)/rij6
    135135                else
    136 c For hydrogen bonding use 10-12 Lennard-Jones potential
     136! For hydrogen bonding use 10-12 Lennard-Jones potential
    137137                  eyhb=eyhb+ahb(ity,jty)/(rij6*rij6)
    138      #                     -chb(ity,jty)/(rij6*rij4)
     138     &                     -chb(ity,jty)/(rij6*rij4)
    139139                endif
    140140
     
    142142            enddo 
    143143           
    144 c Loop over 1-4 interaction partners
    145 c The interactions between atoms that are three bonds apart in the protein are
    146 c dominated by quantum mechanical effects. They are treated separately.
     144! Loop over 1-4 interaction partners
     145! The interactions between atoms that are three bonds apart in the protein are
     146! dominated by quantum mechanical effects. They are treated separately.
    147147            do i14=i14at1(i),i14at2(i)   
    148148              j=l14at(i14)
     
    157157              rij6=rij4*rij2
    158158              rij = sqrt(rij2)
    159 c Are we using a distance dependent dielectric constant?
     159! Are we using a distance dependent dielectric constant?
    160160              if(epsd) then
    161161               sr=slp*rij
     
    166166
    167167              eyel=eyel+cqi*cgat(j)/(rij*ep)
    168 c If hydrogen bonding is not possible use 6-12 Lennard-Jones potential.
     168! If hydrogen bonding is not possible use 6-12 Lennard-Jones potential.
    169169              if (ihbty(ity,jty).eq.0) then
    170170                eyvw=eyvw+a14(ity,jty)/(rij6*rij6)
    171      #                   -cij(ity,jty)/rij6
     171     &                   -cij(ity,jty)/rij6
    172172              else
    173 c Use 10-12 Lennard-Jones potential for hydrogen bonds.
     173! Use 10-12 Lennard-Jones potential for hydrogen bonds.
    174174                eyhb=eyhb+ahb(ity,jty)/(rij6*rij6)
    175      #                   -chb(ity,jty)/(rij6*rij4)
     175     &                   -chb(ity,jty)/(rij6*rij4)
    176176              endif
    177177
  • enyshe_p.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: enyshe
    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: enyshe
     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      real*8 function enyshe(nml)
    1414
    15 c     ............................................................................
    16 c     
    17 c     PURPOSE: Calculate internal energy of molecule 'nml' with ECEPP parameters
    18 c     
    19 c     CALLS: none
    20 c     
    21 c     The function loops over all moving sets within the molecule. Within
    22 c     this loop it loops over the van-der-Waals domains of each atom in the
    23 c     moving set and finally over the atoms that belong to the 1-4 interaction
    24 c     set.
    25 c     ............................................................................
     15!     ............................................................................
     16!     
     17!     PURPOSE: Calculate internal energy of molecule 'nml' with ECEPP parameters
     18!     
     19!     CALLS: none
     20!     
     21!     The function loops over all moving sets within the molecule. Within
     22!     this loop it loops over the van-der-Waals domains of each atom in the
     23!     moving set and finally over the atoms that belong to the 1-4 interaction
     24!     set.
     25!     ............................................................................
    2626
    2727      include 'INCL.H'
     
    3030
    3131
    32 c If nml == 0 calculate the interaction between all pairs.
     32! If nml == 0 calculate the interaction between all pairs.
    3333      if (nml.eq.0) then
    3434         ntlvr = nvr
     
    3939      if (ntlvr.eq.0) then
    4040         write (*,'(a,i4)')
    41      #        ' enyshe> No variables defined in molecule #',nml
     41     &        ' enyshe> No variables defined in molecule #',nml
    4242         return
    4343      endif
     
    5757         i1s = imsml1(ntlml) + nmsml(ntlml)
    5858      else
    59 c     Index of first variable in molecule.
     59!     Index of first variable in molecule.
    6060         ifivr=ivrml1(nml)
    61 c     Index of last moving set in molecule
     61!     Index of last moving set in molecule
    6262         i1s=imsml1(nml)+nmsml(nml)
    6363      endif
    64 c     Loop over variables in reverse order     
    65 c     This is the first loop to parallize. We'll just split the moving sets
    66 c     over the number of available processors and sum the energy up in the end.
    67 
    68 c     Number of moving sets per processor
     64!     Loop over variables in reverse order     
     65!     This is the first loop to parallize. We'll just split the moving sets
     66!     over the number of available processors and sum the energy up in the end.
     67
     68!     Number of moving sets per processor
    6969      iend = ifivr
    7070      istart = ifivr + ntlvr - 1
     
    7272      startwtime = MPI_Wtime()
    7373      loopcounter = 0
    74 c      do io=ifivr+ntlvr-1,ifivr,-1 
     74!      do io=ifivr+ntlvr-1,ifivr,-1 
    7575      do io = workPerProcessor(nml, myrank) - 1,
    7676     &        workPerProcessor(nml, myrank+1), -1
     
    7878            i1s = imsvr1(iorvr(io + 1))
    7979         endif
    80 c     The array iorvr contains the variables in an "apropriate" order.
     80!     The array iorvr contains the variables in an "apropriate" order.
    8181         iv=iorvr(io)       
    82 c     Index of the primary moving atom for the variable with index iv
     82!     Index of the primary moving atom for the variable with index iv
    8383         ia=iatvr(iv)       
    84 c     Get the type of variable iv (valence length, valence angle, dihedral angle)
     84!     Get the type of variable iv (valence length, valence angle, dihedral angle)
    8585         it=ityvr(iv)       
    86 c     Class of variable iv's potential  (Q: What are they)
     86!     Class of variable iv's potential  (Q: What are they)
    8787         ic=iclvr(iv)       
    88 c     If iv is a dihedral angle ...
     88!     If iv is a dihedral angle ...
    8989         if (it.eq.3) then     
    90 c     Barrier height * 1/2 of the potential of iv.
     90!     Barrier height * 1/2 of the potential of iv.
    9191            e0=e0to(ic)
    92 c     Calculate the periodic potential term. sgto is the sign of the barrier, rnto is
    93 c     the periodicity and toat is torsion angle(?) associate with atom ia.
     92!     Calculate the periodic potential term. sgto is the sign of the barrier, rnto is
     93!     the periodicity and toat is torsion angle(?) associate with atom ia.
    9494            if (e0.ne.0.)
    95      #           teyvr=teyvr+e0*(1.0+sgto(ic)*cos(toat(ia)*rnto(ic)))
    96 c     else if iv is a valence angle ...
     95     &           teyvr=teyvr+e0*(1.0+sgto(ic)*cos(toat(ia)*rnto(ic)))
     96!     else if iv is a valence angle ...
    9797         elseif (it.eq.2) then 
    98 c     vr is the valence angle of ia
     98!     vr is the valence angle of ia
    9999            vr=baat(ia)
    100 c     else if iv is a valence length...
     100!     else if iv is a valence length...
    101101         elseif (it.eq.1) then 
    102 c     vr is the length of the valence bond
     102!     vr is the length of the valence bond
    103103            vr=blat(ia)
    104104         endif
    105105
    106 c     ============================================ Energies & Atomic forces
    107 c     index of next to last moving set
     106!     ============================================ Energies & Atomic forces
     107!     index of next to last moving set
    108108         i2s=i1s-1
    109 c     index of first moving set associated with iv
     109!     index of first moving set associated with iv
    110110         i1s=imsvr1(iv)
    111 c     Loop over all moving sets starting from the one associated with vr to the end.
     111!     Loop over all moving sets starting from the one associated with vr to the end.
    112112         do ims=i1s,i2s 
    113 c     First atom of the current moving set
     113!     First atom of the current moving set
    114114            i1=latms1(ims)
    115 c     Last atom of the current moving set
     115!     Last atom of the current moving set
    116116            i2=latms2(ims)
    117 c     Loop over all atoms of the current moving set.
     117!     Loop over all atoms of the current moving set.
    118118            do i=i1,i2 
    119 c     Atom class of current atom
     119!     Atom class of current atom
    120120               ity=ityat(i)
    121 c     Point charge at current atom
     121!     Point charge at current atom
    122122               cqi=conv*cgat(i)
    123 c     Cartesian coordinates of current atom
     123!     Cartesian coordinates of current atom
    124124               xi=xat(i)
    125125               yi=yat(i)
    126126               zi=zat(i)
    127 c     Loop over the atoms of the van der Waals domain belonging to atom i
     127!     Loop over the atoms of the van der Waals domain belonging to atom i
    128128               do ivw=ivwat1(i),ivwat2(i) 
    129 c     Loop over the atoms of the van der Waals domain of the atoms of the
    130 c     van der Waals domain of atom i
    131 c     Q: Which atoms are in these domains?
     129!     Loop over the atoms of the van der Waals domain of the atoms of the
     130!     van der Waals domain of atom i
     131!     Q: Which atoms are in these domains?
    132132                  do j=lvwat1(ivw),lvwat2(ivw) 
    133133
    134134                     loopcounter = loopcounter + 1
    135 c     Atom type of partner
     135!     Atom type of partner
    136136                     jty=ityat(j)
    137 c     Differences in cartesian coordinates
     137!     Differences in cartesian coordinates
    138138                     xij=xat(j)-xi
    139139                     yij=yat(j)-yi
    140140                     zij=zat(j)-zi
    141 c     Cartesian distance and higher powers
     141!     Cartesian distance and higher powers
    142142                     rij2=xij*xij+yij*yij+zij*zij
    143143                     rij4=rij2*rij2
    144144                     rij6=rij4*rij2
    145145                     rij=sqrt(rij2)
    146 c     Are we using a distance dependent dielectric constant?
     146!     Are we using a distance dependent dielectric constant?
    147147                     if(epsd) then
    148148                        sr=slp*rij
     
    151151                        ep = 1.0d0
    152152                     end if
    153 c     Coulomb interaction
     153!     Coulomb interaction
    154154                     teyel=teyel+cqi*cgat(j)/(rij*ep)
    155 c     If the two atoms cannot form a hydrogen bond use 6-12 Lennard-Jones potential
     155!     If the two atoms cannot form a hydrogen bond use 6-12 Lennard-Jones potential
    156156                     if (ihbty(ity,jty).eq.0) then
    157157                        teyvw=teyvw+aij(ity,jty)/(rij6*rij6)
    158      #                       -cij(ity,jty)/rij6
     158     &                       -cij(ity,jty)/rij6
    159159                     else
    160 c     For hydrogen bonding use 10-12 Lennard-Jones potential
     160!     For hydrogen bonding use 10-12 Lennard-Jones potential
    161161                        teyhb=teyhb+ahb(ity,jty)/(rij6*rij6)
    162      #                       -chb(ity,jty)/(rij6*rij4)
     162     &                       -chb(ity,jty)/(rij6*rij4)
    163163                     endif
    164164
     
    166166               enddo 
    167167               
    168 c     Loop over 1-4 interaction partners
    169 c     The interactions between atoms that are three bonds apart in the protein are
    170 c     dominated by quantum mechanical effects. They are treated separately.
     168!     Loop over 1-4 interaction partners
     169!     The interactions between atoms that are three bonds apart in the protein are
     170!     dominated by quantum mechanical effects. They are treated separately.
    171171               do i14=i14at1(i),i14at2(i)   
    172172                  loopcounter = loopcounter + 1
     
    182182                  rij6=rij4*rij2
    183183                  rij = sqrt(rij2)
    184 c     Are we using a distance dependent dielectric constant?
     184!     Are we using a distance dependent dielectric constant?
    185185                  if(epsd) then
    186186                     sr=slp*rij
     
    191191
    192192                  teyel=teyel+cqi*cgat(j)/(rij*ep)
    193 c     If hydrogen bonding is not possible use 6-12 Lennard-Jones potential.
     193!     If hydrogen bonding is not possible use 6-12 Lennard-Jones potential.
    194194                  if (ihbty(ity,jty).eq.0) then
    195195                     teyvw=teyvw+a14(ity,jty)/(rij6*rij6)
    196      #                    -cij(ity,jty)/rij6
     196     &                    -cij(ity,jty)/rij6
    197197                  else
    198 c     Use 10-12 Lennard-Jones potential for hydrogen bonds.
     198!     Use 10-12 Lennard-Jones potential for hydrogen bonds.
    199199                     teyhb=teyhb+ahb(ity,jty)/(rij6*rij6)
    200      #                    -chb(ity,jty)/(rij6*rij4)
     200     &                    -chb(ity,jty)/(rij6*rij4)
    201201                  endif
    202202               enddo            ! ... 1-4-partners of i
     
    209209      endwtime = MPI_Wtime()
    210210
    211 c     Collect energies from all nodes and sum them up
     211!     Collect energies from all nodes and sum them up
    212212      call MPI_ALLREDUCE(teysm, eysmsum, 1, MPI_DOUBLE_PRECISION, 
    213213     &     MPI_SUM, my_mpi_comm, ierror)
  • enysol.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: enysol,tessel
    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: enysol,tessel
     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     
     
    1414
    1515      include 'INCL.H'
    16 c --------------------------------------------------------------
    17 c
    18 c     Double Cubic Lattice algorithm for calculating the
    19 c     solvation energy of proteins using
    20 c     solvent accessible area method.
    21 c
    22 c     if nmol == 0 do solvation energy over all residues.
    23 c CALLS: nursat
    24 c
    25 c -------------------------------------------------------------
    26 c TODO: Check the solvent energy for multiple molecules     
     16! --------------------------------------------------------------
     17!
     18!     Double Cubic Lattice algorithm for calculating the
     19!     solvation energy of proteins using
     20!     solvent accessible area method.
     21!
     22!     if nmol == 0 do solvation energy over all residues.
     23! CALLS: nursat
     24!
     25! -------------------------------------------------------------
     26! TODO: Check the solvent energy for multiple molecules     
    2727      dimension numbox(mxat),inbox(mxbox+1),indsort(mxat),look(mxat)
    2828      dimension xyz(mxinbox,3),radb(mxinbox),radb2(mxinbox)
     
    9595      diamax=2.d0*rmax
    9696
    97 c  The sizes of the big box
     97!  The sizes of the big box
    9898
    9999      sizex=xmax-xmin
     
    101101      sizez=zmax-zmin
    102102
    103 c  How many maximal diameters in each size ?
     103!  How many maximal diameters in each size ?
    104104
    105105      ndx=sizex/diamax + 1
     
    107107      ndz=sizez/diamax + 1
    108108
    109 c We may need the number of quadratic boxes in (X,Y) plane
     109! We may need the number of quadratic boxes in (X,Y) plane
    110110
    111111      nqxy=ndx*ndy
    112112
    113 c   The number of cubic boxes of the size "diamax"
     113!   The number of cubic boxes of the size "diamax"
    114114
    115115      ncbox=nqxy*ndz
     
    119119      end if
    120120       
    121 c Let us shift the borders to home all boxes
     121! Let us shift the borders to home all boxes
    122122
    123123      shiftx=(dble(ndx)*diamax-sizex)/2.d0
     
    131131      zmax=zmax+shiftz
    132132
    133 c Finding the box of each atom
     133! Finding the box of each atom
    134134
    135135      do j=nlow,nup
     
    153153      end do
    154154
    155 c  Summation over the boxes
     155!  Summation over the boxes
    156156
    157157      do i=1,ncbox
     
    160160         
    161161       
    162 c   Sorting the atoms by the their box numbers
     162!   Sorting the atoms by the their box numbers
    163163
    164164      do i=nlow,nup
     
    169169      end do   
    170170         
    171 c Getting started
     171! Getting started
    172172
    173173      do iz=0,ndz-1 ! Over the boxes along Z-axis
     
    177177           ibox=ix+iy*ndx+iz*nqxy + 1
    178178
    179 c  Does this box contain atoms ?
     179!  Does this box contain atoms ?
    180180
    181181           lbn=inbox(ibox+1)-inbox(ibox)
     
    189189             nez=min(iz+1,ndz-1)
    190190                     
    191 c  Atoms in the boxes around
     191!  Atoms in the boxes around
    192192
    193193             jcnt=1
     
    221221                     dr=1.0d0+akrad
    222222                     dr=dr*dr
    223 cc if contact
     223!c if contact
    224224                     if(dd.le.dr) then
    225225                       nnei=nnei+1
     
    232232                   end if
    233233                 end do
    234 cc
     234!c
    235235                  do il=1,npnt
    236236                     surfc(il)=.false.
    237237                  end do
    238238
    239 c  Check overlap
     239!  Check overlap
    240240
    241241                  lst=1
     
    279279                 area   = sdr*dble(icount)
    280280                 volume = sdr/3.0d0*(trad*dble(icount)
    281      #                               +(xat(jbi)-avr_x)*dx
    282      #                               +(yat(jbi)-avr_y)*dy
    283      #                               +(zat(jbi)-avr_z)*dz)
     281     &                               +(xat(jbi)-avr_x)*dx
     282     &                               +(yat(jbi)-avr_y)*dy
     283     &                               +(zat(jbi)-avr_z)*dz)
    284284
    285285                 asa=asa+area
    286286                 vdvol=vdvol+volume
    287287                 eysl=eysl+area*sigma(jbi)
    288 c Separate hydrophilic (h) and hyrdophobic (p) contributions to eysl
     288! Separate hydrophilic (h) and hyrdophobic (p) contributions to eysl
    289289                 if (sigma(jbi).lt.0) then
    290290                    eyslp = eyslp + area * sigma(jbi)
     
    295295                    asah = asah + area
    296296                 endif
    297 c Measure how much a residue is solvent accessible:
     297! Measure how much a residue is solvent accessible:
    298298                 jres = nursat(jbi)
    299299                 surfres(jres) = surfres(jres) + area
     
    305305       end do
    306306
    307 c
     307!
    308308       if (isolscl) then
    309309          nhx=0
     
    319319       return
    320320       end
    321 c *********************
     321! *********************
    322322      subroutine tessel
    323323      include 'INCL.H'
    324324      character lin*80
    325325
    326 c    Skipping comment lines, which begin with '!' 
    327 
     326!    Skipping comment lines, which begin with '!' 
    328327      read(20,'(a)') lin
    329328      do while(lin(1:1).eq.'!')
     
    331330      end do
    332331
    333 c   The first non-comment line is the number of the surface points
     332!   The first non-comment line is the number of the surface points
    334333
    335334      read(lin(1:5),'(i5)') npnt
    336 c        write(*,'(a,i5)') 'the number of points---->',npnt
    337 
    338 c    Read the surface points   
     335!       write(*,'(a,i5)') 'the number of points---->',npnt
     336
     337!    Read the surface points   
    339338
    340339      do i=1,npnt
    341340         read(20,'(3f20.10)') spoint(i,1),spoint(i,2),spoint(i,3)
    342          
    343 c        write(31,'(3f20.10)') spoint(i,1),spoint(i,2),spoint(i,3)
     341!          write(31,'(3f20.10)') spoint(i,1),spoint(i,2),spoint(i,3)
    344342      end do
    345343 
  • enysol_p.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: enysol,tessel
    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: enysol,tessel
     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     
     
    1616      include 'mpif.h'
    1717
    18 c --------------------------------------------------------------
    19 c
    20 c     Double Cubic Lattice algorithm for calculating the
    21 c     solvation energy of proteins using
    22 c     solvent accessible area method.
    23 c
    24 c     if nmol == 0 do solvation energy over all residues.
    25 c CALLS: nursat
    26 c
    27 c -------------------------------------------------------------
    28 c TODO: Check the solvent energy for multiple molecules     
     18! --------------------------------------------------------------
     19!
     20!     Double Cubic Lattice algorithm for calculating the
     21!     solvation energy of proteins using
     22!     solvent accessible area method.
     23!
     24!     if nmol == 0 do solvation energy over all residues.
     25! CALLS: nursat
     26!
     27! -------------------------------------------------------------
     28! TODO: Check the solvent energy for multiple molecules     
    2929      dimension numbox(mxat),inbox(mxbox+1),indsort(mxat),look(mxat)
    3030      dimension xyz(mxinbox,3),radb(mxinbox),radb2(mxinbox)
     
    101101      diamax=2.d0*rmax
    102102
    103 c  The sizes of the big box
     103!  The sizes of the big box
    104104
    105105      sizex=xmax-xmin
     
    107107      sizez=zmax-zmin
    108108
    109 c  How many maximal diameters in each size ?
     109!  How many maximal diameters in each size ?
    110110
    111111      ndx=sizex/diamax + 1
     
    113113      ndz=sizez/diamax + 1
    114114
    115 c We may need the number of quadratic boxes in (X,Y) plane
     115! We may need the number of quadratic boxes in (X,Y) plane
    116116
    117117      nqxy=ndx*ndy
    118118
    119 c   The number of cubic boxes of the size "diamax"
     119!   The number of cubic boxes of the size "diamax"
    120120
    121121      ncbox=nqxy*ndz
     
    125125      end if
    126126       
    127 c Let us shift the borders to home all boxes
     127! Let us shift the borders to home all boxes
    128128
    129129      shiftx=(dble(ndx)*diamax-sizex)/2.d0
     
    137137      zmax=zmax+shiftz
    138138
    139 c Finding the box of each atom
     139! Finding the box of each atom
    140140
    141141      do j=nlow,nup
     
    159159      end do
    160160
    161 c  Summation over the boxes
     161!  Summation over the boxes
    162162
    163163      do i=1,ncbox
     
    166166         
    167167       
    168 c   Sorting the atoms by the their box numbers
     168!   Sorting the atoms by the their box numbers
    169169
    170170      do i=nlow,nup
     
    175175      end do   
    176176         
    177 c    Getting started
    178 c    We have to loop over ncbox boxes and have no processors available
     177!    Getting started
     178!    We have to loop over ncbox boxes and have no processors available
    179179      boxpp = 1.0 * ncbox / no
    180180      iboxmin = boxpp * myrank
     
    191191!     ibox=ix+iy*ndx+iz*nqxy + 1
    192192
    193 c  Does this box contain atoms ?
     193!  Does this box contain atoms ?
    194194
    195195           lbn=inbox(ibox+1)-inbox(ibox)
     
    203203             nez=min(iz+1,ndz-1)
    204204                     
    205 c  Atoms in the boxes around
     205!  Atoms in the boxes around
    206206
    207207             jcnt=1
     
    235235                     dr=1.0d0+akrad
    236236                     dr=dr*dr
    237 cc if contact
     237!c if contact
    238238                     if(dd.le.dr) then
    239239                       nnei=nnei+1
     
    246246                   end if
    247247                 end do
    248 cc
     248!c
    249249                  do il=1,npnt
    250250                     surfc(il)=.false.
    251251                  end do
    252252
    253 c  Check overlap
     253!  Check overlap
    254254
    255255                  lst=1
     
    293293                 area   = sdr*dble(icount)
    294294                 volume = sdr/3.0d0*(trad*dble(icount)
    295      #                               +(xat(jbi)-avr_x)*dx
    296      #                               +(yat(jbi)-avr_y)*dy
    297      #                               +(zat(jbi)-avr_z)*dz)
     295     &                               +(xat(jbi)-avr_x)*dx
     296     &                               +(yat(jbi)-avr_y)*dy
     297     &                               +(zat(jbi)-avr_z)*dz)
    298298
    299299                 asa=asa+area
    300300                 vdvol=vdvol+volume
    301301                 eysl=eysl+area*sigma(jbi)
    302 c Separate hydrophilic (h) and hyrdophobic (p) contributions to eysl
     302! Separate hydrophilic (h) and hyrdophobic (p) contributions to eysl
    303303                 if (sigma(jbi).lt.0) then
    304304                    eyslp = eyslp + area * sigma(jbi)
     
    309309                    asah = asah + area
    310310                 endif
    311 c Measure how much a residue is solvent accessible:
     311! Measure how much a residue is solvent accessible:
    312312                 jres = nursat(jbi)
    313313                 surfres(jres) = surfres(jres) + area
     
    332332     &               endwtime - startwtime, "s"
    333333      endif
    334 c
     334!
    335335       if (isolscl) then
    336336          nhx=0
     
    346346       return
    347347       end
    348 c *********************
     348! *********************
    349349      subroutine tessel
    350350      include 'INCL.H'
    351351      character lin*80
    352352
    353 c    Skipping comment lines, which begin with '!' 
     353!    Skipping comment lines, which begin with '!' 
    354354
    355355      read(20,'(a)') lin
     
    358358      end do
    359359
    360 c   The first non-comment line is the number of the surface points
     360!   The first non-comment line is the number of the surface points
    361361
    362362      read(lin(1:5),'(i5)') npnt
    363 c        write(*,'(a,i5)') 'the number of points---->',npnt
    364 
    365 c    Read the surface points   
     363!        write(*,'(a,i5)') 'the number of points---->',npnt
     364
     365!    Read the surface points   
    366366
    367367      do i=1,npnt
    368368         read(20,'(3f20.10)') spoint(i,1),spoint(i,2),spoint(i,3)
    369369         
    370 c        write(31,'(3f20.10)') spoint(i,1),spoint(i,2),spoint(i,3)
     370!        write(31,'(3f20.10)') spoint(i,1),spoint(i,2),spoint(i,3)
    371371      end do
    372372 
  • esolan.f

    r2ebb8b6 rbd2278d  
    4848     
    4949      dimension neib(0:mxat),vertex(ks0,4),ax(ks0,2),
    50      1          pol(mxat),neibp(0:mxat),as(mxat),ayx(ks0,2),
    51      2          ayx1(ks0),probe(ks0),dd(mxat),ddat(mxat,4),ivrx(ks0)
     50     &          pol(mxat),neibp(0:mxat),as(mxat),ayx(ks0,2),
     51     &          ayx1(ks0),probe(ks0),dd(mxat),ddat(mxat,4),ivrx(ks0)
    5252       
    5353      dimension grad(mxat,mxat,3),dadx(4,3),gp(4),dalp(4),dbet(4),
    54      1   daalp(4),dabet(4),vrx(ks0,4),dv(4),dx(4),dy(4),dz(4),dt(4),
    55      2   di(4),dii(4,3),ss(mxat),dta(4),dtb(4),di1(4),di2(4),gs(3)
     54     &   daalp(4),dabet(4),vrx(ks0,4),dv(4),dx(4),dy(4),dz(4),dt(4),
     55     &   di(4),dii(4,3),ss(mxat),dta(4),dtb(4),di1(4),di2(4),gs(3)
    5656      dimension xold(-1:mxat),yold(-1:mxat),zold(-1:mxat)
    5757      integer ta2(0:mxat),ta3(0:mxat),fullarc(0:mxat),al(0:ks2)
  • eyabgn.f

    r2ebb8b6 rbd2278d  
    1 c *********************************************************************
    2 c This file contains eyrccr, init_abgn, eyentr, eyabgn
    3 c
    4 c Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
    5 c                      Jan H. Meinke, Sandipan Mohanty
    6 c
    7 c Corrections to ECEPP energy terms due to R. A. Abagyan et al.
    8 c
    9 c Two terms are calculated: eyrccr and eyentr, representing respectively
    10 c c a term to slightly shift the backbone dihedral angle preferences in
    11 c the ECEPP potential slightly away from the helix region, and another
    12 c term to estimate the side-chain entropy from a given configuration.
    13 c
    14 c
    15 c *********************************************************************
     1! *********************************************************************
     2! This file contains eyrccr, init_abgn, eyentr, eyabgn
     3!
     4! Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
     5!                      Jan H. Meinke, Sandipan Mohanty
     6!
     7! Corrections to ECEPP energy terms due to R. A. Abagyan et al.
     8!
     9! Two terms are calculated: eyrccr and eyentr, representing respectively
     10! c a term to slightly shift the backbone dihedral angle preferences in
     11! the ECEPP potential slightly away from the helix region, and another
     12! term to estimate the side-chain entropy from a given configuration.
     13!
     14!
     15! *********************************************************************
    1616      real*8 function eyrccr(nml)
    1717      include 'INCL.H'
     
    2929      endif
    3030      et=0.0
    31 c      print *,'***********'
     31!      print *,'***********'
    3232      do i=istres,indres
    3333         mynm=seq(i)
    3434         call tolost(mynm)
    3535         if ((mynm.eq.'val').or.(mynm.eq.'ile').or.
    36      #           (mynm.eq.'thr')) then
     36     &           (mynm.eq.'thr')) then
    3737            rsscl=1.0
    3838         else
     
    4040         endif
    4141         et=et+rsscl*(1.0-sin(vlvr(ipsi(i))))
    42 c         print *,'  contribution = ',rsscl*(1.0-sin(vlvr(ipsi(i))))
    43 c         print *,'obtained using scale ',rsscl,' and angle ',
    44 c     #        vlvr(ipsi(i))
     42!         print *,'  contribution = ',rsscl*(1.0-sin(vlvr(ipsi(i))))
     43!         print *,'obtained using scale ',rsscl,' and angle ',
     44!     #        vlvr(ipsi(i))
    4545      enddo
    46 c      print *,'abagyan dihedral term = ',et
    47 c      print *,'***********'
     46!      print *,'abagyan dihedral term = ',et
     47!      print *,'***********'
    4848      eyrccr=et
    4949      return
     
    5656      dimension xarea(nrsty),estrg(nrsty)
    5757      character mynm*4
    58 c      print *,'Initialization of Abagyan entropic term'
    59 c     Maximum accessible surface areas for different residue types
     58!      print *,'Initialization of Abagyan entropic term'
     59!     Maximum accessible surface areas for different residue types
    6060      data (xarea(i),i=1,nrsty)/
    61 c             1         2         3         4         5
    62      #     117.417 , 244.686 , 245.582 , 146.467 , 144.485 ,
    63 c             6         7         8         9        10
    64      #     144.192 , 142.805 , 147.568 , 183.103 , 177.094 ,
    65 c            11       12        13        14        15
    66      #     186.293 , 83.782 , 187.864 , 187.864 , 187.864 ,
    67 c            16       17        18        19        20
    68      #     187.864 , 160.887 , 161.741 , 184.644 , 179.334 ,
    69 c            21       22        23        24        25
    70      #     209.276 , 209.276 , 203.148 , 208.902 , 153.124 ,
    71 c            26       27        28        29        30
    72      #     153.973 , 153.037 , 158.695 , 157.504 , 157.504 ,
    73 c            31       32        33        34        35
    74      #     119.786 , 146.488 , 238.641 , 223.299 , 160.283 /
    75 c     Entropic contribution for maximally exposed residue
     61!             1         2         3         4         5
     62     &     117.417 , 244.686 , 245.582 , 146.467 , 144.485 ,
     63!             6         7         8         9        10
     64     &     144.192 , 142.805 , 147.568 , 183.103 , 177.094 ,
     65!            11       12        13        14        15
     66     &     186.293 , 83.782 , 187.864 , 187.864 , 187.864 ,
     67!            16       17        18        19        20
     68     &     187.864 , 160.887 , 161.741 , 184.644 , 179.334 ,
     69!            21       22        23        24        25
     70     &     209.276 , 209.276 , 203.148 , 208.902 , 153.124 ,
     71!            26       27        28        29        30
     72     &     153.973 , 153.037 , 158.695 , 157.504 , 157.504 ,
     73!            31       32        33        34        35
     74     &     119.786 , 146.488 , 238.641 , 223.299 , 160.283 /
     75!     Entropic contribution for maximally exposed residue
    7676      data (estrg(i),i=1,nrsty)/
    77 c             1ala      2arg      3arg+     4asn      5asp
    78      #       0.0   ,   2.13  ,   2.13  ,   0.81  ,   0.61  ,
    79 c             6asp-     7cys      8cyss     9gln     10glu
    80      #       0.61  ,   1.14  ,   1.14  ,   2.02  ,   1.65  ,
    81 c            11glu-   12gly     13his     14hise    15hisd
    82      #       1.65  ,  0.0    ,   0.99  ,   0.99  ,   0.99  ,
    83 c            16his+   17hyp     18hypu    19ile     20leu
    84      #       0.99  ,   0.99  ,   0.99  ,  0.75   ,   0.75  ,
    85 c            21lys    22lys+     23met     24phe     25cpro
    86      #       2.21  ,   2.21  ,   1.53  ,   0.58  ,   0.0   ,
    87 c            26pro     27cpru    28prou    29pron    30pro+
    88      #       0.0   ,   0.0   ,   0.0   ,   0.0   ,   0.0   ,
    89 c            31ser     32thr     33trp     34tyr     35val
    90      #       1.19  ,   1.12  ,   0.97  ,   0.99  ,   0.50  /
     77!             1ala      2arg      3arg+     4asn      5asp
     78     &       0.0   ,   2.13  ,   2.13  ,   0.81  ,   0.61  ,
     79!             6asp-     7cys      8cyss     9gln     10glu
     80     &       0.61  ,   1.14  ,   1.14  ,   2.02  ,   1.65  ,
     81!            11glu-   12gly     13his     14hise    15hisd
     82     &       1.65  ,  0.0    ,   0.99  ,   0.99  ,   0.99  ,
     83!            16his+   17hyp     18hypu    19ile     20leu
     84     &       0.99  ,   0.99  ,   0.99  ,  0.75   ,   0.75  ,
     85!            21lys    22lys+     23met     24phe     25cpro
     86     &       2.21  ,   2.21  ,   1.53  ,   0.58  ,   0.0   ,
     87!            26pro     27cpru    28prou    29pron    30pro+
     88     &       0.0   ,   0.0   ,   0.0   ,   0.0   ,   0.0   ,
     89!            31ser     32thr     33trp     34tyr     35val
     90     &       1.19  ,   1.12  ,   0.97  ,   0.99  ,   0.50  /
    9191      do i=1,mxrs
    9292         rsstrg(i)=0.0
     
    100100         do j=1,nrsty
    101101            if (rsnmcd(j).eq.mynm) imytyp=j
    102 c            print *,'comparing ',mynm,' with ',rsnmcd(j),imytyp
     102!            print *,'comparing ',mynm,' with ',rsnmcd(j),imytyp
    103103         enddo
    104104         if (imytyp.eq.0) then
     
    109109            rsstrg(i)=estrg(imytyp)/xarea(imytyp)
    110110         endif
    111 c         print *,'residue ',i,seq(i),' type ',imytyp
    112 c         print *, 'strength for residue ',i,seq(i),' is ',rsstrg(i)
     111!         print *,'residue ',i,seq(i),' type ',imytyp
     112!         print *, 'strength for residue ',i,seq(i),' is ',rsstrg(i)
    113113      enddo
    114114      print *, 'initialized Abagyan corrections to ECEPP force field'
     
    129129         indres=irsml2(nml)
    130130      endif
    131 c      print *,'residue range ',istres,indres
    132 c      print *,'for molecule ',nml
     131!      print *,'residue range ',istres,indres
     132!      print *,'for molecule ',nml
    133133      do i=istres, indres
    134134         aars=surfres(i)
    135135         strh=rsstrg(i)
    136 c        The maximal burial entropies were estimated at temperature 300k
    137 c        The values in the array estrg are k_B * T (=300k) * Entropy
    138 c        Presently we need it at temperature 1/beta, so we need to
    139 c        multiply the strengths in estrg with (1/beta)/(300 kelvin)
    140 c        300 kelvin is approximately 0.59576607 kcal/mol.
     136!        The maximal burial entropies were estimated at temperature 300k
     137!        The values in the array estrg are k_B * T (=300k) * Entropy
     138!        Presently we need it at temperature 1/beta, so we need to
     139!        multiply the strengths in estrg with (1/beta)/(300 kelvin)
     140!        300 kelvin is approximately 0.59576607 kcal/mol.
    141141         eentr=eentr+aars*strh/(0.59576607*beta)
    142 c         print *,'contribution = ',aars*strh/(0.59576607*beta)
    143 c         print *,'residue, exposed area = ',i,aars
    144 c         print *,'strength = ',strh,' for residue index = ',i
    145 c         print *,'beta = ',beta
     142!         print *,'contribution = ',aars*strh/(0.59576607*beta)
     143!         print *,'residue, exposed area = ',i,aars
     144!         print *,'strength = ',strh,' for residue index = ',i
     145!         print *,'beta = ',beta
    146146      enddo
    147 c      print *,'abagyan entropic term = ',eentr
     147!      print *,'abagyan entropic term = ',eentr
    148148      eyentr=eentr
    149149      return
     
    153153      include 'INCL.H'
    154154      eyabgn=eyrccr(nml)+eyentr(nml)
    155 c      print *,'Abagyan term = ',eyabgn
     155!      print *,'Abagyan term = ',eyabgn
    156156      return
    157157      end
  • 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
  • gradient.f

    r2ebb8b6 rbd2278d  
    1 C **************************************************************
    2 c
    3 c This file contains the subroutines: gradient
    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: gradient
     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 gradient()
    1414
    15 c -------------------------------------------
    16 c PURPOSE: calculate energy & gradients
    17 c
    18 c CALLS:   opeflx,opereg,opeshe,opesol,setvar
    19 c -------------------------------------------
     15! -------------------------------------------
     16! PURPOSE: calculate energy & gradients
     17!
     18! CALLS:   opeflx,opereg,opeshe,opesol,setvar
     19! -------------------------------------------
    2020
    2121      include 'INCL.H'
  • 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)
  • helix.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: helix
    4 c
    5 c Copyright 2003       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: helix
     4!
     5! Copyright 2003       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 helix(nhel,mhel,nbet,mbet)
    14 c---------------------------------------------------------------
    15 c
    16 c   PURPOSE: simple identification of secondary structure content
    17 c
    18 c   CALLS: none
    19 c
    20 c ---------------------------------------------------------------
     14!---------------------------------------------------------------
     15!
     16!   PURPOSE: simple identification of secondary structure content
     17!
     18!   CALLS: none
     19!
     20! ---------------------------------------------------------------
    2121      include 'INCL.H'
    2222
    23 cf2py intent(out) nhel
    24 cf2py intent(out) mhel
    25 cf2py intent(out) nbet
    26 cf2py intent(out) mbet
     23!f2py intent(out) nhel
     24!f2py intent(out) mhel
     25!f2py intent(out) nbet
     26!f2py intent(out) mbet
    2727           
    2828      logical lhel,lbet
     
    4242         xphi = vlvr(iv)*crd
    4343         xpsi = vlvr(idvr(i+1))*crd
    44 C Helicity
     44! Helicity
    4545         if(abs(xphi-philim).le.hlim) then
    4646          lbet=.false.
     
    5252            lhel = .false.
    5353          end if
    54 C Sheetness
     54! Sheetness
    5555         else if(abs(xphi-philim2).le.hlim2) then
    5656          lhel = .false.
  • incl_lund.h

    r2ebb8b6 rbd2278d  
    88      double precision alhb,blhb,sighb2,cdon,cacc,casc
    99
    10 c -----Probability for using BGS when it is possible
     10! -----Probability for using BGS when it is possible
    1111      double precision abgs,bbgs, dph(8)
    1212      integer bgsnvar,bgsvar(mxrs), iph(8)
     
    3232
    3333      common /lundff/kbias,
    34      #     epshb1,epshb2,powa,powb,sighb,cthb,
    35      #     cthb2,
    36      #     alhb,blhb,sighb2,cdon,cacc,casc,
    37      #     ihpat,nhpat,hpstrg,
    38      #     exvk,exvcut,exvcut2,
    39      #     matcon,
    40      #     sigsa,sig2lcp,asalcp,bsalcp,
    41      #     lcp1,lcp2,ilpst,ilpnd,
    42      #     exvlam,exvcutg,exvcutg2,
    43      #     sig2exv,asaexv,bsaexv
     34     &     epshb1,epshb2,powa,powb,sighb,cthb,
     35     &     cthb2,
     36     &     alhb,blhb,sighb2,cdon,cacc,casc,
     37     &     ihpat,nhpat,hpstrg,
     38     &     exvk,exvcut,exvcut2,
     39     &     matcon,
     40     &     sigsa,sig2lcp,asalcp,bsalcp,
     41     &     lcp1,lcp2,ilpst,ilpnd,
     42     &     exvlam,exvcutg,exvcutg2,
     43     &     sig2exv,asaexv,bsaexv
    4444      save /lundff/
  • init_energy.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: init_energy,setpar
    4 C This file contains a BLOCK DATA statement
    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: init_energy,setpar
     4! This file contains a BLOCK DATA statement
     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 init_energy(libdir)
    1515
    16 c ----------------------------------------------
    17 c PURPOSE: initialize energy parameters
    18 c        0  => ECEPP2 or ECEPP3 depending on the value of sh2
    19 c        1  => FLEX
    20 c        2  => Lund force field
    21 c        3  => ECEPP with Abagyan corrections
    22 c
    23 c
    24 c CALLS:   setpar, tessel,iendst
    25 c
    26 c contains: BLOCK DATA
    27 c ----------------------------------------------
     16! ----------------------------------------------
     17! PURPOSE: initialize energy parameters
     18!        0  => ECEPP2 or ECEPP3 depending on the value of sh2
     19!        1  => FLEX
     20!        2  => Lund force field
     21!        3  => ECEPP with Abagyan corrections
     22!
     23!
     24! CALLS:   setpar, tessel,iendst
     25!
     26! contains: BLOCK DATA
     27! ----------------------------------------------
    2828
    2929      include 'INCL.H'
     
    5959
    6060
    61 C----Initialize solvation part if necessary
     61!----Initialize solvation part if necessary
    6262      write (*,*) 'init_energy: itysol = ',itysol
    6363      write(*,*) 'init_energy: esol_scaling = ',isolscl
     
    6969        ll=iendst(libdir)
    7070        tesfil = libdir(1:ll)//'tes.dat'
    71 
    7271        open(unit=20,file=tesfil,status='old',err=10)
    73 
    7472        call tessel()
    75 
    7673        close(20)
    7774
     
    8582      endif
    8683
    87 c ___________________________ initialise COMMON 'con_r'
     84! ___________________________ initialise COMMON 'con_r'
    8885      idloa=ichar('a')
    8986      idloz=ichar('z')
     
    9895      end
    9996
    100 c *********************
     97! *********************
    10198      subroutine setpar
    10299
    103 c __________________________________________________________
    104 c PURPOSE: initialize parameter set for empirical potentials
    105 c          depending on variable 'flex'
    106 c
    107 c CALLS:   None
    108 c __________________________________________________________
     100! __________________________________________________________
     101! PURPOSE: initialize parameter set for empirical potentials
     102!          depending on variable 'flex'
     103!
     104! CALLS:   None
     105! __________________________________________________________
    109106
    110107      include 'INCL.H'
     
    116113      tesgrd = .false.  ! numerical check of analytical gradients
    117114
    118 c ______________________________________ Lennard-Jones parameters
     115! ______________________________________ Lennard-Jones parameters
    119116      if (flex) then
    120117
     
    166163          ai=atpl(i)
    167164          aei=sqrt(ai/efel(i))
    168 cc          aic=ai/ehm             !!  ICM
    169 cc          do j=i,mxtyat          !!  -"-
     165!c          aic=ai/ehm             !!  ICM
     166!c          do j=i,mxtyat          !!  -"-
    170167          aic=ai*ehm                 !!  comment for ICM:
    171168          cij(i,i)=aic*ai/(aei+aei)  !!        -"-
     
    175172          do j=i+1,mxtyat            !!
    176173            aj=atpl(j)
    177 c _______ Constant for 6-12 attractive term (Slater-Kirkwood formula)
     174! _______ Constant for 6-12 attractive term (Slater-Kirkwood formula)
    178175            c=aic*aj/(aei+sqrt(aj/efel(j)))
    179176            cij(i,j)=c
    180177            cij(j,i)=c
    181 c ____________________________ repulsive term (form. 3 & 6 of ref 2)
     178! ____________________________ repulsive term (form. 3 & 6 of ref 2)
    182179            rij=.5*(ri+rmin(j))
    183180            a=.5*c*rij**6
     
    192189        enddo
    193190
    194 c +++++++++++++++++++++++++++++++++
     191! +++++++++++++++++++++++++++++++++
    195192        cij(1,1)=45.5d0
    196193        aij(1,1)=14090.0d0
     
    229226        cij(18,18)=370.5d0
    230227        aij(18,18)=909000.0d0
    231 c +++++++++++++++++++++++++++++++++
     228! +++++++++++++++++++++++++++++++++
    232229        do i=1,mxtyat
    233230          a14(i,i)=.5*aij(i,i)
    234231        enddo
    235 c +++++++++++++++++++++++++++++++++
     232! +++++++++++++++++++++++++++++++++
    236233
    237234        do i=1,mxtyat
    238 c         write( *, '(18f14.6)' )  ( a14(i,j), j = 1, mxtyat )
     235!         write( *, '(18f14.6)' )  ( a14(i,j), j = 1, mxtyat )
    239236        enddo
    240237
     
    254251
    255252      endif
    256 c -------------------------------------------- Hydrogen Bond Parameters
     253! -------------------------------------------- Hydrogen Bond Parameters
    257254      do i=1,mxtyat
    258255        do j=1,mxtyat
     
    303300      return
    304301      end
    305 c **************
     302! **************
    306303      BLOCK DATA
    307304
    308305      include 'INCL.H'
    309306
    310 c  Atom types ------------------------------------------------------------
    311 c                                    Original types  -Scheraga:  -Flex:
    312 c  H  1 - with aliphatic carbon                               1      12
    313 c     2 - with aromatic carbon                                3      13
    314 c     3 - with non-sp3 types of nitrogen                      2       1
    315 c     4 - with sp3-hybr. nitrogen                             2       2
    316 c     5 - with oxygen                                         4       1
    317 c     6 - with sulfur                                         3(was 5)1
    318 c  C  7 - sp3-hybr. carbon                                    6,9     3
    319 c     8 - sp2-carbon (carbonyl,carboxyl,carboxylate)          7,11    4
    320 c     9 - aromatic carbon                                     8,10    4
    321 c  O 10 - hydroxyl, ester oxygen (inc. water)                 18,19   8
    322 c    11 - carbonyl oxygen                                     17      9
    323 c    12 - carboxylate oxygen                                  18,19  10
    324 c  N 13 - aliph. nitrogen with 0/1 hydrogen & charged N       13-15   6
    325 c    14 - nitrogen with two hydrogens                         13-15   5
    326 c    15 - all other nitrogens (+ sp2-hybrid. in heteroc.)     13-15   7
    327 c  S 16 - any sulfur                                          20,21  18,19
    328 c  H 17 - H-delta of Pro, Hyp of ECEPP/3 dataset               5(new) -
    329 c  C 18 - C-delta of Pro, Hyp of ECEPP/3 dataset              12(new) -
    330 
    331 c  Classes for torsional potential ---------------------------------------
    332 c
    333 c   1 : 'Omega' = C'(pept.)-N(pept.)  [Cpept-Npept]
    334 c   2 : 'Phi'   = N(pept.)-C(sp3)     [C4-Npept]
    335 c   3 : 'Psi'   = C(sp3)-C'(pept.)    [C4-Cpept]
    336 c   4 : 'Chi1'  = C(sp3)-C(sp3)       [C4-C4]
    337 c   5 : C(sp3)-OH (Hydroxyl)          [C4-OH]
    338 c   6 : C(sp3)-NH2                    [C4-NH2]
    339 c   7 : C(sp3)-NH3+                   [C4-NH3+]
    340 c   8 : C(sp3)-NH-(guanidyl)          [C4-NHX]
    341 c   9 : C(sp3)-COOH(carboxyl)         [C4-COO]
    342 c  10 : C(sp3)-COO-(carboxylate)      [C4-COO]
    343 c  11 : C(sp3)-CO(sp2 of amide)       [C4-Cpept]
    344 c  12 : C(sp3)-C(aromatic ring)       [C4-C3]
    345 c  13 : C(sp3)-S                      [C4-SC4]
    346 c  14 : C(sp3)-SH                     [C4-SH]
    347 c  15 : C(aromatic ring)-OH           [C3-OH]
    348 c ________________________________________________ "rigid" torsions:
    349 c  16 : C(carboxyl)-OH                [C3-OH]
    350 c  17 : -NH-C(sp2 of guanidyl)        [C3-NHX]
    351 c  18 : -C(sp3)-NH2 (guanidyl)        [not in Flex]
    352 c  19 : -C(sp3)-NH2 (amide)           [Cpept-Npept]
     307!  Atom types ------------------------------------------------------------
     308!                                    Original types  -Scheraga:  -Flex:
     309!  H  1 - with aliphatic carbon                               1      12
     310!     2 - with aromatic carbon                                3      13
     311!     3 - with non-sp3 types of nitrogen                      2       1
     312!     4 - with sp3-hybr. nitrogen                             2       2
     313!     5 - with oxygen                                         4       1
     314!     6 - with sulfur                                         3(was 5)1
     315!  C  7 - sp3-hybr. carbon                                    6,9     3
     316!     8 - sp2-carbon (carbonyl,carboxyl,carboxylate)          7,11    4
     317!     9 - aromatic carbon                                     8,10    4
     318!  O 10 - hydroxyl, ester oxygen (inc. water)                 18,19   8
     319!    11 - carbonyl oxygen                                     17      9
     320!    12 - carboxylate oxygen                                  18,19  10
     321!  N 13 - aliph. nitrogen with 0/1 hydrogen & charged N       13-15   6
     322!    14 - nitrogen with two hydrogens                         13-15   5
     323!    15 - all other nitrogens (+ sp2-hybrid. in heteroc.)     13-15   7
     324!  S 16 - any sulfur                                          20,21  18,19
     325!  H 17 - H-delta of Pro, Hyp of ECEPP/3 dataset               5(new) -
     326!  C 18 - C-delta of Pro, Hyp of ECEPP/3 dataset              12(new) -
     327
     328!  Classes for torsional potential ---------------------------------------
     329!
     330!   1 : 'Omega' = C'(pept.)-N(pept.)  [Cpept-Npept]
     331!   2 : 'Phi'   = N(pept.)-C(sp3)     [C4-Npept]
     332!   3 : 'Psi'   = C(sp3)-C'(pept.)    [C4-Cpept]
     333!   4 : 'Chi1'  = C(sp3)-C(sp3)       [C4-C4]
     334!   5 : C(sp3)-OH (Hydroxyl)          [C4-OH]
     335!   6 : C(sp3)-NH2                    [C4-NH2]
     336!   7 : C(sp3)-NH3+                   [C4-NH3+]
     337!   8 : C(sp3)-NH-(guanidyl)          [C4-NHX]
     338!   9 : C(sp3)-COOH(carboxyl)         [C4-COO]
     339!  10 : C(sp3)-COO-(carboxylate)      [C4-COO]
     340!  11 : C(sp3)-CO(sp2 of amide)       [C4-Cpept]
     341!  12 : C(sp3)-C(aromatic ring)       [C4-C3]
     342!  13 : C(sp3)-S                      [C4-SC4]
     343!  14 : C(sp3)-SH                     [C4-SH]
     344!  15 : C(aromatic ring)-OH           [C3-OH]
     345! ________________________________________________ "rigid" torsions:
     346!  16 : C(carboxyl)-OH                [C3-OH]
     347!  17 : -NH-C(sp2 of guanidyl)        [C3-NHX]
     348!  18 : -C(sp3)-NH2 (guanidyl)        [not in Flex]
     349!  19 : -C(sp3)-NH2 (amide)           [Cpept-Npept]
    353350
    354351      data conv/332.d0/  ! to convert electrost. energy into [kcal/mole]
    355352
    356 c ------------------------- ECEPP/3 potential --------------------------------
    357 c 1) Momany F.A McGuire R.F Burgess A.W Scheraga H.A J Phys Chem v79 2361-2381
    358 c    1975
    359 c 2) Nemethy G Pottle M.S Scheraga H.A, J Phys Chem v87 1883-1887 1983
    360 c 3) Sippl M.J Nemethy G Scheraga H.A J Phys Chem v88 6231-6233 1984
    361 c 4) Nemethy G Gibson K.D Palmer K.A Yoon C.N Paterlini G Zagari A Rumsey S
    362 c    Scheraga H.A J Phys Chem v96 6472-6484 1992
    363 c ----------------------------------------------------------------------------
     353! ------------------------- ECEPP/3 potential --------------------------------
     354! 1) Momany F.A McGuire R.F Burgess A.W Scheraga H.A J Phys Chem v79 2361-2381
     355!    1975
     356! 2) Nemethy G Pottle M.S Scheraga H.A, J Phys Chem v87 1883-1887 1983
     357! 3) Sippl M.J Nemethy G Scheraga H.A J Phys Chem v88 6231-6233 1984
     358! 4) Nemethy G Gibson K.D Palmer K.A Yoon C.N Paterlini G Zagari A Rumsey S
     359!    Scheraga H.A J Phys Chem v96 6472-6484 1992
     360! ----------------------------------------------------------------------------
    364361
    365362      data eps_s/2.d0/  ! Distance-INdependent diel. constant
    366 c     data eps_s/6.d0/  ! Distance-INdependent diel. constant
     363!     data eps_s/6.d0/  ! Distance-INdependent diel. constant
    367364      data plt/78.d0/,  slp/0.3d0/   ! Parameters for Epsilon(R)
    368365
    369366      data ehm /362.55d0/  !  Angstrom**2/3 * kcal / mol  ! from KONF90
    370 cc      data ehm /362.09561409d0/  !  Angstrom**2/3 * kcal / mol
    371 c From:
    372 c   1.5
    373 c * elementary charge       = 4.80325   *e+2  Angstrom**3/2 * g**1/2 * s**(-1)
    374 c * Planck's constant/2*Pi  = 1.0545887 *e-34 Joule * s
    375 c * Avogadro's number       = 6.022045  *e+23 mol**(-1)
    376 c / sqrt (mass of electron) = sqrt (9.109534  *e-28 g )
    377 c / thermal equivalent      = 4.1868    *e+3  Joule * kcal**(-1)
    378 cc      data ehm /362.36d0/         ! calculated using Tab II in ref. 2
    379 cc      data 1/ehm /2.757670d-3/    ! 3*sqrt(m)/(2*e*h) taken from ICM
    380 
    381 c ---------------------- atomic polarizabilties (*100,[Angstrom**3])
    382 c                1   2   3   4   5   6   7    8    9  10  11  12
     367!      data ehm /362.09561409d0/  !  Angstrom**2/3 * kcal / mol
     368! From:
     369!   1.5
     370! * elementary charge       = 4.80325   *e+2  Angstrom**3/2 * g**1/2 * s**(-1)
     371! * Planck's constant/2*Pi  = 1.0545887 *e-34 Joule * s
     372! * Avogadro's number       = 6.022045  *e+23 mol**(-1)
     373! / sqrt (mass of electron) = sqrt (9.109534  *e-28 g )
     374! / thermal equivalent      = 4.1868    *e+3  Joule * kcal**(-1)
     375!      data ehm /362.36d0/         ! calculated using Tab II in ref. 2
     376!      data 1/ehm /2.757670d-3/    ! 3*sqrt(m)/(2*e*h) taken from ICM
     377
     378! ---------------------- atomic polarizabilties (*100,[Angstrom**3])
     379!                1   2   3   4   5   6   7    8    9  10  11  12
    383380      data atpl/42.,42.,42.,42.,42.,42.,93.,151.,115.,59.,84.,59.,
    384 c               13  14  15   16  17  18
    385      #          93.,93.,93.,220.,42.,93./
    386 c ---------------------- effective numbers of electrons (*100,ref. 2)
    387 c                1   2   3   4   5   6    7    8    9   10   11   12
     381!               13  14  15   16  17  18
     382     &          93.,93.,93.,220.,42.,93./
     383! ---------------------- effective numbers of electrons (*100,ref. 2)
     384!                1   2   3   4   5   6    7    8    9   10   11   12
    388385      data efel/85.,85.,85.,85.,85.,85.,520.,520.,520.,700.,700.,700.,
    389 c                13   14   15    16  17   18
    390      #          610.,610.,610.,1480.,85.,520./
    391 c ------------------------- min. pairwise 6-12 energy (*1000,[kcal/mol])
    392 c                1   2   3   4   5   6   7    8   9  10   11  12
     386!                13   14   15    16  17   18
     387     &          610.,610.,610.,1480.,85.,520./
     388! ------------------------- min. pairwise 6-12 energy (*1000,[kcal/mol])
     389!                1   2   3   4   5   6   7    8   9  10   11  12
    393390      data emin/37.,36.,61.,61.,44.,36.,38.,140.,99.,94.,200.,94.,
    394 c                13   14   15   16  17  18
    395      #          107.,107.,107.,223.,99.,38./
    396 c ---------------------------- opt. pairwise distance (*100,[Angstrom])
    397 c                 1    2    3    4    5    6    7    8    9   10   11
     391!                13   14   15   16  17  18
     392     &          107.,107.,107.,223.,99.,38./
     393! ---------------------------- opt. pairwise distance (*100,[Angstrom])
     394!                 1    2    3    4    5    6    7    8    9   10   11
    398395      data rmin/292.,293.,268.,268.,283.,293.,412.,374.,370.,324.,312.,
    399 c                12   13   14   15   16   17   18
    400      #          324.,351.,351.,351.,415.,248.,412./
    401 c ---------------------------------------------- Hydrogen-bond donors
    402 c                  1       2       3      4      5      6
     396!                12   13   14   15   16   17   18
     397     &          324.,351.,351.,351.,415.,248.,412./
     398! ---------------------------------------------- Hydrogen-bond donors
     399!                  1       2       3      4      5      6
    403400      data do_s/.false.,.false.,.true.,.true.,.true.,.false.,
    404 c                  7       8       9      10      11      12
    405      #          .false.,.false.,.false.,.false.,.false.,.false.,
    406 c                 13      14      15      16      17      18
    407      #          .false.,.false.,.false.,.false.,.false.,.false./
    408 c -------------------------------------------- Hydrogen-bond acceptors
    409 c                  1       2       3       4       5       6
     401!                  7       8       9      10      11      12
     402     &          .false.,.false.,.false.,.false.,.false.,.false.,
     403!                 13      14      15      16      17      18
     404     &          .false.,.false.,.false.,.false.,.false.,.false./
     405! -------------------------------------------- Hydrogen-bond acceptors
     406!                  1       2       3       4       5       6
    410407      data ac_s/.false.,.false.,.false.,.false.,.false.,.false.,
    411 c                  7       8       9      10     11     12
    412      #          .false.,.false.,.false.,.true.,.true.,.true.,
    413 c                 13     14     15     16      17      18
    414      #          .true.,.true.,.true.,.false.,.false.,.false./
    415 cc     #        .false.,.true.,.true.,.false.,.false.,.false./ !! ICM
    416 c --------------------------------- HB-parameters (/1000,attraction)
     408!                  7       8       9      10     11     12
     409     &          .false.,.false.,.false.,.true.,.true.,.true.,
     410!                 13     14     15     16      17      18
     411     &          .true.,.true.,.true.,.false.,.false.,.false./
     412!     &        .false.,.true.,.true.,.false.,.false.,.false./ !! ICM
     413! --------------------------------- HB-parameters (/1000,attraction)
    417414      data chb_s/2624.,2624.,4610.,.0,  ! given as:
    418      #           4014.,4014.,5783.,.0,  !  (ac_typ x do_typ)
    419      #           2624.,2624.,4610.,.0,  ! to be used:
    420      #           8244.,8244.,8244.,.0,  !  (DO_typ x AC_typ)
    421      #           8244.,8244.,8244.,.0,  ! i.e.:
    422      #           8244.,8244.,8244.,.0/  !  ( 3-5 x 10-15 )
    423 c --------------------------------- HB-parameters (/1000,repulsion)
     415     &           4014.,4014.,5783.,.0,  !  (ac_typ x do_typ)
     416     &           2624.,2624.,4610.,.0,  ! to be used:
     417     &           8244.,8244.,8244.,.0,  !  (DO_typ x AC_typ)
     418     &           8244.,8244.,8244.,.0,  ! i.e.:
     419     &           8244.,8244.,8244.,.0/  !  ( 3-5 x 10-15 )
     420! --------------------------------- HB-parameters (/1000,repulsion)
    424421      data ahb_s/ 5890., 5890.,11220.,.0,
    425      #           12040.,12040.,16583.,.0,  ! 13344 -> 16583 = Ref. 3
    426      #            5890., 5890.,11220.,.0,
    427      #           32897.,32897.,32897.,.0,
    428      #           32897.,32897.,32897.,.0,
    429      #           32897.,32897.,32897.,.0/
    430 
    431 c                   1  2  3   4   5   6   7  8  9 10 11 12 13  14  15
     422     &           12040.,12040.,16583.,.0,  ! 13344 -> 16583 = Ref. 3
     423     &            5890., 5890.,11220.,.0,
     424     &           32897.,32897.,32897.,.0,
     425     &           32897.,32897.,32897.,.0,
     426     &           32897.,32897.,32897.,.0/
     427
     428!                   1  2  3   4   5   6   7  8  9 10 11 12 13  14  15
    432429      data e0to_s /20.,0.,0.,2.7,.6,1.8,1.8,0.,0.,0.,0.,0.,2.,1.5,3.5
    433 c                   16 17  18  19
    434      #             ,8.,18.,20.,15./
     430!                   16 17  18  19
     431     &             ,8.,18.,20.,15./
    435432      data sgto_s /-1.,0.,0., 1.,1., 1., 1.,0.,0.,0.,0.,0.,1., 1.,-1.
    436      #            ,-1.,-1.,-1.,-1./
     433     &            ,-1.,-1.,-1.,-1./
    437434      data rnto_s / 2.,0.,0., 3.,3., 3., 3.,0.,0.,0.,0.,0.,3., 3., 2.
    438      #             ,2., 2., 2., 2./
    439 
    440 c ---------------------------- Flex potential ----------------------------------
    441 c Lavery R Sklenar H Zakrzewska K Pullman B J Biomol Struct Dyn v3 989-1014 1986
    442 c VdW-parameters from: Zhurkin V.B Poltiev V.I Florent'ev V.L Molekulyarnaya
    443 c                      Biologiya v14 116 1980
    444 c ------------------------------------------------------------------------------
     435     &             ,2., 2., 2., 2./
     436
     437! ---------------------------- Flex potential ----------------------------------
     438! Lavery R Sklenar H Zakrzewska K Pullman B J Biomol Struct Dyn v3 989-1014 1986
     439! VdW-parameters from: Zhurkin V.B Poltiev V.I Florent'ev V.L Molekulyarnaya
     440!                      Biologiya v14 116 1980
     441! ------------------------------------------------------------------------------
    445442
    446443      data plt_f/78.d0/,  slp_f/0.16d0/   ! Parameters for Epsilon(R)
    447444      data cohb_f/6.d0/  ! Cut-off distance betw. H- & acceptor atom for HB
    448445      data c_f/  ! ----------- Lennard-Jones C6-parameters (attraction)
    449      #40.,40.,40.,40.,40.,40.,100.,126.,126.,86.,121.,105.,126.,105.,
    450      #146.,213.1,3*0.,40.,40.,40.,40.,40.,100.,126.,126.,86.,121.,105.,
    451      #126.,105.,146.,213.1,4*0.,40.,40.,40.,40.,100.,126.,126.,86.,121.,
    452      #105.,126.,105.,146.,213.1,5*0.,40.,40.,40.,100.,126.,126.,86.,121.
    453      #,105.,126.,105.,146.,213.1,6*0.,40.,40.,100.,126.,126.,86.,121.,
    454      #105.,126.,105.,146.,213.1,7*0.,40.,100.,126.,126.,86.,121.,105.,
    455      #126.,105.,146.,213.1,8*0.,250.,316.,316.,217.,305.,264.,316.,264.,
    456      #367.,489.,9*0.,400.,400.,274.,385.,334.,400.,334.,464.,537.4,10*0.
    457      #,400.,274.,385.,334.,400.,334.,464.,537.4,11*0.,200.,283.,245.,
    458      #278.,233.,330.,424.,12*0.,400.,347.,391.,327.,465.,583.,13*0.,300.
    459      #,339.,284.,403.,530.,14*0.,400.,334.,467.,556.5,15*0.,280.,391.,
    460      #484.,16*0.,550.,673.4,17*0.,246.,38*0./
     446     &40.,40.,40.,40.,40.,40.,100.,126.,126.,86.,121.,105.,126.,105.,
     447     &146.,213.1,3*0.,40.,40.,40.,40.,40.,100.,126.,126.,86.,121.,105.,
     448     &126.,105.,146.,213.1,4*0.,40.,40.,40.,40.,100.,126.,126.,86.,121.,
     449     &105.,126.,105.,146.,213.1,5*0.,40.,40.,40.,100.,126.,126.,86.,121.
     450     &,105.,126.,105.,146.,213.1,6*0.,40.,40.,100.,126.,126.,86.,121.,
     451     &105.,126.,105.,146.,213.1,7*0.,40.,100.,126.,126.,86.,121.,105.,
     452     &126.,105.,146.,213.1,8*0.,250.,316.,316.,217.,305.,264.,316.,264.,
     453     &367.,489.,9*0.,400.,400.,274.,385.,334.,400.,334.,464.,537.4,10*0.
     454     &,400.,274.,385.,334.,400.,334.,464.,537.4,11*0.,200.,283.,245.,
     455     &278.,233.,330.,424.,12*0.,400.,347.,391.,327.,465.,583.,13*0.,300.
     456     &,339.,284.,403.,530.,14*0.,400.,334.,467.,556.5,15*0.,280.,391.,
     457     &484.,16*0.,550.,673.4,17*0.,246.,38*0./
    461458      data a_f/  ! ---- Lennard-Jones A12-parameters (/1000,repulsion)
    462      #7.74,7.74,7.74,7.74,7.74,7.74,70.6,81.6,81.6,31.3,42.2,36.6,71.4,
    463      #62.,78.3,189.3,3*0.,7.74,7.74,7.74,7.74,7.74,70.6,61.7,61.7,31.3,
    464      #17.8,15.4,53.7,62.,58.7,189.3,4*0.,7.74,7.74,7.74,7.74,70.6,81.6,
    465      #81.6,31.3,42.2,36.6,71.4,62.,78.3,189.3,5*0.,7.74,7.74,7.74,70.6,
    466      #61.7,61.7,31.3,17.8,15.4,53.7,62.,58.7,189.3,6*0.,7.74,7.74,70.6,
    467      #81.6,81.6,31.3,42.2,36.6,71.4,62.,78.3,189.3,7*0.,7.74,70.6,81.6,
    468      #81.6,31.3,42.2,36.6,71.4,62.,78.3,189.3,8*0.,512.,601.,601.,256.,
    469      #349.,302.,538.,464.,598.,1196.,9*0.,704.,704.,298.,406.,351.,630.,
    470      #544.,699.,1203.5,10*0.,704.,298.,406.,351.,630.,544.,699.,1203.5,
    471      #11*0.,129.,176.,153.,269.,233.,303.,561.8,12*0.,240.,208.,366.,
    472      #317.,413.,772.5,13*0.,180.,317.,274.,358.,702.3,14*0.,565.,488.,
    473      #629.,1105.8,15*0.,421.,544.,976.8,16*0.,705.,1259.5,17*0.,503.3,
    474      #38*0./
    475 c ---------------------------------------------- Hydrogen-bond donors
    476 c                  1       2       3      4      5      6
     459     &7.74,7.74,7.74,7.74,7.74,7.74,70.6,81.6,81.6,31.3,42.2,36.6,71.4,
     460     &62.,78.3,189.3,3*0.,7.74,7.74,7.74,7.74,7.74,70.6,61.7,61.7,31.3,
     461     &17.8,15.4,53.7,62.,58.7,189.3,4*0.,7.74,7.74,7.74,7.74,70.6,81.6,
     462     &81.6,31.3,42.2,36.6,71.4,62.,78.3,189.3,5*0.,7.74,7.74,7.74,70.6,
     463     &61.7,61.7,31.3,17.8,15.4,53.7,62.,58.7,189.3,6*0.,7.74,7.74,70.6,
     464     &81.6,81.6,31.3,42.2,36.6,71.4,62.,78.3,189.3,7*0.,7.74,70.6,81.6,
     465     &81.6,31.3,42.2,36.6,71.4,62.,78.3,189.3,8*0.,512.,601.,601.,256.,
     466     &349.,302.,538.,464.,598.,1196.,9*0.,704.,704.,298.,406.,351.,630.,
     467     &544.,699.,1203.5,10*0.,704.,298.,406.,351.,630.,544.,699.,1203.5,
     468     &11*0.,129.,176.,153.,269.,233.,303.,561.8,12*0.,240.,208.,366.,
     469     &317.,413.,772.5,13*0.,180.,317.,274.,358.,702.3,14*0.,565.,488.,
     470     &629.,1105.8,15*0.,421.,544.,976.8,16*0.,705.,1259.5,17*0.,503.3,
     471     &38*0./
     472! ---------------------------------------------- Hydrogen-bond donors
     473!                  1       2       3      4      5      6
    477474      data do_f/.false.,.false.,.true.,.true.,.true.,.true.,
    478 c                  7       8       9      10      11      12
    479      #          .false.,.false.,.false.,.false.,.false.,.false.,
    480 c                 13      14      15      16      17      18
    481      #          .false.,.false.,.false.,.false.,.false.,.false./
    482 c -------------------------------------------- Hydrogen-bond acceptors
    483 c                  1       2       3       4       5       6
     475!                  7       8       9      10      11      12
     476     &          .false.,.false.,.false.,.false.,.false.,.false.,
     477!                 13      14      15      16      17      18
     478     &          .false.,.false.,.false.,.false.,.false.,.false./
     479! -------------------------------------------- Hydrogen-bond acceptors
     480!                  1       2       3       4       5       6
    484481      data ac_f/.false.,.false.,.false.,.false.,.false.,.false.,
    485 c                  7       8       9      10     11     12
    486      #          .false.,.false.,.false.,.true.,.true.,.true.,
    487 c                 13      14      15     16     17      18
    488      #          .false.,.false.,.true.,.true.,.false.,.false./
    489 c --------------------------------- HB-parameters (/1000,attraction)
     482!                  7       8       9      10     11     12
     483     &          .false.,.false.,.false.,.true.,.true.,.true.,
     484!                 13      14      15     16     17      18
     485     &          .false.,.false.,.true.,.true.,.false.,.false./
     486! --------------------------------- HB-parameters (/1000,attraction)
    490487      data chb_f/180.,180.,160. ,226.8,  ! given as  (ac_typ x do_typ)
    491      #           175.,175.,150. ,305.8,  ! to be used as:
    492      #           100.,100., 85. , 85. ,  !   (Do_typ x Ac_typ)
    493      #           165.,165.,150. ,305.8,  ! i.e.:
    494      #           720.,720.,643.1,845.6,  !   ( 3-6 x 10-12,15,16 )
    495      #             0.,  0.,  0. ,  0. /
    496 c --------------------------------- HB-parameters (/1000,repulsion)
     488     &           175.,175.,150. ,305.8,  ! to be used as:
     489     &           100.,100., 85. , 85. ,  !   (Do_typ x Ac_typ)
     490     &           165.,165.,150. ,305.8,  ! i.e.:
     491     &           720.,720.,643.1,845.6,  !   ( 3-6 x 10-12,15,16 )
     492     &             0.,  0.,  0. ,  0. /
     493! --------------------------------- HB-parameters (/1000,repulsion)
    497494      data ahb_f/  6600.,  6600.,  6200., 12855.,
    498      #             6400.,  6400.,  7100., 29216.,
    499      #             2400.,  2400.,  2400.,  2000.,
    500      #             6200.,  6200.,  7100., 29216.,
    501      #           185000.,185000.,172301.,308235.,
    502      #                0.,      0.,    0.,     0./
    503 
    504 c                   1  2   3   4  5   6   7  8   9 10 11  12  13 14  15
     495     &             6400.,  6400.,  7100., 29216.,
     496     &             2400.,  2400.,  2400.,  2000.,
     497     &             6200.,  6200.,  7100., 29216.,
     498     &           185000.,185000.,172301.,308235.,
     499     &                0.,      0.,    0.,     0./
     500
     501!                   1  2   3   4  5   6   7  8   9 10 11  12  13 14  15
    505502      data e0to_f /20.,2.,.8,2.6,.6,2.1,1.8,3.2,.5,.5,.8,1.2,1.3,1.,6.2
    506 c                  16  17 18 19
    507      #           ,6.2, 8.,0.,20./
     503!                  16  17 18 19
     504     &           ,6.2, 8.,0.,20./
    508505      data sgto_f /-1.,1.,-1., 1.,1., 1., 1.,1.,1.,1.,-1.,1., 1.,1.,-1.
    509      #           ,-1.,-1.,0.,-1./
     506     &           ,-1.,-1.,0.,-1./
    510507      data rnto_f / 2.,3., 3., 3.,3., 6., 3.,3.,6.,6., 3.,6., 3.,3., 2.
    511      #            ,2., 2.,0.,2./
     508     &            ,2., 2.,0.,2./
    512509
    513510      data (rsnmcd(i),i=1,nrsty)/  ! Names for all amino acid residue types
    514      # 'ala ','arg ','arg+','asn ','asp ','asp-','cys ','cyss','gln ',
    515      # 'glu ','glu-','gly ','his ','hise','hisd','his+','hyp ','hypu',
    516      # 'ile ','leu ','lys ','lys+','met ','phe ','cpro','pro ','cpru',
    517      # 'prou','pron','pro+','ser ','thr ','trp ','tyr ','val ' /
     511     & 'ala ','arg ','arg+','asn ','asp ','asp-','cys ','cyss','gln ',
     512     & 'glu ','glu-','gly ','his ','hise','hisd','his+','hyp ','hypu',
     513     & 'ile ','leu ','lys ','lys+','met ','phe ','cpro','pro ','cpru',
     514     & 'prou','pron','pro+','ser ','thr ','trp ','tyr ','val ' /
    518515 
    519516      data (onltcd(i),i=1,nrsty)/  ! One-letter codes for amino acid types
    520      # 'A',   'R',   'R',   'N',   'D',   'D',   'C',   'C',   'Q',
    521      # 'E',   'E',   'G',   'H',   'H',   'H',   'H',   'P',   'P',
    522      # 'I',   'L',   'K',   'K',   'M',   'F',   'P',   'P',   'P',
    523      # 'P',   'P',   'P',   'S',   'T',   'W',   'Y',   'V' /
    524 
    525 c     The vdW radii (in Angstr.) for the atomic groups and
    526 c      coefficients for their solvation free energy (kcal/molxA**2)
    527 
    528 c  Method:
    529 
    530 c  itysol=1 : OONS --> T.Ooi, et al,
    531 c                      Proc. Natl. Acad. Sci. USA 8 (1987) 3086-3090.
    532 C  itysol=2 : JRF  --> J.Vila, et al,
    533 c                      PROTEINS: Struct Funct Genet 10(1991) 199-218.
    534 C  itysol=3 : WE92 --> L.Wesson, D.Eisenberg,
    535 c                      Protein Science 1 (1992) 227-235.
    536 C  itysol=4 : SCH1 --> D.Eisenberg, et al,
    537 c                      Chem Scrip 29A (1989) 217-221.
    538 C  itysol=5 : SCH2 --> A.H.Juffer, et al,
    539 c                      Proteine Science 4 (1995) 2499-2509.
    540 C  itysol=6 : SCH3 --> L.Wesson, D.Eisenberg,
    541 c                      Protein Science 1 (1992) 227-235.
    542 C  itysol=7 : SCH4 --> C.A. Schiffer, et al,
    543 c                      Mol. Simul. 10(1993) 121-149.
    544 C  itysol=8 : EM86 --> D.Eisenberg, A.D. Mclachlan,
    545 c                      Nature 319 (1986) 199-203.
    546 C  itysol=9 : BM   --> B. Freyberg, et al,
    547 c                      J. Mol. Biol. 233 (1993) 275-292.
    548 
    549 c ATOM
    550 c TYPE OONS    JRF     WE92    SCH1    SCH2    SCH3    SCH4   EM86   BM
    551 
    552 c 1   0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.000 0.000
    553 c 2   0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.000 0.000
    554 c 3   0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.000 0.000
    555 c 4   0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.000 0.000
    556 c 5   0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.000 0.000
    557 c 6   0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.000 0.000
    558 c 7   0.0080  0.2160  0.0120  0.0180  0.0130  0.0040  0.0325  0.016 1.000
    559 c 8   0.4270 -0.7320  0.0120  0.0180  0.0130  0.0040  0.0325  0.016 1.000
    560 c 9  -0.0080 -0.6780  0.0120  0.0180  0.0130  0.0040  0.0325  0.016 1.000
    561 c10  -0.1720 -0.9100 -0.1160 -0.0090 -0.0070 -0.1130 -0.0175 -0.006 0.000
    562 c11  -0.0380 -0.2620 -0.1750 -0.0090 -0.0070 -0.1660 -0.2800 -0.006 0.000
    563 c12  -0.0380 -0.9100 -0.1750 -0.0370 -0.1120 -0.1660 -0.2800 -0.024 0.000
    564 c13  -0.1320 -0.3120 -0.1860 -0.0380 -0.0870 -0.1690 -0.2175 -0.05  0.000
    565 c14  -0.1320 -0.3120 -0.1160 -0.0090 -0.0070 -0.1130 -0.0175 -0.006 0.000
    566 c15  -0.1320 -0.3120 -0.1160 -0.0090 -0.0070 -0.1130 -0.0175 -0.006 0.000
    567 c16  -0.0210 -0.2810 -0.0180  0.0050 -0.0036 -0.0170 -0.0090  0.021 0.000
    568 c17   0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.000 0.000
    569 c18   0.0080  0.2160  0.0120  0.0180  0.0130  0.0040  0.0325  0.016 1.000
     517     & 'A',   'R',   'R',   'N',   'D',   'D',   'C',   'C',   'Q',
     518     & 'E',   'E',   'G',   'H',   'H',   'H',   'H',   'P',   'P',
     519     & 'I',   'L',   'K',   'K',   'M',   'F',   'P',   'P',   'P',
     520     & 'P',   'P',   'P',   'S',   'T',   'W',   'Y',   'V' /
     521
     522!     The vdW radii (in Angstr.) for the atomic groups and
     523!      coefficients for their solvation free energy (kcal/molxA**2)
     524
     525!  Method:
     526
     527!  itysol=1 : OONS --> T.Ooi, et al,
     528!                      Proc. Natl. Acad. Sci. USA 8 (1987) 3086-3090.
     529!  itysol=2 : JRF  --> J.Vila, et al,
     530!                      PROTEINS: Struct Funct Genet 10(1991) 199-218.
     531!  itysol=3 : WE92 --> L.Wesson, D.Eisenberg,
     532!                      Protein Science 1 (1992) 227-235.
     533!  itysol=4 : SCH1 --> D.Eisenberg, et al,
     534!                      Chem Scrip 29A (1989) 217-221.
     535!  itysol=5 : SCH2 --> A.H.Juffer, et al,
     536!                      Proteine Science 4 (1995) 2499-2509.
     537!  itysol=6 : SCH3 --> L.Wesson, D.Eisenberg,
     538!                      Protein Science 1 (1992) 227-235.
     539!  itysol=7 : SCH4 --> C.A. Schiffer, et al,
     540!                      Mol. Simul. 10(1993) 121-149.
     541!  itysol=8 : EM86 --> D.Eisenberg, A.D. Mclachlan,
     542!                      Nature 319 (1986) 199-203.
     543!  itysol=9 : BM   --> B. Freyberg, et al,
     544!                      J. Mol. Biol. 233 (1993) 275-292.
     545
     546! ATOM
     547! TYPE OONS    JRF     WE92    SCH1    SCH2    SCH3    SCH4   EM86   BM
     548
     549! 1   0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.000 0.000
     550! 2   0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.000 0.000
     551! 3   0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.000 0.000
     552! 4   0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.000 0.000
     553! 5   0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.000 0.000
     554! 6   0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.000 0.000
     555! 7   0.0080  0.2160  0.0120  0.0180  0.0130  0.0040  0.0325  0.016 1.000
     556! 8   0.4270 -0.7320  0.0120  0.0180  0.0130  0.0040  0.0325  0.016 1.000
     557! 9  -0.0080 -0.6780  0.0120  0.0180  0.0130  0.0040  0.0325  0.016 1.000
     558!10  -0.1720 -0.9100 -0.1160 -0.0090 -0.0070 -0.1130 -0.0175 -0.006 0.000
     559!11  -0.0380 -0.2620 -0.1750 -0.0090 -0.0070 -0.1660 -0.2800 -0.006 0.000
     560!12  -0.0380 -0.9100 -0.1750 -0.0370 -0.1120 -0.1660 -0.2800 -0.024 0.000
     561!13  -0.1320 -0.3120 -0.1860 -0.0380 -0.0870 -0.1690 -0.2175 -0.05  0.000
     562!14  -0.1320 -0.3120 -0.1160 -0.0090 -0.0070 -0.1130 -0.0175 -0.006 0.000
     563!15  -0.1320 -0.3120 -0.1160 -0.0090 -0.0070 -0.1130 -0.0175 -0.006 0.000
     564!16  -0.0210 -0.2810 -0.0180  0.0050 -0.0036 -0.0170 -0.0090  0.021 0.000
     565!17   0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.000 0.000
     566!18   0.0080  0.2160  0.0120  0.0180  0.0130  0.0040  0.0325  0.016 1.000
    570567
    571568       data coef_sl/54*0.0,
    572      # 0.008, 0.216, 0.012, 0.018, 0.013, 0.004, 0.0325, 0.016,1.000,
    573      # 0.427,-0.732, 0.012, 0.018, 0.013, 0.004, 0.0325, 0.016,1.000,
    574      # -.008,-0.678, 0.012, 0.018, 0.013, 0.004, 0.0325, 0.016,1.000,
    575      # -.172,-0.910,-0.116,-0.009,-0.007,-0.113,-0.0175,-0.006,0.000,
    576      # -.038,-0.262,-0.116,-0.009,-0.007,-0.113,-0.0175,-0.006,0.000,
    577      # -.038,-0.910,-0.175,-0.037,-0.112,-0.166,-0.2800,-0.024,0.000,
    578      # -.132,-0.312,-0.186,-0.038,-0.087,-0.169,-0.2175,-0.05, 0.000,
    579      # -.132,-0.312,-0.116,-0.009,-0.007,-0.113,-0.0175,-0.006,0.000,
    580      # -.132,-0.312,-0.116,-0.009,-0.007,-0.113,-0.0175,-0.006,0.000,
    581      # -.021,-0.281,-0.018, 0.005,-.0036,-0.017,-0.0090, 0.021,0.000,
    582      #  9*0.0,
    583      # 0.008, 0.216, 0.012, 0.018, 0.013, 0.004, 0.0325, 0.016,1.000/
     569     & 0.008, 0.216, 0.012, 0.018, 0.013, 0.004, 0.0325, 0.016,1.000,
     570     & 0.427,-0.732, 0.012, 0.018, 0.013, 0.004, 0.0325, 0.016,1.000,
     571     & -.008,-0.678, 0.012, 0.018, 0.013, 0.004, 0.0325, 0.016,1.000,
     572     & -.172,-0.910,-0.116,-0.009,-0.007,-0.113,-0.0175,-0.006,0.000,
     573     & -.038,-0.262,-0.116,-0.009,-0.007,-0.113,-0.0175,-0.006,0.000,
     574     & -.038,-0.910,-0.175,-0.037,-0.112,-0.166,-0.2800,-0.024,0.000,
     575     & -.132,-0.312,-0.186,-0.038,-0.087,-0.169,-0.2175,-0.05, 0.000,
     576     & -.132,-0.312,-0.116,-0.009,-0.007,-0.113,-0.0175,-0.006,0.000,
     577     & -.132,-0.312,-0.116,-0.009,-0.007,-0.113,-0.0175,-0.006,0.000,
     578     & -.021,-0.281,-0.018, 0.005,-.0036,-0.017,-0.0090, 0.021,0.000,
     579     &  9*0.0,
     580     & 0.008, 0.216, 0.012, 0.018, 0.013, 0.004, 0.0325, 0.016,1.000/
    584581
    585582       data rad_vdw/54*0.,
    586      #              2*2.0,6*1.9,2.0,
    587      #              2*1.55,6*1.9,1.5,
    588      #              2*1.75,6*1.9,1.85,
    589      #              9*1.4,
    590      #              9*1.4,
    591      #              9*1.4,
    592      #              2*1.55,6*1.7,1.5,
    593      #              2*1.55,6*1.7,1.5,
    594      #              2*1.55,6*1.7,1.5,
    595      #              2*2.0,6*1.8,1.85,
    596      #              9*0.,
    597      #              2*2.0,6*1.9,2.0/
     583     &              2*2.0,6*1.9,2.0,
     584     &              2*1.55,6*1.9,1.5,
     585     &              2*1.75,6*1.9,1.85,
     586     &              9*1.4,
     587     &              9*1.4,
     588     &              9*1.4,
     589     &              2*1.55,6*1.7,1.5,
     590     &              2*1.55,6*1.7,1.5,
     591     &              2*1.55,6*1.7,1.5,
     592     &              2*2.0,6*1.8,1.85,
     593     &              9*0.,
     594     &              2*2.0,6*1.9,2.0/
    598595
    599596      end
  • init_molecule.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: init_molecule
    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 **************************************************************
    11 c FIXME: Data in varfile determines which molecule is changed.
     1! **************************************************************
     2!
     3! This file contains the subroutines: init_molecule
     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! **************************************************************
     11! FIXME: Data in varfile determines which molecule is changed.
    1212
    1313      subroutine init_molecule(iabin,grpn,grpc,seqfile,varfile)
    1414
    15 c ----------------------------------------------------------
    16 c PURPOSE: construct starting structure of molecule(s)
    17 c
    18 c          iabin = 1  : ab Initio using sequence &
    19 c                       variables given in input files
    20 c          iabin != 1 : sequence, variable information
    21 c                       from PDB-file
    22 c
    23 c          grpn:        N-terminal group
    24 c          grpc:        C-terminal group
    25 c
    26 c CALLS:   addend,bldmol,c_alfa,getmol,iendst, mklist, nursvr,
    27 C          pdbread,pdbvars,redseq,redvar,setmvs
    28 C
    29 c ----------------------------------------------------------
     15! ----------------------------------------------------------
     16! PURPOSE: construct starting structure of molecule(s)
     17!
     18!          iabin = 1  : ab Initio using sequence &
     19!                       variables given in input files
     20!          iabin != 1 : sequence, variable information
     21!                       from PDB-file
     22!
     23!          grpn:        N-terminal group
     24!          grpc:        C-terminal group
     25!
     26! CALLS:   addend,bldmol,c_alfa,getmol,iendst, mklist, nursvr,
     27!          pdbread,pdbvars,redseq,redvar,setmvs
     28!
     29! ----------------------------------------------------------
    3030
    3131      include 'INCL.H'
    3232      include 'INCP.H'
    3333
    34 cf2py character*80 optional, intent(in) :: seqfile = ' '
    35 cf2py character*80 optional, intent(in) :: varfile = ' '
     34!f2py character*80 optional, intent(in) :: seqfile = ' '
     35!f2py character*80 optional, intent(in) :: varfile = ' '
    3636     
    3737      character grpn*4,grpc*4
     
    4747      if (iabin.eq.1) then 
    4848         
    49 c     ----------------------------------------- get sequence for molecule(s)
     49!     ----------------------------------------- get sequence for molecule(s)
    5050         lunseq=11
    5151         if (ntlml.gt.0) then
     
    6464         write (*,*) 'File with sequence is ', seqfil(1:iendst(seqfil))
    6565         
    66 c     --------------------------------- read & assemble data from libraries
    67 c     initial coordinates, interaction lists
     66!     --------------------------------- read & assemble data from libraries
     67!     initial coordinates, interaction lists
    6868         
    6969         ntl = ntlml
     
    8585         enddo
    8686         
    87 c     --------------------------- Read the initial conformation if necessary
     87!     --------------------------- Read the initial conformation if necessary
    8888         if(readFromStdin) then
    8989            write (*,'(a,$)') ' file with VARIABLES:'
    90 c     
     90!     
    9191            varfil=' '
    9292            read(*,'(a)',end=2,err=2) varfil
     
    105105 2       write(*,*) ' '
    106106         
    107 c     -------------------- get: nvr,idvr, vlvr, olvlvr
     107!     -------------------- get: nvr,idvr, vlvr, olvlvr
    108108         nvr = 0
    109109         do i=1,ivrml1(ntlml)+nvrml(ntlml)-1
     
    149149      endif
    150150     
    151 c     -------------------------- set var. amplitudes for simulations
     151!     -------------------------- set var. amplitudes for simulations
    152152     
    153153      do i=1,ivrml1(ntlml)+nvrml(ntlml)-1
     
    162162            if (                         navr(1:2).eq.'om'
    163163           
    164      #     .or.nars(1:3).eq.'arg'.and.(navr(1:2).eq.'x5'
    165      #           .or.navr(1:2).eq.'x6')
    166            
    167      #           .or.(nars(1:3).eq.'asn'.or.nars(1:3).eq.'asp')
    168      #           .and.navr(1:2).eq.'x3'
    169            
    170      #           .or.(nars(1:3).eq.'gln'.or.nars(1:3).eq.'glu')
    171      #           .and.navr(1:2).eq.'x4'
    172            
    173      #           ) then
    174            
    175 c     axvr(i) = pi/9.d0  ! 20 deg.
     164     &     .or.nars(1:3).eq.'arg'.and.(navr(1:2).eq.'x5'
     165     &           .or.navr(1:2).eq.'x6')
     166           
     167     &           .or.(nars(1:3).eq.'asn'.or.nars(1:3).eq.'asp')
     168     &           .and.navr(1:2).eq.'x3'
     169           
     170     &           .or.(nars(1:3).eq.'gln'.or.nars(1:3).eq.'glu')
     171     &           .and.navr(1:2).eq.'x4'
     172           
     173     &           ) then
     174           
     175!     axvr(i) = pi/9.d0  ! 20 deg.
    176176            axvr(i) = pi2       ! Trying out 360 deg. for these as well
    177177           
     
    186186      enddo                     ! vars.
    187187     
    188 c     --------------------- initialize solvation pars. if necessary
     188!     --------------------- initialize solvation pars. if necessary
    189189
    190190      if (itysol.ne.0) then
  • main.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c This file contains the:  main (SINGLE PROCESSOR JOBS ONLY,
    3 C                                FOR PARALLEL JOBS USE pmain)
    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 CALLS: init_energy,init_molecule
    11 C CALLS TASK SUBROUTINE: anneal,canon,elp,minim,mulcan_par,
    12 c                        mulcan_sim,partem_s, or regul
    13 C CAN ALSO CALL MEASUREMENT ROUTINES: cnteny,contacts,helix,hbond,
    14 C                                    outpdb,outvar,rgyr,
    15 C                                    rmsinit and rsmdfun,zimmer
    16 c $Id: main.f 334 2007-08-07 09:23:59Z meinke $
    17 c **************************************************************
     1! **************************************************************
     2! This file contains the:  main (SINGLE PROCESSOR JOBS ONLY,
     3!                                FOR PARALLEL JOBS USE pmain)
     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! CALLS: init_energy,init_molecule
     11! CALLS TASK SUBROUTINE: anneal,canon,elp,minim,mulcan_par,
     12!                        mulcan_sim,partem_s, or regul
     13! CAN ALSO CALL MEASUREMENT ROUTINES: cnteny,contacts,helix,hbond,
     14!                                    outpdb,outvar,rgyr,
     15!                                    rmsinit and rsmdfun,zimmer
     16! $Id: main.f 334 2007-08-07 09:23:59Z meinke $
     17! **************************************************************
    1818     
    1919      program main
     
    2626      logical lrand,bgsposs
    2727
    28 c =================================================== Energy setup
     28! =================================================== Energy setup
    2929
    30 c            Directory for SMMP libraries
    31 c     Change the following directory path to where you want to put SMMP
    32 c     libraries of residues.
     30!            Directory for SMMP libraries
     31!     Change the following directory path to where you want to put SMMP
     32!     libraries of residues.
    3333      libdir='./SMMP/'
    3434
    35 c      The switch in the following line is now not used.
     35!      The switch in the following line is now not used.
    3636      flex=.false.        ! .true. for Flex  / .false. for ECEPP
    3737
    38 c     Choose energy type with the following switch instead ...
     38!     Choose energy type with the following switch instead ...
    3939      ientyp = 0
    40 c        0  => ECEPP2 or ECEPP3 depending on the value of sh2
    41 c        1  => FLEX
    42 c        2  => Lund force field
    43 c        3  => ECEPP with Abagyan corrections
    44 c
     40!        0  => ECEPP2 or ECEPP3 depending on the value of sh2
     41!        1  => FLEX
     42!        2  => Lund force field
     43!        3  => ECEPP with Abagyan corrections
     44!
    4545
    4646      sh2=.false.         ! .true. for ECEPP/2; .false. for ECEPP3
     
    5454      call init_energy(libdir)
    5555
    56 c ================================================= Structure setup
     56! ================================================= Structure setup
    5757
    5858      grpn = 'nh2' ! N-terminal group
     
    6767      ntlml = 0
    6868      write (*,*) 'Solvent: ', itysol
    69 c     Initialize random number generator.
     69!     Initialize random number generator.
    7070      call sgrnd(31433)
    7171     
     
    7878      call init_molecule(iabin,grpn,grpc,seqfile,varfile)
    7979
    80 c Decide if and when to use BGS, and initialize Lund data structures
     80! Decide if and when to use BGS, and initialize Lund data structures
    8181      bgsprob=0.75   ! Prob for BGS, given that it is possible
    82 c upchswitch= 0 => No BGS 1 => BGS with probability bgsprob
    83 c 2 => temperature dependent choice
     82! upchswitch= 0 => No BGS 1 => BGS with probability bgsprob
     83! 2 => temperature dependent choice
    8484      upchswitch=1
    8585      rndord=.true.
     
    8989     
    9090
    91 c ========================================  Add your task down here
     91! ========================================  Add your task down here
    9292
    9393      imin = 1 ! Quasi-Newton
     
    9595      eps = 1.0d-7 ! requested precision
    9696      call minim(imin, maxit, eps)
    97 c     To do a canonical Monte Carlo simulation uncomment the lines below
     97!     To do a canonical Monte Carlo simulation uncomment the lines below
    9898!       nequi = 100
    9999!       nsweep = 50000
     
    101101!       temp = 300.0
    102102!       lrand = .true.
    103 c      Canonical Monte Carlo
     103!      Canonical Monte Carlo
    104104!       call canon(nequi, nsweep, nmes, temp, lrand)
    105105
    106 c      For simulated annealing uncomment the lines below
     106!      For simulated annealing uncomment the lines below
    107107!      tmin = 200.0
    108108!      tmax = 500.0
    109109!      call anneal(nequi, nsweep, nmes, tmax, tmin, lrand);
    110 c ========================================  End of main     
     110! ========================================  End of main     
    111111       end
  • main_bgl_p.f

    r2ebb8b6 rbd2278d  
    1 c     **************************************************************
    2 c     
    3 c     This file contains the   main (PARALLEL TEMPERING  JOBS ONLY,
    4 C     FOR SINGULAR PROCESSOR JOBS USE main)
    5 C     
    6 C     This file contains also the subroutine: p_init_molecule
    7 c     
    8 c     Copyright 2003-2005  Frank Eisenmenger, U.H.E. Hansmann,
    9 c     Shura Hayryan, Chin-Ku
    10 c Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
    11 c                      Jan H. Meinke, Sandipan Mohanty
    12 c     
    13 C     CALLS init_energy,p_init_molecule,partem_p
    14 C     
    15 c     **************************************************************
     1!     **************************************************************
     2!     
     3!     This file contains the   main (PARALLEL TEMPERING  JOBS ONLY,
     4!     FOR SINGULAR PROCESSOR JOBS USE main)
     5!     
     6!     This file contains also the subroutine: p_init_molecule
     7!     
     8!     Copyright 2003-2005  Frank Eisenmenger, U.H.E. Hansmann,
     9!     Shura Hayryan, Chin-Ku
     10! Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
     11!                      Jan H. Meinke, Sandipan Mohanty
     12!     
     13!     CALLS init_energy,p_init_molecule,partem_p
     14!     
     15!     **************************************************************
    1616      program pmain
    1717
     
    2828      logical newsta
    2929
    30 cc    Number of replicas
     30!c    Number of replicas
    3131      integer num_replica
    32 cc    Number of processors per replica
     32!c    Number of processors per replica
    3333      integer num_ppr
    34 cc    Range of processor for crating communicators
     34!c    Range of processor for crating communicators
    3535      integer proc_range(3)
    36 cc    Array of MPI groups
     36!c    Array of MPI groups
    3737      integer group(MAX_REPLICA), group_partem
    38 cc    Array of MPI communicators
     38!c    Array of MPI communicators
    3939      integer comm(MAX_REPLICA), partem_comm
    40 cc    Array of nodes acting as masters for the energy calculation.
     40!c    Array of nodes acting as masters for the energy calculation.
    4141      integer ranks(MAX_REPLICA)
    42 cc    Configuration switch
     42!c    Configuration switch
    4343      integer switch
    4444      integer rep_id
    45 c     set number of replicas
     45!     set number of replicas
    4646      double precision eols(MAX_REPLICA)
    4747      integer ndims, nldims, log2ppr, color
     
    5353
    5454
    55 c     MPI stuff, and random number generator initialisation
     55!     MPI stuff, and random number generator initialisation
    5656
    5757      call mpi_init(ierr)
     
    8888      call sgrnd(seed)          ! Initialize the random number generator
    8989
    90 c     =================================================== Energy setup
     90!     =================================================== Energy setup
    9191      libdir='SMMP/'     
    92 c     Directory for SMMP libraries
    93 
    94 c     The switch in the following line is now not used.
     92!     Directory for SMMP libraries
     93
     94!     The switch in the following line is now not used.
    9595      flex=.false.              ! .true. for Flex  / .false. for ECEPP
    9696
    97 c     Choose energy type with the following switch instead ...
     97!     Choose energy type with the following switch instead ...
    9898      ientyp = 0
    99 c     0  => ECEPP2 or ECEPP3 depending on the value of sh2
    100 c     1  => FLEX
    101 c     2  => Lund force field
    102 c     3  => ECEPP with Abagyan corrections
    103 c     
     99!     0  => ECEPP2 or ECEPP3 depending on the value of sh2
     100!     1  => FLEX
     101!     2  => Lund force field
     102!     3  => ECEPP with Abagyan corrections
     103!     
    104104
    105105      sh2=.false.               ! .true. for ECEPP/2; .false. for ECEPP3
     
    114114      call init_energy(libdir)
    115115
    116 c     calculate CPU time using MPI_Wtime()
     116!     calculate CPU time using MPI_Wtime()
    117117      startwtime = MPI_Wtime()
    118118
    119119
    120 c     ================================================= Structure setup
     120!     ================================================= Structure setup
    121121      grpn = 'nh2'              ! N-terminal group
    122122      grpc = 'cooh'             ! C-terminal group
     
    153153      ntlml = 0
    154154
    155 c Decide if and when to use BGS, and initialize Lund data structures
     155! Decide if and when to use BGS, and initialize Lund data structures
    156156      bgsprob=0.6    ! Prob for BGS, given that it is possible
    157 c upchswitch= 0 => No BGS 1 => BGS with probability bgsprob
    158 c 2 => temperature dependent choice
     157! upchswitch= 0 => No BGS 1 => BGS with probability bgsprob
     158! 2 => temperature dependent choice
    159159      upchswitch=1
    160160      rndord=.true.
    161161      if (ientyp.eq.2) call init_lundff
    162 c     =================================================================
    163 c     Distribute nodes to parallel tempering tasks
    164 c     I assume that the number of nodes available is an integer
    165 c     multiple n of the number of replicas. Each replica then gets n
    166 c     processors to do its energy calculation.
     162!     =================================================================
     163!     Distribute nodes to parallel tempering tasks
     164!     I assume that the number of nodes available is an integer
     165!     multiple n of the number of replicas. Each replica then gets n
     166!     processors to do its energy calculation.
    167167      num_ppr = num_proc / num_replica
    168168
     
    206206!      call mpi_comm_group(mpi_comm_world,  group_world, error)
    207207
    208 c     The current version doesn't require a separate variable j. I
    209 c     could just use i * num_ppr but this way it's more flexible.
     208!     The current version doesn't require a separate variable j. I
     209!     could just use i * num_ppr but this way it's more flexible.
    210210!       j = 0
    211211!       do i = 1, num_replica
     
    277277      nml = 1
    278278
    279 c     RRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD
     279!     RRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD
    280280      call rmsinit(nml,ref_pdb)
    281 c     RRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD
     281!     RRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD
    282282
    283283!     READ  REFERENCE CONTACT MAP
     
    294294      end do
    295295
    296 c     ========================================  start of parallel tempering run
     296!     ========================================  start of parallel tempering run
    297297      write (*,*) "There are ", no,
    298298     &            " processors available for ",rep_id
     
    303303      call partem_p(num_replica, nequi, nswp, nmes, nsave, newsta,
    304304     &              switch, rep_id, partem_comm)
    305 c     ========================================  end of parallel tempering run
    306 c     calculate CPU time using MPI_Wtime()
     305!     ========================================  end of parallel tempering run
     306!     calculate CPU time using MPI_Wtime()
    307307      endwtime = MPI_Wtime()
    308308
     
    319319      enddo
    320320
    321 c     ========================================  End of main
     321!     ========================================  End of main
    322322      CALL mpi_finalize(ierr)
    323323
  • main_p.f

    r2ebb8b6 rbd2278d  
    1 c     **************************************************************
    2 c     
    3 c     This file contains the   main (PARALLEL TEMPERING  JOBS ONLY,
    4 C     FOR SINGULAR PROCESSOR JOBS USE main)
    5 C     
    6 C     This file contains also the subroutine: p_init_molecule
    7 c     
    8 c     Copyright 2003-2005  Frank Eisenmenger, U.H.E. Hansmann,
    9 c     Shura Hayryan, Chin-Ku
    10 c Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
    11 c                      Jan H. Meinke, Sandipan Mohanty
    12 c     
    13 C     CALLS init_energy,p_init_molecule,partem_p
    14 C     
    15 c     **************************************************************
     1!     **************************************************************
     2!     
     3!     This file contains the   main (PARALLEL TEMPERING  JOBS ONLY,
     4!     FOR SINGULAR PROCESSOR JOBS USE main)
     5!     
     6!     This file contains also the subroutine: p_init_molecule
     7!     
     8!     Copyright 2003-2005  Frank Eisenmenger, U.H.E. Hansmann,
     9!     Shura Hayryan, Chin-Ku
     10! Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
     11!                      Jan H. Meinke, Sandipan Mohanty
     12!     
     13!     CALLS init_energy,p_init_molecule,partem_p
     14!     
     15!     **************************************************************
    1616      program pmain
    1717
     
    2828      logical newsta
    2929
    30 cc    Number of replicas
     30!c    Number of replicas
    3131      integer num_replica
    32 cc    Number of processors per replica
     32!c    Number of processors per replica
    3333      integer num_ppr
    34 cc    Range of processor for crating communicators
     34!c    Range of processor for crating communicators
    3535      integer proc_range(3)
    36 cc    Array of MPI groups
     36!c    Array of MPI groups
    3737      integer group(MAX_REPLICA), group_partem
    38 cc    Array of MPI communicators
     38!c    Array of MPI communicators
    3939      integer comm(MAX_REPLICA), partem_comm
    40 cc    Array of nodes acting as masters for the energy calculation.
     40!c    Array of nodes acting as masters for the energy calculation.
    4141      integer ranks(MAX_REPLICA)
    42 cc    Configuration switch
     42!c    Configuration switch
    4343      integer switch
    4444      integer rep_id
    45 c     set number of replicas
     45!     set number of replicas
    4646      double precision eols(MAX_REPLICA)
    4747
     
    5050
    5151
    52 c     MPI stuff, and random number generator initialisation
     52!     MPI stuff, and random number generator initialisation
    5353
    5454      call mpi_init(ierr)
     
    6161      call sgrnd(seed)          ! Initialize the random number generator
    6262
    63 c     =================================================== Energy setup
     63!     =================================================== Energy setup
    6464      libdir='SMMP/'     
    65 c     Directory for SMMP libraries
    66 
    67 c     The switch in the following line is now not used.
     65!     Directory for SMMP libraries
     66
     67!     The switch in the following line is now not used.
    6868      flex=.false.              ! .true. for Flex  / .false. for ECEPP
    6969
    70 c     Choose energy type with the following switch instead ...
     70!     Choose energy type with the following switch instead ...
    7171      ientyp = 0
    72 c     0  => ECEPP2 or ECEPP3 depending on the value of sh2
    73 c     1  => FLEX
    74 c     2  => Lund force field
    75 c     3  => ECEPP with Abagyan corrections
    76 c     
     72!     0  => ECEPP2 or ECEPP3 depending on the value of sh2
     73!     1  => FLEX
     74!     2  => Lund force field
     75!     3  => ECEPP with Abagyan corrections
     76!     
    7777
    7878      sh2=.false.               ! .true. for ECEPP/2; .false. for ECEPP3
     
    8787      call init_energy(libdir)
    8888
    89 c     calculate CPU time using MPI_Wtime()
     89!     calculate CPU time using MPI_Wtime()
    9090      startwtime = MPI_Wtime()
    9191
    9292
    93 c     ================================================= Structure setup
     93!     ================================================= Structure setup
    9494      grpn = 'nh2'              ! N-terminal group
    9595      grpc = 'cooh'             ! C-terminal group
     
    121121      ntlml = 0
    122122
    123 c Decide if and when to use BGS, and initialize Lund data structures
     123! Decide if and when to use BGS, and initialize Lund data structures
    124124      bgsprob=0.6    ! Prob for BGS, given that it is possible
    125 c upchswitch= 0 => No BGS 1 => BGS with probability bgsprob
    126 c 2 => temperature dependent choice
     125! upchswitch= 0 => No BGS 1 => BGS with probability bgsprob
     126! 2 => temperature dependent choice
    127127      upchswitch=1
    128128      rndord=.true.
    129129      if (ientyp.eq.2) call init_lundff
    130 c     =================================================================
    131 c     Distribute nodes to parallel tempering tasks
    132 c     I assume that the number of nodes available is an integer
    133 c     multiple n of the number of replicas. Each replica then gets n
    134 c     processors to do its energy calculation.
     130!     =================================================================
     131!     Distribute nodes to parallel tempering tasks
     132!     I assume that the number of nodes available is an integer
     133!     multiple n of the number of replicas. Each replica then gets n
     134!     processors to do its energy calculation.
    135135      num_ppr = num_proc / num_replica
    136136
    137137      call mpi_comm_group(mpi_comm_world,  group_world, error)
    138138
    139 c     The current version doesn't require a separate variable j. I
    140 c     could just use i * num_ppr but this way it's more flexible.
     139!     The current version doesn't require a separate variable j. I
     140!     could just use i * num_ppr but this way it's more flexible.
    141141      j = 0
    142142      do i = 1, num_replica
     
    163163      enddo
    164164
    165 c     Setup the communicator used for parallel tempering
     165!     Setup the communicator used for parallel tempering
    166166      write (*,*) "PTGroup=", ranks(:num_replica)
    167167      call flush(6)
     
    194194      nml = 1
    195195
    196 c     RRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD
     196!     RRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD
    197197      call rmsinit(nml,'EXAMPLES/1bdd.pdb')
    198 c     RRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD
     198!     RRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD
    199199
    200200!     READ  REFERENCE CONTACT MAP
     
    211211      end do
    212212
    213 c     ========================================  start of parallel tempering run
     213!     ========================================  start of parallel tempering run
    214214      write (*,*) "There are ", no,
    215215     &            " processors available for ",rep_id
     
    220220      call partem_p(num_replica, nequi, nswp, nmes, nsave, newsta,
    221221     &              switch, rep_id, partem_comm)
    222 c     ========================================  end of parallel tempering run
    223 c     calculate CPU time using MPI_Wtime()
     222!     ========================================  end of parallel tempering run
     223!     calculate CPU time using MPI_Wtime()
    224224      endwtime = MPI_Wtime()
    225225
     
    236236      enddo
    237237
    238 c     ========================================  End of main
     238!     ========================================  End of main
    239239      CALL mpi_finalize(ierr)
    240240
  • metropolis.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines:  metropolis
    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:  metropolis
     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 metropolis(eol1,acz,dummy)
    14 C
    15 C SUBROUTINE FOR METROPOLIS UPDATE OF CONFIGURATIONS
    16 C
    17 C CALLS: energy,addang,grnd,dummy (function provided as argument)
    18 C
     14!
     15! SUBROUTINE FOR METROPOLIS UPDATE OF CONFIGURATIONS
     16!
     17! CALLS: energy,addang,grnd,dummy (function provided as argument)
     18!
    1919      include 'INCL.H'
    2020      include 'INCP.H'
     
    2525      integer updtch1, updtch2,bgs
    2626      double precision vrol(mxvr), gbol
    27 cf2py intent(in, out) eol
    28 cf2py intent(in, out) acz
     27!f2py intent(in, out) eol
     28!f2py intent(in, out) acz
    2929      eol = energy()
    30 c     external rand
     30!     external rand
    3131      do nsw=1,nvr
    32 c Loop over dihedrals
    33 c
     32! Loop over dihedrals
     33!
    3434         iupstate=0
    3535         iupt=1
     
    5454            iupstate=bgs(eol,dummy)
    5555         else
    56 c           Simple twist of
    57 c           Get Proposal configuration
     56!           Simple twist of
     57!           Get Proposal configuration
    5858            vrol=vlvr!(jv) 
    5959            dv=axvr(jv)*(grnd()-0.5)
    6060            vlvr(jv)=addang(vrol(jv),dv)
    61 c
    62 c           Get dummy of proposal configuration
    63 c
     61!
     62!           Get dummy of proposal configuration
     63!
    6464            enw = energy()
    65 c
     65!
    6666            delta =  dummy(enw) - dummy(eol)
    67 c           ___________________________ check acceptance criteria
     67!           ___________________________ check acceptance criteria
    6868            if (delta.le.0.0d0) then
    6969               eol=enw 
     
    9090      end do
    9191
    92 c Updates on relative position of different molecules when there are many     
     92! Updates on relative position of different molecules when there are many     
    9393      if (ntlml.gt.1) then
    9494         do iml=1, ntlml
     
    104104                  endif
    105105               endif
    106 c     
    107 c              Get dummy of proposal configuration
    108 c     
     106!     
     107!              Get dummy of proposal configuration
     108!     
    109109               enw = energy()
    110 c
     110!
    111111               delta =  dummy(enw) - dummy(eol)
    112 c     
    113 c              ____________________________ check acceptance criteria
    114 c     
     112!     
     113!              ____________________________ check acceptance criteria
     114!     
    115115               if (delta.le.0.0d0) then
    116116                  eol=enw
     
    138138                  gbpr(i, iml) = (grnd()-0.5) * pi2
    139139               endif
    140 c     
    141 c              Get dummy of proposal configuration
    142 c     
     140!     
     141!              Get dummy of proposal configuration
     142!     
    143143               enw = energy()
    144 c     
     144!     
    145145               delta =  dummy(enw) - dummy(eol)
    146 c     
    147 c              ____________________________ check acceptance criteria
    148 c     
     146!     
     147!              ____________________________ check acceptance criteria
     148!     
    149149               if (delta.le.0.0d0) then
    150150                  eol=enw
     
    166166         enddo
    167167      endif
    168 c     
    169 c     Re-calculate energy
    170 c     
     168!     
     169!     Re-calculate energy
     170!     
    171171      enw = energy()
    172172      if(abs(eol-enw).gt.0.000001)  then
     
    176176         endif
    177177      endif
    178 c     
     178!     
    179179      eol1 = eol
    180180      return
    181 c     
     181!     
    182182      end
    183183     
  • mincjg.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: mincjg
    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: mincjg
     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      subroutine mincjg(n,mxn,x,f,g,acur,d,xa,ga,dt,yt,gt,maxfun,nfun)
    1212
    13 c ....................................................................
    14 c
    15 c  Conjugate Gradient Minimizer
    16 c
    17 c  INPUT:   X,F,G - variables, value of FUNC, gradient at START/
    18 c           ACUR - convergence is assumed if ACUR > SUM ( G(I)**2 )
    19 c           MAXFUN - maximum overall number of function calls
    20 c
    21 c  OUTPUT:  X,F,G - variables, value of FUNC, gradient at MINIMUM
    22 c           NFUN  - overall number of function calls used
    23 c
    24 c  ARRAYS:  D,XA,GA,YT,DT,GT - dimension N
    25 c
    26 c  CALLS:   MOVE - calculate function & its gradients for current X
    27 c
    28 c  PARAMETERS:  AMF    - rough estimate of first reduction in F, used
    29 c                        to guess initial step of 1st line search
    30 c               MXFCON - see 'ier=4'
    31 c               MAXLIN -
    32 c
    33 c  DIAGNOSTICS (ier)
    34 c
    35 c           = 0: minimization completed successfully
    36 c           = 1: number of steps reached MAXFUN
    37 c           = 2: line search was abandoned
    38 c           = 3: search direction is uphill
    39 c           = 4: two consecutive line searches failed to reduce F
    40 c ....................................................................
     13! ....................................................................
     14!
     15!  Conjugate Gradient Minimizer
     16!
     17!  INPUT:   X,F,G - variables, value of FUNC, gradient at START/
     18!           ACUR - convergence is assumed if ACUR > SUM ( G(I)**2 )
     19!           MAXFUN - maximum overall number of function calls
     20!
     21!  OUTPUT:  X,F,G - variables, value of FUNC, gradient at MINIMUM
     22!           NFUN  - overall number of function calls used
     23!
     24!  ARRAYS:  D,XA,GA,YT,DT,GT - dimension N
     25!
     26!  CALLS:   MOVE - calculate function & its gradients for current X
     27!
     28!  PARAMETERS:  AMF    - rough estimate of first reduction in F, used
     29!                        to guess initial step of 1st line search
     30!               MXFCON - see 'ier=4'
     31!               MAXLIN -
     32!
     33!  DIAGNOSTICS (ier)
     34!
     35!           = 0: minimization completed successfully
     36!           = 1: number of steps reached MAXFUN
     37!           = 2: line search was abandoned
     38!           = 3: search direction is uphill
     39!           = 4: two consecutive line searches failed to reduce F
     40! ....................................................................
    4141
    4242      implicit real*8 (a-h,o-z)
     
    4444
    4545      parameter (AMF = 10.d0,
    46      #           MXFCON = 2,
    47      #           MAXLIN = 5,
    48      #           TOL = 1.d-7,  ! controls 'stepch'
    49      #           EPS = .7d0)
     46     &           MXFCON = 2,
     47     &           MAXLIN = 5,
     48     &           TOL = 1.d-7,  ! controls 'stepch'
     49     &           EPS = .7d0)
    5050
    5151      dimension x(mxn),g(mxn),
    52      #          d(mxn),xa(mxn),ga(mxn),dt(mxn),yt(mxn),gt(mxn)
     52     &          d(mxn),xa(mxn),ga(mxn),dt(mxn),yt(mxn),gt(mxn)
    5353
    5454
     
    154154
    155155        if ( nfun .gt. (nfbeg + 1) .or.
    156      #       abs(gdmi/gdit) .gt. EPS ) then
     156     &       abs(gdmi/gdit) .gt. EPS ) then
    157157
    158158          ier=2
     
    205205
    206206      if ( (gdmi * gspln) .lt. 0.d0 )  stepch = stepch * gdmi /
    207      #                                          (gdmi - gspln)
     207     &                                          (gdmi - gspln)
    208208
    209209      goto 2
     
    242242
    243243        if (iterrs .ne. 0 .and. (iter - iterrs) .lt. (n-1) .and.
    244      #      abs(sum) .lt. gsq2 ) then
     244     &      abs(sum) .lt. gsq2 ) then
    245245
    246246          gama = 0.d0
  • minim.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: minim,move
    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: minim,move
     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 minim(imin, maxit, eps)
    1414
    15 c ......................................................................
    16 c PURPOSE: Use minimizers
    17 c
    18 c          imin = 1:  use Quasi-Newton
    19 c          imin = 2:  use Conjugated Gradients
    20 c
    21 c          @param maxit maximum number of iterations
    22 c          @param eps acceptance criterium
    23 cInstitute
    24 c CALLS: difang,energy,gradient, mincjg,minqsn, nursvr
    25 c ......................................................................
     15! ......................................................................
     16! PURPOSE: Use minimizers
     17!
     18!          imin = 1:  use Quasi-Newton
     19!          imin = 2:  use Conjugated Gradients
     20!
     21!          @param maxit maximum number of iterations
     22!          @param eps acceptance criterium
     23!Institute
     24! CALLS: difang,energy,gradient, mincjg,minqsn, nursvr
     25! ......................................................................
    2626
    2727      include 'INCL.H'
    28 cf2py intent(in) imin
    29 cf2py intent(in) maxit
    30 cf2py intent(in) eps
     28!f2py intent(in) imin
     29!f2py intent(in) maxit
     30!f2py intent(in) eps
    3131      parameter (msvmx=mxvr*(mxvr+5)/(2*(2*mxvr+1)),   
    32      #            msv  = 50 )                             
     32     &            msv  = 50 )                             
    3333
    3434      dimension w(mxvr*(mxvr+13)/2)
     
    3636      dimension vlvrn(mxvr),vlvro(mxvr),gdvr(mxvr),scl(mxvr)
    3737
    38 c --------------------------- new
     38! --------------------------- new
    3939      dimension gbpro(6,mxml)
    4040
     
    4747      endif
    4848
    49 c ----------------------- energy & gradient
     49! ----------------------- energy & gradient
    5050
    5151      call gradient()
     
    5656
    5757        write (*,'(a,e12.5,/,3(a,e11.4),/,2(a,e11.4),/)') ' Total: ',
    58      #    eysm,
    59      #    '   Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb,
    60      #    '   Variables: ',eyvr,'  Solvatation: ',eysl
     58     &    eysm,
     59     &    '   Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb,
     60     &    '   Variables: ',eyvr,'  Solvatation: ',eysl
    6161
    6262       else
     
    6464
    6565        write (*,'(a,e12.5,/,3(a,e11.4),/,3(a,e11.4),/)') ' Total: ',
    66      #    wtey*eysm + wtrg*eyrg,
    67      #    '   Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb,
    68      #    '   Variables: ',eyvr,'  Solvatation: ',eysl,
    69      #    ' Regularization: ',eyrg
     66     &    wtey*eysm + wtrg*eyrg,
     67     &    '   Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb,
     68     &    '   Variables: ',eyvr,'  Solvatation: ',eysl,
     69     &    ' Regularization: ',eyrg
    7070
    7171       endif
    7272
    73 c --------------------------------------- variables
     73! --------------------------------------- variables
    7474
    7575      ntlvr=ivrml1(ntlml)+nvrml(ntlml)-1
     
    129129        enddo
    130130
    131 c        if (abs(wtrg-1.d0).gt.1.d-4.and.abs(wtey-1.d0).gt.1.d-4) then
    132 c          gdey2 = max(acc,gdey2)
    133 c          gdrg2 = max(acc,gdrg2)
    134 c          wtrg = wtrg * sqrt(gdey2/gdrg2)
    135 c          write(*,*)  ' -->    Wt_energy = ',wtey,'  Wt_regul. = ',wtrg
    136 c          write(*,*)  '  '
    137 c        endif
     131!        if (abs(wtrg-1.d0).gt.1.d-4.and.abs(wtey-1.d0).gt.1.d-4) then
     132!          gdey2 = max(acc,gdey2)
     133!          gdrg2 = max(acc,gdrg2)
     134!          wtrg = wtrg * sqrt(gdey2/gdrg2)
     135!          write(*,*)  ' -->    Wt_energy = ',wtey,'  Wt_regul. = ',wtrg
     136!          write(*,*)  '  '
     137!        endif
    138138
    139139        esm=wtey*eysm+wtrg*eyrg
     
    152152
    153153        call minqsn(n,mxvr,vlvrn,esm,gdvr,scl,acc,w,w(n1),w(n2),
    154      #              w(n3),w(n4),w(n5),w(n6),mxop,nop)
     154     &              w(n3),w(n4),w(n5),w(n6),mxop,nop)
    155155
    156156      elseif (imin.eq.2) then ! Conjugated Gradients
     
    163163
    164164        call mincjg(n,mxvr,vlvrn,esm,gdvr,acc,w,w(n1),w(n2),  ! no 'scl'
    165      #              w(n3),w(n4),w(n5),mxop,nop)
     165     &              w(n3),w(n4),w(n5),mxop,nop)
    166166
    167167      endif
     
    176176
    177177      write (*,'(/,2a,/)') ' Final energies ',
    178      # '__________________________________________________'
     178     & '__________________________________________________'
    179179
    180180      eysm = energy()
     
    183183
    184184        write (*,'(a,e12.5,/,3(a,e11.4),/,2(a,e11.4))') ' Total: ',eysm,
    185      #  '   Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb,
    186      #  '   Variables: ',eyvr,'  Solvatation: ',eysl
     185     &  '   Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb,
     186     &  '   Variables: ',eyvr,'  Solvatation: ',eysl
    187187
    188188      else
    189189
    190190        write (*,'(a,e12.5,/,3(a,e11.4),/,3(a,e11.4))') ' Total: ',
    191      #      wtey*eysm + wtrg*eyrg,
    192      #  '   Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb,
    193      #  '   Variables: ',eyvr,'  Solvatation: ',eysl,
    194      #  ' Regularization: ',eyrg
     191     &      wtey*eysm + wtrg*eyrg,
     192     &  '   Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb,
     193     &  '   Variables: ',eyvr,'  Solvatation: ',eysl,
     194     &  ' Regularization: ',eyrg
    195195
    196196      endif
     
    207207
    208208          write (*,'(1x,a,1x,i4,f8.1,a,f5.1,a)') nmvr(i),nursvr(i),
    209      #        vr*crd,'    (',abs(difang(vr,vlvro(i)))*crd,')'
     209     &        vr*crd,'    (',abs(difang(vr,vlvro(i)))*crd,')'
    210210
    211211          vlvr(i) = vr
     
    231231
    232232      write (*,'(/,2a)') ' Gradient ',
    233      # '______________________________________________________________'
     233     & '______________________________________________________________'
    234234
    235235      write (*,'(8(1x,f8.3))') (gdvr(i),i=1,nv)
     
    244244      return
    245245      end
    246 c ********************************************
     246! ********************************************
    247247      subroutine move(nop,nvr1,esm,vlvrn,gdvr)
    248 c
    249 c CALLS: gradient
    250 c
     248!
     249! CALLS: gradient
     250!
    251251      include 'INCL.H'
    252252
     
    254254
    255255
    256 c ------------------------ compile & new variables
     256! ------------------------ compile & new variables
    257257
    258258      ntlvr=ivrml1(ntlml)+nvrml(ntlml)-1
     
    278278      endif
    279279
    280 c -------------------------- new minimz. gradient
     280! -------------------------- new minimz. gradient
    281281
    282282      call gradient()
     
    309309
    310310        write (*,'(a,i5,a,2(e13.6,a))') ' Step ',nop,': energy ',esm
    311      #                                 ,'  (',gdsmey,' )'
     311     &                                 ,'  (',gdsmey,' )'
    312312
    313313      else
     
    328328
    329329        write (*,'(a,i5,a,3(e13.6,a))') ' Step ',nop,': energy ',esm
    330      #                                 ,'  (',gdsmey,',',gdsmrg,' )'
     330     &                                 ,'  (',gdsmey,',',gdsmrg,' )'
    331331
    332332      endif
  • minqsn.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: minqsn,mc11a,mc11e
    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: minqsn,mc11a,mc11e
     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      subroutine minqsn(n,mxn,x,f,g,scal,acur,h,d,w,xa,ga,xb,gb,maxfun,
    13      #                  nfun)
    14 
    15 c .............................................................
    16 c  PURPOSE: Quasi-Newton minimizer
    17 c
    18 c           Unconstrained local minimization of function FUNC
    19 c           vs. N variables by quasi-Newton method using BFGS-
    20 c           formula to update hessian matrix; approximate line
    21 c           searches performed using cubic extra-/interpolation
    22 c           [see Gill P.E., Murray W., Wright M.H., Practical
    23 c            Optimization, Ch. 2.2.5.7, 4.3.2.1 ff.,4.4.2.2.,
    24 c            4.5.2.1]
    25 c
    26 c  INPUT:   X,F,G - variables, value of FUNC, gradient at START
    27 c           SCAL  - factors to reduce(increase) initial step &
    28 c                   its lower bound for line searches, diagonal
    29 c                   elements of initial hessian matrix
    30 c           MXN - maximal overall number of function calls
    31 c
    32 c  OUTPUT:  X,F,G - variables, value of FUNC, gradient at MINIMUM
    33 c           NFUN  - overall number of function calls used
    34 c 
    35 c  ARRAYS:  H - approximate hessian matrix in symmetric storage
    36 c               (dimension N(N+1)/2)
    37 c           W,D,XA,XB,GA,GB - dimension N
    38 c
    39 c  CALLS:   MOVE - external to calculate function for current X
    40 c                  and its gradients
    41 c           MC11E- solve system H*D=-G for search direction D, where
    42 c                  H is given in Cholesky-factorization
    43 c           MC11A- update H using BFGS formula, factorizise new H
    44 c                  according to Cholesky (modified to maintain its
    45 c                  positive definiteness)
    46 c
    47 c  PARAMETERS:
    48 c 
    49 c  EPS1 - checks reduction of FUNC during line search
    50 c         ( 0.0001 <= EPS1 < 0.5 )
    51 c  EPS2 - controls accuracy of line search (reduce to increase
    52 c         accuracy; EPS1 < EPS2 <= 0.9 )
    53 c  ACUR - fractional precision for determination of variables
    54 c         (should not be smaller than sqrt of machine accuracy)
    55 c  TINY - prevent division by zero during cubic extrapolation
    56 c .............................................................
     13     &                  nfun)
     14
     15! .............................................................
     16!  PURPOSE: Quasi-Newton minimizer
     17!
     18!           Unconstrained local minimization of function FUNC
     19!           vs. N variables by quasi-Newton method using BFGS-
     20!           formula to update hessian matrix; approximate line
     21!           searches performed using cubic extra-/interpolation
     22!           [see Gill P.E., Murray W., Wright M.H., Practical
     23!            Optimization, Ch. 2.2.5.7, 4.3.2.1 ff.,4.4.2.2.,
     24!            4.5.2.1]
     25!
     26!  INPUT:   X,F,G - variables, value of FUNC, gradient at START
     27!           SCAL  - factors to reduce(increase) initial step &
     28!                   its lower bound for line searches, diagonal
     29!                   elements of initial hessian matrix
     30!           MXN - maximal overall number of function calls
     31!
     32!  OUTPUT:  X,F,G - variables, value of FUNC, gradient at MINIMUM
     33!           NFUN  - overall number of function calls used
     34! 
     35!  ARRAYS:  H - approximate hessian matrix in symmetric storage
     36!               (dimension N(N+1)/2)
     37!           W,D,XA,XB,GA,GB - dimension N
     38!
     39!  CALLS:   MOVE - external to calculate function for current X
     40!                  and its gradients
     41!           MC11E- solve system H*D=-G for search direction D, where
     42!                  H is given in Cholesky-factorization
     43!           MC11A- update H using BFGS formula, factorizise new H
     44!                  according to Cholesky (modified to maintain its
     45!                  positive definiteness)
     46!
     47!  PARAMETERS:
     48! 
     49!  EPS1 - checks reduction of FUNC during line search
     50!         ( 0.0001 <= EPS1 < 0.5 )
     51!  EPS2 - controls accuracy of line search (reduce to increase
     52!         accuracy; EPS1 < EPS2 <= 0.9 )
     53!  ACUR - fractional precision for determination of variables
     54!         (should not be smaller than sqrt of machine accuracy)
     55!  TINY - prevent division by zero during cubic extrapolation
     56! .............................................................
    5757
    5858      implicit real*8 (a-h,o-z)
     
    6060
    6161      parameter ( eps1=0.1d0,
    62      #            eps2=0.7d0,
    63      #            tiny=1.d-32,
    64 
    65      #            zero=0.d0,
    66      #            izero=0,
    67      #            ione=1 )
     62     &            eps2=0.7d0,
     63     &            tiny=1.d-32,
     64
     65     &            zero=0.d0,
     66     &            izero=0,
     67     &            ione=1 )
    6868
    6969      dimension x(mxn),g(mxn),scal(mxn),h(mxn*(mxn+1)/2),d(mxn),w(mxn),
    70      #          xa(mxn),ga(mxn),xb(mxn),gb(mxn)
     70     &          xa(mxn),ga(mxn),xb(mxn),gb(mxn)
    7171
    7272      nfun=0
    7373      itr=0
    7474      dff=0.
    75 c _______________ hessian to a diagonal matrix depending on scale
     75! _______________ hessian to a diagonal matrix depending on scale
    7676      c=0.
    7777      do i=1,n
     
    102102    2 itr=itr+1    ! Start New Line-search from A
    103103
    104 c ______________ search direction of the iteration
     104! ______________ search direction of the iteration
    105105      do i=1,n
    106106        d(i)=-ga(i)
     
    126126      steplb=acur*c       ! lower bound on step
    127127
    128 c ________________________ initial step of the line search
     128! ________________________ initial step of the line search
    129129      if (dff.gt.0.) then
    130130        step=min(1.d0,(dff+dff)/(-dga))
     
    134134
    135135    3 if (nfun.ge.maxfun) then
    136 cc        write (*,*) ' minfor> exceeded max. number of function calls'
     136!c        write (*,*) ' minfor> exceeded max. number of function calls'
    137137        return
    138138      endif
     
    159159          if (gl2.ge.gl1) goto 4
    160160        endif
    161 c ______________ store function value if it is smallest so far
     161! ______________ store function value if it is smallest so far
    162162        f=fb
    163163        do i=1,n
     
    182182        stepub=stepub-step      ! new upper bound on step
    183183
    184 c _______________________________ next step by extrapolation
     184! _______________________________ next step by extrapolation
    185185        if (stepub.gt.0.) then
    186186          step=.5*stepub
     
    244244      return
    245245      end
    246 c ***********************************************
     246! ***********************************************
    247247      subroutine mc11a(a,n,mxn,z,sig,w,ir,mk,eps)
    248 c
    249 c CALLS: none
    250 c
     248!
     249! CALLS: none
     250!
    251251      implicit real*8 (a-h,o-z)
    252252      implicit integer*4 (i-n)
     
    368368      return
    369369      end
    370 c ************************************
     370! ************************************
    371371      subroutine mc11e(a,n,mxn,z,w,ir)
    372 c
    373 c CALLS: none
    374 c
     372!
     373! CALLS: none
     374!
    375375      implicit real*8 (a-h,o-z)
    376376      implicit integer*4 (i-n)
  • mklist.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: mklist,quench
    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: mklist,quench
     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      subroutine mklist(nml)
    1313
    14 c ......................................................................
    15 c PURPOSE: Compile interaction lists ('1-4' according to Scheraga)
    16 c
    17 c CALLS: quench
    18 c ......................................................................
    19 c TODO: Calculate van-der-Waals regions over all molecules.
     14! ......................................................................
     15! PURPOSE: Compile interaction lists ('1-4' according to Scheraga)
     16!
     17! CALLS: quench
     18! ......................................................................
     19! TODO: Calculate van-der-Waals regions over all molecules.
    2020      include 'INCL.H'
    2121
    2222      parameter (mxh=50,         ! max. # of atom regions
    23      #           mx2=50)
     23     &           mx2=50)
    2424
    2525      logical ovlp,quench
    2626
    2727      dimension l1st1(mxh),l1st2(mxh),l2nd1(mxh),l2nd2(mxh)
    28      #         ,l1i(mxbd),l2i(mx2)
    29 
    30 c _______________________ indices of 1st vdw-region/14-partner for 'nml'
     28     &         ,l1i(mxbd),l2i(mx2)
     29
     30! _______________________ indices of 1st vdw-region/14-partner for 'nml'
    3131      if (nml.eq.1) then
    3232        ivwml1(1)=1
     
    4040      if (ntlms.eq.0) then
    4141        write (*,'(a,i4)')
    42      #           ' mklist> No mov. sets defined in molecule #',nml
     42     &           ' mklist> No mov. sets defined in molecule #',nml
    4343        nvwml(nml)=0
    4444        n14ml(nml)=0
     
    4848      nvw=ivwml1(nml)-1     ! # of vdw-regions we have so far
    4949      n14=i14ml1(nml)-1     ! # of 14-partners      -"-
    50 c First atom in molecule
     50! First atom in molecule
    5151      ifiat=iatrs1(irsml1(nml))
    52 c Last atom in molecule
     52! Last atom in molecule
    5353      ilaat=iatrs2(irsml2(nml))
    54 c First variable in molecule
     54! First variable in molecule
    5555      ifivr=ivrml1(nml)
    56 c Last variable in molecule
     56! Last variable in molecule
    5757      ilavr=ifivr+nvrml(nml)-1
    58 c ____________________________ initialize: 1st vdw-region & 14-partner per atom
     58! ____________________________ initialize: 1st vdw-region & 14-partner per atom
    5959      do i=ifiat,ilaat
    6060        ivwat1(i)=0         !!!  for some atoms ...
     
    7474        if ((i2s-i1s+1).gt.0) then
    7575
    76 c ____________ exclude mov.sets of var. 'iv' from 1ST list of interact.partn.
     76! ____________ exclude mov.sets of var. 'iv' from 1ST list of interact.partn.
    7777          do is=i1s,i2s
    7878            ovlp=quench(latms1(is),latms2(is),n1st,mxh,l1st1,l1st2)
    7979          enddo
    80 c _______________________________ intitialize 2ND list with current 1ST list
     80! _______________________________ intitialize 2ND list with current 1ST list
    8181          do i=1,n1st
    8282            l2nd1(i)=l1st1(i)
     
    8484          enddo
    8585          n2nd=n1st
    86 c _________________________________ exclude 'ib' of var. 'iv' from 2ND list
     86! _________________________________ exclude 'ib' of var. 'iv' from 2ND list
    8787          ib=iowat(iatvr(iv))
    8888          ovlp=quench(ib,ib,n2nd,mxh,l2nd1,l2nd2)
     
    9494            ovlp=quench(iob,iob,n2nd,mxh,l2nd1,l2nd2) ! & in 2ND list
    9595
    96 c _____ atoms branching from 'iob': into GENERAL list of 1-4 partners
     96! _____ atoms branching from 'iob': into GENERAL list of 1-4 partners
    9797            do i=1,nbdat(iob)
    9898              ibd=ibdat(i,iob)
    9999              if (ibd.ne.ib.and.iowat(ibd).eq.iob.and.
    100      #            quench(ibd,ibd,n2nd,mxh,l2nd1,l2nd2) ) then
     100     &            quench(ibd,ibd,n2nd,mxh,l2nd1,l2nd2) ) then
    101101                n2i=n2i+1
    102102                if (n2i.gt.mx2) then
    103103                  write (*,'(a,i3,2a)')  ' mklist> Molecule # ',nml,
    104      #                ': too many atoms bound to ',nmat(iob)
     104     &                ': too many atoms bound to ',nmat(iob)
    105105                  stop
    106106                endif
     
    108108              endif
    109109            enddo  ! ... branches of 'iob'
    110 c ____________________________ check for further '1-4' partners
    111 c                              connected to branches 'l2i'
     110! ____________________________ check for further '1-4' partners
     111!                              connected to branches 'l2i'
    112112            do i=1,n2i
    113113              ia=l2i(i)
     
    116116                do j=latms1(im),latms2(im)
    117117                  if (ia.ne.j.and.
    118      #                quench(j,j,n2nd,mxh,l2nd1,l2nd2) ) then
     118     &                quench(j,j,n2nd,mxh,l2nd1,l2nd2) ) then
    119119                    n2i=n2i+1
    120120                    if (n2i.gt.mx2) then
    121121                      write (*,'(a,i3,a)')  ' mklist> Molecule # '
    122      #                         ,nml,': too many atoms in list L2I'
     122     &                         ,nml,': too many atoms in list L2I'
    123123                      stop
    124124                    endif
     
    129129            enddo
    130130
    131 c ____ If 'iow(iob)' exists and in 2ND list: into GENERAL list of 1-4 partners
     131! ____ If 'iow(iob)' exists and in 2ND list: into GENERAL list of 1-4 partners
    132132            ioiob=iowat(iob)    !  existence of iow( iow(base) )
    133133            if (ioiob.gt.0) then
     
    136136                if (n2i.gt.mx2) then
    137137                  write (*,'(a,i3,2a)')  ' mklist> Molecule # '
    138      #             ,nml,': too many atoms bound to ',nmat(iob)
     138     &             ,nml,': too many atoms bound to ',nmat(iob)
    139139                  stop
    140140                endif
     
    150150          endif
    151151
    152 c ______ Atoms bound to 'ib' & in 2ND list(=are NOT in m.s of 'iv'):
    153 c                    exclude from 2ND list & put in list 'l1i'
     152! ______ Atoms bound to 'ib' & in 2ND list(=are NOT in m.s of 'iv'):
     153!                    exclude from 2ND list & put in list 'l1i'
    154154          n1i=0
    155155          do i=1,nbdat(ib)
    156156            ibd=ibdat(i,ib)
    157157            if (iowat(ibd).eq.ib.and.
    158      #        quench(ibd,ibd,n2nd,mxh,l2nd1,l2nd2) ) then
     158     &        quench(ibd,ibd,n2nd,mxh,l2nd1,l2nd2) ) then
    159159              n1i=n1i+1
    160160              if (n1i.gt.mxbd) then
    161161                write (*,'(a,i3,2a)')  ' mklist> Molecule # ',nml,
    162      #             ': too many atoms bound to ',nmat(ib)
     162     &             ': too many atoms bound to ',nmat(ib)
    163163                stop
    164164              endif
    165165              l1i(n1i)=ibd
    166 c _______ add atoms branching from 'l1i'-atoms to GENERAL list 1-4 partners
     166! _______ add atoms branching from 'l1i'-atoms to GENERAL list 1-4 partners
    167167              do j=1,nbdat(ibd)
    168168                jbd=ibdat(j,ibd)
    169169                if (iowat(jbd).eq.ibd.and.
    170      #              quench(jbd,jbd,n2nd,mxh,l2nd1,l2nd2) ) then
     170     &              quench(jbd,jbd,n2nd,mxh,l2nd1,l2nd2) ) then
    171171                  n2i=n2i+1
    172172                  if (n2i.gt.mx2) then
    173173                    write (*,'(a,i3,2a)')  ' mklist> Molecule # ',nml,
    174      #              ': too many atoms bound to branches of ',nmat(ib)
     174     &              ': too many atoms bound to branches of ',nmat(ib)
    175175                    stop
    176176                  endif
     
    180180            endif
    181181          enddo
    182 c _____________________________ check for further '1-4' partners
    183 c                               belonging to moving set of base 'ib'
     182! _____________________________ check for further '1-4' partners
     183!                               belonging to moving set of base 'ib'
    184184          im=ixmsat(ib)
    185185          if (im.gt.0) then
     
    189189                if (n2i.gt.mx2) then
    190190                  write (*,'(a,i3,a)')  ' mklist> Molecule # ',nml,
    191      #            ': too many atoms n list L2I '
     191     &            ': too many atoms n list L2I '
    192192                  stop
    193193                endif
     
    199199          do is=i1s,i2s
    200200            do i=latms1(is),latms2(is)  ! ============= atoms in m.s of 'iv'
    201 c ________________________________________ Current 2ND list -> VdW-interact.
     201! ________________________________________ Current 2ND list -> VdW-interact.
    202202              if ((nvw+n2nd).gt.mxvw) then
    203203                write (*,'(a,i4,a,i5)') ' mklist> Molecule # ',nml,
    204      #            ': Number of vdw-domains > ',mxvw
     204     &            ': Number of vdw-domains > ',mxvw
    205205                stop
    206206              endif
     
    213213                lvwat2(nvw)=l2nd2(j)
    214214              enddo  ! ... vdW-domains
    215 c _________________________________________ General list of 1-4 partners
     215! _________________________________________ General list of 1-4 partners
    216216              if ((n14+n2i).gt.mx14) goto 1
    217217              i14at1(i)=n14+1
     
    221221                l14at(n14)=l2i(j)
    222222              enddo
    223 c __________________________________ Special cases of 1-4 interactions
    224 c                                    (list l1i, atoms iob,ib)
     223! __________________________________ Special cases of 1-4 interactions
     224!                                    (list l1i, atoms iob,ib)
    225225              iow=iowat(i)
    226226              if (iow.ne.ib) then
     
    253253      nvwml(nml)=nvw-ivwml1(nml)+1
    254254      n14ml(nml)=n14-i14ml1(nml)+1
    255 c _________________________________ some cleaning up
     255! _________________________________ some cleaning up
    256256      do i=ifiat,ilaat
    257257        if (ivwat1(i).le.0) then
     
    265265      enddo
    266266
    267 c ____________________________________________ Summary
    268 c      do i=ifiat,ilaat
    269 c        write (*,'(3a,i5,a)') ' ######## atom ',nmat(i),'(',i,')'
    270 c        iv1=ivwat1(i)
    271 c        iv2=ivwat2(i)
    272 c        if (iv1.le.iv2) then
    273 c          write(*,'(a)') ' ---> vdW :'
    274 c          do j=iv1,iv2
    275 c            write (*,'(i5,a,i5)') lvwat1(j),'-',lvwat2(j)
    276 c          enddo
    277 c        endif
    278 c        i41=i14at1(i)
    279 c        i42=i14at2(i)
    280 c        if (i41.le.i42) then
    281 c          write(*,'(a)') ' ---> 1-4 :'
    282 c          write(*,'(10i5)') (l14at(j),j=i41,i42)
    283 c        endif
    284 c      enddo
     267! ____________________________________________ Summary
     268!      do i=ifiat,ilaat
     269!        write (*,'(3a,i5,a)') ' ######## atom ',nmat(i),'(',i,')'
     270!        iv1=ivwat1(i)
     271!        iv2=ivwat2(i)
     272!        if (iv1.le.iv2) then
     273!          write(*,'(a)') ' ---> vdW :'
     274!          do j=iv1,iv2
     275!            write (*,'(i5,a,i5)') lvwat1(j),'-',lvwat2(j)
     276!          enddo
     277!        endif
     278!        i41=i14at1(i)
     279!        i42=i14at2(i)
     280!        if (i41.le.i42) then
     281!          write(*,'(a)') ' ---> 1-4 :'
     282!          write(*,'(10i5)') (l14at(j),j=i41,i42)
     283!        endif
     284!      enddo
    285285
    286286      return
    287287
    288288    1 write (*,'(a,i4,a,i5)') ' mklist> Molecule # ',nml,
    289      #                     ': Number of 1-4 interactions > ',mx14
     289     &                     ': Number of 1-4 interactions > ',mx14
    290290      stop
    291291      end
    292 c *********************************************
     292! *********************************************
    293293      logical function quench(i1,i2,n,mx,l1,l2)
    294294
    295 c ....................................................
    296 c PURPOSE:  Correct size/number (n) of index ranges
    297 c           given by lists 'l1' & 'l2' in order to
    298 c           EXCLUDE overlaps with range 'i1-i2'
    299 c
    300 c           quench = true, if any overlap was obtained
    301 c
    302 c CALLS: none
    303 c
    304 c ....................................................
     295! ....................................................
     296! PURPOSE:  Correct size/number (n) of index ranges
     297!           given by lists 'l1' & 'l2' in order to
     298!           EXCLUDE overlaps with range 'i1-i2'
     299!
     300!           quench = true, if any overlap was obtained
     301!
     302! CALLS: none
     303!
     304! ....................................................
    305305
    306306      implicit integer*4 (i-n)
  • mulcan_par.f

    r2ebb8b6 rbd2278d  
    55! Copyright 2003-2005  Frank Eisenmenger, U.H.E. Hansmann,
    66!                      Shura Hayryan, Chin-Ku
    7 c Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
    8 c                      Jan H. Meinke, Sandipan Mohanty
     7! Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
     8!                      Jan H. Meinke, Sandipan Mohanty
    99!
    1010! **************************************************************
  • mulcan_sim.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: mulcan_sim,muca_weight2
    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: mulcan_sim,muca_weight2
     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      subroutine  mulcan_sim
    13 C
    14 C PURPOSE: PERFORM A MULTICANONICAL SIMULATION
    15 C REQUIRES AS INPUT THE MULTICANONICAL PARAMETER AS CALCULATED
    16 C BY THE SUBROUTINE mulcan_par
    17 C
    18 c CALLS: addang, contacts,energy,metropolis
    19 c
     13!
     14! PURPOSE: PERFORM A MULTICANONICAL SIMULATION
     15! REQUIRES AS INPUT THE MULTICANONICAL PARAMETER AS CALCULATED
     16! BY THE SUBROUTINE mulcan_par
     17!
     18! CALLS: addang, contacts,energy,metropolis
     19!
    2020      include 'INCL.H'
    2121
    22 c     external rand
     22!     external rand
    2323      external muca_weight2
    2424
     
    2929      parameter(nsweep=100000,nequi=100)
    3030      Parameter(nsave=1000,nmes=10)
    31 C
    32 C     restart: .true. =  restart of simulation
    33 C              .false. = start of simulation with random configuration
    34 C     kmin,kmax: Range of multicanonical parameter
    35 C     ebin:      bin size for multicanonical parameter
    36 C     nequi: Number of sweeps for equilibrisation
    37 C     nsweep:  Number of sweeps for simulation run
    38 C     nsave:  Number of sweeps after which actual configuration is saved
    39 C             for re-starts
    40 C     nmes: Number of sweeps between measurments
    41 C
     31!
     32!     restart: .true. =  restart of simulation
     33!              .false. = start of simulation with random configuration
     34!     kmin,kmax: Range of multicanonical parameter
     35!     ebin:      bin size for multicanonical parameter
     36!     nequi: Number of sweeps for equilibrisation
     37!     nsweep:  Number of sweeps for simulation run
     38!     nsave:  Number of sweeps after which actual configuration is saved
     39!             for re-starts
     40!     nmes: Number of sweeps between measurments
     41!
    4242
    4343      dimension xhist(kmin:kmax),ihist(kmin:kmax)
     
    4545
    4646 
    47 C FILE with last conformation (for re-starts)
     47! FILE with last conformation (for re-starts)
    4848      open(8,file='EXAMPLES/start.d')
    49 C File with contact map of reference configuration
     49! File with contact map of reference configuration
    5050      open(9,file='EXAMPLES/enkefa.ref')
    51 C File with multicanonical parameter
     51! File with multicanonical parameter
    5252      open(10,file='EXAMPLES/muca.d')
    53 C Result file: Time series of certain quantities
     53! Result file: Time series of certain quantities
    5454      open(11, file='EXAMPLES/time.d')
    5555
     
    6060
    6161      nresi=irsml2(1)-irsml1(1) + 1
    62 c     nresi:  Number of residues
    63 
    64 C READ  REFERENCE CONTACT MAP
     62!     nresi:  Number of residues
     63
     64! READ  REFERENCE CONTACT MAP
    6565      nci = 0
    6666      do i=1,nresi
     
    7474      write(*,*) 'Number of contacts in reference conformation:',nci
    7575
    76 C READ IN FIELDS WITH MULTICANONICAL PARAMETER
     76! READ IN FIELDS WITH MULTICANONICAL PARAMETER
    7777      Do j=kmin,kmax
    7878       read(10,*) i,b(i),alpha(i)
    7979      end do
    80 C
     80!
    8181
    8282      if(restart) then
     
    9090       write(*,*) 'Last iteration, energy:',nswm,eol_old
    9191      else
    92 c _________________________________ random start
     92! _________________________________ random start
    9393       do i=1,nvr
    9494        iv=idvr(i)  ! provides index of non-fixed variable
     
    9898       enddo
    9999      end if
    100 c
     100!
    101101      eol = energy()
    102102      write (*,'(e12.5,/)')  eol
     
    109109      end do
    110110      write(*,*)
    111 C
     111!
    112112
    113113     
    114114      if(.not.restart) then
    115 c =====================Equilibrization by  Metropolis
     115! =====================Equilibrization by  Metropolis
    116116       do nsw=1,nequi
    117117        call metropolis(eol,acz,muca_weight2)
     
    123123      end if
    124124
    125 C======================Simulation
     125!======================Simulation
    126126      acz = 0.0d0
    127 C LOOP OVER SWEEPS
     127! LOOP OVER SWEEPS
    128128      do nsw=nswm,nsweep
    129 C
    130 C METROPOLIS UPDATE
     129!
     130! METROPOLIS UPDATE
    131131       call metropolis(eol,acz,muca_weight2)
    132132       muold = min(kmax,max(kmin,int(eol/ebin+sign(0.5d0,eol))))
    133133       ihist(muold) = ihist(muold) + 1
    134 C
    135 C  SAVE ACTUAL CONFORMATIONS FOR RE-STARTS:
     134!
     135!  SAVE ACTUAL CONFORMATIONS FOR RE-STARTS:
    136136       if(mod(nsw,nsave).eq.0) then
    137137        rewind 8
     
    143143        end do
    144144       end if
    145 C Measurements after NMES sweeps
     145! Measurements after NMES sweeps
    146146       if(mod(nsw,nmes).eq.0) then
    147 C Take a histogram of energy
     147! Take a histogram of energy
    148148        do i=kmin,kmax
    149149         xhist(i) = xhist(i) + ihist(i)
    150150         ihist(i) = 0
    151151        end do
    152 c Calculate contacts in actual configuartion and compare with reference
    153 C configuration
    154 c       call contacts(nhx,nhy,dham)
    155 C nhx : Number of contcats in actual conformation
    156 C nhy : Number of contacts which are identical in actual and reference
    157 C       configuration
    158 C dham:  Hamming distance between actual and reference configuration     
    159 C
     152! Calculate contacts in actual configuartion and compare with reference
     153! configuration
     154!       call contacts(nhx,nhy,dham)
     155! nhx : Number of contcats in actual conformation
     156! nhy : Number of contacts which are identical in actual and reference
     157!       configuration
     158! dham:  Hamming distance between actual and reference configuration     
     159!
    160160        write(11,'(i7,f12.2,2i8,f12.4)')  nsw,eol,nhx,nhy,dham
    161161       end if
    162162      end do
    163 C END OF SIMULATION
    164 
    165 C FINAL OUTPUT:
     163! END OF SIMULATION
     164
     165! FINAL OUTPUT:
    166166      acz = acz/dble(nsw*nvr)
    167167      write(*,*) 'last energy',eol
    168168      write(*,*) 'aczeptance rate:',acz
    169169
    170 C WRITE DOWN (UN-REWEIGHTED) HISTOGRAM OF MULTICANONICAL SIMULATION
     170! WRITE DOWN (UN-REWEIGHTED) HISTOGRAM OF MULTICANONICAL SIMULATION
    171171      do i=kmin,kmax
    172172       if(xhist(i).gt.0.0d0) then
     
    174174       end if
    175175      end do
    176 c =====================
     176! =====================
    177177      close(8)
    178178      close(9)
     
    183183      end
    184184
    185 c ************************************************************
     185! ************************************************************
    186186      real*8 function muca_weight2(x)
    187187
  • nursvr.f

    r2ebb8b6 rbd2278d  
    1 c**************************************************************
    2 c
    3 c This file contains the subroutines: nursvr, nursat
    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: nursvr, nursat
     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      integer*4 function nursvr(ivr)
    1212
    13 c ...........................................................
    14 c  PURPOSE: defines index of residue for given variable 'ivr'
    15 c
    16 c  CALLS: none
    17 c
    18 c ...........................................................
     13! ...........................................................
     14!  PURPOSE: defines index of residue for given variable 'ivr'
     15!
     16!  CALLS: none
     17!
     18! ...........................................................
    1919      include 'INCL.H'
    2020
     
    3636      end
    3737
    38 c **********************************
     38! **********************************
    3939      integer*4 function nursat(iat)
    4040
    41 c .......................................................
    42 c  PURPOSE: defines index of residue for given atom 'iat'
    43 c .......................................................
     41! .......................................................
     42!  PURPOSE: defines index of residue for given atom 'iat'
     43! .......................................................
    4444
    4545      include 'INCL.H'
  • opeflx.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: opeflx,gdtflx
    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: opeflx,gdtflx
     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      subroutine opeflx(nml)
    1313
    14 c ......................................................................
    15 c PURPOSE: Calculate internal energy for FLEX dataset and its partial
    16 c          derivatives vs. variables using recursive algorithm from:
    17 c          Noguti T, Go N, J Phys Soc (Japan) v52 3685-3690 1984; Abe H,
    18 c          Braun W, Noguti T, Go N, Comp Chem v8 239-247 1984; Mazur A K,
    19 c          Abagyan R A, J Biomol Struct Dyn v6 815-832, which I modified
    20 c          for atomic forces instead of simple derivatives (see Lavery R,
    21 c          Sklenar H, Zakrzewska K, Pullman B, J Biomol Struct Dyn v3
    22 c          989-1014 1986)
    23 c
    24 c CALLS:   gdtflx
    25 c ......................................................................
     14! ......................................................................
     15! PURPOSE: Calculate internal energy for FLEX dataset and its partial
     16!          derivatives vs. variables using recursive algorithm from:
     17!          Noguti T, Go N, J Phys Soc (Japan) v52 3685-3690 1984; Abe H,
     18!          Braun W, Noguti T, Go N, Comp Chem v8 239-247 1984; Mazur A K,
     19!          Abagyan R A, J Biomol Struct Dyn v6 815-832, which I modified
     20!          for atomic forces instead of simple derivatives (see Lavery R,
     21!          Sklenar H, Zakrzewska K, Pullman B, J Biomol Struct Dyn v3
     22!          989-1014 1986)
     23!
     24! CALLS:   gdtflx
     25! ......................................................................
    2626
    2727      include 'INCL.H'
    2828
    2929      dimension xfat(mxat),yfat(mxat),zfat(mxat),
    30      #          xtat(mxat),ytat(mxat),ztat(mxat),
    31      #          xfvr(mxvr),yfvr(mxvr),zfvr(mxvr),
    32      #          xfrvr(mxvr),yfrvr(mxvr),zfrvr(mxvr)
     30     &          xtat(mxat),ytat(mxat),ztat(mxat),
     31     &          xfvr(mxvr),yfvr(mxvr),zfvr(mxvr),
     32     &          xfrvr(mxvr),yfrvr(mxvr),zfrvr(mxvr)
    3333
    3434
     
    4242      if (ntlvr.eq.0) then
    4343        write (*,'(a,i4)')
    44      #           ' opeflx> No variables defined in molecule #',nml
     44     &           ' opeflx> No variables defined in molecule #',nml
    4545        return
    4646      endif
     
    117117        endif
    118118
    119 c ============================================ Energies & Atomic forces
     119! ============================================ Energies & Atomic forces
    120120
    121121        xfiv=0.d0
     
    249249                    yfji=yfji+ dhb*py+ hhb*yij
    250250                    zfji=zfji+ dhb*pz+ hhb*zij
    251 c __________________________________________________ No Hydrogen Bond
     251! __________________________________________________ No Hydrogen Bond
    252252                  else
    253253                    eyvw=eyvw+eyrp-eyds
     
    365365                  yfji=yfji+ dhb*py+ hhb*yij
    366366                  zfji=zfji+ dhb*pz+ hhb*zij
    367 c __________________________________________________ No Hydrogen Bond
     367! __________________________________________________ No Hydrogen Bond
    368368                else
    369369                  eyvw=eyvw+eyrp-eyds
     
    424424
    425425          gdeyvr(iv)= (ey*zb-ez*yb)*xfiv+(ez*xb-ex*zb)*yfiv+
    426      #                (ex*yb-ey*xb)*zfiv
    427      #               +ex*xfriv+ey*yfriv+ez*zfriv -fvr
     426     &                (ex*yb-ey*xb)*zfiv
     427     &               +ex*xfriv+ey*yfriv+ez*zfriv -fvr
    428428
    429429        elseif (it.eq.1) then         ! b.length
     
    441441      return
    442442      end
    443 c *****************************
     443! *****************************
    444444      subroutine gdtflx(nml,iv)
    445445
    446 c .....................................................................
    447 c PURPOSE: calculate partial derivative of internal energy for molecule
    448 c          'nml' vs. variable 'iv' NUMERICALLY and compare with
    449 c          its value obtained analytically
    450 c
    451 c CALLS:  setvar, enyflx
    452 c .....................................................................
     446! .....................................................................
     447! PURPOSE: calculate partial derivative of internal energy for molecule
     448!          'nml' vs. variable 'iv' NUMERICALLY and compare with
     449!          its value obtained analytically
     450!
     451! CALLS:  setvar, enyflx
     452! .....................................................................
    453453
    454454      include 'INCL.H'
     
    458458      dimension vlvrx(mxvr)
    459459
    460 c ____________________________ get & save values of variables
     460! ____________________________ get & save values of variables
    461461      do i=1,ivrml1(ntlml)+nvrml(ntlml)-1
    462462        it=ityvr(i)  ! type
     
    481481
    482482      write (*,'(1x,2a,2(e12.6,a))') nmvr(iv),': ',gda,' (',
    483      #       abs(gda-gdn),')'
    484 
    485 c _________________________ restore
     483     &       abs(gda-gdn),')'
     484
     485! _________________________ restore
    486486      vlvrx(iv)=ovr
    487487      call setvar(nml,vlvrx)
  • opereg.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: opereg,gdtgbl,gdtreg
    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: opereg,gdtgbl,gdtreg
     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      subroutine opereg(nml)
    1313
    14 c .......................................................................
    15 c PURPOSE: calculate regul. energy & it's partial derivatives
    16 c          for molecule 'nml' vs. variables 'iv'
    17 c
    18 c  NB: if the unit axis for an internal variable coincides with a
    19 c      global axis (i.e. for torsion or bond length variation round
    20 c      or along 'xrfax', respectively, and bd. angle var. round
    21 c      'zrfax'): VdW & 14 interaction partners of moving set atoms
    22 c      should be used for calculation, instead of the mov. sets,
    23 c      with opposite sign.
    24 c
    25 c      Example: By the the way the molecule-fixed system is set up,
    26 c               changes in Phi_1 affect atomic positions BEFORE the
    27 c               N-C^alpha bond relatively to the space-fixed system,
    28 c               not the moving set of Phi_1.
    29 c
    30 c CALLS:    gdtgbl, gdtreg
    31 c ......................................................................
     14! .......................................................................
     15! PURPOSE: calculate regul. energy & it's partial derivatives
     16!          for molecule 'nml' vs. variables 'iv'
     17!
     18!  NB: if the unit axis for an internal variable coincides with a
     19!      global axis (i.e. for torsion or bond length variation round
     20!      or along 'xrfax', respectively, and bd. angle var. round
     21!      'zrfax'): VdW & 14 interaction partners of moving set atoms
     22!      should be used for calculation, instead of the mov. sets,
     23!      with opposite sign.
     24!
     25!      Example: By the the way the molecule-fixed system is set up,
     26!               changes in Phi_1 affect atomic positions BEFORE the
     27!               N-C^alpha bond relatively to the space-fixed system,
     28!               not the moving set of Phi_1.
     29!
     30! CALLS:    gdtgbl, gdtreg
     31! ......................................................................
    3232
    3333      include 'INCL.H'
     
    3535
    3636      dimension xfat(mxat),yfat(mxat),zfat(mxat),
    37      #          xfrat(mxat),yfrat(mxat),zfrat(mxat),
    38 
    39      #          xfvr(mxvr),yfvr(mxvr),zfvr(mxvr),
    40      #          xfrvr(mxvr),yfrvr(mxvr),zfrvr(mxvr)
     37     &          xfrat(mxat),yfrat(mxat),zfrat(mxat),
     38
     39     &          xfvr(mxvr),yfvr(mxvr),zfvr(mxvr),
     40     &          xfrvr(mxvr),yfrvr(mxvr),zfrvr(mxvr)
    4141
    4242      logical   lnb
     
    4646      if (ntlvr.eq.0) then
    4747        write (*,'(a,i4)')
    48      #           ' opereg> No variables defined in molecule #',nml
     48     &           ' opereg> No variables defined in molecule #',nml
    4949        return
    5050      endif
     
    5555      ilavr=ifivr+ntlvr-1       ! last var. of 'nml'
    5656
    57 c --------------------------- initializations
     57! --------------------------- initializations
    5858      do i=ifivr,ilavr
    5959        gdeyrg(i)=0.d0
     
    107107          dz = 2.d0 * zji
    108108
    109 c =============================================== global pars.
     109! =============================================== global pars.
    110110
    111111          gdeygb(ii+1) = gdeygb(ii+1) - dx   ! d(E_ij) / d(x_i)
     
    113113          gdeygb(ii+3) = gdeygb(ii+3) - dz   ! d(E_ij) / d(z_i)
    114114
    115 c -------------------------- r = r_i - r_1
     115! -------------------------- r = r_i - r_1
    116116          x = xi - x1
    117117          y = yi - y1
     
    123123
    124124          gdeygb(ii+6) = gdeygb(ii+6) +dx*(zk*y-yk*z)+dy*(xk*z-zk*x)  !  d(E_ij) / d(g)
    125      #                                +dz*(yk*x-xk*y)
    126 
    127 c =============================================== for internal vars.
     125     &                                +dz*(yk*x-xk*y)
     126
     127! =============================================== for internal vars.
    128128
    129129          xfat(i) = dx
     
    164164        zb=zat(ib)
    165165
    166 c ---------------------------------------- axis for var.
     166! ---------------------------------------- axis for var.
    167167
    168168        if (it.eq.3) then      ! torsion
     
    279279
    280280          gdeyrg(iv)= (ey*zb-ez*yb)*xfiv+(ez*xb-ex*zb)*yfiv+
    281      #                (ex*yb-ey*xb)*zfiv
    282      #               +ex*xfriv+ey*yfriv+ez*zfriv
     281     &                (ex*yb-ey*xb)*zfiv
     282     &               +ex*xfriv+ey*yfriv+ez*zfriv
    283283
    284284        elseif (it.eq.1) then         ! b.length
     
    294294      return
    295295      end
    296 c **************************
     296! **************************
    297297      subroutine gdtgbl(nml)
    298 C
    299 C CALLS: bldmol,enyreg
    300 c
    301 c -------------------------- gradtest for 'gbpr'
     298!
     299! CALLS: bldmol,enyreg
     300!
     301! -------------------------- gradtest for 'gbpr'
    302302
    303303      include 'INCL.H'
     
    310310      do i = 1,6
    311311
    312 c ----------------------------- modify
     312! ----------------------------- modify
    313313        pro = gbpr(i,nml)
    314314        gbpr(i,nml) = pro+del
     
    318318
    319319        write (*,*) ' Gb. var #',(ii+i),': ',gdeygb(ii+i),gdn,
    320      #                                   abs(gdn-gdeygb(ii+i))
    321 c ----------------------------- restore
     320     &                                   abs(gdn-gdeygb(ii+i))
     321! ----------------------------- restore
    322322        gbpr(i,nml) = pro
    323323        call bldmol(nml)
     
    327327      return
    328328      end
    329 c *****************************
     329! *****************************
    330330      subroutine gdtreg(nml,iv)
    331331
    332 c .................................................................
    333 c PURPOSE: calculate partial derivative of reg. energy for molecule
    334 c          'nml' vs. variable 'iv' NUMERICALLY and compare with
    335 c          its value obtained analytically
    336 c
    337 c CALLS:  setvar, enyreg
    338 c .................................................................
     332! .................................................................
     333! PURPOSE: calculate partial derivative of reg. energy for molecule
     334!          'nml' vs. variable 'iv' NUMERICALLY and compare with
     335!          its value obtained analytically
     336!
     337! CALLS:  setvar, enyreg
     338! .................................................................
    339339
    340340      include 'INCL.H'
     
    344344      dimension vlvrx(mxvr)
    345345
    346 c ____________________________ get & save values of variables
     346! ____________________________ get & save values of variables
    347347      do i=1,ivrml1(ntlml)+nvrml(ntlml)-1
    348348        it=ityvr(i)  ! type
     
    366366
    367367      write (*,'(1x,2a,2(e12.6,a))') nmvr(iv),': ',gda,' (',
    368      #       abs(gda-gdn),')'
    369 
    370 c _________________________ restore vars
     368     &       abs(gda-gdn),')'
     369
     370! _________________________ restore vars
    371371      vlvrx(iv)=ovr
    372372      call setvar(nml,vlvrx)
  • opeshe.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: opeshe,gdtshe
    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: opeshe,gdtshe
     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      subroutine opeshe(nml)
    1313
    14 c ......................................................................
    15 c PURPOSE: Calculate internal energy for ECEPP/3 dataset and its partial
    16 c          derivatives vs. variables using recursive algorithm from:
    17 c          Noguti T, Go N, J Phys Soc (Japan) v52 3685-3690 1984; Abe H,
    18 c          Braun W, Noguti T, Go N, Comp Chem v8 239-247 1984; Mazur A K,
    19 c          Abagyan R A, J Biomol Struct Dyn v6 815-832, which I modified
    20 c          for atomic forces instead of simple derivatives (see Lavery R,
    21 c          Sklenar H, Zakrzewska K, Pullman B, J Biomol Struct Dyn v3
    22 c          989-1014 1986)
    23 c
    24 c CALLS:   gdtshe
    25 c ......................................................................
     14! ......................................................................
     15! PURPOSE: Calculate internal energy for ECEPP/3 dataset and its partial
     16!          derivatives vs. variables using recursive algorithm from:
     17!          Noguti T, Go N, J Phys Soc (Japan) v52 3685-3690 1984; Abe H,
     18!          Braun W, Noguti T, Go N, Comp Chem v8 239-247 1984; Mazur A K,
     19!          Abagyan R A, J Biomol Struct Dyn v6 815-832, which I modified
     20!          for atomic forces instead of simple derivatives (see Lavery R,
     21!          Sklenar H, Zakrzewska K, Pullman B, J Biomol Struct Dyn v3
     22!          989-1014 1986)
     23!
     24! CALLS:   gdtshe
     25! ......................................................................
    2626
    2727      include 'INCL.H'
    2828
    2929      dimension xfat(mxat),yfat(mxat),zfat(mxat),
    30      #          xfvr(mxvr),yfvr(mxvr),zfvr(mxvr),
    31      #          xfrvr(mxvr),yfrvr(mxvr),zfrvr(mxvr)
     30     &          xfvr(mxvr),yfvr(mxvr),zfvr(mxvr),
     31     &          xfrvr(mxvr),yfrvr(mxvr),zfrvr(mxvr)
    3232
    3333
     
    4141      if (ntlvr.eq.0) then
    4242        write (*,'(a,i4)')
    43      #           ' opeshe> No variables defined in molecule #',nml
     43     &           ' opeshe> No variables defined in molecule #',nml
    4444        return
    4545      endif
     
    116116        endif
    117117
    118 c ============================================ Energies & Atomic forces
     118! ============================================ Energies & Atomic forces
    119119
    120120        xfiv=0.d0
     
    303303
    304304          gdeyvr(iv)= (ey*zb-ez*yb)*xfiv+(ez*xb-ex*zb)*yfiv+
    305      #                (ex*yb-ey*xb)*zfiv
    306      #               +ex*xfriv+ey*yfriv+ez*zfriv -fvr
     305     &                (ex*yb-ey*xb)*zfiv
     306     &               +ex*xfriv+ey*yfriv+ez*zfriv -fvr
    307307
    308308        elseif (it.eq.1) then         ! b.length
     
    320320      return
    321321      end
    322 c *****************************
     322! *****************************
    323323      subroutine gdtshe(nml,iv)
    324324
    325 c .....................................................................
    326 c PURPOSE: calculate partial derivative of internal energy for molecule
    327 c          'nml' vs. variable 'iv' NUMERICALLY and compare with
    328 c          its value obtained analytically
    329 c
    330 c CALLS:  setvar, enyshe
    331 c .....................................................................
     325! .....................................................................
     326! PURPOSE: calculate partial derivative of internal energy for molecule
     327!          'nml' vs. variable 'iv' NUMERICALLY and compare with
     328!          its value obtained analytically
     329!
     330! CALLS:  setvar, enyshe
     331! .....................................................................
    332332
    333333      include 'INCL.H'
     
    337337      dimension vlvrx(mxvr)
    338338
    339 c ____________________________ get & save values of variables
     339! ____________________________ get & save values of variables
    340340      do i=1,ivrml1(ntlml)+nvrml(ntlml)-1
    341341        it=ityvr(i)  ! type
     
    360360
    361361      write (*,'(1x,2a,2(e12.6,a))') nmvr(iv),': ',gda,' (',
    362      #       abs(gda-gdn),')'
    363 
    364 c _________________________ restore
     362     &       abs(gda-gdn),')'
     363
     364! _________________________ restore
    365365      vlvrx(iv)=ovr
    366366      call setvar(nml,vlvrx)
  • opesol.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines:  opesol,gdtsol
    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:  opesol,gdtsol
     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      subroutine opesol(nml)
    1313
    14 c ......................................................................
    15 c PURPOSE:  derivatives of solvatation energy vs. internal variables for
    16 c           molecule 'nml'
    17 c
    18 c  NB: if the unit axis for an internal variable coincides with a
    19 c      global axis (i.e. for torsion or bond length variation round
    20 c      or along 'xrfax', respectively, and bd. angle var. round
    21 c      'zrfax'): VdW & 14 interaction partners of moving set atoms
    22 c      should be used for calculation, instead of the mov. sets,
    23 c      with opposite sign.
    24 c
    25 c      Example: By the the way the molecule-fixed system is set up,
    26 c               changes in Phi_1 affect atomic positions BEFORE the
    27 c               N-C^alpha bond relatively to the space-fixed system,
    28 c               not the moving set of Phi_1.
    29 c
    30 c CALLS:    esolan, gdtsol
    31 c ......................................................................
     14! ......................................................................
     15! PURPOSE:  derivatives of solvatation energy vs. internal variables for
     16!           molecule 'nml'
     17!
     18!  NB: if the unit axis for an internal variable coincides with a
     19!      global axis (i.e. for torsion or bond length variation round
     20!      or along 'xrfax', respectively, and bd. angle var. round
     21!      'zrfax'): VdW & 14 interaction partners of moving set atoms
     22!      should be used for calculation, instead of the mov. sets,
     23!      with opposite sign.
     24!
     25!      Example: By the the way the molecule-fixed system is set up,
     26!               changes in Phi_1 affect atomic positions BEFORE the
     27!               N-C^alpha bond relatively to the space-fixed system,
     28!               not the moving set of Phi_1.
     29!
     30! CALLS:    esolan, gdtsol
     31! ......................................................................
    3232
    3333      include 'INCL.H'
    3434
    3535      dimension xfat(mxat),yfat(mxat),zfat(mxat),
    36      #          xfrat(mxat),yfrat(mxat),zfrat(mxat),
    37 
    38      #          xfvr(mxvr),yfvr(mxvr),zfvr(mxvr),
    39      #          xfrvr(mxvr),yfrvr(mxvr),zfrvr(mxvr)
     36     &          xfrat(mxat),yfrat(mxat),zfrat(mxat),
     37
     38     &          xfvr(mxvr),yfvr(mxvr),zfvr(mxvr),
     39     &          xfrvr(mxvr),yfrvr(mxvr),zfrvr(mxvr)
    4040
    4141      logical   lnb
     
    4545      if (ntlvr.eq.0) then
    4646        write (*,'(a,i4)')
    47      #           ' opesol> No variables defined in molecule #',nml
     47     &           ' opesol> No variables defined in molecule #',nml
    4848        return
    4949      endif
     
    6666      eysl = esolan(nml)
    6767
    68 c -------------------------------------------------- f & g for atoms
     68! -------------------------------------------------- f & g for atoms
    6969
    7070      do i=iatrs1(irsml1(nml)),iatrs2(irsml2(nml))
     
    217217
    218218          gdeysl(iv)= (ey*zb-ez*yb)*xfiv+(ez*xb-ex*zb)*yfiv+
    219      #                 (ex*yb-ey*xb)*zfiv
    220      #                +ex*xfriv+ey*yfriv+ez*zfriv
     219     &                 (ex*yb-ey*xb)*zfiv
     220     &                +ex*xfriv+ey*yfriv+ez*zfriv
    221221
    222222        elseif (it.eq.1) then         ! b.length
     
    232232      return
    233233      end
    234 c *****************************
     234! *****************************
    235235      subroutine gdtsol(nml,iv)
    236236
    237 c .....................................................................
    238 c PURPOSE: calculate partial derivative of solvation energy for molecule
    239 c          'nml' vs. variable 'iv' NUMERICALLY and compare with
    240 c          its value obtained analytically
    241 c
    242 c CALLS:  setvar, esolan
    243 c .....................................................................
     237! .....................................................................
     238! PURPOSE: calculate partial derivative of solvation energy for molecule
     239!          'nml' vs. variable 'iv' NUMERICALLY and compare with
     240!          its value obtained analytically
     241!
     242! CALLS:  setvar, esolan
     243! .....................................................................
    244244
    245245      include 'INCL.H'
     
    250250
    251251
    252 c ____________________________ get & save values of variables
     252! ____________________________ get & save values of variables
    253253      do i=1,ivrml1(ntlml)+nvrml(ntlml)-1
    254254        it=ityvr(i)  ! type
     
    272272
    273273      write (*,'(1x,2a,2(e12.6,a))') nmvr(iv),': ',gda,' (',
    274      #       abs(gda-gdn),')'
    275 
    276 c _________________________ restore vars
     274     &       abs(gda-gdn),')'
     275
     276! _________________________ restore vars
    277277      vlvrx(iv)=ovr
    278278
  • outpdb.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: outpdb
    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: outpdb
     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      subroutine outpdb(nml,fileName)
    1313
    14 c ..............................................
    15 c  PURPOSE:  write coordinates of molecule 'nml'
    16 c            in PDB-format (with specialities for hydrogens)
    17 c
    18 c  INPUT:    nml - number of molecule
    19 c
    20 c            npdb - unit of output-file
    21 c
    22 c  CALLS:    toupst,iendst
    23 c ..............................................
     14! ..............................................
     15!  PURPOSE:  write coordinates of molecule 'nml'
     16!            in PDB-format (with specialities for hydrogens)
     17!
     18!  INPUT:    nml - number of molecule
     19!
     20!            npdb - unit of output-file
     21!
     22!  CALLS:    toupst,iendst
     23! ..............................................
    2424
    2525      include 'INCL.H'
     
    9090              j = iendst(atnm)
    9191              if (ichar(atnm(j:j)).ge.i0.and.
    92      #            ichar(atnm(j:j)).le.i9) then
     92     &            ichar(atnm(j:j)).le.i9) then
    9393                atnm(1:1)=atnm(j:j)
    9494                atnm(j:j)=' '
     
    102102            linout = ' '
    103103            write (linout,1) linty,iat,atnm,res(1:3),chid,irs,cdin,
    104      #                       xat(i),yat(i),zat(i),occ,bva
     104     &                       xat(i),yat(i),zat(i),occ,bva
    105105            write(iout,'(a80)') linout
    106106
     
    115115      enddo  ! molecules
    116116
    117 c ______________________________________ connectivity
    118 c                                        ( only bonds i-j with i<j)
     117! ______________________________________ connectivity
     118!                                        ( only bonds i-j with i<j)
    119119
    120120      do iml = im1,im2
  • outvar.f

    r2ebb8b6 rbd2278d  
    55! Copyright 2005       Frank Eisenmenger, U.H.E. Hansmann,
    66!                      Shura Hayryan, Chin-Ku
    7 c Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
    8 c                      Jan H. Meinke, Sandipan Mohanty
     7! Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
     8!                      Jan H. Meinke, Sandipan Mohanty
    99!
    1010! **************************************************************
     
    7070
    7171        if ( gbpr(1,iml).ne.zero
    72      #   .or.gbpr(2,iml).ne.zero
    73      #   .or.gbpr(3,iml).ne.zero
    74      #   .or.gbpr(4,iml).ne.zero
    75      #   .or.gbpr(5,iml).ne.zero
    76      #   .or.gbpr(6,iml).ne.zero ) then
     72     &   .or.gbpr(2,iml).ne.zero
     73     &   .or.gbpr(3,iml).ne.zero
     74     &   .or.gbpr(4,iml).ne.zero
     75     &   .or.gbpr(5,iml).ne.zero
     76     &   .or.gbpr(6,iml).ne.zero ) then
    7777
    7878          do i = 1,3
     
    8484
    8585          write(iout,'(1x,2a,1x,12a)')
    86      #    '@ ',mlfd,(strg(i)(ibegst(strg(i)):),',',i=1,5),
    87      #    strg(6)(ibegst(strg(6)):)
     86     &    '@ ',mlfd,(strg(i)(ibegst(strg(i)):),',',i=1,5),
     87     &    strg(6)(ibegst(strg(6)):)
    8888
    8989        endif
     
    9797
    9898            write(iout,'(3x,a,i3,1x,a,1x,a,1x,a,1x,f10.3)')
    99      #        mlfd,(nursvr(i)-is),':',nmvr(i),':',vlvr(i)*crd
     99     &        mlfd,(nursvr(i)-is),':',nmvr(i),':',vlvr(i)*crd
    100100          else
    101101
     
    105105
    106106              write(iout,'(3x,a,i3,1x,a,1x,a,1x,a,1x,f10.3,1x,a)')
    107      #          mlfd,(nursvr(i)-is),':',nmvr(i),':',vlvr(i)*crd
    108      #          ,' &'
     107     &          mlfd,(nursvr(i)-is),':',nmvr(i),':',vlvr(i)*crd
     108     &          ,' &'
    109109            endif
    110110
  • partem_p.f

    r2ebb8b6 rbd2278d  
    1 c**************************************************************
    2 c     
    3 c This file contains the subroutines: partem_p
    4 C USE WITH main_p, NOT WITH main!!!!!!
    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: partem_p
     4! USE WITH main_p, NOT WITH main!!!!!!
     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      subroutine  partem_p(num_rep, nequi, nswp, nmes, nsave, newsta,
    1414     &                     switch, rep_id, partem_comm)
    15 C     
    16 C     PURPOSE: SIMULATION OF PROTEINS BY PARALLEL TEMPERING ALGORITHM
    17 C     ON PARALLEL COMPUTERS USING MPI
    18 C     
    19 C     switch: Choses the starting configuration:
    20 C     -1 - stretched configuration
    21 C     0 - don't change anything
    22 C     1 - random start configuration
    23 C     
    24 c     CALLS:  addang,contacts,energy,hbond,helix,iendst,metropolis,
    25 c     outvar,(rand),rgyr
    26 C     
     15!     
     16!     PURPOSE: SIMULATION OF PROTEINS BY PARALLEL TEMPERING ALGORITHM
     17!     ON PARALLEL COMPUTERS USING MPI
     18!     
     19!     switch: Choses the starting configuration:
     20!     -1 - stretched configuration
     21!     0 - don't change anything
     22!     1 - random start configuration
     23!     
     24!     CALLS:  addang,contacts,energy,hbond,helix,iendst,metropolis,
     25!     outvar,(rand),rgyr
     26!     
    2727      include 'INCL.H'
    2828      include 'INCP.H'
     
    3131      logical newsta
    3232      integer switch, partem_comm, rep_id, nsave
    33 c     external rand
     33!     external rand
    3434      external can_weight
    3535
    36 C     nequi:  number of Monte Carlo sweeps for thermalization
    37 C     nswp:   number of Monte Carlo sweeps
    38 C     nmes:   number of Monte Carlo sweeps between measurments
    39 C     newsta: .true. for new simulations, .false. for re-start
     36!     nequi:  number of Monte Carlo sweeps for thermalization
     37!     nswp:   number of Monte Carlo sweeps
     38!     nmes:   number of Monte Carlo sweeps between measurments
     39!     newsta: .true. for new simulations, .false. for re-start
    4040
    4141      dimension  eavm(MAX_PROC),sph(MAX_PROC),intem(MAX_PROC),
     
    4747      double precision    e_min, e_minp(MAX_PROC), e_minpt(MAX_PROC)
    4848      integer   h_max, h_maxp(MAX_PROC)
    49 c     Order of replica exchange
     49!     Order of replica exchange
    5050      integer   odd
    5151!     Counter to keep random number generators in sync
    5252      integer randomCount
    5353     
    54 c     Collect partial energies. Only the root writes to disk. We have to
    55 c     collect the information from the different replicas and provide
    56 c     arrays to store them.
    57 c     eyslr    storage array for solvent energy
    58 c     eyelp     -      "        - coulomb energy
    59 c     eyvwp     -      "        - van-der-Waals energy
    60 c     eyhbp     -      "        - hydrogen bonding energy
    61 c     eysmi    -      "        - intermolecular interaction energy
    62 c     eyabp     -      "        - Abagyan correction term
     54!     Collect partial energies. Only the root writes to disk. We have to
     55!     collect the information from the different replicas and provide
     56!     arrays to store them.
     57!     eyslr    storage array for solvent energy
     58!     eyelp     -      "        - coulomb energy
     59!     eyvwp     -      "        - van-der-Waals energy
     60!     eyhbp     -      "        - hydrogen bonding energy
     61!     eysmi    -      "        - intermolecular interaction energy
     62!     eyabp     -      "        - Abagyan correction term
    6363      double precision eyslr(MAX_PROC)
    6464      double precision eyelp(MAX_PROC),eyvwp(MAX_PROC),eyhbp(MAX_PROC),
    6565     &     eyvrp(MAX_PROC),eysmip(MAX_PROC), eyabp(MAX_PROC)
    66 c     Collect information about accessible surface and van-der-Waals volume
    67 c     asap      storage array for solvent accessible surface
    68 c     vdvolp     storage array for van-der-Waals volume
     66!     Collect information about accessible surface and van-der-Waals volume
     67!     asap      storage array for solvent accessible surface
     68!     vdvolp     storage array for van-der-Waals volume
    6969      double precision asap(MAX_PROC), vdvolp(MAX_PROC)
    7070
     
    7373      integer imhbp(MAX_PROC)
    7474      character*80 filebase, fileNameMP, tbase0,tbase1
    75 c     frame     frame number for writing configurations
    76 c     trackID   configuration that should be tracked and written out
    77 c     dir          direction in random walk
    78 c     -1 - visited highest temperature last
    79 c     1 - visited lowest temperature last
    80 c     0 - haven't visited the boundaries yet.
    81 c     dirp      storage array for directions.
     75!     frame     frame number for writing configurations
     76!     trackID   configuration that should be tracked and written out
     77!     dir          direction in random walk
     78!     -1 - visited highest temperature last
     79!     1 - visited lowest temperature last
     80!     0 - haven't visited the boundaries yet.
     81!     dirp      storage array for directions.
    8282      integer frame, trackID, dir
    8383      integer dirp(MAX_PROC)
     
    9090     &            rep_id, num_rep, partem_comm, myrank
    9191      call flush(6)
    92 C     
    93 c     
    94 C     File with temperatures
     92!     
     93!     
     94!     File with temperatures
    9595      open(11,file='temperatures',status='old')
    96 C     File with reference conformation
     96!     File with reference conformation
    9797      tbase0='trj_00000'
    9898      open(18,file=fileNameMP(tbase0,5,9,rep_id),status='unknown')
    9999      if (rep_id.eq.0.and.myrank.eq.0) then
    100 c     File with time series of simulation
     100!     File with time series of simulation
    101101         open(14,file='ts.d',status='unknown')
    102 c     Track weights
    103 c      open(16, file='weights.dat', status='unknown')
     102!     Track weights
     103!      open(16, file='weights.dat', status='unknown')
    104104      endif
    105105     
    106 C     READ IN TEMPERATURES
     106!     READ IN TEMPERATURES
    107107      do i=1,num_rep
    108108         read(11,*) j,temp
     
    111111      close(11)
    112112
    113 c     nresi:  number of residues
     113!     nresi:  number of residues
    114114      nresi=irsml2(1)-irsml1(1)+1
    115 C     
    116 C     Initialize variables
     115!     
     116!     Initialize variables
    117117      do i=1,num_rep     
    118118         acx1(i) = 0.0d0
     
    132132      dir = dirp(rep_id + 1)
    133133
    134 c     _________________________________ Initialize Variables
     134!     _________________________________ Initialize Variables
    135135      if(newsta) then
    136136         iold=0
     
    139139            intem(i) = i
    140140         end do
    141 c     _________________________________ initialize starting configuration
     141!     _________________________________ initialize starting configuration
    142142         if (switch.ne.0) then
    143143            do i=1,nvr
     
    178178         CALL MPI_BCAST(INODE,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD,IERR)
    179179         CALL MPI_BCAST(YOL,num_rep,MPI_DOUBLE_PRECISION,0,
    180      #        MPI_COMM_WORLD,IERR)
     180     &        MPI_COMM_WORLD,IERR)
    181181         CALL MPI_BCAST(E_MINP, num_rep, MPI_DOUBLE_PRECISION, 0,
    182      #        MPI_COMM_WORLD, IERR)
     182     &        MPI_COMM_WORLD, IERR)
    183183         CALL MPI_BCAST(h_maxp,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD,
    184      $        IERR)
     184     &        IERR)
    185185      end if
    186186     
     
    194194         write(*,*) rep_id, yol(rep_id + 1), eol
    195195      endif
    196 C     Start of simulation
     196!     Start of simulation
    197197      write (*,*) '[',rep_id, myrank, beta, partem_comm,
    198198     &            '] Energy before equilibration:', eol
    199 c     =====================Equilibration by canonical Metropolis
     199!     =====================Equilibration by canonical Metropolis
    200200      do nsw=1,nequi
    201201         call metropolis(eol,acz,can_weight)
     
    204204      write (*,*) '[',rep_id,'] Energy after equilibration:', eol
    205205      call flush(6)
    206 C     
    207 C======================Multiple Markov Chains
     206!     
     207!======================Multiple Markov Chains
    208208      acz = 0
    209209      do nsw=1,nswp
    210 c------------First ordinary Metropolis
     210!------------First ordinary Metropolis
    211211         call metropolis(eol,acz,can_weight)
    212212         iold = iold + 1       
     
    223223            endif
    224224            acz0 = acz
    225 c     Evaluate RMSD
     225!     Evaluate RMSD
    226226            nml = 1
    227227            rmsv = rmsdfun(nml,irsml1(nml),irsml2(nml),ixatp,xatp,yatp, &
    228228     &             zatp,0)
    229 c            print *,myrank,'received RMSD,energy ',rmsv,eyab,beta
    230 C     Measure global radius of gyration
     229!            print *,myrank,'received RMSD,energy ',rmsv,eyab,beta
     230!     Measure global radius of gyration
    231231            call rgyr(0,rgy,ee) 
    232232            rgyp = rgy
    233 C     Measure Helicity and Sheetness
     233!     Measure Helicity and Sheetness
    234234            call helix(nhel,mhel,nbet,mbet)
    235 C     Measure Number of hydrogen bonds
     235!     Measure Number of hydrogen bonds
    236236            mhb = 0
    237237            do i = 1, ntlml
     
    240240            enddo
    241241            call interhbond(imhb)
    242 C     Measure total number of contacts (NCTOT) and number of
    243 C     native contacts (NCNAT)
     242!     Measure total number of contacts (NCTOT) and number of
     243!     native contacts (NCNAT)
    244244            call contacts(nctot,ncnat,dham)
    245 c     Add tracking of lowest energy configuration
     245!     Add tracking of lowest energy configuration
    246246            if (eol.lt.e_min) then
    247 c     Write out configuration
     247!     Write out configuration
    248248               i=rep_id+1
    249249               j=inode(i)
     
    262262               close(15)
    263263            endif
    264 c     Add tracking of configuration with larges hydrogen contents.
     264!     Add tracking of configuration with larges hydrogen contents.
    265265            if ((mhb + imhb).gt.h_max) then
    266 c     Write out configuration
     266!     Write out configuration
    267267               i = rep_id + 1
    268268               j = inode(i)
     
    282282            endif
    283283
    284 C     
    285 C--------------------Gather measurement data
     284!     
     285!--------------------Gather measurement data
    286286! I only use the master node of each replica for data collection. The
    287287! variable partem_comm provides the appropriate communicator.
    288288            if (partem_comm.ne.MPI_COMM_NULL) then
    289289               CALL MPI_GATHER(rmsv,1,MPI_DOUBLE_PRECISION,rmsdp,1,
    290      #              MPI_DOUBLE_PRECISION, 0,partem_comm,IERR)
     290     &              MPI_DOUBLE_PRECISION, 0,partem_comm,IERR)
    291291               CALL MPI_GATHER(eyab,1,MPI_DOUBLE_PRECISION,eyabp,1,
    292      #              MPI_DOUBLE_PRECISION, 0,partem_comm,IERR)
     292     &              MPI_DOUBLE_PRECISION, 0,partem_comm,IERR)
    293293               CALL MPI_GATHER(RGYP,1,MPI_DOUBLE_PRECISION,RGYRP,1,
    294      #              MPI_DOUBLE_PRECISION, 0,partem_comm,IERR)
     294     &              MPI_DOUBLE_PRECISION, 0,partem_comm,IERR)
    295295               CALL MPI_GATHER(NHEL,1,MPI_INTEGER,NHELP,1,MPI_INTEGER,
    296296     &              0,partem_comm,IERR)
     
    335335!     &                0,MPI_COMM_WORLD, IERR)               
    336336
    337 c     Write trajectory
     337!     Write trajectory
    338338               write (18,*) '@@@',iold,inode(rep_id+1)
    339339               call outvbs(0,18)
    340340               write (18,*) '###'
    341341!                call flush(18)
    342 c     Write current configuration
     342!     Write current configuration
    343343               if ((mod(iold, nsave).eq.0)) then
    344344                  filebase = "conf_0000.var"
     
    349349            if(rep_id.eq.0.and.myrank.eq.0) then
    350350               randomCount = 0
    351 c  Update acceptance, temperature wise average of E and E^2 used to calculate
    352 c  specific heat.
     351!  Update acceptance, temperature wise average of E and E^2 used to calculate
     352!  specific heat.
    353353               do i=1,num_rep
    354354                  j=intem(i)
    355355                  acy(i)=0.0
    356 c  Above: contents of acy1 are added to acy(i) a few lines down.
    357 c  acy1(intem(i)) contains information received from the node at temperature
    358 c  i, on how many updates have been accepted in node intem(i). Since acz
    359 c  is not reset to 0 every cycle, acy(i) must be set to 0 here. Else, there
    360 c  will be serious double counting and the values of acceptance printed
    361 c  will be simply wrong.
     356!  Above: contents of acy1 are added to acy(i) a few lines down.
     357!  acy1(intem(i)) contains information received from the node at temperature
     358!  i, on how many updates have been accepted in node intem(i). Since acz
     359!  is not reset to 0 every cycle, acy(i) must be set to 0 here. Else, there
     360!  will be serious double counting and the values of acceptance printed
     361!  will be simply wrong.
    362362                  e_minpt(i)=e_minp(intem(i))
    363363               end do
     
    371371
    372372
    373 C     Write measurements to the time series file ts.d
     373!     Write measurements to the time series file ts.d
    374374               do i=1,num_rep
    375375                  j=intem(i)
     
    382382!                      call flush(14)
    383383               end do
    384 c     Write the current parallel tempering information into par_R.in
     384!     Write the current parallel tempering information into par_R.in
    385385!               timeLeft = llwrem(2) ! Time left till hard limit
    386386!               if ((mod(iold, nsave).eq.0).or.(timeLeft.lt.minTimeLeft)
     
    393393     &                    h_maxp(i)
    394394                  end do
    395 C     -------------------------- Various statistics of current run
    396 c               swp=nswp-nequi
     395!     -------------------------- Various statistics of current run
     396!               swp=nswp-nequi
    397397                  swp=nsw
    398398                  write(13,*) 'Acceptance rate for change of chains:'
     
    400400                     temp=1.0d0/pbe(k1)/0.00198773
    401401                     write(13,*) temp, acx1(k1)*2.0d0*nmes/swp
    402 c  Above: it's the acceptance rate of exchange of replicas. Since a
    403 c  replica exchange is attempted only once every nmes sweeps, the
    404 c  rate should be normalized with (nmes/swp).
     402!  Above: it's the acceptance rate of exchange of replicas. Since a
     403!  replica exchange is attempted only once every nmes sweeps, the
     404!  rate should be normalized with (nmes/swp).
    405405                  end do
    406406                  write(13,*)
     
    411411                     geavm(k1) = nmes*eavm(k1)/swp
    412412                     gsph(k1)  = (nmes*sph(k1)/swp-geavm(k1)**2)
    413      #                    *beta*beta/nresi
     413     &                    *beta*beta/nresi
    414414                     write(13,'(a,2f9.2,i4,f12.3)')
    415415     &                    'Temperature, Node,local acceptance rate:',
    416416     &                    beta,temp,k,acy(k1)/dble(nsw*nvr)
    417 c  Above: Changed (nswp-nequi) in the denominator of acceptance as
    418 c  acceptance values are initialized to 0 after equilibration cycles are
    419 c  finished. Note also that since this is being written in the middle of
    420 c  the simulation, it is normalized to nsw instead of nswp.
     417!  Above: Changed (nswp-nequi) in the denominator of acceptance as
     418!  acceptance values are initialized to 0 after equilibration cycles are
     419!  finished. Note also that since this is being written in the middle of
     420!  the simulation, it is normalized to nsw instead of nswp.
    421421                     write(13,'(a,3f12.2)')
    422422     &                    'Last Energy, Average Energy, Spec. Heat:',
     
    431431               end if
    432432
    433 C--------------------Parallel Tempering  update
    434 c     Swap with right neighbor (odd, even)           
     433!--------------------Parallel Tempering  update
     434!     Swap with right neighbor (odd, even)           
    435435               if(odd.eq.1) then
    436436                  nu=1
    437437                  no1 = num_rep-1
    438 c     Swap with left neighbor (even, odd)
     438!     Swap with left neighbor (even, odd)
    439439               else
    440440                  nu = 2
     
    443443               do i=nu,no1,2
    444444                  j=i+1
    445 c     Periodic bc for swaps
     445!     Periodic bc for swaps
    446446                  if(i.eq.num_rep) j=1
    447447                  in=intem(i)
     
    449449                  wij=exp(-pbe(i)*yol(jn)-pbe(j)*yol(in)
    450450     &                 +pbe(i)*yol(in)+pbe(j)*yol(jn))
    451 c The random number generator is getting out of sync here, because
    452 c        the swap is only done on node 0!
     451! The random number generator is getting out of sync here, because
     452!        the swap is only done on node 0!
    453453! Keep track of number of random numbers used.
    454454                  rd=grnd()
    455455                  randomCount = randomCount + 1
    456 c                  write (16,*) '>', iold, i,j
    457 c     &            ,pbe(i),yol(in), pbe(j), yol(jn), wij, rd
     456!                  write (16,*) '>', iold, i,j
     457!     &            ,pbe(i),yol(in), pbe(j), yol(jn), wij, rd
    458458                  if(wij.ge.rd) then
    459 c Next line: Replica exchange only happens after equilibration,
    460 c which takes place outside this loop over nsw. So, I think nsw.gt.nequi
    461 c is irrelevant for the calculation of acceptance of replica exchanges.
    462 c /Sandipan
    463 c                     if(nsw.gt.nequi)
     459! Next line: Replica exchange only happens after equilibration,
     460! which takes place outside this loop over nsw. So, I think nsw.gt.nequi
     461! is irrelevant for the calculation of acceptance of replica exchanges.
     462! /Sandipan
     463!                     if(nsw.gt.nequi)
    464464                     acx1(i) = acx1(i)+1
    465465                     intem(i) = jn
     
    469469                  end if
    470470               end do
    471 c     ---------------- End Loop over nodes which creates a new temperature
    472 c     map for all nodes, at the node with rank 0.
    473 c     
     471!     ---------------- End Loop over nodes which creates a new temperature
     472!     map for all nodes, at the node with rank 0.
     473!     
    474474               odd = 1 - odd
    475475            end if
    476 c     End of "if (myrank.eq.0) ...". The block above includes PT update and
    477 c     writing of observables into the time series file etc.
     476!     End of "if (myrank.eq.0) ...". The block above includes PT update and
     477!     writing of observables into the time series file etc.
    478478           
    479 c     Below: Communicate new temperature-node map to all nodes
     479!     Below: Communicate new temperature-node map to all nodes
    480480            CALL MPI_BCAST(INTEM,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD,
    481481     &           IERR)
     
    486486            CALL MPI_BCAST(H_MAXP,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD,
    487487     &           IERR)
    488 c Synchronize random number generators for replica 0
     488! Synchronize random number generators for replica 0
    489489            if (rep_id.eq.0) then
    490490               CALL MPI_BCAST(randomCount,1,MPI_INTEGER,0,my_mpi_comm,
     
    507507
    508508         endif
    509 c        End of "if (mod(iold,nmes).eq.0) ..."
     509!        End of "if (mod(iold,nmes).eq.0) ..."
    510510      end do
    511 c-----------End Loop over sweeps
    512 c     
    513 C     OUTPUT:
    514 C--------------------For Re-starts:
     511!-----------End Loop over sweeps
     512!     
     513!     OUTPUT:
     514!--------------------For Re-starts:
    515515      nu = rep_id + 1
    516516      filebase = "conf_0000.var"
     
    524524      if (partem_comm.ne.MPI_COMM_NULL) then
    525525         CALL MPI_GATHER(EOL0,1,MPI_DOUBLE_PRECISION,YOL,1,
    526      #        MPI_DOUBLE_PRECISION,0,partem_comm,IERR)
     526     &        MPI_DOUBLE_PRECISION,0,partem_comm,IERR)
    527527         CALL MPI_GATHER(acz0,1,MPI_DOUBLE_PRECISION,acy1,1,
    528      #     MPI_DOUBLE_PRECISION,0,partem_comm,IERR)
     528     &     MPI_DOUBLE_PRECISION,0,partem_comm,IERR)
    529529      endif
    530530     
     
    536536            write(13,*) i,inode(i),intem(i),yol(i),e_minp(i),h_maxp(i)
    537537         end do
    538 C     -------------------------- Various statistics of current run
     538!     -------------------------- Various statistics of current run
    539539         swp=nswp
    540540         write(13,*) 'Acceptance rate for change of chains:'
     
    559559         end do
    560560         close(13)
    561 c         close(16)
     561!         close(16)
    562562      end if
    563563      close(18)
    564564
    565 c     =====================
     565!     =====================
    566566      CALL MPI_BARRIER(MPI_COMM_WORLD,IERR)
    567567
  • partem_s.f

    r2ebb8b6 rbd2278d  
    55! Copyright 2003-2005  Frank Eisenmenger, U.H.E. Hansmann,
    66!                      Shura Hayryan, Chin-Ku
    7 c Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
    8 c                      Jan H. Meinke, Sandipan Mohanty
     7! Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
     8!                      Jan H. Meinke, Sandipan Mohanty
    99!
    1010!
  • pdbread.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: pdbread,pdbvars,atixpdb,getpar
    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: pdbread,pdbvars,atixpdb,getpar
     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      subroutine pdbread(pdbfil,ier)
    1313
    14 c ....................................................
    15 c PURPOSE: read protein atom coordinates from 'pdbfil'
    16 c          (no Hydrogens, only ATOM records)
    17 c
    18 c RETURNS: 0 = no errors / 1 = error
    19 c
    20 c CALLS: iopfil,iendst
    21 c ......................................................
     14! ....................................................
     15! PURPOSE: read protein atom coordinates from 'pdbfil'
     16!          (no Hydrogens, only ATOM records)
     17!
     18! RETURNS: 0 = no errors / 1 = error
     19!
     20! CALLS: iopfil,iendst
     21! ......................................................
    2222
    2323      implicit real*8 (a-h,o-z)
     
    2626      include 'INCP.H'
    2727
    28 c -------------------------- input
     28! -------------------------- input
    2929      character*(*) pdbfil
    30 c -------------------------- local
     30! -------------------------- local
    3131      dimension cor(3)
    3232      character atm*4,rsn*3,rsno*3,chn,chno,
    33      #          rsid*5,rsido*5,line*132
     33     &          rsid*5,rsido*5,line*132
    3434
    3535      natp=0
     
    4848      else
    4949        write (*,'(a)')
    50      #    ' pdbread> empty file name to read pdb-structure'
     50     &    ' pdbread> empty file name to read pdb-structure'
    5151
    5252        return
     
    5757      if (io.le.0) then
    5858        write (*,'(a,/,a)')
    59      #  ' pdbread> ERROR opening file to read pdb-structure: ',
    60      #  pdbfil(1:iendst(pdbfil))
     59     &  ' pdbread> ERROR opening file to read pdb-structure: ',
     60     &  pdbfil(1:iendst(pdbfil))
    6161
    6262        return
     
    7070      if ( line(17:17).ne.' ' )  then
    7171        write (*,'(a,/,a,/,a,/,2a)')
    72      #  ' pdbread> found alternate atom location: ',
    73      #  '                !',
    74      #  line(:l),' in file: ',pdbfil(1:iendst(pdbfil))
     72     &  ' pdbread> found alternate atom location: ',
     73     &  '                !',
     74     &  line(:l),' in file: ',pdbfil(1:iendst(pdbfil))
    7575
    7676        close(lunpdb)
     
    8686      if ((natp+1).gt.MXATP) then
    8787        write (*,'(a,i5,a,/,a)')
    88      #  ' pdbread>  >MXATP (',MXATP,') ATOM lines in PDB file ',
    89      #  pdbfil(1:iendst(pdbfil))
     88     &  ' pdbread>  >MXATP (',MXATP,') ATOM lines in PDB file ',
     89     &  pdbfil(1:iendst(pdbfil))
    9090
    9191        close(lunpdb)
     
    9797        if ((nchp+1).gt.MXCHP) then
    9898          write (*,'(a,i3,a,/,a)')
    99      #    ' pdbread>  >MXCHP (',MXCHP,') chains in PDB file ',
    100      #    pdbfil(1:iendst(pdbfil))
     99     &    ' pdbread>  >MXCHP (',MXCHP,') chains in PDB file ',
     100     &    pdbfil(1:iendst(pdbfil))
    101101
    102102          close(lunpdb)
     
    106106        if ((nrsp+1).gt.MXRSP) then
    107107          write (*,'(a,i3,a,/,a)')
    108      #    ' pdbread>  >MXRSP (',MXRSP,') residues in PDB file ',
    109      #    pdbfil(1:iendst(pdbfil))
     108     &    ' pdbread>  >MXRSP (',MXRSP,') residues in PDB file ',
     109     &    pdbfil(1:iendst(pdbfil))
    110110
    111111          close(lunpdb)
     
    141141        if ((nrsp+1).gt.MXRSP) then
    142142          write (*,'(a,i3,a,/,a)')
    143      #    ' pdbread>  >MXRSP (',MXRSP,') residues in PDB file ',
    144      #    pdbfil(1:iendst(pdbfil))
     143     &    ' pdbread>  >MXRSP (',MXRSP,') residues in PDB file ',
     144     &    pdbfil(1:iendst(pdbfil))
    145145
    146146          close(lunpdb)
     
    172172
    173173    2 write (*,'(a,/,a,/,2a)')
    174      #  ' pdbread> ERROR reading ATOM line ',
    175      #  line(:l),
    176      #  ' from file ',pdbfil(1:iendst(pdbfil))
     174     &  ' pdbread> ERROR reading ATOM line ',
     175     &  line(:l),
     176     &  ' from file ',pdbfil(1:iendst(pdbfil))
    177177
    178178      close(lunpdb)
     
    195195
    196196        write (*,'(a,/,a)')
    197      #  ' pdbread> NO atom coordinates selected from file ',
    198      #  pdbfil(1:iendst(pdbfil))
     197     &  ' pdbread> NO atom coordinates selected from file ',
     198     &  pdbfil(1:iendst(pdbfil))
    199199
    200200      endif
     
    205205
    206206      end
    207 c **************************************************************
     207! **************************************************************
    208208
    209209      subroutine pdbvars()
    210210
    211 c --------------------------------------------------------------------
    212 c PURPOSE: sequence,indices for selected atoms (data in INCP.H)
    213 c          & torsions from PDB to be used to build SMMP structure
    214 c
    215 c          ixatp(i,)
    216 c          = indices for SMMP atoms pointing to PDB atoms
    217 c            (=0, if atom not selected)
    218 c
    219 c --------------------------------- ref. point & axes
    220 c         ixrfpt(3,),rfpt(3,),xrfax(3,),yrfax(3,),zrfax(3,)
    221 c
    222 c CALLS:  tolost,getmol,bldmol,addend,atixpdb,setmvs,mklist,
    223 c         dihedr,fnd3ba,setsys,getpar,setvar,rmsdopt
    224 c --------------------------------------------------------------------
     211! --------------------------------------------------------------------
     212! PURPOSE: sequence,indices for selected atoms (data in INCP.H)
     213!          & torsions from PDB to be used to build SMMP structure
     214!
     215!          ixatp(i,)
     216!          = indices for SMMP atoms pointing to PDB atoms
     217!            (=0, if atom not selected)
     218!
     219! --------------------------------- ref. point & axes
     220!         ixrfpt(3,),rfpt(3,),xrfax(3,),yrfax(3,),zrfax(3,)
     221!
     222! CALLS:  tolost,getmol,bldmol,addend,atixpdb,setmvs,mklist,
     223!         dihedr,fnd3ba,setsys,getpar,setvar,rmsdopt
     224! --------------------------------------------------------------------
    225225
    226226      include 'INCL.H'
     
    236236      do nc=1,nchp  ! PDB chains
    237237
    238 c =============================== SMMP molecule
     238! =============================== SMMP molecule
    239239        nml=nml+1
    240240        if (nml.gt.mxml) then
    241241          write(*,'(a,i4,2a)')' pdbvars> NUMBER of chains > '
    242      #                          ,mxml,' in ',' ?'
     242     &                          ,mxml,' in ',' ?'
    243243          stop
    244244        endif
    245245        ntlml=nml
    246 c ----------------------------- 'nmml' = ChainID
     246! ----------------------------- 'nmml' = ChainID
    247247        nmml(nml)=chnp(nc)
    248248
    249 c ======================================== get sequence
     249! ======================================== get sequence
    250250
    251251        irb=nrs+1
    252252        ire=nrs+nchrsp(nc)
    253 c ----------------------------- # of 1st & last residue
     253! ----------------------------- # of 1st & last residue
    254254        irsml1(nml)=irb
    255255        irsml2(nml)=ire
     
    261261          if (nrs.gt.mxrs) then
    262262            write(*,'(a,i4,2a)') ' pdbvars> NUMBER of residues > '
    263      #                       ,mxrs,' in ',' ?'
     263     &                       ,mxrs,' in ',' ?'
    264264            stop
    265265          endif
     
    271271
    272272          if (.not.flex.and.irs.eq.irb.and.seq(nrs)(1:3).eq.'pro')
    273      #      seq(nrs)='pron'  ! only ECEPP/3
     273     &      seq(nrs)='pron'  ! only ECEPP/3
    274274
    275275        enddo ! residues
    276276
    277 c ======================== get initial coords. for molecule 'nml'
    278 c                          with library values for deg. of freedom
     277! ======================== get initial coords. for molecule 'nml'
     278!                          with library values for deg. of freedom
    279279
    280280        call getmol(nml)   ! assemble res. data from libraries
     
    289289        call atixpdb(nml)  ! get 'ixatp'
    290290
    291 c -------------------------- 'load' SMMP variable information
     291! -------------------------- 'load' SMMP variable information
    292292        call setmvs(nml)   ! moving sets
    293293        call mklist(nml)   ! interaction lists
    294294
    295 c ================================= get variables for 'nml'
     295! ================================= get variables for 'nml'
    296296
    297297        ii=ivrml1(nml)
     
    356356        nvr = ivrml1(ntlml)+nvrml(ntlml)-1
    357357
    358 c ================================= global parameters for 'nml'
    359 
    360 c +++++++++++
     358! ================================= global parameters for 'nml'
     359
     360! +++++++++++
    361361       inew=0
    362362
    363363       if (inew.eq.1) then
    364 c ++++++++++++++++++++++++
     364! ++++++++++++++++++++++++
    365365
    366366        call setvar(nml,vlvr)
     
    369369        call rmsdopt(nml,1,nrs,ixatp,xatp,yatp,zatp,0,rm,av1,av2,rmsd)
    370370
    371 c ---------------------------- retrieve ref. coords.
    372 c                     & transform acc. to opt. rmsd
     371! ---------------------------- retrieve ref. coords.
     372!                     & transform acc. to opt. rmsd
    373373        do i=1,3
    374374          ii=ixrfpt(i,nml)
     
    396396        call bldmol(nml)  ! finally build SMMP molecule
    397397
    398 c ++++++++++++++++
     398! ++++++++++++++++
    399399       else  ! old
    400 c ++++++++++++++++
     400! ++++++++++++++++
    401401
    402402        call fnd3ba(nml,i1,i2,i3)  ! three 1st bb atoms in SMMP (e.g. n,ca,c')
     
    406406        ixrfpt(3,nml)=i3
    407407
    408 c -------------------------------- retrieve ref. coords.
     408! -------------------------------- retrieve ref. coords.
    409409        do i=1,3
    410410          ii=ixrfpt(i,nml)
     
    416416          else
    417417            write(*,'(3a)') ' pdbvars> missing PDB atom ',nmat(ii),
    418      #       ' is ref. point for SMMP - cannot proceed !'
     418     &       ' is ref. point for SMMP - cannot proceed !'
    419419          endif
    420420        enddo
     
    426426        call rmsdopt(nml,1,nrs,ixatp,xatp,yatp,zatp,0,rm,av1,av2,rmsd)
    427427
    428 c ++++++++++
     428! ++++++++++
    429429       endif
    430 c ++++++++++
     430! ++++++++++
    431431
    432432       write(*,*) ' '
     
    437437      return
    438438      end
    439 c ***************************
     439! ***************************
    440440      subroutine atixpdb(nml)
    441441
    442 c --------------------------------------------------------------------
    443 c PURPOSE: get ixatp - pointer of each SMMP atom to corresponding atom
    444 c                      of reference structure loaded in 'INCP.H'
    445 c                      (=0 if no corr. atom in ref. str.)
    446 c
    447 c CALLS:   toupst
    448 c --------------------------------------------------------------------
     442! --------------------------------------------------------------------
     443! PURPOSE: get ixatp - pointer of each SMMP atom to corresponding atom
     444!                      of reference structure loaded in 'INCP.H'
     445!                      (=0 if no corr. atom in ref. str.)
     446!
     447! CALLS:   toupst
     448! --------------------------------------------------------------------
    449449
    450450      include 'INCL.H'
     
    477477            enddo
    478478               
    479 c            write(*,'(8a)') ' pdbvars> ',atm,' not found in '
    480 c     #       ,chnp(nc),' ',rsidp(irs),' ',rsnmp(irs)
     479!            write(*,'(8a)') ' pdbvars> ',atm,' not found in '
     480!     #       ,chnp(nc),' ',rsidp(irs),' ',rsnmp(irs)
    481481
    482482          endif
     
    489489      return
    490490      end
    491 c **************************
     491! **************************
    492492      subroutine getpar(nml)
    493493
     
    496496      parameter (TOL = 1.d-12)
    497497
    498 c Obtain molecule-fixed system (J,K,L) for 1st 3 bb-atoms,
    499 c -> determine global parameters: shifts dX,dY,dZ
    500 c & angles alpha,beta,gamma [rad], put into 'gbpr'
    501 c
    502 c CALLS: none
    503 c
     498! Obtain molecule-fixed system (J,K,L) for 1st 3 bb-atoms,
     499! -> determine global parameters: shifts dX,dY,dZ
     500! & angles alpha,beta,gamma [rad], put into 'gbpr'
     501!
     502! CALLS: none
     503!
    504504
    505505      i1=ixrfpt(1,nml)  ! from 'INCL.H'
    506506      i2=ixrfpt(2,nml)
    507507      i3=ixrfpt(3,nml)
    508 c -------------------------------------- Shifts
     508! -------------------------------------- Shifts
    509509      gbpr(1,nml) = xat(i1)
    510510      gbpr(2,nml) = yat(i1)
     
    514514        gbpr(i,nml) = 0.d0
    515515      enddo
    516 c --------------------------------- J
     516! --------------------------------- J
    517517      h1=xat(i2)
    518518      h2=yat(i2)
     
    528528      x2=x2/d
    529529      x3=x3/d
    530 c --------------------------------- L
     530! --------------------------------- L
    531531      h1=xat(i3)-h1
    532532      h2=yat(i3)-h2
     
    543543      z3=z3/d
    544544
    545 c ---------------------------------- K
     545! ---------------------------------- K
    546546      y1=z2*x3-z3*x2
    547547      y2=z3*x1-z1*x3
     
    550550      if ( ( 1.d0 - abs(y3) ) .gt. TOL )  then       ! ============ |beta| < PI/2
    551551
    552 c ----------------------------------------------- Y'
     552! ----------------------------------------------- Y'
    553553        d = sqrt( y1 * y1 + y2 * y2 )
    554554        yp1= y1 / d
  • redseq.f

    r2ebb8b6 rbd2278d  
    1 c**************************************************************
    2 c
    3 c This file contains the subroutines: redseq
    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: redseq
     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 redseq
    1414
    15 c ............................................................
    16 c PURPOSE: read 'lunseq' 'seqfil', extract names of molecules,
    17 c          sequences
    18 c
    19 c Molecules are separated by lines containing char. '#',
    20 c           a name for the molecule may follow '#' on this line
    21 c Residue   names can be of 1-4 characters to be separated by ' '
    22 c
    23 c Returns: ntlml,nmml,irsml1,irsml2,seq
    24 c
    25 c CALLS:   ibegst,iendst,iopfil,tolost
    26 c ............................................................
     15! ............................................................
     16! PURPOSE: read 'lunseq' 'seqfil', extract names of molecules,
     17!          sequences
     18!
     19! Molecules are separated by lines containing char. '#',
     20!           a name for the molecule may follow '#' on this line
     21! Residue   names can be of 1-4 characters to be separated by ' '
     22!
     23! Returns: ntlml,nmml,irsml1,irsml2,seq
     24!
     25! CALLS:   ibegst,iendst,iopfil,tolost
     26! ............................................................
    2727
    2828      include 'INCL.H'
     
    3333      if (iopfil(lunseq,seqfil,'old','formatted').le.izero) then
    3434        write (*,'(a,/,a,i3,2a)')
    35      #    ' redseq> ERROR opening sequence file:',
    36      #      ' LUN=',lunseq,' FILE=',seqfil(1:iendst(seqfil))
     35     &    ' redseq> ERROR opening sequence file:',
     36     &      ' LUN=',lunseq,' FILE=',seqfil(1:iendst(seqfil))
    3737        stop
    3838      endif
    3939
    40 c      ntlml=0
     40!      ntlml=0
    4141      if (ntlml.gt.0) then
    4242        nrs = irsml2(ntlml)
     
    5656        if (ic.gt.0) then  ! found '#'
    5757
    58 c ____________________________________ new molecule
     58! ____________________________________ new molecule
    5959
    6060          if (ntlml.gt.0) then   ! check previous molecule
     
    6464            if ((nrs-irsml1(ntlml)+1).eq.0) then
    6565              write(*,'(2a)') ' redseq> IGNORE molecule: ',
    66      #                        nmml(ntlml)(1:iendst(nmml(ntlml)))
     66     &                        nmml(ntlml)(1:iendst(nmml(ntlml)))
    6767              ntlml=ntlml-1
    6868            endif
     
    7171          if (ntlml.gt.mxml) then
    7272            write(*,'(a,i4,2a)')' redseq> NUMBER of molecules > '
    73      #                          ,mxml,' in ',seqfil(1:iendst(seqfil))
     73     &                          ,mxml,' in ',seqfil(1:iendst(seqfil))
    7474            close(lunseq)
    7575            stop
     
    8080
    8181          if (ic.le.lg) then
    82 c ___________________________________ extract name of molecule
     82! ___________________________________ extract name of molecule
    8383
    8484            hlin=blnk
     
    9999        else  ! no '#'
    100100
    101 c _________________________________________ sequence
     101! _________________________________________ sequence
    102102
    103103          ib=ibegst(line)
     
    110110
    111111          ie=iendst(line)
    112 c ___________________________________ extract names of residues
     112! ___________________________________ extract names of residues
    113113    2     id=index(line(ib:ie),blnk)-1   ! find next separator
    114114          if (id.gt.0) then
     
    121121          if (id.gt.4) then
    122122            write (*,'(4a)') ' redseq> INVALID residue NAME >',
    123      #                       line(ib:ii),'< in ',
    124      #      seqfil(1:iendst(seqfil))
     123     &                       line(ib:ii),'< in ',
     124     &      seqfil(1:iendst(seqfil))
    125125            close(lunseq)
    126126            stop
     
    130130            if (nrs.gt.mxrs) then
    131131              write(*,'(a,i4,2a)') ' redseq> NUMBER of residues > '
    132      #                       ,mxrs,' in ',seqfil(1:iendst(seqfil))
     132     &                       ,mxrs,' in ',seqfil(1:iendst(seqfil))
    133133              close(lunseq)
    134134              stop
     
    155155
    156156    3 close(lunseq)
    157 c ___________________________________ output
     157! ___________________________________ output
    158158
    159159      if (nrs.eq.0) then
    160160        write (*,'(2a)') ' redseq> no residues found in ',
    161      #                   seqfil(1:iendst(seqfil))
     161     &                   seqfil(1:iendst(seqfil))
    162162        stop
    163163      else
     
    176176            if ((nrs-ifirs+1).eq.0) then
    177177              write(*,'(2a)') ' redseq> IGNORE molecule '
    178      #                        ,nmml(ntlml)(1:iendst(nmml(ntlml)))
     178     &                        ,nmml(ntlml)(1:iendst(nmml(ntlml)))
    179179              ntlml=ntlml-1
    180180              if (ntlml.eq.0) then
    181181                write (*,'(2a)') ' redseq> no residues found in ',
    182      #          seqfil(1:iendst(seqfil))
     182     &          seqfil(1:iendst(seqfil))
    183183                stop
    184184              endif
     
    188188          endif
    189189
    190 cc          write (*,'(/,a,i4,2a)') ' redseq> ',irsml2(i)-irsml1(i)+1,
    191 cc     #           ' residue(s) in molecule: ',
    192 cc     #           nmml(i)(1:iendst(nmml(i)))
    193 cc          write (*,'(15(1x,a))') (seq(j),j=irsml1(i),irsml2(i))
     190!          write (*,'(/,a,i4,2a)') ' redseq> ',irsml2(i)-irsml1(i)+1,
     191!     &           ' residue(s) in molecule: ',
     192!     &           nmml(i)(1:iendst(nmml(i)))
     193!          write (*,'(15(1x,a))') (seq(j),j=irsml1(i),irsml2(i))
    194194
    195195        enddo
     
    197197      endif
    198198      return
    199 c _______________________________________________ error
     199! _______________________________________________ error
    200200
    201201    4 write (*,'(a,i4,2a)') ' redseq> ERROR reading line No. ',nln,
    202      #' in ',seqfil(1:iendst(seqfil))
     202     & ' in ',seqfil(1:iendst(seqfil))
    203203      close(lunseq)
    204204      stop
  • redstr.f

    r2ebb8b6 rbd2278d  
    1 c**************************************************************
    2 c
    3 c This file contains the subroutines: extstr,ibegst,iendst,
    4 c                                     iredin,iredrl,iopfil,
    5 c                                     tolost,toupst
    6 c
    7 c Copyright 2003-2005  Frank Eisenmenger, U.H.E. Hansmann,
    8 c                      Shura Hayryan, Chin-Ku
    9 c Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
    10 c                      Jan H. Meinke, Sandipan Mohanty
    11 c
    12 c **************************************************************
     1!**************************************************************
     2!
     3! This file contains the subroutines: extstr,ibegst,iendst,
     4!                                     iredin,iredrl,iopfil,
     5!                                     tolost,toupst
     6!
     7! Copyright 2003-2005  Frank Eisenmenger, U.H.E. Hansmann,
     8!                      Shura Hayryan, Chin-Ku
     9! Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
     10!                      Jan H. Meinke, Sandipan Mohanty
     11!
     12! **************************************************************
    1313
    1414
    1515      subroutine extstr(spr,ib,ie,str,strn,l)
    1616
    17 c ..........................................................
    18 c PURPOSE:  Extract substring preceeding separator 'spr'
    19 c           from 'str' searching from position 'ib' up to
    20 c           position 'ie' and put it into 'strn(1:l)'.
    21 c           'ib' is shifted to position following 'spr' or
    22 c           to 'ie+1', if 'spr' is not found
    23 c
    24 c          ! 'spr' should not be blank
    25 c
    26 c CALLS: ibegst,iendst
    27 c ..........................................................
     17! ..........................................................
     18! PURPOSE:  Extract substring preceeding separator 'spr'
     19!           from 'str' searching from position 'ib' up to
     20!           position 'ie' and put it into 'strn(1:l)'.
     21!           'ib' is shifted to position following 'spr' or
     22!           to 'ie+1', if 'spr' is not found
     23!
     24!          ! 'spr' should not be blank
     25!
     26! CALLS: ibegst,iendst
     27! ..........................................................
    2828
    2929      implicit integer*4 (i-n)
     
    6464        l=0
    6565        strn=blnk
    66 c ____________________________ make string in 'strn' left justified
     66! ____________________________ make string in 'strn' left justified
    6767      elseif (i.gt.1) then
    6868        j=iendst(strn)
     
    7575
    7676      return
    77 c ______________________________________________________________ Error
     77! ______________________________________________________________ Error
    7878    1 write (*,'(a)') ' extstr> Substring to be extracted is too long !'
    7979      stop
    8080
    8181      end
    82 c **********************************
     82! **********************************
    8383      integer*4 function ibegst(str)
    8484
    85 c .............................................................
    86 c PURPOSE: returns position of 1st non-blank character in 'str'
    87 c
    88 c CALLS: none
    89 c
    90 c .............................................................
     85! .............................................................
     86! PURPOSE: returns position of 1st non-blank character in 'str'
     87!
     88! CALLS: none
     89!
     90! .............................................................
    9191
    9292      implicit integer*4 (i-n)
     
    106106      return
    107107      end
    108 c **********************************
     108! **********************************
    109109      integer*4 function iendst(str)
    110110
    111 c ..............................................................
    112 c PURPOSE: returns position of last non-blank character in 'str'
    113 c
    114 c CALLS: none
    115 c
    116 c ..............................................................
     111! ..............................................................
     112! PURPOSE: returns position of last non-blank character in 'str'
     113!
     114! CALLS: none
     115!
     116! ..............................................................
    117117
    118118      implicit integer*4 (i-n)
     
    132132      return
    133133      end
    134 c **************************************
     134! **************************************
    135135      integer*4 function iredin(line,in)
    136136
    137 c ..........................................
    138 c PURPOSE: Read integer*4 value 'in' from 'line'
    139 c          with format 'i9'
    140 c
    141 c          iredin=0 : error status
    142 c          iredin=1 : success
    143 c
    144 c CALLS: ibegst,iendst
    145 c ..........................................
     137! ..........................................
     138! PURPOSE: Read integer*4 value 'in' from 'line'
     139!          with format 'i9'
     140!
     141!          iredin=0 : error status
     142!          iredin=1 : success
     143!
     144! CALLS: ibegst,iendst
     145! ..........................................
    146146
    147147      implicit integer*4 (i-n)
     
    172172    1 return
    173173      end
    174 c *************************************
     174! *************************************
    175175      integer*4 function iredrl(line,r)
    176176
    177 c ..........................................
    178 c PURPOSE: Read real*8 value 'r' from 'line'
    179 c          with format 'd17.6'
    180 c
    181 c          iredrl=0 : error status
    182 c          iredrl=1 : success
    183 c
    184 c CALLS: ibegst,iendst
    185 c ..........................................
     177! ..........................................
     178! PURPOSE: Read real*8 value 'r' from 'line'
     179!          with format 'd17.6'
     180!
     181!          iredrl=0 : error status
     182!          iredrl=1 : success
     183!
     184! CALLS: ibegst,iendst
     185! ..........................................
    186186
    187187      implicit integer*4 (i-n)
    188188
    189189      parameter (mxd =17,   ! max. # of digits
    190      #           mxap= 6,   ! max. # of digits after period
    191      #           mxip=mxd-mxap)
     190     &           mxap= 6,   ! max. # of digits after period
     191     &           mxip=mxd-mxap)
    192192 
    193193      real*8 r
     
    222222    1 return
    223223      end
    224 c **************************
     224! **************************
    225225      subroutine tolost(str)
    226226
    227 c ..........................................
    228 c  PURPOSE:  converts 'string' to lower-case
    229 c  INPUT:    str - string to be converted
    230 c  CALLS:    ibegst,iendst
    231 c ..........................................
     227! ..........................................
     228!  PURPOSE:  converts 'string' to lower-case
     229!  INPUT:    str - string to be converted
     230!  CALLS:    ibegst,iendst
     231! ..........................................
    232232
    233233      include 'INCL.H'
     
    246246      return
    247247      end
    248 c **************************
     248! **************************
    249249      subroutine toupst(str)
    250250
    251 c ..........................................
    252 c  PURPOSE:  converts 'string' to upper-case
    253 c  INPUT:    str - string to be converted
    254 c  CALLS:    ibegst,iendst
    255 c ..........................................
     251! ..........................................
     252!  PURPOSE:  converts 'string' to upper-case
     253!  INPUT:    str - string to be converted
     254!  CALLS:    ibegst,iendst
     255! ..........................................
    256256
    257257      include 'INCL.H'
     
    270270      return
    271271      end
    272 c *****************************************************
     272! *****************************************************
    273273      integer*4 function iopfil(lun,filnam,stat,format)
    274274
    275 c ........................................................
    276 c PURPOSE: open 'lun' with 'filnam' 'stat' 'format'
    277 c
    278 c          returns: 1 = file successful opened
    279 c                   0 = error during open of existing file
    280 c                  -1 = file does not exist
    281 c
    282 c CALLS: ibegst
    283 c ........................................................
     275! ........................................................
     276! PURPOSE: open 'lun' with 'filnam' 'stat' 'format'
     277!
     278!          returns: 1 = file successful opened
     279!                   0 = error during open of existing file
     280!                  -1 = file does not exist
     281!
     282! CALLS: ibegst
     283! ........................................................
    284284
    285285      implicit integer*4 (i-n)
     
    299299            if (j.gt.0.and.k.gt.0) then
    300300              open(lun,file=filnam(i:),status=stat(j:),
    301      #             form=format(k:),err=1)
     301     &             form=format(k:),err=1)
    302302              iopfil=1
    303303            endif
  • redvar.f

    r2ebb8b6 rbd2278d  
    1 c**************************************************************
    2 c
    3 c This file contains the subroutines: redvar
    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: redvar
     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 redvar
    1414
    15 c ...................................................................
    16 c
    17 c PURPOSE: Read global parameters for molecules from lines
    18 c
    19 c          +--------------------------------------------------+
    20 c          |@ molecule no. : six floats separated by commas   |
    21 c          +--------------------------------------------------+
    22 c
    23 c          NB: 1) if omit field with molecule no. assume: nml=1
    24 c              2) last 3 float are angles in deg.
    25 c
    26 c          Read and interpret file to SET and FIX internal variables
    27 c          by commands:
    28 c
    29 c          +-----------------------------------------+
    30 c          |  molecule : residue : variable : value  |
    31 c          +-----------------------------------------+
    32 c
    33 c        * Lines containing '&' assign FIXED variable(s), they will
    34 c          not be varied during subsequent minimization etc.
    35 c
    36 c        * Empty LINES or lines containing '#' are ignored
    37 c        * Several commands on same line must be separated by ';'
    38 c        * Empty COMMANDS, i.e. ' : : ' are ignored
    39 c        * All spaces are not significant and are therefore ignored
    40 c
    41 c        * A command consists of up to 4 (maxfld) fields, separated
    42 c          by ':'
    43 c
    44 c        - last field     : value for VARIABLE (REAL)
    45 c                           ! should never be empty
    46 c        - 1st before last: name(s) (CHAR) or index(ices) of VARIABLE(S)
    47 c        - 2nd before last: name(s) or index(ices) of RESIDUE(S)
    48 c        - 3rd before last: name or number(ices) of MOLECULE(S)
    49 c
    50 c        * molecules, residues, variables can be identified, either by,
    51 c          INDICES (zones 'n1-n2' possible) or NAMES
    52 c
    53 c        * several identifiers in a field can be separated by ','
    54 c
    55 c        * INDICES: for residues  - refer to numbering within molecule
    56 c                 : for variables - refer to numbering within residue
    57 c        * ZONES:   '-n2' indicates '1-n2'
    58 c                   'n1-' indicates 'n1-(all)'
    59 c        * NAMES or their ends can be indicated by wild-card '*'
    60 c                are case-sensitive
    61 c
    62 c        Example:  phi:-65; psi:-45  >set all phi=-65, all psi=-45
    63 c                  om*: 180 &  >set all omg, omt ... to 180 & fix them
    64 c                  5 : x* : -60  >set all xi-angles of residue 5 to 60
    65 c
    66 c CALLS: setvar,extstr,iendst,ibegst,iopfil,iredin,iredrl
    67 c ......................................................................
     15! ...................................................................
     16!
     17! PURPOSE: Read global parameters for molecules from lines
     18!
     19!          +--------------------------------------------------+
     20!          |@ molecule no. : six floats separated by commas   |
     21!          +--------------------------------------------------+
     22!
     23!          NB: 1) if omit field with molecule no. assume: nml=1
     24!              2) last 3 float are angles in deg.
     25!
     26!          Read and interpret file to SET and FIX internal variables
     27!          by commands:
     28!
     29!          +-----------------------------------------+
     30!          |  molecule : residue : variable : value  |
     31!          +-----------------------------------------+
     32!
     33!        * Lines containing '&' assign FIXED variable(s), they will
     34!          not be varied during subsequent minimization etc.
     35!
     36!        * Empty LINES or lines containing '#' are ignored
     37!        * Several commands on same line must be separated by ';'
     38!        * Empty COMMANDS, i.e. ' : : ' are ignored
     39!        * All spaces are not significant and are therefore ignored
     40!
     41!        * A command consists of up to 4 (maxfld) fields, separated
     42!          by ':'
     43!
     44!        - last field     : value for VARIABLE (REAL)
     45!                           ! should never be empty
     46!        - 1st before last: name(s) (CHAR) or index(ices) of VARIABLE(S)
     47!        - 2nd before last: name(s) or index(ices) of RESIDUE(S)
     48!        - 3rd before last: name or number(ices) of MOLECULE(S)
     49!
     50!        * molecules, residues, variables can be identified, either by,
     51!          INDICES (zones 'n1-n2' possible) or NAMES
     52!
     53!        * several identifiers in a field can be separated by ','
     54!
     55!        * INDICES: for residues  - refer to numbering within molecule
     56!                 : for variables - refer to numbering within residue
     57!        * ZONES:   '-n2' indicates '1-n2'
     58!                   'n1-' indicates 'n1-(all)'
     59!        * NAMES or their ends can be indicated by wild-card '*'
     60!                are case-sensitive
     61!
     62!        Example:  phi:-65; psi:-45  >set all phi=-65, all psi=-45
     63!                  om*: 180 &  >set all omg, omt ... to 180 & fix them
     64!                  5 : x* : -60  >set all xi-angles of residue 5 to 60
     65!
     66! CALLS: setvar,extstr,iendst,ibegst,iopfil,iredin,iredrl
     67! ......................................................................
    6868
    6969
    7070      include 'INCL.H'
    7171
    72 c maxfld: max. # of fields in one command
    73 c maxide: max. # of identifiers in a field
    74 c maxcmd: max. # of commands to be interpreted
    75 c ilrg:   a large integer
     72! maxfld: max. # of fields in one command
     73! maxide: max. # of identifiers in a field
     74! maxcmd: max. # of commands to be interpreted
     75! ilrg:   a large integer
    7676
    7777      parameter (maxfld=4,
    78      #           maxide=30,
    79      #           maxcmd=5000,
    80      #           ilrg=1000000)
     78     &           maxide=30,
     79     &           maxcmd=5000,
     80     &           ilrg=1000000)
    8181
    8282      character spcm,spfd,spcc,sphy,cmt,wdc,sfix,blnk, sglp,
    83      #          line*132,lincmd*132,linfld(maxfld)*132,linide*132,
    84      #          linh*132,strg(6)*17
     83     &          line*132,lincmd*132,linfld(maxfld)*132,linide*132,
     84     &          linh*132,strg(6)*17
    8585      dimension ifdend(maxfld),vlvrx(mxvr),rn(6)
    8686      logical fix,did,exa,forml(mxml),forrs(mxrs),forvr(mxvr),
    87      #        stvr(mxvr)
     87     &        stvr(mxvr)
    8888      data spcm/';'/,spfd/':'/,spcc/','/,sphy/'-'/,cmt/'#'/,wdc/'*'/,
    89      #     sfix/'&'/,blnk/' '/, sglp/'@'/
    90 
    91 
    92 c ___________________________________ Checks
     89     &     sfix/'&'/,blnk/' '/, sglp/'@'/
     90
     91
     92! ___________________________________ Checks
    9393      ntlvr=ivrml1(ntlml)+nvrml(ntlml)-1
    9494      if (ntlvr.eq.0) then
     
    9696        return
    9797      endif
    98 c ___________________________________ Initialize
     98! ___________________________________ Initialize
    9999
    100100      io=iopfil(lunvar,varfil,'old','formatted')
    101101      if (io.eq.0) then
    102102        write (*,'(a,/,a,i3,2a)')
    103      #    ' redvar> ERROR opening file to set variables:',
    104      #    ' LUN=',lunvar,' FILE=',varfil(1:iendst(varfil))
     103     &    ' redvar> ERROR opening file to set variables:',
     104     &    ' LUN=',lunvar,' FILE=',varfil(1:iendst(varfil))
    105105        stop
    106106      elseif (io.eq.-1) then
    107107        return
    108108      endif
    109 c ___________________________________ Initialization
     109! ___________________________________ Initialization
    110110      do i=1,ntlml
    111111        forml(i)=.true.
     
    138138    1 read (lunvar,'(a)',end=2) line
    139139      ile=iendst(line)
    140 c _________________________________ ! ignore empty and commentary lines
     140! _________________________________ ! ignore empty and commentary lines
    141141      if (ile.gt.0.and.index(line(1:ile),cmt).le.0) then
    142142
    143 c _________________________________________ Global variables
     143! _________________________________________ Global variables
    144144        ilb = index(line(1:ile),sglp)+1
    145145        if (ilb.ge.2) then
     
    150150
    151151            if (iredin(lincmd,nml).le.0.or.
    152      #          nml.le.0.or.nml.gt.ntlml) then
     152     &          nml.le.0.or.nml.gt.ntlml) then
    153153              write (*,*) 'redvar> ','Incorrect molecule number >',
    154      #                    lincmd(1:l),'<  Must be in range [1,',
    155      #                    ntlml,'] !'
     154     &                    lincmd(1:l),'<  Must be in range [1,',
     155     &                    ntlml,'] !'
    156156              close(lunvar)
    157157              stop
     
    179179          if (iredrl(linh,rn(6)).le.0) goto 105
    180180
    181 c ---------------------------------------- check global angles
     181! ---------------------------------------- check global angles
    182182          if (  abs(rn(4)).gt.(1.8d2+1d-6)
    183      #     .or. abs(rn(5)).gt.(9d1+1d-6)
    184      #     .or. abs(rn(6)).gt.(1.8d2+1d-6)
    185      #    ) goto 106
     183     &     .or. abs(rn(5)).gt.(9d1+1d-6)
     184     &     .or. abs(rn(6)).gt.(1.8d2+1d-6)
     185     &    ) goto 106
    186186           
    187187          do i = 1,3
     
    221221            endif
    222222
    223 c _________________________________________ Extract Command Fields
     223! _________________________________________ Extract Command Fields
    224224            nfld=0
    225225            icb=1
     
    235235
    236236            enddo
    237 c _______________________________ Interpret Command Fields (except last)
     237! _______________________________ Interpret Command Fields (except last)
    238238            do i=1,nfld-1
    239239              ii=i
     
    255255                enddo
    256256              endif
    257 c __________________________________ Identifiers in field
     257! __________________________________ Identifiers in field
    258258              nide=0
    259259              ifb=1
     
    299299                      if (ifld.eq.3) then        !  Mol.
    300300
    301 c ################### impossible # (inum) of molecule
     301! ################### impossible # (inum) of molecule
    302302
    303303                        if (inum.le.0.or.inum.gt.ntlml) then
     
    313313                            k=inum+nfi-1
    314314
    315 c ################### impossible # of residue (inum) in molecule
     315! ################### impossible # of residue (inum) in molecule
    316316
    317317                            if (k.lt.nfi.or.k.gt.irsml2(j)) then
     
    331331                                l=inum+nfi-1
    332332
    333 c ################### impossible # of variable (inum) in residue
     333! ################### impossible # of variable (inum) in residue
    334334
    335335                                if (l.lt.nfi.or.
    336      #                              l.gt.nfi+nvrrs(k)-1) then
     336     &                              l.gt.nfi+nvrrs(k)-1) then
    337337                                  write (*,*) ' # 3: ',inum
    338338                                  goto 104
     
    364364                            linh(1:ieh1)=nmml(j)(ib:ieh)
    365365                            if (((exa.and.ieh1.eq.id).or.
    366      #                         (.not.exa.and.ieh1.ge.id)).and.
    367      #                         linh(1:id).eq.linide(1:id))
    368      #                         forml(j)=.true.
     366     &                         (.not.exa.and.ieh1.ge.id)).and.
     367     &                         linh(1:id).eq.linide(1:id))
     368     &                         forml(j)=.true.
    369369                          endif
    370370                        enddo       
     
    380380                                linh(1:ieh1)=seq(k)(ib:ieh)
    381381                                if (((exa.and.ieh1.eq.id).or.
    382      #                             (.not.exa.and.ieh1.ge.id))
    383      #                          .and.linh(1:id).eq.linide(1:id))
    384      #                            forrs(k)=.true.
     382     &                             (.not.exa.and.ieh1.ge.id))
     383     &                          .and.linh(1:id).eq.linide(1:id))
     384     &                            forrs(k)=.true.
    385385                              endif
    386386                            enddo
     
    401401                                    linh(1:ieh1)=nmvr(l)(ib:ieh)
    402402                                    if (((exa.and.ieh1.eq.id)
    403      #                         .or.(.not.exa.and.ieh1.ge.id))
    404      #                          .and.linh(1:id).eq.linide(1:id))
    405      #                              forvr(l)=.true.
     403     &                         .or.(.not.exa.and.ieh1.ge.id))
     404     &                          .and.linh(1:id).eq.linide(1:id))
     405     &                              forvr(l)=.true.
    406406                                  endif
    407407                                enddo
     
    416416                  else                                       ! ___ Zone
    417417
    418 c ################### impossible zone '-' (without integer)
     418! ################### impossible zone '-' (without integer)
    419419
    420420                    if (ide.eq.1.and.ihy.eq.ide) then
     
    429429                      linh=linide(1:ihy-1)
    430430
    431 c ################### impossible (to read) integer before '-'
     431! ################### impossible (to read) integer before '-'
    432432
    433433                      if (iredin(linh,ibz).le.0.or.ibz.le.0)
    434      #                  then
     434     &                  then
    435435                        write (*,*) ' # 5 '
    436436                        goto 104
     
    444444                      linh=linide(ihy+1:ide)
    445445
    446 c ################### impossible (to read) integer after '-'
     446! ################### impossible (to read) integer after '-'
    447447
    448448                      if (iredin(linh,iez).le.0.or.iez.le.0.or.
    449      #                  iez.lt.ibz) then
     449     &                  iez.lt.ibz) then
    450450                        write (*,*) ' # 6 '
    451451                        goto 104
     
    502502            enddo  ! ... Fields (excl. value)
    503503
    504 c _____________________________________________________ Execute Command
     504! _____________________________________________________ Execute Command
    505505
    506506            if (iredrl(linfld(nfld),val).gt.izero) then  ! Read Value
     
    517517              enddo
    518518              if (.not.did) write (*,'(3a)')
    519      #          ' redvar> No variables affected by command >',
    520      #          lincmd(1:ice),'<'
     519     &          ' redvar> No variables affected by command >',
     520     &          lincmd(1:ice),'<'
    521521            else
    522522
     
    524524              ll2=iendst(linfld(nfld))
    525525              write (*,*) 'll1,ll2, linfld(nfld): ',ll1,ll2,
    526      #           '>',linfld(nfld)(ll1:ll2),'<'
     526     &           '>',linfld(nfld)(ll1:ll2),'<'
    527527
    528528              goto 102
     
    535535
    536536    2 close(lunvar)
    537 c __________________________ Summary
     537! __________________________ Summary
    538538      iv=0
    539539      do i=1,ntlml
     
    552552
    553553             write (*,'(3a,/,1x,5(a,2x),a)') ' redvar> ',nmml(i)(1:ie),
    554      #                                    ' with global parameters:',
    555      #                              (strg(k)(ibegst(strg(k)):),k=1,6)
     554     &                                    ' with global parameters:',
     555     &                              (strg(k)(ibegst(strg(k)):),k=1,6)
    556556             call setvar(i,vlvrx)
    557557             goto 3
     
    572572                if (fxvr(iv)) then
    573573                  write (*,'(3a,i4,1x,4a,f10.3,a)') ' redvar> ',
    574      #                nmml(i)(1:ie),': residue ',j-jb,seq(j),
    575      #                ': ',nmvr(iv),' set ',vlvrx(iv),'   Fixed'
     574     &                nmml(i)(1:ie),': residue ',j-jb,seq(j),
     575     &                ': ',nmvr(iv),' set ',vlvrx(iv),'   Fixed'
    576576                else
    577577                  write (*,'(3a,i4,1x,4a,f10.3)') ' redvar> ',
    578      #                nmml(i)(1:ie),': residue ',j-jb,seq(j),
    579      #                ': ',nmvr(iv),' set ',vlvrx(iv)
     578     &                nmml(i)(1:ie),': residue ',j-jb,seq(j),
     579     &                ': ',nmvr(iv),' set ',vlvrx(iv)
    580580                endif
    581581                ity=ityvr(iv)
    582582                if (ity.eq.3.or.ity.eq.2)
    583      #            vlvrx(iv)=vlvrx(iv)*cdr             ! angles
     583     &            vlvrx(iv)=vlvrx(iv)*cdr             ! angles
    584584                 
    585585              else
     
    590590          if (did) then
    591591            if (in.gt.0) write (*,'(3a,i5,a)')
    592      #        ' redvar> Molecule ',nmml(i)(1:ie),': ',in,
    593      #        ' variable(s) remain unchanged'
     592     &        ' redvar> Molecule ',nmml(i)(1:ie),': ',in,
     593     &        ' variable(s) remain unchanged'
    594594            call setvar(iml,vlvrx)
    595595          else
    596596            write (*,'(3a)') ' redvar> Molecule ',
    597      #        nmml(i)(1:ie),': No internal variables changed'
     597     &        nmml(i)(1:ie),': No internal variables changed'
    598598          endif
    599599        endif
     
    601601
    602602      return
    603 c ____________________________________________________________ Errors
     603! ____________________________________________________________ Errors
    604604  100 write (*,'(3a)') ' redvar> Cannot interpret command >',
    605      #                 lincmd(1:ice),'<'
     605     &                 lincmd(1:ice),'<'
    606606      close(lunvar)
    607607      stop
     
    610610      stop
    611611  102 write (*,'(3a)') ' redvar> Cannot read value from >',
    612      #                   lincmd(1:ice),'<'
     612     &                   lincmd(1:ice),'<'
    613613      close(lunvar)
    614614      stop
    615615  103 write (*,'(a,i3,3a)') ' redvar> Cannot read >',maxide,
    616      #         ' identifiers from >',linfld(ii)(1:ife),'<'
     616     &         ' identifiers from >',linfld(ii)(1:ife),'<'
    617617      close(lunvar)
    618618      stop
    619619  104 write (*,'(5a)') ' redvar> Error in identifier >',
    620      #            linide(1:ide),'< of command >',lincmd(1:ice),'<'
     620     &            linide(1:ide),'< of command >',lincmd(1:ice),'<'
    621621      close(lunvar)
    622622      stop
    623623  105 write (*,'(a,/,a,/,2a,/)') ' redvar> line with global paramters:',
    624      #                           line(1:ile),' must contain 6 floating',
    625      #                           ' point numbers separated by commas !'
     624     &                           line(1:ile),' must contain 6 floating',
     625     &                           ' point numbers separated by commas !'
    626626      close(lunvar)
    627627      stop
    628628
    629629  106 write (*,'(a,/,a,/,2a,/)') ' redvar> line with global paramters:',
    630      #                           line(1:ile),' angles must be inside ',
    631      #'ranges [-180,180], [-90,90], and [-180,180] Deg., respectively !'
     630     &                           line(1:ile),' angles must be inside ',
     631     &'ranges [-180,180], [-90,90], and [-180,180] Deg., respectively !'
    632632      close(lunvar)
    633633      stop
  • regul.f

    r2ebb8b6 rbd2278d  
    1 c**************************************************************
    2 c
    3 c This file contains the subroutines: regul
    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: regul
     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 regul(nml, iter, nsteps, acc)
    1414
    15 c ----------------------------------------------------------
    16 c PURPOSE: regularization of PDB-structure into SMMP geometry
    17 c
    18 c          @param nml molecule to be regularized
    19 c          @param iter number of iterations during regularization
    20 c          @param nsteps maximum number of steps in minimization
    21 c          @param acc acceptance criterium for minimization
    22 c
    23 c CALLS:   minim, cnteny, outvar,rmsdopt
    24 c ----------------------------------------------------------
     15! ----------------------------------------------------------
     16! PURPOSE: regularization of PDB-structure into SMMP geometry
     17!
     18!          @param nml molecule to be regularized
     19!          @param iter number of iterations during regularization
     20!          @param nsteps maximum number of steps in minimization
     21!          @param acc acceptance criterium for minimization
     22!
     23! CALLS:   minim, cnteny, outvar,rmsdopt
     24! ----------------------------------------------------------
    2525
    2626      include 'INCL.H'
    2727      include 'INCP.H'
    2828     
    29 cf2py intent(in) nml
    30 cf2py intent(in) iter
    31 cf2py intent(in) nsteps
    32 cf2py intent(in) acc
     29!f2py intent(in) nml
     30!f2py intent(in) iter
     31!f2py intent(in) nsteps
     32!f2py intent(in) acc
    3333
    3434      dimension rm(3,3),av1(3),av2(3)
     
    4141
    4242      write(*,'(/,a,2(a,f4.2),/)')
    43      #  ' ====================== Regularization only',
    44      #  '   Wt(energy) = ',wtey,'  Wt(regul.) = ',wtrg
     43     &  ' ====================== Regularization only',
     44     &  '   Wt(energy) = ',wtey,'  Wt(regul.) = ',wtrg
    4545
    4646      call minim(1, nsteps, acc)
     
    5757      write(*,*) ' RMSD = ',rmsd
    5858
    59 c --------------------------------------- fix vars. defined in PDB
     59! --------------------------------------- fix vars. defined in PDB
    6060
    6161
     
    6767
    6868      write(*,'(/,a,2(a,f4.2),/)')
    69      #  ' ====================== Internal Energy for Hydrogens only',
    70      #  '   Wt(energy) = ',wtey,'  Wt(regul.) = ',wtrg
     69     &  ' ====================== Internal Energy for Hydrogens only',
     70     &  '   Wt(energy) = ',wtey,'  Wt(regul.) = ',wtrg
    7171
    7272      call minim(1, nsteps, acc)
     
    9595
    9696        write(*,'(/,a,i2,2(a,e11.3),/)')
    97      #    ' ================ Minimization #',it,
    98      #        '   Wt(energy) = ',wtey,'  Wt(regul.) = ',wtrg
     97     &    ' ================ Minimization #',it,
     98     &        '   Wt(energy) = ',wtey,'  Wt(regul.) = ',wtrg
    9999
    100100        call minim(1, nsteps, acc)
     
    113113      call cnteny(nml)
    114114
    115 c      call outpdb(nml,12)
     115!      call outpdb(nml,12)
    116116
    117 c Output of dihedral angles of the regularized structure
     117! Output of dihedral angles of the regularized structure
    118118      write(*,*) 'Dihedral angles of the regularized structure;'
    119119      call outvar(nml, 'regd.var')
  • rgyr.f

    r2ebb8b6 rbd2278d  
    1 c**************************************************************
    2 c
    3 c This file contains the subroutines: rgyr
    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: rgyr
     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 rgyr(nml, rgy, ee)
    1414
    15 C CALCULATES THE RADIUS-OF-GYRATION AND THE END-TO-END DISTANCE
    16 C FOR A GIVEN PROTEIN CONFORMATION
    17 C If nml == 0, calculate the radius of gyration for all molecules
    18 C
    19 C     rgy  = radius-of-gyration
    20 C     ee   = end-to-end distance
    21 C
    22 C REQUIREMENTS: c_alfa has to be called BEFORE call of this subroutine
    23 C
    24 C CALLS: NONE
    25 C
     15! CALCULATES THE RADIUS-OF-GYRATION AND THE END-TO-END DISTANCE
     16! FOR A GIVEN PROTEIN CONFORMATION
     17! If nml == 0, calculate the radius of gyration for all molecules
     18!
     19!     rgy  = radius-of-gyration
     20!     ee   = end-to-end distance
     21!
     22! REQUIREMENTS: c_alfa has to be called BEFORE call of this subroutine
     23!
     24! CALLS: NONE
     25!
    2626      include 'INCL.H'
    27 cf2py intent(in) nml
    28 cf2py intent(out) rgy
    29 cf2py intent(out) ee
     27!f2py intent(in) nml
     28!f2py intent(out) rgy
     29!f2py intent(out) ee
    3030      integer typ
    3131      if (nml.eq.0) then
     
    4242      if (nat.le.0) then
    4343        write (*,'(a,i4)')
    44      #     ' rgyr> No atoms found for molecule #',nml
     44     &     ' rgyr> No atoms found for molecule #',nml
    4545        return
    4646      endif
     
    128128
    129129      ee = sqrt((xat(i2)-xat(i1))**2+(yat(i2)-yat(i1))**2
    130      #         +(zat(i2)-zat(i1))**2)
     130     &         +(zat(i2)-zat(i1))**2)
    131131
    132132      return
  • rmsdfun.f

    r2ebb8b6 rbd2278d  
    1 c **************************************************************
    2 c
    3 c This file contains the subroutines: rmsdfun,rmsdopt,fitmol,
    4 c                                     jacobi,rmsinit
    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: rmsdfun,rmsdopt,fitmol,
     4!                                     jacobi,rmsinit
     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      real*8 function rmsdfun(nml,ir1,ir2,ixat,xrf,yrf,zrf,isl)
    14 C
    15 C --------------------------------------------------------------
    16 c Wrapping function for calculating rmsd
    17 c
    18 c LIMITATION: requires call of rmsinit BEFORE calling this function
    19 c
    20 c CALLS: rmsdopt
    21 c
    22 c ---------------------------------------------------------------
    23 c
     14!
     15! --------------------------------------------------------------
     16! Wrapping function for calculating rmsd
     17!
     18! LIMITATION: requires call of rmsinit BEFORE calling this function
     19!
     20! CALLS: rmsdopt
     21!
     22! ---------------------------------------------------------------
     23!
    2424      include 'INCL.H'
    2525      include 'INCP.H'
    26 c
    27 c Input
     26!
     27! Input
    2828      dimension ixat(mxat),xrf(mxatp),yrf(mxatp),zrf(mxatp)
    29 c Local
     29! Local
    3030      dimension rm(3,3),av1(3),av2(3)
    3131      call rmsdopt(nml,ir1,ir2,ixat,xrf,yrf,zrf,isl,rm,av1,av2,rssd)
     
    3737      end
    3838
    39 c*******************************************************************
     39!*******************************************************************
    4040      subroutine rmsdopt(nml,ir1,ir2,ixat,xrf,yrf,zrf,isl,
    41      #                   rm,av1,av2,rmsd)
    42 
    43 c ---------------------------------------------------------------
    44 c PURPOSE: root mean square deviation (rmsd) between current SMMP
    45 c          structure and reference atom coordinates 'x,y,zrf()'
    46 c          for range of SMMP residues [ir1,ir2] in molecule 'nml'
    47 c
    48 c          ixat(i) - points to the atom in ref. coords., which is
    49 c                    equivalent to atom i of SMMP structure
    50 c                    (=0 if no equivalent in ref. structure exists)
    51 c
    52 c          isl = 0  : select all heavy atoms
    53 c          isl = 1  : backbone atoms n,ca,c
    54 c          isl = 2  : only ca atoms
    55 c
    56 c CALLS:   fitmol [S.K.Kearsley, Acta Cryst. 1989, A45, 208-210]
    57 c
    58 c      NB  uncomment last lines in 'fitmol' to return coordinates
    59 c          in 'x2' after fitting the ref. str. onto SMMP structure
    60 c ----------------------------------------------------------------
     41     &                   rm,av1,av2,rmsd)
     42
     43! ---------------------------------------------------------------
     44! PURPOSE: root mean square deviation (rmsd) between current SMMP
     45!          structure and reference atom coordinates 'x,y,zrf()'
     46!          for range of SMMP residues [ir1,ir2] in molecule 'nml'
     47!
     48!          ixat(i) - points to the atom in ref. coords., which is
     49!                    equivalent to atom i of SMMP structure
     50!                    (=0 if no equivalent in ref. structure exists)
     51!
     52!          isl = 0  : select all heavy atoms
     53!          isl = 1  : backbone atoms n,ca,c
     54!          isl = 2  : only ca atoms
     55!
     56! CALLS:   fitmol [S.K.Kearsley, Acta Cryst. 1989, A45, 208-210]
     57!
     58!      NB  uncomment last lines in 'fitmol' to return coordinates
     59!          in 'x2' after fitting the ref. str. onto SMMP structure
     60! ----------------------------------------------------------------
    6161
    6262      include 'INCL.H'
    6363      include 'INCP.H'
    6464
    65 c-------------------------------------------------------- input
     65!-------------------------------------------------------- input
    6666      dimension ixat(mxat),xrf(mxatp),yrf(mxatp),zrf(mxatp)
    67 c-------------------------------------------------------- output
     67!-------------------------------------------------------- output
    6868      dimension rm(3,3),av1(3),av2(3)
    69 c-------------------------------------------------------- local
     69!-------------------------------------------------------- local
    7070      dimension x1(3,mxat),x2(3,mxat)
    7171      character*4 atnm
     
    9999                if ( isl.eq.0
    100100
    101      #               .or.
    102 
    103      #              (isl.eq.1.and.(index(atnm,'n   ').gt.0 .or.
    104      #                             index(atnm,'ca  ').gt.0 .or.
    105      #                             index(atnm,'c   ').gt.0 ))
    106      #               .or.
    107 
    108      #              (isl.eq.2.and.index(atnm,'ca  ').gt.0)
    109 
    110      #          ) then
     101     &               .or.
     102
     103     &              (isl.eq.1.and.(index(atnm,'n   ').gt.0 .or.
     104     &                             index(atnm,'ca  ').gt.0 .or.
     105     &                             index(atnm,'c   ').gt.0 ))
     106     &               .or.
     107
     108     &              (isl.eq.2.and.index(atnm,'ca  ').gt.0)
     109
     110     &          ) then
    111111
    112112                  n=n+1
     
    136136      return
    137137      end
    138 c *********************************************
     138! *********************************************
    139139      subroutine fitmol(n,x1,x2, rm,a1,a2,rmsd)
    140 c      real*8 function fitmol(n,x1,x2)
    141 
    142 c .......................................................
    143 c PURPOSE: compute RMSD of n positions in x1(3,) & x2(3,)
    144 c          [S.K.Kearsley Acta Cryst. 1989,A45,208-210]
    145 c
    146 c CALLS: jacobi
    147 c .......................................................
    148 cf2py intent(out) rmsd
     140!      real*8 function fitmol(n,x1,x2)
     141
     142! .......................................................
     143! PURPOSE: compute RMSD of n positions in x1(3,) & x2(3,)
     144!          [S.K.Kearsley Acta Cryst. 1989,A45,208-210]
     145!
     146! CALLS: jacobi
     147! .......................................................
     148!f2py intent(out) rmsd
    149149                   
    150150      include 'INCL.H'
    151 c      implicit real*8 (a-h,o-z)
    152 c      implicit integer*4 (i-n)
     151!      implicit real*8 (a-h,o-z)
     152!      implicit integer*4 (i-n)
    153153 
    154 c ------------------------------------------- input/output
     154! ------------------------------------------- input/output
    155155      dimension x1(3,mxat),x2(3,mxat)
    156 c -------------------------------------------------- local
     156! -------------------------------------------------- local
    157157      dimension e(4),q(4,4),v(4,4),dm(3),dp(3),a1(3),a2(3),rm(3,3)
    158158
    159159      dn=dble(n)
    160 c ------------------- average of coordinates
     160! ------------------- average of coordinates
    161161      do i=1,3
    162162        a1(i) = 0.d0
     
    169169        a2(i) = a2(i)/dn
    170170      enddo
    171 c ------------------------- compile quaternion
     171! ------------------------- compile quaternion
    172172      do i=1,4
    173173        do j=1,4
     
    208208        enddo
    209209      enddo
    210 c ------------------------------ eigenvalues & -vectors
     210! ------------------------------ eigenvalues & -vectors
    211211      ndim4=4
    212212      call jacobi(q,ndim4,e,v)
    213 c --------------------------- lowest eigenvalue
     213! --------------------------- lowest eigenvalue
    214214      im=1
    215215      em=e(1)
     
    223223      rmsd = sqrt(em/dn)
    224224
    225 c ================= uncomment following lines to fit molecule 2 onto 1
    226 
    227 c ---------------------------------------------------rotation matrix
     225! ================= uncomment following lines to fit molecule 2 onto 1
     226
     227! ---------------------------------------------------rotation matrix
    228228      rm(1,1) = v(1,im)**2+v(2,im)**2-v(3,im)**2-v(4,im)**2
    229229      rm(1,2) = 2.d0*( v(2,im)*v(3,im)-v(1,im)*v(4,im) )
     
    236236      rm(3,3) = v(1,im)**2+v(4,im)**2-v(2,im)**2-v(3,im)**2
    237237
    238 c      do i=1,n
    239 c        do j=1,3
    240 c          dm(j) = x2(j,i) - a2(j)
    241 c        enddo
    242 c        do j=1,3
    243 c          dp(j) = a1(j)
    244 c          do k=1,3
    245 c            dp(j) = dp(j) + rm(j,k) * dm(k)
    246 c          enddo
    247 c          x2(j,i) = dp(j)
    248 c        enddo
    249 c      enddo
    250 
    251 c      fitmol=rmsd
     238!      do i=1,n
     239!        do j=1,3
     240!          dm(j) = x2(j,i) - a2(j)
     241!        enddo
     242!        do j=1,3
     243!          dp(j) = a1(j)
     244!          do k=1,3
     245!            dp(j) = dp(j) + rm(j,k) * dm(k)
     246!          enddo
     247!          x2(j,i) = dp(j)
     248!        enddo
     249!      enddo
     250
     251!      fitmol=rmsd
    252252
    253253      return
    254254      end
    255 c ******************************
     255! ******************************
    256256      subroutine jacobi(a,n,d,v)
    257257
    258 c ......................................................
    259 c PURPOSE: for given symmetric matrix 'a(n,n)
    260 c          compute eigenvalues 'd' & eigenvectors 'v(,)'
    261 c
    262 c  [W.H.Press,S.A.Teukolsky,W.T.Vetterling,
    263 c   B.P.Flannery, Numerical Recipes in FORTRAN,
    264 c   Cambridge Univ. Press, 2nd Ed. 1992, 456-462]
    265 c
    266 c CALLS: none
    267 c
    268 c ......................................................
    269 
    270 cf2py intent(out) d
    271 cf2py intent(out) v
     258! ......................................................
     259! PURPOSE: for given symmetric matrix 'a(n,n)
     260!          compute eigenvalues 'd' & eigenvectors 'v(,)'
     261!
     262!  [W.H.Press,S.A.Teukolsky,W.T.Vetterling,
     263!   B.P.Flannery, Numerical Recipes in FORTRAN,
     264!   Cambridge Univ. Press, 2nd Ed. 1992, 456-462]
     265!
     266! CALLS: none
     267!
     268! ......................................................
     269
     270!f2py intent(out) d
     271!f2py intent(out) v
    272272      parameter (NMAX=500)
    273273     
     
    276276
    277277      real*8 a(n,n),d(n),v(n,n),
    278      #       c,g,h,s,sm,t,tau,theta,tresh,b(NMAX),z(NMAX),smeps
     278     &       c,g,h,s,sm,t,tau,theta,tresh,b(NMAX),z(NMAX),smeps
    279279
    280280      smeps=1.0d-6
     
    318318            if((i.gt.4).and.(abs(d(ip))+
    319319
    320      #g.eq.abs(d(ip))).and.(abs(d(iq))+g.eq.abs(d(iq))))then
     320     &g.eq.abs(d(ip))).and.(abs(d(iq))+g.eq.abs(d(iq))))then
    321321              a(ip,iq)=0.d0
    322322
     
    393393      end
    394394
    395 c ***********************************************************
     395! ***********************************************************
    396396
    397397      subroutine rmsinit(nml,string)
    398 c
    399 c------------------------------------------------------------------------------
    400 c Reads in pdb-file 'string' into INCP.H and initalizes
    401 c the files that 'rmdsopt' needs to calculate the rmsd
    402 c of a configuration with the pdb-configuration
    403 C
    404 c CALLS: pdbread,atixpdb
    405 c
    406 c ----------------------------------------------------------------------------
    407 c
     398!
     399!------------------------------------------------------------------------------
     400! Reads in pdb-file 'string' into INCP.H and initalizes
     401! the files that 'rmdsopt' needs to calculate the rmsd
     402! of a configuration with the pdb-configuration
     403!
     404! CALLS: pdbread,atixpdb
     405!
     406! ----------------------------------------------------------------------------
     407!
    408408      include 'INCL.H'
    409409      include 'INCP.H'
     
    412412 
    413413      if(string.eq.'smmp') then
    414 c
    415 c Compare with a smmp-structure
    416 c
     414!
     415! Compare with a smmp-structure
     416!
    417417        do i=iatrs1(irsml1(nml)),iatrs2(irsml2(nml))
    418418         if(nmat(i)(1:1).ne.'h') then
     
    422422         end if
    423423        enddo
    424 c
     424!
    425425       else
    426 c
    427 c Reference structure is read in from pdb-file
    428 c
     426!
     427! Reference structure is read in from pdb-file
     428!
    429429         call pdbread(string,ier)
    430430         if(ier.ne.0) stop
    431431         call atixpdb(nml)
    432 c
     432!
    433433      end if
    434434      print *,'RMSD initialized with ',string
  • 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'
  • setvar.f

    r2ebb8b6 rbd2278d  
    1 c**************************************************************
    2 c
    3 c This file contains the subroutines: setvar
    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: setvar
     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 setvar(nml,vlvrx)
    1414
    15 c ..............................................................
    16 c PURPOSE: Reset variables in molecule 'nml' to new values given
    17 c          in 'vlvrx' and rebuild molecule
    18 c         
    19 c ! assure constant PHASE angles for branches from same atom
    20 c
    21 c CALLS: bldmol,difang
    22 c ....................................................
     15! ..............................................................
     16! PURPOSE: Reset variables in molecule 'nml' to new values given
     17!          in 'vlvrx' and rebuild molecule
     18!         
     19! ! assure constant PHASE angles for branches from same atom
     20!
     21! CALLS: bldmol,difang
     22! ....................................................
    2323
    2424      include 'INCL.H'
  • universe.py

    r2ebb8b6 rbd2278d  
    112112        """Saves the state of this Universe."""
    113113        pass
     114
     115if __name__ == '__main__':
     116    u=Universe()
  • utilities.f

    r2ebb8b6 rbd2278d  
    114114      end subroutine distributeWorkLoad
    115115     
    116 c-----------------------------------------------------------------------
    117 c     The function fileNameMP takes a template of a file name in the
    118 c     variable base. The position of the first and last character that
    119 c     may be replaced by rank in the string are given in i1 (first) and
    120 c     i2 (last).
    121 c     The function returns an empty string if the rank would need more
    122 c     characters than is allowed by the template.
    123 c     For example,
    124 c     \code
    125 c     rank = 11
    126 c     fileName = fileNameMP('base_0000.dat', 6, 9, rank)
    127 c     write (*,*), fileName
    128 c     \endcode
    129 c     will output base_0011.dat.
    130 c     
    131 c     @param base the base file name, e.g., base_0000.dat.
    132 c     @param i1 index of the first character that may be replaced
    133 c     @param i2 index of the last character that may be replaced
    134 c     @param rank the number that should be inserted into the file name.
    135 c     
    136 c     @return file name for rank
    137 c-----------------------------------------------------------------------
     116!-----------------------------------------------------------------------
     117!     The function fileNameMP takes a template of a file name in the
     118!     variable base. The position of the first and last character that
     119!     may be replaced by rank in the string are given in i1 (first) and
     120!     i2 (last).
     121!     The function returns an empty string if the rank would need more
     122!     characters than is allowed by the template.
     123!     For example,
     124!     \code
     125!     rank = 11
     126!     fileName = fileNameMP('base_0000.dat', 6, 9, rank)
     127!     write (*,*), fileName
     128!     \endcode
     129!     will output base_0011.dat.
     130!     
     131!     @param base the base file name, e.g., base_0000.dat.
     132!     @param i1 index of the first character that may be replaced
     133!     @param i2 index of the last character that may be replaced
     134!     @param rank the number that should be inserted into the file name.
     135!     
     136!     @return file name for rank
     137!-----------------------------------------------------------------------
    138138      character*80 function fileNameMP(base, i1, i2, rank)
    139139
    140140      character*(*) base
    141 c     i1, i2: Index of first and last character that can be replaced
    142 c     rank: rank of node
     141!     i1, i2: Index of first and last character that can be replaced
     142!     rank: rank of node
    143143      integer i1, i2, rank
    144144
     
    150150      endif
    151151
    152 c     TODO: Allow arbitrary rank
     152!     TODO: Allow arbitrary rank
    153153
    154154      if (rank.lt.10) then
     
    166166      endif
    167167      end function fileNameMP
    168 c     End fileNameMP
     168!     End fileNameMP
    169169
  • zimmer.f

    r2ebb8b6 rbd2278d  
    1 c**************************************************************
    2 c
    3 c This file contains the subroutines: zimmer
    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 CALLS: none
    11 c
    12 c **************************************************************
     1!**************************************************************
     2!
     3! This file contains the subroutines: zimmer
     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! CALLS: none
     11!
     12! **************************************************************
    1313
    1414     
    1515         subroutine zimmer(nresi)
    1616
    17 C Calculates the Zimmerman-code of a configuration (Zimmerman et. al.
    18 C Macromolecules, vol. 10 (1977) 1-9.)
    19 C
    20 C Note the difference in Notations:
    21 C    SMMP:                      Zimmerman, et.al.:
    22 C         A                                       A
    23 C         B                                       B
    24 C         C                                       C
    25 C         D                                       D
    26 C         E                                       E
    27 C         F                                       F
    28 C         G                                       G
    29 C         H                                       H
    30 C         a                                       A*
    31 C         b                                       B*
    32 C         c                                       C*
    33 C         d                                       D*
    34 C         e                                       E*
    35 C         f                                       F*
    36 C         g                                       G*
    37 C         h                                       H*
    38 C
     17! Calculates the Zimmerman-code of a configuration (Zimmerman et. al.
     18! Macromolecules, vol. 10 (1977) 1-9.)
     19!
     20! Note the difference in Notations:
     21!    SMMP:                      Zimmerman, et.al.:
     22!         A                                       A
     23!         B                                       B
     24!         C                                       C
     25!         D                                       D
     26!         E                                       E
     27!         F                                       F
     28!         G                                       G
     29!         H                                       H
     30!         a                                       A*
     31!         b                                       B*
     32!         c                                       C*
     33!         d                                       D*
     34!         e                                       E*
     35!         f                                       F*
     36!         g                                       G*
     37!         h                                       H*
     38!
    3939      include 'INCL.H'
    40 cf2py intent(in) nresi
     40!f2py intent(in) nresi
    4141      character*1 zim
    4242
Note: See TracChangeset for help on using the changeset viewer.