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