1 |
C $Header: /u/gcmpack/models/MITgcmUV/eesupp/src/exch_uv_xy_rx.template,v 1.2 2001/05/29 14:01:36 adcroft Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_EEOPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: EXCH_UV_XY_RX |
8 |
|
9 |
C !INTERFACE: |
10 |
SUBROUTINE EXCH_UV_XY_RX( |
11 |
U Uphi, Vphi, withSigns, |
12 |
I myThid ) |
13 |
IMPLICIT NONE |
14 |
C !DESCRIPTION: |
15 |
C *==========================================================* |
16 |
C | SUBROUTINE EXCH_UV_XY_RX |
17 |
C | o Handle exchanges for _RX, two-dimensional arrays. |
18 |
C *==========================================================* |
19 |
C | Driver exchange routine which branches to cube sphere or |
20 |
C | global, simple cartesian index grid. Exchange routine is |
21 |
C | called with two arrays that are components of a vector. |
22 |
C | These components are rotated and interchanged on the |
23 |
C | rotated grid during cube exchanges. |
24 |
C *==========================================================* |
25 |
|
26 |
C !USES: |
27 |
C === Global data === |
28 |
#include "SIZE.h" |
29 |
#include "EEPARAMS.h" |
30 |
#include "EESUPPORT.h" |
31 |
|
32 |
C !INPUT/OUTPUT PARAMETERS: |
33 |
C === Routine arguments === |
34 |
C Uphi :: Arrays with overlap regions are to be exchanged |
35 |
C Vphi Note - The interface to EXCH_ assumes that |
36 |
C the standard Fortran 77 sequence association rules |
37 |
C apply. |
38 |
C myThid :: My thread id. |
39 |
C withSigns :: Flag controlling whether vector is signed. |
40 |
_RX Uphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
41 |
_RX Vphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
42 |
LOGICAL withSigns |
43 |
INTEGER myThid |
44 |
|
45 |
C !LOCAL VARIABLES: |
46 |
C == Local variables == |
47 |
C OL[wens] :: Overlap extents in west, east, north, south. |
48 |
C exchWidth[XY] :: Extent of regions that will be exchanged. |
49 |
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY, myNz |
50 |
CEOP |
51 |
|
52 |
OLw = OLx |
53 |
OLe = OLx |
54 |
OLn = OLy |
55 |
OLs = OLy |
56 |
exchWidthX = OLx |
57 |
exchWidthY = OLy |
58 |
myNz = 1 |
59 |
C ** NOTE ** The exchange routine we use here does not |
60 |
C require the preceeding and following barriers. |
61 |
C However, the slow, simple exchange interface |
62 |
C that is calling it here is meant to ensure |
63 |
C that threads are synchronised before exchanges |
64 |
C begine. |
65 |
IF (useCubedSphereExchange) THEN |
66 |
CALL EXCH_UV_RX_CUBE( Uphi, Vphi, withSigns, |
67 |
I OLw, OLe, OLs, OLn, myNz, |
68 |
I exchWidthX, exchWidthY, |
69 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
70 |
ELSE |
71 |
c CALL EXCH_RX( Uphi, |
72 |
c I OLw, OLe, OLs, OLn, myNz, |
73 |
c I exchWidthX, exchWidthY, |
74 |
c I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
75 |
c CALL EXCH_RX( Vphi, |
76 |
c I OLw, OLe, OLs, OLn, myNz, |
77 |
c I exchWidthX, exchWidthY, |
78 |
c I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
79 |
c_jmc: for JAM compatibility, replace the 2 CALLs above by the 2 CPP_MACROs: |
80 |
_EXCH_XY_RX( Uphi, myThid ) |
81 |
_EXCH_XY_RX( Vphi, myThid ) |
82 |
ENDIF |
83 |
|
84 |
RETURN |
85 |
END |