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