1 |
C $Header: /u/gcmpack/MITgcm/eesupp/src/exch_z_3d_rx.template,v 1.4 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_Z_3D_RX |
9 |
|
10 |
C !INTERFACE: |
11 |
SUBROUTINE EXCH_Z_3D_RX( |
12 |
U phi, |
13 |
I myNz, myThid ) |
14 |
IMPLICIT NONE |
15 |
C !DESCRIPTION: |
16 |
C *==========================================================* |
17 |
C | SUBROUTINE EXCH_Z_3D_RX |
18 |
C | o Handle exchanges for _RX, 3-dim, zeta coord arrays. |
19 |
C *==========================================================* |
20 |
C | Branch to appropriate exchange routine for a zeta coord |
21 |
C | array on the current grid scheme. |
22 |
C *==========================================================* |
23 |
|
24 |
C !USES: |
25 |
C == Global variables == |
26 |
#include "SIZE.h" |
27 |
#include "EEPARAMS.h" |
28 |
|
29 |
C !INPUT/OUTPUT PARAMETERS: |
30 |
C == Routine arguments == |
31 |
C phi :: Array with overlap regions are to be exchanged |
32 |
C Note - The interface to EXCH_RX assumes that |
33 |
C the standard Fortran 77 sequence association rules |
34 |
C apply. |
35 |
C myNz :: 3rd dimension of array to exchange |
36 |
C myThid :: My thread id. |
37 |
INTEGER myNz |
38 |
_RX phi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,nSx,nSy) |
39 |
INTEGER myThid |
40 |
|
41 |
C !LOCAL VARIABLES: |
42 |
#ifndef ALLOW_EXCH2 |
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 |
#endif |
48 |
CEOP |
49 |
|
50 |
#ifdef ALLOW_EXCH2 |
51 |
CALL EXCH2_Z_3D_RX( |
52 |
U phi, |
53 |
I myNz, myThid ) |
54 |
#else /* ALLOW_EXCH2 */ |
55 |
|
56 |
OLw = OLx |
57 |
OLe = OLx |
58 |
OLn = OLy |
59 |
OLs = OLy |
60 |
exchWidthX = OLx |
61 |
exchWidthY = OLy |
62 |
IF (useCubedSphereExchange) THEN |
63 |
CALL EXCH1_Z_RX_CUBE( phi, .FALSE., |
64 |
I OLw, OLe, OLs, OLn, myNz, |
65 |
I exchWidthX, exchWidthY, |
66 |
I EXCH_UPDATE_CORNERS, myThid ) |
67 |
ELSE |
68 |
#ifdef DISCONNECTED_TILES |
69 |
CALL EXCH0_RX( phi, |
70 |
I OLw, OLe, OLs, OLn, myNz, |
71 |
I exchWidthX, exchWidthY, |
72 |
I EXCH_UPDATE_CORNERS, myThid ) |
73 |
#else /* DISCONNECTED_TILES */ |
74 |
CALL EXCH1_RX( phi, |
75 |
I OLw, OLe, OLs, OLn, myNz, |
76 |
I exchWidthX, exchWidthY, |
77 |
I EXCH_UPDATE_CORNERS, myThid ) |
78 |
#endif /* DISCONNECTED_TILES */ |
79 |
ENDIF |
80 |
|
81 |
#endif /* ALLOW_EXCH2 */ |
82 |
|
83 |
RETURN |
84 |
END |