3 |
|
|
4 |
#include "CPP_OPTIONS.h" |
#include "CPP_OPTIONS.h" |
5 |
|
|
6 |
|
CBOP |
7 |
|
C !ROUTINE: CG2D |
8 |
|
C !INTERFACE: |
9 |
SUBROUTINE CG2D( |
SUBROUTINE CG2D( |
10 |
I cg2d_b, |
I cg2d_b, |
11 |
U cg2d_x, |
U cg2d_x, |
13 |
O lastResidual, |
O lastResidual, |
14 |
U numIters, |
U numIters, |
15 |
I myThid ) |
I myThid ) |
16 |
C /==========================================================\ |
C !DESCRIPTION: \bv |
17 |
C | SUBROUTINE CG2D | |
C *==========================================================* |
18 |
C | o Two-dimensional grid problem conjugate-gradient | |
C | SUBROUTINE CG2D |
19 |
C | inverter (with preconditioner). | |
C | o Two-dimensional grid problem conjugate-gradient |
20 |
C |==========================================================| |
C | inverter (with preconditioner). |
21 |
C | Con. grad is an iterative procedure for solving Ax = b. | |
C *==========================================================* |
22 |
C | It requires the A be symmetric. | |
C | Con. grad is an iterative procedure for solving Ax = b. |
23 |
C | This implementation assumes A is a five-diagonal | |
C | It requires the A be symmetric. |
24 |
C | matrix of the form that arises in the discrete | |
C | This implementation assumes A is a five-diagonal |
25 |
C | representation of the del^2 operator in a | |
C | matrix of the form that arises in the discrete |
26 |
C | two-dimensional space. | |
C | representation of the del^2 operator in a |
27 |
C | Notes: | |
C | two-dimensional space. |
28 |
C | ====== | |
C | Notes: |
29 |
C | This implementation can support shared-memory | |
C | ====== |
30 |
C | multi-threaded execution. In order to do this COMMON | |
C | This implementation can support shared-memory |
31 |
C | blocks are used for many of the arrays - even ones that | |
C | multi-threaded execution. In order to do this COMMON |
32 |
C | are only used for intermedaite results. This design is | |
C | blocks are used for many of the arrays - even ones that |
33 |
C | OK if you want to all the threads to collaborate on | |
C | are only used for intermedaite results. This design is |
34 |
C | solving the same problem. On the other hand if you want | |
C | OK if you want to all the threads to collaborate on |
35 |
C | the threads to solve several different problems | |
C | solving the same problem. On the other hand if you want |
36 |
C | concurrently this implementation will not work. | |
C | the threads to solve several different problems |
37 |
C \==========================================================/ |
C | concurrently this implementation will not work. |
38 |
IMPLICIT NONE |
C *==========================================================* |
39 |
|
C \ev |
40 |
|
|
41 |
|
C !USES: |
42 |
|
IMPLICIT NONE |
43 |
C === Global data === |
C === Global data === |
44 |
#include "SIZE.h" |
#include "SIZE.h" |
45 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
48 |
#include "CG2D.h" |
#include "CG2D.h" |
49 |
#include "SURFACE.h" |
#include "SURFACE.h" |
50 |
|
|
51 |
|
C !INPUT/OUTPUT PARAMETERS: |
52 |
C === Routine arguments === |
C === Routine arguments === |
53 |
C myThid - Thread on which I am working. |
C myThid - Thread on which I am working. |
54 |
C cg2d_b - The source term or "right hand side" |
C cg2d_b - The source term or "right hand side" |
64 |
INTEGER numIters |
INTEGER numIters |
65 |
INTEGER myThid |
INTEGER myThid |
66 |
|
|
67 |
|
C !LOCAL VARIABLES: |
68 |
C === Local variables ==== |
C === Local variables ==== |
69 |
C actualIts - Number of iterations taken |
C actualIts - Number of iterations taken |
70 |
C actualResidual - residual |
C actualResidual - residual |
100 |
INTEGER exchWidthX |
INTEGER exchWidthX |
101 |
INTEGER exchWidthY |
INTEGER exchWidthY |
102 |
INTEGER myNz |
INTEGER myNz |
103 |
|
CEOP |
104 |
|
|
105 |
|
|
106 |
CcnhDebugStarts |
CcnhDebugStarts |