1 |
C $Header: /u/gcmpack/MITgcm/eesupp/src/exch_s3d_rx.template,v 1.5 2010/05/19 01:53:46 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 |
|
31 |
C !INPUT/OUTPUT PARAMETERS: |
32 |
C === Routine arguments === |
33 |
C phi :: Array with overlap regions are to be exchanged |
34 |
C myNz :: 3rd dimension of array to exchange |
35 |
C myThid :: My thread id. |
36 |
INTEGER myNz |
37 |
_RX phi(0:sNx+1,0:sNy+1,myNz,nSx,nSy) |
38 |
INTEGER myThid |
39 |
|
40 |
C !LOCAL VARIABLES: |
41 |
#ifndef ALLOW_EXCH2 |
42 |
C == Local variables == |
43 |
C OL[wens] :: Overlap extents in west, east, north, south. |
44 |
C exchWidth[XY] :: Extent of regions that will be exchanged. |
45 |
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY |
46 |
#endif |
47 |
CEOP |
48 |
|
49 |
#ifdef ALLOW_EXCH2 |
50 |
CALL EXCH2_S3D_RX( phi, myNz, myThid ) |
51 |
#else /* ALLOW_EXCH2 */ |
52 |
|
53 |
OLw = 1 |
54 |
OLe = 1 |
55 |
OLn = 1 |
56 |
OLs = 1 |
57 |
exchWidthX = 1 |
58 |
exchWidthY = 1 |
59 |
IF (useCubedSphereExchange) THEN |
60 |
CALL EXCH1_RX_CUBE( phi, .FALSE., |
61 |
I OLw, OLe, OLs, OLn, myNz, |
62 |
I exchWidthX, exchWidthY, |
63 |
I EXCH_IGNORE_CORNERS, myThid ) |
64 |
ELSE |
65 |
#ifdef DISCONNECTED_TILES |
66 |
CALL EXCH0_RX( phi, |
67 |
I OLw, OLe, OLs, OLn, myNz, |
68 |
I exchWidthX, exchWidthY, |
69 |
I EXCH_IGNORE_CORNERS, myThid ) |
70 |
#else /* DISCONNECTED_TILES */ |
71 |
CALL EXCH1_RX( phi, |
72 |
I OLw, OLe, OLs, OLn, myNz, |
73 |
I exchWidthX, exchWidthY, |
74 |
I EXCH_IGNORE_CORNERS, myThid ) |
75 |
#endif /* DISCONNECTED_TILES */ |
76 |
ENDIF |
77 |
|
78 |
#endif /* ALLOW_EXCH2 */ |
79 |
|
80 |
RETURN |
81 |
END |