1 |
C $Header$ |
C $Header$ |
2 |
|
C $Name$ |
3 |
C |
C |
4 |
C /==========================================================\ |
CBOP |
5 |
C | GRID.h | |
C !ROUTINE: GRID.h |
6 |
C | o Header file defining model grid. | |
C !INTERFACE: |
7 |
C |==========================================================| |
C include GRID.h |
8 |
C | Model grid is defined for each process by reference to | |
C !DESCRIPTION: \bv |
9 |
C | the arrays set here. | |
C *==========================================================* |
10 |
C | Notes | |
C | GRID.h |
11 |
C | ===== | |
C | o Header file defining model grid. |
12 |
C | The standard MITgcm convention of westmost, southern most| |
C *==========================================================* |
13 |
C | and upper most having the (1,1,1) index is used here. | |
C | Model grid is defined for each process by reference to |
14 |
C | i.e. | |
C | the arrays set here. |
15 |
C |----------------------------------------------------------| |
C | Notes |
16 |
C | (1) Plan view schematic of model grid (top layer i.e. ) | |
C | ===== |
17 |
C | ================================= ( ocean surface ) | |
C | The standard MITgcm convention of westmost, southern most |
18 |
C | ( or top of ) | |
C | and upper most having the (1,1,1) index is used here. |
19 |
C | ( atmosphere ) | |
C | i.e. |
20 |
C | This diagram shows the location of the model | |
C |---------------------------------------------------------- |
21 |
C | prognostic variables on the model grid. The "T" | |
C | (1) Plan view schematic of model grid (top layer i.e. ) |
22 |
C | location is used for all tracers. The figure also | |
C | ================================= ( ocean surface ) |
23 |
C | shows the southern most, western most indexing | |
C | ( or top of ) |
24 |
C | convention that is used for all model variables. | |
C | ( atmosphere ) |
25 |
C | | |
C | This diagram shows the location of the model |
26 |
C | | |
C | prognostic variables on the model grid. The "T" |
27 |
C | V(i=1, V(i=Nx, | |
C | location is used for all tracers. The figure also |
28 |
C | j=Ny+1, j=Ny+1, | |
C | shows the southern most, western most indexing |
29 |
C | k=1) k=1) | |
C | convention that is used for all model variables. |
30 |
C | /|\ /|\ "PWX" | |
C | |
31 |
C | |---------|------------------etc.. |---- *--- | |
C | |
32 |
C | | | * | | |
C | V(i=1, V(i=Nx, |
33 |
C |"PWY"*******************************etc.. **********"PWY"| |
C | j=Ny+1, j=Ny+1, |
34 |
C | | | * | | |
C | k=1) k=1) |
35 |
C | | | * | | |
C | /|\ /|\ "PWX" |
36 |
C | | | * | | |
C | |---------|------------------etc.. |---- *--- |
37 |
C |U(i=1, ==> x | x *==>U | |
C | | | * | |
38 |
C | j=Ny,| T(i=1, | T(i=Nx, *(i=Nx+1,| |
C |"PWY"*******************************etc.. **********"PWY" |
39 |
C | k=1) | j=Ny, | j=Ny, * |j=Ny,| |
C | | | * | |
40 |
C | | k=1) | k=1) * |k=1) | |
C | | | * | |
41 |
C | | |
C | | | * | |
42 |
C | . . . | |
C |U(i=1, ==> x | x *==>U |
43 |
C | . . . | |
C | j=Ny,| T(i=1, | T(i=Nx, *(i=Nx+1, |
44 |
C | . . . | |
C | k=1) | j=Ny, | j=Ny, * |j=Ny, |
45 |
C | e e * e | |
C | | k=1) | k=1) * |k=1) |
46 |
C | t t * t | |
C | |
47 |
C | c c * c | |
C | . . . |
48 |
C | | | * | | |
C | . . . |
49 |
C | | | * | | |
C | . . . |
50 |
C |U(i=1, ==> x | x * | | |
C | e e * e |
51 |
C | j=2, | T(i=1, | T(i=Nx, * | | |
C | t t * t |
52 |
C | k=1) | j=2, | j=2, * | | |
C | c c * c |
53 |
C | | k=1) | k=1) * | | |
C | | | * | |
54 |
C | | | * | | |
C | | | * | |
55 |
C | | /|\ | /|\ * | | |
C |U(i=1, ==> x | x * | |
56 |
C | -----------|------------------etc.. |-----*--- | |
C | j=2, | T(i=1, | T(i=Nx, * | |
57 |
C | | V(i=1, | V(i=Nx, * | | |
C | k=1) | j=2, | j=2, * | |
58 |
C | | j=2, | j=2, * | | |
C | | k=1) | k=1) * | |
59 |
C | | k=1) | k=1) * | | |
C | | | * | |
60 |
C | | | * | | |
C | | /|\ | /|\ * | |
61 |
C |U(i=1, ==> x ==>U(i=2, x *==>U | |
C | -----------|------------------etc.. |-----*--- |
62 |
C | j=1, | T(i=1, | j=1, T(i=Nx, *(i=Nx+1,| |
C | | V(i=1, | V(i=Nx, * | |
63 |
C | k=1) | j=1, | k=1) j=1, * |j=1, | |
C | | j=2, | j=2, * | |
64 |
C | | k=1) | k=1) * |k=1) | |
C | | k=1) | k=1) * | |
65 |
C | | | * | | |
C | | | * | |
66 |
C | | /|\ | /|\ * | | |
C |U(i=1, ==> x ==>U(i=2, x *==>U |
67 |
C |"SB"++>|---------|------------------etc.. |-----*--- | |
C | j=1, | T(i=1, | j=1, T(i=Nx, *(i=Nx+1, |
68 |
C | /+\ V(i=1, V(i=Nx, * | |
C | k=1) | j=1, | k=1) j=1, * |j=1, |
69 |
C | + j=1, j=1, * | |
C | | k=1) | k=1) * |k=1) |
70 |
C | + k=1) k=1) * | |
C | | | * | |
71 |
C | "WB" "PWX" | |
C | | /|\ | /|\ * | |
72 |
C | | |
C |"SB"++>|---------|------------------etc.. |-----*--- |
73 |
C | N, y increasing northwards | |
C | /+\ V(i=1, V(i=Nx, * |
74 |
C | /|\ j increasing northwards | |
C | + j=1, j=1, * |
75 |
C | | | |
C | + k=1) k=1) * |
76 |
C | | | |
C | "WB" "PWX" |
77 |
C | ======>E, x increasing eastwards | |
C | |
78 |
C | i increasing eastwards | |
C | N, y increasing northwards |
79 |
C | | |
C | /|\ j increasing northwards |
80 |
C | i: East-west index | |
C | | |
81 |
C | j: North-south index | |
C | | |
82 |
C | k: up-down index | |
C | ======>E, x increasing eastwards |
83 |
C | U: x-velocity (m/s) | |
C | i increasing eastwards |
84 |
C | V: y-velocity (m/s) | |
C | |
85 |
C | T: potential temperature (oC) | |
C | i: East-west index |
86 |
C | "SB": Southern boundary | |
C | j: North-south index |
87 |
C | "WB": Western boundary | |
C | k: up-down index |
88 |
C |"PWX": Periodic wrap around in X. | |
C | U: x-velocity (m/s) |
89 |
C |"PWY": Periodic wrap around in Y. | |
C | V: y-velocity (m/s) |
90 |
C |----------------------------------------------------------| |
C | T: potential temperature (oC) |
91 |
C | (2) South elevation schematic of model grid | |
C | "SB": Southern boundary |
92 |
C | ======================================= | |
C | "WB": Western boundary |
93 |
C | This diagram shows the location of the model | |
C |"PWX": Periodic wrap around in X. |
94 |
C | prognostic variables on the model grid. The "T" | |
C |"PWY": Periodic wrap around in Y. |
95 |
C | location is used for all tracers. The figure also | |
C |---------------------------------------------------------- |
96 |
C | shows the upper most, western most indexing | |
C | (2) South elevation schematic of model grid |
97 |
C | convention that is used for all model variables. | |
C | ======================================= |
98 |
C | | |
C | This diagram shows the location of the model |
99 |
C | "WB" | |
C | prognostic variables on the model grid. The "T" |
100 |
C | + | |
C | location is used for all tracers. The figure also |
101 |
C | + | |
C | shows the upper most, western most indexing |
102 |
C | \+/ /|\ /|\ | |
C | convention that is used for all model variables. |
103 |
C |"UB"++>|-------- | -----------------etc.. | ----*--- | |
C | |
104 |
C | | rVel(i=1, | rVel(i=Nx, * | | |
C | "WB" |
105 |
C | | j=1, | j=1, * | | |
C | + |
106 |
C | | k=1) | k=1) * | | |
C | + |
107 |
C | | | * | | |
C | \+/ /|\ /|\ . |
108 |
C |U(i=1, ==> x ==>U(i=2, x *==>U | |
C |"UB"++>|-------- | -----------------etc.. | ----*--- |
109 |
C | j=1, | T(i=1, | j=1, T(i=Nx, *(i=Nx+1,| |
C | | rVel(i=1, | rVel(i=Nx, * | |
110 |
C | k=1) | j=1, | k=1) j=1, * |j=1, | |
C | | j=1, | j=1, * | |
111 |
C | | k=1) | k=1) * |k=1) | |
C | | k=1) | k=1) * | |
112 |
C | | | * | | |
C | | | * | |
113 |
C | | /|\ | /|\ * | | |
C |U(i=1, ==> x ==>U(i=2, x *==>U |
114 |
C | |-------- | -----------------etc.. | ----*--- | |
C | j=1, | T(i=1, | j=1, T(i=Nx, *(i=Nx+1, |
115 |
C | | rVel(i=1, | rVel(i=Nx, * | | |
C | k=1) | j=1, | k=1) j=1, * |j=1, |
116 |
C | | j=1, | j=1, * | | |
C | | k=1) | k=1) * |k=1) |
117 |
C | | k=2) | k=2) * | | |
C | | | * | |
118 |
C | | |
C | | /|\ | /|\ * | |
119 |
C | . . . | |
C | |-------- | -----------------etc.. | ----*--- |
120 |
C | . . . | |
C | | rVel(i=1, | rVel(i=Nx, * | |
121 |
C | . . . | |
C | | j=1, | j=1, * | |
122 |
C | e e * e | |
C | | k=2) | k=2) * | |
123 |
C | t t * t | |
C | |
124 |
C | c c * c | |
C | . . . |
125 |
C | | | * | | |
C | . . . |
126 |
C | | | * | | |
C | . . . |
127 |
C | | | * | | |
C | e e * e |
128 |
C | | | * | | |
C | t t * t |
129 |
C | | /|\ | /|\ * | | |
C | c c * c |
130 |
C | |-------- | -----------------etc.. | ----*--- | |
C | | | * | |
131 |
C | | rVel(i=1, | rVel(i=Nx, * | | |
C | | | * | |
132 |
C | | j=1, | j=1, * | | |
C | | | * | |
133 |
C | | k=Nr) | k=Nr) * | | |
C | | | * | |
134 |
C |U(i=1, ==> x ==>U(i=2, x *==>U | |
C | | /|\ | /|\ * | |
135 |
C | j=1, | T(i=1, | j=1, T(i=Nx, *(i=Nx+1,| |
C | |-------- | -----------------etc.. | ----*--- |
136 |
C | k=Nr)| j=1, | k=Nr) j=1, * |j=1, | |
C | | rVel(i=1, | rVel(i=Nx, * | |
137 |
C | | k=Nr) | k=Nr) * |k=Nr)| |
C | | j=1, | j=1, * | |
138 |
C | | | * | | |
C | | k=Nr) | k=Nr) * | |
139 |
C |"LB"++>============================================== | |
C |U(i=1, ==> x ==>U(i=2, x *==>U |
140 |
C | "PWX" | |
C | j=1, | T(i=1, | j=1, T(i=Nx, *(i=Nx+1, |
141 |
C | | |
C | k=Nr)| j=1, | k=Nr) j=1, * |j=1, |
142 |
C | Up increasing upwards. | |
C | | k=Nr) | k=Nr) * |k=Nr) |
143 |
C |/|\ | |
C | | | * | |
144 |
C | | | |
C |"LB"++>============================================== |
145 |
C | | | |
C | "PWX" |
146 |
C | =====> E i increasing eastwards | |
C | |
147 |
C | | x increasing eastwards | |
C | Up increasing upwards. |
148 |
C | | | |
C |/|\ . |
149 |
C |\|/ | |
C | | |
150 |
C | Down,k increasing downwards. | |
C | | |
151 |
C | | |
C | =====> E i increasing eastwards |
152 |
C | Note: r => height (m) => r increases upwards | |
C | | x increasing eastwards |
153 |
C | r => pressure (Pa) => r increases downwards | |
C | | |
154 |
C | | |
C |\|/ |
155 |
C | | |
C | Down,k increasing downwards. |
156 |
C | i: East-west index | |
C | |
157 |
C | j: North-south index | |
C | Note: r => height (m) => r increases upwards |
158 |
C | k: up-down index | |
C | r => pressure (Pa) => r increases downwards |
159 |
C | U: x-velocity (m/s) | |
C | |
160 |
C | rVel: z-velocity ( units of r ) | |
C | |
161 |
C | The vertical velocity variable rVel is in units of | |
C | i: East-west index |
162 |
C | "r" the vertical coordinate. r in m will give | |
C | j: North-south index |
163 |
C | rVel m/s. r in Pa will give rVel Pa/s. | |
C | k: up-down index |
164 |
C | T: potential temperature (oC) | |
C | U: x-velocity (m/s) |
165 |
C | "UB": Upper boundary. | |
C | rVel: z-velocity ( units of r ) |
166 |
C | "LB": Lower boundary (always solid - therefore om|w == 0)| |
C | The vertical velocity variable rVel is in units of |
167 |
C | "WB": Western boundary | |
C | "r" the vertical coordinate. r in m will give |
168 |
C |"PWX": Periodic wrap around in X. | |
C | rVel m/s. r in Pa will give rVel Pa/s. |
169 |
C |----------------------------------------------------------| |
C | T: potential temperature (oC) |
170 |
C | (3) Views showing nomenclature and indexing | |
C | "UB": Upper boundary. |
171 |
C | for grid descriptor variables. | |
C | "LB": Lower boundary (always solid - therefore om|w == 0) |
172 |
C | | |
C | "WB": Western boundary |
173 |
C | Fig 3a. shows the orientation, indexing and | |
C |"PWX": Periodic wrap around in X. |
174 |
C | notation for the grid spacing terms used internally | |
C |---------------------------------------------------------- |
175 |
C | for the evaluation of gradient and averaging terms. | |
C | (3) Views showing nomenclature and indexing |
176 |
C | These varaibles are set based on the model input | |
C | for grid descriptor variables. |
177 |
C | parameters which define the model grid in terms of | |
C | |
178 |
C | spacing in X, Y and Z. | |
C | Fig 3a. shows the orientation, indexing and |
179 |
C | | |
C | notation for the grid spacing terms used internally |
180 |
C | Fig 3b. shows the orientation, indexing and | |
C | for the evaluation of gradient and averaging terms. |
181 |
C | notation for the variables that are used to define | |
C | These varaibles are set based on the model input |
182 |
C | the model grid. These varaibles are set directly | |
C | parameters which define the model grid in terms of |
183 |
C | from the model input. | |
C | spacing in X, Y and Z. |
184 |
C | | |
C | |
185 |
C | Figure 3a | |
C | Fig 3b. shows the orientation, indexing and |
186 |
C | ========= | |
C | notation for the variables that are used to define |
187 |
C | |------------------------------------ | |
C | the model grid. These varaibles are set directly |
188 |
C | | | | |
C | from the model input. |
189 |
C |"PWY"********************************* etc... | |
C | |
190 |
C | | | | |
C | Figure 3a |
191 |
C | | | | |
C | ========= |
192 |
C | | | | |
C | |------------------------------------ |
193 |
C | | | | |
C | | | |
194 |
C | | | | |
C |"PWY"********************************* etc... |
195 |
C | | | | |
C | | | |
196 |
C | | | | |
C | | | |
197 |
C | | |
C | | | |
198 |
C | . . | |
C | | | |
199 |
C | . . | |
C | | | |
200 |
C | . . | |
C | | | |
201 |
C | e e | |
C | | | |
202 |
C | t t | |
C | |
203 |
C | c c | |
C | . . |
204 |
C | |-----------v-----------|-----------v----------|- | |
C | . . |
205 |
C | | | | | |
C | . . |
206 |
C | | | | | |
C | e e |
207 |
C | | | | | |
C | t t |
208 |
C | | | | | |
C | c c |
209 |
C | | | | | |
C | |-----------v-----------|-----------v----------|- |
210 |
C | u<--dxF(i=1,j=2,k=1)--->u t | | |
C | | | | |
211 |
C | |/|\ /|\ | | | |
C | | | | |
212 |
C | | | | | | | |
C | | | | |
213 |
C | | | | | | | |
C | | | | |
214 |
C | | | | | | | |
C | | | | |
215 |
C | |dyU(i=1, dyC(i=1, | | | |
C | u<--dxF(i=1,j=2,k=1)--->u t | |
216 |
C | --- ---|--j=2,---|--j=2,-----------------v----------|- | |
C | |/|\ /|\ | | |
217 |
C | /|\ | | k=1) | k=1) | /|\ | | |
C | | | | | | |
218 |
C | | | | | | dyF(i=2, | | |
C | | | | | | |
219 |
C | | | | | | | j=1, | | |
C | | | | | | |
220 |
C |dyG( |\|/ \|/ | | k=1) | | |
C | |dyU(i=1, dyC(i=1, | | |
221 |
C | i=1,u--- t<---dxC(i=2,j=1,k=1)-->t | | |
C | --- ---|--j=2,---|--j=2,-----------------v----------|- |
222 |
C | j=1,| | | | | |
C | /|\ | | k=1) | k=1) | /|\ | |
223 |
C | k=1)| | | | | |
C | | | | | | dyF(i=2, | |
224 |
C | | | | | | | |
C | | | | | | | j=1, | |
225 |
C | | | | | | | |
C |dyG( |\|/ \|/ | | k=1) | |
226 |
C | \|/ | |<---dxV(i=2,j=1,k=1)--\|/ | | |
C | i=1,u--- t<---dxC(i=2,j=1,k=1)-->t | |
227 |
C |"SB"++>|___________v___________|___________v__________|_ | |
C | j=1,| | | | |
228 |
C | <--dxG(i=1,j=1,k=1)-----> | |
C | k=1)| | | | |
229 |
C | /+\ | |
C | | | | | | |
230 |
C | + | |
C | | | | | | |
231 |
C | + | |
C | \|/ | |<---dxV(i=2,j=1,k=1)--\|/ | |
232 |
C | "WB" | |
C |"SB"++>|___________v___________|___________v__________|_ |
233 |
C | | |
C | <--dxG(i=1,j=1,k=1)-----> |
234 |
C | N, y increasing northwards | |
C | /+\ . |
235 |
C | /|\ j increasing northwards | |
C | + |
236 |
C | | | |
C | + |
237 |
C | | | |
C | "WB" |
238 |
C | ======>E, x increasing eastwards | |
C | |
239 |
C | i increasing eastwards | |
C | N, y increasing northwards |
240 |
C | | |
C | /|\ j increasing northwards |
241 |
C | i: East-west index | |
C | | |
242 |
C | j: North-south index | |
C | | |
243 |
C | k: up-down index | |
C | ======>E, x increasing eastwards |
244 |
C | u: x-velocity point | |
C | i increasing eastwards |
245 |
C | V: y-velocity point | |
C | |
246 |
C | t: tracer point | |
C | i: East-west index |
247 |
C | "SB": Southern boundary | |
C | j: North-south index |
248 |
C | "WB": Western boundary | |
C | k: up-down index |
249 |
C |"PWX": Periodic wrap around in X. | |
C | u: x-velocity point |
250 |
C |"PWY": Periodic wrap around in Y. | |
C | V: y-velocity point |
251 |
C | | |
C | t: tracer point |
252 |
C | Figure 3b | |
C | "SB": Southern boundary |
253 |
C | ========= | |
C | "WB": Western boundary |
254 |
C | | |
C |"PWX": Periodic wrap around in X. |
255 |
C | . . | |
C |"PWY": Periodic wrap around in Y. |
256 |
C | . . | |
C | |
257 |
C | . . | |
C | Figure 3b |
258 |
C | e e | |
C | ========= |
259 |
C | t t | |
C | |
260 |
C | c c | |
C | . . |
261 |
C | |-----------v-----------|-----------v--etc... | |
C | . . |
262 |
C | | | | |
C | . . |
263 |
C | | | | |
C | e e |
264 |
C | | | | |
C | t t |
265 |
C | | | | |
C | c c |
266 |
C | | | | |
C | |-----------v-----------|-----------v--etc... |
267 |
C | u<--delX(i=1)---------->u t | |
C | | | |
268 |
C | | | | |
C | | | |
269 |
C | | | | |
C | | | |
270 |
C | | | | |
C | | | |
271 |
C | | | | |
C | | | |
272 |
C | | | | |
C | u<--delX(i=1)---------->u t |
273 |
C | |-----------v-----------------------v--etc... | |
C | | | |
274 |
C | | /|\ | | |
C | | | |
275 |
C | | | | | |
C | | | |
276 |
C | | | | | |
C | | | |
277 |
C | | | | | |
C | | | |
278 |
C | u delY(j=1) | t | |
C | |-----------v-----------------------v--etc... |
279 |
C | | | | | |
C | | /|\ | |
280 |
C | | | | | |
C | | | | |
281 |
C | | | | | |
C | | | | |
282 |
C | | | | | |
C | | | | |
283 |
C | | \|/ | | |
C | u delY(j=1) | t |
284 |
C |"SB"++>|___________v___________|___________v__etc... | |
C | | | | |
285 |
C | /+\ | |
C | | | | |
286 |
C | + | |
C | | | | |
287 |
C | + | |
C | | | | |
288 |
C | "WB" | |
C | | \|/ | |
289 |
C | | |
C |"SB"++>|___________v___________|___________v__etc... |
290 |
C \==========================================================/ |
C | /+\ . |
291 |
|
C | + |
292 |
|
C | + |
293 |
|
C | "WB" |
294 |
|
C | |
295 |
|
C *==========================================================* |
296 |
|
C \ev |
297 |
|
CEOP |
298 |
|
|
299 |
C Macros that override/modify standard definitions |
C Macros that override/modify standard definitions |
300 |
#include "GRID_MACROS.h" |
#include "GRID_MACROS.h" |
301 |
|
|
302 |
C |
C-- COMMON /GRID_RL/ RL valued grid defining variables. |
303 |
C-- COMMON /GRID_R/ REAL valued grid defining variables. |
C deepFacC :: deep-model grid factor (fct of vertical only) for dx,dy |
304 |
C dxC - Cell center separation in X across western cell wall (m) |
C deepFacF at level-center (deepFacC) and level interface (deepFacF) |
305 |
C dxG - Cell face separation in X along southern cell wall (m) |
C deepFac2C :: deep-model grid factor (fct of vertical only) for area dx*dy |
306 |
C dxF - Cell face separation in X thru cell center (m) |
C deepFac2F at level-center (deepFac2C) and level interface (deepFac2F) |
307 |
C dxV - V-point separation in X across south-west corner of cell (m) |
C gravitySign :: indicates the direction of gravity relative to R direction |
308 |
C dyC - Cell center separation in Y across southern cell wall (m) |
C (= -1 for R=Z (Z increases upward, -gravity direction ) |
309 |
C dyG - Cell face separation in Y along western cell wall (m) |
C (= +1 for R=P (P increases downward, +gravity direction) |
310 |
C dyF - Cell face separation in Y thru cell center (m) |
C rkSign :: Vertical coordinate to vertical index orientation. |
311 |
C dyU - U-point separation in Y across south-west corner of cell (m) |
C ( +1 same orientation, -1 opposite orientation ) |
312 |
C drC - Cell center separation along Z axis ( units of r ). |
C globalArea :: Domain Integrated horizontal Area [m2] |
313 |
C drF - Cell face separation along Z axis ( units of r ). |
COMMON /GRID_RL/ |
314 |
C H - Depth of base of fluid from upper surface f[X,Y] (m). |
& cosFacU, cosFacV, sqCosFacU, sqCosFacV, |
315 |
C hFac - Fraction of cell in vertical which is open i.e how |
& deepFacC, deepFac2C, recip_deepFacC, recip_deepFac2C, |
316 |
|
& deepFacF, deepFac2F, recip_deepFacF, recip_deepFac2F, |
317 |
|
& gravitySign, rkSign, globalArea |
318 |
|
_RL cosFacU (1-Oly:sNy+Oly,nSx,nSy) |
319 |
|
_RL cosFacV (1-Oly:sNy+Oly,nSx,nSy) |
320 |
|
_RL sqCosFacU (1-Oly:sNy+Oly,nSx,nSy) |
321 |
|
_RL sqCosFacV (1-Oly:sNy+Oly,nSx,nSy) |
322 |
|
_RL deepFacC (Nr) |
323 |
|
_RL deepFac2C (Nr) |
324 |
|
_RL deepFacF (Nr+1) |
325 |
|
_RL deepFac2F (Nr+1) |
326 |
|
_RL recip_deepFacC (Nr) |
327 |
|
_RL recip_deepFac2C(Nr) |
328 |
|
_RL recip_deepFacF (Nr+1) |
329 |
|
_RL recip_deepFac2F(Nr+1) |
330 |
|
_RL gravitySign |
331 |
|
_RL rkSign |
332 |
|
_RL globalArea |
333 |
|
|
334 |
|
C-- COMMON /GRID_RS/ RS valued grid defining variables. |
335 |
|
C dxC :: Cell center separation in X across western cell wall (m) |
336 |
|
C dxG :: Cell face separation in X along southern cell wall (m) |
337 |
|
C dxF :: Cell face separation in X thru cell center (m) |
338 |
|
C dxV :: V-point separation in X across south-west corner of cell (m) |
339 |
|
C dyC :: Cell center separation in Y across southern cell wall (m) |
340 |
|
C dyG :: Cell face separation in Y along western cell wall (m) |
341 |
|
C dyF :: Cell face separation in Y thru cell center (m) |
342 |
|
C dyU :: U-point separation in Y across south-west corner of cell (m) |
343 |
|
C drC :: Cell center separation along Z axis ( units of r ). |
344 |
|
C drF :: Cell face separation along Z axis ( units of r ). |
345 |
|
C R_low :: base of fluid in r_unit (Depth(m) / Pressure(Pa) at top Atmos.) |
346 |
|
C rLowW :: base of fluid column in r_unit at Western edge location. |
347 |
|
C rLowS :: base of fluid column in r_unit at Southern edge location. |
348 |
|
C Ro_surf :: surface reference (at rest) position, r_unit. |
349 |
|
C rSurfW :: surface reference position at Western edge location [r_unit]. |
350 |
|
C rSurfS :: surface reference position at Southern edge location [r_unit]. |
351 |
|
C hFac :: Fraction of cell in vertical which is open i.e how |
352 |
C "lopped" a cell is (dimensionless scale factor). |
C "lopped" a cell is (dimensionless scale factor). |
353 |
C Note: The code needs terms like MIN(hFac,hFac(I+1)) |
C Note: The code needs terms like MIN(hFac,hFac(I+1)) |
354 |
C On some platforms it may be better to precompute |
C On some platforms it may be better to precompute |
355 |
C hFacW, hFacE, ... here than do MIN on the fly. |
C hFacW, hFacE, ... here than do MIN on the fly. |
356 |
C rkFac - Vertical coordinate to vertical index orientation. |
cC maskH :: cell Center full-column mask (= 2D mask) |
357 |
C ( 1 same orientation, -1 opposite orientation ) |
C maskInC :: Cell Center 2-D Interior mask (i.e., zero beyond OB) |
358 |
C ( vertical coord == m -> rkFac = -1 ) |
C maskInW :: West face 2-D Interior mask (i.e., zero on and beyond OB) |
359 |
C ( vertical coord == Pa -> rkFac = 1 ) |
C maskInS :: South face 2-D Interior mask (i.e., zero on and beyond OB) |
360 |
C maskW - West face land mask |
C maskC :: cell Center land mask |
361 |
C maskS - South face land mask |
C maskW :: West face land mask |
362 |
C recip_dxC - Recipricol of dxC |
C maskS :: South face land mask |
363 |
C recip_dxG - Recipricol of dxG |
C recip_dxC :: Reciprocal of dxC |
364 |
C recip_dxF - Recipricol of dxF |
C recip_dxG :: Reciprocal of dxG |
365 |
C recip_dxV - Recipricol of dxV |
C recip_dxF :: Reciprocal of dxF |
366 |
C recip_dyC - Recipricol of dxC |
C recip_dxV :: Reciprocal of dxV |
367 |
C recip_dyG - Recipricol of dyG |
C recip_dyC :: Reciprocal of dxC |
368 |
C recip_dyF - Recipricol of dyF |
C recip_dyG :: Reciprocal of dyG |
369 |
C recip_dyU - Recipricol of dyU |
C recip_dyF :: Reciprocal of dyF |
370 |
C recip_drC - Recipricol of drC |
C recip_dyU :: Reciprocal of dyU |
371 |
C recip_drF - Recipricol of drF |
C recip_drC :: Reciprocal of drC |
372 |
C recip_H - Inverse of cell center open-depth |
C recip_drF :: Reciprocal of drF |
373 |
C recip_hFacC - Inverse of cell open-depth f[X,Y,Z] ( dimensionless ). |
C recip_Rcol :: Inverse of cell center column thickness (1/r_unit) |
374 |
C recip_hFacW rhFacC center, rhFacW west, rhFacS south. |
C recip_hFacC :: Inverse of cell open-depth f[X,Y,Z] ( dimensionless ). |
375 |
C recip_hFacS Note: This is precomputed here because it involves division. |
C recip_hFacW rhFacC center, rhFacW west, rhFacS south. |
376 |
C saFac - Shallow atmosphere factor (dimensionless scale factor). |
C recip_hFacS Note: This is precomputed here because it involves division. |
377 |
C xC - X-coordinate of center of cell f[X,Y]. The units of xc, yc |
C xC :: X-coordinate of cell center f[X,Y]. The units of xc, yc |
378 |
C depend on the grid. They are not used in differencing or |
C depend on the grid. They are not used in differencing or |
379 |
C averaging but are just a convient quantity for I/O, |
C averaging but are just a convient quantity for I/O, |
380 |
C diagnostics etc.. As such xc is in m for cartesian |
C diagnostics etc.. As such xc is in m for cartesian |
381 |
C coordinates but degrees for spherical polar. |
C coordinates but degrees for spherical polar. |
382 |
C yC - Y-coordinate of center of cell f[X,Y]. |
C yC :: Y-coordinate of center of cell f[X,Y]. |
383 |
C xC0, yC0 - West edge x coord ( metres or degrees ) |
C yG :: Y-coordinate of corner of cell ( c-grid vorticity point) f[X,Y]. |
384 |
C South edge y coord ( metres or degrees ) |
C rA :: R-face are f[X,Y] ( m^2 ). |
385 |
C rA - R-face are f[X,Y] ( m^2 ). |
C Note: In a cartesian framework zA is simply dx*dy, |
386 |
C Note: In a cartesian framework zA is simply dx*dy, |
C however we use zA to allow for non-globally |
387 |
C however we use zA to allow for non-globally |
C orthogonal coordinate frames (with appropriate |
388 |
C orthogonal coordinate frames (with appropriate |
C metric terms). |
389 |
C metric terms). |
C rC :: R-coordinate of center of cell f[Z] (units of r). |
390 |
C rC - R-coordinate of center of cell f[Z] (units of r). |
C rF :: R-coordinate of face of cell f[Z] (units of r). |
391 |
C rF - R-coordinate of face of cell f[Z] (units of r). |
C - *HybSigm* - :: Hybrid-Sigma vert. Coord coefficients |
392 |
C tanPhiAtU - tan of the latitude at U point. Used for spherical polar |
C aHybSigmF at level-interface (*HybSigmF) and level-center (*HybSigmC) |
393 |
C metric term in U equation. |
C aHybSigmC aHybSigm* = constant r part, bHybSigm* = sigma part, such as |
394 |
C tanPhiAtV - tan of the latitude at V point. Used for spherical polar |
C bHybSigmF r(ij,k,t) = rLow(ij) + aHybSigm(k)*[rF(1)-rF(Nr+1)] |
395 |
C metric term in V equation. |
C bHybSigmC + bHybSigm(k)*[eta(ij,t)+Ro_surf(ij) - rLow(ij)] |
396 |
COMMON /GRID_R/ |
C dAHybSigF :: vertical increment of Hybrid-Sigma coefficient: constant r part, |
397 |
& dxC,dxF,dxG,dxV,dyC,dyF,dyG,dyU,drC,drF, |
C dAHybSigC between interface (dAHybSigF) and between center (dAHybSigC) |
398 |
& H,HFacC,HFacW,HFacS, |
C dBHybSigF :: vertical increment of Hybrid-Sigma coefficient: sigma part, |
399 |
|
C dBHybSigC between interface (dBHybSigF) and between center (dBHybSigC) |
400 |
|
C tanPhiAtU :: tan of the latitude at U point. Used for spherical polar |
401 |
|
C metric term in U equation. |
402 |
|
C tanPhiAtV :: tan of the latitude at V point. Used for spherical polar |
403 |
|
C metric term in V equation. |
404 |
|
C angleCosC :: cosine of grid orientation angle relative to Geographic direction |
405 |
|
C at cell center: alpha=(Eastward_dir,grid_uVel_dir)=(North_d,vVel_d) |
406 |
|
C angleSinC :: sinus of grid orientation angle relative to Geographic direction |
407 |
|
C at cell center: alpha=(Eastward_dir,grid_uVel_dir)=(North_d,vVel_d) |
408 |
|
C fCori :: Coriolis parameter at grid Center point |
409 |
|
C fCoriG :: Coriolis parameter at grid Corner point |
410 |
|
C fCoriCos :: Coriolis Cos(phi) parameter at grid Center point (for NH) |
411 |
|
|
412 |
|
COMMON /GRID_RS/ |
413 |
|
& dxC,dxF,dxG,dxV,dyC,dyF,dyG,dyU, |
414 |
|
& R_low, rLowW, rLowS, |
415 |
|
& Ro_surf, rSurfW, rSurfS, |
416 |
|
& hFacC, hFacW, hFacS, |
417 |
& recip_dxC,recip_dxF,recip_dxG,recip_dxV, |
& recip_dxC,recip_dxF,recip_dxG,recip_dxV, |
418 |
& recip_dyC,recip_dyF,recip_dyG,recip_dyU, |
& recip_dyC,recip_dyF,recip_dyG,recip_dyU, |
419 |
& recip_drC,recip_drF, |
& recip_Rcol, |
420 |
& recip_H, |
& recip_hFacC,recip_hFacW,recip_hFacS, |
421 |
& recip_hFacC,recip_hFacW,recip_hFacS, |
& xC,yC,rA,rAw,rAs,rAz,xG,yG, |
422 |
& rkFac, recip_rkFac, |
& maskInC, maskInW, maskInS, |
423 |
& saFac, |
& maskC, maskW, maskS, |
424 |
& xC,yC,rA,rC,rF,yC0,xC0, |
& recip_rA,recip_rAw,recip_rAs,recip_rAz, |
425 |
& maskW,maskS, |
& drC, drF, recip_drC, recip_drF, rC, rF, |
426 |
& tanPhiAtU, tanPhiAtV |
& aHybSigmF, bHybSigmF, aHybSigmC, bHybSigmC, |
427 |
|
& dAHybSigF, dBHybSigF, dBHybSigC, dAHybSigC, |
428 |
|
& tanPhiAtU, tanPhiAtV, angleCosC, angleSinC, |
429 |
|
& fCori, fCoriG, fCoriCos |
430 |
|
c & , maskH |
431 |
_RS dxC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS dxC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
432 |
_RS dxF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS dxF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
433 |
_RS dxG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS dxG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
436 |
_RS dyF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS dyF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
437 |
_RS dyG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS dyG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
438 |
_RS dyU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS dyU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
439 |
_RS drC (1:Nr) |
_RS R_low (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
440 |
_RS drF (1:Nr) |
_RS rLowW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
441 |
_RS rkFac |
_RS rLowS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
442 |
_RS recip_rkFac |
_RS Ro_surf (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
443 |
_RS H (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS rSurfW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
444 |
_RS HFacC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy) |
_RS rSurfS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
445 |
_RS HFacW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy) |
_RS hFacC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
446 |
_RS HFacS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy) |
_RS hFacW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
447 |
|
_RS hFacS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
448 |
_RS recip_dxC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS recip_dxC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
449 |
_RS recip_dxF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS recip_dxF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
450 |
_RS recip_dxG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS recip_dxG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
453 |
_RS recip_dyF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS recip_dyF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
454 |
_RS recip_dyG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS recip_dyG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
455 |
_RS recip_dyU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS recip_dyU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
456 |
_RS recip_drC (1:Nr) |
_RS recip_Rcol (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
457 |
_RS recip_drF (1:Nr) |
_RS recip_hFacC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
458 |
_RS recip_h (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS recip_hFacW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
459 |
_RS recip_hFacC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy) |
_RS recip_hFacS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
|
_RS recip_hFacW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy) |
|
|
_RS recip_hFacS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy) |
|
|
_RS saFac (1:Nr) |
|
460 |
_RS xC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS xC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
461 |
_RS xC0 |
_RS xG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
462 |
_RS yC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS yC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
463 |
_RS yC0 |
_RS yG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
464 |
_RS rA (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS rA (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
465 |
_RS rC (1:Nr) |
_RS rAw (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
466 |
_RS rF (1:Nr+1) |
_RS rAs (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
467 |
_RS maskW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy) |
_RS rAz (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
468 |
_RS maskS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy) |
_RS recip_rA (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
469 |
|
_RS recip_rAw (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
470 |
|
_RS recip_rAs (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
471 |
|
_RS recip_rAz (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
472 |
|
c _RS maskH (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
473 |
|
_RS maskInC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
474 |
|
_RS maskInW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
475 |
|
_RS maskInS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
476 |
|
_RS maskC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
477 |
|
_RS maskW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
478 |
|
_RS maskS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
479 |
|
_RS drC (Nr) |
480 |
|
_RS drF (Nr) |
481 |
|
_RS recip_drC (Nr) |
482 |
|
_RS recip_drF (Nr) |
483 |
|
_RS rC (Nr) |
484 |
|
_RS rF (Nr+1) |
485 |
|
_RS aHybSigmF (Nr+1) |
486 |
|
_RS bHybSigmF (Nr+1) |
487 |
|
_RS aHybSigmC (Nr) |
488 |
|
_RS bHybSigmC (Nr) |
489 |
|
_RS dAHybSigF (Nr) |
490 |
|
_RS dBHybSigF (Nr) |
491 |
|
_RS dBHybSigC (Nr+1) |
492 |
|
_RS dAHybSigC (Nr+1) |
493 |
_RS tanPhiAtU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS tanPhiAtU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
494 |
_RS tanPhiAtV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS tanPhiAtV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
495 |
|
_RS angleCosC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
496 |
|
_RS angleSinC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
497 |
|
_RS fCori (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
498 |
|
_RS fCoriG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
499 |
|
_RS fCoriCos (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
500 |
|
|
501 |
|
#ifdef ALLOW_DEPTH_CONTROL |
502 |
|
C-- COMMON /GRID_DEPTH_CTRL/ grid defining variables for Depth Control code. |
503 |
|
C xx_r_low :: in TAF-sense active replacement of R_low |
504 |
|
COMMON /GRID_DEPTH_CTRL/ |
505 |
|
& xx_r_low |
506 |
|
_RL xx_r_low (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
507 |
|
#endif /* ALLOW_DEPTH_CONTROL */ |
508 |
|
|
509 |
C-- COMMON /GRID_I/ Integer valued grid defining variables |
C-- COMMON /GRID_I/ INTEGER valued grid defining variables. |
510 |
C iDep - Index of last "non-land" cell for each column f[X,Y]. |
C kSurfC :: vertical index of the surface tracer cell |
511 |
|
C kSurfW :: vertical index of the surface U point |
512 |
|
C kSurfS :: vertical index of the surface V point |
513 |
|
C kLowC :: index of the r-lowest "wet cell" (2D) |
514 |
|
C IMPORTANT: ksurfC,W,S = Nr+1 and kLowC = 0 where the fluid column |
515 |
|
C is empty (continent) |
516 |
COMMON /GRID_I/ |
COMMON /GRID_I/ |
517 |
& iDep |
& kSurfC, kSurfW, kSurfS, |
518 |
INTEGER iDep(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
& kLowC |
519 |
|
INTEGER kSurfC(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
520 |
|
INTEGER kSurfW(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
521 |
|
INTEGER kSurfS(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
522 |
|
INTEGER kLowC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
523 |
|
|
524 |
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |