/[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.14 - (show annotations) (download)
Sun Feb 4 14:38:44 2001 UTC (23 years, 4 months ago) by cnh
Branch: MAIN
CVS Tags: checkpoint38, c37_adj, checkpoint39, checkpoint37, checkpoint36, checkpoint35
Branch point for: pre38
Changes since 1.13: +2 -1 lines
File MIME type: text/plain
Made sure each .F and .h file had
the CVS keywords Header and Name at its start.
Most had header but very few currently have Name, so
lots of changes!

1 C $Header: /u/gcmpack/models/MITgcmUV/model/inc/GRID.h,v 1.13 2001/02/02 21:04:47 adcroft 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 H - Depth of base of fluid from upper surface f[X,Y] (m).
308 C hFac - Fraction of cell in vertical which is open i.e how
309 C "lopped" a cell is (dimensionless scale factor).
310 C Note: The code needs terms like MIN(hFac,hFac(I+1))
311 C On some platforms it may be better to precompute
312 C hFacW, hFacE, ... here than do MIN on the fly.
313 C rkFac - Vertical coordinate to vertical index orientation.
314 C ( -1 same orientation, 1 opposite orientation )
315 C ( vertical coord == m -> rkFac = 1 )
316 C ( vertical coord == Pa -> rkFac = -1 )
317 C maskW - West face land mask
318 C maskS - South face land mask
319 C recip_dxC - Recipricol of dxC
320 C recip_dxG - Recipricol of dxG
321 C recip_dxF - Recipricol of dxF
322 C recip_dxV - Recipricol of dxV
323 C recip_dyC - Recipricol of dxC
324 C recip_dyG - Recipricol of dyG
325 C recip_dyF - Recipricol of dyF
326 C recip_dyU - Recipricol of dyU
327 C recip_drC - Recipricol of drC
328 C recip_drF - Recipricol of drF
329 C recip_H - Inverse of cell center open-depth
330 C recip_hFacC - Inverse of cell open-depth f[X,Y,Z] ( dimensionless ).
331 C recip_hFacW rhFacC center, rhFacW west, rhFacS south.
332 C recip_hFacS Note: This is precomputed here because it involves division.
333 C saFac - Shallow atmosphere factor (dimensionless scale factor).
334 C xC - X-coordinate of center of cell f[X,Y]. The units of xc, yc
335 C depend on the grid. They are not used in differencing or
336 C averaging but are just a convient quantity for I/O,
337 C diagnostics etc.. As such xc is in m for cartesian
338 C coordinates but degrees for spherical polar.
339 C yC - Y-coordinate of center of cell f[X,Y].
340 C yG - Y-coordinate of corner of cell ( c-grid vorticity point) f[X,Y].
341 C xC0, yC0 - West edge x coord ( metres or degrees )
342 C South edge y coord ( metres or degrees )
343 C rA - R-face are f[X,Y] ( m^2 ).
344 C Note: In a cartesian framework zA is simply dx*dy,
345 C however we use zA to allow for non-globally
346 C orthogonal coordinate frames (with appropriate
347 C metric terms).
348 C rC - R-coordinate of center of cell f[Z] (units of r).
349 C rF - R-coordinate of face of cell f[Z] (units of r).
350 C tanPhiAtU - tan of the latitude at U point. Used for spherical polar
351 C metric term in U equation.
352 C tanPhiAtV - tan of the latitude at V point. Used for spherical polar
353 C metric term in V equation.
354 COMMON /GRID_R/
355 & dxC,dxF,dxG,dxV,dyC,dyF,dyG,dyU,drC,drF,
356 & H,HFacC,HFacW,HFacS,DepthInK,
357 & recip_dxC,recip_dxF,recip_dxG,recip_dxV,
358 & recip_dyC,recip_dyF,recip_dyG,recip_dyU,
359 & recip_drC,recip_drF,
360 & recip_H,
361 & recip_hFacC,recip_hFacW,recip_hFacS,
362 & rkFac, recip_rkFac,
363 & saFac,
364 & xC,yC,rA,rAw,rAs,rAz,rC,rF,yC0,xC0,xG,yG,
365 & maskW,maskS,recip_rA,recip_rAw,recip_rAs,recip_rAz,
366 & tanPhiAtU, tanPhiAtV
367 _RS dxC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
368 _RS dxF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
369 _RS dxG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
370 _RS dxV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
371 _RS dyC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
372 _RS dyF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
373 _RS dyG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
374 _RS dyU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
375 _RS drC (1:Nr)
376 _RS drF (1:Nr)
377 _RS rkFac
378 _RS recip_rkFac
379 _RS DepthInK (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
380 _RS H (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_drC (1:Nr)
393 _RS recip_drF (1:Nr)
394 _RS recip_h (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
395 _RS recip_hFacC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
396 _RS recip_hFacW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
397 _RS recip_hFacS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
398 _RS saFac (1:Nr)
399 _RS xC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
400 _RS xG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
401 _RS xC0
402 _RS yC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
403 _RS yG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
404 _RS yC0
405 _RS rA (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
406 _RS rAw (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
407 _RS rAs (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
408 _RS rAz (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
409 _RS recip_rA (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
410 _RS recip_rAw (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
411 _RS recip_rAs (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
412 _RS recip_rAz (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
413 _RS rC (1:Nr)
414 _RS rF (1:Nr+1)
415 _RS maskW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
416 _RS maskS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
417 _RS tanPhiAtU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
418 _RS tanPhiAtV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
419
420 #ifdef ALLOW_NONHYDROSTATIC
421 COMMON /GRID_NH/
422 & recip_hFacU
423 _RS recip_hFacU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
424 #endif

  ViewVC Help
Powered by ViewVC 1.1.22