3 |
|
|
4 |
#ifdef ALLOW_GMREDI |
#ifdef ALLOW_GMREDI |
5 |
|
|
6 |
C Package flag |
C--- GM/Redi package parameters |
|
logical GMREDIisON |
|
|
logical GM_AdvForm |
|
|
logical GM_AdvSeparate |
|
|
logical GM_ExtraDiag |
|
|
COMMON /GM_PACKAGE/ GMREDIisON, |
|
|
& GM_AdvForm, GM_AdvSeparate, |
|
|
& GM_ExtraDiag |
|
7 |
|
|
8 |
C GM/Redi parameters |
C-- Numerical Constant |
9 |
C GM_Small_Number :: epsilon used in computing the slope |
_RL op5 |
10 |
|
_RL op25 |
11 |
|
PARAMETER( op5 = 0.5 _d 0 ) |
12 |
|
PARAMETER( op25 = 0.25 _d 0 ) |
13 |
|
|
14 |
|
C-- COMMON /GM_PARAMS_L/ GM/Redi Logical-type parameters |
15 |
|
C GM_AdvForm :: use Advective Form (instead of Skew-Flux form) |
16 |
|
C GM_AdvSeparate :: do separately advection by Eulerian and Bolus velocity |
17 |
|
C GM_useBVP :: use Boundary-Value-Problem method for Bolus transport |
18 |
|
C GM_useSubMeso :: use parameterization of mixed layer (Sub-Mesoscale) eddies |
19 |
|
C GM_ExtraDiag :: select extra diagnostics |
20 |
|
C GM_InMomAsStress :: apply GM as a stress in momentum Eq. |
21 |
|
C GM_MNC :: |
22 |
|
C GM_MDSIO :: |
23 |
|
C GM_useK3D :: use the 3 dimensional calculation for K |
24 |
|
C GM_K3D_likeGM :: Makes the PV closure similar to the GM closure (for debugging only!) |
25 |
|
LOGICAL GM_AdvForm |
26 |
|
LOGICAL GM_AdvSeparate |
27 |
|
LOGICAL GM_useBVP |
28 |
|
LOGICAL GM_useSubMeso |
29 |
|
LOGICAL GM_ExtraDiag |
30 |
|
LOGICAL GM_InMomAsStress |
31 |
|
LOGICAL GM_MNC |
32 |
|
LOGICAL GM_MDSIO |
33 |
|
LOGICAL GM_useK3D |
34 |
|
LOGICAL GM_K3D_likeGM |
35 |
|
COMMON /GM_PARAMS_L/ |
36 |
|
& GM_AdvForm, GM_AdvSeparate, |
37 |
|
& GM_useBVP, GM_useSubMeso, |
38 |
|
& GM_ExtraDiag, GM_MNC, GM_MDSIO, |
39 |
|
& GM_InMomAsStress, |
40 |
|
& GM_useK3D, GM_K3D_likeGM |
41 |
|
|
42 |
|
C-- GM/Redi Integer-type parameters |
43 |
|
C GM_BVP_modeNumber :: vertical mode number used for speed "c" in BVP transport |
44 |
|
C GM_K3D_NModes :: number of vertical modes used for calculating Xi in K3D |
45 |
|
INTEGER GM_BVP_modeNumber |
46 |
|
INTEGER GM_K3D_NModes |
47 |
|
COMMON /GM_PARAMS_I/ |
48 |
|
& GM_BVP_modeNumber, |
49 |
|
& GM_K3D_NModes |
50 |
|
|
51 |
|
C-- COMMON /GM_PARAMS_C/ GM/Redi Character-type parameters |
52 |
|
C GM_taper_scheme :: select which tapering/clipping scheme to use |
53 |
|
C GM_iso2dFile :: input file for 2.D horiz scaling of Isopycnal diffusivity |
54 |
|
C GM_iso1dFile :: input file for 1.D vert. scaling of Isopycnal diffusivity |
55 |
|
C GM_bol2dFile :: input file for 2.D horiz scaling of Thickness diffusivity |
56 |
|
C GM_bol1dFile :: input file for 1.D vert. scaling of Thickness diffusivity |
57 |
|
CHARACTER*(40) GM_taper_scheme |
58 |
|
CHARACTER*(MAX_LEN_FNAM) GM_iso2dFile |
59 |
|
CHARACTER*(MAX_LEN_FNAM) GM_iso1dFile |
60 |
|
CHARACTER*(MAX_LEN_FNAM) GM_bol2dFile |
61 |
|
CHARACTER*(MAX_LEN_FNAM) GM_bol1dFile |
62 |
|
COMMON /GM_PARAMS_C/ |
63 |
|
& GM_taper_scheme, |
64 |
|
& GM_iso2dFile, GM_iso1dFile, |
65 |
|
& GM_bol2dFile, GM_bol1dFile |
66 |
|
|
67 |
|
C-- COMMON /GM_PARAMS_R/ GM/Redi real-type parameters |
68 |
|
C GM_isopycK :: Isopycnal diffusivity [m^2/s] (Redi-tensor) |
69 |
|
C GM_background_K :: Thickness diffusivity [m^2/s] (GM bolus transport) |
70 |
|
C GM_maxSlope :: maximum slope (tapering/clipping) [-] |
71 |
|
C GM_Kmin_horiz :: minimum horizontal diffusivity [m^2/s] |
72 |
|
C GM_Small_Number :: epsilon used in computing the slope |
73 |
C GM_slopeSqCutoff :: slope^2 cut-off value |
C GM_slopeSqCutoff :: slope^2 cut-off value |
74 |
|
C- Transition layer thickness definition: |
75 |
|
C GM_facTrL2dz :: minimum Trans. Layer Thick. as a factor of local dz |
76 |
|
C GM_facTrL2ML :: maximum Trans. Layer Thick. as a factor of Mix-Layer Depth |
77 |
|
C GM_maxTransLay :: maximum Trans. Layer Thick. [m] |
78 |
|
C- Boundary-Value-Problem method parameters: |
79 |
|
C GM_BVP_cMin :: minimum value for wave speed parameter "c" in BVP [m/s] |
80 |
|
C- mixed layer (Sub-Mesoscale) eddies parameterization: |
81 |
|
C subMeso_Ceff :: efficiency coefficient of Mixed-Layer Eddies [-] |
82 |
|
C subMeso_invTau :: inverse of mixing time-scale in sub-meso parameteriz. [s^-1] |
83 |
|
C subMeso_LfMin :: minimum value for length-scale "Lf" [m] |
84 |
|
C subMeso_Lmax :: maximum horizontal grid-scale length [m] |
85 |
|
C Variable K with PV diffusion parameters: |
86 |
|
C GM_K3D_gamma :: mixing efficiency for 3D eddy diffusivity [-] |
87 |
|
C GM_K3D_EadyMinDepth :: upper depth for Eady calculation |
88 |
|
C GM_K3D_EadyMaxDepth :: lower depth for Eady calculation |
89 |
|
C GM_maxK3D :: Upper bound on the diffusivity |
90 |
|
C GM_K3D_constK :: Constant diffusivity to use when GM_useK3D=.TRUE. and GM_K3D_likeGM=.TRUE. |
91 |
|
C GM_K3D_maxLurms:: Upper bound on th length scale used for calculating urms |
92 |
|
C GM_K3D_minCori :: minimum value for f (to stop things blowing up near the equator) |
93 |
|
C GM_K3D_minN2 :: minimum value for the square of the buoyancy frequency |
94 |
|
C GM_K3D_surfMinDepth :: minimum value for the depth of the surface layer |
95 |
|
|
96 |
_RL GM_isopycK |
_RL GM_isopycK |
97 |
_RL GM_background_K |
_RL GM_background_K |
98 |
_RL GM_maxSlope |
_RL GM_maxSlope |
102 |
_RL GM_Visbeck_alpha |
_RL GM_Visbeck_alpha |
103 |
_RL GM_Visbeck_length |
_RL GM_Visbeck_length |
104 |
_RL GM_Visbeck_depth |
_RL GM_Visbeck_depth |
105 |
_RL GM_Visbeck_maxval_K |
_RL GM_Visbeck_minDepth |
106 |
CHARACTER*(MAX_LEN_FNAM) GM_taper_scheme |
_RL GM_Visbeck_maxSlope |
107 |
|
_RL GM_Visbeck_minVal_K |
108 |
|
_RL GM_Visbeck_maxVal_K |
109 |
|
_RL GM_K3D_gamma |
110 |
|
_RL GM_K3D_EadyMinDepth |
111 |
|
_RL GM_K3D_EadyMaxDepth |
112 |
|
_RL GM_K3D_Lambda |
113 |
|
_RL GM_K3D_smallK |
114 |
|
_RL GM_K3D_maxSlope |
115 |
|
_RL GM_K3D_maxC |
116 |
|
_RL GM_maxK3D |
117 |
|
_RL GM_K3D_constK |
118 |
|
_RL GM_K3D_maxLurms |
119 |
|
_RL GM_K3D_minCori |
120 |
|
_RL GM_K3D_minN2 |
121 |
|
_RL GM_K3D_surfMinDepth |
122 |
|
_RL GM_facTrL2dz |
123 |
|
_RL GM_facTrL2ML |
124 |
|
_RL GM_maxTransLay |
125 |
_RL GM_Scrit |
_RL GM_Scrit |
126 |
_RL GM_Sd |
_RL GM_Sd |
127 |
COMMON /GM_PARAMS/ GM_isopycK, GM_background_K, |
_RL GM_BVP_cMin |
128 |
|
_RL subMeso_Ceff |
129 |
|
_RL subMeso_invTau |
130 |
|
_RL subMeso_LfMin |
131 |
|
_RS subMeso_Lmax |
132 |
|
COMMON /GM_PARAMS_RL/ |
133 |
|
& GM_isopycK, GM_background_K, |
134 |
& GM_maxSlope, |
& GM_maxSlope, |
135 |
& GM_Kmin_horiz, |
& GM_Kmin_horiz, |
136 |
& GM_Small_Number, GM_slopeSqCutoff, |
& GM_Small_Number, GM_slopeSqCutoff, |
137 |
& GM_Visbeck_alpha, |
& GM_Visbeck_alpha, GM_Visbeck_length, |
|
& GM_Visbeck_length, |
|
138 |
& GM_Visbeck_depth, |
& GM_Visbeck_depth, |
139 |
& GM_Visbeck_maxval_K, |
& GM_Visbeck_minDepth, GM_Visbeck_maxSlope, |
140 |
& GM_taper_scheme, |
& GM_Visbeck_minVal_K, GM_Visbeck_maxVal_K, |
141 |
& GM_Scrit, |
& GM_K3D_gamma, GM_K3D_EadyMinDepth, |
142 |
& GM_Sd |
& GM_K3D_EadyMaxDepth, GM_K3D_Lambda, |
143 |
|
& GM_K3D_smallK, GM_K3D_maxSlope, GM_K3D_maxC, |
144 |
|
& GM_maxK3D, GM_K3D_minCori, GM_K3D_minN2, |
145 |
|
& GM_K3D_surfMinDepth, GM_K3D_maxLurms, |
146 |
|
& GM_K3D_constK, |
147 |
|
& GM_facTrL2dz, GM_facTrL2ML, GM_maxTransLay, |
148 |
|
& GM_Scrit, GM_Sd, GM_BVP_cMin, |
149 |
|
& subMeso_Ceff, subMeso_invTau, subMeso_LfMin |
150 |
|
COMMON /GM_PARAMS_RS/ |
151 |
|
& subMeso_Lmax |
152 |
|
|
153 |
_RL op5 |
C-- COMMON /GM_DERIVED_PAR/ other GM/Redi parameters |
154 |
_RL op25 |
C (derived from previous block and not directly user configured) |
|
PARAMETER( op5 = 0.5D0 ) |
|
|
PARAMETER( op25 = 0.25D0 ) |
|
|
|
|
|
C More GM/Redi parameters diagnosed from previous block |
|
|
C (not directly user configured) |
|
155 |
_RL GM_rMaxSlope |
_RL GM_rMaxSlope |
156 |
_RL GM_skewflx |
_RL GM_skewflx |
157 |
_RL GM_advect |
_RL GM_advect |
158 |
COMMON /GM_PARAMS2/ GM_rMaxSlope, |
_RL GM_BVP_rModeNumber |
159 |
& GM_skewflx, GM_advect |
_RL GM_BVP_cHat2Min |
160 |
|
COMMON /GM_DERIVED_PAR/ |
161 |
|
& GM_rMaxSlope, |
162 |
|
& GM_skewflx, GM_advect, |
163 |
|
& GM_BVP_rModeNumber, GM_BVP_cHat2Min |
164 |
|
|
165 |
|
|
166 |
|
C-- COMMON /GM_COEFFICIENTS/ GM/Redi scaling coefficients |
167 |
|
C defined at grid-cell center (tracer location) |
168 |
|
C GM_isoFac2d :: 2.D horiz scaling factor [-] of Isopycnal diffusivity |
169 |
|
C GM_bolFac2d :: 2.D horiz scaling factor [-] of Thickness diffusivity |
170 |
|
C GM_isoFac1d :: 1.D vert. scaling factor [-] of Isopycnal diffusivity |
171 |
|
C GM_bolFac1d :: 1.D vert. scaling factor [-] of Thickness diffusivity |
172 |
|
_RS GM_isoFac2d(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
173 |
|
_RS GM_bolFac2d(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
174 |
|
_RS GM_isoFac1d(Nr) |
175 |
|
_RS GM_bolFac1d(Nr) |
176 |
|
COMMON /GM_COEFFICIENTS/ |
177 |
|
& GM_isoFac2d, GM_bolFac2d, GM_isoFac1d, GM_bolFac1d |
178 |
|
|
179 |
C GM/Redi tensor elements |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
180 |
|
C--- GM/Redi tensor elements |
181 |
|
|
182 |
C Bottom row of tensor corresponds to W points |
C Bottom row of tensor corresponds to W points |
183 |
C Kwx is K_31 element, X direction at W point |
C Kwx :: K_31 element of GM/Redi tensor, X direction at W point |
184 |
C Kwy is K_32 element, Y direction at W point |
C Kwy :: K_32 element of GM/Redi tensor, Y direction at W point |
185 |
C Kwz is K_33 element, Z direction at W point |
C Kwz :: K_33 element of GM/Redi tensor, Z direction at W point |
186 |
_RL Kwx(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
_RL Kwx(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
187 |
_RL Kwy(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
_RL Kwy(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
188 |
_RL Kwz(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
_RL Kwz(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
189 |
COMMON /GM_Wtensor/ Kwx,Kwy,Kwz |
COMMON /GM_Wtensor/ Kwx,Kwy,Kwz |
190 |
|
|
191 |
#ifdef GM_NON_UNITY_DIAGONAL |
#ifdef GM_NON_UNITY_DIAGONAL |
192 |
C Horizontal part of the tensor |
C Horizontal part of the tensor |
193 |
C Kux is K_11 element, X direction at U point |
C Kux :: K_11 element of GM/Redi tensor, X direction at U point |
194 |
C Kvy is K_22 element, Y direction at V point |
C Kvy :: K_22 element of GM/Redi tensor, Y direction at V point |
195 |
_RL Kux(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
_RL Kux(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
196 |
_RL Kvy(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
_RL Kvy(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
197 |
COMMON /GM_HorTensor/ Kux,Kvy |
COMMON /GM_HorTensor/ Kux,Kvy |
202 |
|
|
203 |
#ifdef GM_EXTRA_DIAGONAL |
#ifdef GM_EXTRA_DIAGONAL |
204 |
C First/second rows of tensor corresponds to U/V points |
C First/second rows of tensor corresponds to U/V points |
205 |
C Kuz is K_13 element, Z direction at U point |
C Kuz :: K_13 element of GM/Redi tensor, Z direction at U point |
206 |
C Kvz is K_23 element, Z direction at V point |
C Kvz :: K_23 element of GM/Redi tensor, Z direction at V point |
207 |
_RL Kuz(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
_RL Kuz(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
208 |
_RL Kvz(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
_RL Kvz(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
209 |
COMMON /GM_UVtensor/ Kuz,Kvz |
COMMON /GM_UVtensor/ Kuz,Kvz |
213 |
#endif |
#endif |
214 |
|
|
215 |
#ifdef GM_BOLUS_ADVEC |
#ifdef GM_BOLUS_ADVEC |
216 |
C GM advection formulation: bolus velocities are derived from 2 |
C GM advection formulation: bolus velocities are derived from 2 |
217 |
C streamfunctions PsiX and PsiY : |
C streamfunctions PsiX and PsiY : |
218 |
_RL GM_PsiX(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
_RL GM_PsiX(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
219 |
_RL GM_PsiY(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
_RL GM_PsiY(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
220 |
COMMON /GM_BOLUS/ GM_PsiX,GM_PsiY |
COMMON /GM_BOLUS/ GM_PsiX,GM_PsiY |
227 |
COMMON /GM_Visbeck/ VisbeckK |
COMMON /GM_Visbeck/ VisbeckK |
228 |
#endif |
#endif |
229 |
|
|
230 |
|
#ifdef GM_K3D |
231 |
|
C K3D :: The three dimensional eddy mixing coeffixint [m**2/s] |
232 |
|
_RL K3D(1-Olx:sNx+Olx,1-Oly:sNy+Oly,1:Nr,nSx,nSy) |
233 |
|
|
234 |
|
COMMON /GM_K3D/ K3D |
235 |
|
#endif |
236 |
#endif /* ALLOW_GMREDI */ |
#endif /* ALLOW_GMREDI */ |
237 |
|
|
238 |
|
CEH3 ;;; Local Variables: *** |
239 |
|
CEH3 ;;; mode:fortran *** |
240 |
|
CEH3 ;;; End: *** |