Back to home page

MITgcm

 
 

    


File indexing completed on 2021-11-06 05:16:37 UTC

view on githubraw file Latest commit 1c2b1fa3 on 2021-10-19 18:24:13 UTC
924557e60a Chri*0001 C
ac0f2a1690 Chri*0002 CBOP
                0003 C    !ROUTINE: GRID.h
                0004 C    !INTERFACE:
                0005 C    include GRID.h
                0006 C    !DESCRIPTION: \bv
                0007 C     *==========================================================*
1202a37b57 Jean*0008 C     | GRID.h
                0009 C     | o Header file defining model grid.
ac0f2a1690 Chri*0010 C     *==========================================================*
1202a37b57 Jean*0011 C     | Model grid is defined for each process by reference to
                0012 C     | the arrays set here.
                0013 C     | Notes
                0014 C     | =====
                0015 C     | The standard MITgcm convention of westmost, southern most
                0016 C     | and upper most having the (1,1,1) index is used here.
                0017 C     | i.e.
                0018 C     |----------------------------------------------------------
                0019 C     | (1)  Plan view schematic of model grid (top layer i.e. )
                0020 C     |      ================================= ( ocean surface )
                0021 C     |                                        ( or top of     )
                0022 C     |                                        ( atmosphere    )
                0023 C     |      This diagram shows the location of the model
                0024 C     |      prognostic variables on the model grid. The "T"
                0025 C     |      location is used for all tracers. The figure also
                0026 C     |      shows the southern most, western most indexing
                0027 C     |      convention that is used for all model variables.
                0028 C     |
                0029 C     |
                0030 C     |             V(i=1,                     V(i=Nx,
                0031 C     |               j=Ny+1,                    j=Ny+1,
                0032 C     |               k=1)                       k=1)
                0033 C     |                /|\                       /|\  "PWX"
                0034 C     |       |---------|------------------etc..  |---- *---
                0035 C     |       |                     |                   *  |
                0036 C     |"PWY"*******************************etc..  **********"PWY"
                0037 C     |       |                     |                   *  |
                0038 C     |       |                     |                   *  |
                0039 C     |       |                     |                   *  |
                0040 C     |U(i=1, ==>       x           |             x     *==>U
                0041 C     |  j=Ny,|      T(i=1,         |          T(i=Nx,  *(i=Nx+1,
                0042 C     |  k=1) |        j=Ny,        |            j=Ny,  *  |j=Ny,
                0043 C     |       |        k=1)         |            k=1)   *  |k=1)
                0044 C     |
                0045 C     |       .                     .                      .
                0046 C     |       .                     .                      .
                0047 C     |       .                     .                      .
                0048 C     |       e                     e                   *  e
                0049 C     |       t                     t                   *  t
                0050 C     |       c                     c                   *  c
                0051 C     |       |                     |                   *  |
                0052 C     |       |                     |                   *  |
                0053 C     |U(i=1, ==>       x           |             x     *  |
                0054 C     |  j=2, |      T(i=1,         |          T(i=Nx,  *  |
                0055 C     |  k=1) |        j=2,         |            j=2,   *  |
                0056 C     |       |        k=1)         |            k=1)   *  |
                0057 C     |       |                     |                   *  |
                0058 C     |       |        /|\          |            /|\    *  |
                0059 C     |      -----------|------------------etc..  |-----*---
                0060 C     |       |       V(i=1,        |           V(i=Nx, *  |
                0061 C     |       |         j=2,        |             j=2,  *  |
                0062 C     |       |         k=1)        |             k=1)  *  |
                0063 C     |       |                     |                   *  |
                0064 C     |U(i=1, ==>       x         ==>U(i=2,       x     *==>U
                0065 C     |  j=1, |      T(i=1,         |  j=1,    T(i=Nx,  *(i=Nx+1,
                0066 C     |  k=1) |        j=1,         |  k=1)      j=1,   *  |j=1,
                0067 C     |       |        k=1)         |            k=1)   *  |k=1)
                0068 C     |       |                     |                   *  |
                0069 C     |       |        /|\          |            /|\    *  |
                0070 C     |"SB"++>|---------|------------------etc..  |-----*---
                0071 C     |      /+\      V(i=1,                    V(i=Nx, *
                0072 C     |       +         j=1,                      j=1,  *
                0073 C     |       +         k=1)                      k=1)  *
                0074 C     |     "WB"                                      "PWX"
                0075 C     |
                0076 C     |   N, y increasing northwards
                0077 C     |  /|\ j increasing northwards
                0078 C     |   |
                0079 C     |   |
                0080 C     |   ======>E, x increasing eastwards
                0081 C     |             i increasing eastwards
                0082 C     |
                0083 C     |    i: East-west index
                0084 C     |    j: North-south index
                0085 C     |    k: up-down index
                0086 C     |    U: x-velocity (m/s)
                0087 C     |    V: y-velocity (m/s)
                0088 C     |    T: potential temperature (oC)
                0089 C     | "SB": Southern boundary
                0090 C     | "WB": Western boundary
                0091 C     |"PWX": Periodic wrap around in X.
                0092 C     |"PWY": Periodic wrap around in Y.
                0093 C     |----------------------------------------------------------
                0094 C     | (2) South elevation schematic of model grid
                0095 C     |     =======================================
                0096 C     |     This diagram shows the location of the model
                0097 C     |     prognostic variables on the model grid. The "T"
                0098 C     |     location is used for all tracers. The figure also
                0099 C     |     shows the upper most, western most indexing
                0100 C     |     convention that is used for all model variables.
                0101 C     |
                0102 C     |      "WB"
                0103 C     |       +
                0104 C     |       +
