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