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

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

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


Revision 1.9 - (hide annotations) (download)
Tue Sep 8 01:37:49 1998 UTC (25 years, 8 months ago) by cnh
Branch: MAIN
CVS Tags: checkpoint14
Changes since 1.8: +2 -7 lines
File MIME type: text/plain
Consistent isomorphism changes

1 cnh 1.9 C $Header: /u/gcmpack/models/MITgcmUV/model/inc/GRID.h,v 1.8 1998/09/06 14:49:23 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 cnh 1.5 C | \+/ /|\ /|\ |
102     C |"UB"++>|-------- | -----------------etc.. | ----*--- |
103     C | | rVel(i=1, | rVel(i=Nx, * | |
104 cnh 1.1 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 cnh 1.5 C | | /|\ | /|\ * | |
113     C | |-------- | -----------------etc.. | ----*--- |
114     C | | rVel(i=1, | rVel(i=Nx, * | |
115 cnh 1.1 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 cnh 1.5 C | | /|\ | /|\ * | |
129     C | |-------- | -----------------etc.. | ----*--- |
130     C | | rVel(i=1, | rVel(i=Nx, * | |
131 cnh 1.1 C | | j=1, | j=1, * | |
132 cnh 1.6 C | | k=Nr) | k=Nr) * | |
133 cnh 1.1 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 cnh 1.6 C | k=Nr)| j=1, | k=Nr) j=1, * |j=1, |
136     C | | k=Nr) | k=Nr) * |k=Nr)|
137 cnh 1.1 C | | | * | |
138     C |"LB"++>============================================== |
139     C | "PWX" |
140     C | |
141 cnh 1.5 C | Up increasing upwards. |
142 cnh 1.1 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 cnh 1.5 C | Note: r => height (m) => r increases upwards |
152     C | r => pressure (Pa) => r increases downwards |
153     C | |
154     C | |
155 cnh 1.1 C | i: East-west index |
156     C | j: North-south index |
157     C | k: up-down index |
158     C | U: x-velocity (m/s) |
159 cnh 1.5 C | rVel: z-velocity ( units of r ) |
160     C | The vertical velocity variable rVel is in units of |
161     C | "r" the vertical coordinate. r in m will give |
162     C | rVel m/s. r in Pa will give rVel Pa/s. |
163 cnh 1.1 C | T: potential temperature (oC) |
164     C | "UB": Upper boundary. |
165     C | "LB": Lower boundary (always solid - therefore om|w == 0)|
166     C | "WB": Western boundary |
167     C |"PWX": Periodic wrap around in X. |
168     C |----------------------------------------------------------|
169     C | (3) Views showing nomenclature and indexing |
170     C | for grid descriptor variables. |
171     C | |
172     C | Fig 3a. shows the orientation, indexing and |
173     C | notation for the grid spacing terms used internally |
174     C | for the evaluation of gradient and averaging terms. |
175     C | These varaibles are set based on the model input |
176     C | parameters which define the model grid in terms of |
177     C | spacing in X, Y and Z. |
178     C | |
179     C | Fig 3b. shows the orientation, indexing and |
180     C | notation for the variables that are used to define |
181     C | the model grid. These varaibles are set directly |
182     C | from the model input. |
183     C | |
184     C | Figure 3a |
185     C | ========= |
186     C | |------------------------------------ |
187     C | | | |
188     C |"PWY"********************************* etc... |
189     C | | | |
190     C | | | |
191     C | | | |
192     C | | | |
193     C | | | |
194     C | | | |
195     C | | | |
196     C | |
197     C | . . |
198     C | . . |
199     C | . . |
200     C | e e |
201     C | t t |
202     C | c c |
203     C | |-----------v-----------|-----------v----------|- |
204     C | | | | |
205     C | | | | |
206     C | | | | |
207     C | | | | |
208     C | | | | |
209     C | u<--dxF(i=1,j=2,k=1)--->u t | |
210     C | |/|\ /|\ | | |
211     C | | | | | | |
212     C | | | | | | |
213     C | | | | | | |
214     C | |dyU(i=1, dyC(i=1, | | |
215     C | --- ---|--j=2,---|--j=2,-----------------v----------|- |
216     C | /|\ | | k=1) | k=1) | /|\ | |
217     C | | | | | | dyF(i=2, | |
218     C | | | | | | | j=1, | |
219     C |dyG( |\|/ \|/ | | k=1) | |
220     C | i=1,u--- t<---dxC(i=2,j=1,k=1)-->t | |
221     C | j=1,| | | | |
222     C | k=1)| | | | |
223     C | | | | | | |
224     C | | | | | | |
225     C | \|/ | |<---dxV(i=2,j=1,k=1)--\|/ | |
226     C |"SB"++>|___________v___________|___________v__________|_ |
227     C | <--dxG(i=1,j=1,k=1)-----> |
228     C | /+\ |
229     C | + |
230     C | + |
231     C | "WB" |
232     C | |
233     C | N, y increasing northwards |
234     C | /|\ j increasing northwards |
235     C | | |
236     C | | |
237     C | ======>E, x increasing eastwards |
238     C | i increasing eastwards |
239     C | |
240     C | i: East-west index |
241     C | j: North-south index |
242     C | k: up-down index |
243     C | u: x-velocity point |
244     C | V: y-velocity point |
245     C | t: tracer point |
246     C | "SB": Southern boundary |
247     C | "WB": Western boundary |
248     C |"PWX": Periodic wrap around in X. |
249     C |"PWY": Periodic wrap around in Y. |
250     C | |
251     C | Figure 3b |
252     C | ========= |
253     C | |
254     C | . . |
255     C | . . |
256     C | . . |
257     C | e e |
258     C | t t |
259     C | c c |
260     C | |-----------v-----------|-----------v--etc... |
261     C | | | |
262     C | | | |
263     C | | | |
264     C | | | |
265     C | | | |
266     C | u<--delX(i=1)---------->u t |
267     C | | | |
268     C | | | |
269     C | | | |
270     C | | | |
271     C | | | |
272     C | |-----------v-----------------------v--etc... |
273     C | | /|\ | |
274     C | | | | |
275     C | | | | |
276     C | | | | |
277     C | u delY(j=1) | t |
278     C | | | | |
279     C | | | | |
280     C | | | | |
281     C | | | | |
282     C | | \|/ | |
283     C |"SB"++>|___________v___________|___________v__etc... |
284     C | /+\ |
285     C | + |
286     C | + |
287     C | "WB" |
288     C | |
289     C \==========================================================/
290 cnh 1.3
291     C Macros that override/modify standard definitions
292     #include "GRID_MACROS.h"
293    
294 cnh 1.1 C
295     C-- COMMON /GRID_R/ REAL valued grid defining variables.
296     C dxC - Cell center separation in X across western cell wall (m)
297     C dxG - Cell face separation in X along southern cell wall (m)
298     C dxF - Cell face separation in X thru cell center (m)
299     C dxV - V-point separation in X across south-west corner of cell (m)
300     C dyC - Cell center separation in Y across southern cell wall (m)
301     C dyG - Cell face separation in Y along western cell wall (m)
302     C dyF - Cell face separation in Y thru cell center (m)
303     C dyU - U-point separation in Y across south-west corner of cell (m)
304 cnh 1.5 C drC - Cell center separation along Z axis ( units of r ).
305     C drF - Cell face separation along Z axis ( units of r ).
306 cnh 1.1 C H - Depth of base of fluid from upper surface f[X,Y] (m).
307     C hFac - Fraction of cell in vertical which is open i.e how
308     C "lopped" a cell is (dimensionless scale factor).
309     C Note: The code needs terms like MIN(hFac,hFac(I+1))
310     C On some platforms it may be better to precompute
311     C hFacW, hFacE, ... here than do MIN on the fly.
312 cnh 1.6 C rkFac - Vertical coordinate to vertical index orientation.
313 cnh 1.7 C ( -1 same orientation, 1 opposite orientation )
314     C ( vertical coord == m -> rkFac = 1 )
315     C ( vertical coord == Pa -> rkFac = -1 )
316 cnh 1.1 C maskW - West face land mask
317     C maskS - South face land mask
318 cnh 1.5 C recip_dxC - Recipricol of dxC
319     C recip_dxG - Recipricol of dxG
320     C recip_dxF - Recipricol of dxF
321     C recip_dxV - Recipricol of dxV
322     C recip_dyC - Recipricol of dxC
323     C recip_dyG - Recipricol of dyG
324     C recip_dyF - Recipricol of dyF
325     C recip_dyU - Recipricol of dyU
326     C recip_drC - Recipricol of drC
327     C recip_drF - Recipricol of drF
328     C recip_H - Inverse of cell center open-depth
329     C recip_hFacC - Inverse of cell open-depth f[X,Y,Z] ( dimensionless ).
330     C recip_hFacW rhFacC center, rhFacW west, rhFacS south.
331     C recip_hFacS Note: This is precomputed here because it involves division.
332 cnh 1.1 C saFac - Shallow atmosphere factor (dimensionless scale factor).
333     C xC - X-coordinate of center of cell f[X,Y]. The units of xc, yc
334     C depend on the grid. They are not used in differencing or
335     C averaging but are just a convient quantity for I/O,
336     C diagnostics etc.. As such xc is in m for cartesian
337     C coordinates but degrees for spherical polar.
338     C yC - Y-coordinate of center of cell f[X,Y].
339 cnh 1.4 C xC0, yC0 - West edge x coord ( metres or degrees )
340     C South edge y coord ( metres or degrees )
341 cnh 1.5 C rA - R-face are f[X,Y] ( m^2 ).
342 cnh 1.1 C Note: In a cartesian framework zA is simply dx*dy,
343     C however we use zA to allow for non-globally
344     C orthogonal coordinate frames (with appropriate
345     C metric terms).
346 cnh 1.5 C rC - R-coordinate of center of cell f[Z] (units of r).
347     C rF - R-coordinate of face of cell f[Z] (units of r).
348 cnh 1.4 C tanPhiAtU - tan of the latitude at U point. Used for spherical polar
349     C metric term in U equation.
350     C tanPhiAtV - tan of the latitude at V point. Used for spherical polar
351     C metric term in V equation.
352 cnh 1.1 COMMON /GRID_R/
353 cnh 1.6 & dxC,dxF,dxG,dxV,dyC,dyF,dyG,dyU,drC,drF,
354 cnh 1.1 & H,HFacC,HFacW,HFacS,
355 cnh 1.5 & recip_dxC,recip_dxF,recip_dxG,recip_dxV,
356     & recip_dyC,recip_dyF,recip_dyG,recip_dyU,
357     & recip_drC,recip_drF,
358     & recip_H,
359     & recip_hFacC,recip_hFacW,recip_hFacS,
360 cnh 1.6 & rkFac, recip_rkFac,
361 cnh 1.5 & saFac,
362     & xC,yC,rA,rC,rF,yC0,xC0,
363 cnh 1.4 & maskW,maskS,
364     & tanPhiAtU, tanPhiAtV
365 cnh 1.5 _RS dxC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
366     _RS dxF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
367     _RS dxG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
368     _RS dxV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
369     _RS dyC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
370     _RS dyF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
371     _RS dyG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
372     _RS dyU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
373 cnh 1.6 _RS drC (1:Nr)
374     _RS drF (1:Nr)
375     _RS rkFac
376     _RS recip_rkFac
377 cnh 1.9 _RS DepthInK (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
378 cnh 1.5 _RS H (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
379 cnh 1.6 _RS HFacC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
380     _RS HFacW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
381     _RS HFacS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
382 cnh 1.5 _RS recip_dxC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
383     _RS recip_dxF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
384     _RS recip_dxG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
385     _RS recip_dxV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
386     _RS recip_dyC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
387     _RS recip_dyF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
388     _RS recip_dyG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
389     _RS recip_dyU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
390 cnh 1.6 _RS recip_drC (1:Nr)
391     _RS recip_drF (1:Nr)
392 cnh 1.5 _RS recip_h (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
393 cnh 1.6 _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 saFac (1:Nr)
397 cnh 1.5 _RS xC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
398 cnh 1.4 _RS xC0
399 cnh 1.5 _RS yC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
400 cnh 1.4 _RS yC0
401 cnh 1.5 _RS rA (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
402 cnh 1.6 _RS rC (1:Nr)
403     _RS rF (1:Nr+1)
404     _RS maskW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
405     _RS maskS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
406 cnh 1.5 _RS tanPhiAtU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
407     _RS tanPhiAtV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)

  ViewVC Help
Powered by ViewVC 1.1.22