source: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_ini.F90 @ 5112

Last change on this file since 5112 was 5112, checked in by abarral, 4 months ago

Rename modules in phy_common from *_mod > lmdz_*

File size: 6.3 KB
Line 
1MODULE lmdz_thermcell_ini
2
3IMPLICIT NONE
4
5integer, protected :: dvdq=1,dqimpl=-1,prt_level=0,lunout
6real   , 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
13real,    protected :: r_aspect_thermals=2.       ! Aspect ratio for thermal celles
14real,    protected :: tau_thermals = 0.          ! relaxation time constant
15real,    protected :: fact_thermals_ed_dz = 0.1  ! bouyancy computed with a delta
16real,    protected :: betalpha=0.9               !
17real,    protected :: afact=2./3.                !
18real,    protected :: fact_shell=1.              !
19real,    protected :: detr_min=1.e-5             !
20real,    protected :: entr_min=1.e-5             !
21real,    protected :: detr_q_coef=0.012          !
22real,    protected :: detr_q_power=0.5           !
23real,    protected :: mix0=0.                    !
24integer, protected :: iflag_thermals_ed = 0      !
25integer, protected :: iflag_thermals_optflux = 0 !
26integer, protected :: iflag_thermals_closure = 1 !
27integer, protected :: iflag_thermals_down = 0    !
28real, protected    :: fact_thermals_down = 0.5   !
29integer, protected :: thermals_flag_alim=0       !
30integer, 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
47CONTAINS
48
49SUBROUTINE 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
54integer, intent(in) :: iflag_thermals,prt_level_in,lunout_in
55real, intent(in) :: RG_in,RD_in,RCPD_in,RKAPPA_in,RLVTT_in,RETV_in,tau_thermals_in
56
57PRINT*,'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
103write(lunout,*) 'thermcell_ini ,prt_level                =',  prt_level                   
104write(lunout,*) 'thermcell_ini ,RG                       =',  RG                     
105write(lunout,*) 'thermcell_ini ,RD                       =',  RD                       
106write(lunout,*) 'thermcell_ini ,RCPD                     =',  RCPD                   
107write(lunout,*) 'thermcell_ini ,RKAPPA                   =',  RKAPPA                 
108write(lunout,*) 'thermcell_ini ,RLVTT                    =',  RLVTT                   
109write(lunout,*) 'thermcell_ini ,RLvCp                    =',  RLvCp                   
110write(lunout,*) 'thermcell_ini ,RETV                     =',  RETV                   
111write(lunout,*) 'thermcell_ini ,tau_thermals             =',  tau_thermals           
112write(lunout,*) 'thermcell_ini ,lunout                   =',  lunout                 
113write(lunout,*) 'thermcell_ini ,r_aspect_thermals        =',  r_aspect_thermals       
114write(lunout,*) 'thermcell_ini ,tau_thermals             =',  tau_thermals           
115write(lunout,*) 'thermcell_ini ,fact_thermals_ed_dz      =',  fact_thermals_ed_dz
116write(lunout,*) 'thermcell_ini ,fact_thermals_ed_dz      =',  fact_thermals_ed_dz
117write(lunout,*) 'thermcell_ini ,iflag_thermals_ed        =',  iflag_thermals_ed       
118write(lunout,*) 'thermcell_ini ,iflag_thermals_optflux   =',  iflag_thermals_optflux
119write(lunout,*) 'thermcell_ini ,iflag_thermals_closure   =',  iflag_thermals_closure
120write(lunout,*) 'thermcell_ini ,iflag_thermals_down      =',  iflag_thermals_down
121write(lunout,*) 'thermcell_ini ,fact_thermals_down       =',  fact_thermals_down
122write(lunout,*) 'thermcell_ini ,fact_epsilon             =',  fact_epsilon           
123write(lunout,*) 'thermcell_ini ,betalpha                 =',  betalpha               
124write(lunout,*) 'thermcell_ini ,afact                    =',  afact                   
125write(lunout,*) 'thermcell_ini ,fact_shell               =',  fact_shell             
126write(lunout,*) 'thermcell_ini ,detr_min                 =',  detr_min               
127write(lunout,*) 'thermcell_ini ,entr_min                 =',  entr_min               
128write(lunout,*) 'thermcell_ini ,detr_q_coef              =',  detr_q_coef             
129write(lunout,*) 'thermcell_ini ,detr_q_power             =',  detr_q_power           
130write(lunout,*) 'thermcell_ini ,mix0                     =',  mix0                   
131write(lunout,*) 'thermcell_ini ,thermals_flag_alim       =',  thermals_flag_alim
132write(lunout,*) 'thermcell_ini ,iflag_thermals_tenv      =',  iflag_thermals_tenv
133
134
135
136END SUBROUTINE thermcell_ini
137END MODULE lmdz_thermcell_ini
Note: See TracBrowser for help on using the repository browser.