source: LMDZ6/trunk/libf/phylmd/lmdz_wake_ini.F90 @ 4842

Last change on this file since 4842 was 4842, checked in by fhourdin, 3 months ago

Suite poches

File size: 8.3 KB
Line 
1MODULE lmdz_wake_ini
2IMPLICIT NONE
3
4  ! ============================================================================
5
6
7  ! But : Decrire le comportement des poches froides apparaissant dans les
8  ! grands systemes convectifs, et fournir l'energie disponible pour
9  ! le declenchement de nouvelles colonnes convectives.
10
11  ! State variables :
12  ! deltatw    : temperature difference between wake and off-wake regions
13  ! deltaqw    : specific humidity difference between wake and off-wake regions
14  ! sigmaw     : fractional area covered by wakes.
15  ! wdens      : number of wakes per unit area
16
17  ! -------------------------------------------------------------------------
18  ! Declaration de variables
19  ! -------------------------------------------------------------------------
20
21  ! Variables a fixer
22!jyg<
23!!  REAL, SAVE                                            :: stark, wdens_ref, coefgw, alpk
24  INTEGER, SAVE, PROTECTED                                    :: prt_level
25  REAL, SAVE, PROTECTED, DIMENSION(2)                         :: wdens_ref
26  REAL, SAVE, PROTECTED                                       :: stark, coefgw, alpk, wk_pupper
27!>jyg
28  REAL, SAVE, PROTECTED                                       :: crep_upper, crep_sol 
29  !$OMP THREADPRIVATE(stark, wdens_ref, coefgw, alpk, wk_pupper, crep_upper, crep_sol)
30
31  REAL, SAVE, PROTECTED                                       :: tau_cv
32  !$OMP THREADPRIVATE(tau_cv)
33  REAL, SAVE, PROTECTED                                       :: rzero, aa0 ! minimal wake radius and area
34  !$OMP THREADPRIVATE(rzero, aa0)
35
36  LOGICAL, SAVE, PROTECTED                                    :: ok_bug_gfl
37  !$OMP THREADPRIVATE(ok_bug_gfl)
38  LOGICAL, SAVE, PROTECTED                                    :: flag_wk_check_trgl
39  !$OMP THREADPRIVATE(flag_wk_check_trgl)
40  INTEGER, SAVE, PROTECTED                                    :: iflag_wk_act
41  !$OMP THREADPRIVATE(iflag_wk_act)
42
43  INTEGER, SAVE, PROTECTED                                    :: iflag_wk_check_trgl
44  !$OMP THREADPRIVATE(iflag_wk_check_trgl)
45  INTEGER, SAVE, PROTECTED                                    :: iflag_wk_pop_dyn
46  !$OMP THREADPRIVATE(iflag_wk_pop_dyn)
47
48  INTEGER, SAVE, PROTECTED                                    :: iflag_wk_profile
49  !$OMP THREADPRIVATE(iflag_wk_profile)
50
51  INTEGER, SAVE, PROTECTED                                    :: iflag_wk_new_ptop
52  !$OMP THREADPRIVATE(iflag_wk_new_ptop)
53
54  REAL, SAVE, PROTECTED                                       :: wdensinit ! Minimum wake density used to restart wakes from a wake-free state
55  !$OMP THREADPRIVATE(wdensinit)
56  REAL, SAVE, PROTECTED                                       :: wdensthreshold ! Threshold wake density below which wakes are killed
57  !$OMP THREADPRIVATE(wdensthreshold)
58  REAL, SAVE, PROTECTED                                       :: sigmad, hwmin, wapecut, cstart
59  !$OMP THREADPRIVATE(sigmad, hwmin, wapecut, cstart)
60  REAL, SAVE, PROTECTED                                       :: sigmaw_max
61  !$OMP THREADPRIVATE(sigmaw_max) 
62  REAL, SAVE, PROTECTED                                       :: dens_rate
63  !$OMP THREADPRIVATE(dens_rate)
64  REAL, SAVE, PROTECTED                                       :: epsilon_loc
65  !$OMP THREADPRIVATE(epsilon_loc)
66  REAL, SAVE, PROTECTED                                       :: epsim1,RG,RD
67  !$OMP THREADPRIVATE(epsim1,RG,RD)
68  REAL, SAVE, PROTECTED                                        ::smallestreal
69  !$OMP THREADPRIVATE(smallestreal)
70
71
72
73CONTAINS
74
75  ! =========================================================================
76  SUBROUTINE wake_ini(rg_in,rd_in,rv_in,prt_lev)
77  ! =========================================================================
78
79  ! **************************************************************
80  ! *
81  ! WAKE                                                        *
82  ! retour a un Pupper fixe                                *
83  ! *
84  ! written by   :  GRANDPEIX Jean-Yves   09/03/2000            *
85  ! modified by :   ROEHRIG Romain        01/29/2007            *
86  ! **************************************************************
87
88  ! -------------------------------------------------------------------------
89  ! Initialisations
90  ! -------------------------------------------------------------------------
91
92  USE ioipsl_getin_p_mod, ONLY : getin_p
93  real eps
94  integer, intent(in) :: prt_lev
95  real, intent(in) :: rg_in,rd_in,rv_in
96
97  smallestreal=tiny(smallestreal)
98!
99  prt_level=prt_lev
100  epsilon_loc=1.E-15
101  wapecut=1. ! previously 5.
102!
103  rzero = 5000.
104  CALL getin_p('rzero_wk', rzero)
105  aa0 = 3.14*rzero*rzero
106!
107  ! Essais d'initialisation avec sigmaw = 0.02 et hw = 10.
108!!  sigmad=0.005
109  sigmad=0.02
110  CALL getin_p('sigmad', sigmad)
111  hwmin=10.
112!
113!!wdensthreshold=1.e-12
114  wdensthreshold=1.e-14
115  wdensthreshold=2.e-14
116  CALL getin_p('wdensthreshold', wdensthreshold)
117!
118  IF (sigmad < 0.) THEN
119    sigmad = abs(sigmad)
120!!    wdensmin=sigmad/(3.14*rzero**2)
121    wdensinit=sigmad/(3.14*rzero**2)
122  ELSE
123    wdensinit = wdensthreshold/2.
124  ENDIF
125!
126!
127  ! cc nrlmd
128  sigmaw_max=0.4
129  dens_rate=0.1
130
131  eps = rd_in/rv_in
132  epsim1 = 1.0/eps - 1.0
133  RG=rg_in
134  RD=rd_in
135
136
137  ! cc
138  ! Longueur de maille (en m)
139  ! -------------------------------------------------------------------------
140
141  ! ALON = 3.e5
142  ! alon = 1.E6
143
144  ! Configuration de coefgw,stark,wdens (22/02/06 by YU Jingmei)
145
146  ! coefgw : Coefficient pour les ondes de gravite
147  ! stark : Coefficient k dans Cstar=k*sqrt(2*WAPE)
148  ! wdens : Densite surfacique de poche froide
149  ! -------------------------------------------------------------------------
150
151  ! cc nrlmd      coefgw=10
152  ! coefgw=1
153  ! wdens0 = 1.0/(alon**2)
154  ! cc nrlmd      wdens = 1.0/(alon**2)
155  ! cc nrlmd      stark = 0.50
156  ! CRtest
157  ! cc nrlmd      alpk=0.1
158  ! alpk = 1.0
159  ! alpk = 0.5
160  ! alpk = 0.05
161
162
163
164  crep_upper = 0.9
165  crep_sol = 1.0
166
167  ! Flag concerning the bug in gfl computation
168  ok_bug_gfl = .True.
169  call getin_p('ok_bug_gfl', ok_bug_gfl)
170
171  ! Get wapecut from parameter file
172  wapecut = 1.
173
174print*,'wapecut',wapecut
175  CALL getin_p('wapecut', wapecut)
176print*,'wapecut',wapecut
177
178  ! cc nrlmd Lecture du fichier wake_param.data
179
180
181  ! cc nrlmd Lecture du fichier wake_param.data
182  stark=0.33
183  CALL getin_p('stark',stark)
184  cstart = stark*sqrt(2.*wapecut)
185
186  alpk=0.25
187  CALL getin_p('alpk',alpk)
188 
189  wk_pupper=0.6
190  CALL getin_p('wk_pupper',wk_pupper)
191
192
193!jyg<
194!!  wdens_ref=8.E-12
195!!  CALL getin_p('wdens_ref',wdens_ref)
196  wdens_ref(1)=8.E-12
197  wdens_ref(2)=8.E-12
198  CALL getin_p('wdens_ref_o',wdens_ref(1))    !wake number per unit area ; ocean
199  CALL getin_p('wdens_ref_l',wdens_ref(2))    !wake number per unit area ; land
200!>jyg
201!
202!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
203!!!!!!!!!  Population dynamics parameters    !!!!!!!!!!!!!!!!!!!!!!!!!!!!
204!------------------------------------------------------------------------
205
206  iflag_wk_pop_dyn = 0
207  CALL getin_p('iflag_wk_pop_dyn',iflag_wk_pop_dyn) ! switch between wdens prescribed
208                                                    ! and wdens prognostic
209  iflag_wk_act = 0
210  CALL getin_p('iflag_wk_act',iflag_wk_act) ! 0: act(:)=0.
211                                            ! 1: act(:)=1.
212                                            ! 2: act(:)=f(Wape)
213
214  iflag_wk_profile = 0
215  CALL getin_p('iflag_wk_profile',iflag_wk_profile) ! switch between wdens prescribed
216                                                    ! and wdens prognostic
217  iflag_wk_profile = 0
218  CALL getin_p('iflag_wk_new_ptop',iflag_wk_new_ptop)
219
220  tau_cv = 4000.
221  CALL getin_p('tau_cv', tau_cv)
222
223!------------------------------------------------------------------------
224
225  coefgw=4.
226  CALL getin_p('coefgw',coefgw)
227
228  WRITE(*,*) 'stark=', stark
229  WRITE(*,*) 'alpk=', alpk
230  WRITE(*,*) 'wk_pupper=', wk_pupper
231!jyg<
232!!  WRITE(*,*) 'wdens_ref=', wdens_ref
233  WRITE(*,*) 'wdens_ref_o=', wdens_ref(1)
234  WRITE(*,*) 'wdens_ref_l=', wdens_ref(2)
235!>jyg
236  WRITE(*,*) 'iflag_wk_pop_dyn=',iflag_wk_pop_dyn
237  WRITE(*,*) 'iflag_wk_act',iflag_wk_act
238  WRITE(*,*) 'coefgw=', coefgw
239
240  flag_wk_check_trgl=.false.
241  CALL getin_p('flag_wk_check_trgl ', flag_wk_check_trgl)
242  WRITE(*,*) 'flag_wk_check_trgl=', flag_wk_check_trgl
243  WRITE(*,*) 'flag_wk_check_trgl OBSOLETE. Utilisr iflag_wk_check_trgl plutot'
244  iflag_wk_check_trgl=0 ; IF (flag_wk_check_trgl) iflag_wk_check_trgl=1
245  CALL getin_p('iflag_wk_check_trgl ', iflag_wk_check_trgl)
246  WRITE(*,*) 'iflag_wk_check_trgl=', iflag_wk_check_trgl
247
248 RETURN
249
250END SUBROUTINE wake_ini
251
252
253
254END MODULE lmdz_wake_ini
Note: See TracBrowser for help on using the repository browser.