/[MITgcm]/MITgcm/model/inc/GRID.h
ViewVC logotype

Contents of /MITgcm/model/inc/GRID.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.15 - (show annotations) (download)
Tue May 29 14:01:36 2001 UTC (23 years ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint40pre3, checkpoint40pre1, checkpoint40pre7, checkpoint40pre6, checkpoint40pre9, checkpoint40pre8, checkpoint40pre2, checkpoint40pre4, checkpoint40pre5, checkpoint40
Changes since 1.14: +35 -26 lines
File MIME type: text/plain
Merge from branch pre38:
 o essential mods for cubed sphere
 o debugged atmosphere, dynamcis + physics (aim)
 o new packages (mom_vecinv, mom_fluxform, ...)

1 C $Header: /u/gcmpack/models/MITgcmUV/model/inc/GRID.h,v 1.14.2.3 2001/03/30 22:44:04 jmc Exp $
2 C $Name: $
3 C
4 C /==========================================================\
5 C | GRID.h |
6 C | o Header file defining model grid. |
7 C |==========================================================|
8 C | Model grid is defined for each process by reference to |
9 C | the arrays set here. |
10 C | Notes |
11 C | ===== |
12 C | The standard MITgcm convention of westmost, southern most|
13 C | and upper most having the (1,1,1) index is used here. |
14 C | i.e. |
15 C |----------------------------------------------------------|
16 C | (1) Plan view schematic of model grid (top layer i.e. ) |
17 C | ================================= ( ocean surface ) |
18 C | ( or top of ) |
19 C | ( atmosphere ) |
20 C | This diagram shows the location of the model |
21 C | prognostic variables on the model grid. The "T" |
22 C | location is used for all tracers. The figure also |
23 C | shows the southern most, western most indexing |
24 C | convention that is used for all model variables. |
25 C | |
26 C | |
27 C | V(i=1, V(i=Nx, |
28 C | j=Ny+1, j=Ny+1, |
29 C | k=1) k=1) |
30 C | /|\ /|\ "PWX" |
31 C | |---------|------------------etc.. |---- *--- |
32 C | | | * | |
33 C |"PWY"*******************************etc.. **********"PWY"|
34 C | | | * | |
35 C | | | * | |
36 C | | | * | |
37 C |U(i=1, ==> x | x *==>U |
38 C | j=Ny,| T(i=1, | T(i=Nx, *(i=Nx+1,|
39 C | k=1) | j=Ny, | j=Ny, * |j=Ny,|
40 C | | k=1) | k=1) * |k=1) |
41 C | |
42 C | . . . |
43 C | . . . |
44 C | . . . |
45 C | e e * e |
46 C | t t * t |
47 C | c c * c |
48 C | | | * | |
49 C | | | * | |
50 C |U(i=1, ==> x | x * | |
51 C | j=2, | T(i=1, | T(i=Nx, * | |
52 C | k=1) | j=2, | j=2, * | |
53 C | | k=1) | k=1) * | |
54 C | | | * | |
55 C | | /|\ | /|\ * | |
56 C | -----------|------------------etc.. |-----*--- |
57 C | | V(i=1, | V(i=Nx, * | |
58 C | | j=2, | j=2, * | |
59 C | | k=1) | k=1) * | |
60 C | | | * | |
61 C |U(i=1, ==> x ==>U(i=2, x *==>U |
62 C | j=1, | T(i=1, | j=1, T(i=Nx, *(i=Nx+1,|
63 C | k=1) | j=1, | k=1) j=1, * |j=1, |
64 C | | k=1) | k=1) * |k=1) |
65 C | | | * | |
66 C | | /|\ | /|\ * | |
67 C |"SB"++>|---------|------------------etc.. |-----*--- |
68 C | /+\ V(i=1, V(i=Nx, * |
69 C | + j=1, j=1, * |
70 C | + k=1) k=1) * |
71 C | "WB" "PWX" |
72 C | |
73 C | N, y increasing northwards |
74 C | /|\ j increasing northwards |
75 C | | |
76 C | | |
77 C | ======>E, x increasing eastwards |
78 C | i increasing eastwards |
79 C | |
80 C | i: East-west index |
81 C | j: North-south index |
82 C | k: up-down index |
83 C | U: x-velocity (m/s) |
84 C | V: y-velocity (m/s) |
85 C | T: potential temperature (oC) |
86 C | "SB": Southern boundary |
87 C | "WB": Western boundary |
88 C |"PWX": Periodic wrap around in X. |
89 C |"PWY": Periodic wrap around in Y. |
90 C |----------------------------------------------------------|
91 C | (2) South elevation schematic of model grid |
92 C | ======================================= |
93 C | This diagram shows the location of the model |
94 C | prognostic variables on the model grid. The "T" |
95 C | location is used for all tracers. The figure also |
96 C | shows the upper most, western most indexing |
97 C | convention that is used for all model variables. |
98 C | |
99 C | "WB" |
100 C | + |
101 C | + |
102 C | \+/ /|\ /|\ |
103 C |"UB"++>|-------- | -----------------etc.. | ----*--- |
104 C | | rVel(i=1, | rVel(i=Nx, * | |
105 C | | j=1, | j=1, * | |
106 C | | k=1) | k=1) * | |
107 C | | | * | |
108 C |U(i=1, ==> x ==>U(i=2, x *==>U |
109 C | j=1, | T(i=1, | j=1, T(i=Nx, *(i=Nx+1,|
110 C | k=1) | j=1, | k=1) j=1, * |j=1, |
111 C | | k=1) | k=1) * |k=1) |
112 C | | | * | |
113 C | | /|\ | /|\ * | |
114 C | |-------- | -----------------etc.. | ----*--- |
115 C | | rVel(i=1, | rVel(i=Nx, * | |
116 C | | j=1, | j=1, * | |
117 C | | k=2) | k=2) * | |
118 C | |
119 C | . . . |
120 C | . . . |
121 C | . . . |
122 C | e e * e |
123 C | t t * t |
124 C | c c * c |
125 C | | | * | |
126 C | | | * | |
127 C | | | * | |
128 C | | | * | |
129 C | | /|\ | /|\ * | |
130 C | |-------- | -----------------etc.. | ----*--- |
131 C | | rVel(i=1, | rVel(i=Nx, * | |
132 C | | j=1, | j=1, * | |
133 C | | k=Nr) | k=Nr) * | |
134 C |U(i=1, ==> x ==>U(i=2, x *==>U |
135 C | j=1, | T(i=1, | j=1, T(i=Nx, *(i=Nx+1,|
136 C | k=Nr)| j=1, | k=Nr) j=1, * |j=1, |
137 C | | k=Nr) | k=Nr) * |k=Nr)|
138 C | | | * | |
139 C |"LB"++>============================================== |
140 C | "PWX" |
141 C | |
142 C | Up increasing upwards. |
143 C |/|\ |
144 C | | |
145 C | | |
146 C | =====> E i increasing eastwards |
147 C | | x increasing eastwards |
148 C | | |
149 C |\|/ |
150 C | Down,k increasing downwards. |
151 C | |
152 C | Note: r => height (m) => r increases upwards |
153 C | r => pressure (Pa) => r increases downwards |
154 C | |
155 C | |
156 C | i: East-west index |
157 C | j: North-south index |
158 C | k: up-down index |
159 C | U: x-velocity (m/s) |
160 C | rVel: z-velocity ( units of r ) |
161 C | The vertical velocity variable rVel is in units of |
162 C | "r" the vertical coordinate. r in m will give |
163 C | rVel m/s. r in Pa will give rVel Pa/s. |
164 C | T: potential temperature (oC) |
165 C | "UB": Upper boundary. |
166 C | "LB": Lower boundary (always solid - therefore om|w == 0)|
167 C | "WB": Western boundary |
168 C |"PWX": Periodic wrap around in X. |
169 C |----------------------------------------------------------|
170 C | (3) Views showing nomenclature and indexing |
171 C | for grid descriptor variables. |
172 C | |
173 C | Fig 3a. shows the orientation, indexing and |
174 C | notation for the grid spacing terms used internally |
175 C | for the evaluation of gradient and averaging terms. |
176 C | These varaibles are set based on the model input |
177 C | parameters which define the model grid in terms of |
178 C | spacing in X, Y and Z. |
179 C | |
180 C | Fig 3b. shows the orientation, indexing and |
181 C | notation for the variables that are used to define |
182 C | the model grid. These varaibles are set directly |
183 C | from the model input. |
184 C | |
185 C | Figure 3a |
186 C | ========= |
187 C | |------------------------------------ |
188 C | | | |
189 C |"PWY"********************************* etc... |
190 C | | | |
191 C | | | |
192 C | | | |
193 C | | | |
194 C | | | |
195 C | | | |
196 C | | | |
197 C | |
198 C | . . |
199 C | . . |
200 C | . . |
201 C | e e |
202 C | t t |
203 C | c c |
204 C | |-----------v-----------|-----------v----------|- |
205 C | | | | |
206 C | | | | |
207 C | | | | |
208 C | | | | |
209 C | | | | |
210 C | u<--dxF(i=1,j=2,k=1)--->u t | |
211 C | |/|\ /|\ | | |
212 C | | | | | | |
213 C | | | | | | |
214 C | | | | | | |
215 C | |dyU(i=1, dyC(i=1, | | |
216 C | --- ---|--j=2,---|--j=2,-----------------v----------|- |
217 C | /|\ | | k=1) | k=1) | /|\ | |
218 C | | | | | | dyF(i=2, | |
219 C | | | | | | | j=1, | |
220 C |dyG( |\|/ \|/ | | k=1) | |
221 C | i=1,u--- t<---dxC(i=2,j=1,k=1)-->t | |
222 C | j=1,| | | | |
223 C | k=1)| | | | |
224 C | | | | | | |
225 C | | | | | | |
226 C | \|/ | |<---dxV(i=2,j=1,k=1)--\|/ | |
227 C |"SB"++>|___________v___________|___________v__________|_ |
228 C | <--dxG(i=1,j=1,k=1)-----> |
229 C | /+\ |
230 C | + |
231 C | + |
232 C | "WB" |
233 C | |
234 C | N, y increasing northwards |
235 C | /|\ j increasing northwards |
236 C | | |
237 C | | |
238 C | ======>E, x increasing eastwards |
239 C | i increasing eastwards |
240 C | |
241 C | i: East-west index |
242 C | j: North-south index |
243 C | k: up-down index |
244 C | u: x-velocity point |
245 C | V: y-velocity point |
246 C | t: tracer point |
247 C | "SB": Southern boundary |
248 C | "WB": Western boundary |
249 C |"PWX": Periodic wrap around in X. |
250 C |"PWY": Periodic wrap around in Y. |
251 C | |
252 C | Figure 3b |
253 C | ========= |
254 C | |
255 C | . . |
256 C | . . |
257 C | . . |
258 C | e e |
259 C | t t |
260 C | c c |
261 C | |-----------v-----------|-----------v--etc... |
262 C | | | |
263 C | | | |
264 C | | | |
265 C | | | |
266 C | | | |
267 C | u<--delX(i=1)---------->u t |
268 C | | | |
269 C | | | |
270 C | | | |
271 C | | | |
272 C | | | |
273 C | |-----------v-----------------------v--etc... |
274 C | | /|\ | |
275 C | | | | |
276 C | | | | |
277 C | | | | |
278 C | u delY(j=1) | t |
279 C | | | | |
280 C | | | | |
281 C | | | | |
282 C | | | | |
283 C | | \|/ | |
284 C |"SB"++>|___________v___________|___________v__etc... |
285 C | /+\ |
286 C | + |
287 C | + |
288 C | "WB" |
289 C | |
290 C \==========================================================/
291
292 C Macros that override/modify standard definitions
293 #include "GRID_MACROS.h"
294
295 C
296 C-- COMMON /GRID_R/ REAL valued grid defining variables.
297 C dxC - Cell center separation in X across western cell wall (m)
298 C dxG - Cell face separation in X along southern cell wall (m)
299 C dxF - Cell face separation in X thru cell center (m)
300 C dxV - V-point separation in X across south-west corner of cell (m)
301 C dyC - Cell center separation in Y across southern cell wall (m)
302 C dyG - Cell face separation in Y along western cell wall (m)
303 C dyF - Cell face separation in Y thru cell center (m)
304 C dyU - U-point separation in Y across south-west corner of cell (m)
305 C drC - Cell center separation along Z axis ( units of r ).
306 C drF - Cell face separation along Z axis ( units of r ).
307 C Rcolumn -Total thickness (in r_unit) of the fluid column
308 C R_low - base of fluid in r_unit (Depth(m) / Pressure(Pa) at top Atmos.)
309 C Ro_surf- surface reference (at rest) position, r_unit.
310 C hFac - Fraction of cell in vertical which is open i.e how
311 C "lopped" a cell is (dimensionless scale factor).
312 C Note: The code needs terms like MIN(hFac,hFac(I+1))
313 C On some platforms it may be better to precompute
314 C hFacW, hFacE, ... here than do MIN on the fly.
315 C rkFac - Vertical coordinate to vertical index orientation.
316 C ( -1 same orientation, 1 opposite orientation )
317 C ( vertical coord == m -> rkFac = 1 )
318 C ( vertical coord == Pa -> rkFac = -1 )
319 C maskC - cell Center land mask
320 C maskW - West face land mask
321 C maskS - South face land mask
322 C recip_dxC - Recipricol of dxC
323 C recip_dxG - Recipricol of dxG
324 C recip_dxF - Recipricol of dxF
325 C recip_dxV - Recipricol of dxV
326 C recip_dyC - Recipricol of dxC
327 C recip_dyG - Recipricol of dyG
328 C recip_dyF - Recipricol of dyF
329 C recip_dyU - Recipricol of dyU
330 C recip_drC - Recipricol of drC
331 C recip_drF - Recipricol of drF
332 C recip_Rcol - Inverse of cell center column thickness (1/r_unit)
333 C recip_hFacC - Inverse of cell open-depth f[X,Y,Z] ( dimensionless ).
334 C recip_hFacW rhFacC center, rhFacW west, rhFacS south.
335 C recip_hFacS Note: This is precomputed here because it involves division.
336 C saFac - Shallow atmosphere factor (dimensionless scale factor).
337 C xC - X-coordinate of center of cell f[X,Y]. The units of xc, yc
338 C depend on the grid. They are not used in differencing or
339 C averaging but are just a convient quantity for I/O,
340 C diagnostics etc.. As such xc is in m for cartesian
341 C coordinates but degrees for spherical polar.
342 C yC - Y-coordinate of center of cell f[X,Y].
343 C yG - Y-coordinate of corner of cell ( c-grid vorticity point) f[X,Y].
344 C xC0, yC0 - West edge x coord ( metres or degrees )
345 C South edge y coord ( metres or degrees )
346 C rA - R-face are f[X,Y] ( m^2 ).
347 C Note: In a cartesian framework zA is simply dx*dy,
348 C however we use zA to allow for non-globally
349 C orthogonal coordinate frames (with appropriate
350 C metric terms).
351 C rC - R-coordinate of center of cell f[Z] (units of r).
352 C rF - R-coordinate of face of cell f[Z] (units of r).
353 C tanPhiAtU - tan of the latitude at U point. Used for spherical polar
354 C metric term in U equation.
355 C tanPhiAtV - tan of the latitude at V point. Used for spherical polar
356 C metric term in V equation.
357 COMMON /GRID_R/
358 & dxC,dxF,dxG,dxV,dyC,dyF,dyG,dyU,
359 & R_low,Ro_surf,HFacC,HFacW,HFacS,
360 & recip_dxC,recip_dxF,recip_dxG,recip_dxV,
361 & recip_dyC,recip_dyF,recip_dyG,recip_dyU,
362 & recip_Rcol,
363 & recip_hFacC,recip_hFacW,recip_hFacS,
364 & saFac,
365 & xC,yC,rA,rAw,rAs,rAz,xG,yG,
366 & maskC,maskW,maskS,recip_rA,recip_rAw,recip_rAs,recip_rAz,
367 & tanPhiAtU, tanPhiAtV,
368 & cosfacU,cosfacV,sqcosfacU,sqcosfacV,
369 & drC,drF,recip_drC,recip_drF,rC,rF,
370 & rkFac, recip_rkFac, xC0, yC0
371 _RS dxC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
372 _RS dxF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
373 _RS dxG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
374 _RS dxV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
375 _RS dyC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
376 _RS dyF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
377 _RS dyG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
378 _RS dyU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
379 _RS R_low (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
380 _RS Ro_surf (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
381 _RS HFacC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
382 _RS HFacW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
383 _RS HFacS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
384 _RS recip_dxC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
385 _RS recip_dxF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
386 _RS recip_dxG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
387 _RS recip_dxV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
388 _RS recip_dyC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
389 _RS recip_dyF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
390 _RS recip_dyG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
391 _RS recip_dyU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
392 _RS recip_Rcol (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
393 _RS recip_hFacC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
394 _RS recip_hFacW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
395 _RS recip_hFacS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
396 _RS xC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
397 _RS xG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
398 _RS yC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
399 _RS yG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
400 _RS rA (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
401 _RS rAw (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
402 _RS rAs (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
403 _RS rAz (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
404 _RS recip_rA (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
405 _RS recip_rAw (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
406 _RS recip_rAs (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
407 _RS recip_rAz (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
408 _RS maskC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
409 _RS maskW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
410 _RS maskS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
411 _RS tanPhiAtU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
412 _RS tanPhiAtV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
413 _RL cosfacU(1-Oly:sNy+Oly,nSx,nSy)
414 _RL cosfacV(1-Oly:sNy+Oly,nSx,nSy)
415 _RL sqcosfacU(1-Oly:sNy+Oly,nSx,nSy)
416 _RL sqcosfacV(1-Oly:sNy+Oly,nSx,nSy)
417 _RS drC (1:Nr)
418 _RS drF (1:Nr)
419 _RS recip_drC (1:Nr)
420 _RS recip_drF (1:Nr)
421 _RS saFac (1:Nr)
422 _RS rC (1:Nr)
423 _RS rF (1:Nr+1)
424 _RS rkFac
425 _RS recip_rkFac
426 _RS xC0
427 _RS yC0
428
429 #ifdef ALLOW_NONHYDROSTATIC
430 COMMON /GRID_NH/
431 & recip_hFacU
432 _RS recip_hFacU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
433 #endif

  ViewVC Help
Powered by ViewVC 1.1.22