1 |
C $Header: /u/gcmpack/MITgcm/eesupp/src/exch_uv_3d_rx.template,v 1.1 2006/08/23 15:18:47 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_EEOPTIONS.h" |
6 |
|
7 |
CBOP |
8 |
C !ROUTINE: EXCH_UV_3D_RX |
9 |
|
10 |
C !INTERFACE: |
11 |
SUBROUTINE EXCH_UV_3D_RX( |
12 |
U Uphi, Vphi, |
13 |
I withSigns, myNz, myThid ) |
14 |
|
15 |
C !DESCRIPTION: |
16 |
C *==========================================================* |
17 |
C | SUBROUTINE EXCH_UV_3D_RX |
18 |
C | o Handle exchanges for _RX, 3-dimensional vector arrays. |
19 |
C *==========================================================* |
20 |
C | Vector arrays need to be rotated and interchaged for |
21 |
C | exchange operations on some grids. This driver routine |
22 |
C | branches to support this. |
23 |
C *==========================================================* |
24 |
|
25 |
C !USES: |
26 |
IMPLICIT NONE |
27 |
C === Global data === |
28 |
#include "SIZE.h" |
29 |
#include "EEPARAMS.h" |
30 |
#include "EESUPPORT.h" |
31 |
#include "EXCH.h" |
32 |
|
33 |
C !INPUT/OUTPUT PARAMETERS: |
34 |
C === Routine arguments === |
35 |
C phi :: Array with overlap regions are to be exchanged |
36 |
C Note - The interface to EXCH_RX assumes that |
37 |
C the standard Fortran 77 sequence association rules |
38 |
C apply. |
39 |
C myNz :: 3rd dimension of array to exchange |
40 |
C myThid :: My thread id. |
41 |
INTEGER myNz |
42 |
_RX Uphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,nSx,nSy) |
43 |
_RX Vphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,nSx,nSy) |
44 |
LOGICAL withSigns |
45 |
INTEGER myThid |
46 |
|
47 |
C !LOCAL VARIABLES: |
48 |
C == Local variables == |
49 |
C OL[wens] :: Overlap extents in west, east, north, south. |
50 |
C exchWidth[XY] :: Extent of regions that will be exchanged. |
51 |
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY |
52 |
|
53 |
CEOP |
54 |
#ifdef ALLOW_EXCH2 |
55 |
CALL EXCH2_UV_3D_RX( |
56 |
U Uphi, Vphi, |
57 |
I withSigns, myNz, myThid ) |
58 |
RETURN |
59 |
#else |
60 |
|
61 |
OLw = OLx |
62 |
OLe = OLx |
63 |
OLn = OLy |
64 |
OLs = OLy |
65 |
exchWidthX = OLx |
66 |
exchWidthY = OLy |
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 |
CALL EXCH_RX( Uphi, |
80 |
I OLw, OLe, OLs, OLn, myNz, |
81 |
I exchWidthX, exchWidthY, |
82 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
83 |
CALL EXCH_RX( Vphi, |
84 |
I OLw, OLe, OLs, OLn, myNz, |
85 |
I exchWidthX, exchWidthY, |
86 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
87 |
ENDIF |
88 |
|
89 |
RETURN |
90 |
#endif |
91 |
END |
92 |
|
93 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
94 |
|
95 |
CEH3 ;;; Local Variables: *** |
96 |
CEH3 ;;; mode:fortran *** |
97 |
CEH3 ;;; End: *** |