1 |
C $Header: /u/gcmpack/MITgcm/eesupp/src/exch_s3d_rx.template,v 1.2 2006/08/23 15:18:47 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_EEOPTIONS.h" |
6 |
|
7 |
CBOP |
8 |
C !ROUTINE: EXCH_S3D_RX |
9 |
|
10 |
C !INTERFACE: |
11 |
SUBROUTINE EXCH_S3D_RX( |
12 |
U phi, |
13 |
I myNz, myThid ) |
14 |
|
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 |
IMPLICIT NONE |
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 myNz :: 3rd dimension of array to exchange |
37 |
C myThid :: My thread id. |
38 |
INTEGER myNz |
39 |
_RX phi(0:sNx+1,0:sNy+1,myNz,nSx,nSy) |
40 |
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 |
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY |
47 |
|
48 |
CEOP |
49 |
|
50 |
#ifdef ALLOW_EXCH2 |
51 |
CALL EXCH2_S3D_RX( phi, myNz, myThid ) |
52 |
RETURN |
53 |
#else |
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 |
#endif |
81 |
END |