1 | MODULE thermcell_mod |
---|
2 | |
---|
3 | IMPLICIT NONE |
---|
4 | |
---|
5 | |
---|
6 | ! Flags for computations |
---|
7 | ! default |
---|
8 | LOGICAL,SAVE :: dqimpl ! .true. Flag for thermcell_dq version (True : implicit scheme || False : explicit scheme) |
---|
9 | LOGICAL,SAVE :: dvimpl ! .false. Flag for specific u, v mixing (True : thermcell_dv2 || False : thermcell_dq) |
---|
10 | |
---|
11 | ! Physical parameters |
---|
12 | |
---|
13 | REAL,SAVE :: r_aspect_thermals ! 1.0 Aspect ratio of the thermals (width / height) |
---|
14 | REAL,SAVE :: tau_thermals ! 0. Relaxation time |
---|
15 | REAL,SAVE :: betalpha ! 0.9 - between 0 (e=d) and 1 (rho*fraca=cst) |
---|
16 | REAL,SAVE :: afact ! 2./3. - buoyancy acceleration efficiency, between 0 and 1 |
---|
17 | REAL,SAVE :: fact_epsilon ! 2.e-3 - turbulence and friction deceleration |
---|
18 | REAL,SAVE :: nu ! 0. Geometrical contributions to entrainment and detrainment |
---|
19 | REAL,SAVE :: alpha_max ! 0.7 Maximal permitted updraft fraction |
---|
20 | REAL,SAVE :: fomass_max ! 0.5 Maximal permitted outgoing layer mass fraction |
---|
21 | REAL,SAVE :: pres_limit ! 1.e5 - |
---|
22 | |
---|
23 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
24 | ! AB : linf is used to set the lowest possible first level because we allow it |
---|
25 | ! to begin higher than the surface. It is set to 2 in order to remove the |
---|
26 | ! first layer for gas giant. |
---|
27 | ! If there is a surface, it has to be set to 1. |
---|
28 | ! If someone want to call more than once the thermal plume model in some |
---|
29 | ! grid points, this variable may become a saved array of INTEGER with size |
---|
30 | ! ngrid. |
---|
31 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
32 | INTEGER,SAVE :: linf ! 1 |
---|
33 | |
---|
34 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
35 | ! AB : d_temp is an artificial virtual potential temperature offset added in |
---|
36 | ! layer linf which can be used to force convection to begin in it. |
---|
37 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
38 | REAL,SAVE :: d_temp ! 0. |
---|
39 | |
---|
40 | ! Physical constants |
---|
41 | |
---|
42 | REAL,SAVE :: RTT |
---|
43 | REAL,SAVE :: RG |
---|
44 | REAL,SAVE :: RKAPPA |
---|
45 | REAL,SAVE :: RPI |
---|
46 | REAL,SAVE :: RD |
---|
47 | |
---|
48 | !$OMP THREADPRIVATE(RTT, RG, RKAPPA, RPI, RD) |
---|
49 | |
---|
50 | |
---|
51 | CONTAINS |
---|
52 | |
---|
53 | SUBROUTINE init_thermcell_mod(g, rcp, r, pi, T_h2o_ice_liq, RV) |
---|
54 | |
---|
55 | USE ioipsl_getin_p_mod, ONLY: getin_p |
---|
56 | |
---|
57 | IMPLICIT NONE |
---|
58 | |
---|
59 | REAL g |
---|
60 | REAL rcp |
---|
61 | REAL r |
---|
62 | REAL pi |
---|
63 | REAL T_h2o_ice_liq |
---|
64 | REAL RV |
---|
65 | |
---|
66 | RTT = T_h2o_ice_liq |
---|
67 | RG = g |
---|
68 | RKAPPA = rcp |
---|
69 | RPI = pi |
---|
70 | RD = r |
---|
71 | |
---|
72 | print *, 'Implicit mixing scheme ?' |
---|
73 | dqimpl = .true. |
---|
74 | call getin_p('dqimpl', dqimpl) |
---|
75 | print *, 'dqimpl = ', dqimpl |
---|
76 | |
---|
77 | print *, 'Use specific horizontal momentum scheme ?' |
---|
78 | dvimpl = .false. |
---|
79 | call getin_p('dvimpl', dvimpl) |
---|
80 | print *, 'dvimpl = ', dvimpl |
---|
81 | |
---|
82 | print *, 'Plume aspect ratio ?' |
---|
83 | r_aspect_thermals = 1. |
---|
84 | call getin_p('r_aspect_thermals', r_aspect_thermals) |
---|
85 | print *, 'r_aspect_thermals = ', r_aspect_thermals |
---|
86 | |
---|
87 | print *, 'Relaxation time ?' |
---|
88 | tau_thermals = 0. |
---|
89 | call getin_p('tau_thermals', tau_thermals) |
---|
90 | print *, 'tau_thermals = ', tau_thermals |
---|
91 | |
---|
92 | print *, 'betalpha ?' |
---|
93 | betalpha = 0.9 |
---|
94 | call getin_p('betalpha', betalpha) |
---|
95 | print *, 'betalpha = ', betalpha |
---|
96 | |
---|
97 | print *, 'Buoyancy acceleration efficiency ?' |
---|
98 | afact = 2./3. |
---|
99 | call getin_p('afact', afact) |
---|
100 | print *, 'afact = ', afact |
---|
101 | |
---|
102 | print *, 'Turbulence and friction factor ?' |
---|
103 | fact_epsilon = 2.e-3 |
---|
104 | call getin_p('fact_epsilon', fact_epsilon) |
---|
105 | print *, 'fact_epsilon = ', fact_epsilon |
---|
106 | |
---|
107 | print *, 'Constant entrainment and detrainment term ?' |
---|
108 | nu = 0. |
---|
109 | call getin_p('nu', nu) |
---|
110 | print *, 'nu = ', nu |
---|
111 | |
---|
112 | print *, 'Maximal authorized updraft fraction ?' |
---|
113 | alpha_max = 0.7 |
---|
114 | call getin_p('alpha_max', alpha_max) |
---|
115 | print *, 'alpha_max = ', alpha_max |
---|
116 | |
---|
117 | print *, 'Maximal authorized entrained mass flux ?' |
---|
118 | fomass_max = 0.5 |
---|
119 | call getin_p('fomass_max', fomass_max) |
---|
120 | print *, 'fomass_max = ', fomass_max |
---|
121 | |
---|
122 | print *, 'Minimal pressure below which plume can no longer trigger ?' |
---|
123 | pres_limit = 1.e5 |
---|
124 | call getin_p('pres_limit', pres_limit) |
---|
125 | print *, 'pres_limit = ', pres_limit |
---|
126 | |
---|
127 | print *, 'Deepest layer from which a plume can rise ?' |
---|
128 | linf = 1 |
---|
129 | call getin_p('linf', linf) |
---|
130 | print *, 'linf = ', linf |
---|
131 | |
---|
132 | print *, 'd_temp ?' |
---|
133 | d_temp = 0. |
---|
134 | call getin_p('d_temp', d_temp) |
---|
135 | print *, 'd_temp = ', d_temp |
---|
136 | |
---|
137 | RETURN |
---|
138 | END SUBROUTINE init_thermcell_mod |
---|
139 | |
---|
140 | END MODULE thermcell_mod |
---|