1 |
C $Header: /u/gcmpack/MITgcm/pkg/layers/LAYERS.h,v 1.13 2012/10/19 18:01:44 rpa Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#ifdef ALLOW_LAYERS |
5 |
|
6 |
C-- Header for LAYERS package. By Ryan Abernathey. |
7 |
C-- For computing volume fluxes in isopyncal layers |
8 |
|
9 |
C -- Parms |
10 |
INTEGER LAYER_nb, layers_kref |
11 |
INTEGER layers_num(layers_maxNum), layers_krho(layers_maxNum) |
12 |
COMMON /LAYERS_PARM_I/ layers_num,layers_krho, |
13 |
& LAYER_nb, layers_kref |
14 |
|
15 |
CHARACTER*(3) layers_name(layers_maxNum) |
16 |
COMMON /LAYERS_PARM_C/ layers_name |
17 |
|
18 |
_RL layers_taveFreq, layers_diagFreq |
19 |
COMMON /LAYERS_PARM_RL/ layers_taveFreq, layers_diagFreq |
20 |
|
21 |
LOGICAL layers_MNC, layers_MDSIO, useBOLUS |
22 |
LOGICAL layers_bolus(layers_maxNum) |
23 |
COMMON /LAYERS_PARM_L/ layers_MNC, layers_MDSIO, |
24 |
& useBOLUS, layers_bolus |
25 |
|
26 |
C -- Isopycnal grid parameters: |
27 |
C layers_bounds :: boundaries of tracer layers |
28 |
C layers_G :: boundaries of tracer layers (retired) |
29 |
C dZZf :: height of fine grid cells |
30 |
C NZZ :: the number of levels to use in the fine grid |
31 |
C MapIndex :: indices for mapping ZZ to Z |
32 |
C MapFact :: factors for interpolating T(Z) to T(ZZ) |
33 |
|
34 |
_RL layers_G(nLayers+1) |
35 |
_RL layers_bounds(nLayers+1,layers_maxNum) |
36 |
_RL dZZf(FineGridMax) |
37 |
INTEGER MapIndex(FineGridMax), CellIndex(FineGridMax) |
38 |
_RL MapFact(FineGridMax) |
39 |
INTEGER NZZ |
40 |
COMMON /LAYERS_VERT_GRID_I/ |
41 |
& NZZ, MapIndex, CellIndex |
42 |
COMMON /LAYERS_VERT_GRID_R/ |
43 |
& layers_G, MapFact, dZZf, layers_bounds |
44 |
|
45 |
C -- 3D Layers fields. The vertical dimension in these fields is nLayers, |
46 |
C i.e. the isopycnal coordinate. |
47 |
C |
48 |
C layers_UH :: U integrated over layer (m^2/s) |
49 |
C layers_VH :: V integrated over layer (m^2/s) |
50 |
C layers_Hw :: Layer thickness at the U point (m) |
51 |
C layers_Hs :: Layer thickness at the V point (m) |
52 |
C layers_PIw :: 1 if layer exists, 0 otherwise |
53 |
C layers_PIs :: 1 if layer exists, 0 otherwise |
54 |
C layers_U :: mean zonal velocity in layer (only if layer exists) (m/s) |
55 |
C layers_V :: mean meridional velocity in layer (only if layer exists) (m/s) |
56 |
|
57 |
#ifdef LAYERS_UFLUX |
58 |
COMMON /LAYERS_VAR_UFLUX/ layers_UH |
59 |
_RL layers_UH (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nlayers,nSx,nSy) |
60 |
# ifdef LAYERS_THICKNESS |
61 |
COMMON /LAYERS_VAR_UTHICKNESS/ |
62 |
& layers_Hw, layers_PIw, layers_U |
63 |
_RL layers_Hw (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nlayers,nSx,nSy) |
64 |
_RL layers_PIw(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nlayers,nSx,nSy) |
65 |
_RL layers_U (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nlayers,nSx,nSy) |
66 |
# endif /* LAYERS_THICKNESS */ |
67 |
#endif /* LAYERS_UFLUX */ |
68 |
|
69 |
#ifdef LAYERS_VFLUX |
70 |
COMMON /LAYERS_VAR_VFLUX/ layers_VH |
71 |
_RL layers_VH (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nlayers,nSx,nSy) |
72 |
& |
73 |
# ifdef LAYERS_THICKNESS |
74 |
COMMON /LAYERS_VAR_VTHICKNESS/ |
75 |
& layers_Hs, layers_PIs, layers_V |
76 |
_RL layers_Hs (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nlayers,nSx,nSy) |
77 |
_RL layers_PIs(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nlayers,nSx,nSy) |
78 |
_RL layers_V (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nlayers,nSx,nSy) |
79 |
# endif /* LAYERS_THICKNESS */ |
80 |
#endif /* LAYERS_VFLUX */ |
81 |
|
82 |
#ifdef LAYERS_PRHO_REF |
83 |
COMMON /LAYERS_PRHO/ prho |
84 |
_RL prho(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
85 |
#endif |
86 |
|
87 |
C -- Thermodynamics fields |
88 |
C Right-hand-side tendency terms times thickness |
89 |
C |
90 |
C layers_TtendSurf :: Temperature tendency from surface forcing (m deg/s) |
91 |
C layers_TtendDiffh :: Temperature tendency from horizontal mixing (m deg/s) |
92 |
C layers_TtendDiffr :: Temperature tendency from vertical mixing (m deg/s) |
93 |
C layers_StendSurf :: Salinity tendency from surface forcing (m PSU/s) |
94 |
C layers_StendDiffh :: Salinity tendency from horizontal mixing (m PSU/s) |
95 |
C layers_StendDiffr :: Salinity tendency from vertical mixing (m PSU/s) |
96 |
C -- The following are temporary arrays that need to be stored. |
97 |
C -- They are in regular vertical coordinates. |
98 |
C -- The fourth index is tracer id: 1 for T and 2 for S |
99 |
C layers_surfflux :: surface temperature flux (same as diagnostics TFLUX and SFLUX) |
100 |
C layers_dfx :: zonal diffusive flux of T / S |
101 |
C layers_dfy :: meridional diffusive flux of T / S |
102 |
C layers_dfr :: vertical diffusive flux of T / S |
103 |
C -- to save memory, the same arrays are converted in place to divergences |
104 |
|
105 |
# ifdef LAYERS_THERMODYNAMICS |
106 |
COMMON /LAYERS_VAR_THERMODYNAMICS/ |
107 |
& layers_TtendSurf, layers_TtendDiffh, layers_TtendDiffr, |
108 |
& layers_StendSurf, layers_StendDiffh, layers_StendDiffr, |
109 |
& layers_Hc, layers_PIc, |
110 |
& layers_surfflux, layers_dfx, layers_dfy, layers_dfr |
111 |
_RL layers_TtendSurf (1-OLx:sNx+OLx,1-OLy:sNy+OLy, |
112 |
& Nlayers,nSx,nSy) |
113 |
_RL layers_TtendDiffh(1-OLx:sNx+OLx,1-OLy:sNy+OLy, |
114 |
& Nlayers,nSx,nSy) |
115 |
_RL layers_TtendDiffr(1-OLx:sNx+OLx,1-OLy:sNy+OLy, |
116 |
& Nlayers,nSx,nSy) |
117 |
_RL layers_StendSurf (1-OLx:sNx+OLx,1-OLy:sNy+OLy, |
118 |
& Nlayers,nSx,nSy) |
119 |
_RL layers_StendDiffh(1-OLx:sNx+OLx,1-OLy:sNy+OLy, |
120 |
& Nlayers,nSx,nSy) |
121 |
_RL layers_StendDiffr(1-OLx:sNx+OLx,1-OLy:sNy+OLy, |
122 |
& Nlayers,nSx,nSy) |
123 |
_RL layers_Hc(1-OLx:sNx+OLx,1-OLy:sNy+OLy, |
124 |
& Nlayers,nSx,nSy) |
125 |
_RL layers_PIc(1-OLx:sNx+OLx,1-OLy:sNy+OLy, |
126 |
& Nlayers,nSx,nSy) |
127 |
_RL layers_surfflux(1-OLx:sNx+OLx,1-OLy:sNy+OLy,1,2,nSx,nSy) |
128 |
_RL layers_dfx(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,2,nSx,nSy) |
129 |
_RL layers_dfy(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,2,nSx,nSy) |
130 |
_RL layers_dfr(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,2,nSx,nSy) |
131 |
# endif /* LAYERS_THERMODYAMICS */ |
132 |
|
133 |
#ifdef ALLOW_TIMEAVE |
134 |
C-- The same variables, time-averaged |
135 |
|
136 |
C Keep track of time |
137 |
_RL layers_TimeAve(nSx,nSy) |
138 |
COMMON /LAYERS_TAVE/ layers_TimeAve |
139 |
|
140 |
#ifdef LAYERS_UFLUX |
141 |
_RL layers_UH_T(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nlayers, |
142 |
& nSx,nSy) |
143 |
#ifdef LAYERS_THICKNESS |
144 |
_RL layers_Hw_T(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nlayers, |
145 |
& nSx,nSy) |
146 |
COMMON /LAYERS_U_TAVE/ layers_UH_T, |
147 |
& layers_Hw_T |
148 |
#else /* LAYERS_THICKNESS */ |
149 |
COMMON /LAYERS_U_TAVE/ layers_UH_T |
150 |
#endif /* LAYERS_THICKNESS */ |
151 |
#endif /* LAYERS_UFLUX */ |
152 |
|
153 |
#ifdef LAYERS_VFLUX |
154 |
_RL layers_VH_T(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nlayers, |
155 |
& nSx,nSy) |
156 |
#ifdef LAYERS_THICKNESS |
157 |
_RL layers_Hs_T(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nlayers, |
158 |
& nSx,nSy) |
159 |
COMMON /LAYERS_V_TAVE/ layers_VH_T, |
160 |
& layers_Hs_T |
161 |
#else /* LAYERS_THICKNESS */ |
162 |
COMMON /LAYERS_V_TAVE/ layers_VH_T |
163 |
#endif /* LAYERS_THICKNESS */ |
164 |
#endif /* LAYERS_VFLUX */ |
165 |
|
166 |
#ifdef LAYERS_PRHO_REF |
167 |
_RL prho_tave(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
168 |
COMMON /LAYERS_RPHO_TAVE/ prho_tave |
169 |
#endif |
170 |
|
171 |
#endif /* ALLOW_TIMEAVE */ |
172 |
|
173 |
#endif /* ALLOW_LAYERS */ |