1 |
cnh |
1.3 |
C $Header: /u/gcmpack/models/MITgcmUV/model/inc/GRID.h,v 1.2 1998/04/24 02:11:36 cnh Exp $ |
2 |
cnh |
1.1 |
C |
3 |
|
|
C /==========================================================\ |
4 |
|
|
C | GRID.h | |
5 |
|
|
C | o Header file defining model grid. | |
6 |
|
|
C |==========================================================| |
7 |
|
|
C | Model grid is defined for each process by reference to | |
8 |
|
|
C | the arrays set here. | |
9 |
|
|
C | Notes | |
10 |
|
|
C | ===== | |
11 |
|
|
C | The standard MITgcm convention of westmost, southern most| |
12 |
|
|
C | and upper most having the (1,1,1) index is used here. | |
13 |
|
|
C | i.e. | |
14 |
|
|
C |----------------------------------------------------------| |
15 |
|
|
C | (1) Plan view schematic of model grid (top layer i.e. ) | |
16 |
|
|
C | ================================= ( ocean surface ) | |
17 |
|
|
C | ( or top of ) | |
18 |
|
|
C | ( atmosphere ) | |
19 |
|
|
C | This diagram shows the location of the model | |
20 |
|
|
C | prognostic variables on the model grid. The "T" | |
21 |
|
|
C | location is used for all tracers. The figure also | |
22 |
|
|
C | shows the southern most, western most indexing | |
23 |
|
|
C | convention that is used for all model variables. | |
24 |
|
|
C | | |
25 |
|
|
C | | |
26 |
|
|
C | V(i=1, V(i=Nx, | |
27 |
|
|
C | j=Ny+1, j=Ny+1, | |
28 |
|
|
C | k=1) k=1) | |
29 |
|
|
C | /|\ /|\ "PWX" | |
30 |
|
|
C | |---------|------------------etc.. |---- *--- | |
31 |
|
|
C | | | * | | |
32 |
|
|
C |"PWY"*******************************etc.. **********"PWY"| |
33 |
|
|
C | | | * | | |
34 |
|
|
C | | | * | | |
35 |
|
|
C | | | * | | |
36 |
|
|
C |U(i=1, ==> x | x *==>U | |
37 |
|
|
C | j=Ny,| T(i=1, | T(i=Nx, *(i=Nx+1,| |
38 |
|
|
C | k=1) | j=Ny, | j=Ny, * |j=Ny,| |
39 |
|
|
C | | k=1) | k=1) * |k=1) | |
40 |
|
|
C | | |
41 |
|
|
C | . . . | |
42 |
|
|
C | . . . | |
43 |
|
|
C | . . . | |
44 |
|
|
C | e e * e | |
45 |
|
|
C | t t * t | |
46 |
|
|
C | c c * c | |
47 |
|
|
C | | | * | | |
48 |
|
|
C | | | * | | |
49 |
|
|
C |U(i=1, ==> x | x * | | |
50 |
|
|
C | j=2, | T(i=1, | T(i=Nx, * | | |
51 |
|
|
C | k=1) | j=2, | j=2, * | | |
52 |
|
|
C | | k=1) | k=1) * | | |
53 |
|
|
C | | | * | | |
54 |
|
|
C | | /|\ | /|\ * | | |
55 |
|
|
C | -----------|------------------etc.. |-----*--- | |
56 |
|
|
C | | V(i=1, | V(i=Nx, * | | |
57 |
|
|
C | | j=2, | j=2, * | | |
58 |
|
|
C | | k=1) | k=1) * | | |
59 |
|
|
C | | | * | | |
60 |
|
|
C |U(i=1, ==> x ==>U(i=2, x *==>U | |
61 |
|
|
C | j=1, | T(i=1, | j=1, T(i=Nx, *(i=Nx+1,| |
62 |
|
|
C | k=1) | j=1, | k=1) j=1, * |j=1, | |
63 |
|
|
C | | k=1) | k=1) * |k=1) | |
64 |
|
|
C | | | * | | |
65 |
|
|
C | | /|\ | /|\ * | | |
66 |
|
|
C |"SB"++>|---------|------------------etc.. |-----*--- | |
67 |
|
|
C | /+\ V(i=1, V(i=Nx, * | |
68 |
|
|
C | + j=1, j=1, * | |
69 |
|
|
C | + k=1) k=1) * | |
70 |
|
|
C | "WB" "PWX" | |
71 |
|
|
C | | |
72 |
|
|
C | N, y increasing northwards | |
73 |
|
|
C | /|\ j increasing northwards | |
74 |
|
|
C | | | |
75 |
|
|
C | | | |
76 |
|
|
C | ======>E, x increasing eastwards | |
77 |
|
|
C | i increasing eastwards | |
78 |
|
|
C | | |
79 |
|
|
C | i: East-west index | |
80 |
|
|
C | j: North-south index | |
81 |
|
|
C | k: up-down index | |
82 |
|
|
C | U: x-velocity (m/s) | |
83 |
|
|
C | V: y-velocity (m/s) | |
84 |
|
|
C | T: potential temperature (oC) | |
85 |
|
|
C | "SB": Southern boundary | |
86 |
|
|
C | "WB": Western boundary | |
87 |
|
|
C |"PWX": Periodic wrap around in X. | |
88 |
|
|
C |"PWY": Periodic wrap around in Y. | |
89 |
|
|
C |----------------------------------------------------------| |
90 |
|
|
C | (2) South elevation schematic of model grid | |
91 |
|
|
C | ======================================= | |
92 |
|
|
C | This diagram shows the location of the model | |
93 |
|
|
C | prognostic variables on the model grid. The "T" | |
94 |
|
|
C | location is used for all tracers. The figure also | |
95 |
|
|
C | shows the upper most, western most indexing | |
96 |
|
|
C | convention that is used for all model variables. | |
97 |
|
|
C | | |
98 |
|
|
C | "WB" | |
99 |
|
|
C | + | |
100 |
|
|
C | + | |
101 |
|
|
C | \+/ | | | |
102 |
|
|
C |"UB"++>|--------\|/-----------------etc.. \|/----*--- | |
103 |
|
|
C | | w,om(i=1, | w,om(i=Nx, * | | |
104 |
|
|
C | | j=1, | j=1, * | | |
105 |
|
|
C | | k=1) | k=1) * | | |
106 |
|
|
C | | | * | | |
107 |
|
|
C |U(i=1, ==> x ==>U(i=2, x *==>U | |
108 |
|
|
C | j=1, | T(i=1, | j=1, T(i=Nx, *(i=Nx+1,| |
109 |
|
|
C | k=1) | j=1, | k=1) j=1, * |j=1, | |
110 |
|
|
C | | k=1) | k=1) * |k=1) | |
111 |
|
|
C | | | * | | |
112 |
|
|
C | | | | | * | | |
113 |
|
|
C | |--------\|/-----------------etc.. \|/----*--- | |
114 |
|
|
C | | w,om(i=1, | w,om(i=Nx, * | | |
115 |
|
|
C | | j=1, | j=1, * | | |
116 |
|
|
C | | k=2) | k=2) * | | |
117 |
|
|
C | | |
118 |
|
|
C | . . . | |
119 |
|
|
C | . . . | |
120 |
|
|
C | . . . | |
121 |
|
|
C | e e * e | |
122 |
|
|
C | t t * t | |
123 |
|
|
C | c c * c | |
124 |
|
|
C | | | * | | |
125 |
|
|
C | | | * | | |
126 |
|
|
C | | | * | | |
127 |
|
|
C | | | * | | |
128 |
|
|
C | | | | | * | | |
129 |
|
|
C | |--------\|/-----------------etc.. \|/----*--- | |
130 |
|
|
C | | w,om(i=1, | w,om(i=Nx, * | | |
131 |
|
|
C | | j=1, | j=1, * | | |
132 |
|
|
C | | k=Nz) | k=Nz) * | | |
133 |
|
|
C |U(i=1, ==> x ==>U(i=2, x *==>U | |
134 |
|
|
C | j=1, | T(i=1, | j=1, T(i=Nx, *(i=Nx+1,| |
135 |
|
|
C | k=Nz)| j=1, | k=Nz) j=1, * |j=1, | |
136 |
|
|
C | | k=Nz) | k=Nz) * |k=Nz)| |
137 |
|
|
C | | | * | | |
138 |
|
|
C |"LB"++>============================================== | |
139 |
|
|
C | "PWX" | |
140 |
|
|
C | | |
141 |
|
|
C | Up,z increasing upwards. | |
142 |
|
|
C |/|\ | |
143 |
|
|
C | | | |
144 |
|
|
C | | | |
145 |
|
|
C | =====> E i increasing eastwards | |
146 |
|
|
C | | x increasing eastwards | |
147 |
|
|
C | | | |
148 |
|
|
C |\|/ | |
149 |
|
|
C | Down,k increasing downwards. | |
150 |
|
|
C | | |
151 |
|
|
C | i: East-west index | |
152 |
|
|
C | j: North-south index | |
153 |
|
|
C | k: up-down index | |
154 |
|
|
C | U: x-velocity (m/s) | |
155 |
|
|
C | w,om: z-velocity (Pa/s - therefore +ve is down) | |
156 |
|
|
C | The vertical velocity variable is sometimes named | |
157 |
|
|
C | "w" in the model code. The vertical coordinate and | |
158 |
|
|
C | also gridding are both under review - watch this | |
159 |
|
|
C | space! | |
160 |
|
|
C | T: potential temperature (oC) | |
161 |
|
|
C | "UB": Upper boundary. | |
162 |
|
|
C | "LB": Lower boundary (always solid - therefore om|w == 0)| |
163 |
|
|
C | "WB": Western boundary | |
164 |
|
|
C |"PWX": Periodic wrap around in X. | |
165 |
|
|
C |----------------------------------------------------------| |
166 |
|
|
C | (3) Views showing nomenclature and indexing | |
167 |
|
|
C | for grid descriptor variables. | |
168 |
|
|
C | | |
169 |
|
|
C | Fig 3a. shows the orientation, indexing and | |
170 |
|
|
C | notation for the grid spacing terms used internally | |
171 |
|
|
C | for the evaluation of gradient and averaging terms. | |
172 |
|
|
C | These varaibles are set based on the model input | |
173 |
|
|
C | parameters which define the model grid in terms of | |
174 |
|
|
C | spacing in X, Y and Z. | |
175 |
|
|
C | | |
176 |
|
|
C | Fig 3b. shows the orientation, indexing and | |
177 |
|
|
C | notation for the variables that are used to define | |
178 |
|
|
C | the model grid. These varaibles are set directly | |
179 |
|
|
C | from the model input. | |
180 |
|
|
C | | |
181 |
|
|
C | Figure 3a | |
182 |
|
|
C | ========= | |
183 |
|
|
C | |------------------------------------ | |
184 |
|
|
C | | | | |
185 |
|
|
C |"PWY"********************************* etc... | |
186 |
|
|
C | | | | |
187 |
|
|
C | | | | |
188 |
|
|
C | | | | |
189 |
|
|
C | | | | |
190 |
|
|
C | | | | |
191 |
|
|
C | | | | |
192 |
|
|
C | | | | |
193 |
|
|
C | | |
194 |
|
|
C | . . | |
195 |
|
|
C | . . | |
196 |
|
|
C | . . | |
197 |
|
|
C | e e | |
198 |
|
|
C | t t | |
199 |
|
|
C | c c | |
200 |
|
|
C | |-----------v-----------|-----------v----------|- | |
201 |
|
|
C | | | | | |
202 |
|
|
C | | | | | |
203 |
|
|
C | | | | | |
204 |
|
|
C | | | | | |
205 |
|
|
C | | | | | |
206 |
|
|
C | u<--dxF(i=1,j=2,k=1)--->u t | | |
207 |
|
|
C | |/|\ /|\ | | | |
208 |
|
|
C | | | | | | | |
209 |
|
|
C | | | | | | | |
210 |
|
|
C | | | | | | | |
211 |
|
|
C | |dyU(i=1, dyC(i=1, | | | |
212 |
|
|
C | --- ---|--j=2,---|--j=2,-----------------v----------|- | |
213 |
|
|
C | /|\ | | k=1) | k=1) | /|\ | | |
214 |
|
|
C | | | | | | dyF(i=2, | | |
215 |
|
|
C | | | | | | | j=1, | | |
216 |
|
|
C |dyG( |\|/ \|/ | | k=1) | | |
217 |
|
|
C | i=1,u--- t<---dxC(i=2,j=1,k=1)-->t | | |
218 |
|
|
C | j=1,| | | | | |
219 |
|
|
C | k=1)| | | | | |
220 |
|
|
C | | | | | | | |
221 |
|
|
C | | | | | | | |
222 |
|
|
C | \|/ | |<---dxV(i=2,j=1,k=1)--\|/ | | |
223 |
|
|
C |"SB"++>|___________v___________|___________v__________|_ | |
224 |
|
|
C | <--dxG(i=1,j=1,k=1)-----> | |
225 |
|
|
C | /+\ | |
226 |
|
|
C | + | |
227 |
|
|
C | + | |
228 |
|
|
C | "WB" | |
229 |
|
|
C | | |
230 |
|
|
C | N, y increasing northwards | |
231 |
|
|
C | /|\ j increasing northwards | |
232 |
|
|
C | | | |
233 |
|
|
C | | | |
234 |
|
|
C | ======>E, x increasing eastwards | |
235 |
|
|
C | i increasing eastwards | |
236 |
|
|
C | | |
237 |
|
|
C | i: East-west index | |
238 |
|
|
C | j: North-south index | |
239 |
|
|
C | k: up-down index | |
240 |
|
|
C | u: x-velocity point | |
241 |
|
|
C | V: y-velocity point | |
242 |
|
|
C | t: tracer point | |
243 |
|
|
C | "SB": Southern boundary | |
244 |
|
|
C | "WB": Western boundary | |
245 |
|
|
C |"PWX": Periodic wrap around in X. | |
246 |
|
|
C |"PWY": Periodic wrap around in Y. | |
247 |
|
|
C | | |
248 |
|
|
C | Figure 3b | |
249 |
|
|
C | ========= | |
250 |
|
|
C | | |
251 |
|
|
C | . . | |
252 |
|
|
C | . . | |
253 |
|
|
C | . . | |
254 |
|
|
C | e e | |
255 |
|
|
C | t t | |
256 |
|
|
C | c c | |
257 |
|
|
C | |-----------v-----------|-----------v--etc... | |
258 |
|
|
C | | | | |
259 |
|
|
C | | | | |
260 |
|
|
C | | | | |
261 |
|
|
C | | | | |
262 |
|
|
C | | | | |
263 |
|
|
C | u<--delX(i=1)---------->u t | |
264 |
|
|
C | | | | |
265 |
|
|
C | | | | |
266 |
|
|
C | | | | |
267 |
|
|
C | | | | |
268 |
|
|
C | | | | |
269 |
|
|
C | |-----------v-----------------------v--etc... | |
270 |
|
|
C | | /|\ | | |
271 |
|
|
C | | | | | |
272 |
|
|
C | | | | | |
273 |
|
|
C | | | | | |
274 |
|
|
C | u delY(j=1) | t | |
275 |
|
|
C | | | | | |
276 |
|
|
C | | | | | |
277 |
|
|
C | | | | | |
278 |
|
|
C | | | | | |
279 |
|
|
C | | \|/ | | |
280 |
|
|
C |"SB"++>|___________v___________|___________v__etc... | |
281 |
|
|
C | /+\ | |
282 |
|
|
C | + | |
283 |
|
|
C | + | |
284 |
|
|
C | "WB" | |
285 |
|
|
C | | |
286 |
|
|
C \==========================================================/ |
287 |
cnh |
1.3 |
|
288 |
|
|
C Macros that override/modify standard definitions |
289 |
|
|
#include "GRID_MACROS.h" |
290 |
|
|
|
291 |
cnh |
1.1 |
C |
292 |
|
|
C-- COMMON /GRID_R/ REAL valued grid defining variables. |
293 |
|
|
C dxC - Cell center separation in X across western cell wall (m) |
294 |
|
|
C dxG - Cell face separation in X along southern cell wall (m) |
295 |
|
|
C dxF - Cell face separation in X thru cell center (m) |
296 |
|
|
C dxV - V-point separation in X across south-west corner of cell (m) |
297 |
|
|
C dyC - Cell center separation in Y across southern cell wall (m) |
298 |
|
|
C dyG - Cell face separation in Y along western cell wall (m) |
299 |
|
|
C dyF - Cell face separation in Y thru cell center (m) |
300 |
|
|
C dyU - U-point separation in Y across south-west corner of cell (m) |
301 |
|
|
C dzC - Cell center separation in Z (Pa). |
302 |
|
|
C dzF - Cell face separation in Z (Pa). |
303 |
|
|
C H - Depth of base of fluid from upper surface f[X,Y] (m). |
304 |
|
|
C hFac - Fraction of cell in vertical which is open i.e how |
305 |
|
|
C "lopped" a cell is (dimensionless scale factor). |
306 |
|
|
C Note: The code needs terms like MIN(hFac,hFac(I+1)) |
307 |
|
|
C On some platforms it may be better to precompute |
308 |
|
|
C hFacW, hFacE, ... here than do MIN on the fly. |
309 |
|
|
C maskW - West face land mask |
310 |
|
|
C maskS - South face land mask |
311 |
|
|
C rdxC - Recipricol of dxC |
312 |
|
|
C rdxG - Recipricol of dxG |
313 |
|
|
C rdxF - Recipricol of dxF |
314 |
|
|
C rdxV - Recipricol of dxV |
315 |
|
|
C rdyC - Recipricol of dxC |
316 |
|
|
C rdyG - Recipricol of dyG |
317 |
|
|
C rdyF - Recipricol of dyF |
318 |
|
|
C rdyU - Recipricol of dyU |
319 |
|
|
C rdzC - Recipricol of dzC |
320 |
|
|
C rdzF - Recipricol of dzF |
321 |
|
|
C rh - Inverse of cell center open-depth |
322 |
|
|
C rhFacC - Inverse of cell open-depth f[X,Y,Z] ( dimensionless ). |
323 |
|
|
C rhFacW rhFacC center, rhFacW west, rhFacS south. |
324 |
|
|
C rhFacS Note: This is precomputed here because it involves division. |
325 |
|
|
C saFac - Shallow atmosphere factor (dimensionless scale factor). |
326 |
|
|
C xC - X-coordinate of center of cell f[X,Y]. The units of xc, yc |
327 |
|
|
C depend on the grid. They are not used in differencing or |
328 |
|
|
C averaging but are just a convient quantity for I/O, |
329 |
|
|
C diagnostics etc.. As such xc is in m for cartesian |
330 |
|
|
C coordinates but degrees for spherical polar. |
331 |
|
|
C yC - Y-coordinate of center of cell f[X,Y]. |
332 |
|
|
C zA - Z-face are f[X,Y] (m^2). |
333 |
|
|
C Note: In a cartesian framework zA is simply dx*dy, |
334 |
|
|
C however we use zA to allow for non-globally |
335 |
|
|
C orthogonal coordinate frames (with appropriate |
336 |
|
|
C metric terms). |
337 |
|
|
C zC - Z-coordinate of center of cell f[Z] |
338 |
|
|
C zFace - Z-coordinate of face of cell f[Z] (Pa). |
339 |
|
|
COMMON /GRID_R/ |
340 |
|
|
& dxC,dxF,dxG,dxV,dyC,dyF,dyG,dyU,dzC,dzF, |
341 |
|
|
& H,HFacC,HFacW,HFacS, |
342 |
|
|
& rdxC,rdxF,rdxG,rdxV,rdyC,rdyF,rdyG,rdyU,rdzC,rdzF, |
343 |
|
|
& rH, rhFacC,rhFacW,rhFacS, |
344 |
|
|
& saFac,xC,yC,zA,zC,zFace, |
345 |
|
|
& maskW,maskS |
346 |
cnh |
1.3 |
_RS dxC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nS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nSx,nSy) |
367 |
|
|
_RS rdyU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
368 |
|
|
_RS rdzC (1:Nz) |
369 |
|
|
_RS rdzF (1:Nz) |
370 |
|
|
_RS rh (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
371 |
|
|
_RS rhFacC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nz,nSx,nSy) |
372 |
|
|
_RS rhFacW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nz,nSx,nSy) |
373 |
|
|
_RS rhFacS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nz,nSx,nSy) |
374 |
|
|
_RS saFac (1:Nz) |
375 |
|
|
_RS xC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
376 |
|
|
_RS yC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
377 |
|
|
_RS zA (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
378 |
|
|
_RS zC (1:Nz) |
379 |
|
|
_RS zFace (1:Nz+1) |
380 |
|
|
_RS maskW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nz,nSx,nSy) |
381 |
|
|
_RS maskS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nz,nSx,nSy) |
382 |
cnh |
1.1 |
|
383 |
|
|
|
384 |
|
|
C-- COMMON /GRID_I/ Integer valued grid defining variables |
385 |
|
|
C iDep - Index of last "non-land" cell for each column f[X,Y]. |
386 |
|
|
COMMON /GRID_I/ |
387 |
|
|
& iDep |
388 |
|
|
INTEGER iDep(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |