Changeset bd2278d for minim.f


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

Reformatting comments and continuation marks.

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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.