1 |
C $Header: /u/gcmpack/MITgcm/eesupp/src/exch_z_xy_rx.template,v 1.7 2006/11/17 22:35:03 heimbach Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_EEOPTIONS.h" |
6 |
|
7 |
CBOP |
8 |
C !ROUTINE: EXCH_Z_XY_RX |
9 |
|
10 |
C !INTERFACE: |
11 |
SUBROUTINE EXCH_Z_XY_RX( |
12 |
U phi, |
13 |
I myThid ) |
14 |
IMPLICIT NONE |
15 |
|
16 |
C !DESCRIPTION: |
17 |
C *==========================================================* |
18 |
C | SUBROUTINE EXCH_Z_XY_RX |
19 |
C | o Handle exchanges for _RX, 2-dim zeta coord array. |
20 |
C *==========================================================* |
21 |
C | Branch to correct exchange for particular grid operating |
22 |
C | on a zeta coord array. |
23 |
C *==========================================================* |
24 |
|
25 |
C !USES: |
26 |
C == Global variables == |
27 |
#include "SIZE.h" |
28 |
#include "EEPARAMS.h" |
29 |
#include "EESUPPORT.h" |
30 |
#include "EXCH.h" |
31 |
|
32 |
C !INPUT/OUTPUT PARAMETERS: |
33 |
C == Routine arguments == |
34 |
C phi :: Array with overlap regions are to be exchanged |
35 |
C Note - The interface to EXCH_RL assumes that |
36 |
C the standard Fortran 77 sequence association rules |
37 |
C apply. |
38 |
C myThid :: My thread id. |
39 |
_RX phi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,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, myNz |
47 |
CEOP |
48 |
|
49 |
#ifdef ALLOW_EXCH2 |
50 |
CALL EXCH2_Z_3D_RX( phi, 1, myThid ) |
51 |
RETURN |
52 |
#else |
53 |
|
54 |
OLw = OLx |
55 |
OLe = OLx |
56 |
OLn = OLy |
57 |
OLs = OLy |
58 |
exchWidthX = OLx |
59 |
exchWidthY = OLy |
60 |
myNz = 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_Z_RX_CUBE( phi, |
69 |
I OLw, OLe, OLs, OLn, myNz, |
70 |
I exchWidthX, exchWidthY, |
71 |
I FORWARD_SIMULATION, EXCH_UPDATE_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_UPDATE_CORNERS, myThid ) |
77 |
ENDIF |
78 |
|
79 |
RETURN |
80 |
#endif |
81 |
END |