1 |
C $Header: /u/gcmpack/models/MITgcmUV/eesupp/src/exch_z_xy_rx.template,v 1.2 2001/05/29 14:01:36 adcroft Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_EEOPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
|
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 |
|
31 |
C !INPUT/OUTPUT PARAMETERS: |
32 |
C == Routine arguments == |
33 |
C phi :: Array with overlap regions are to be exchanged |
34 |
C Note - The interface to EXCH_RL assumes that |
35 |
C the standard Fortran 77 sequence association rules |
36 |
C apply. |
37 |
C myThid :: My thread id. |
38 |
_RX phi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
39 |
INTEGER myThid |
40 |
|
41 |
C !LOCAL VARIABLES: |
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, myNz |
46 |
CEOP |
47 |
|
48 |
OLw = OLx |
49 |
OLe = OLx |
50 |
OLn = OLy |
51 |
OLs = OLy |
52 |
exchWidthX = OLx |
53 |
exchWidthY = OLy |
54 |
myNz = 1 |
55 |
C ** NOTE ** The exchange routine we use here does not |
56 |
C require the preceeding and following barriers. |
57 |
C However, the slow, simple exchange interface |
58 |
C that is calling it here is meant to ensure |
59 |
C that threads are synchronised before exchanges |
60 |
C begine. |
61 |
IF (useCubedSphereExchange) THEN |
62 |
CALL EXCH_Z_RX_CUBE( phi, |
63 |
I OLw, OLe, OLs, OLn, myNz, |
64 |
I exchWidthX, exchWidthY, |
65 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
66 |
ELSE |
67 |
CALL EXCH_RX( phi, |
68 |
I OLw, OLe, OLs, OLn, myNz, |
69 |
I exchWidthX, exchWidthY, |
70 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
71 |
ENDIF |
72 |
|
73 |
RETURN |
74 |
END |