d5d020ff5e Alis*0105 C     |      \+/       /|\                       /|\       .
1202a37b57 Jean*0106 C     |"UB"++>|-------- | -----------------etc..  | ----*---
                0107 C     |       |    rVel(i=1,        |        rVel(i=Nx, *  |
                0108 C     |       |         j=1,        |             j=1,  *  |
                0109 C     |       |         k=1)        |             k=1)  *  |
                0110 C     |       |                     |                   *  |
                0111 C     |U(i=1, ==>       x         ==>U(i=2,       x     *==>U
                0112 C     |  j=1, |      T(i=1,         |  j=1,    T(i=Nx,  *(i=Nx+1,
                0113 C     |  k=1) |        j=1,         |  k=1)      j=1,   *  |j=1,
                0114 C     |       |        k=1)         |            k=1)   *  |k=1)
                0115 C     |       |                     |                   *  |
                0116 C     |       |        /|\          |            /|\    *  |
                0117 C     |       |-------- | -----------------etc..  | ----*---
                0118 C     |       |    rVel(i=1,        |        rVel(i=Nx, *  |
                0119 C     |       |         j=1,        |             j=1,  *  |
                0120 C     |       |         k=2)        |             k=2)  *  |
                0121 C     |
                0122 C     |       .                     .                      .
                0123 C     |       .                     .                      .
                0124 C     |       .                     .                      .
                0125 C     |       e                     e                   *  e
                0126 C     |       t                     t                   *  t
                0127 C     |       c                     c                   *  c
                0128 C     |       |                     |                   *  |
                0129 C     |       |                     |                   *  |
                0130 C     |       |                     |                   *  |
                0131 C     |       |                     |                   *  |
                0132 C     |       |        /|\          |            /|\    *  |
                0133 C     |       |-------- | -----------------etc..  | ----*---
                0134 C     |       |    rVel(i=1,        |        rVel(i=Nx, *  |
                0135 C     |       |         j=1,        |             j=1,  *  |
                0136 C     |       |         k=Nr)       |             k=Nr) *  |
                0137 C     |U(i=1, ==>       x         ==>U(i=2,       x     *==>U
                0138 C     |  j=1, |      T(i=1,         |  j=1,    T(i=Nx,  *(i=Nx+1,
                0139 C     |  k=Nr)|        j=1,         |  k=Nr)     j=1,   *  |j=1,
                0140 C     |       |        k=Nr)        |            k=Nr)  *  |k=Nr)
                0141 C     |       |                     |                   *  |
                0142 C     |"LB"++>==============================================
                0143 C     |                                               "PWX"
                0144 C     |
                0145 C     | Up   increasing upwards.
d5d020ff5e Alis*0146 C     |/|\                                                       .
1202a37b57 Jean*0147 C     | |
                0148 C     | |
                0149 C     | =====> E  i increasing eastwards
                0150 C     | |         x increasing eastwards
                0151 C     | |
                0152 C     |\|/
                0153 C     | Down,k increasing downwards.
                0154 C     |
                0155 C     | Note: r => height (m) => r increases upwards
                0156 C     |       r => pressure (Pa) => r increases downwards
                0157 C     |
                0158 C     |
                0159 C     |    i: East-west index
                0160 C     |    j: North-south index
                0161 C     |    k: up-down index
                0162 C     |    U: x-velocity (m/s)
                0163 C     | rVel: z-velocity ( units of r )
                0164 C     |       The vertical velocity variable rVel is in units of
                0165 C     |       "r" the vertical coordinate. r in m will give
                0166 C     |       rVel m/s. r in Pa will give rVel Pa/s.
                0167 C     |    T: potential temperature (oC)
                0168 C     | "UB": Upper boundary.
                0169 C     | "LB": Lower boundary (always solid - therefore om|w == 0)
                0170 C     | "WB": Western boundary
                0171 C     |"PWX": Periodic wrap around in X.
                0172 C     |----------------------------------------------------------
                0173 C     | (3) Views showing nomenclature and indexing
                0174 C     |     for grid descriptor variables.
                0175 C     |
                0176 C     |      Fig 3a. shows the orientation, indexing and
                0177 C     |      notation for the grid spacing terms used internally
                0178 C     |      for the evaluation of gradient and averaging terms.
                0179 C     |      These varaibles are set based on the model input
                0180 C     |      parameters which define the model grid in terms of
                0181 C     |      spacing in X, Y and Z.
                0182 C     |
                0183 C     |      Fig 3b. shows the orientation, indexing and
                0184 C     |      notation for the variables that are used to define
                0185 C     |      the model grid. These varaibles are set directly
                0186 C     |      from the model input.
                0187 C     |
                0188 C     | Figure 3a
                0189 C     | =========
                0190 C     |       |------------------------------------
                0191 C     |       |                       |
                0192 C     |"PWY"********************************* etc...
                0193 C     |       |                       |
                0194 C     |       |                       |
                0195 C     |       |                       |
                0196 C     |       |                       |
                0197 C     |       |                       |
                0198 C     |       |                       |
                0199 C     |       |                       |
                0200 C     |
                0201 C     |       .                       .
                0202 C     |       .                       .
                0203 C     |       .                       .
                0204 C     |       e                       e
                0205 C     |       t                       t
                0206 C     |       c                       c
                0207 C     |       |-----------v-----------|-----------v----------|-
                0208 C     |       |                       |                      |
                0209 C     |       |                       |                      |
                0210 C     |       |                       |                      |
                0211 C     |       |                       |                      |
                0212 C     |       |                       |                      |
                0213 C     |       u<--dxF(i=1,j=2,k=1)--->u           t          |
                0214 C     |       |/|\       /|\          |                      |
                0215 C     |       | |         |           |                      |
                0216 C     |       | |         |           |                      |
                0217 C     |       | |         |           |                      |
                0218 C     |       |dyU(i=1,  dyC(i=1,     |                      |
                0219 C     | ---  ---|--j=2,---|--j=2,-----------------v----------|-
                0220 C     | /|\   | |  k=1)   |  k=1)     |          /|\         |
                0221 C     |  |    | |         |           |          dyF(i=2,    |
                0222 C     |  |    | |         |           |           |  j=1,    |
                0223 C     |dyG(   |\|/       \|/          |           |  k=1)    |
                0224 C     |   i=1,u---        t<---dxC(i=2,j=1,k=1)-->t          |
                0225 C     |   j=1,|                       |           |          |
                0226 C     |   k=1)|                       |           |          |
                0227 C     |  |    |                       |           |          |
                0228 C     |  |    |                       |           |          |
                0229 C     | \|/   |           |<---dxV(i=2,j=1,k=1)--\|/         |
                0230 C     |"SB"++>|___________v___________|___________v__________|_
                0231 C     |       <--dxG(i=1,j=1,k=1)----->
d5d020ff5e Alis*0232 C     |      /+\                                              .
1202a37b57 Jean*0233 C     |       +
                0234 C     |       +
                0235 C     |     "WB"
                0236 C     |
                0237 C     |   N, y increasing northwards
                0238 C     |  /|\ j increasing northwards
                0239 C     |   |
                0240 C     |   |
                0241 C     |   ======>E, x increasing eastwards
                0242 C     |             i increasing eastwards
                0243 C     |
                0244 C     |    i: East-west index
                0245 C     |    j: North-south index
                0246 C     |    k: up-down index
                0247 C     |    u: x-velocity point
                0248 C     |    V: y-velocity point
                0249 C     |    t: tracer point
                0250 C     | "SB": Southern boundary
                0251 C     | "WB": Western boundary
                0252 C     |"PWX": Periodic wrap around in X.
                0253 C     |"PWY": Periodic wrap around in Y.
                0254 C     |
                0255 C     | Figure 3b
                0256 C     | =========
                0257 C     |
                0258 C     |       .                       .
                0259 C     |       .                       .
                0260 C     |       .                       .
                0261 C     |       e                       e
                0262 C     |       t                       t
                0263 C     |       c                       c
                0264 C     |       |-----------v-----------|-----------v--etc...
                0265 C     |       |                       |
                0266 C     |       |                       |
                0267 C     |       |                       |
                0268 C     |       |                       |
                0269 C     |       |                       |
                0270 C     |       u<--delX(i=1)---------->u           t
                0271 C     |       |                       |
                0272 C     |       |                       |
                0273 C     |       |                       |
                0274 C     |       |                       |
                0275 C     |       |                       |
                0276 C     |       |-----------v-----------------------v--etc...
                0277 C     |       |          /|\          |
                0278 C     |       |           |           |
                0279 C     |       |           |           |
                0280 C     |       |           |           |
                0281 C     |       u        delY(j=1)      |           t
                0282 C     |       |           |           |
                0283 C     |       |           |           |
                0284 C     |       |           |           |
                0285 C     |       |           |           |
                0286 C     |       |          \|/          |
                0287 C     |"SB"++>|___________v___________|___________v__etc...
d5d020ff5e Alis*0288 C     |      /+\                                                 .
1202a37b57 Jean*0289 C     |       +
                0290 C     |       +
                0291 C     |     "WB"
                0292 C     |
ac0f2a1690 Chri*0293 C     *==========================================================*
                0294 C     \ev
                0295 CEOP
5c76561bf0 Chri*0296 
                0297 C     Macros that override/modify standard definitions
                0298 #include "GRID_MACROS.h"
                0299 
1202a37b57 Jean*0300 C--   COMMON /GRID_RL/ RL valued grid defining variables.
c5eaffde99 Jean*0301 C     deepFacC  :: deep-model grid factor (fct of vertical only) for dx,dy
                0302 C     deepFacF     at level-center (deepFacC)  and level interface (deepFacF)
                0303 C     deepFac2C :: deep-model grid factor (fct of vertical only) for area dx*dy
                0304 C     deepFac2F    at level-center (deepFac2C) and level interface (deepFac2F)
