Changeset bd2278d for mincjg.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
  • 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
Note: See TracChangeset for help on using the changeset viewer.