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

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

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

revision 1.13 by adcroft, Fri Feb 2 21:04:47 2001 UTC revision 1.34 by jmc, Tue Aug 12 22:24:40 2008 UTC
# Line 1  Line 1 
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    
 C  
302  C--   COMMON /GRID_R/ REAL valued grid defining variables.  C--   COMMON /GRID_R/ REAL valued grid defining variables.
303  C     dxC    - Cell center separation in X across western cell wall (m)  C     dxC    - Cell center separation in X across western cell wall (m)
304  C     dxG    - Cell face separation in X along southern cell wall (m)  C     dxG    - Cell face separation in X along southern cell wall (m)
# Line 303  C     dyF    - Cell face separation in Y Line 310  C     dyF    - Cell face separation in Y
310  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)
311  C     drC    - Cell center separation along Z axis ( units of r ).  C     drC    - Cell center separation along Z axis ( units of r ).
312  C     drF    - Cell face separation along Z axis ( units of r ).  C     drF    - Cell face separation along Z axis ( units of r ).
313  C     H      - Depth of base of fluid from upper surface f[X,Y] (m).  C     Rcolumn  -Total thickness (in r_unit) of the fluid column
314    C     R_low  - base of fluid in r_unit (Depth(m) / Pressure(Pa) at top Atmos.)
315    C     xx_r_low - in TAF-sense active replacement of R_low
316    C     Ro_surf- surface reference (at rest) position, r_unit.
317  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
318  C              "lopped" a cell is (dimensionless scale factor).  C              "lopped" a cell is (dimensionless scale factor).
319  C              Note: The code needs terms like MIN(hFac,hFac(I+1))  C              Note: The code needs terms like MIN(hFac,hFac(I+1))
320  C                    On some platforms it may be better to precompute  C                    On some platforms it may be better to precompute
321  C                    hFacW, hFacE, ... here than do MIN on the fly.  C                    hFacW, hFacE, ... here than do MIN on the fly.
322  C     rkFac     - Vertical coordinate to vertical index orientation.  C     gravitySign - indicates the direction of gravity relative to R direction
323  C                 ( -1 same orientation, 1 opposite orientation )  C                  (= -1 for R=Z (Z increases upward, -gravity direction  )
324  C                 ( vertical coord == m  -> rkFac =  1 )  C                  (= +1 for R=P (P increases downward, +gravity direction)
325  C                 ( vertical coord == Pa -> rkFac = -1 )  C     rkSign - Vertical coordinate to vertical index orientation.
326    C                 ( +1 same orientation, -1 opposite orientation )
327    C     globalArea :: Domain Integrated horizontal Area [m2]
328    C     maskH  - cell Center full-column mask (= 2D mask)
329    C     maskC  - cell Center land mask
330  C     maskW  - West face land mask  C     maskW  - West face land mask
331  C     maskS  - South face land mask  C     maskS  - South face land mask
332  C     recip_dxC   - Recipricol of dxC  C     recip_dxC   - Recipricol of dxC
# Line 325  C     recip_dyF   - Recipricol of dyF Line 339  C     recip_dyF   - Recipricol of dyF
339  C     recip_dyU   - Recipricol of dyU  C     recip_dyU   - Recipricol of dyU
340  C     recip_drC   - Recipricol of drC  C     recip_drC   - Recipricol of drC
341  C     recip_drF   - Recipricol of drF  C     recip_drF   - Recipricol of drF
342  C     recip_H     - Inverse of cell center open-depth  C     recip_Rcol  - Inverse of cell center column thickness (1/r_unit)
343  C     recip_hFacC - Inverse of cell open-depth f[X,Y,Z] ( dimensionless ).  C     recip_hFacC - Inverse of cell open-depth f[X,Y,Z] ( dimensionless ).
344  C     recip_hFacW   rhFacC center, rhFacW west, rhFacS south.  C     recip_hFacW   rhFacC center, rhFacW west, rhFacS south.
345  C     recip_hFacS   Note: This is precomputed here because it involves division.  C     recip_hFacS   Note: This is precomputed here because it involves division.
 C     saFac  - Shallow atmosphere factor (dimensionless scale factor).  
346  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
347  C              depend on the grid. They are not used in differencing or  C              depend on the grid. They are not used in differencing or
348  C              averaging but are just a convient quantity for I/O,  C              averaging but are just a convient quantity for I/O,
349  C              diagnostics etc.. As such xc is in m for cartesian  C              diagnostics etc.. As such xc is in m for cartesian
350  C              coordinates but degrees for spherical polar.  C              coordinates but degrees for spherical polar.
351  C     yC     - Y-coordinate of center of cell f[X,Y].  C     yC     - Y-coordinate of center of cell f[X,Y].
352  C     yG     - Y-coordinate of corner of cell ( c-grid vorticity point) f[X,Y].  C     yG     - Y-coordinate of corner of cell ( c-grid vorticity point) f[X,Y].
353  C     xC0, yC0 - West edge x coord  ( metres or degrees )  C     xC0, yC0 - West edge x coord  ( metres or degrees )
354  C                South edge y coord ( metres or degrees )  C                South edge y coord ( metres or degrees )
355  C     rA     - R-face are f[X,Y] ( m^2 ).  C     rA     - R-face are f[X,Y] ( m^2 ).
# Line 346  C                    orthogonal coordina Line 359  C                    orthogonal coordina
359  C                    metric terms).  C                    metric terms).
360  C     rC     - R-coordinate of center of cell f[Z] (units of r).  C     rC     - R-coordinate of center of cell f[Z] (units of r).
361  C     rF     - R-coordinate of face of cell f[Z] (units of r).  C     rF     - R-coordinate of face of cell f[Z] (units of r).
362    C     deepFacC  :: deep-model grid factor (fct of vertical only) for dx,dy
363    C     deepFacF     at level-center (deepFacC)  and level interface (deepFacF)
364    C     deepFac2C :: deep-model grid factor (fct of vertical only) for area dx*dy
365    C     deepFac2F    at level-center (deepFac2C) and level interface (deepFac2F)
366  C     tanPhiAtU - tan of the latitude at U point. Used for spherical polar  C     tanPhiAtU - tan of the latitude at U point. Used for spherical polar
367  C                 metric term in U equation.  C                 metric term in U equation.
368  C     tanPhiAtV - tan of the latitude at V point. Used for spherical polar  C     tanPhiAtV - tan of the latitude at V point. Used for spherical polar
369  C                 metric term in V equation.  C                 metric term in V equation.
370    C     angleCosC :: cosine of grid orientation angle relative to Geographic direction
371    C                  at cell center: alpha=(Eastward_dir,grid_uVel_dir)=(North_d,vVel_d)
372    C     angleSinC :: sinus  of grid orientation angle relative to Geographic direction
373    C                  at cell center: alpha=(Eastward_dir,grid_uVel_dir)=(North_d,vVel_d)
374    C     fCori     :: Coriolis parameter at grid Center point
375    C     fCoriG    :: Coriolis parameter at grid Corner point
376    C     fCoriCos  :: Coriolis Cos(phi) parameter at grid Center point (for NH)
377    
378        COMMON /GRID_R/        COMMON /GRID_R/
379       &  dxC,dxF,dxG,dxV,dyC,dyF,dyG,dyU,drC,drF,       &  cosFacU, cosFacV, sqCosFacU, sqCosFacV,
380       &  H,HFacC,HFacW,HFacS,DepthInK,       &  gravitySign, rkSign, globalArea,
381         &  deepFacC, deepFac2C, recip_deepFacC, recip_deepFac2C,
382         &  deepFacF, deepFac2F, recip_deepFacF, recip_deepFac2F,
383         &  dxC,dxF,dxG,dxV,dyC,dyF,dyG,dyU,
384         &  R_low,Ro_surf,hFacC,hFacW,hFacS,
385    #ifdef ALLOW_DEPTH_CONTROL
386         &  xx_r_low,
387    #endif /* ALLOW_DEPTH_CONTROL */
388       &  recip_dxC,recip_dxF,recip_dxG,recip_dxV,       &  recip_dxC,recip_dxF,recip_dxG,recip_dxV,
389       &  recip_dyC,recip_dyF,recip_dyG,recip_dyU,       &  recip_dyC,recip_dyF,recip_dyG,recip_dyU,
390       &  recip_drC,recip_drF,       &  recip_Rcol,
391       &  recip_H,       &  recip_hFacC,recip_hFacW,recip_hFacS,
392       &  recip_hFacC,recip_hFacW,recip_hFacS,       &  xC,yC,rA,rAw,rAs,rAz,xG,yG,
393       &  rkFac, recip_rkFac,       &  maskH, maskC,maskW,maskS,
394       &  saFac,       &  recip_rA,recip_rAw,recip_rAs,recip_rAz,
395       &  xC,yC,rA,rAw,rAs,rAz,rC,rF,yC0,xC0,xG,yG,       &  tanPhiAtU, tanPhiAtV, angleCosC, angleSinC,
396       &  maskW,maskS,recip_rA,recip_rAw,recip_rAs,recip_rAz,       &  drC,drF,recip_drC,recip_drF,rC,rF,
397       &  tanPhiAtU, tanPhiAtV       &  xC0, yC0,
398         &  fCori, fCoriG, fCoriCos
399          _RL cosFacU(1-Oly:sNy+Oly,nSx,nSy)
400          _RL cosFacV(1-Oly:sNy+Oly,nSx,nSy)
401          _RL sqCosFacU(1-Oly:sNy+Oly,nSx,nSy)
402          _RL sqCosFacV(1-Oly:sNy+Oly,nSx,nSy)
403          _RL gravitySign
404          _RL rkSign
405          _RL globalArea
406          _RL deepFacC (Nr)
407          _RL deepFac2C(Nr)
408          _RL deepFacF (Nr+1)
409          _RL deepFac2F(Nr+1)
410          _RL recip_deepFacC (Nr)
411          _RL recip_deepFac2C(Nr)
412          _RL recip_deepFacF (Nr+1)
413          _RL recip_deepFac2F(Nr+1)
414        _RS dxC            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS dxC            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
415        _RS dxF            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS dxF            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
416        _RS dxG            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS dxG            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
# Line 371  C                 metric term in V equat Line 419  C                 metric term in V equat
419        _RS dyF            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS dyF            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
420        _RS dyG            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS dyG            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
421        _RS dyU            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS dyU            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
422        _RS drC            (1:Nr)        _RS R_low          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
423        _RS drF            (1:Nr)        _RS Ro_surf        (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
424        _RS rkFac  #ifdef ALLOW_DEPTH_CONTROL
425        _RS recip_rkFac        _RL xx_r_low       (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
426        _RS DepthInK       (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)  #endif /* ALLOW_DEPTH_CONTROL */
427        _RS H              (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS hFacC          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
428        _RS HFacC          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)        _RS hFacW          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
429        _RS HFacW          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)        _RS hFacS          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
       _RS HFacS          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)  
