1 |
C $Header: /u/gcmpack/MITgcm/pkg/exch2/exch2_s3d_rx.template,v 1.5 2009/05/12 19:44:58 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_EEOPTIONS.h" |
5 |
#include "W2_OPTIONS.h" |
6 |
|
7 |
CBOP |
8 |
C !ROUTINE: EXCH2_S3D_RX |
9 |
|
10 |
C !INTERFACE: |
11 |
SUBROUTINE EXCH2_S3D_RX( |
12 |
U phi, |
13 |
I myNz, myThid ) |
14 |
|
15 |
C !DESCRIPTION: |
16 |
C *==========================================================* |
17 |
C | SUBROUTINE EXCH2_S3D_RX |
18 |
C | o Handle Simple exchanges (= that ignore corners) |
19 |
C | for _RX, 3-dim scalar arrays with overlap size = 1 |
20 |
C *==========================================================* |
21 |
C | Invoke appropriate exchange routine depending on type |
22 |
C | of grid (cube or globally indexed) to be operated on. |
23 |
C *==========================================================* |
24 |
|
25 |
C !USES: |
26 |
IMPLICIT NONE |
27 |
C === Global data === |
28 |
#include "SIZE.h" |
29 |
#include "EEPARAMS.h" |
30 |
c#include "EESUPPORT.h" |
31 |
c#include "W2_EXCH2_SIZE.h" |
32 |
c#include "W2_EXCH2_TOPOLOGY.h" |
33 |
|
34 |
C !INPUT/OUTPUT PARAMETERS: |
35 |
C === Routine arguments === |
36 |
C phi :: Array with overlap regions are to be exchanged |
37 |
C myNz :: 3rd dimension of array to exchange |
38 |
C myThid :: My thread id. |
39 |
INTEGER myNz |
40 |
_RX phi(0:sNx+1,0:sNy+1,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 |
|
49 |
CEOP |
50 |
|
51 |
OLw = 1 |
52 |
OLe = 1 |
53 |
OLn = 1 |
54 |
OLs = 1 |
55 |
exchWidthX = 1 |
56 |
exchWidthY = 1 |
57 |
C ** NOTE ** The exchange routine we use here does not |
58 |
C require the preceeding and following barriers. |
59 |
C However, the slow, simple exchange interface |
60 |
C that is calling it here is meant to ensure |
61 |
C that threads are synchronised before exchanges |
62 |
C begine. |
63 |
|
64 |
IF (useCubedSphereExchange) THEN |
65 |
|
66 |
CALL EXCH2_RX1_CUBE( phi, 'T ', |
67 |
I OLw, OLe, OLs, OLn, myNz, |
68 |
I exchWidthX, exchWidthY, |
69 |
I FORWARD_SIMULATION, EXCH_IGNORE_CORNERS, myThid ) |
70 |
|
71 |
ELSE |
72 |
|
73 |
#ifndef AUTODIFF_EXCH2 |
74 |
CALL EXCH_RX( phi, |
75 |
I OLw, OLe, OLs, OLn, myNz, |
76 |
I exchWidthX, exchWidthY, |
77 |
I FORWARD_SIMULATION, EXCH_IGNORE_CORNERS, myThid ) |
78 |
#endif |
79 |
|
80 |
ENDIF |
81 |
|
82 |
RETURN |
83 |
END |
84 |
|
85 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
86 |
|
87 |
CEH3 ;;; Local Variables: *** |
88 |
CEH3 ;;; mode:fortran *** |
89 |
CEH3 ;;; End: *** |