[4687] | 1 | MODULE lmdz_atke_turbulence_ini |
---|
[4449] | 2 | |
---|
| 3 | implicit none |
---|
| 4 | |
---|
| 5 | save |
---|
| 6 | |
---|
[4631] | 7 | integer :: iflag_atke, iflag_num_atke, iflag_atke_lmix |
---|
| 8 | !$OMP THREADPRIVATE(iflag_atke, iflag_num_atke, iflag_atke_lmix) |
---|
[4449] | 9 | real :: kappa = 0.4 ! Von Karman constant |
---|
| 10 | !$OMP THREADPRIVATE(kappa) |
---|
[4663] | 11 | real :: l0,ric,ri0,cinf,cepsilon,pr_slope,pr_asym,pr_neut,clmix,clmixshear,smmin,ctkes,cke |
---|
| 12 | !$OMP THREADPRIVATE(l0,ric,cinf,cepsilon,pr_slope,pr_asym,pr_neut,clmix,clmixshear,smmin,ctkes,cke) |
---|
[4449] | 13 | integer :: lunout,prt_level |
---|
| 14 | !$OMP THREADPRIVATE(lunout,prt_level) |
---|
[4653] | 15 | real :: rg, rd, rpi, rcpd, rv |
---|
| 16 | !$OMP THREADPRIVATE(rg, rd, rpi, rcpd, rv) |
---|
[4449] | 17 | |
---|
[4478] | 18 | real :: viscom, viscoh |
---|
| 19 | !$OMP THREADPRIVATE(viscom,viscoh) |
---|
[4449] | 20 | |
---|
[4644] | 21 | real :: lmin=0.01 ! minimum mixing length |
---|
[4631] | 22 | !$OMP THREADPRIVATE(lmin) |
---|
[4478] | 23 | |
---|
[4653] | 24 | logical :: atke_ok_vdiff, atke_ok_virtual |
---|
| 25 | !$OMP THREADPRIVATE(atke_ok_vdiff,atke_ok_virtual) |
---|
[4478] | 26 | |
---|
[4449] | 27 | CONTAINS |
---|
| 28 | |
---|
[4653] | 29 | SUBROUTINE atke_ini(prt_level_in, lunout_in, rg_in, rd_in, rpi_in, rcpd_in, rv_in) |
---|
[4449] | 30 | |
---|
| 31 | USE ioipsl_getin_p_mod, ONLY : getin_p |
---|
| 32 | |
---|
| 33 | integer, intent(in) :: lunout_in,prt_level_in |
---|
[4653] | 34 | real, intent(in) :: rg_in, rd_in, rpi_in, rcpd_in, rv_in |
---|
[4449] | 35 | |
---|
| 36 | |
---|
| 37 | lunout=lunout_in |
---|
| 38 | prt_level=prt_level_in |
---|
| 39 | rd=rd_in |
---|
| 40 | rg=rg_in |
---|
| 41 | rpi=rpi_in |
---|
[4478] | 42 | rcpd=rcpd_in |
---|
[4653] | 43 | rv=rv_in |
---|
[4449] | 44 | |
---|
[4478] | 45 | viscom=1.46E-5 |
---|
| 46 | viscoh=2.06E-5 |
---|
| 47 | |
---|
[4449] | 48 | ! flag that controls options in atke_compute_km_kh |
---|
| 49 | iflag_atke=0 |
---|
| 50 | CALL getin_p('iflag_atke',iflag_atke) |
---|
| 51 | |
---|
[4631] | 52 | ! flag that controls the calculation of mixing length in atke |
---|
| 53 | iflag_atke_lmix=0 |
---|
| 54 | CALL getin_p('iflag_atke_lmix',iflag_atke_lmix) |
---|
| 55 | |
---|
| 56 | if (iflag_atke .eq. 0 .and. iflag_atke_lmix>0) then |
---|
| 57 | call abort_physic("atke_turbulence_ini", & |
---|
| 58 | 'stationary scheme must use mixing length formulation not depending on tke', 1) |
---|
| 59 | endif |
---|
| 60 | |
---|
[4644] | 61 | ! activate vertical diffusion of TKE or not |
---|
[4653] | 62 | atke_ok_vdiff=.false. |
---|
| 63 | CALL getin_p('atke_ok_vdiff',atke_ok_vdiff) |
---|
[4631] | 64 | |
---|
[4653] | 65 | |
---|
| 66 | ! account for vapor for flottability |
---|
| 67 | atke_ok_virtual=.true. |
---|
| 68 | CALL getin_p('atke_ok_virtual',atke_ok_virtual) |
---|
| 69 | |
---|
| 70 | |
---|
[4545] | 71 | ! flag that controls the numerical treatment of diffusion coeffiient calculation |
---|
| 72 | iflag_num_atke=0 |
---|
| 73 | CALL getin_p('iflag_num_atke',iflag_num_atke) |
---|
| 74 | |
---|
[4631] | 75 | ! asymptotic mixing length in neutral conditions [m] |
---|
| 76 | ! Sun et al 2011, JAMC |
---|
| 77 | ! between 10 and 40 |
---|
| 78 | |
---|
| 79 | l0=15.0 |
---|
[4449] | 80 | CALL getin_p('atke_l0',l0) |
---|
| 81 | |
---|
| 82 | ! critical Richardson number |
---|
| 83 | ric=0.25 |
---|
| 84 | CALL getin_p('atke_ric',ric) |
---|
| 85 | |
---|
| 86 | ! asymptotic value of Sm for Ri=-Inf |
---|
| 87 | cinf=1.5 |
---|
| 88 | CALL getin_p('atke_cinf',cinf) |
---|
| 89 | |
---|
| 90 | ! constant for tke dissipation calculation |
---|
[4653] | 91 | cepsilon=5.87 ! default value as in yamada4 |
---|
[4449] | 92 | CALL getin_p('atke_cepsilon',cepsilon) |
---|
| 93 | |
---|
[4653] | 94 | |
---|
| 95 | ! coefficient for surface TKE |
---|
[4663] | 96 | ! following Lenderink & Holtslag 2004, ctkes=(cepsilon)**(2/3) |
---|
[4653] | 97 | ! (provided by limit condition in neutral conditions) |
---|
[4663] | 98 | ctkes=(cepsilon)**(2./3.) |
---|
[4653] | 99 | |
---|
[4449] | 100 | ! slope of Pr=f(Ri) for stable conditions |
---|
| 101 | pr_slope=5.0 ! default value from Zilitinkevich et al. 2005 |
---|
| 102 | CALL getin_p('atke_pr_slope',pr_slope) |
---|
[4631] | 103 | if (pr_slope .le. 1) then |
---|
| 104 | call abort_physic("atke_turbulence_ini", & |
---|
| 105 | 'pr_slope has to be greater than 1 for consistency of the tke scheme', 1) |
---|
| 106 | endif |
---|
[4449] | 107 | |
---|
| 108 | ! asymptotic turbulent prandt number value for Ri=-Inf |
---|
| 109 | pr_asym=0.4 |
---|
| 110 | CALL getin_p('atke_pr_asym',pr_asym) |
---|
| 111 | |
---|
[4478] | 112 | ! value of turbulent prandtl number in neutral conditions (Ri=0) |
---|
[4481] | 113 | pr_neut=0.8 |
---|
[4478] | 114 | CALL getin_p('atke_pr_neut',pr_neut) |
---|
| 115 | |
---|
[4631] | 116 | ! coefficient for mixing length depending on local stratification |
---|
[4632] | 117 | clmix=0.5 |
---|
[4631] | 118 | CALL getin_p('atke_clmix',clmix) |
---|
[4663] | 119 | |
---|
| 120 | ! coefficient for mixing length depending on local wind shear |
---|
| 121 | clmixshear=0.5 |
---|
| 122 | CALL getin_p('atke_clmixshear',clmixshear) |
---|
| 123 | |
---|
| 124 | |
---|
[4644] | 125 | ! minimum anisotropy coefficient (defined here as minsqrt(Ez/Ek)) at large Ri. |
---|
| 126 | ! From Zilitinkevich et al. 2013, it equals sqrt(0.03)~0.17 |
---|
| 127 | |
---|
| 128 | smmin=0.17 |
---|
| 129 | CALL getin_p('atke_smmin',smmin) |
---|
| 130 | |
---|
| 131 | |
---|
| 132 | ! ratio between the eddy diffusivity coeff for tke wrt that for momentum |
---|
| 133 | ! default value from Lenderink et al. 2004 |
---|
| 134 | cke=2. |
---|
| 135 | CALL getin_p('atke_cke',cke) |
---|
| 136 | |
---|
[4449] | 137 | RETURN |
---|
| 138 | |
---|
| 139 | END SUBROUTINE atke_ini |
---|
| 140 | |
---|
[4687] | 141 | END MODULE lmdz_atke_turbulence_ini |
---|