1 |
C $Header: /u/gcmpack/MITgcm/eesupp/src/exch_z_xy_rx.template,v 1.3 2001/09/21 03:55:50 cnh 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 |
#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 |
OLw = OLx |
50 |
OLe = OLx |
51 |
OLn = OLy |
52 |
OLs = OLy |
53 |
exchWidthX = OLx |
54 |
exchWidthY = OLy |
55 |
myNz = 1 |
56 |
C ** NOTE ** The exchange routine we use here does not |
57 |
C require the preceeding and following barriers. |
58 |
C However, the slow, simple exchange interface |
59 |
C that is calling it here is meant to ensure |
60 |
C that threads are synchronised before exchanges |
61 |
C begine. |
62 |
IF (useCubedSphereExchange) THEN |
63 |
CALL EXCH_Z_RX_CUBE( phi, |
64 |
I OLw, OLe, OLs, OLn, myNz, |
65 |
I exchWidthX, exchWidthY, |
66 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
67 |
ELSE |
68 |
CALL EXCH_RX( phi, |
69 |
I OLw, OLe, OLs, OLn, myNz, |
70 |
I exchWidthX, exchWidthY, |
71 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
72 |
ENDIF |
73 |
|
74 |
RETURN |
75 |
END |