1 |
C $Header: /u/gcmpack/MITgcm/pkg/exch2/W2_EXCH2_TOPOLOGY.h,v 1.6 2009/06/28 00:58:42 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
CBOP |
5 |
C !ROUTINE: W2_EXCH2_TOPOLOGY.h |
6 |
C !INTERFACE: |
7 |
C #include W2_EXCH2_TOPOLOGY.h |
8 |
|
9 |
C !DESCRIPTION: |
10 |
C *==========================================================* |
11 |
C | W2_EXCH2_TOPOLOGY.h |
12 |
C | o Header defining tile exchange and mapping for W2_EXCH2 |
13 |
C *==========================================================* |
14 |
C | 1rst part holds the full topology structure (same for all |
15 |
C | process) and is independent of tile-processor repartition |
16 |
C | (needs W2_EXCH2_SIZE.h to be included before) |
17 |
C | 2nd part (put in this header for convenience) holds |
18 |
C | Tile Ids and is function of tile-process repartition |
19 |
C | (needs SIZE.h to be included before) |
20 |
C *==========================================================* |
21 |
CEOP |
22 |
|
23 |
C--- Topology data structures |
24 |
C exch2_global_Nx :: Global-file domain length. |
25 |
C exch2_global_Ny :: Global-file domain height. |
26 |
C--- Tiling and Exch data structures |
27 |
C exch2_tProc :: Rank of process owning tile (filled at run time). |
28 |
C exch2_myFace :: Face number for each tile (used for I/O). |
29 |
C exch2_mydNx :: Face size in X for each tile (for I/O). |
30 |
C exch2_mydNy :: Face size in Y for each tile (for I/O). |
31 |
C exch2_tNx :: Size in X for each tile. |
32 |
C exch2_tNy :: Size in Y for each tile. |
33 |
C exch2_tBasex :: Tile offset in X within its sub-domain (cube face) |
34 |
C exch2_tBasey :: Tile offset in Y within its sub-domain (cube face) |
35 |
C exch2_txGlobalo :: Tile base X index within global index space. |
36 |
C exch2_tyGlobalo :: Tile base Y index within global index space. |
37 |
C exch2_isWedge :: 1 if West is at domain edge, 0 if not. |
38 |
C exch2_isNedge :: 1 if North is at domain edge, 0 if not. |
39 |
C exch2_isEedge :: 1 if East is at domain edge, 0 if not. |
40 |
C exch2_isSedge :: 1 if South is at domain edge, 0 if not. |
41 |
C exch2_nNeighbours :: Tile neighbour entries count. |
42 |
C exch2_neighbourId :: Tile number for each neighbour entry. |
43 |
C exch2_opposingSend:: Neighbour entry in target tile send |
44 |
C :: which has this tile and neighbour as its target. |
45 |
C exch2_pij(:,n,t) :: Matrix which applies to target-tile indices to get |
46 |
C :: source-tile "t" indices, for neighbour entry "n". |
47 |
C exch2_oi(n,t) :: Source-tile "t" X index offset in target |
48 |
C :: to source connection (neighbour entry "n"). |
49 |
C exch2_oj(n,t) :: Source-tile "t" Y index offset in target |
50 |
C :: to source connection (neighbour entry "n"). |
51 |
INTEGER exch2_global_Nx |
52 |
INTEGER exch2_global_Ny |
53 |
INTEGER exch2_tProc( W2_maxNbTiles ) |
54 |
INTEGER exch2_myFace( W2_maxNbTiles ) |
55 |
INTEGER exch2_mydNx( W2_maxNbTiles ) |
56 |
INTEGER exch2_mydNy( W2_maxNbTiles ) |
57 |
INTEGER exch2_tNx( W2_maxNbTiles ) |
58 |
INTEGER exch2_tNy( W2_maxNbTiles ) |
59 |
INTEGER exch2_tBasex( W2_maxNbTiles ) |
60 |
INTEGER exch2_tBasey( W2_maxNbTiles ) |
61 |
INTEGER exch2_txGlobalo(W2_maxNbTiles ) |
62 |
INTEGER exch2_tyGlobalo(W2_maxNbTiles ) |
63 |
INTEGER exch2_isWedge( W2_maxNbTiles ) |
64 |
INTEGER exch2_isNedge( W2_maxNbTiles ) |
65 |
INTEGER exch2_isEedge( W2_maxNbTiles ) |
66 |
INTEGER exch2_isSedge( W2_maxNbTiles ) |
67 |
INTEGER exch2_nNeighbours( W2_maxNbTiles ) |
68 |
INTEGER exch2_neighbourId( W2_maxNeighbours, W2_maxNbTiles ) |
69 |
INTEGER exch2_opposingSend( W2_maxNeighbours, W2_maxNbTiles ) |
70 |
INTEGER exch2_pij(4,W2_maxNeighbours, W2_maxNbTiles ) |
71 |
INTEGER exch2_oi ( W2_maxNeighbours, W2_maxNbTiles ) |
72 |
INTEGER exch2_oj ( W2_maxNeighbours, W2_maxNbTiles ) |
73 |
|
74 |
COMMON /W2_EXCH2_TOPO_I/ |
75 |
& exch2_global_Nx, exch2_global_Ny, |
76 |
& exch2_tProc, |
77 |
& exch2_myFace, exch2_mydNx, exch2_mydNy, |
78 |
& exch2_tNx, exch2_tNy, |
79 |
& exch2_tBasex, exch2_tBasey, |
80 |
& exch2_txGlobalo,exch2_tyGlobalo, |
81 |
& exch2_isWedge, exch2_isNedge, |
82 |
& exch2_isEedge, exch2_isSedge, |
83 |
& exch2_nNeighbours, exch2_neighbourId, |
84 |
& exch2_opposingSend, |
85 |
& exch2_pij, |
86 |
& exch2_oi, exch2_oj |
87 |
|
88 |
C--- Exchange execution loop data structures |
89 |
C exch2_iLo,iHi(n,t) :: X-index range of this tile "t" halo-region |
90 |
C :: to be updated with neighbour entry "n". |
91 |
C exch2_jLo,jHi(n,t) :: Y-index range of this tile "t" halo-region |
92 |
C :: to be updated with neighbour entry "n". |
93 |
INTEGER exch2_iLo( W2_maxNeighbours, W2_maxNbTiles ) |
94 |
INTEGER exch2_iHi( W2_maxNeighbours, W2_maxNbTiles ) |
95 |
INTEGER exch2_jLo( W2_maxNeighbours, W2_maxNbTiles ) |
96 |
INTEGER exch2_jHi( W2_maxNeighbours, W2_maxNbTiles ) |
97 |
COMMON /W2_EXCH2_HALO_SPEC/ |
98 |
& exch2_iLo, exch2_iHi, |
99 |
& exch2_jLo, exch2_jHi |
100 |
|
101 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
102 |
|
103 |
C-- COMMON /W2_EXCH2_TILE_ID/ tile ids |
104 |
C W2 tile id variables (tile ids are no longer a function of |
105 |
C process and subgrid indices). |
106 |
C W2_myTileList :: list of tiles owned by this process |
107 |
C W2_procTileList :: same as W2_myTileList, but contains |
108 |
C information for all processes |
109 |
INTEGER W2_myTileList(nSx,nSy) |
110 |
INTEGER W2_procTileList(nSx,nSy,nPx*nPy) |
111 |
COMMON /W2_EXCH2_TILE_ID/ |
112 |
& W2_myTileList, W2_procTileList |
113 |
|
114 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |