| 1 |
C $Header: /u/gcmpack/models/MITgcmUV/eesupp/src/exch_xyz_rx.template,v 1.2 2001/05/29 14:01:36 adcroft Exp $ |
| 2 |
C $Name: $ |
| 3 |
|
| 4 |
#include "CPP_EEOPTIONS.h" |
| 5 |
CBOP |
| 6 |
|
| 7 |
C !ROUTINE: EXCH_XYZ_RX |
| 8 |
|
| 9 |
C !INTERFACE: |
| 10 |
SUBROUTINE EXCH_XYZ_RX( |
| 11 |
U phi, |
| 12 |
I myThid ) |
| 13 |
IMPLICIT NONE |
| 14 |
|
| 15 |
C !DESCRIPTION: |
| 16 |
C *==========================================================* |
| 17 |
C | SUBROUTINE EXCH_XYZ_RX |
| 18 |
C | o Handle exchanges for _RX, three-dim scalar arrays. |
| 19 |
C *==========================================================* |
| 20 |
C | Invoke appropriate exchange routine depending on type |
| 21 |
C | of grid (cube or globally indexed) to be operated on. |
| 22 |
C *==========================================================* |
| 23 |
|
| 24 |
C !USES: |
| 25 |
C === Global data === |
| 26 |
#include "SIZE.h" |
| 27 |
#include "EEPARAMS.h" |
| 28 |
#include "EESUPPORT.h" |
| 29 |
|
| 30 |
C !INPUT/OUTPUT PARAMETERS: |
| 31 |
C === Routine arguments === |
| 32 |
C phi :: Array with overlap regions are to be exchanged |
| 33 |
C myThid :: My thread id. |
| 34 |
_RX phi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy) |
| 35 |
INTEGER myThid |
| 36 |
|
| 37 |
C !LOCAL VARIABLES: |
| 38 |
C == Local variables == |
| 39 |
C OL[wens] :: Overlap extents in west, east, north, south. |
| 40 |
C exchWidth[XY] :: Extent of regions that will be exchanged. |
| 41 |
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY, myNz |
| 42 |
|
| 43 |
CEOP |
| 44 |
|
| 45 |
OLw = OLx |
| 46 |
OLe = OLx |
| 47 |
OLn = OLy |
| 48 |
OLs = OLy |
| 49 |
exchWidthX = OLx |
| 50 |
exchWidthY = OLy |
| 51 |
myNz = Nr |
| 52 |
C ** NOTE ** The exchange routine we use here does not |
| 53 |
C require the preceeding and following barriers. |
| 54 |
C However, the slow, simple exchange interface |
| 55 |
C that is calling it here is meant to ensure |
| 56 |
C that threads are synchronised before exchanges |
| 57 |
C begine. |
| 58 |
IF (useCubedSphereExchange) THEN |
| 59 |
CALL EXCH_RX_CUBE( phi, |
| 60 |
I OLw, OLe, OLs, OLn, myNz, |
| 61 |
I exchWidthX, exchWidthY, |
| 62 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
| 63 |
ELSE |
| 64 |
CALL EXCH_RX( phi, |
| 65 |
I OLw, OLe, OLs, OLn, myNz, |
| 66 |
I exchWidthX, exchWidthY, |
| 67 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
| 68 |
ENDIF |
| 69 |
|
| 70 |
RETURN |
| 71 |
END |