Actual source code: ex5f.h
1: ! "$Id: ex5f.F,v 1.59 2001/01/31 18:47:09 balay Exp $";
2: ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3: ! Include file for program ex5f.F
4: ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
5: !
6: ! This program uses CPP for preprocessing, as indicated by the use of
7: ! PETSc include files in the directory petsc/include/finclude. This
8: ! convention enables use of the CPP preprocessor, which allows the use
9: ! of the #include statements that define PETSc objects and variables.
10: !
11: ! Use of the conventional Fortran include statements is also supported
12: ! In this case, the PETsc include files are located in the directory
13: ! petsc/include/foldinclude.
14: !
15: ! Since one must be very careful to include each file no more than once
16: ! in a Fortran routine, application programmers must explicitly list
17: ! each file needed for the various PETSc components within their
18: ! program (unlike the C/C++ interface).
19: !
20: ! See the Fortran section of the PETSc users manual for details.
21: !
22: ! The following include statements are generally used in SNES Fortran
23: ! programs:
24: ! petsc.h - base PETSc routines
25: ! petscvec.h - vectors
26: ! petscmat.h - matrices
27: ! petscksp.h - Krylov subspace methods
28: ! petscpc.h - preconditioners
29: ! petscsnes.h - SNES interface
30: ! In addition, we need the following for use of distributed arrays
31: ! petscda.h - distributed arrays (DAs)
33: #include include/finclude/petsc.h
34: #include include/finclude/petscvec.h
35: #include include/finclude/petscda.h
36: #include include/finclude/petscis.h
37: #include include/finclude/petscmat.h
38: #include include/finclude/petscksp.h
39: #include include/finclude/petscpc.h
40: #include include/finclude/petscsnes.h
42: ! Common blocks:
43: ! In this example we use common blocks to store data needed by the
44: ! application-provided call-back routines, FormJacobian() and
45: ! FormFunction(). Note that we can store (pointers to)
46: ! PETSc objects within these common blocks.
47: !
48: ! common /params/ - contains parameters for the global application
49: ! mx, my - global discretization in x- and y-directions
50: ! lambda - nonlinearity parameter
51: !
52: ! common /pdata/ - contains some parallel data
53: ! da - distributed array
54: ! rank - processor rank within communicator
55: ! size - number of processors
56: ! xs, ys - local starting grid indices (no ghost points)
57: ! xm, ym - widths of local grid (no ghost points)
58: ! gxs, gys - local starting grid indices (including ghost points)
59: ! gxm, gym - widths of local grid (including ghost points)
61: DA da
62: integer xs,xe,xm,gxs,gxe,gxm
63: integer ys,ye,ym,gys,gye,gym
64: integer mx,my,rank,size
65: double precision lambda
67: common /params/ lambda,mx,my
68: common /pdata/ da,rank,size
69: common /pdata/ xs,xe,xm,gxs,gxe,gxm
70: common /pdata/ ys,ye,ym,gys,gye,gym
72: ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -