1 |
jmc |
1.2 |
C $Header: /u/gcmpack/MITgcm/eesupp/src/exch_s3d_rx.template,v 1.1 2005/11/07 02:14:50 jmc Exp $ |
2 |
jmc |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "PACKAGES_CONFIG.h" |
5 |
|
|
#include "CPP_EEOPTIONS.h" |
6 |
jmc |
1.2 |
|
7 |
jmc |
1.1 |
CBOP |
8 |
|
|
C !ROUTINE: EXCH_S3D_RX |
9 |
|
|
|
10 |
|
|
C !INTERFACE: |
11 |
|
|
SUBROUTINE EXCH_S3D_RX( |
12 |
|
|
U phi, |
13 |
jmc |
1.2 |
I myNz, myThid ) |
14 |
jmc |
1.1 |
|
15 |
|
|
C !DESCRIPTION: |
16 |
|
|
C *==========================================================* |
17 |
|
|
C | SUBROUTINE EXCH_S3D_RX |
18 |
|
|
C | o Handle Simple exchanges (= that ignore corners) |
19 |
|
|
C | for _RX, 3-dim scalar arrays with overlap size = 1 |
20 |
|
|
C *==========================================================* |
21 |
|
|
C | Invoke appropriate exchange routine depending on type |
22 |
|
|
C | of grid (cube or globally indexed) to be operated on. |
23 |
|
|
C *==========================================================* |
24 |
|
|
|
25 |
|
|
C !USES: |
26 |
jmc |
1.2 |
IMPLICIT NONE |
27 |
jmc |
1.1 |
C === Global data === |
28 |
|
|
#include "SIZE.h" |
29 |
|
|
#include "EEPARAMS.h" |
30 |
|
|
#include "EESUPPORT.h" |
31 |
|
|
#include "EXCH.h" |
32 |
|
|
|
33 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
34 |
|
|
C === Routine arguments === |
35 |
|
|
C phi :: Array with overlap regions are to be exchanged |
36 |
jmc |
1.2 |
C myNz :: 3rd dimension of array to exchange |
37 |
jmc |
1.1 |
C myThid :: My thread id. |
38 |
jmc |
1.2 |
INTEGER myNz |
39 |
|
|
_RX phi(0:sNx+1,0:sNy+1,myNz,nSx,nSy) |
40 |
jmc |
1.1 |
INTEGER myThid |
41 |
|
|
|
42 |
|
|
C !LOCAL VARIABLES: |
43 |
|
|
C == Local variables == |
44 |
|
|
C OL[wens] :: Overlap extents in west, east, north, south. |
45 |
|
|
C exchWidth[XY] :: Extent of regions that will be exchanged. |
46 |
jmc |
1.2 |
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY |
47 |
jmc |
1.1 |
|
48 |
|
|
CEOP |
49 |
|
|
|
50 |
|
|
#ifdef ALLOW_EXCH2 |
51 |
jmc |
1.2 |
CALL EXCH2_S3D_RX( phi, myNz, myThid ) |
52 |
jmc |
1.1 |
RETURN |
53 |
|
|
#endif |
54 |
|
|
|
55 |
|
|
OLw = 1 |
56 |
|
|
OLe = 1 |
57 |
|
|
OLn = 1 |
58 |
|
|
OLs = 1 |
59 |
|
|
exchWidthX = 1 |
60 |
|
|
exchWidthY = 1 |
61 |
|
|
C ** NOTE ** The exchange routine we use here does not |
62 |
|
|
C require the preceeding and following barriers. |
63 |
|
|
C However, the slow, simple exchange interface |
64 |
|
|
C that is calling it here is meant to ensure |
65 |
|
|
C that threads are synchronised before exchanges |
66 |
|
|
C begine. |
67 |
|
|
IF (useCubedSphereExchange) THEN |
68 |
|
|
CALL EXCH_RX_CUBE( phi, |
69 |
|
|
I OLw, OLe, OLs, OLn, myNz, |
70 |
|
|
I exchWidthX, exchWidthY, |
71 |
|
|
I FORWARD_SIMULATION, EXCH_IGNORE_CORNERS, myThid ) |
72 |
|
|
ELSE |
73 |
|
|
CALL EXCH_RX( phi, |
74 |
|
|
I OLw, OLe, OLs, OLn, myNz, |
75 |
|
|
I exchWidthX, exchWidthY, |
76 |
|
|
I FORWARD_SIMULATION, EXCH_IGNORE_CORNERS, myThid ) |
77 |
|
|
ENDIF |
78 |
|
|
|
79 |
|
|
RETURN |
80 |
|
|
END |