/[MITgcm]/MITgcm_contrib/PRM/multi_comp_setup/fg/build/GRID_mod.F90
ViewVC logotype

Annotation of /MITgcm_contrib/PRM/multi_comp_setup/fg/build/GRID_mod.F90

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


Revision 1.2 - (hide annotations) (download)
Fri Apr 25 18:46:56 2008 UTC (18 years, 4 months ago) by jmc
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
clean-up

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

  ViewVC Help
Powered by ViewVC 1.1.22