1202a37b57 Jean*0305 C     gravitySign :: indicates the direction of gravity relative to R direction
                0306 C                   (= -1 for R=Z (Z increases upward, -gravity direction  )
                0307 C                   (= +1 for R=P (P increases downward, +gravity direction)
                0308 C     rkSign     :: Vertical coordinate to vertical index orientation.
                0309 C                   ( +1 same orientation, -1 opposite orientation )
                0310 C     globalArea :: Domain Integrated horizontal Area [m2]
                0311       COMMON /GRID_RL/
                0312      &  cosFacU, cosFacV, sqCosFacU, sqCosFacV,
                0313      &  deepFacC, deepFac2C, recip_deepFacC, recip_deepFac2C,
                0314      &  deepFacF, deepFac2F, recip_deepFacF, recip_deepFac2F,
                0315      &  gravitySign, rkSign, globalArea
75e9aa41a6 Jean*0316       _RL cosFacU        (1-OLy:sNy+OLy,nSx,nSy)
                0317       _RL cosFacV        (1-OLy:sNy+OLy,nSx,nSy)
                0318       _RL sqCosFacU      (1-OLy:sNy+OLy,nSx,nSy)
                0319       _RL sqCosFacV      (1-OLy:sNy+OLy,nSx,nSy)
1202a37b57 Jean*0320       _RL deepFacC       (Nr)
                0321       _RL deepFac2C      (Nr)
                0322       _RL deepFacF       (Nr+1)
                0323       _RL deepFac2F      (Nr+1)
                0324       _RL recip_deepFacC (Nr)
                0325       _RL recip_deepFac2C(Nr)
                0326       _RL recip_deepFacF (Nr+1)
                0327       _RL recip_deepFac2F(Nr+1)
                0328       _RL gravitySign
                0329       _RL rkSign
                0330       _RL globalArea
                0331 
                0332 C--   COMMON /GRID_RS/ RS valued grid defining variables.
                0333 C     dxC     :: Cell center separation in X across western cell wall (m)
                0334 C     dxG     :: Cell face separation in X along southern cell wall (m)
                0335 C     dxF     :: Cell face separation in X thru cell center (m)
                0336 C     dxV     :: V-point separation in X across south-west corner of cell (m)
                0337 C     dyC     :: Cell center separation in Y across southern cell wall (m)
                0338 C     dyG     :: Cell face separation in Y along western cell wall (m)
                0339 C     dyF     :: Cell face separation in Y thru cell center (m)
                0340 C     dyU     :: U-point separation in Y across south-west corner of cell (m)
                0341 C     drC     :: Cell center separation along Z axis ( units of r ).
                0342 C     drF     :: Cell face separation along Z axis ( units of r ).
                0343 C     R_low   :: base of fluid in r_unit (Depth(m) / Pressure(Pa) at top Atmos.)
3efbd3434a Jean*0344 C     rLowW   :: base of fluid column in r_unit at Western  edge location.
                0345 C     rLowS   :: base of fluid column in r_unit at Southern edge location.
1202a37b57 Jean*0346 C     Ro_surf :: surface reference (at rest) position, r_unit.
3efbd3434a Jean*0347 C     rSurfW  :: surface reference position at Western  edge location [r_unit].
                0348 C     rSurfS  :: surface reference position at Southern edge location [r_unit].
1202a37b57 Jean*0349 C     hFac    :: Fraction of cell in vertical which is open i.e how
                0350 C              "lopped" a cell is (dimensionless scale factor).
75e9aa41a6 Jean*0351 C              Note: The code needs terms like MIN(hFac,hFac(I-1))
1202a37b57 Jean*0352 C                    On some platforms it may be better to precompute
75e9aa41a6 Jean*0353 C                    hFacW, hFacS, ... here than do MIN on the fly.
e3cb4a8313 Jean*0354 C     maskInC :: Cell Center 2-D Interior mask (i.e., zero beyond OB)
                0355 C     maskInW :: West  face 2-D Interior mask (i.e., zero on and beyond OB)
                0356 C     maskInS :: South face 2-D Interior mask (i.e., zero on and beyond OB)
1202a37b57 Jean*0357 C     maskC   :: cell Center land mask
                0358 C     maskW   :: West face land mask
                0359 C     maskS   :: South face land mask
71c54f7424 Jean*0360 C     recip_dxC   :: Reciprocal of dxC
                0361 C     recip_dxG   :: Reciprocal of dxG
                0362 C     recip_dxF   :: Reciprocal of dxF
                0363 C     recip_dxV   :: Reciprocal of dxV
                0364 C     recip_dyC   :: Reciprocal of dxC
                0365 C     recip_dyG   :: Reciprocal of dyG
                0366 C     recip_dyF   :: Reciprocal of dyF
                0367 C     recip_dyU   :: Reciprocal of dyU
                0368 C     recip_drC   :: Reciprocal of drC
                0369 C     recip_drF   :: Reciprocal of drF
1202a37b57 Jean*0370 C     recip_Rcol  :: Inverse of cell center column thickness (1/r_unit)
                0371 C     recip_hFacC :: Inverse of cell open-depth f[X,Y,Z] ( dimensionless ).
                0372 C     recip_hFacW    rhFacC center, rhFacW west, rhFacS south.
1c2b1fa3bc Mart*0373 C     recip_hFacS   Note: This is precomputed here because it involves division.
                0374 C     xC     :: X-coordinate of cell center f[X,Y]. The units of xc, yc
                0375 C               depend on the grid. They are not used in differencing or
                0376 C               averaging but are just a convient quantity for I/O,
                0377 C               diagnostics etc.. As such xc is in m for cartesian
                0378 C               coordinates but degrees for spherical polar.
                0379 C     yC     :: Y-coordinate of center of cell f[X,Y].
                0380 C     yG     :: Y-coordinate of corner of cell (c-grid vorticity point) f[X,Y].
                0381 C     rA     :: R-face are f[X,Y] ( m^2 ).
                0382 C               Note: In a cartesian framework rA is simply dx*dy,
                0383 C                   however we use rA to allow for non-globally
                0384 C                   orthogonal coordinate frames (with appropriate
                0385 C                   metric terms).
                0386 C     rC     :: R-coordinate of center of cell f[Z] (units of r).
                0387 C     rF     :: R-coordinate of face of cell f[Z] (units of r).
f15994caab Jean*0388 C - *HybSigm* - :: Hybrid-Sigma vert. Coord coefficients
                0389 C     aHybSigmF    at level-interface (*HybSigmF) and level-center (*HybSigmC)
                0390 C     aHybSigmC    aHybSigm* = constant r part, bHybSigm* = sigma part, such as
                0391 C     bHybSigmF    r(ij,k,t) = rLow(ij) + aHybSigm(k)*[rF(1)-rF(Nr+1)]
                0392 C     bHybSigmC              + bHybSigm(k)*[eta(ij,t)+Ro_surf(ij) - rLow(ij)]
1c2b1fa3bc Mart*0393 C     dAHybSigF :: vertical increment of Hybrid-Sigma coeff.: constant r part,
f15994caab Jean*0394 C     dAHybSigC    between interface (dAHybSigF) and between center (dAHybSigC)
                0395 C     dBHybSigF :: vertical increment of Hybrid-Sigma coefficient: sigma part,
                0396 C     dBHybSigC    between interface (dBHybSigF) and between center (dBHybSigC)
1202a37b57 Jean*0397 C     tanPhiAtU :: tan of the latitude at U point. Used for spherical polar
                0398 C                  metric term in U equation.
                0399 C     tanPhiAtV :: tan of the latitude at V point. Used for spherical polar
                0400 C                  metric term in V equation.
1c2b1fa3bc Mart*0401 C     angleCosC :: cosine of grid orientation angle relative to Geographic
                0402 C direction at cell center: alpha=(Eastward_dir,grid_uVel_dir)=(North_d,vVel_d)
                0403 C     angleSinC :: sine   of grid orientation angle relative to Geographic
                0404 C direction at cell center: alpha=(Eastward_dir,grid_uVel_dir)=(North_d,vVel_d)
c60325a5b9 Jean*0405 C     u2zonDir  :: cosine of grid orientation angle at U point location
                0406 C     v2zonDir  :: minus sine of  orientation angle at V point location
ccfec6784d Jean*0407 C     fCori     :: Coriolis parameter at grid Center point
                0408 C     fCoriG    :: Coriolis parameter at grid Corner point
                0409 C     fCoriCos  :: Coriolis Cos(phi) parameter at grid Center point (for NH)
60c223928f Mart*0410 
1202a37b57 Jean*0411       COMMON /GRID_RS/
aea29c8517 Alis*0412      &  dxC,dxF,dxG,dxV,dyC,dyF,dyG,dyU,
1c2b1fa3bc Mart*0413      &  rLowW, rLowS,
3efbd3434a Jean*0414      &  Ro_surf, rSurfW, rSurfS,
c8a2a4bee7 Chri*0415      &  recip_dxC,recip_dxF,recip_dxG,recip_dxV,
                0416      &  recip_dyC,recip_dyF,recip_dyG,recip_dyU,
aea29c8517 Alis*0417      &  xC,yC,rA,rAw,rAs,rAz,xG,yG,
e3cb4a8313 Jean*0418      &  maskInC, maskInW, maskInS,
                0419      &  maskC, maskW, maskS,
31cfced703 Jean*0420      &  recip_rA,recip_rAw,recip_rAs,recip_rAz,
3efbd3434a Jean*0421      &  drC, drF, recip_drC, recip_drF, rC, rF,
f15994caab Jean*0422      &  aHybSigmF, bHybSigmF, aHybSigmC, bHybSigmC,
                0423      &  dAHybSigF, dBHybSigF, dBHybSigC, dAHybSigC,
c60325a5b9 Jean*0424      &  tanPhiAtU, tanPhiAtV,
                0425      &  angleCosC, angleSinC, u2zonDir, v2zonDir,
ccfec6784d Jean*0426      &  fCori, fCoriG, fCoriCos
c8a2a4bee7 Chri*0427       _RS dxC            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0428       _RS dxF            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0429       _RS dxG            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0430       _RS dxV            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0431       _RS dyC            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0432       _RS dyF            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0433       _RS dyG            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0434       _RS dyU            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
3efbd3434a Jean*0435       _RS rLowW          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0436       _RS rLowS          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
aea29c8517 Alis*0437       _RS Ro_surf        (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
3efbd3434a Jean*0438       _RS rSurfW         (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0439       _RS rSurfS         (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
c8a2a4bee7 Chri*0440       _RS recip_dxC      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0441       _RS recip_dxF      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0442       _RS recip_dxG      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0443       _RS recip_dxV      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0444       _RS recip_dyC      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0445       _RS recip_dyF      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0446       _RS recip_dyG      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0447       _RS recip_dyU      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0448       _RS xC             (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
fb481a83c2 Alis*0449       _RS xG             (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
c8a2a4bee7 Chri*0450       _RS yC             (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
fb481a83c2 Alis*0451       _RS yG             (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
c8a2a4bee7 Chri*0452       _RS rA             (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
c1701ff971 Alis*0453       _RS rAw            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0454       _RS rAs            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
fb481a83c2 Alis*0455       _RS rAz            (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0456       _RS recip_rA       (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0457       _RS recip_rAw      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0458       _RS recip_rAs      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0459       _RS recip_rAz      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
e3cb4a8313 Jean*0460       _RS maskInC        (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0461       _RS maskInW        (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0462       _RS maskInS        (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
1202a37b57 Jean*0463       _RS maskC          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0464       _RS maskW          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0465       _RS maskS          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
75e9aa41a6 Jean*0466       _RS drC            (Nr+1)
1202a37b57 Jean*0467       _RS drF            (Nr)
75e9aa41a6 Jean*0468       _RS recip_drC      (Nr+1)
1202a37b57 Jean*0469       _RS recip_drF      (Nr)
                0470       _RS rC             (Nr)
                0471       _RS rF             (Nr+1)
f15994caab Jean*0472       _RS aHybSigmF      (Nr+1)
                0473       _RS bHybSigmF      (Nr+1)
                0474       _RS aHybSigmC      (Nr)
                0475       _RS bHybSigmC      (Nr)
                0476       _RS dAHybSigF      (Nr)
                0477       _RS dBHybSigF      (Nr)
                0478       _RS dBHybSigC      (Nr+1)
                0479       _RS dAHybSigC      (Nr+1)
3efbd3434a Jean*0480       _RS tanPhiAtU      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0481       _RS tanPhiAtV      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0482       _RS angleCosC      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0483       _RS angleSinC      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
c60325a5b9 Jean*0484       _RS u2zonDir       (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0485       _RS v2zonDir       (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
1202a37b57 Jean*0486       _RS fCori          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0487       _RS fCoriG         (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0488       _RS fCoriCos       (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0489 
1c2b1fa3bc Mart*0490 C--   COMMON /GRID_VAR_RS/ potentially time-dependent or active RS
                0491 C     valued grid defining variables. These grid defining variables are
                0492 C     time-dependent when using a non-linear free surface, or they are
                0493 C     active in an AD sense when using depth as a control parameter, or
                0494 C     both.
                0495       COMMON /GRID_VAR_RS/
                0496      &  hFacC, hFacW, hFacS,
                0497      &  recip_hFacC,recip_hFacW,recip_hFacS,
                0498      &  R_low, recip_Rcol
                0499       _RS hFacC          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0500       _RS hFacW          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0501       _RS hFacS          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0502       _RS recip_hFacC    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0503       _RS recip_hFacW    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0504       _RS recip_hFacS    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0505       _RS R_low          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0506       _RS recip_Rcol     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0507 
1202a37b57 Jean*0508 #ifdef ALLOW_DEPTH_CONTROL
                0509 C--   COMMON /GRID_DEPTH_CTRL/ grid defining variables for Depth Control code.
                0510 C     xx_r_low  :: in TAF-sense active replacement of R_low
                0511       COMMON /GRID_DEPTH_CTRL/
                0512      &  xx_r_low
                0513       _RL xx_r_low       (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0514 #endif /* ALLOW_DEPTH_CONTROL */
ccfec6784d Jean*0515 
472726f723 Jean*0516 C--   COMMON /GRID_I/ INTEGER valued grid defining variables.
                0517 C     kSurfC  :: vertical index of the surface tracer cell
                0518 C     kSurfW  :: vertical index of the surface U point
                0519 C     kSurfS  :: vertical index of the surface V point
                0520 C     kLowC   :: index of the r-lowest "wet cell" (2D)
3361082848 Jean*0521 C IMPORTANT: kLowC = 0 and kSurfC,W,S = Nr+1 (or =Nr+2 on a thin-wall)
                0522 C            where the fluid column is empty (continent)
472726f723 Jean*0523       COMMON /GRID_I/
                0524      &  kSurfC, kSurfW, kSurfS,
                0525      &  kLowC
                0526       INTEGER kSurfC(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0527       INTEGER kSurfW(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0528       INTEGER kSurfS(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0529       INTEGER kLowC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0530 
1202a37b57 Jean*0531 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|