1 | MODULE lmdz_thermcell_ini |
---|
2 | |
---|
3 | IMPLICIT NONE |
---|
4 | |
---|
5 | save |
---|
6 | |
---|
7 | |
---|
8 | integer, protected :: dvdq=1,dqimpl=-1,prt_level=0,lunout |
---|
9 | real , protected :: RG,RD,RCPD,RKAPPA,RLVTT,RLvCp,RETV |
---|
10 | |
---|
11 | |
---|
12 | |
---|
13 | !$OMP THREADPRIVATE(dvdq,dqimpl,prt_level,lunout) |
---|
14 | !$OMP THREADPRIVATE(RG,RD,RCPD,RKAPPA,RLVTT,RLvCp,RETV) |
---|
15 | |
---|
16 | |
---|
17 | ! Parameters that can be modified directly by a getin call |
---|
18 | real, protected :: r_aspect_thermals=2. ! Aspect ratio for thermal celles |
---|
19 | real, protected :: tau_thermals = 0. ! relaxation time constant |
---|
20 | real, protected :: fact_thermals_ed_dz = 0.1 ! bouyancy computed with a delta |
---|
21 | real, protected :: betalpha=0.9 ! |
---|
22 | real, protected :: afact=2./3. ! |
---|
23 | real, protected :: fact_shell=1. ! |
---|
24 | real, protected :: detr_min=1.e-5 ! |
---|
25 | real, protected :: entr_min=1.e-5 ! |
---|
26 | real, protected :: detr_q_coef=0.012 ! |
---|
27 | real, protected :: detr_q_power=0.5 ! |
---|
28 | real, protected :: mix0=0. ! |
---|
29 | integer, protected :: iflag_thermals_ed = 0 ! |
---|
30 | integer, protected :: iflag_thermals_optflux = 0 ! |
---|
31 | integer, protected :: iflag_thermals_closure = 1 ! |
---|
32 | integer, protected :: iflag_thermals_down = 0 ! |
---|
33 | real, protected :: fact_thermals_down = 0.5 ! |
---|
34 | integer, protected :: thermals_flag_alim=0 ! |
---|
35 | integer, protected :: iflag_thermals_tenv=0 ! |
---|
36 | |
---|
37 | ! WARNING !!! fact_epsilon is not protected. It can be modified in thermcell_plume* |
---|
38 | ! depending on other flags. |
---|
39 | |
---|
40 | real :: fact_epsilon=0.002 |
---|
41 | |
---|
42 | !$OMP THREADPRIVATE(r_aspect_thermals,tau_thermals,fact_thermals_ed_dz) |
---|
43 | !$OMP THREADPRIVATE(iflag_thermals_ed,iflag_thermals_optflux,iflag_thermals_closure) |
---|
44 | !$OMP THREADPRIVATE(iflag_thermals_down) |
---|
45 | !$OMP THREADPRIVATE(fact_thermals_down) |
---|
46 | !$OMP THREADPRIVATE(fact_epsilon, betalpha, afact, fact_shell) |
---|
47 | !$OMP THREADPRIVATE(detr_min, entr_min, detr_q_coef, detr_q_power) |
---|
48 | !$OMP THREADPRIVATE( mix0, thermals_flag_alim) |
---|
49 | !$OMP THREADPRIVATE(iflag_thermals_tenv) |
---|
50 | |
---|
51 | integer, protected :: thermals_subsid_advect_more_than_one=1 |
---|
52 | character*6, protected :: thermals_subsid_advect_scheme = 'upwind' ! or 'center' |
---|
53 | |
---|
54 | !$OMP THREADPRIVATE(thermals_subsid_advect_scheme,thermals_subsid_advect_more_than_one) |
---|
55 | |
---|
56 | CONTAINS |
---|
57 | |
---|
58 | SUBROUTINE thermcell_ini(iflag_thermals,prt_level_in,tau_thermals_in,lunout_in, & |
---|
59 | & RG_in,RD_in,RCPD_in,RKAPPA_in,RLVTT_in,RETV_in) |
---|
60 | |
---|
61 | USE ioipsl_getin_p_mod, ONLY : getin_p |
---|
62 | |
---|
63 | integer, intent(in) :: iflag_thermals,prt_level_in,lunout_in |
---|
64 | real, intent(in) :: RG_in,RD_in,RCPD_in,RKAPPA_in,RLVTT_in,RETV_in,tau_thermals_in |
---|
65 | |
---|
66 | print*,'thermcell_ini' |
---|
67 | if (iflag_thermals==15.or.iflag_thermals==16) then |
---|
68 | dvdq=0 |
---|
69 | dqimpl=-1 |
---|
70 | else |
---|
71 | dvdq=1 |
---|
72 | dqimpl=1 |
---|
73 | endif |
---|
74 | prt_level=prt_level_in |
---|
75 | RG=RG_in |
---|
76 | RD=RD_in |
---|
77 | RCPD=RCPD_in |
---|
78 | RKAPPA=RKAPPA_in |
---|
79 | RLVTT=RLVTT_in |
---|
80 | RLvCp = RLVTT/RCPD |
---|
81 | RETV=RETV_in |
---|
82 | tau_thermals=tau_thermals_in |
---|
83 | lunout=lunout_in |
---|
84 | |
---|
85 | |
---|
86 | !===================================================================== |
---|
87 | ! a la fois les vieilles param et thermcell_main : |
---|
88 | !===================================================================== |
---|
89 | |
---|
90 | CALL getin_p('r_aspect_thermals',r_aspect_thermals) |
---|
91 | CALL getin_p('tau_thermals',tau_thermals) |
---|
92 | CALL getin_p('fact_thermals_ed_dz',fact_thermals_ed_dz) |
---|
93 | CALL getin_p('iflag_thermals_ed',iflag_thermals_ed) |
---|
94 | CALL getin_p('iflag_thermals_optflux',iflag_thermals_optflux) |
---|
95 | CALL getin_p('iflag_thermals_closure',iflag_thermals_closure) |
---|
96 | CALL getin_p('iflag_thermals_down',iflag_thermals_down) |
---|
97 | CALL getin_p('fact_thermals_down',fact_thermals_down) |
---|
98 | CALL getin_p('thermals_fact_epsilon',fact_epsilon) |
---|
99 | CALL getin_p('thermals_betalpha',betalpha) |
---|
100 | CALL getin_p('thermals_afact',afact) |
---|
101 | CALL getin_p('thermals_fact_shell',fact_shell) |
---|
102 | CALL getin_p('thermals_detr_min',detr_min) |
---|
103 | CALL getin_p('thermals_entr_min',entr_min) |
---|
104 | CALL getin_p('thermals_detr_q_coef',detr_q_coef) |
---|
105 | CALL getin_p('thermals_detr_q_power',detr_q_power) |
---|
106 | CALL getin_p('thermals_mix0',mix0) |
---|
107 | CALL getin_p('thermals_flag_alim',thermals_flag_alim) |
---|
108 | CALL getin_p('iflag_thermals_tenv',iflag_thermals_tenv) |
---|
109 | CALL getin_p('thermals_subsid_advect_scheme',thermals_subsid_advect_scheme) |
---|
110 | CALL getin_p('thermals_subsid_advect_more_than_one',thermals_subsid_advect_more_than_one) |
---|
111 | |
---|
112 | |
---|
113 | write(lunout,*) 'thermcell_ini ,prt_level =', prt_level |
---|
114 | write(lunout,*) 'thermcell_ini ,RG =', RG |
---|
115 | write(lunout,*) 'thermcell_ini ,RD =', RD |
---|
116 | write(lunout,*) 'thermcell_ini ,RCPD =', RCPD |
---|
117 | write(lunout,*) 'thermcell_ini ,RKAPPA =', RKAPPA |
---|
118 | write(lunout,*) 'thermcell_ini ,RLVTT =', RLVTT |
---|
119 | write(lunout,*) 'thermcell_ini ,RLvCp =', RLvCp |
---|
120 | write(lunout,*) 'thermcell_ini ,RETV =', RETV |
---|
121 | write(lunout,*) 'thermcell_ini ,tau_thermals =', tau_thermals |
---|
122 | write(lunout,*) 'thermcell_ini ,lunout =', lunout |
---|
123 | write(lunout,*) 'thermcell_ini ,r_aspect_thermals =', r_aspect_thermals |
---|
124 | write(lunout,*) 'thermcell_ini ,tau_thermals =', tau_thermals |
---|
125 | write(lunout,*) 'thermcell_ini ,fact_thermals_ed_dz =', fact_thermals_ed_dz |
---|
126 | write(lunout,*) 'thermcell_ini ,fact_thermals_ed_dz =', fact_thermals_ed_dz |
---|
127 | write(lunout,*) 'thermcell_ini ,iflag_thermals_ed =', iflag_thermals_ed |
---|
128 | write(lunout,*) 'thermcell_ini ,iflag_thermals_optflux =', iflag_thermals_optflux |
---|
129 | write(lunout,*) 'thermcell_ini ,iflag_thermals_closure =', iflag_thermals_closure |
---|
130 | write(lunout,*) 'thermcell_ini ,iflag_thermals_down =', iflag_thermals_down |
---|
131 | write(lunout,*) 'thermcell_ini ,fact_thermals_down =', fact_thermals_down |
---|
132 | write(lunout,*) 'thermcell_ini ,fact_epsilon =', fact_epsilon |
---|
133 | write(lunout,*) 'thermcell_ini ,betalpha =', betalpha |
---|
134 | write(lunout,*) 'thermcell_ini ,afact =', afact |
---|
135 | write(lunout,*) 'thermcell_ini ,fact_shell =', fact_shell |
---|
136 | write(lunout,*) 'thermcell_ini ,detr_min =', detr_min |
---|
137 | write(lunout,*) 'thermcell_ini ,entr_min =', entr_min |
---|
138 | write(lunout,*) 'thermcell_ini ,detr_q_coef =', detr_q_coef |
---|
139 | write(lunout,*) 'thermcell_ini ,detr_q_power =', detr_q_power |
---|
140 | write(lunout,*) 'thermcell_ini ,mix0 =', mix0 |
---|
141 | write(lunout,*) 'thermcell_ini ,thermals_flag_alim =', thermals_flag_alim |
---|
142 | write(lunout,*) 'thermcell_ini ,iflag_thermals_tenv =', iflag_thermals_tenv |
---|
143 | write(lunout,*) 'thermcell_ini ,thermals_subsid_advect_scheme=',thermals_subsid_advect_scheme |
---|
144 | write(lunout,*) 'thermcell_ini ,thermals_subsid_advect_more_than_one=',thermals_subsid_advect_more_than_one |
---|
145 | |
---|
146 | RETURN |
---|
147 | |
---|
148 | END SUBROUTINE thermcell_ini |
---|
149 | END MODULE lmdz_thermcell_ini |
---|