1 |
C $Header: /u/gcmpack/MITgcm/eesupp/src/exch_uv_3d_rx.template,v 1.5 2010/05/19 01:53:46 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_EEOPTIONS.h" |
6 |
#ifdef ALLOW_EXCH2 |
7 |
#include "W2_OPTIONS.h" |
8 |
#endif |
9 |
|
10 |
CBOP |
11 |
C !ROUTINE: EXCH_UV_3D_RX |
12 |
|
13 |
C !INTERFACE: |
14 |
SUBROUTINE EXCH_UV_3D_RX( |
15 |
U uPhi, vPhi, |
16 |
I withSigns, myNz, myThid ) |
17 |
|
18 |
C !DESCRIPTION: |
19 |
C *==========================================================* |
20 |
C | SUBROUTINE EXCH_UV_3D_RX |
21 |
C | o Handle exchanges for _RX, 3-dimensional vector arrays. |
22 |
C *==========================================================* |
23 |
C | Vector arrays need to be rotated and interchaged for |
24 |
C | exchange operations on some grids. This driver routine |
25 |
C | branches to support this. |
26 |
C *==========================================================* |
27 |
|
28 |
C !USES: |
29 |
IMPLICIT NONE |
30 |
|
31 |
C === Global data === |
32 |
#include "SIZE.h" |
33 |
#include "EEPARAMS.h" |
34 |
|
35 |
C !INPUT/OUTPUT PARAMETERS: |
36 |
C === Routine arguments === |
37 |
C uPhi :: 2 components of a vector field with overlap regions |
38 |
C vPhi :: to be exchanged |
39 |
C withSigns :: Flag controlling whether vector is signed. |
40 |
C myNz :: 3rd dimension of array to exchange |
41 |
C myThid :: my Thread Id. number |
42 |
INTEGER myNz |
43 |
_RX uPhi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,nSx,nSy) |
44 |
_RX vPhi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,nSx,nSy) |
45 |
LOGICAL withSigns |
46 |
INTEGER myThid |
47 |
|
48 |
C !LOCAL VARIABLES: |
49 |
#ifndef ALLOW_EXCH2 |
50 |
C == Local variables == |
51 |
C OL[wens] :: Overlap extents in west, east, north, south. |
52 |
C exchWidth[XY] :: Extent of regions that will be exchanged. |
53 |
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY |
54 |
#endif |
55 |
CEOP |
56 |
|
57 |
#ifdef ALLOW_EXCH2 |
58 |
#ifdef W2_USE_R1_ONLY |
59 |
CALL EXCH2_UV_CGRID_3D_RX( |
60 |
U uPhi, vPhi, |
61 |
I withSigns, myNz, myThid ) |
62 |
#else |
63 |
CALL EXCH2_UV_3D_RX( |
64 |
U uPhi, vPhi, |
65 |
I withSigns, myNz, myThid ) |
66 |
#endif |
67 |
#else /* ALLOW_EXCH2 */ |
68 |
|
69 |
OLw = OLx |
70 |
OLe = OLx |
71 |
OLn = OLy |
72 |
OLs = OLy |
73 |
exchWidthX = OLx |
74 |
exchWidthY = OLy |
75 |
IF (useCubedSphereExchange) THEN |
76 |
CALL EXCH1_UV_RX_CUBE( uPhi, vPhi, withSigns, |
77 |
I OLw, OLe, OLs, OLn, myNz, |
78 |
I exchWidthX, exchWidthY, |
79 |
I EXCH_UPDATE_CORNERS, myThid ) |
80 |
ELSE |
81 |
#ifdef DISCONNECTED_TILES |
82 |
CALL EXCH0_RX( uPhi, |
83 |
I OLw, OLe, OLs, OLn, myNz, |
84 |
I exchWidthX, exchWidthY, |
85 |
I EXCH_UPDATE_CORNERS, myThid ) |
86 |
CALL EXCH0_RX( vPhi, |
87 |
I OLw, OLe, OLs, OLn, myNz, |
88 |
I exchWidthX, exchWidthY, |
89 |
I EXCH_UPDATE_CORNERS, myThid ) |
90 |
#else /* DISCONNECTED_TILES */ |
91 |
CALL EXCH1_RX( uPhi, |
92 |
I OLw, OLe, OLs, OLn, myNz, |
93 |
I exchWidthX, exchWidthY, |
94 |
I EXCH_UPDATE_CORNERS, myThid ) |
95 |
CALL EXCH1_RX( vPhi, |
96 |
I OLw, OLe, OLs, OLn, myNz, |
97 |
I exchWidthX, exchWidthY, |
98 |
I EXCH_UPDATE_CORNERS, myThid ) |
99 |
#endif /* DISCONNECTED_TILES */ |
100 |
ENDIF |
101 |
|
102 |
#endif /* ALLOW_EXCH2 */ |
103 |
|
104 |
RETURN |
105 |
END |
106 |
|
107 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
108 |
|
109 |
CEH3 ;;; Local Variables: *** |
110 |
CEH3 ;;; mode:fortran *** |
111 |
CEH3 ;;; End: *** |