1 |
C $Header$ |
C $Header$ |
2 |
|
C $Name$ |
3 |
C |
C |
4 |
C /==========================================================\ |
C /==========================================================\ |
5 |
C | GRID.h | |
C | GRID.h | |
99 |
C | "WB" | |
C | "WB" | |
100 |
C | + | |
C | + | |
101 |
C | + | |
C | + | |
102 |
C | \+/ | | | |
C | \+/ /|\ /|\ | |
103 |
C |"UB"++>|--------\|/-----------------etc.. \|/----*--- | |
C |"UB"++>|-------- | -----------------etc.. | ----*--- | |
104 |
C | | w,om(i=1, | w,om(i=Nx, * | | |
C | | rVel(i=1, | rVel(i=Nx, * | | |
105 |
C | | j=1, | j=1, * | | |
C | | j=1, | j=1, * | | |
106 |
C | | k=1) | k=1) * | | |
C | | k=1) | k=1) * | | |
107 |
C | | | * | | |
C | | | * | | |
110 |
C | k=1) | j=1, | k=1) j=1, * |j=1, | |
C | k=1) | j=1, | k=1) j=1, * |j=1, | |
111 |
C | | k=1) | k=1) * |k=1) | |
C | | k=1) | k=1) * |k=1) | |
112 |
C | | | * | | |
C | | | * | | |
113 |
C | | | | | * | | |
C | | /|\ | /|\ * | | |
114 |
C | |--------\|/-----------------etc.. \|/----*--- | |
C | |-------- | -----------------etc.. | ----*--- | |
115 |
C | | w,om(i=1, | w,om(i=Nx, * | | |
C | | rVel(i=1, | rVel(i=Nx, * | | |
116 |
C | | j=1, | j=1, * | | |
C | | j=1, | j=1, * | | |
117 |
C | | k=2) | k=2) * | | |
C | | k=2) | k=2) * | | |
118 |
C | | |
C | | |
126 |
C | | | * | | |
C | | | * | | |
127 |
C | | | * | | |
C | | | * | | |
128 |
C | | | * | | |
C | | | * | | |
129 |
C | | | | | * | | |
C | | /|\ | /|\ * | | |
130 |
C | |--------\|/-----------------etc.. \|/----*--- | |
C | |-------- | -----------------etc.. | ----*--- | |
131 |
C | | w,om(i=1, | w,om(i=Nx, * | | |
C | | rVel(i=1, | rVel(i=Nx, * | | |
132 |
C | | j=1, | j=1, * | | |
C | | j=1, | j=1, * | | |
133 |
C | | k=Nz) | k=Nz) * | | |
C | | k=Nr) | k=Nr) * | | |
134 |
C |U(i=1, ==> x ==>U(i=2, x *==>U | |
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,| |
C | j=1, | T(i=1, | j=1, T(i=Nx, *(i=Nx+1,| |
136 |
C | k=Nz)| j=1, | k=Nz) j=1, * |j=1, | |
C | k=Nr)| j=1, | k=Nr) j=1, * |j=1, | |
137 |
C | | k=Nz) | k=Nz) * |k=Nz)| |
C | | k=Nr) | k=Nr) * |k=Nr)| |
138 |
C | | | * | | |
C | | | * | | |
139 |
C |"LB"++>============================================== | |
C |"LB"++>============================================== | |
140 |
C | "PWX" | |
C | "PWX" | |
141 |
C | | |
C | | |
142 |
C | Up,z increasing upwards. | |
C | Up increasing upwards. | |
143 |
C |/|\ | |
C |/|\ | |
144 |
C | | | |
C | | | |
145 |
C | | | |
C | | | |
149 |
C |\|/ | |
C |\|/ | |
150 |
C | Down,k increasing downwards. | |
C | Down,k increasing downwards. | |
151 |
C | | |
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 | |
C | i: East-west index | |
157 |
C | j: North-south index | |
C | j: North-south index | |
158 |
C | k: up-down index | |
C | k: up-down index | |
159 |
C | U: x-velocity (m/s) | |
C | U: x-velocity (m/s) | |
160 |
C | w,om: z-velocity (Pa/s - therefore +ve is down) | |
C | rVel: z-velocity ( units of r ) | |
161 |
C | The vertical velocity variable is sometimes named | |
C | The vertical velocity variable rVel is in units of | |
162 |
C | "w" in the model code. The vertical coordinate and | |
C | "r" the vertical coordinate. r in m will give | |
163 |
C | also gridding are both under review - watch this | |
C | rVel m/s. r in Pa will give rVel Pa/s. | |
|
C | space! | |
|
164 |
C | T: potential temperature (oC) | |
C | T: potential temperature (oC) | |
165 |
C | "UB": Upper boundary. | |
C | "UB": Upper boundary. | |
166 |
C | "LB": Lower boundary (always solid - therefore om|w == 0)| |
C | "LB": Lower boundary (always solid - therefore om|w == 0)| |
288 |
C | "WB" | |
C | "WB" | |
289 |
C | | |
C | | |
290 |
C \==========================================================/ |
C \==========================================================/ |
291 |
|
|
292 |
|
C Macros that override/modify standard definitions |
293 |
|
#include "GRID_MACROS.h" |
294 |
|
|
295 |
C |
C |
296 |
C-- COMMON /GRID_R/ REAL valued grid defining variables. |
C-- COMMON /GRID_R/ REAL valued grid defining variables. |
297 |
C dxC - Cell center separation in X across western cell wall (m) |
C dxC - Cell center separation in X across western cell wall (m) |
302 |
C dyG - Cell face separation in Y along western cell wall (m) |
C dyG - Cell face separation in Y along western cell wall (m) |
303 |
C dyF - Cell face separation in Y thru cell center (m) |
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) |
C dyU - U-point separation in Y across south-west corner of cell (m) |
305 |
C dzC - Cell center separation in Z (Pa). |
C drC - Cell center separation along Z axis ( units of r ). |
306 |
C dzF - Cell face separation in Z (Pa). |
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). |
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 |
C hFac - Fraction of cell in vertical which is open i.e how |
309 |
C "lopped" a cell is (dimensionless scale factor). |
C "lopped" a cell is (dimensionless scale factor). |
310 |
C Note: The code needs terms like MIN(hFac,hFac(I+1)) |
C Note: The code needs terms like MIN(hFac,hFac(I+1)) |
311 |
C On some platforms it may be better to precompute |
C On some platforms it may be better to precompute |
312 |
C hFacW, hFacE, ... here than do MIN on the fly. |
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 |
C maskW - West face land mask |
318 |
C maskS - South face land mask |
C maskS - South face land mask |
319 |
C rdxC - Recipricol of dxC |
C recip_dxC - Recipricol of dxC |
320 |
C rdxG - Recipricol of dxG |
C recip_dxG - Recipricol of dxG |
321 |
C rdxF - Recipricol of dxF |
C recip_dxF - Recipricol of dxF |
322 |
C rdxV - Recipricol of dxV |
C recip_dxV - Recipricol of dxV |
323 |
C rdyC - Recipricol of dxC |
C recip_dyC - Recipricol of dxC |
324 |
C rdyG - Recipricol of dyG |
C recip_dyG - Recipricol of dyG |
325 |
C rdyF - Recipricol of dyF |
C recip_dyF - Recipricol of dyF |
326 |
C rdyU - Recipricol of dyU |
C recip_dyU - Recipricol of dyU |
327 |
C rdzC - Recipricol of dzC |
C recip_drC - Recipricol of drC |
328 |
C rdzF - Recipricol of dzF |
C recip_drF - Recipricol of drF |
329 |
C rh - Inverse of cell center open-depth |
C recip_H - Inverse of cell center open-depth |
330 |
C rhFacC - Inverse of cell open-depth f[X,Y,Z] ( dimensionless ). |
C recip_hFacC - Inverse of cell open-depth f[X,Y,Z] ( dimensionless ). |
331 |
C rhFacW rhFacC center, rhFacW west, rhFacS south. |
C recip_hFacW rhFacC center, rhFacW west, rhFacS south. |
332 |
C rhFacS Note: This is precomputed here because it involves division. |
C recip_hFacS Note: This is precomputed here because it involves division. |
333 |
C saFac - Shallow atmosphere factor (dimensionless scale factor). |
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 |
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 |
C depend on the grid. They are not used in differencing or |
337 |
C diagnostics etc.. As such xc is in m for cartesian |
C diagnostics etc.. As such xc is in m for cartesian |
338 |
C coordinates but degrees for spherical polar. |
C coordinates but degrees for spherical polar. |
339 |
C yC - Y-coordinate of center of cell f[X,Y]. |
C yC - Y-coordinate of center of cell f[X,Y]. |
340 |
C zA - Z-face are f[X,Y] (m^2). |
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, |
C Note: In a cartesian framework zA is simply dx*dy, |
345 |
C however we use zA to allow for non-globally |
C however we use zA to allow for non-globally |
346 |
C orthogonal coordinate frames (with appropriate |
C orthogonal coordinate frames (with appropriate |
347 |
C metric terms). |
C metric terms). |
348 |
C zC - Z-coordinate of center of cell f[Z] |
C rC - R-coordinate of center of cell f[Z] (units of r). |
349 |
C zFace - Z-coordinate of face of cell f[Z] (Pa). |
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/ |
COMMON /GRID_R/ |
355 |
& dxC,dxF,dxG,dxV,dyC,dyF,dyG,dyU,dzC,dzF, |
& dxC,dxF,dxG,dxV,dyC,dyF,dyG,dyU,drC,drF, |
356 |
& H,HFacC,HFacW,HFacS, |
& H,HFacC,HFacW,HFacS,DepthInK, |
357 |
& rdxC,rdxF,rdxG,rdxV,rdyC,rdyF,rdyG,rdyU,rdzC,rdzF, |
& recip_dxC,recip_dxF,recip_dxG,recip_dxV, |
358 |
& rH, rhFacC,rhFacW,rhFacS, |
& recip_dyC,recip_dyF,recip_dyG,recip_dyU, |
359 |
& saFac,xC,yC,zA,zC,zFace, |
& recip_drC,recip_drF, |
360 |
& maskW,maskS |
& recip_H, |
361 |
real dxC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
& recip_hFacC,recip_hFacW,recip_hFacS, |
362 |
real dxF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
& rkFac, recip_rkFac, |
363 |
real dxG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
& saFac, |
364 |
real dxV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
& xC,yC,rA,rAw,rAs,rAz,rC,rF,yC0,xC0,xG,yG, |
365 |
real dyC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
& maskW,maskS,recip_rA,recip_rAw,recip_rAs,recip_rAz, |
366 |
real dyF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
& tanPhiAtU, tanPhiAtV |
367 |
real dyG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS dxC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
368 |
real dyU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS dxF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
369 |
real dzC (1:Nz) |
_RS dxG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
370 |
real dzF (1:Nz) |
_RS dxV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
371 |
real H (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS dyC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
372 |
real HFacC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nz,nSx,nSy) |
_RS dyF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
373 |
real HFacW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nz,nSx,nSy) |
_RS dyG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
374 |
real HFacS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nz,nSx,nSy) |
_RS dyU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
375 |
real rdxC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS drC (1:Nr) |
376 |
real rdxF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS drF (1:Nr) |
377 |
real rdxG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS rkFac |
378 |
real rdxV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS recip_rkFac |
379 |
real rdyC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS DepthInK (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
380 |
real rdyF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS H (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
381 |
real rdyG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS HFacC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy) |
382 |
real rdyU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS HFacW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy) |
383 |
real rdzC (1:Nz) |
_RS HFacS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy) |
384 |
real rdzF (1:Nz) |
_RS recip_dxC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
385 |
real rh (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS recip_dxF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
386 |
real rhFacC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nz,nSx,nSy) |
_RS recip_dxG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
387 |
real rhFacW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nz,nSx,nSy) |
_RS recip_dxV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
388 |
real rhFacS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nz,nSx,nSy) |
_RS recip_dyC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
389 |
real saFac (1:Nz) |
_RS recip_dyF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
390 |
real xC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS recip_dyG (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
391 |
real yC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS recip_dyU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
392 |
real zA (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RS recip_drC (1:Nr) |
393 |
real zC (1:Nz) |
_RS recip_drF (1:Nr) |
394 |
real zFace (1:Nz+1) |
_RS recip_h (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
395 |
real maskW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nz,nSx,nSy) |
_RS recip_hFacC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy) |
396 |
real maskS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nz,nSx,nSy) |
_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 |
C-- COMMON /GRID_I/ Integer valued grid defining variables |
#ifdef ALLOW_NONHYDROSTATIC |
421 |
C iDep - Index of last "non-land" cell for each column f[X,Y]. |
COMMON /GRID_NH/ |
422 |
COMMON /GRID_I/ |
& recip_hFacU |
423 |
& iDep |
_RS recip_hFacU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy) |
424 |
INTEGER iDep(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
#endif |