1 |
dimitri |
1.1 |
|
2 |
|
|
#if 0 |
3 |
|
|
|
4 |
|
|
The somewhat weird looking format of this file is so that it can be |
5 |
|
|
included in both C and FORTRAN routines. The general problem is that |
6 |
|
|
FORTRAN requires that the definitions in this header file be included |
7 |
|
|
in each *subroutine*, and thus possibly multiple times in a single |
8 |
|
|
source file if that source file defines multiple subroutines, while C |
9 |
|
|
demands that the actual definitions only appear once per *file*, even |
10 |
|
|
if this header file is (accidently) #include'd multiple times. |
11 |
|
|
|
12 |
|
|
N.B.: Do NOT remove the parentheses in the "enum" or "PARAMETER" |
13 |
|
|
declarations. We want the user to be able to use an expression |
14 |
|
|
in the "#define" (e.g. "#define __sNx 64 + 8 "), and not have |
15 |
|
|
to worry about precedence in the substituted expressions (e.g. |
16 |
|
|
if "__sNx" is defined as 64 + 8, then "__sNx * __sNy" would not |
17 |
|
|
behave the way you might expect, unlike "(__sNx) * (__sNy)"). |
18 |
|
|
|
19 |
|
|
#endif |
20 |
|
|
|
21 |
|
|
|
22 |
|
|
|
23 |
|
|
#if 0 |
24 |
|
|
Define the magic constants. If you want to add (or delete) entries, |
25 |
|
|
note that the change needs to also be made to the C "enum" and the |
26 |
|
|
Fortran "parameter" statements. |
27 |
|
|
|
28 |
|
|
__sFacet : The fundamental unit size of a facet in llc. Facets |
29 |
|
|
one and two are 1unit x 3units, facet three (the arctic |
30 |
|
|
polar facet) is 1unit x 1unit, and facets four and five |
31 |
|
|
are 3units x 1unit. |
32 |
|
|
|
33 |
|
|
__sNx, __sNy : The (sub)tile dimensions. Each must divide __sFacet. |
34 |
|
|
Note that if sub-tiles are being used (i.e. __nSx |
35 |
|
|
and/or __nSy are greater than one), these dimensions |
36 |
|
|
are the extent of each sub-tile. |
37 |
|
|
|
38 |
|
|
__OLx, __OLy : The overlap, i.e. the number of ghost cells. |
39 |
|
|
|
40 |
|
|
__nSx, __nSy : If the code uses parallel threads in (addition to MPI), |
41 |
|
|
the sub-division of an individual tile into sub-tiles. |
42 |
|
|
An MPI process is assigned a whole tile, and each thread |
43 |
|
|
within that process is assigned a sub-tile. Thus, each |
44 |
|
|
MPI process will use (__nSx * __nSy) threads. These |
45 |
|
|
values are usually both "1" (i.e. no threading). |
46 |
|
|
|
47 |
|
|
__nPx, __nPy : The full llc decomposition of the earth contains |
48 |
|
|
(__sFacet/__sNx) * (__sFacet/__sNy) * 13 |
49 |
|
|
total tiles. However, some of these tiles represent |
50 |
|
|
areas that have no water, and so MITgcm doesn't care |
51 |
|
|
about them. (These are called "dry" tiles, or "blank" |
52 |
|
|
tiles.) We take that sub-set of the tiles we care |
53 |
|
|
about (i.e. the "wet" tiles; the ones we are actually |
54 |
|
|
going to do computations on), and imagine those tiles |
55 |
|
|
being in a 2D array, with extent (__nPx, __nPy). |
56 |
|
|
As a practical matter, for the llc decomposition, |
57 |
|
|
__nPy is almost always 1 (and __nPx is equal to the |
58 |
|
|
number of "wet" tiles). |
59 |
|
|
|
60 |
|
|
__Nr : The number of vertical levels in the 3D fields. |
61 |
|
|
#endif |
62 |
|
|
|
63 |
|
|
#if !defined(_MITGCM_MAGIC_CONSTANTS) |
64 |
|
|
#define _MITGCM_MAGIC_CONSTANTS |
65 |
|
|
|
66 |
|
|
#define __sFacet 1080 |
67 |
|
|
#define __sNx 90 |
68 |
|
|
#define __sNy 90 |
69 |
|
|
#define __OLx 8 |
70 |
|
|
#define __OLy 8 |
71 |
|
|
#define __nSx 1 |
72 |
|
|
#define __nSy 1 |
73 |
|
|
#define __nPx 1872-530 |
74 |
|
|
#define __nPy 1 |
75 |
|
|
#define __Nr 90 |
76 |
|
|
|
77 |
|
|
#endif |
78 |
|
|
|
79 |
|
|
|
80 |
|
|
|
81 |
|
|
|
82 |
|
|
#if defined(__STDC__) || defined(__cplusplus) |
83 |
|
|
|
84 |
|
|
/* For C, only include this part once */ |
85 |
|
|
#if !defined(SIZE_h) |
86 |
|
|
#define SIZE_h |
87 |
|
|
|
88 |
|
|
/* |
89 |
|
|
** We use the "enum" hack in order to force the names into the symbol |
90 |
|
|
** table, which "#define" by itself typically does not do. |
91 |
|
|
*/ |
92 |
|
|
enum { |
93 |
|
|
sFacet = (__sFacet), |
94 |
|
|
sNx = (__sNx), |
95 |
|
|
sNy = (__sNy), |
96 |
|
|
OLx = (__OLx), |
97 |
|
|
OLy = (__OLy), |
98 |
|
|
nSx = (__nSx), |
99 |
|
|
nSy = (__nSy), |
100 |
|
|
nPx = (__nPx), |
101 |
|
|
nPy = (__nPy), |
102 |
|
|
Nr = (__Nr), |
103 |
|
|
|
104 |
|
|
Nx = ((__sNx)*(__nSx)*(__nPx)), |
105 |
|
|
Ny = ((__sNy)*(__nSy)*(__nPy)), |
106 |
|
|
MAX_OLX = (OLx), |
107 |
|
|
MAX_OLY = (OLy), |
108 |
|
|
}; |
109 |
|
|
|
110 |
|
|
/* end of "if !defined(SIZE_h)" */ |
111 |
|
|
#endif |
112 |
|
|
|
113 |
|
|
|
114 |
|
|
#else |
115 |
|
|
|
116 |
|
|
|
117 |
|
|
! There are no pre-processor symbols that are guarenteed to be defined |
118 |
|
|
! for a Fortran compile, so we just assume that since this wasn't C/C++, |
119 |
|
|
! it must be Fortran. |
120 |
|
|
|
121 |
|
|
C $Header: /u/gcmpack/MITgcm_contrib/llc_hires/llc_4320/code/SIZE.h_45x45x73408,v 1.2 2016/04/14 03:51:44 dimitri Exp $ |
122 |
|
|
C $Name: $ |
123 |
|
|
C |
124 |
|
|
CBOP |
125 |
|
|
C !ROUTINE: SIZE.h |
126 |
|
|
C !INTERFACE: |
127 |
|
|
C include SIZE.h |
128 |
|
|
C !DESCRIPTION: \bv |
129 |
|
|
C *==========================================================* |
130 |
|
|
C | SIZE.h Declare size of underlying computational grid. |
131 |
|
|
C *==========================================================* |
132 |
|
|
C | The design here support a three-dimensional model grid |
133 |
|
|
C | with indices I,J and K. The three-dimensional domain |
134 |
|
|
C | is comprised of nPx*nSx blocks of size sNx along one axis |
135 |
|
|
C | nPy*nSy blocks of size sNy along another axis and one |
136 |
|
|
C | block of size Nz along the final axis. |
137 |
|
|
C | Blocks have overlap regions of size OLx and OLy along the |
138 |
|
|
C | dimensions that are subdivided. |
139 |
|
|
C *==========================================================* |
140 |
|
|
C \ev |
141 |
|
|
CEOP |
142 |
|
|
C Voodoo numbers controlling data layout. |
143 |
|
|
C sNx :: No. X points in sub-grid. |
144 |
|
|
C sNy :: No. Y points in sub-grid. |
145 |
|
|
C OLx :: Overlap extent in X. |
146 |
|
|
C OLy :: Overlat extent in Y. |
147 |
|
|
C nSx :: No. sub-grids in X. |
148 |
|
|
C nSy :: No. sub-grids in Y. |
149 |
|
|
C nPx :: No. of processes to use in X. |
150 |
|
|
C nPy :: No. of processes to use in Y. |
151 |
|
|
C Nx :: No. points in X for the total domain. |
152 |
|
|
C Ny :: No. points in Y for the total domain. |
153 |
|
|
C Nr :: No. points in Z for full process domain. |
154 |
|
|
|
155 |
|
|
INTEGER sFacet |
156 |
|
|
INTEGER sNx |
157 |
|
|
INTEGER sNy |
158 |
|
|
INTEGER OLx |
159 |
|
|
INTEGER OLy |
160 |
|
|
INTEGER nSx |
161 |
|
|
INTEGER nSy |
162 |
|
|
INTEGER nPx |
163 |
|
|
INTEGER nPy |
164 |
|
|
INTEGER Nx |
165 |
|
|
INTEGER Ny |
166 |
|
|
INTEGER Nr |
167 |
|
|
|
168 |
|
|
PARAMETER ( |
169 |
|
|
& sFacet = (__sFacet), |
170 |
|
|
& sNx = (__sNx), |
171 |
|
|
& sNy = (__sNy), |
172 |
|
|
& OLx = (__OLx), |
173 |
|
|
& OLy = (__OLy), |
174 |
|
|
& nSx = (__nSx), |
175 |
|
|
& nSy = (__nSy), |
176 |
|
|
& nPx = (__nPx), |
177 |
|
|
& nPy = (__nPy), |
178 |
|
|
& Nr = (__Nr) ) |
179 |
|
|
|
180 |
|
|
PARAMETER ( Nx = (__sNx)*(__nSx)*(__nPx) ) |
181 |
|
|
PARAMETER ( Ny = (__sNy)*(__nSy)*(__nPy) ) |
182 |
|
|
|
183 |
|
|
C MAX_OLX :: Set to the maximum overlap region size of any array |
184 |
|
|
C MAX_OLY that will be exchanged. Controls the sizing of exch |
185 |
|
|
C routine buffers. |
186 |
|
|
INTEGER MAX_OLX |
187 |
|
|
INTEGER MAX_OLY |
188 |
|
|
PARAMETER ( MAX_OLX = (OLx), |
189 |
|
|
& MAX_OLY = (OLy) ) |
190 |
|
|
|
191 |
|
|
|
192 |
|
|
#endif |
193 |
|
|
|