1 |
jmc |
1.10 |
C $Header: /u/gcmpack/MITgcm/eesupp/src/exch_xy_rx.template,v 1.9 2010/05/19 01:53:46 jmc Exp $ |
2 |
cnh |
1.3 |
C $Name: $ |
3 |
adcroft |
1.2 |
|
4 |
jmc |
1.5 |
#include "PACKAGES_CONFIG.h" |
5 |
adcroft |
1.2 |
#include "CPP_EEOPTIONS.h" |
6 |
|
|
|
7 |
cnh |
1.3 |
CBOP |
8 |
|
|
|
9 |
|
|
C !ROUTINE: EXCH_XY_RX |
10 |
|
|
|
11 |
|
|
C !INTERFACE: |
12 |
jmc |
1.8 |
SUBROUTINE EXCH_XY_RX( |
13 |
|
|
U phi, |
14 |
adcroft |
1.2 |
I myThid ) |
15 |
jmc |
1.9 |
|
16 |
cnh |
1.3 |
C !DESCRIPTION: |
17 |
|
|
C *==========================================================* |
18 |
jmc |
1.8 |
C | SUBROUTINE EXCH_XY_RX |
19 |
cnh |
1.3 |
C | o Handle exchanges for _RX two-dimensional scalar arrays. |
20 |
|
|
C *==========================================================* |
21 |
jmc |
1.9 |
C | Invoke appropriate exchange routine depending on type |
22 |
|
|
C | of grid (cube or globally indexed) to be operated on. |
23 |
cnh |
1.3 |
C *==========================================================* |
24 |
adcroft |
1.2 |
|
25 |
cnh |
1.3 |
C !USES: |
26 |
jmc |
1.9 |
IMPLICIT NONE |
27 |
|
|
|
28 |
adcroft |
1.2 |
C === Global data === |
29 |
|
|
#include "SIZE.h" |
30 |
|
|
#include "EEPARAMS.h" |
31 |
|
|
|
32 |
cnh |
1.3 |
C !INPUT/OUTPUT PARAMETERS: |
33 |
adcroft |
1.2 |
C === Routine arguments === |
34 |
cnh |
1.3 |
C phi :: Array with overlap regions are to be exchanged |
35 |
|
|
C myThid :: My thread id. |
36 |
adcroft |
1.2 |
_RX phi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
37 |
|
|
INTEGER myThid |
38 |
|
|
|
39 |
cnh |
1.3 |
C !LOCAL VARIABLES: |
40 |
jmc |
1.8 |
#ifndef ALLOW_EXCH2 |
41 |
adcroft |
1.2 |
C == Local variables == |
42 |
cnh |
1.3 |
C OL[wens] :: Overlap extents in west, east, north, south. |
43 |
|
|
C exchWidth[XY] :: Extent of regions that will be exchanged. |
44 |
adcroft |
1.2 |
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY, myNz |
45 |
jmc |
1.8 |
#endif |
46 |
cnh |
1.3 |
CEOP |
47 |
adcroft |
1.2 |
|
48 |
jmc |
1.5 |
#ifdef ALLOW_EXCH2 |
49 |
jmc |
1.9 |
CALL EXCH2_3D_RX( phi, 1, myThid ) |
50 |
jmc |
1.8 |
#else /* ALLOW_EXCH2 */ |
51 |
jmc |
1.5 |
|
52 |
adcroft |
1.2 |
OLw = OLx |
53 |
|
|
OLe = OLx |
54 |
|
|
OLn = OLy |
55 |
|
|
OLs = OLy |
56 |
|
|
exchWidthX = OLx |
57 |
|
|
exchWidthY = OLy |
58 |
|
|
myNz = 1 |
59 |
|
|
IF (useCubedSphereExchange) THEN |
60 |
jmc |
1.9 |
CALL EXCH1_RX_CUBE( phi, .FALSE., |
61 |
adcroft |
1.2 |
I OLw, OLe, OLs, OLn, myNz, |
62 |
|
|
I exchWidthX, exchWidthY, |
63 |
jmc |
1.9 |
I EXCH_UPDATE_CORNERS, myThid ) |
64 |
adcroft |
1.2 |
ELSE |
65 |
jmc |
1.10 |
#ifdef DISCONNECTED_TILES |
66 |
|
|
CALL EXCH0_RX( phi, |
67 |
|
|
I OLw, OLe, OLs, OLn, myNz, |
68 |
|
|
I exchWidthX, exchWidthY, |
69 |
|
|
I EXCH_UPDATE_CORNERS, myThid ) |
70 |
|
|
#else /* DISCONNECTED_TILES */ |
71 |
jmc |
1.9 |
CALL EXCH1_RX( phi, |
72 |
adcroft |
1.2 |
I OLw, OLe, OLs, OLn, myNz, |
73 |
|
|
I exchWidthX, exchWidthY, |
74 |
jmc |
1.9 |
I EXCH_UPDATE_CORNERS, myThid ) |
75 |
jmc |
1.10 |
#endif /* DISCONNECTED_TILES */ |
76 |
adcroft |
1.2 |
ENDIF |
77 |
|
|
|
78 |
jmc |
1.10 |
#endif /* ALLOW_EXCH2 */ |
79 |
|
|
|
80 |
adcroft |
1.2 |
RETURN |
81 |
|
|
END |
82 |
jmc |
1.5 |
|
83 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
84 |
|
|
|
85 |
|
|
CEH3 ;;; Local Variables: *** |
86 |
|
|
CEH3 ;;; mode:fortran *** |
87 |
|
|
CEH3 ;;; End: *** |