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 |
|
|
7 |
|
CBOP |
8 |
|
C !ROUTINE: EXCH_UV_XY_RX |
9 |
|
|
10 |
|
C !INTERFACE: |
11 |
SUBROUTINE EXCH_UV_XY_RX( |
SUBROUTINE EXCH_UV_XY_RX( |
12 |
U Uphi, Vphi, withSigns, |
U Uphi, Vphi, |
13 |
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 \==========================================================/ |
|
14 |
IMPLICIT NONE |
IMPLICIT NONE |
15 |
|
C !DESCRIPTION: |
16 |
|
C *==========================================================* |
17 |
|
C | SUBROUTINE EXCH_UV_XY_RX |
18 |
|
C | o Handle exchanges for _RX, two-dimensional arrays. |
19 |
|
C *==========================================================* |
20 |
|
C | Driver exchange routine which branches to cube sphere or |
21 |
|
C | global, simple cartesian index grid. Exchange routine is |
22 |
|
C | called with two arrays that are components of a vector. |
23 |
|
C | These components are rotated and interchanged on the |
24 |
|
C | rotated grid during cube exchanges. |
25 |
|
C *==========================================================* |
26 |
|
|
27 |
|
C !USES: |
28 |
C === Global data === |
C === Global data === |
29 |
#include "SIZE.h" |
#include "SIZE.h" |
30 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
31 |
#include "EESUPPORT.h" |
#include "EESUPPORT.h" |
32 |
|
#include "EXCH.h" |
33 |
|
|
34 |
|
C !INPUT/OUTPUT PARAMETERS: |
35 |
C === Routine arguments === |
C === Routine arguments === |
36 |
C phi - Array with overlap regions are to be exchanged |
C Uphi :: Arrays with overlap regions are to be exchanged |
37 |
C Note - The interface to EXCH_RL assumes that |
C Vphi Note - The interface to EXCH_ assumes that |
38 |
C the standard Fortran 77 sequence association rules |
C the standard Fortran 77 sequence association rules |
39 |
C apply. |
C apply. |
40 |
C myThid - My thread id. |
C myThid :: My thread id. |
41 |
|
C withSigns :: Flag controlling whether vector is signed. |
42 |
_RX Uphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RX Uphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
43 |
_RX Vphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RX Vphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
44 |
LOGICAL withSigns |
LOGICAL withSigns |
45 |
INTEGER myThid |
INTEGER myThid |
|
CEndOfInterface |
|
46 |
|
|
47 |
|
C !LOCAL VARIABLES: |
48 |
C == Local variables == |
C == Local variables == |
49 |
C OL[wens] - Overlap extents in west, east, north, south. |
C OL[wens] :: Overlap extents in west, east, north, south. |
50 |
C exchWidth[XY] - Extent of regions that will be exchanged. |
C exchWidth[XY] :: Extent of regions that will be exchanged. |
51 |
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY, myNz |
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY, myNz |
52 |
|
CEOP |
53 |
|
|
54 |
|
#ifdef ALLOW_EXCH2 |
55 |
|
CALL EXCH2_UV_XY_RX( |
56 |
|
U Uphi, Vphi, |
57 |
|
I withSigns, myThid ) |
58 |
|
RETURN |
59 |
|
#endif |
60 |
|
|
61 |
OLw = OLx |
OLw = OLx |
62 |
OLe = OLx |
OLe = OLx |
71 |
C that is calling it here is meant to ensure |
C that is calling it here is meant to ensure |
72 |
C that threads are synchronised before exchanges |
C that threads are synchronised before exchanges |
73 |
C begine. |
C begine. |
|
_BARRIER |
|
74 |
IF (useCubedSphereExchange) THEN |
IF (useCubedSphereExchange) THEN |
75 |
CALL EXCH_UV_RX_CUBE( Uphi, Vphi, withSigns, |
CALL EXCH_UV_RX_CUBE( Uphi, Vphi, withSigns, |
76 |
I OLw, OLe, OLs, OLn, myNz, |
I OLw, OLe, OLs, OLn, myNz, |
89 |
_EXCH_XY_RX( Uphi, myThid ) |
_EXCH_XY_RX( Uphi, myThid ) |
90 |
_EXCH_XY_RX( Vphi, myThid ) |
_EXCH_XY_RX( Vphi, myThid ) |
91 |
ENDIF |
ENDIF |
|
_BARRIER |
|
92 |
|
|
93 |
RETURN |
RETURN |
94 |
END |
END |
95 |
|
|
96 |
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
97 |
|
|
98 |
|
CEH3 ;;; Local Variables: *** |
99 |
|
CEH3 ;;; mode:fortran *** |
100 |
|
CEH3 ;;; End: *** |