1 |
jmc |
1.3 |
C $Header: /u/gcmpack/MITgcm/eesupp/src/exch_3d_rx.template,v 1.2 2007/08/17 18:34:17 jmc Exp $ |
2 |
jmc |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "PACKAGES_CONFIG.h" |
5 |
|
|
#include "CPP_EEOPTIONS.h" |
6 |
|
|
|
7 |
|
|
CBOP |
8 |
|
|
C !ROUTINE: EXCH_3D_RX |
9 |
|
|
|
10 |
|
|
C !INTERFACE: |
11 |
|
|
SUBROUTINE EXCH_3D_RX( |
12 |
|
|
U phi, |
13 |
|
|
I myNz, myThid ) |
14 |
|
|
|
15 |
|
|
C !DESCRIPTION: |
16 |
|
|
C *==========================================================* |
17 |
|
|
C | SUBROUTINE EXCH_3D_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 |
|
|
C === Global data === |
27 |
|
|
#include "SIZE.h" |
28 |
|
|
#include "EEPARAMS.h" |
29 |
|
|
|
30 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
31 |
|
|
C === Routine arguments === |
32 |
|
|
C phi :: Array with overlap regions are to be exchanged |
33 |
|
|
C myNz :: 3rd dimension of array to exchange |
34 |
|
|
C myThid :: My thread id. |
35 |
|
|
INTEGER myNz |
36 |
|
|
_RX phi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:myNz,nSx,nSy) |
37 |
|
|
INTEGER myThid |
38 |
|
|
|
39 |
|
|
C !LOCAL VARIABLES: |
40 |
jmc |
1.2 |
#ifndef ALLOW_EXCH2 |
41 |
jmc |
1.1 |
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 |
45 |
jmc |
1.2 |
#endif |
46 |
jmc |
1.1 |
CEOP |
47 |
|
|
|
48 |
|
|
#ifdef ALLOW_EXCH2 |
49 |
|
|
CALL EXCH2_3D_RX( phi, myNz, myThid ) |
50 |
|
|
RETURN |
51 |
jmc |
1.2 |
#else /* ALLOW_EXCH2 */ |
52 |
jmc |
1.1 |
|
53 |
|
|
OLw = OLx |
54 |
|
|
OLe = OLx |
55 |
|
|
OLn = OLy |
56 |
|
|
OLs = OLy |
57 |
|
|
exchWidthX = OLx |
58 |
|
|
exchWidthY = OLy |
59 |
|
|
IF (useCubedSphereExchange) THEN |
60 |
jmc |
1.3 |
CALL EXCH1_RX_CUBE( phi, .FALSE., |
61 |
jmc |
1.1 |
I OLw, OLe, OLs, OLn, myNz, |
62 |
|
|
I exchWidthX, exchWidthY, |
63 |
jmc |
1.3 |
I EXCH_UPDATE_CORNERS, myThid ) |
64 |
jmc |
1.1 |
ELSE |
65 |
jmc |
1.3 |
CALL EXCH1_RX( phi, |
66 |
jmc |
1.1 |
I OLw, OLe, OLs, OLn, myNz, |
67 |
|
|
I exchWidthX, exchWidthY, |
68 |
jmc |
1.3 |
I EXCH_UPDATE_CORNERS, myThid ) |
69 |
jmc |
1.1 |
ENDIF |
70 |
|
|
|
71 |
|
|
RETURN |
72 |
jmc |
1.2 |
#endif /* ALLOW_EXCH2 */ |
73 |
jmc |
1.1 |
END |