Actual source code: rosenbrock1f.h

      1: ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      2: !             Include file for program rosenbrock1f.F
      3: ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      4: !
      5: !  This program uses CPP for preprocessing, as indicated by the use of
      6: !  TAO include files in the directories $TAO_DIR/include/finclude and
      7: !  $PETSC_DIR/include/finclude.  This convention enables use of the CPP
      8: !  preprocessor, which allows the use of the #include statements that
      9: !  define TAO objects and variables.
     10: !
     11: !  Since one must be very careful to include each file no more than once
     12: !  in a Fortran routine, application programmers must explicitly list
     13: !  each file needed for the various TAO and PETSc components within their
     14: !  program (unlike the C/C++ interface).
     15: !
     16: !  See the Fortran section of the PETSc users manual for details.
     17: !
     18: !  The following include statements are generally used in TAO programs:
     19: !     tao_solver.h - TAO solvers
     20: !     petscksp.h   - Krylov subspace methods
     21: !     petscpc.h    - preconditioners
     22: !     petscmat.h   - matrices
     23: !     petscvec.h   - vectors
     24: !     petsc.h      - basic PETSc routines

     26: #include "include/finclude/petsc.h"
     27: #include "include/finclude/petscvec.h"
     28: #include "include/finclude/petscmat.h"
     29: #include "include/finclude/petscksp.h"
     30: #include "include/finclude/petscpc.h"
     31: #include "include/finclude/tao_solver.h"

     33: !  Common blocks:
     34: !  In this example we use common blocks to store data needed by the
     35: !  application-provided call-back routines, FormMinimizationFunction(),
     36: !  FormFunctionGradient(), and FormHessian().  Note that we can store
     37: !  (pointers to) TAO objects within these common blocks.
     38: !
     39: !  common /params/ - contains parameters that help to define the application
     40: !
     41: !     alpha, n - define the extended Rosenbrock function:
     42: !       sum_{i=0}^{n/2-1} ( alpha*(x_{2i+1}-x_{2i}^2)^2 + (1-x_{2i})^2 )

     44:       double precision alpha
     45:       integer          n

     47:       common /params/ alpha, n

     49: ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -