1 |
C $Header: /u/gcmpack/MITgcm/eesupp/src/exch_z_3d_rx.template,v 1.2 2006/11/17 22:35:03 heimbach Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_EEOPTIONS.h" |
6 |
|
7 |
CBOP |
8 |
C !ROUTINE: EXCH_Z_3D_RX |
9 |
|
10 |
C !INTERFACE: |
11 |
SUBROUTINE EXCH_Z_3D_RX( |
12 |
U phi, |
13 |
I myNz, myThid ) |
14 |
IMPLICIT NONE |
15 |
C !DESCRIPTION: |
16 |
C *==========================================================* |
17 |
C | SUBROUTINE EXCH_Z_3D_RX |
18 |
C | o Handle exchanges for _RX, 3-dim, zeta coord arrays. |
19 |
C *==========================================================* |
20 |
C | Branch to appropriate exchange routine for a zeta coord |
21 |
C | array on the current grid scheme. |
22 |
C *==========================================================* |
23 |
|
24 |
C !USES: |
25 |
C == Global variables == |
26 |
#include "SIZE.h" |
27 |
#include "EEPARAMS.h" |
28 |
c#include "EESUPPORT.h" |
29 |
c#include "EXCH.h" |
30 |
|
31 |
C !INPUT/OUTPUT PARAMETERS: |
32 |
C == Routine arguments == |
33 |
C phi :: Array with overlap regions are to be exchanged |
34 |
C Note - The interface to EXCH_RX assumes that |
35 |
C the standard Fortran 77 sequence association rules |
36 |
C apply. |
37 |
C myNz :: 3rd dimension of array to exchange |
38 |
C myThid :: My thread id. |
39 |
INTEGER myNz |
40 |
_RX phi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,nSx,nSy) |
41 |
INTEGER myThid |
42 |
|
43 |
C !LOCAL VARIABLES: |
44 |
#ifndef ALLOW_EXCH2 |
45 |
C == Local variables == |
46 |
C OL[wens] :: Overlap extents in west, east, north, south. |
47 |
C exchWidth[XY] :: Extent of regions that will be exchanged. |
48 |
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY |
49 |
#endif |
50 |
CEOP |
51 |
|
52 |
#ifdef ALLOW_EXCH2 |
53 |
CALL EXCH2_Z_3D_RX( |
54 |
U phi, |
55 |
I myNz, myThid ) |
56 |
RETURN |
57 |
#else /* ALLOW_EXCH2 */ |
58 |
|
59 |
OLw = OLx |
60 |
OLe = OLx |
61 |
OLn = OLy |
62 |
OLs = OLy |
63 |
exchWidthX = OLx |
64 |
exchWidthY = OLy |
65 |
C ** NOTE ** The exchange routine we use here does not |
66 |
C require the preceeding and following barriers. |
67 |
C However, the slow, simple exchange interface |
68 |
C that is calling it here is meant to ensure |
69 |
C that threads are synchronised before exchanges |
70 |
C begine. |
71 |
IF (useCubedSphereExchange) THEN |
72 |
CALL EXCH_Z_RX_CUBE( phi, |
73 |
I OLw, OLe, OLs, OLn, myNz, |
74 |
I exchWidthX, exchWidthY, |
75 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
76 |
ELSE |
77 |
CALL EXCH_RX( phi, |
78 |
I OLw, OLe, OLs, OLn, myNz, |
79 |
I exchWidthX, exchWidthY, |
80 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
81 |
ENDIF |
82 |
|
83 |
RETURN |
84 |
#endif /* ALLOW_EXCH2 */ |
85 |
END |