1 |
C $Header: /u/gcmpack/MITgcm/eesupp/src/exch_xyz_rx.template,v 1.10 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_XYZ_RX |
9 |
|
10 |
C !INTERFACE: |
11 |
SUBROUTINE EXCH_XYZ_RX( |
12 |
U phi, |
13 |
I myThid ) |
14 |
|
15 |
C !DESCRIPTION: |
16 |
C *==========================================================* |
17 |
C | SUBROUTINE EXCH_XYZ_RX |
18 |
C | o Handle exchanges for _RX, three-dim scalar arrays. |
19 |
C *==========================================================* |
20 |
C | Invoke appropriate exchange routine depending on type |
21 |
C | of grid (cube or globally indexed) to be operated on. |
22 |
C *==========================================================* |
23 |
|
24 |
C !USES: |
25 |
IMPLICIT NONE |
26 |
|
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 myThid :: My thread id. |
35 |
_RX phi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy) |
36 |
INTEGER myThid |
37 |
|
38 |
C !LOCAL VARIABLES: |
39 |
#ifndef ALLOW_EXCH2 |
40 |
C == Local variables == |
41 |
C OL[wens] :: Overlap extents in west, east, north, south. |
42 |
C exchWidth[XY] :: Extent of regions that will be exchanged. |
43 |
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY, myNz |
44 |
#endif |
45 |
CEOP |
46 |
|
47 |
#ifdef ALLOW_EXCH2 |
48 |
CALL EXCH2_3D_RX( phi, Nr, myThid ) |
49 |
#else /* ALLOW_EXCH2 */ |
50 |
|
51 |
OLw = OLx |
52 |
OLe = OLx |
53 |
OLn = OLy |
54 |
OLs = OLy |
55 |
exchWidthX = OLx |
56 |
exchWidthY = OLy |
57 |
myNz = Nr |
58 |
IF (useCubedSphereExchange) THEN |
59 |
CALL EXCH1_RX_CUBE( phi, .FALSE., |
60 |
I OLw, OLe, OLs, OLn, myNz, |
61 |
I exchWidthX, exchWidthY, |
62 |
I EXCH_UPDATE_CORNERS, myThid ) |
63 |
ELSE |
64 |
#ifdef DISCONNECTED_TILES |
65 |
CALL EXCH0_RX( phi, |
66 |
I OLw, OLe, OLs, OLn, myNz, |
67 |
I exchWidthX, exchWidthY, |
68 |
I EXCH_UPDATE_CORNERS, myThid ) |
69 |
#else /* DISCONNECTED_TILES */ |
70 |
CALL EXCH1_RX( phi, |
71 |
I OLw, OLe, OLs, OLn, myNz, |
72 |
I exchWidthX, exchWidthY, |
73 |
I EXCH_UPDATE_CORNERS, myThid ) |
74 |
#endif /* DISCONNECTED_TILES */ |
75 |
ENDIF |
76 |
|
77 |
#endif /* ALLOW_EXCH2 */ |
78 |
|
79 |
RETURN |
80 |
END |