1 | MODULE lmdz_atke_turbulence_ini |
---|
2 | |
---|
3 | implicit none |
---|
4 | |
---|
5 | ! declaration of constants and parameters |
---|
6 | |
---|
7 | real, save, protected :: rg, rd, rpi, rcpd, rv, viscom, viscoh |
---|
8 | !$OMP THREADPRIVATE(rg, rd, rpi, rcpd, rv, viscom, viscoh) |
---|
9 | |
---|
10 | integer, save, protected :: iflag_atke ! flag that controls options in atke_compute_km_kh |
---|
11 | integer, save, protected :: iflag_atke_lmix ! flag that controls the calculation of mixing length in atke |
---|
12 | integer, save, protected :: iflag_num_atke ! flag that controls the numerical treatment of diffusion coeffiient calculation |
---|
13 | !$OMP THREADPRIVATE(iflag_atke, iflag_atke_lmix, iflag_num_atke) |
---|
14 | |
---|
15 | logical, save, protected :: atke_ok_vdiff ! activate vertical diffusion of TKE or not |
---|
16 | logical, save, protected :: atke_ok_virtual ! account for vapor for flottability |
---|
17 | !$OMP THREADPRIVATE(atke_ok_vdiff, atke_ok_virtual) |
---|
18 | |
---|
19 | real, save, protected :: kappa = 0.4 ! Von Karman constant |
---|
20 | real, save, protected :: cn ! Sm value at Ri=0 |
---|
21 | real, save, protected :: cinf ! Sm value at Ri=-Inf |
---|
22 | real, save, protected :: ri0 ! Richardson number near zero to guarantee continuity in slope of Sm (stability function) at Ri=0 |
---|
23 | real, save, protected :: ri1 ! Richardson number near zero to guarantee continuity in slope of Pr (Prandlt's number) at Ri=0 |
---|
24 | real, save, protected :: lmin = 0.01 ! minimum mixing length corresponding to the Kolmogov dissipation scale in planetary atmospheres (Chen et al 2016, JGR Atmos) |
---|
25 | real, save, protected :: ctkes ! coefficient for surface TKE |
---|
26 | real, save, protected :: clmixshear ! coefficient for mixing length depending on local wind shear |
---|
27 | !$OMP THREADPRIVATE(kappa, cn, cinf, ri0, ri1, lmin, ctkes, clmixshear) |
---|
28 | |
---|
29 | |
---|
30 | ! Tunable parameters for the ATKE scheme and their range of values |
---|
31 | !!------------------------------------------------------------------------------------------------------------- |
---|
32 | real, save, protected :: cepsilon ! controls the value of the dissipation length scale, range [1.2 - 10] |
---|
33 | real, save, protected :: cke ! controls the value of the diffusion coefficient of TKE, range [1 - 5] |
---|
34 | real, save, protected :: l0 ! asymptotic mixing length far from the ground [m] (Sun et al 2011, JAMC), range [15 - 75] |
---|
35 | real, save, protected :: clmix ! controls the value of the mixing length in stratified conditions, range [0.1 - 2] |
---|
36 | real, save, protected :: ric ! critical Richardson number controlling the slope of Sm in stable conditions, range [0.19 - 0.25] |
---|
37 | real, save, protected :: smmin ! minimum value of Sm in very stable conditions (defined here as minsqrt(Ez/Ek)) at large Ri, range [0.025 - 0.1] |
---|
38 | real, save, protected :: pr_neut ! neutral value of the Prandtl number (Ri=0), range [0.7 - 1] |
---|
39 | real, save, protected :: pr_slope ! linear slope of Pr with Ri in the very stable regime, range [3 - 5] |
---|
40 | real, save, protected :: cinffac ! ratio between cinf and cn controlling the convective limit of Sm, range [1.2 - 5.0] |
---|
41 | real, save, protected :: pr_asym ! value of Prandlt in the convective limit(Ri=-Inf), range [0.3 - 0.5] |
---|
42 | !$OMP THREADPRIVATE(cepsilon, cke, l0, clmix, ric, smmin, pr_neut, pr_slope, cinffac, pr_asym) |
---|
43 | !!------------------------------------------------------------------------------------------------------------- |
---|
44 | |
---|
45 | CONTAINS |
---|
46 | |
---|
47 | SUBROUTINE atke_ini(rg_in, rd_in, rpi_in, rcpd_in, rv_in, viscom_in, viscoh_in) |
---|
48 | !!---------------------------------------------------------------------- |
---|
49 | !! *** ROUTINE atke_ini *** |
---|
50 | !! |
---|
51 | !! ** Purpose : Initialization of the atke module and choice of some constants |
---|
52 | !! |
---|
53 | !!---------------------------------------------------------------------- |
---|
54 | |
---|
55 | USE ioipsl_getin_p_mod, ONLY : getin_p |
---|
56 | |
---|
57 | ! input arguments (universal constants for planet) |
---|
58 | !------------------------------------------------- |
---|
59 | real, intent(in) :: rg_in, rd_in, rpi_in, rcpd_in, rv_in, viscom_in, viscoh_in |
---|
60 | !!---------------------------------------------------------------------- |
---|
61 | |
---|
62 | rg=rg_in ! gravity acceleration |
---|
63 | rd=rd_in ! dry gas constant (R/M, R=perfect gas constant and M is the molar mass of the fluid) |
---|
64 | rpi=rpi_in ! Pi number |
---|
65 | rcpd=rcpd_in ! cp per unit mass of the gas |
---|
66 | rv=rv_in ! water vapor constant (for simulations in Earth's atmosphere) |
---|
67 | viscom=viscom_in ! kinematic molecular viscosity for momentum |
---|
68 | viscoh=viscoh_in ! kinematic molecular viscosity for heat |
---|
69 | |
---|
70 | |
---|
71 | ! Read flag values in .def files |
---|
72 | !------------------------------- |
---|
73 | |
---|
74 | ! flag that controls options in atke_compute_km_kh |
---|
75 | iflag_atke=0 |
---|
76 | CALL getin_p('iflag_atke',iflag_atke) |
---|
77 | |
---|
78 | ! flag that controls the calculation of mixing length in atke |
---|
79 | iflag_atke_lmix=0 |
---|
80 | CALL getin_p('iflag_atke_lmix',iflag_atke_lmix) |
---|
81 | |
---|
82 | if (iflag_atke .eq. 0 .and. iflag_atke_lmix>0) then |
---|
83 | call abort_physic("atke_turbulence_ini", & |
---|
84 | 'stationary scheme must use mixing length formulation not depending on tke', 1) |
---|
85 | endif |
---|
86 | |
---|
87 | ! activate vertical diffusion of TKE or not |
---|
88 | atke_ok_vdiff=.false. |
---|
89 | CALL getin_p('atke_ok_vdiff',atke_ok_vdiff) |
---|
90 | |
---|
91 | ! account for vapor for flottability |
---|
92 | atke_ok_virtual=.true. |
---|
93 | CALL getin_p('atke_ok_virtual',atke_ok_virtual) |
---|
94 | |
---|
95 | |
---|
96 | ! flag that controls the numerical treatment of diffusion coeffiient calculation |
---|
97 | iflag_num_atke=0 |
---|
98 | CALL getin_p('iflag_num_atke',iflag_num_atke) |
---|
99 | |
---|
100 | ! asymptotic mixing length in neutral conditions [m] |
---|
101 | ! Sun et al 2011, JAMC |
---|
102 | ! between 10 and 40 |
---|
103 | l0=15.0 |
---|
104 | CALL getin_p('atke_l0',l0) |
---|
105 | |
---|
106 | ! critical Richardson number |
---|
107 | ric=0.25 |
---|
108 | CALL getin_p('atke_ric',ric) |
---|
109 | |
---|
110 | ! constant for tke dissipation calculation |
---|
111 | cepsilon=5.87 ! default value as in yamada4 |
---|
112 | CALL getin_p('atke_cepsilon',cepsilon) |
---|
113 | |
---|
114 | ! calculation of cn = Sm value at Ri=0 |
---|
115 | ! direct dependance on cepsilon to guarantee Fm=1 (first-order like stability function) at Ri=0 |
---|
116 | cn=(1./sqrt(cepsilon))**(2/3) |
---|
117 | |
---|
118 | ! asymptotic value of Sm for Ri=-Inf |
---|
119 | cinffac=2.0 |
---|
120 | CALL getin_p('atke_cinffac',cinffac) |
---|
121 | cinf=cinffac*cn |
---|
122 | if (cinf .le. cn) then |
---|
123 | call abort_physic("atke_turbulence_ini", & |
---|
124 | 'cinf cannot be lower than cn', 1) |
---|
125 | endif |
---|
126 | |
---|
127 | ! coefficient for surface TKE |
---|
128 | ! following Lenderink & Holtslag 2004, ctkes=(cepsilon)**(2/3) |
---|
129 | ! (provided by limit condition in neutral conditions) |
---|
130 | ctkes=(cepsilon)**(2./3.) |
---|
131 | |
---|
132 | ! slope of Pr=f(Ri) for stable conditions |
---|
133 | pr_slope=5.0 ! default value from Zilitinkevich et al. 2005 |
---|
134 | CALL getin_p('atke_pr_slope',pr_slope) |
---|
135 | if (pr_slope .le. 1) then |
---|
136 | call abort_physic("atke_turbulence_ini", & |
---|
137 | 'pr_slope has to be greater than 1 for consistency of the tke scheme', 1) |
---|
138 | endif |
---|
139 | |
---|
140 | ! value of turbulent prandtl number in neutral conditions (Ri=0) |
---|
141 | pr_neut=0.8 |
---|
142 | CALL getin_p('atke_pr_neut',pr_neut) |
---|
143 | |
---|
144 | ! asymptotic turbulent prandt number value for Ri=-Inf |
---|
145 | pr_asym=0.4 |
---|
146 | CALL getin_p('atke_pr_asym',pr_asym) |
---|
147 | if (pr_asym .ge. pr_neut) then |
---|
148 | call abort_physic("atke_turbulence_ini", & |
---|
149 | 'pr_asym must be be lower than pr_neut', 1) |
---|
150 | endif |
---|
151 | |
---|
152 | ! coefficient for mixing length depending on local stratification |
---|
153 | clmix=0.5 |
---|
154 | CALL getin_p('atke_clmix',clmix) |
---|
155 | |
---|
156 | ! coefficient for mixing length depending on local wind shear |
---|
157 | clmixshear=0.5 |
---|
158 | CALL getin_p('atke_clmixshear',clmixshear) |
---|
159 | |
---|
160 | ! minimum anisotropy coefficient (defined here as minsqrt(Ez/Ek)) at large Ri. |
---|
161 | ! From Zilitinkevich et al. 2013, it equals sqrt(0.03)~0.17 |
---|
162 | smmin=0.17 |
---|
163 | CALL getin_p('atke_smmin',smmin) |
---|
164 | |
---|
165 | ! ratio between the eddy diffusivity coeff for tke wrt that for momentum |
---|
166 | ! default value from Lenderink et al. 2004 |
---|
167 | cke=2. |
---|
168 | CALL getin_p('atke_cke',cke) |
---|
169 | |
---|
170 | ! calculation of Ri0 such that continuity in slope of Sm at Ri=0 |
---|
171 | ri0=2./rpi*(cinf - cn)*ric/cn |
---|
172 | |
---|
173 | ! calculation of Ri1 to guarantee continuity in slope of Prandlt number at Ri=0 |
---|
174 | ri1 = -2./rpi * (pr_asym - pr_neut) |
---|
175 | |
---|
176 | RETURN |
---|
177 | |
---|
178 | END SUBROUTINE atke_ini |
---|
179 | |
---|
180 | END MODULE lmdz_atke_turbulence_ini |
---|