| 1 | MODULE thermcell_mod |
|---|
| 2 | |
|---|
| 3 | IMPLICIT NONE |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | ! Flags for computations |
|---|
| 7 | ! default |
|---|
| 8 | INTEGER,PARAMETER :: iflag_thermals_optflux = 1 ! 0 - |
|---|
| 9 | INTEGER,PARAMETER :: dqimpl = 1 ! 1 flag for thermcell_dq version (1 : implicit scheme || 0 : explicit scheme) |
|---|
| 10 | |
|---|
| 11 | ! Physical parameters |
|---|
| 12 | |
|---|
| 13 | REAL,PARAMETER :: r_aspect_thermals = 1.0 ! Aspect ratio of the thermals (width / height) |
|---|
| 14 | REAL,PARAMETER :: tau_thermals = 0. ! 0. Relaxation time |
|---|
| 15 | REAL,PARAMETER :: betalpha = 1.0 ! 0.9 - between 0 (e=d) and 1 (rho*fraca=cst) |
|---|
| 16 | REAL,PARAMETER :: afact = 1. ! 2./3. - buoyancy contribution, between 0 and 1 |
|---|
| 17 | REAL,PARAMETER :: fact_epsilon = 1.e-4 ! 2.e-3 - friction |
|---|
| 18 | REAL,PARAMETER :: nu = 0.000 ! Geometrical contributions to entrainment and detrainment |
|---|
| 19 | REAL,PARAMETER :: alphamax = 0.7 ! 0.7 Maximal permitted updraft fraction |
|---|
| 20 | REAL,PARAMETER :: fomass_max = 0.5 ! 0.5 Maximal permitted outgoing layer mass fraction |
|---|
| 21 | REAL,PARAMETER :: pres_limit = 2.e5 ! 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,PARAMETER :: linf = 1 ! 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,PARAMETER :: d_temp = 0. ! 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 | IMPLICIT NONE |
|---|
| 56 | |
|---|
| 57 | REAL g |
|---|
| 58 | REAL rcp |
|---|
| 59 | REAL r |
|---|
| 60 | REAL pi |
|---|
| 61 | REAL T_h2o_ice_liq |
|---|
| 62 | REAL RV |
|---|
| 63 | |
|---|
| 64 | RTT = T_h2o_ice_liq |
|---|
| 65 | RG = g |
|---|
| 66 | RKAPPA = rcp |
|---|
| 67 | RPI = pi |
|---|
| 68 | RD = r |
|---|
| 69 | |
|---|
| 70 | RETURN |
|---|
| 71 | END SUBROUTINE init_thermcell_mod |
|---|
| 72 | |
|---|
| 73 | END MODULE thermcell_mod |
|---|