1 |
C $Header$ |
C $Header$ |
2 |
C $Name$ |
C $Name$ |
3 |
|
|
4 |
|
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_EEOPTIONS.h" |
#include "CPP_EEOPTIONS.h" |
6 |
|
#ifdef ALLOW_EXCH2 |
7 |
|
#include "W2_OPTIONS.h" |
8 |
|
#endif |
9 |
|
|
10 |
|
CBOP |
11 |
|
C !ROUTINE: EXCH_UV_XY_RX |
12 |
|
|
13 |
|
C !INTERFACE: |
14 |
SUBROUTINE EXCH_UV_XY_RX( |
SUBROUTINE EXCH_UV_XY_RX( |
15 |
U Uphi, Vphi, withSigns, |
U Uphi, Vphi, |
16 |
I myThid ) |
I withSigns, myThid ) |
|
C /==========================================================\ |
|
|
C | SUBROUTINE EXCH_UV_XY_RX | |
|
|
C | o Handle exchanges for _RX, two-dimensional arrays. | |
|
|
C |==========================================================| |
|
|
C | Do true shared-memory data transfers and "messaging" | |
|
|
C | tranfers for blocking case of data transfers. | |
|
|
C | Applications call this routine using | |
|
|
C | CALL EXCH..( x, myThid ) | |
|
|
C | where x is a two-dimensional array with overlaps. | |
|
|
C | This routine does true-shared-memory copies for blocks | |
|
|
C | within a thread. It will also do MPI meesaging between | |
|
|
C | different processes. | |
|
|
C | Note: | |
|
|
C | ===== | |
|
|
C | This routine is a default mode interface to the more | |
|
|
C | general exchange routine. Under default mode the | |
|
|
C | exchange is for an edge width of OLx, and OLy and | |
|
|
C | updates corner points as well as edges ( slightly more | |
|
|
C | synchronisation required). | |
|
|
C \==========================================================/ |
|
17 |
IMPLICIT NONE |
IMPLICIT NONE |
18 |
|
C !DESCRIPTION: |
19 |
|
C *==========================================================* |
20 |
|
C | SUBROUTINE EXCH_UV_XY_RX |
21 |
|
C | o Handle exchanges for _RX, two-dimensional arrays. |
22 |
|
C *==========================================================* |
23 |
|
C | Driver exchange routine which branches to cube sphere or |
24 |
|
C | global, simple cartesian index grid. Exchange routine is |
25 |
|
C | called with two arrays that are components of a vector. |
26 |
|
C | These components are rotated and interchanged on the |
27 |
|
C | rotated grid during cube exchanges. |
28 |
|
C *==========================================================* |
29 |
|
|
30 |
|
C !USES: |
31 |
C === Global data === |
C === Global data === |
32 |
#include "SIZE.h" |
#include "SIZE.h" |
33 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
34 |
#include "EESUPPORT.h" |
cph-mpi#include "EESUPPORT.h" |
35 |
|
#include "EXCH.h" |
36 |
|
|
37 |
|
C !INPUT/OUTPUT PARAMETERS: |
38 |
C === Routine arguments === |
C === Routine arguments === |
39 |
C phi - Array with overlap regions are to be exchanged |
C Uphi :: Arrays with overlap regions are to be exchanged |
40 |
C Note - The interface to EXCH_RL assumes that |
C Vphi Note - The interface to EXCH_ assumes that |
41 |
C the standard Fortran 77 sequence association rules |
C the standard Fortran 77 sequence association rules |
42 |
C apply. |
C apply. |
43 |
C myThid - My thread id. |
C myThid :: My thread id. |
44 |
|
C withSigns :: Flag controlling whether vector is signed. |
45 |
_RX Uphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RX Uphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
46 |
_RX Vphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RX Vphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
47 |
LOGICAL withSigns |
LOGICAL withSigns |
48 |
INTEGER myThid |
INTEGER myThid |
|
CEndOfInterface |
|
49 |
|
|
50 |
|
C !LOCAL VARIABLES: |
51 |
C == Local variables == |
C == Local variables == |
52 |
C OL[wens] - Overlap extents in west, east, north, south. |
C OL[wens] :: Overlap extents in west, east, north, south. |
53 |
C exchWidth[XY] - Extent of regions that will be exchanged. |
C exchWidth[XY] :: Extent of regions that will be exchanged. |
54 |
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY, myNz |
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY, myNz |
55 |
|
CEOP |
56 |
|
|
57 |
|
#ifdef ALLOW_EXCH2 |
58 |
|
#ifdef W2_USE_R1_ONLY |
59 |
|
CALL EXCH2_UV_CGRID_3D_RX( |
60 |
|
U Uphi, Vphi, |
61 |
|
I withSigns, 1, myThid ) |
62 |
|
#else |
63 |
|
CALL EXCH2_UV_XY_RX( |
64 |
|
U Uphi, Vphi, |
65 |
|
I withSigns, myThid ) |
66 |
|
#endif |
67 |
|
RETURN |
68 |
|
#else /* ALLOW_EXCH2 */ |
69 |
|
|
70 |
OLw = OLx |
OLw = OLx |
71 |
OLe = OLx |
OLe = OLx |
80 |
C that is calling it here is meant to ensure |
C that is calling it here is meant to ensure |
81 |
C that threads are synchronised before exchanges |
C that threads are synchronised before exchanges |
82 |
C begine. |
C begine. |
|
_BARRIER |
|
83 |
IF (useCubedSphereExchange) THEN |
IF (useCubedSphereExchange) THEN |
84 |
CALL EXCH_UV_RX_CUBE( Uphi, Vphi, withSigns, |
CALL EXCH_UV_RX_CUBE( Uphi, Vphi, withSigns, |
85 |
I OLw, OLe, OLs, OLn, myNz, |
I OLw, OLe, OLs, OLn, myNz, |
98 |
_EXCH_XY_RX( Uphi, myThid ) |
_EXCH_XY_RX( Uphi, myThid ) |
99 |
_EXCH_XY_RX( Vphi, myThid ) |
_EXCH_XY_RX( Vphi, myThid ) |
100 |
ENDIF |
ENDIF |
|
_BARRIER |
|
101 |
|
|
102 |
RETURN |
RETURN |
103 |
|
#endif /* ALLOW_EXCH2 */ |
104 |
END |
END |
105 |
|
|
106 |
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
107 |
|
|
108 |
|
CEH3 ;;; Local Variables: *** |
109 |
|
CEH3 ;;; mode:fortran *** |
110 |
|
CEH3 ;;; End: *** |