1 |
heimbach |
1.2 |
C $Header: /u/gcmpack/MITgcm/eesupp/src/exch_z_3d_rx.template,v 1.1 2006/08/23 15:18:47 jmc Exp $ |
2 |
jmc |
1.1 |
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 |
|
|
#include "EESUPPORT.h" |
29 |
|
|
#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 |
|
|
C == Local variables == |
45 |
|
|
C OL[wens] :: Overlap extents in west, east, north, south. |
46 |
|
|
C exchWidth[XY] :: Extent of regions that will be exchanged. |
47 |
|
|
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY |
48 |
|
|
CEOP |
49 |
|
|
|
50 |
|
|
#ifdef ALLOW_EXCH2 |
51 |
|
|
CALL EXCH2_Z_3D_RX( |
52 |
|
|
U phi, |
53 |
|
|
I myNz, myThid ) |
54 |
|
|
RETURN |
55 |
heimbach |
1.2 |
#else |
56 |
jmc |
1.1 |
|
57 |
|
|
OLw = OLx |
58 |
|
|
OLe = OLx |
59 |
|
|
OLn = OLy |
60 |
|
|
OLs = OLy |
61 |
|
|
exchWidthX = OLx |
62 |
|
|
exchWidthY = OLy |
63 |
|
|
C ** NOTE ** The exchange routine we use here does not |
64 |
|
|
C require the preceeding and following barriers. |
65 |
|
|
C However, the slow, simple exchange interface |
66 |
|
|
C that is calling it here is meant to ensure |
67 |
|
|
C that threads are synchronised before exchanges |
68 |
|
|
C begine. |
69 |
|
|
IF (useCubedSphereExchange) THEN |
70 |
|
|
CALL EXCH_Z_RX_CUBE( phi, |
71 |
|
|
I OLw, OLe, OLs, OLn, myNz, |
72 |
|
|
I exchWidthX, exchWidthY, |
73 |
|
|
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
74 |
|
|
ELSE |
75 |
|
|
CALL EXCH_RX( phi, |
76 |
|
|
I OLw, OLe, OLs, OLn, myNz, |
77 |
|
|
I exchWidthX, exchWidthY, |
78 |
|
|
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
79 |
|
|
ENDIF |
80 |
|
|
|
81 |
|
|
RETURN |
82 |
heimbach |
1.2 |
#endif |
83 |
jmc |
1.1 |
END |