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