1 |
C $Header: /u/gcmpack/MITgcm/pkg/exch2/exch2_xyz_rx.template,v 1.4 2005/07/27 01:11:19 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_EEOPTIONS.h" |
5 |
#include "W2_OPTIONS.h" |
6 |
|
7 |
CBOP |
8 |
|
9 |
C !ROUTINE: EXCH2_S3D_RX |
10 |
|
11 |
C !INTERFACE: |
12 |
SUBROUTINE EXCH2_S3D_RX( |
13 |
U phi, |
14 |
I myThid ) |
15 |
IMPLICIT NONE |
16 |
|
17 |
C !DESCRIPTION: |
18 |
C *==========================================================* |
19 |
C | SUBROUTINE EXCH2_S3D_RX |
20 |
C | o Handle Simple exchanges (= that ignore corners) |
21 |
C | for _RX, 3-dim scalar arrays with overlap size = 1 |
22 |
C *==========================================================* |
23 |
C | Invoke appropriate exchange routine depending on type |
24 |
C | of grid (cube or globally indexed) to be operated on. |
25 |
C *==========================================================* |
26 |
|
27 |
C !USES: |
28 |
C === Global data === |
29 |
#include "SIZE.h" |
30 |
#include "EEPARAMS.h" |
31 |
#include "EESUPPORT.h" |
32 |
#include "W2_EXCH2_TOPOLOGY.h" |
33 |
#include "W2_EXCH2_PARAMS.h" |
34 |
|
35 |
C !INPUT/OUTPUT PARAMETERS: |
36 |
C === Routine arguments === |
37 |
C phi :: Array with overlap regions are to be exchanged |
38 |
C myThid :: My thread id. |
39 |
_RX phi(0:sNx+1,0:sNy+1,Nr,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 |
|
48 |
CEOP |
49 |
|
50 |
OLw = 1 |
51 |
OLe = 1 |
52 |
OLn = 1 |
53 |
OLs = 1 |
54 |
exchWidthX = 1 |
55 |
exchWidthY = 1 |
56 |
myNz = Nr |
57 |
C ** NOTE ** The exchange routine we use here does not |
58 |
C require the preceeding and following barriers. |
59 |
C However, the slow, simple exchange interface |
60 |
C that is calling it here is meant to ensure |
61 |
C that threads are synchronised before exchanges |
62 |
C begine. |
63 |
|
64 |
IF (useCubedSphereExchange) THEN |
65 |
|
66 |
CALL EXCH2_RX1_CUBE( phi, 'T ', |
67 |
I OLw, OLe, OLs, OLn, myNz, |
68 |
I exchWidthX, exchWidthY, |
69 |
I FORWARD_SIMULATION, EXCH_IGNORE_CORNERS, myThid ) |
70 |
|
71 |
ELSE |
72 |
|
73 |
CALL EXCH_RX( phi, |
74 |
I OLw, OLe, OLs, OLn, myNz, |
75 |
I exchWidthX, exchWidthY, |
76 |
I FORWARD_SIMULATION, EXCH_IGNORE_CORNERS, myThid ) |
77 |
|
78 |
ENDIF |
79 |
|
80 |
RETURN |
81 |
END |
82 |
|
83 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
84 |
|
85 |
CEH3 ;;; Local Variables: *** |
86 |
CEH3 ;;; mode:fortran *** |
87 |
CEH3 ;;; End: *** |