1 |
C $Header: /u/gcmpack/MITgcm/eesupp/src/exch_uv_xyz_rx.template,v 1.6 2006/08/23 15:20:37 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_EEOPTIONS.h" |
6 |
|
7 |
CBOP |
8 |
|
9 |
C !ROUTINE: EXCH_UV_XYZ_RX |
10 |
|
11 |
C !INTERFACE: |
12 |
SUBROUTINE EXCH_UV_XYZ_RX( |
13 |
U Uphi, Vphi, |
14 |
I withSigns, myThid ) |
15 |
|
16 |
C !DESCRIPTION: |
17 |
C *==========================================================* |
18 |
C | SUBROUTINE EXCH_UV_XYZ_RX |
19 |
C | o Handle exchanges for _RX, 3-dimensional vector arrays. |
20 |
C *==========================================================* |
21 |
C | Vector arrays need to be rotated and interchaged for |
22 |
C | exchange operations on some grids. This driver routine |
23 |
C | branches to support this. |
24 |
C *==========================================================* |
25 |
|
26 |
C !USES: |
27 |
IMPLICIT NONE |
28 |
C === Global data === |
29 |
#include "SIZE.h" |
30 |
#include "EEPARAMS.h" |
31 |
#include "EESUPPORT.h" |
32 |
#include "EXCH.h" |
33 |
|
34 |
C !INPUT/OUTPUT PARAMETERS: |
35 |
C === Routine arguments === |
36 |
C phi :: Array with overlap regions are to be exchanged |
37 |
C Note - The interface to EXCH_RX assumes that |
38 |
C the standard Fortran 77 sequence association rules |
39 |
C apply. |
40 |
C myThid :: My thread id. |
41 |
_RX Uphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
42 |
_RX Vphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
43 |
LOGICAL withSigns |
44 |
INTEGER myThid |
45 |
|
46 |
C !LOCAL VARIABLES: |
47 |
C == Local variables == |
48 |
C OL[wens] :: Overlap extents in west, east, north, south. |
49 |
C exchWidth[XY] :: Extent of regions that will be exchanged. |
50 |
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY, myNz |
51 |
|
52 |
CEOP |
53 |
#ifdef ALLOW_EXCH2 |
54 |
CALL EXCH2_UV_3D_RX( |
55 |
U Uphi, Vphi, |
56 |
I withSigns, Nr, myThid ) |
57 |
RETURN |
58 |
#else |
59 |
|
60 |
OLw = OLx |
61 |
OLe = OLx |
62 |
OLn = OLy |
63 |
OLs = OLy |
64 |
exchWidthX = OLx |
65 |
exchWidthY = OLy |
66 |
myNz = Nr |
67 |
C ** NOTE ** The exchange routine we use here does not |
68 |
C require the preceeding and following barriers. |
69 |
C However, the slow, simple exchange interface |
70 |
C that is calling it here is meant to ensure |
71 |
C that threads are synchronised before exchanges |
72 |
C begine. |
73 |
IF (useCubedSphereExchange) THEN |
74 |
CALL EXCH_UV_RX_CUBE( Uphi, Vphi, withSigns, |
75 |
I OLw, OLe, OLs, OLn, myNz, |
76 |
I exchWidthX, exchWidthY, |
77 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
78 |
ELSE |
79 |
c CALL EXCH_RX( Uphi, |
80 |
c I OLw, OLe, OLs, OLn, myNz, |
81 |
c I exchWidthX, exchWidthY, |
82 |
c I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
83 |
c CALL EXCH_RX( Vphi, |
84 |
c I OLw, OLe, OLs, OLn, myNz, |
85 |
c I exchWidthX, exchWidthY, |
86 |
c I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
87 |
c_jmc: for JAM compatibility, replace the 2 CALLs above by the 2 CPP_MACROs: |
88 |
_EXCH_XYZ_RX( Uphi, myThid ) |
89 |
_EXCH_XYZ_RX( Vphi, myThid ) |
90 |
ENDIF |
91 |
|
92 |
RETURN |
93 |
#endif |
94 |
END |
95 |
|
96 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
97 |
|
98 |
CEH3 ;;; Local Variables: *** |
99 |
CEH3 ;;; mode:fortran *** |
100 |
CEH3 ;;; End: *** |