1 |
jmc |
1.4 |
C $Header: /u/gcmpack/MITgcm/eesupp/src/exch_uv_3d_rx.template,v 1.3 2007/07/25 21:19:44 jmc Exp $ |
2 |
jmc |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "PACKAGES_CONFIG.h" |
5 |
|
|
#include "CPP_EEOPTIONS.h" |
6 |
jmc |
1.3 |
#ifdef ALLOW_EXCH2 |
7 |
|
|
#include "W2_OPTIONS.h" |
8 |
|
|
#endif |
9 |
jmc |
1.1 |
|
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 |
|
|
C === Global data === |
31 |
|
|
#include "SIZE.h" |
32 |
|
|
#include "EEPARAMS.h" |
33 |
jmc |
1.4 |
c#include "EESUPPORT.h" |
34 |
|
|
c#include "EXCH.h" |
35 |
jmc |
1.1 |
|
36 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
37 |
|
|
C === Routine arguments === |
38 |
|
|
C phi :: Array with overlap regions are to be exchanged |
39 |
|
|
C Note - The interface to EXCH_RX assumes that |
40 |
|
|
C the standard Fortran 77 sequence association rules |
41 |
|
|
C apply. |
42 |
|
|
C myNz :: 3rd dimension of array to exchange |
43 |
|
|
C myThid :: My thread id. |
44 |
|
|
INTEGER myNz |
45 |
|
|
_RX Uphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,nSx,nSy) |
46 |
|
|
_RX Vphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,nSx,nSy) |
47 |
|
|
LOGICAL withSigns |
48 |
|
|
INTEGER myThid |
49 |
|
|
|
50 |
|
|
C !LOCAL VARIABLES: |
51 |
jmc |
1.4 |
#ifndef ALLOW_EXCH2 |
52 |
jmc |
1.1 |
C == Local variables == |
53 |
|
|
C OL[wens] :: Overlap extents in west, east, north, south. |
54 |
|
|
C exchWidth[XY] :: Extent of regions that will be exchanged. |
55 |
|
|
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY |
56 |
jmc |
1.4 |
#endif |
57 |
|
|
CEOP |
58 |
jmc |
1.1 |
|
59 |
|
|
#ifdef ALLOW_EXCH2 |
60 |
jmc |
1.3 |
#ifdef W2_USE_R1_ONLY |
61 |
|
|
CALL EXCH2_UV_CGRID_3D_RX( |
62 |
|
|
U Uphi, Vphi, |
63 |
|
|
I withSigns, myNz, myThid ) |
64 |
|
|
#else |
65 |
jmc |
1.1 |
CALL EXCH2_UV_3D_RX( |
66 |
|
|
U Uphi, Vphi, |
67 |
|
|
I withSigns, myNz, myThid ) |
68 |
jmc |
1.3 |
#endif |
69 |
jmc |
1.1 |
RETURN |
70 |
jmc |
1.3 |
#else /* ALLOW_EXCH2 */ |
71 |
jmc |
1.1 |
|
72 |
|
|
OLw = OLx |
73 |
|
|
OLe = OLx |
74 |
|
|
OLn = OLy |
75 |
|
|
OLs = OLy |
76 |
|
|
exchWidthX = OLx |
77 |
|
|
exchWidthY = OLy |
78 |
|
|
C ** NOTE ** The exchange routine we use here does not |
79 |
|
|
C require the preceeding and following barriers. |
80 |
|
|
C However, the slow, simple exchange interface |
81 |
|
|
C that is calling it here is meant to ensure |
82 |
|
|
C that threads are synchronised before exchanges |
83 |
|
|
C begine. |
84 |
|
|
IF (useCubedSphereExchange) THEN |
85 |
|
|
CALL EXCH_UV_RX_CUBE( Uphi, Vphi, withSigns, |
86 |
|
|
I OLw, OLe, OLs, OLn, myNz, |
87 |
|
|
I exchWidthX, exchWidthY, |
88 |
|
|
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
89 |
|
|
ELSE |
90 |
|
|
CALL EXCH_RX( Uphi, |
91 |
|
|
I OLw, OLe, OLs, OLn, myNz, |
92 |
|
|
I exchWidthX, exchWidthY, |
93 |
|
|
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
94 |
|
|
CALL EXCH_RX( Vphi, |
95 |
|
|
I OLw, OLe, OLs, OLn, myNz, |
96 |
|
|
I exchWidthX, exchWidthY, |
97 |
|
|
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
98 |
|
|
ENDIF |
99 |
|
|
|
100 |
|
|
RETURN |
101 |
jmc |
1.3 |
#endif /* ALLOW_EXCH2 */ |
102 |
jmc |
1.1 |
END |
103 |
|
|
|
104 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
105 |
|
|
|
106 |
|
|
CEH3 ;;; Local Variables: *** |
107 |
|
|
CEH3 ;;; mode:fortran *** |
108 |
|
|
CEH3 ;;; End: *** |