1 |
dgoldberg |
1.1 |
C $Header: /u/gcmpack/MITgcm/model/inc/CG3D.h,v 1.10 2010/03/16 00:04:00 jmc Exp $ |
2 |
|
|
C $Name: $ |
3 |
|
|
|
4 |
|
|
#ifdef ALLOW_NONHYDROSTATIC |
5 |
|
|
CBOP |
6 |
|
|
C !ROUTINE: CG3D.h |
7 |
|
|
C !INTERFACE: |
8 |
|
|
C include "CG3D.h" |
9 |
|
|
C !DESCRIPTION: \bv |
10 |
|
|
C *==========================================================* |
11 |
|
|
C | CG3D.h |
12 |
|
|
C | o Three-dimensional conjugate gradient solver header. |
13 |
|
|
C *==========================================================* |
14 |
|
|
C | The common blocks set up here are used in the elliptic |
15 |
|
|
C | equation inversion. They are also used as the interface |
16 |
|
|
C | to the rest of the model. To set the source term for the |
17 |
|
|
C | solver set the appropriate array below. To read the |
18 |
|
|
C | solution read from the appropriate array below. |
19 |
|
|
C *==========================================================* |
20 |
|
|
C \ev |
21 |
|
|
CEOP |
22 |
|
|
|
23 |
|
|
C-- COMMON /CG3D_R/ DEL**2 Laplacian operators |
24 |
|
|
C aW3d :: East-west operator. |
25 |
|
|
C aS3d :: North-south operator. |
26 |
|
|
C aV3d :: Vertical operator. |
27 |
|
|
C aC3d :: 3D operator main diagonal term. |
28 |
|
|
C zMC, zML, zMU :: preconditioner 3D solver |
29 |
|
|
C cg3dNorm - A matrix normalisation factor. |
30 |
|
|
|
31 |
|
|
#ifdef ALLOW_PETSC |
32 |
|
|
INTEGER MAX_CG3D_PETSC_CPUINVERT |
33 |
dgoldberg |
1.2 |
parameter ( MAX_CG3D_PETSC_CPUINVERT = 1 ) |
34 |
dgoldberg |
1.1 |
#endif |
35 |
|
|
|
36 |
|
|
COMMON /CG3D_R/ |
37 |
|
|
& aW3d, aS3d, aV3d, |
38 |
|
|
& aC3d, |
39 |
|
|
& zMC, zML, zMU, |
40 |
|
|
& cg3dNorm |
41 |
|
|
_RS aW3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
42 |
|
|
_RS aS3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
43 |
|
|
_RS aV3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
44 |
|
|
_RS aC3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
45 |
|
|
_RS zMC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
46 |
|
|
_RS zML (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
47 |
|
|
_RS zMU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
48 |
|
|
_RL cg3dNorm |
49 |
|
|
|
50 |
|
|
C-- COMMON /CG3D_WK_R/ Work array common block |
51 |
|
|
C cg3d_q - Intermediate matrix-vector product term |
52 |
|
|
C cg3d_r - idem |
53 |
|
|
C cg3d_s - idem |
54 |
|
|
COMMON /CG3D_WK_R/ |
55 |
|
|
& cg3d_q, cg3d_r, cg3d_s |
56 |
|
|
_RL cg3d_q(1-1 :sNx+1 ,1-1 :sNy+1 ,Nr,nSx,nSy) |
57 |
|
|
_RL cg3d_r(1-1 :sNx+1 ,1-1 :sNy+1 ,Nr,nSx,nSy) |
58 |
|
|
_RL cg3d_s(1-1 :sNx+1 ,1-1 :sNy+1 ,Nr,nSx,nSy) |
59 |
|
|
|
60 |
|
|
#ifdef ALLOW_PETSC |
61 |
|
|
COMMON /CG3D_PETSC_DOFS_RS/ |
62 |
|
|
& cg3d_petsc_dofs, cg3d_petsc_color |
63 |
|
|
_RS cg3d_petsc_dofs |
64 |
|
|
& (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
65 |
|
|
_RS cg3d_petsc_color |
66 |
|
|
& (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
67 |
|
|
|
68 |
|
|
COMMON /CG3D_PETSC_DOFS_I/ |
69 |
|
|
& cg3d_dofs_process, cg3d_color_rank |
70 |
|
|
INTEGER cg3d_dofs_process (0:nPx*nPy*MAX_CG3D_PETSC_CPUINVERT-1) |
71 |
|
|
INTEGER cg3d_color_rank ( MAX_CG3D_PETSC_CPUINVERT ) |
72 |
|
|
|
73 |
|
|
#endif |
74 |
|
|
|
75 |
|
|
|
76 |
|
|
#endif /* ALLOW_NONHYDROSTATIC */ |