430        _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)
431        _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)
432        _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)
# Line 388  C                 metric term in V equat Line 435  C                 metric term in V equat
435        _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)
436        _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)
437        _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)
438        _RS recip_drC      (1:Nr)        _RS recip_Rcol     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
       _RS recip_drF      (1:Nr)  
       _RS recip_h        (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)  
439        _RS recip_hFacC    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)        _RS recip_hFacC    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
440        _RS recip_hFacW    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)        _RS recip_hFacW    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
441        _RS recip_hFacS    (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)  
442        _RS xC             (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS xC             (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
443        _RS xG             (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS xG             (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
       _RS xC0  
444        _RS yC             (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS yC             (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
445        _RS yG             (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS yG             (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
       _RS yC0  
446        _RS rA             (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS rA             (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
447        _RS rAw            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS rAw            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
448        _RS rAs            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS rAs            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
# Line 409  C                 metric term in V equat Line 451  C                 metric term in V equat
451        _RS recip_rAw      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS recip_rAw      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
452        _RS recip_rAs      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS recip_rAs      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
453        _RS recip_rAz      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS recip_rAz      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
454        _RS rC             (1:Nr)        _RS maskH          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
455        _RS rF             (1:Nr+1)        _RS maskC          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
456        _RS maskW          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)        _RS maskW          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
457        _RS maskS          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)        _RS maskS          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
458        _RS tanPhiAtU      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS tanPhiAtU      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
459        _RS tanPhiAtV      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS tanPhiAtV      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
460          _RS angleCosC      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
461          _RS angleSinC      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
462          _RS drC            (1:Nr)
463          _RS drF            (1:Nr)
464          _RS recip_drC      (1:Nr)
465          _RS recip_drF      (1:Nr)
466          _RS rC             (1:Nr)
467          _RS rF             (1:Nr+1)
468          _RS xC0
469          _RS yC0
470          _RS fCori(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
471          _RS fCoriG(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
472          _RS fCoriCos(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
473    
474    C--   COMMON /GRID_I/ INTEGER valued grid defining variables.
475    C     kSurfC  :: vertical index of the surface tracer cell
476    C     kSurfW  :: vertical index of the surface U point
477    C     kSurfS  :: vertical index of the surface V point
478    C     kLowC   :: index of the r-lowest "wet cell" (2D)
479    C IMPORTANT: ksurfC,W,S = Nr+1 and kLowC = 0 where the fluid column
480    C            is empty (continent)
481          COMMON /GRID_I/
482         &  kSurfC, kSurfW, kSurfS,
483         &  kLowC
484          INTEGER kSurfC(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
485          INTEGER kSurfW(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
486          INTEGER kSurfS(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
487          INTEGER kLowC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
488    
 #ifdef ALLOW_NONHYDROSTATIC  
       COMMON /GRID_NH/  
      &  recip_hFacU  
       _RS recip_hFacU    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)  
 #endif  

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.34

  ViewVC Help
Powered by ViewVC 1.1.22