12 |
|
|
13 |
C !INTERFACE: |
C !INTERFACE: |
14 |
SUBROUTINE EXCH_UV_XY_RX( |
SUBROUTINE EXCH_UV_XY_RX( |
15 |
U Uphi, Vphi, |
U Uphi, Vphi, |
16 |
I withSigns, myThid ) |
I withSigns, myThid ) |
17 |
IMPLICIT NONE |
|
18 |
C !DESCRIPTION: |
C !DESCRIPTION: |
19 |
C *==========================================================* |
C *==========================================================* |
20 |
C | SUBROUTINE EXCH_UV_XY_RX |
C | SUBROUTINE EXCH_UV_XY_RX |
21 |
C | o Handle exchanges for _RX, two-dimensional arrays. |
C | o Handle exchanges for _RX, 2-dimensional vector arrays. |
22 |
C *==========================================================* |
C *==========================================================* |
23 |
C | Driver exchange routine which branches to cube sphere or |
C | Vector arrays need to be rotated and interchaged for |
24 |
C | global, simple cartesian index grid. Exchange routine is |
C | exchange operations on some grids. This driver routine |
25 |
C | called with two arrays that are components of a vector. |
C | branches to support this. |
|
C | These components are rotated and interchanged on the |
|
|
C | rotated grid during cube exchanges. |
|
26 |
C *==========================================================* |
C *==========================================================* |
27 |
|
|
28 |
C !USES: |
C !USES: |
29 |
|
IMPLICIT NONE |
30 |
|
|
31 |
C === Global data === |
C === Global data === |
32 |
#include "SIZE.h" |
#include "SIZE.h" |
33 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
|
cph-mpi#include "EESUPPORT.h" |
|
|
c#include "EXCH.h" |
|
34 |
|
|
35 |
C !INPUT/OUTPUT PARAMETERS: |
C !INPUT/OUTPUT PARAMETERS: |
36 |
C === Routine arguments === |
C === Routine arguments === |
37 |
C Uphi :: Arrays with overlap regions are to be exchanged |
C Uphi :: 2 components of a vector field with overlap regions |
38 |
C Vphi Note - The interface to EXCH_ assumes that |
C Vphi :: to be exchanged |
|
C the standard Fortran 77 sequence association rules |
|
|
C apply. |
|
|
C myThid :: My thread id. |
|
39 |
C withSigns :: Flag controlling whether vector is signed. |
C withSigns :: Flag controlling whether vector is signed. |
40 |
|
C myThid :: my Thread Id. number |
41 |
_RX Uphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RX Uphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
42 |
_RX Vphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RX Vphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
43 |
LOGICAL withSigns |
LOGICAL withSigns |
55 |
#ifdef ALLOW_EXCH2 |
#ifdef ALLOW_EXCH2 |
56 |
#ifdef W2_USE_R1_ONLY |
#ifdef W2_USE_R1_ONLY |
57 |
CALL EXCH2_UV_CGRID_3D_RX( |
CALL EXCH2_UV_CGRID_3D_RX( |
58 |
U Uphi, Vphi, |
U Uphi, Vphi, |
59 |
I withSigns, 1, myThid ) |
I withSigns, 1, myThid ) |
60 |
#else |
#else |
61 |
CALL EXCH2_UV_XY_RX( |
CALL EXCH2_UV_3D_RX( |
62 |
U Uphi, Vphi, |
U Uphi, Vphi, |
63 |
I withSigns, myThid ) |
I withSigns, 1, myThid ) |
64 |
#endif |
#endif |
65 |
RETURN |
RETURN |
66 |
#else /* ALLOW_EXCH2 */ |
#else /* ALLOW_EXCH2 */ |
72 |
exchWidthX = OLx |
exchWidthX = OLx |
73 |
exchWidthY = OLy |
exchWidthY = OLy |
74 |
myNz = 1 |
myNz = 1 |
|
C ** NOTE ** The exchange routine we use here does not |
|
|
C require the preceeding and following barriers. |
|
|
C However, the slow, simple exchange interface |
|
|
C that is calling it here is meant to ensure |
|
|
C that threads are synchronised before exchanges |
|
|
C begine. |
|
75 |
IF (useCubedSphereExchange) THEN |
IF (useCubedSphereExchange) THEN |
76 |
CALL EXCH_UV_RX_CUBE( Uphi, Vphi, withSigns, |
CALL EXCH1_UV_RX_CUBE( Uphi, Vphi, withSigns, |
77 |
I OLw, OLe, OLs, OLn, myNz, |
I OLw, OLe, OLs, OLn, myNz, |
78 |
I exchWidthX, exchWidthY, |
I exchWidthX, exchWidthY, |
79 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
I EXCH_UPDATE_CORNERS, myThid ) |
80 |
ELSE |
ELSE |
81 |
c CALL EXCH_RX( Uphi, |
CALL EXCH1_RX( Uphi, |
82 |
c I OLw, OLe, OLs, OLn, myNz, |
I OLw, OLe, OLs, OLn, myNz, |
83 |
c I exchWidthX, exchWidthY, |
I exchWidthX, exchWidthY, |
84 |
c I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
I EXCH_UPDATE_CORNERS, myThid ) |
85 |
c CALL EXCH_RX( Vphi, |
CALL EXCH1_RX( Vphi, |
86 |
c I OLw, OLe, OLs, OLn, myNz, |
I OLw, OLe, OLs, OLn, myNz, |
87 |
c I exchWidthX, exchWidthY, |
I exchWidthX, exchWidthY, |
88 |
c I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
I EXCH_UPDATE_CORNERS, myThid ) |
|
c_jmc: for JAM compatibility, replace the 2 CALLs above by the 2 CPP_MACROs: |
|
|
c _EXCH_XY_RX( Uphi, myThid ) |
|
|
c _EXCH_XY_RX( Vphi, myThid ) |
|
|
CALL EXCH_XY_RX( Uphi, myThid ) |
|
|
CALL EXCH_XY_RX( Vphi, myThid ) |
|
89 |
ENDIF |
ENDIF |
90 |
|
|
91 |
RETURN |
RETURN |