| 1 | MODULE thermcell_mod |
|---|
| 2 | |
|---|
| 3 | IMPLICIT NONE |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | ! Flags for computations |
|---|
| 7 | ! default |
|---|
| 8 | INTEGER,PARAMETER :: dqimpl = 1 ! 1 flag for thermcell_dq version (1 : implicit scheme || 0 : explicit scheme) |
|---|
| 9 | |
|---|
| 10 | ! Physical parameters |
|---|
| 11 | |
|---|
| 12 | REAL,PARAMETER :: r_aspect_thermals = 1.0 ! Aspect ratio of the thermals (width / height) |
|---|
| 13 | REAL,PARAMETER :: tau_thermals = 0. ! 0. Relaxation time |
|---|
| 14 | REAL,PARAMETER :: betalpha = 1.0 ! 0.9 - factor between 0 (e=d) and 1 (rho*fraca=cst) |
|---|
| 15 | REAL,PARAMETER :: afact = 1. ! 2./3. Buoyancy contribution - factor between 0 and 1 |
|---|
| 16 | REAL,PARAMETER :: fact_epsilon = 1.e-4 ! 2.e-3 Friction at plume borders - exponential decrease |
|---|
| 17 | REAL,PARAMETER :: nu = 0.000 ! Geometrical contributions to entrainment and detrainment |
|---|
| 18 | REAL,PARAMETER :: alpha_max = 0.7 ! 0.7 Maximal permitted updraft fraction |
|---|
| 19 | REAL,PARAMETER :: fomass_max = 0.5 ! 0.5 Maximal permitted outgoing layer mass fraction |
|---|
| 20 | REAL,PARAMETER :: pres_limit = 2.e5 ! 1.e5 Minimal permitted pressure to trigger a thermal plume |
|---|
| 21 | |
|---|
| 22 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 23 | ! AB : linf is used to set the lowest possible first level because we allow it |
|---|
| 24 | ! to begin higher than the surface. It is set to 2 in order to remove the |
|---|
| 25 | ! first layer for gas giant. |
|---|
| 26 | ! If there is a surface, it has to be set to 1. |
|---|
| 27 | ! If someone want to call more than once the thermal plume model in some |
|---|
| 28 | ! grid points, this variable may become a saved array of INTEGER with size |
|---|
| 29 | ! ngrid. |
|---|
| 30 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 31 | INTEGER,PARAMETER :: linf = 1 ! 1 |
|---|
| 32 | |
|---|
| 33 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 34 | ! AB : d_temp is an artificial virtual potential temperature offset added in |
|---|
| 35 | ! layer linf which can be used to force convection to begin in it. |
|---|
| 36 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 37 | REAL,PARAMETER :: d_temp = 0. ! 0. |
|---|
| 38 | |
|---|
| 39 | ! Physical constants |
|---|
| 40 | |
|---|
| 41 | REAL,SAVE :: RTT |
|---|
| 42 | REAL,SAVE :: RG |
|---|
| 43 | REAL,SAVE :: RKAPPA |
|---|
| 44 | REAL,SAVE :: RPI |
|---|
| 45 | REAL,SAVE :: RD |
|---|
| 46 | |
|---|
| 47 | !$OMP THREADPRIVATE(RTT, RG, RKAPPA, RPI, RD) |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | CONTAINS |
|---|
| 51 | |
|---|
| 52 | SUBROUTINE init_thermcell_mod(g, rcp, r, pi, T_h2o_ice_liq, RV) |
|---|
| 53 | |
|---|
| 54 | IMPLICIT NONE |
|---|
| 55 | |
|---|
| 56 | REAL g |
|---|
| 57 | REAL rcp |
|---|
| 58 | REAL r |
|---|
| 59 | REAL pi |
|---|
| 60 | REAL T_h2o_ice_liq |
|---|
| 61 | REAL RV |
|---|
| 62 | |
|---|
| 63 | RTT = T_h2o_ice_liq |
|---|
| 64 | RG = g |
|---|
| 65 | RKAPPA = rcp |
|---|
| 66 | RPI = pi |
|---|
| 67 | RD = r |
|---|
| 68 | |
|---|
| 69 | RETURN |
|---|
| 70 | END SUBROUTINE init_thermcell_mod |
|---|
| 71 | |
|---|
| 72 | END MODULE thermcell_mod |
|---|