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