1 |
C $Header: /u/gcmpack/models/MITgcmUV/eesupp/src/exch_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_XY_RX |
9 |
|
10 |
C !INTERFACE: |
11 |
SUBROUTINE EXCH_XY_RX( |
12 |
U phi, |
13 |
I myThid ) |
14 |
IMPLICIT NONE |
15 |
C !DESCRIPTION: |
16 |
C *==========================================================* |
17 |
C | SUBROUTINE EXCH_XY_RX |
18 |
C | o Handle exchanges for _RX two-dimensional scalar arrays. |
19 |
C *==========================================================* |
20 |
C | Invoke appropriate exchange for a scalar array for either |
21 |
C | global grid, or cube sphere grid. |
22 |
C *==========================================================* |
23 |
|
24 |
C !USES: |
25 |
C === Global data === |
26 |
#include "SIZE.h" |
27 |
#include "EEPARAMS.h" |
28 |
#include "EESUPPORT.h" |
29 |
|
30 |
C !INPUT/OUTPUT PARAMETERS: |
31 |
C === Routine arguments === |
32 |
C phi :: Array with overlap regions are to be exchanged |
33 |
C myThid :: My thread id. |
34 |
_RX phi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
35 |
INTEGER myThid |
36 |
|
37 |
C !LOCAL VARIABLES: |
38 |
C == Local variables == |
39 |
C OL[wens] :: Overlap extents in west, east, north, south. |
40 |
C exchWidth[XY] :: Extent of regions that will be exchanged. |
41 |
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY, myNz |
42 |
CEOP |
43 |
|
44 |
OLw = OLx |
45 |
OLe = OLx |
46 |
OLn = OLy |
47 |
OLs = OLy |
48 |
exchWidthX = OLx |
49 |
exchWidthY = OLy |
50 |
myNz = 1 |
51 |
C ** NOTE ** The exchange routine we use here does not |
52 |
C require the preceeding and following barriers. |
53 |
C However, the slow, simple exchange interface |
54 |
C that is calling it here is meant to ensure |
55 |
C that threads are synchronised before exchanges |
56 |
C begine. |
57 |
IF (useCubedSphereExchange) THEN |
58 |
CALL EXCH_RX_CUBE( phi, |
59 |
I OLw, OLe, OLs, OLn, myNz, |
60 |
I exchWidthX, exchWidthY, |
61 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
62 |
ELSE |
63 |
CALL EXCH_RX( phi, |
64 |
I OLw, OLe, OLs, OLn, myNz, |
65 |
I exchWidthX, exchWidthY, |
66 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
67 |
ENDIF |
68 |
|
69 |
RETURN |
70 |
END |