source: LMDZ6/branches/LMDZ_cdrag_LSCE/libf/phylmd/thermcell_ini_mod.F90 @ 4991

Last change on this file since 4991 was 4443, checked in by fhourdin, 21 months ago

Fixing an error in the previous commit

File size: 3.4 KB
Line 
1MODULE thermcell_ini_mod
2IMPLICIT NONE
3
4save
5
6   integer :: dvdq=1,dqimpl=-1,prt_level=0,lunout
7   real RG,RD,RCPD,RKAPPA,RLVTT,RLvCp,RETV
8   real           :: r_aspect_thermals,tau_thermals,fact_thermals_ed_dz
9   integer        :: iflag_thermals_ed,iflag_thermals_optflux,iflag_thermals_closure
10   integer        :: iflag_thermals_down
11   real           :: fact_thermals_down
12
13!$OMP THREADPRIVATE(dvdq,dqimpl,prt_level,lunout)
14!$OMP THREADPRIVATE(RG,RD,RCPD,RKAPPA,RLVTT,RLvCp)
15!$OMP THREADPRIVATE(r_aspect_thermals,tau_thermals,fact_thermals_ed_dz)
16!$OMP THREADPRIVATE(iflag_thermals_ed,iflag_thermals_optflux,iflag_thermals_closure)
17!$OMP THREADPRIVATE(iflag_thermals_down)
18!$OMP THREADPRIVATE(fact_thermals_down)
19
20
21   REAL, SAVE :: fact_epsilon=0.002
22   REAL, SAVE :: betalpha=0.9
23   REAL, SAVE :: afact=2./3.
24   REAL, SAVE :: fact_shell=1.
25   REAL,SAVE :: detr_min=1.e-5
26   REAL,SAVE :: entr_min=1.e-5
27   REAL,SAVE :: detr_q_coef=0.012
28   REAL,SAVE :: detr_q_power=0.5
29   REAL,SAVE :: mix0=0.
30   INTEGER,SAVE :: thermals_flag_alim=0
31
32!$OMP THREADPRIVATE(fact_epsilon, betalpha, afact, fact_shell)
33!$OMP THREADPRIVATE(detr_min, entr_min, detr_q_coef, detr_q_power)
34!$OMP THREADPRIVATE( mix0, thermals_flag_alim)
35
36
37CONTAINS
38
39SUBROUTINE thermcell_ini(iflag_thermals,prt_level_in,tau_thermals_in,lunout_in, &
40   &    RG_in,RD_in,RCPD_in,RKAPPA_in,RLVTT_in,RETV_in)
41
42   USE ioipsl_getin_p_mod, ONLY : getin_p
43
44integer, intent(in) :: iflag_thermals,prt_level_in,lunout_in
45real, intent(in) :: RG_in,RD_in,RCPD_in,RKAPPA_in,RLVTT_in,RETV_in,tau_thermals_in
46
47print*,'thermcell_ini'
48      if (iflag_thermals==15.or.iflag_thermals==16) then
49         dvdq=0
50         dqimpl=-1
51      else
52         dvdq=1
53         dqimpl=1
54      endif
55   prt_level=prt_level_in
56   RG=RG_in
57   RD=RD_in
58   RCPD=RCPD_in
59   RKAPPA=RKAPPA_in
60   RLVTT=RLVTT_in
61   RLvCp = RLVTT/RCPD
62   RETV=RETV_in
63   tau_thermals=tau_thermals_in
64   lunout=lunout_in
65
66
67!=====================================================================
68! a la fois les vieilles param et thermcell_main :
69!=====================================================================
70
71   r_aspect_thermals=2.
72   CALL getin_p('r_aspect_thermals',r_aspect_thermals)
73   
74   tau_thermals = 0.
75   CALL getin_p('tau_thermals',tau_thermals)
76   
77   fact_thermals_ed_dz = 0.1
78   CALL getin_p('fact_thermals_ed_dz',fact_thermals_ed_dz)
79   
80   fact_thermals_ed_dz = 0.1
81   CALL getin_p('fact_thermals_ed_dz',fact_thermals_ed_dz)
82   
83   iflag_thermals_ed = 0
84   CALL getin_p('iflag_thermals_ed',iflag_thermals_ed)
85   
86   iflag_thermals_optflux = 0
87   CALL getin_p('iflag_thermals_optflux',iflag_thermals_optflux)
88   
89   iflag_thermals_closure = 1
90   CALL getin_p('iflag_thermals_closure',iflag_thermals_closure)
91
92   iflag_thermals_down = 0
93   CALL getin_p('iflag_thermals_down',iflag_thermals_down)
94
95   fact_thermals_down = 0.5
96   CALL getin_p('fact_thermals_down',fact_thermals_down)
97
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
109
110 RETURN
111
112END SUBROUTINE thermcell_ini
113END MODULE thermcell_ini_mod
Note: See TracBrowser for help on using the repository browser.