source: LMDZ6/trunk/libf/phylmd/phys_local_var_mod.F90 @ 3528

Last change on this file since 3528 was 3496, checked in by jyg, 6 years ago

Implementation of the ejection of liquid precipitation from the adiabatic ascents.
New flags:
+cvflag_prec_eject: logical

n -> old code, y -> new code

+ejectliq: real; possible values 0. & 1.

  1. -> no liquid precipitation is ejected
  2. -> all liquid precipitation is ejected

+ejectice: real; any value between 0. and 1.

fraction of solid precipitation ejected at each level

Note that the adiabatic ascent mass flux decrease due to precipitation ejection is not taken into account.

Attempts to do it led to water conservation violation.

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 48.1 KB
Line 
1!
2! $Id: phys_local_var_mod.F90 3496 2019-05-10 10:17:35Z oboucher $
3!
4      MODULE phys_local_var_mod
5! Variables locales pour effectuer les appels en serie
6!======================================================================
7!
8!
9!======================================================================
10! Declaration des variables
11
12      REAL, SAVE, ALLOCATABLE :: t_seri(:,:), q_seri(:,:)
13      !$OMP THREADPRIVATE(t_seri, q_seri)
14      REAL, SAVE, ALLOCATABLE :: ql_seri(:,:),qs_seri(:,:)
15      !$OMP THREADPRIVATE(ql_seri,qs_seri)
16      REAL, SAVE, ALLOCATABLE :: u_seri(:,:), v_seri(:,:)
17      !$OMP THREADPRIVATE(u_seri, v_seri)
18      REAL, SAVE, ALLOCATABLE :: l_mixmin(:,:,:), l_mix(:,:,:)
19      !$OMP THREADPRIVATE(l_mixmin, l_mix)
20
21      REAL, SAVE, ALLOCATABLE :: tr_seri(:,:,:)
22      !$OMP THREADPRIVATE(tr_seri)
23      REAL, SAVE, ALLOCATABLE :: d_t_dyn(:,:), d_q_dyn(:,:)
24      !$OMP THREADPRIVATE(d_t_dyn, d_q_dyn)
25      REAL, SAVE, ALLOCATABLE :: d_ql_dyn(:,:), d_qs_dyn(:,:)
26      !$OMP THREADPRIVATE(d_ql_dyn, d_qs_dyn)
27      REAL, SAVE, ALLOCATABLE :: d_q_dyn2d(:), d_ql_dyn2d(:), d_qs_dyn2d(:)
28      !$OMP THREADPRIVATE(d_q_dyn2d, d_ql_dyn2d, d_qs_dyn2d)
29      REAL, SAVE, ALLOCATABLE :: d_u_dyn(:,:), d_v_dyn(:,:)
30      !$OMP THREADPRIVATE(d_u_dyn, d_v_dyn)
31      REAL, SAVE, ALLOCATABLE :: d_tr_dyn(:,:,:)
32      !$OMP THREADPRIVATE(d_tr_dyn)
33      REAL, SAVE, ALLOCATABLE :: d_t_con(:,:),d_q_con(:,:)
34      !$OMP THREADPRIVATE(d_t_con,d_q_con)
35      REAL, SAVE, ALLOCATABLE :: d_u_con(:,:),d_v_con(:,:)
36      !$OMP THREADPRIVATE(d_u_con,d_v_con)
37      REAL, SAVE, ALLOCATABLE :: d_t_wake(:,:),d_q_wake(:,:)
38      !$OMP THREADPRIVATE( d_t_wake,d_q_wake)
39      REAL, SAVE, ALLOCATABLE :: d_t_lsc(:,:),d_q_lsc(:,:),d_ql_lsc(:,:),d_qi_lsc(:,:)
40      !$OMP THREADPRIVATE(d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc)
41      REAL, SAVE, ALLOCATABLE :: d_t_lwr(:,:),d_t_lw0(:,:),d_t_swr(:,:),d_t_sw0(:,:)
42      !$OMP THREADPRIVATE(d_t_lwr,d_t_lw0,d_t_swr,d_t_sw0)
43      REAL, SAVE, ALLOCATABLE :: d_t_ajsb(:,:), d_q_ajsb(:,:)
44      !$OMP THREADPRIVATE(d_t_ajsb, d_q_ajsb)
45      REAL, SAVE, ALLOCATABLE :: d_t_ajs(:,:), d_q_ajs(:,:)
46      !$OMP THREADPRIVATE(d_t_ajs, d_q_ajs)
47      REAL, SAVE, ALLOCATABLE :: d_u_ajs(:,:), d_v_ajs(:,:)
48      !$OMP THREADPRIVATE(d_u_ajs, d_v_ajs)
49!nrlmd<
50      REAL, SAVE, ALLOCATABLE :: d_t_ajs_w(:,:), d_q_ajs_w(:,:)
51      !$OMP THREADPRIVATE(d_t_ajs_w, d_q_ajs_w)
52      REAL, SAVE, ALLOCATABLE :: d_t_ajs_x(:,:), d_q_ajs_x(:,:)
53      !$OMP THREADPRIVATE(d_t_ajs_x, d_q_ajs_x)
54!>nrlmd
55      REAL, SAVE, ALLOCATABLE :: d_t_eva(:,:),d_q_eva(:,:),d_ql_eva(:,:),d_qi_eva(:,:)
56      !$OMP THREADPRIVATE(d_t_eva,d_q_eva,d_ql_eva,d_qi_eva)
57      REAL, SAVE, ALLOCATABLE :: d_t_lscst(:,:),d_q_lscst(:,:)
58      !$OMP THREADPRIVATE(d_t_lscst,d_q_lscst)
59      REAL, SAVE, ALLOCATABLE :: d_t_lscth(:,:),d_q_lscth(:,:)
60      !$OMP THREADPRIVATE(d_t_lscth,d_q_lscth)
61      REAL, SAVE, ALLOCATABLE :: plul_th(:),plul_st(:)
62      !$OMP THREADPRIVATE(plul_th,plul_st)
63!tendances dues a oro et lif
64      REAL, SAVE, ALLOCATABLE :: d_t_oli(:,:)
65      !$OMP THREADPRIVATE(d_t_oli)
66      REAL, SAVE, ALLOCATABLE :: d_u_oli(:,:), d_v_oli(:,:)
67      !$OMP THREADPRIVATE(d_u_oli, d_v_oli)
68      REAL, SAVE, ALLOCATABLE :: d_t_vdf(:,:), d_q_vdf(:,:), d_t_diss(:,:)
69      !$OMP THREADPRIVATE( d_t_vdf, d_q_vdf,d_t_diss)
70      REAL, SAVE, ALLOCATABLE :: d_u_vdf(:,:), d_v_vdf(:,:)
71      !$OMP THREADPRIVATE(d_u_vdf, d_v_vdf)
72!nrlmd+jyg<
73      REAL, SAVE, ALLOCATABLE :: d_t_vdf_w(:,:), d_q_vdf_w(:,:)
74      !$OMP THREADPRIVATE( d_t_vdf_w, d_q_vdf_w)
75      REAL, SAVE, ALLOCATABLE :: d_t_vdf_x(:,:), d_q_vdf_x(:,:)
76      !$OMP THREADPRIVATE( d_t_vdf_x, d_q_vdf_x)
77!>nrlmd+jyg
78      REAL, SAVE, ALLOCATABLE :: d_t_oro(:,:)
79      !$OMP THREADPRIVATE(d_t_oro)
80      REAL, SAVE, ALLOCATABLE :: d_u_oro(:,:), d_v_oro(:,:)
81      !$OMP THREADPRIVATE(d_u_oro, d_v_oro)
82      REAL, SAVE, ALLOCATABLE :: d_t_oro_gw(:,:)
83      !$OMP THREADPRIVATE(d_t_oro_gw)
84      REAL, SAVE, ALLOCATABLE :: d_u_oro_gw(:,:), d_v_oro_gw(:,:)
85      !$OMP THREADPRIVATE(d_u_oro_gw, d_v_oro_gw)
86      REAL, SAVE, ALLOCATABLE :: d_t_lif(:,:)
87      !$OMP THREADPRIVATE(d_t_lif)
88      REAL, SAVE, ALLOCATABLE :: d_u_lif(:,:), d_v_lif(:,:)
89      !$OMP THREADPRIVATE(d_u_lif, d_v_lif)
90! Tendances Ondes de G non oro (runs strato).
91      REAL, SAVE, ALLOCATABLE :: du_gwd_hines(:,:)
92      !$OMP THREADPRIVATE(du_gwd_hines)
93      REAL, SAVE, ALLOCATABLE :: dv_gwd_hines(:,:)
94      !$OMP THREADPRIVATE(dv_gwd_hines)
95      REAL, SAVE, ALLOCATABLE :: dv_gwd_rando(:,:)
96      !$OMP THREADPRIVATE(dv_gwd_rando)
97      REAL, SAVE, ALLOCATABLE :: dv_gwd_front(:,:)
98      !$OMP THREADPRIVATE(dv_gwd_front)
99      REAL, SAVE, ALLOCATABLE :: east_gwstress(:,:)
100      !$OMP THREADPRIVATE(east_gwstress)
101      REAL, SAVE, ALLOCATABLE :: west_gwstress(:,:)
102      !$OMP THREADPRIVATE(west_gwstress)
103      REAL, SAVE, ALLOCATABLE :: d_t_hin(:,:)
104      !$OMP THREADPRIVATE(d_t_hin)
105! tendance due a l'oxydation du methane
106      REAL, SAVE, ALLOCATABLE :: d_q_ch4(:,:)
107      !$OMP THREADPRIVATE(d_q_ch4)
108
109! tendance du a la conersion Ec -> E thermique
110      REAL, SAVE, ALLOCATABLE :: d_t_ec(:,:)
111      !$OMP THREADPRIVATE(d_t_ec)
112      REAL, SAVE, ALLOCATABLE :: d_ts(:,:), d_tr(:,:,:)
113      !$OMP THREADPRIVATE(d_ts, d_tr)
114
115! diagnostique pour le rayonnement
116      REAL, SAVE, ALLOCATABLE :: topswad_aero(:),  solswad_aero(:)      ! diag
117      !$OMP THREADPRIVATE(topswad_aero,solswad_aero)
118      REAL, SAVE, ALLOCATABLE :: topswai_aero(:),  solswai_aero(:)      ! diag
119      !$OMP THREADPRIVATE(topswai_aero,solswai_aero)
120      REAL, SAVE, ALLOCATABLE :: topswad0_aero(:), solswad0_aero(:)     ! diag
121      !$OMP THREADPRIVATE(topswad0_aero,solswad0_aero)
122      REAL, SAVE, ALLOCATABLE :: topsw_aero(:,:),  solsw_aero(:,:)      ! diag
123      !$OMP THREADPRIVATE(topsw_aero,solsw_aero)
124      REAL, SAVE, ALLOCATABLE :: topsw0_aero(:,:), solsw0_aero(:,:)     ! diag
125      !$OMP THREADPRIVATE(topsw0_aero,solsw0_aero)
126      REAL, SAVE, ALLOCATABLE :: topswcf_aero(:,:),  solswcf_aero(:,:)  ! diag
127      !$OMP THREADPRIVATE(topswcf_aero,solswcf_aero)
128! LW radiation diagnostics CK
129      REAL, SAVE, ALLOCATABLE :: toplwad_aero(:),  sollwad_aero(:)      ! diag
130      !$OMP THREADPRIVATE(toplwad_aero,sollwad_aero)
131      REAL, SAVE, ALLOCATABLE :: toplwai_aero(:),  sollwai_aero(:)      ! diag
132      !$OMP THREADPRIVATE(toplwai_aero,sollwai_aero)
133      REAL, SAVE, ALLOCATABLE :: toplwad0_aero(:), sollwad0_aero(:)     ! diag
134      !$OMP THREADPRIVATE(toplwad0_aero,sollwad0_aero)
135! Special RRTM
136      REAL, SAVE, ALLOCATABLE :: ZLWFT0_i(:,:),  ZSWFT0_i(:,:)      ! diag
137      !$OMP THREADPRIVATE(ZLWFT0_i,ZSWFT0_i)
138      REAL, SAVE, ALLOCATABLE :: ZFLDN0(:,:),  ZFLUP0(:,:)      ! diag
139      !$OMP THREADPRIVATE(ZFLDN0,ZFLUP0)
140      REAL, SAVE, ALLOCATABLE :: ZFSDN0(:,:),  ZFSUP0(:,:)      ! diag
141      !$OMP THREADPRIVATE(ZFSDN0,ZFSUP0)
142!
143      REAL, SAVE, ALLOCATABLE :: stratomask(:,:)
144      !$OMP THREADPRIVATE(stratomask)
145      REAL, SAVE, ALLOCATABLE :: tausum_aero(:,:,:)
146      !$OMP THREADPRIVATE(tausum_aero)
147      REAL, SAVE, ALLOCATABLE :: drytausum_aero(:,:)
148      !$OMP THREADPRIVATE(drytausum_aero)
149      REAL, SAVE, ALLOCATABLE :: tau3d_aero(:,:,:,:)
150      !$OMP THREADPRIVATE(tau3d_aero)
151      REAL, SAVE, ALLOCATABLE :: scdnc(:,:)
152      !$OMP THREADPRIVATE(scdnc)
153      REAL, SAVE, ALLOCATABLE :: dNovrN(:)
154      !$OMP THREADPRIVATE(dNovrN)
155      REAL, SAVE, ALLOCATABLE :: cldncl(:)
156      !$OMP THREADPRIVATE(cldncl)
157      REAL, SAVE, ALLOCATABLE :: reffclwtop(:)
158      !$OMP THREADPRIVATE(reffclwtop)
159      REAL, SAVE, ALLOCATABLE :: lcc(:)
160      !$OMP THREADPRIVATE(lcc)
161      REAL, SAVE, ALLOCATABLE :: reffclws(:,:)
162      !$OMP THREADPRIVATE(reffclws)
163      REAL, SAVE, ALLOCATABLE :: reffclwc(:,:)
164      !$OMP THREADPRIVATE(reffclwc)
165      REAL, SAVE, ALLOCATABLE :: cldnvi(:)
166      !$OMP THREADPRIVATE(cldnvi)
167      REAL, SAVE, ALLOCATABLE :: lcc3d(:,:)
168      !$OMP THREADPRIVATE(lcc3d)
169      REAL, SAVE, ALLOCATABLE :: lcc3dcon(:,:)
170      !$OMP THREADPRIVATE(lcc3dcon)
171      REAL, SAVE, ALLOCATABLE :: lcc3dstra(:,:)
172      !$OMP THREADPRIVATE(lcc3dstra)
173      REAL, SAVE, ALLOCATABLE :: icc3dcon(:,:)
174      !$OMP THREADPRIVATE(icc3dcon)
175      REAL, SAVE, ALLOCATABLE :: icc3dstra(:,:)
176      !$OMP THREADPRIVATE(icc3dstra)
177      REAL, SAVE, ALLOCATABLE :: zfice(:,:)
178      !$OMP THREADPRIVATE(zfice)
179      REAL, SAVE, ALLOCATABLE :: od443aer(:)
180      !$OMP THREADPRIVATE(od443aer)
181      REAL, SAVE, ALLOCATABLE :: od550aer(:)
182      !$OMP THREADPRIVATE(od550aer)
183      REAL, SAVE, ALLOCATABLE :: dryod550aer(:)
184      !$OMP THREADPRIVATE(dryod550aer)
185      REAL, SAVE, ALLOCATABLE :: abs550aer(:)
186      !$OMP THREADPRIVATE(abs550aer)
187      REAL, SAVE, ALLOCATABLE :: od865aer(:)
188      !$OMP THREADPRIVATE(od865aer)
189      REAL, SAVE, ALLOCATABLE :: ec550aer(:,:)
190      !$OMP THREADPRIVATE(ec550aer)
191      REAL, SAVE, ALLOCATABLE :: od550lt1aer(:)
192      !$OMP THREADPRIVATE(od550lt1aer)
193      REAL, SAVE, ALLOCATABLE :: sconcso4(:)
194      !$OMP THREADPRIVATE(sconcso4)
195      REAL, SAVE, ALLOCATABLE :: sconcno3(:)
196      !$OMP THREADPRIVATE(sconcno3)
197      REAL, SAVE, ALLOCATABLE :: sconcoa(:)
198      !$OMP THREADPRIVATE(sconcoa)
199      REAL, SAVE, ALLOCATABLE :: sconcbc(:)
200      !$OMP THREADPRIVATE(sconcbc)
201      REAL, SAVE, ALLOCATABLE :: sconcss(:)
202      !$OMP THREADPRIVATE(sconcss)
203      REAL, SAVE, ALLOCATABLE :: sconcdust(:)
204      !$OMP THREADPRIVATE(sconcdust)
205      REAL, SAVE, ALLOCATABLE :: concso4(:,:)
206      !$OMP THREADPRIVATE(concso4)
207      REAL, SAVE, ALLOCATABLE :: concno3(:,:)
208      !$OMP THREADPRIVATE(concno3)
209      REAL, SAVE, ALLOCATABLE :: concoa(:,:)
210      !$OMP THREADPRIVATE(concoa)
211      REAL, SAVE, ALLOCATABLE :: concbc(:,:)
212      !$OMP THREADPRIVATE(concbc)
213      REAL, SAVE, ALLOCATABLE :: concss(:,:)
214      !$OMP THREADPRIVATE(concss)
215      REAL, SAVE, ALLOCATABLE :: concdust(:,:)
216      !$OMP THREADPRIVATE(concdust)
217      REAL, SAVE, ALLOCATABLE :: loadso4(:)
218      !$OMP THREADPRIVATE(loadso4)
219      REAL, SAVE, ALLOCATABLE :: loadoa(:)
220      !$OMP THREADPRIVATE(loadoa)
221      REAL, SAVE, ALLOCATABLE :: loadbc(:)
222      !$OMP THREADPRIVATE(loadbc)
223      REAL, SAVE, ALLOCATABLE :: loadss(:)
224      !$OMP THREADPRIVATE(loadss)
225      REAL, SAVE, ALLOCATABLE :: loaddust(:)
226      !$OMP THREADPRIVATE(loaddust)
227      REAL, SAVE, ALLOCATABLE :: loadno3(:)
228      !$OMP THREADPRIVATE(loadno3)
229      REAL, SAVE, ALLOCATABLE :: load_tmp1(:), load_tmp2(:)
230      !$OMP THREADPRIVATE(load_tmp1, load_tmp2)
231      REAL, SAVE, ALLOCATABLE :: load_tmp3(:), load_tmp4(:)
232      !$OMP THREADPRIVATE(load_tmp3, load_tmp4)
233      REAL, SAVE, ALLOCATABLE :: load_tmp5(:), load_tmp6(:)
234      !$OMP THREADPRIVATE(load_tmp5, load_tmp6)
235      REAL, SAVE, ALLOCATABLE :: load_tmp7(:), load_tmp8(:)
236      !$OMP THREADPRIVATE(load_tmp7, load_tmp8)
237      REAL, SAVE, ALLOCATABLE :: load_tmp9(:), load_tmp10(:)
238      !$OMP THREADPRIVATE(load_tmp9, load_tmp10)
239
240!IM ajout variables CFMIP2/CMIP5
241      REAL,ALLOCATABLE,SAVE :: topswad_aerop(:), solswad_aerop(:)
242!$OMP THREADPRIVATE(topswad_aerop, solswad_aerop)
243      REAL,ALLOCATABLE,SAVE :: topswai_aerop(:), solswai_aerop(:)
244!$OMP THREADPRIVATE(topswai_aerop, solswai_aerop)
245      REAL,ALLOCATABLE,SAVE :: topswad0_aerop(:), solswad0_aerop(:)
246!$OMP THREADPRIVATE(topswad0_aerop, solswad0_aerop)
247      REAL,ALLOCATABLE,SAVE :: topsw_aerop(:,:), topsw0_aerop(:,:) 
248!$OMP THREADPRIVATE(topsw_aerop, topsw0_aerop)
249      REAL,ALLOCATABLE,SAVE :: solsw_aerop(:,:), solsw0_aerop(:,:)
250!$OMP THREADPRIVATE(solsw_aerop, solsw0_aerop)
251      REAL,ALLOCATABLE,SAVE :: topswcf_aerop(:,:), solswcf_aerop(:,:)
252!$OMP THREADPRIVATE(topswcf_aerop, solswcf_aerop)
253
254! additional LW variables CK
255      REAL,ALLOCATABLE,SAVE :: toplwad_aerop(:), sollwad_aerop(:)
256!$OMP THREADPRIVATE(toplwad_aerop, sollwad_aerop)
257      REAL,ALLOCATABLE,SAVE :: toplwai_aerop(:), sollwai_aerop(:)
258!$OMP THREADPRIVATE(toplwai_aerop, sollwai_aerop)
259      REAL,ALLOCATABLE,SAVE :: toplwad0_aerop(:), sollwad0_aerop(:)
260!$OMP THREADPRIVATE(toplwad0_aerop, sollwad0_aerop)
261
262!Ajout de celles n??cessaires au phys_output_write_mod
263      REAL, SAVE, ALLOCATABLE :: tal1(:), pal1(:), pab1(:), pab2(:)
264!$OMP THREADPRIVATE(tal1, pal1, pab1, pab2)
265      REAL, SAVE, ALLOCATABLE :: ptstar(:), pt0(:), slp(:)
266!$OMP THREADPRIVATE(ptstar, pt0, slp)
267      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sens, flwp, fiwp
268!$OMP THREADPRIVATE(sens, flwp, fiwp)
269!!
270!!         Wake variables
271      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: alp_wake
272!$OMP THREADPRIVATE(alp_wake)           
273!!jyg!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h,wake_k
274      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h
275      INTEGER,ALLOCATABLE,SAVE,DIMENSION(:)         :: wake_k
276!$OMP THREADPRIVATE(wake_h,wake_k)                       
277    REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)            :: wake_omg
278!$OMP THREADPRIVATE(wake_omg)                     
279    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_wk, d_deltaq_wk
280!$OMP THREADPRIVATE(d_deltat_wk, d_deltaq_wk)
281      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: d_s_wk, d_dens_a_wk, d_dens_wk
282!$OMP THREADPRIVATE(d_s_wk, d_dens_a_wk, d_dens_wk)
283    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_wk_gw, d_deltaq_wk_gw
284!$OMP THREADPRIVATE(d_deltat_wk_gw, d_deltaq_wk_gw)
285    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_vdf, d_deltaq_vdf
286!$OMP THREADPRIVATE(d_deltat_vdf, d_deltaq_vdf)
287!!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_vdf, d_dens_vdf
288!!!OMP THREADPRIVATE(d_s_vdf, d_dens_vdf)
289    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_the, d_deltaq_the
290!$OMP THREADPRIVATE(d_deltat_the, d_deltaq_the)
291!!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_the, d_dens_the
292!!!OMP THREADPRIVATE(d_s_the, d_dens_the)
293      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)           :: d_deltat_ajs_cv, d_deltaq_ajs_cv
294!$OMP THREADPRIVATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)                       
295!!         End of Wake variables
296!!
297      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: bils
298!$OMP THREADPRIVATE(bils)
299      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragm, cdragh
300!$OMP THREADPRIVATE(cdragm, cdragh)
301      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cldh, cldl, cldm, cldq, cldt, qsat2m
302!$OMP THREADPRIVATE(cldh, cldl, cldm, cldq, cldt, qsat2m )
303      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cldhjn, cldljn, cldmjn,cldtjn
304!$OMP THREADPRIVATE(cldhjn, cldljn, cldmjn, cldtjn)
305      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: JrNt
306!$OMP THREADPRIVATE(JrNt)
307      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: dthmin, evap, fder, plcl, plfc, prw, prlw, prsw
308!$OMP THREADPRIVATE(dthmin, evap, fder, plcl, plfc, prw, prlw, prsw)
309      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zustar, zu10m, zv10m, rh2m
310!$OMP THREADPRIVATE(zustar, zu10m, zv10m, rh2m)
311      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_lcl, s_pblh, s_pblt, s_therm
312!$OMP THREADPRIVATE(s_lcl, s_pblh, s_pblt, s_therm)
313!
314!nrlmd+jyg<
315      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_pblh_x, s_pblh_w
316!$OMP THREADPRIVATE(s_pblh_x, s_pblh_w)
317      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_lcl_x, s_lcl_w
318!$OMP THREADPRIVATE(s_lcl_x, s_lcl_w)
319!>nrlmd+jyg
320!
321      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: slab_wfbils
322!$OMP THREADPRIVATE(slab_wfbils)
323      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte
324!$OMP THREADPRIVATE(tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte)
325      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfqcalving
326!$OMP THREADPRIVATE(zxfqcalving)
327      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfluxlat, zxtsol, snow_lsc, zxfqfonte
328!$OMP THREADPRIVATE(zxfluxlat, zxtsol, snow_lsc, zxfqfonte)
329      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxrunofflic
330!$OMP THREADPRIVATE(zxrunofflic)
331      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxqsurf, rain_lsc, rain_num
332!$OMP THREADPRIVATE(zxqsurf, rain_lsc, rain_num)
333!
334!jyg+nrlmd<
335!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
336!                                                                          c
337!       Declarations liees a la couche limite differentiee w-x             c
338!                                                                          c
339!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
340      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sens_x, sens_w
341!$OMP THREADPRIVATE(sens_x, sens_w)
342      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfluxlat_x, zxfluxlat_w
343!$OMP THREADPRIVATE(zxfluxlat_x, zxfluxlat_w)
344!jyg<
345!!! Entrees supplementaires couche-limite
346!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t_x, t_w
347!!!$OMP THREADPRIVATE(t_x, t_w)
348!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: q_x, q_w
349!!!$OMP THREADPRIVATE(q_x, q_w)
350!>jyg
351!!! Sorties ferret
352      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dtvdf_x, dtvdf_w
353!$OMP THREADPRIVATE(dtvdf_x, dtvdf_w)
354      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dqvdf_x, dqvdf_w
355!$OMP THREADPRIVATE(dqvdf_x, dqvdf_w)
356! Variables supplementaires dans physiq.F relative au splitting de la surface
357      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: pbl_tke_input
358!$OMP THREADPRIVATE(pbl_tke_input)
359! Entree supplementaire Thermiques :
360      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t_therm, q_therm, u_therm, v_therm
361!$OMP THREADPRIVATE(t_therm, q_therm, u_therm, v_therm)
362      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragh_x, cdragh_w
363!$OMP THREADPRIVATE(cdragh_x, cdragh_w)
364      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragm_x, cdragm_w
365!$OMP THREADPRIVATE(cdragm_x, cdragm_w)
366      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: kh, kh_x, kh_w
367!$OMP THREADPRIVATE(kh, kh_x, kh_w)
368!!!
369!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
370      LOGICAL, SAVE, ALLOCATABLE :: ptconv(:,:)
371      !$OMP THREADPRIVATE(ptconv)
372      REAL, SAVE, ALLOCATABLE :: ratqsc(:,:)
373      !$OMP THREADPRIVATE(ratqsc)
374!>jyg+nrlmd
375  !
376      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: wbeff, convoccur, zmax_th, zq2m, zt2m
377!$OMP THREADPRIVATE(wbeff, convoccur, zmax_th, zq2m, zt2m)
378      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zt2m_min_mon, zt2m_max_mon
379!$OMP THREADPRIVATE(zt2m_min_mon, zt2m_max_mon)
380      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: t2m_min_mon, t2m_max_mon
381!$OMP THREADPRIVATE(t2m_min_mon, t2m_max_mon)
382      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zq2m_cor, zt2m_cor
383!$OMP THREADPRIVATE(zq2m_cor, zt2m_cor)
384      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zu10m_cor, zv10m_cor
385!$OMP THREADPRIVATE(zu10m_cor, zv10m_cor)
386      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zrh2m_cor, zqsat2m_cor
387!$OMP THREADPRIVATE(zrh2m_cor, zqsat2m_cor)
388      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: weak_inversion
389!$OMP THREADPRIVATE(weak_inversion)
390      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_conv,alp_bl_det
391!$OMP THREADPRIVATE(alp_bl_conv,alp_bl_det)
392      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_fluct_m,alp_bl_fluct_tke
393!$OMP THREADPRIVATE(alp_bl_fluct_m,alp_bl_fluct_tke)
394      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_stat, n2, s2
395!$OMP THREADPRIVATE(alp_bl_stat, n2, s2)
396      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: proba_notrig, random_notrig
397!$OMP THREADPRIVATE(proba_notrig, random_notrig)
398      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cv_gen
399!$OMP THREADPRIVATE(cv_gen)
400      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: fsolsw, wfbils, wfbilo
401!$OMP THREADPRIVATE(fsolsw, wfbils, wfbilo)
402      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: wfevap, wfrain, wfsnow
403!$OMP THREADPRIVATE(wfevap,wfrain,wfsnow)
404      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: t2m, fluxlat, fsollw,evap_pot
405!$OMP THREADPRIVATE(t2m, fluxlat, fsollw,evap_pot)
406      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dnwd0, omega
407!$OMP THREADPRIVATE(dnwd0, omega)
408      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: epmax_diag ! epmax_cape
409!$OMP THREADPRIVATE(epmax_diag)
410!
411!  Deep convective variables used in phytrac
412      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: ep ! epmax_cape
413!$OMP THREADPRIVATE(ep)
414      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: dnwd, upwd
415!$OMP THREADPRIVATE(dnwd, upwd)
416      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: pmflxr, pmflxs
417!$OMP THREADPRIVATE(pmflxr, pmflxs)
418      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: wdtrainA, wdtrainS, wdtrainM
419!$OMP THREADPRIVATE(wdtrainA, wdtrainS, wdtrainM)
420      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: da, mp
421!$OMP THREADPRIVATE(da, mp)
422      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: wght_cvfd
423!$OMP THREADPRIVATE(wght_cvfd)
424      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:):: phi, phi2, elij, epmlmMm
425!$OMP THREADPRIVATE(phi, phi2, elij, epmlmMm)
426      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: d1a, dam
427!$OMP THREADPRIVATE(d1a, dam)
428      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: ev
429!$OMP THREADPRIVATE(ev)
430      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: qtaa
431!$OMP THREADPRIVATE(qtaa)
432      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: clw
433!$OMP THREADPRIVATE(clw)
434      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: eplaMm
435!$OMP THREADPRIVATE(eplaMm)
436      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:):: sij
437!$OMP THREADPRIVATE(sij)
438!
439!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: coefh, coefm, lambda_th
440      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: lambda_th
441!$OMP THREADPRIVATE(lambda_th)
442      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: cldemi, cldfra, cldtau, fiwc, fl, re, flwc
443!$OMP THREADPRIVATE(cldemi, cldfra, cldtau, fiwc, fl, re, flwc)
444      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ref_liq, ref_ice, theta, zphi
445!$OMP THREADPRIVATE(ref_liq, ref_ice, theta, zphi)
446      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ref_liq_pi, ref_ice_pi
447!$OMP THREADPRIVATE(ref_liq_pi, ref_ice_pi)
448      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zx_rh
449!$OMP THREADPRIVATE(zx_rh)
450      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: prfl, psfl, fraca
451!$OMP THREADPRIVATE(prfl, psfl, fraca)
452      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: Vprecip, zw2
453!$OMP THREADPRIVATE(Vprecip, zw2)
454      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: pmfd, pmfu
455!$OMP THREADPRIVATE(pmfd, pmfu)
456      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: fluxt, fluxu, fluxv
457!$OMP THREADPRIVATE(fluxt, fluxu, fluxv)
458      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: uwriteSTD, vwriteSTD, wwriteSTD
459!$OMP THREADPRIVATE(uwriteSTD, vwriteSTD, wwriteSTD)
460      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD
461!$OMP THREADPRIVATE(phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD)
462
463! ug et d'autres encore:
464      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: beta_prec
465!$OMP THREADPRIVATE(beta_prec)
466      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: rneb,rnebjn,rneblsvol
467!$OMP THREADPRIVATE(rneb,rnebjn,rneblsvol)
468
469! variables de sorties MM
470      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxsnow,snowhgt,qsnow,to_ice
471      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: sissnow,runoff,albsol3_lic
472!$OMP THREADPRIVATE(zxsnow,snowhgt,qsnow,to_ice)
473!$OMP THREADPRIVATE(sissnow,runoff,albsol3_lic)
474
475      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: p_tropopause, z_tropopause, t_tropopause
476!$OMP THREADPRIVATE(p_tropopause, z_tropopause, t_tropopause)
477
478#ifdef CPP_StratAer
479!
480! variables for stratospheric aerosol
481      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: R2SO4
482!$OMP THREADPRIVATE(R2SO4)
483      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: DENSO4
484!$OMP THREADPRIVATE(DENSO4)
485      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: f_r_wet
486!$OMP THREADPRIVATE(f_r_wet)
487      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: decfluxaer
488!$OMP THREADPRIVATE(decfluxaer)
489      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: mdw
490!$OMP THREADPRIVATE(mdw)
491      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: OCS_lifetime
492!$OMP THREADPRIVATE(OCS_lifetime)
493      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: SO2_lifetime
494!$OMP THREADPRIVATE(SO2_lifetime)
495      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: alpha_bin
496!$OMP THREADPRIVATE(alpha_bin)
497      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: piz_bin
498!$OMP THREADPRIVATE(piz_bin)
499      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: cg_bin
500!$OMP THREADPRIVATE(cg_bin)
501      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tau_strat_550
502!$OMP THREADPRIVATE(tau_strat_550)
503      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tau_strat_1020
504!$OMP THREADPRIVATE(tau_strat_1020)
505      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tausum_strat
506!$OMP THREADPRIVATE(tausum_strat)
507      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: surf_PM25_sulf
508!$OMP THREADPRIVATE(surf_PM25_sulf)
509      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vsed_aer
510!$OMP THREADPRIVATE(vsed_aer)
511!
512!---3D budget variables
513      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_nucl
514!$OMP THREADPRIVATE(budg_3D_nucl)
515      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_cond_evap
516!$OMP THREADPRIVATE(budg_3D_cond_evap)
517      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_ocs_to_so2
518!$OMP THREADPRIVATE(budg_3D_ocs_to_so2)
519      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_so2_to_h2so4
520!$OMP THREADPRIVATE(budg_3D_so2_to_h2so4)
521      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_backgr_ocs
522!$OMP THREADPRIVATE(budg_3D_backgr_ocs)
523      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_backgr_so2
524!$OMP THREADPRIVATE(budg_3D_backgr_so2)
525!
526!---2D budget variables
527      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_ocs
528      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_so2
529      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_h2so4
530      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_part
531!$OMP THREADPRIVATE(budg_dep_dry_ocs,budg_dep_dry_so2,budg_dep_dry_h2so4,budg_dep_dry_part)
532      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_ocs
533      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_so2
534      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_h2so4
535      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_part
536!$OMP THREADPRIVATE(budg_dep_wet_ocs,budg_dep_wet_so2,budg_dep_wet_h2so4,budg_dep_wet_part)
537      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_ocs
538      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_so2
539      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_h2so4
540      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_part
541!$OMP THREADPRIVATE(budg_emi_ocs,budg_emi_so2,budg_emi_h2so4,budg_emi_part)
542      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_ocs_to_so2
543      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_so2_to_h2so4
544      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_h2so4_to_part
545!$OMP THREADPRIVATE(budg_ocs_to_so2,budg_so2_to_h2so4,budg_h2so4_to_part)
546      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_sed_part
547!$OMP THREADPRIVATE(budg_sed_part)
548#endif
549
550CONTAINS
551
552!======================================================================
553SUBROUTINE phys_local_var_init
554USE dimphy
555USE infotrac_phy, ONLY : nbtr
556USE aero_mod
557USE indice_sol_mod
558USE phys_output_var_mod
559USE phys_state_var_mod
560
561IMPLICIT NONE
562      ALLOCATE(t_seri(klon,klev),q_seri(klon,klev),ql_seri(klon,klev),qs_seri(klon,klev))
563      ALLOCATE(u_seri(klon,klev),v_seri(klon,klev))
564      ALLOCATE(l_mixmin(klon,klev+1,nbsrf), l_mix(klon,klev+1,nbsrf))
565      l_mix(:,:,:)=0. ; l_mixmin(:,:,:)=0. ! doit etre initialse car pas toujours remplis
566
567      ALLOCATE(tr_seri(klon,klev,nbtr))
568      ALLOCATE(d_t_dyn(klon,klev),d_q_dyn(klon,klev))
569      ALLOCATE(d_ql_dyn(klon,klev),d_qs_dyn(klon,klev))
570      ALLOCATE(d_q_dyn2d(klon),d_ql_dyn2d(klon),d_qs_dyn2d(klon))
571      ALLOCATE(d_u_dyn(klon,klev),d_v_dyn(klon,klev))
572      ALLOCATE(d_tr_dyn(klon,klev,nbtr))                   !RomP
573      ALLOCATE(d_t_con(klon,klev),d_q_con(klon,klev))
574      ALLOCATE(d_u_con(klon,klev),d_v_con(klon,klev))
575      ALLOCATE(d_t_wake(klon,klev),d_q_wake(klon,klev))
576      ALLOCATE(d_t_lsc(klon,klev),d_q_lsc(klon,klev))
577      ALLOCATE(d_t_lwr(klon,klev),d_t_lw0(klon,klev))
578      ALLOCATE(d_t_swr(klon,klev),d_t_sw0(klon,klev))
579      ALLOCATE(d_ql_lsc(klon,klev),d_qi_lsc(klon,klev))
580      ALLOCATE(d_t_ajsb(klon,klev),d_q_ajsb(klon,klev))
581      ALLOCATE(d_t_ajs(klon,klev),d_q_ajs(klon,klev))
582!nrlmd<
583      ALLOCATE(d_t_ajs_w(klon,klev),d_q_ajs_w(klon,klev))
584      ALLOCATE(d_t_ajs_x(klon,klev),d_q_ajs_x(klon,klev))
585!>nrlmd
586      ALLOCATE(d_u_ajs(klon,klev),d_v_ajs(klon,klev))
587      ALLOCATE(d_t_eva(klon,klev),d_q_eva(klon,klev))
588      ALLOCATE(d_ql_eva(klon,klev),d_qi_eva(klon,klev))
589      ALLOCATE(d_t_lscst(klon,klev),d_q_lscst(klon,klev))
590      ALLOCATE(d_t_lscth(klon,klev),d_q_lscth(klon,klev))
591      ALLOCATE(plul_st(klon),plul_th(klon))
592      ALLOCATE(d_t_vdf(klon,klev),d_q_vdf(klon,klev),d_t_diss(klon,klev))
593
594      ALLOCATE(d_t_vdf_w(klon,klev),d_q_vdf_w(klon,klev))
595      ALLOCATE(d_t_vdf_x(klon,klev),d_q_vdf_x(klon,klev))
596
597      ALLOCATE(d_u_vdf(klon,klev),d_v_vdf(klon,klev))
598      ALLOCATE(d_t_oli(klon,klev),d_t_oro(klon,klev))
599      ALLOCATE(d_u_oli(klon,klev),d_v_oli(klon,klev))
600      ALLOCATE(d_u_oro(klon,klev),d_v_oro(klon,klev))
601      ALLOCATE(d_u_oro_gw(klon,klev),d_v_oro_gw(klon,klev))
602      ALLOCATE(d_t_oro_gw(klon,klev))
603      ALLOCATE(d_t_lif(klon,klev),d_t_ec(klon,klev))
604      ALLOCATE(d_u_lif(klon,klev),d_v_lif(klon,klev))
605      ALLOCATE(d_ts(klon,nbsrf), d_tr(klon,klev,nbtr))
606! Special RRTM
607      ALLOCATE(ZLWFT0_i(klon,klev+1),ZSWFT0_i(klon,klev+1),ZFLDN0(klon,klev+1))
608      ZFLDN0= 0.
609      ALLOCATE(ZFLUP0(klon,klev+1),ZFSDN0(klon,klev+1),ZFSUP0(klon,klev+1))
610!
611      ALLOCATE(topswad_aero(klon), solswad_aero(klon))
612      ALLOCATE(topswai_aero(klon), solswai_aero(klon))
613      ALLOCATE(topswad0_aero(klon), solswad0_aero(klon))
614      ALLOCATE(toplwad_aero(klon), sollwad_aero(klon))
615      ALLOCATE(toplwai_aero(klon), sollwai_aero(klon))
616      ALLOCATE(toplwad0_aero(klon), sollwad0_aero(klon))
617      ALLOCATE(topsw_aero(klon,naero_grp), solsw_aero(klon,naero_grp))
618      ALLOCATE(topsw0_aero(klon,naero_grp), solsw0_aero(klon,naero_grp))
619      ALLOCATE(topswcf_aero(klon,3), solswcf_aero(klon,3))
620      ALLOCATE(du_gwd_hines(klon,klev),dv_gwd_hines(klon,klev))
621      ALLOCATE(dv_gwd_rando(klon,klev),dv_gwd_front(klon,klev))
622      ALLOCATE(east_gwstress(klon,klev),west_gwstress(klon,klev))
623      east_gwstress(:,:)=0 !ym missing init
624      west_gwstress(:,:)=0 !ym missing init
625      ALLOCATE(d_t_hin(klon,klev))
626      ALLOCATE(d_q_ch4(klon,klev))
627      ALLOCATE(stratomask(klon,klev))
628      ALLOCATE(tausum_aero(klon,nwave,naero_tot))
629      ALLOCATE(drytausum_aero(klon,naero_tot))
630      ALLOCATE(tau3d_aero(klon,klev,nwave,naero_tot))
631      ALLOCATE(scdnc(klon, klev))
632      ALLOCATE(dNovrN(klon))
633      ALLOCATE(cldncl(klon))
634      ALLOCATE(reffclwtop(klon))
635      ALLOCATE(lcc(klon))
636      ALLOCATE(reffclws(klon, klev))
637      ALLOCATE(reffclwc(klon, klev))
638      ALLOCATE(cldnvi(klon))
639      ALLOCATE(lcc3d(klon, klev))
640      ALLOCATE(lcc3dcon(klon, klev))
641      ALLOCATE(lcc3dstra(klon, klev))
642      ALLOCATE(icc3dcon(klon, klev))
643      ALLOCATE(icc3dstra(klon, klev))
644      ALLOCATE(zfice(klon, klev))
645      ALLOCATE(od443aer(klon))
646      ALLOCATE(od550aer(klon))
647      ALLOCATE(od865aer(klon))
648      ALLOCATE(dryod550aer(klon))
649      dryod550aer(:) = 0.
650      ALLOCATE(abs550aer(klon))
651      abs550aer(:) = 0.
652      ALLOCATE(ec550aer(klon,klev))
653      ALLOCATE(od550lt1aer(klon))
654      ALLOCATE(sconcso4(klon))
655      ALLOCATE(sconcno3(klon))
656      ALLOCATE(sconcoa(klon))
657      ALLOCATE(sconcbc(klon))
658      ALLOCATE(sconcss(klon))
659      ALLOCATE(sconcdust(klon))
660      ALLOCATE(concso4(klon,klev))
661      ALLOCATE(concno3(klon,klev))
662      ALLOCATE(concoa(klon,klev))
663      ALLOCATE(concbc(klon,klev))
664      ALLOCATE(concss(klon,klev))
665      ALLOCATE(concdust(klon,klev))
666      ALLOCATE(loadso4(klon))
667      ALLOCATE(loadoa(klon))
668      ALLOCATE(loadbc(klon))
669      ALLOCATE(loadss(klon))
670      ALLOCATE(loaddust(klon))
671      ALLOCATE(loadno3(klon))
672      ALLOCATE(load_tmp1(klon))
673      ALLOCATE(load_tmp2(klon))
674      ALLOCATE(load_tmp3(klon))
675      ALLOCATE(load_tmp4(klon))
676      ALLOCATE(load_tmp5(klon))
677      ALLOCATE(load_tmp6(klon))
678      ALLOCATE(load_tmp7(klon))
679      ALLOCATE(load_tmp8(klon))
680      ALLOCATE(load_tmp9(klon))
681      ALLOCATE(load_tmp10(klon))
682
683!IM ajout variables CFMIP2/CMIP5
684      ALLOCATE(topswad_aerop(klon), solswad_aerop(klon))
685      ALLOCATE(topswai_aerop(klon), solswai_aerop(klon))
686      ALLOCATE(topswad0_aerop(klon), solswad0_aerop(klon))
687      ALLOCATE(topsw_aerop(klon,naero_grp), topsw0_aerop(klon,naero_grp))
688      ALLOCATE(solsw_aerop(klon,naero_grp), solsw0_aerop(klon,naero_grp))
689      ALLOCATE(topswcf_aerop(klon,naero_grp), solswcf_aerop(klon,naero_grp))
690
691! additional LW variables CK
692      ALLOCATE(toplwad_aerop(klon), sollwad_aerop(klon))
693      ALLOCATE(toplwai_aerop(klon), sollwai_aerop(klon))
694      ALLOCATE(toplwad0_aerop(klon), sollwad0_aerop(klon))
695
696! FH Ajout de celles necessaires au phys_output_write_mod
697
698      ALLOCATE(tal1(klon), pal1(klon), pab1(klon), pab2(klon))
699      ALLOCATE(ptstar(klon),pt0(klon),slp(klon))
700!!
701!!          Wake variables
702      ALLOCATE(alp_wake(klon))
703      ALLOCATE(wake_h(klon),wake_k(klon))
704      ALLOCATE(wake_omg(klon, klev))
705      ALLOCATE(d_deltat_wk(klon, klev), d_deltaq_wk(klon, klev))
706      ALLOCATE(d_s_wk(klon), d_dens_a_wk(klon), d_dens_wk(klon))
707      ALLOCATE(d_deltat_wk_gw(klon, klev), d_deltaq_wk_gw(klon, klev))
708      ALLOCATE(d_deltat_vdf(klon, klev), d_deltaq_vdf(klon, klev))
709!!      ALLOCATE( d_s_vdf(klon), d_dens_vdf(klon))
710      ALLOCATE(d_deltat_the(klon, klev), d_deltaq_the(klon, klev))
711!!      ALLOCATE( d_s_the(klon), d_dens_the(klon))
712      ALLOCATE(d_deltat_ajs_cv(klon, klev), d_deltaq_ajs_cv(klon, klev))
713!!         End of wake variables
714!!
715      ALLOCATE(bils(klon))
716      ALLOCATE(cdragm(klon), cdragh(klon), cldh(klon), cldl(klon))
717      ALLOCATE(cldm(klon), cldq(klon), cldt(klon), qsat2m(klon))
718      ALLOCATE(cldhjn(klon), cldljn(klon), cldmjn(klon), cldtjn(klon))
719      ALLOCATE(JrNt(klon))
720      ALLOCATE(dthmin(klon), evap(klon), fder(klon), plcl(klon), plfc(klon))
721      ALLOCATE(prw(klon), prlw(klon), prsw(klon), zustar(klon), zu10m(klon), zv10m(klon), rh2m(klon))
722      ALLOCATE(s_lcl(klon))
723      ALLOCATE(s_pblh(klon), s_pblt(klon), s_therm(klon))
724!
725!nrlmd+jyg<
726      ALLOCATE(s_pblh_x(klon), s_pblh_w(klon))
727      ALLOCATE(s_lcl_x(klon), s_lcl_w(klon))
728!>nrlmd+jyg
729!
730      ALLOCATE(slab_wfbils(klon), tpot(klon), tpote(klon), ue(klon))
731      ALLOCATE(uq(klon), ve(klon), vq(klon), zxffonte(klon))
732      ALLOCATE(uwat(klon), vwat(klon))
733      ALLOCATE(zxfqcalving(klon), zxfluxlat(klon))
734      ALLOCATE(zxtsol(klon), snow_lsc(klon), zxfqfonte(klon), zxqsurf(klon))
735      ALLOCATE(zxrunofflic(klon))
736      ALLOCATE(rain_lsc(klon))
737      ALLOCATE(rain_num(klon))
738!
739      ALLOCATE(sens_x(klon), sens_w(klon))
740      ALLOCATE(zxfluxlat_x(klon), zxfluxlat_w(klon))
741!jyg<
742!!      ALLOCATE(t_x(klon,klev), t_w(klon,klev))
743!!      ALLOCATE(q_x(klon,klev), q_w(klon,klev))
744!>jyg
745      ALLOCATE(dtvdf_x(klon,klev), dtvdf_w(klon,klev))
746      dtvdf_x = 0 ; dtvdf_w=0 ;   !ym missing init
747      ALLOCATE(dqvdf_x(klon,klev), dqvdf_w(klon,klev))
748      dqvdf_x = 0 ; dqvdf_w=0 ;   !ym missing init
749      ALLOCATE(pbl_tke_input(klon,klev+1,nbsrf))
750      ALLOCATE(t_therm(klon,klev), q_therm(klon,klev),u_therm(klon,klev), v_therm(klon,klev))
751      ALLOCATE(cdragh_x(klon), cdragh_w(klon))
752      ALLOCATE(cdragm_x(klon), cdragm_w(klon))
753      ALLOCATE(kh(klon), kh_x(klon), kh_w(klon))
754!
755      ALLOCATE(ptconv(klon,klev))
756      ALLOCATE(ratqsc(klon,klev))
757!
758      ALLOCATE(wbeff(klon), convoccur(klon), zmax_th(klon))
759      ALLOCATE(zq2m(klon), zt2m(klon), weak_inversion(klon))
760      ALLOCATE(zt2m_min_mon(klon), zt2m_max_mon(klon))
761      ALLOCATE(t2m_min_mon(klon), t2m_max_mon(klon))
762      ALLOCATE(zq2m_cor(klon), zt2m_cor(klon), zu10m_cor(klon), zv10m_cor(klon))
763      ALLOCATE(zrh2m_cor(klon), zqsat2m_cor(klon))
764      ALLOCATE(sens(klon), flwp(klon), fiwp(klon))
765      ALLOCATE(alp_bl_conv(klon), alp_bl_det(klon))
766      alp_bl_conv(:)=0 ;  alp_bl_det(:)=0
767      ALLOCATE(alp_bl_fluct_m(klon), alp_bl_fluct_tke(klon))
768      alp_bl_fluct_m(:)=0 ; alp_bl_fluct_tke(:)= 0.
769      ALLOCATE(alp_bl_stat(klon), n2(klon), s2(klon))
770      alp_bl_stat(:)=0
771      ALLOCATE(proba_notrig(klon), random_notrig(klon))
772      ALLOCATE(cv_gen(klon))
773
774      ALLOCATE(dnwd0(klon, klev))
775!      ALLOCATE(upwd(klon, klev), omega(klon, klev), coefh(klon, klev))
776      ALLOCATE(omega(klon, klev))
777      ALLOCATE(epmax_diag(klon)) ! epmax_cape
778!      ALLOCATE(coefm(klon, klev), lambda_th(klon, klev), cldemi(klon, klev))
779      ALLOCATE(lambda_th(klon, klev), cldemi(klon, klev))
780      ALLOCATE(cldfra(klon, klev), cldtau(klon, klev), fiwc(klon, klev))
781      ALLOCATE(fl(klon, klev), re(klon, klev), flwc(klon, klev))
782      ALLOCATE(ref_liq(klon, klev), ref_ice(klon, klev), theta(klon, klev))
783      ALLOCATE(ref_liq_pi(klon, klev), ref_ice_pi(klon, klev))
784      ALLOCATE(zphi(klon, klev), zx_rh(klon, klev))
785      ALLOCATE(pmfd(klon, klev), pmfu(klon, klev))
786
787      ALLOCATE(t2m(klon, nbsrf), fluxlat(klon, nbsrf))
788      ALLOCATE(fsollw(klon, nbsrf))
789      ALLOCATE(fsolsw(klon, nbsrf), wfbils(klon, nbsrf), wfbilo(klon, nbsrf))
790      ALLOCATE(wfevap(klon, nbsrf), wfrain(klon,nbsrf), wfsnow(klon, nbsrf))
791      ALLOCATE(evap_pot(klon, nbsrf))
792!
793!  Deep convective variables used in phytrac
794      ALLOCATE(pmflxr(klon, klev+1), pmflxs(klon, klev+1))
795      ALLOCATE(wdtrainA(klon,klev),wdtrainS(klon,klev),wdtrainM(klon,klev))
796      ALLOCATE(dnwd(klon, klev), upwd(klon, klev) )
797      ALLOCATE(ep(klon,klev))                          ! epmax_cape
798      ALLOCATE(da(klon,klev), mp(klon,klev) )
799      ALLOCATE(phi(klon,klev,klev) )
800      ALLOCATE(wght_cvfd(klon,klev) )
801      ALLOCATE(phi2(klon,klev,klev) )
802      ALLOCATE(d1a(klon,klev), dam(klon,klev))
803      ALLOCATE(ev(klon,klev) )
804      ALLOCATE(elij(klon,klev,klev) )
805      ALLOCATE(qtaa(klon,klev) )
806      ALLOCATE(clw(klon,klev) )
807      ALLOCATE(epmlmMm(klon,klev,klev), eplaMm(klon,klev) )
808      ALLOCATE(sij(klon,klev,klev) )
809
810      ALLOCATE(prfl(klon, klev+1))
811      ALLOCATE(psfl(klon, klev+1), fraca(klon, klev+1), Vprecip(klon, klev+1))
812      ALLOCATE(zw2(klon, klev+1))
813
814      ALLOCATE(fluxu(klon, klev, nbsrf), fluxv(klon, klev, nbsrf))
815      ALLOCATE(fluxt(klon, klev, nbsrf))
816
817      ALLOCATE(uwriteSTD(klon,nlevSTD,nfiles), vwriteSTD(klon,nlevSTD,nfiles))
818      ALLOCATE(wwriteSTD(klon,nlevSTD,nfiles), phiwriteSTD(klon,nlevSTD,nfiles))
819      ALLOCATE(qwriteSTD(klon,nlevSTD,nfiles), twriteSTD(klon,nlevSTD,nfiles))
820      ALLOCATE(rhwriteSTD(klon,nlevSTD,nfiles))
821
822! ug et d'autres encore:
823      ALLOCATE(beta_prec(klon,klev))
824      ALLOCATE(rneb(klon,klev),rnebjn(klon,klev),rneblsvol(klon,klev))
825
826
827      ALLOCATE (zxsnow(klon),snowhgt(klon),qsnow(klon),to_ice(klon))
828      ALLOCATE (sissnow(klon),runoff(klon),albsol3_lic(klon))
829
830      ALLOCATE (p_tropopause(klon))
831      ALLOCATE (z_tropopause(klon))
832      ALLOCATE (t_tropopause(klon))
833
834#ifdef CPP_StratAer
835      ALLOCATE (R2SO4(klon,klev))
836      ALLOCATE (DENSO4(klon,klev))
837      ALLOCATE (f_r_wet(klon,klev))
838      ALLOCATE (decfluxaer(klon,nbtr))
839      ALLOCATE (mdw(nbtr))
840      ALLOCATE (budg_3D_nucl(klon,klev))
841      ALLOCATE (budg_3D_cond_evap(klon,klev))
842      ALLOCATE (budg_3D_ocs_to_so2(klon,klev))
843      ALLOCATE (budg_3D_so2_to_h2so4(klon,klev))
844      ALLOCATE (budg_3D_backgr_ocs(klon,klev))
845      ALLOCATE (budg_3D_backgr_so2(klon,klev))
846      ALLOCATE (OCS_lifetime(klon,klev))
847      ALLOCATE (SO2_lifetime(klon,klev))
848      ALLOCATE (alpha_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave+nwave_lw,nbtr))
849      ALLOCATE (piz_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave+nwave_lw,nbtr))
850      ALLOCATE (cg_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave+nwave_lw,nbtr))
851      ALLOCATE (tau_strat_550(klon,klev))
852      ALLOCATE (tau_strat_1020(klon,klev))
853      ALLOCATE (tausum_strat(klon,3))
854      ALLOCATE (budg_dep_dry_ocs(klon))
855      ALLOCATE (budg_dep_wet_ocs(klon))
856      ALLOCATE (budg_dep_dry_so2(klon))
857      ALLOCATE (budg_dep_wet_so2(klon))
858      ALLOCATE (budg_dep_dry_h2so4(klon))
859      ALLOCATE (budg_dep_wet_h2so4(klon))
860      ALLOCATE (budg_dep_dry_part(klon))
861      ALLOCATE (budg_dep_wet_part(klon))
862      ALLOCATE (budg_emi_ocs(klon))
863      ALLOCATE (budg_emi_so2(klon))
864      ALLOCATE (budg_emi_h2so4(klon))
865      ALLOCATE (budg_emi_part(klon))
866      ALLOCATE (budg_ocs_to_so2(klon))
867      ALLOCATE (budg_so2_to_h2so4(klon))
868      ALLOCATE (budg_h2so4_to_part(klon))
869      ALLOCATE (budg_sed_part(klon))
870      ALLOCATE (surf_PM25_sulf(klon))
871      ALLOCATE (vsed_aer(klon,klev))
872#endif
873
874END SUBROUTINE phys_local_var_init
875
876!======================================================================
877SUBROUTINE phys_local_var_end
878USE dimphy
879USE indice_sol_mod
880IMPLICIT NONE
881      DEALLOCATE(t_seri,q_seri,ql_seri,qs_seri)
882      DEALLOCATE(u_seri,v_seri)
883      DEALLOCATE(l_mixmin,l_mix)
884
885      DEALLOCATE(tr_seri)
886      DEALLOCATE(d_t_dyn,d_q_dyn)
887      DEALLOCATE(d_ql_dyn,d_qs_dyn)
888      DEALLOCATE(d_q_dyn2d,d_ql_dyn2d,d_qs_dyn2d)
889      DEALLOCATE(d_u_dyn,d_v_dyn)
890      DEALLOCATE(d_tr_dyn)                      !RomP
891      DEALLOCATE(d_t_con,d_q_con)
892      DEALLOCATE(d_u_con,d_v_con)
893      DEALLOCATE(d_t_wake,d_q_wake)
894      DEALLOCATE(d_t_lsc,d_q_lsc)
895      DEALLOCATE(d_t_lwr,d_t_lw0)
896      DEALLOCATE(d_t_swr,d_t_sw0)
897      DEALLOCATE(d_ql_lsc,d_qi_lsc)
898      DEALLOCATE(d_t_ajsb,d_q_ajsb)
899      DEALLOCATE(d_t_ajs,d_q_ajs)
900!nrlmd<
901      DEALLOCATE(d_t_ajs_w,d_q_ajs_w)
902      DEALLOCATE(d_t_ajs_x,d_q_ajs_x)
903!>nrlmd
904      DEALLOCATE(d_u_ajs,d_v_ajs)
905      DEALLOCATE(d_t_eva,d_q_eva)
906      DEALLOCATE(d_ql_eva,d_qi_eva)
907      DEALLOCATE(d_t_lscst,d_q_lscst)
908      DEALLOCATE(d_t_lscth,d_q_lscth)
909      DEALLOCATE(plul_st,plul_th)
910      DEALLOCATE(d_t_vdf,d_q_vdf,d_t_diss)
911      DEALLOCATE(d_u_vdf,d_v_vdf)
912      DEALLOCATE(d_t_oli,d_t_oro)
913      DEALLOCATE(d_u_oli,d_v_oli)
914      DEALLOCATE(d_u_oro,d_v_oro)
915      DEALLOCATE(d_t_oro_gw)
916      DEALLOCATE(d_u_oro_gw,d_v_oro_gw)
917      DEALLOCATE(d_t_lif,d_t_ec)
918      DEALLOCATE(d_u_lif,d_v_lif)
919      DEALLOCATE(d_ts, d_tr)
920      DEALLOCATE(topswad_aero,solswad_aero)
921      DEALLOCATE(topswai_aero,solswai_aero)
922      DEALLOCATE(topswad0_aero,solswad0_aero)
923      DEALLOCATE(toplwad_aero,sollwad_aero)
924      DEALLOCATE(toplwai_aero,sollwai_aero)
925      DEALLOCATE(toplwad0_aero,sollwad0_aero)
926      DEALLOCATE(topsw_aero,solsw_aero)
927      DEALLOCATE(topsw0_aero,solsw0_aero)
928      DEALLOCATE(topswcf_aero,solswcf_aero)
929      DEALLOCATE(stratomask)
930      DEALLOCATE(tausum_aero)
931      DEALLOCATE(drytausum_aero)
932      DEALLOCATE(tau3d_aero)
933      DEALLOCATE(scdnc)
934      DEALLOCATE(dNovrN)
935      DEALLOCATE(cldncl)
936      DEALLOCATE(reffclwtop)
937      DEALLOCATE(lcc)
938      DEALLOCATE(reffclws)
939      DEALLOCATE(reffclwc)
940      DEALLOCATE(cldnvi)
941      DEALLOCATE(lcc3d)
942      DEALLOCATE(lcc3dcon)
943      DEALLOCATE(lcc3dstra)
944      DEALLOCATE(icc3dcon)
945      DEALLOCATE(icc3dstra)
946      DEALLOCATE(zfice)
947      DEALLOCATE(od443aer)
948      DEALLOCATE(od550aer)
949      DEALLOCATE(od865aer)
950      DEALLOCATE(dryod550aer)
951      DEALLOCATE(abs550aer)
952      DEALLOCATE(ec550aer)
953      DEALLOCATE(od550lt1aer)
954      DEALLOCATE(sconcso4)
955      DEALLOCATE(sconcno3)
956      DEALLOCATE(sconcoa)
957      DEALLOCATE(sconcbc)
958      DEALLOCATE(sconcss)
959      DEALLOCATE(sconcdust)
960      DEALLOCATE(concso4)
961      DEALLOCATE(concno3)
962      DEALLOCATE(concoa)
963      DEALLOCATE(concbc)
964      DEALLOCATE(concss)
965      DEALLOCATE(concdust)
966      DEALLOCATE(loadso4)
967      DEALLOCATE(loadoa)
968      DEALLOCATE(loadbc)
969      DEALLOCATE(loadss)
970      DEALLOCATE(loaddust)
971      DEALLOCATE(loadno3)
972      DEALLOCATE(load_tmp1)
973      DEALLOCATE(load_tmp2)
974      DEALLOCATE(load_tmp3)
975      DEALLOCATE(load_tmp4)
976      DEALLOCATE(load_tmp5)
977      DEALLOCATE(load_tmp6)
978      DEALLOCATE(load_tmp7)
979      DEALLOCATE(load_tmp8)
980      DEALLOCATE(load_tmp9)
981      DEALLOCATE(load_tmp10)
982      DEALLOCATE(du_gwd_hines,dv_gwd_hines,d_t_hin)
983      DEALLOCATE(d_q_ch4)
984      DEALLOCATE(dv_gwd_rando,dv_gwd_front)
985      DEALLOCATE(east_gwstress,west_gwstress)
986
987!IM ajout variables CFMIP2/CMIP5
988      DEALLOCATE(topswad_aerop, solswad_aerop)
989      DEALLOCATE(topswai_aerop, solswai_aerop)
990      DEALLOCATE(topswad0_aerop, solswad0_aerop)
991      DEALLOCATE(topsw_aerop, topsw0_aerop)
992      DEALLOCATE(solsw_aerop, solsw0_aerop)
993      DEALLOCATE(topswcf_aerop, solswcf_aerop)
994
995!CK LW diagnostics
996      DEALLOCATE(toplwad_aerop, sollwad_aerop)
997      DEALLOCATE(toplwai_aerop, sollwai_aerop)
998      DEALLOCATE(toplwad0_aerop, sollwad0_aerop)
999
1000! FH Ajout de celles necessaires au phys_output_write_mod
1001      DEALLOCATE(tal1, pal1, pab1, pab2)
1002      DEALLOCATE(ptstar, pt0, slp)
1003!
1004      DEALLOCATE(alp_wake)
1005      DEALLOCATE(wake_h,wake_k)
1006      DEALLOCATE(wake_omg)
1007      DEALLOCATE(d_deltat_wk, d_deltaq_wk)
1008      DEALLOCATE(d_s_wk, d_dens_a_wk, d_dens_wk)
1009      DEALLOCATE(d_deltat_wk_gw, d_deltaq_wk_gw)
1010      DEALLOCATE(d_deltat_vdf, d_deltaq_vdf)
1011!!      DEALLOCATE( d_s_vdf, d_dens_vdf)
1012      DEALLOCATE(d_deltat_the, d_deltaq_the)
1013!!      DEALLOCATE( d_s_the, d_dens_the)
1014      DEALLOCATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)
1015!
1016      DEALLOCATE(bils)
1017      DEALLOCATE(cdragm, cdragh, cldh, cldl)
1018      DEALLOCATE(cldm, cldq, cldt, qsat2m)
1019      DEALLOCATE(cldljn, cldmjn, cldhjn, cldtjn, JrNt)
1020      DEALLOCATE(dthmin, evap, fder, plcl, plfc)
1021      DEALLOCATE(prw, prlw, prsw, zustar, zu10m, zv10m, rh2m, s_lcl)
1022      DEALLOCATE(s_pblh, s_pblt, s_therm)
1023!
1024!nrlmd+jyg<
1025      DEALLOCATE(s_pblh_x, s_pblh_w)
1026      DEALLOCATE(s_lcl_x, s_lcl_w)
1027!>nrlmd+jyg
1028!
1029      DEALLOCATE(slab_wfbils, tpot, tpote, ue)
1030      DEALLOCATE(uq, ve, vq, zxffonte)
1031      DEALLOCATE(uwat, vwat)
1032      DEALLOCATE(zxfqcalving, zxfluxlat)
1033      DEALLOCATE(zxrunofflic)
1034      DEALLOCATE(zxtsol, snow_lsc, zxfqfonte, zxqsurf)
1035      DEALLOCATE(rain_lsc)
1036      DEALLOCATE(rain_num)
1037!
1038      DEALLOCATE(sens_x, sens_w)
1039      DEALLOCATE(zxfluxlat_x, zxfluxlat_w)
1040!jyg<
1041!!      DEALLOCATE(t_x, t_w)
1042!!      DEALLOCATE(q_x, q_w)
1043!>jyg
1044      DEALLOCATE(d_t_vdf_x, d_t_vdf_w)
1045      DEALLOCATE(d_q_vdf_x, d_q_vdf_w)
1046      DEALLOCATE(pbl_tke_input)
1047      DEALLOCATE(t_therm, q_therm, u_therm, v_therm)
1048      DEALLOCATE(cdragh_x, cdragh_w)
1049      DEALLOCATE(cdragm_x, cdragm_w)
1050      DEALLOCATE(kh, kh_x, kh_w)
1051!
1052      DEALLOCATE(ptconv)
1053      DEALLOCATE(ratqsc)
1054!
1055      DEALLOCATE(wbeff, convoccur, zmax_th)
1056      DEALLOCATE(zq2m, zt2m, weak_inversion)
1057      DEALLOCATE(zt2m_min_mon, zt2m_max_mon)
1058      DEALLOCATE(t2m_min_mon, t2m_max_mon)
1059      DEALLOCATE(zq2m_cor, zt2m_cor, zu10m_cor, zv10m_cor)
1060      DEALLOCATE(zrh2m_cor, zqsat2m_cor)
1061      DEALLOCATE(sens, flwp, fiwp)
1062      DEALLOCATE(alp_bl_conv,alp_bl_det)
1063      DEALLOCATE(alp_bl_fluct_m,alp_bl_fluct_tke)
1064      DEALLOCATE(alp_bl_stat, n2, s2)
1065      DEALLOCATE(proba_notrig, random_notrig)
1066      DEALLOCATE(cv_gen)
1067
1068      DEALLOCATE(dnwd0)
1069!      DEALLOCATE(upwd, omega, coefh)
1070      DEALLOCATE(omega)
1071      DEALLOCATE(epmax_diag)
1072!      DEALLOCATE(coefm, lambda_th, cldemi)
1073      DEALLOCATE(lambda_th, cldemi)
1074      DEALLOCATE(cldfra, cldtau, fiwc)
1075      DEALLOCATE(fl, re, flwc)
1076      DEALLOCATE(ref_liq, ref_ice, theta)
1077      DEALLOCATE(ref_liq_pi, ref_ice_pi)
1078      DEALLOCATE(zphi, zx_rh)
1079      DEALLOCATE(pmfd, pmfu)
1080
1081      DEALLOCATE(t2m, fluxlat)
1082      DEALLOCATE(fsollw, evap_pot)
1083      DEALLOCATE(fsolsw, wfbils, wfbilo)
1084      DEALLOCATE(wfevap,wfrain,wfsnow)
1085
1086      DEALLOCATE(pmflxr, pmflxs)
1087      DEALLOCATE(wdtrainA, wdtrainS, wdtrainM)
1088      DEALLOCATE(upwd, dnwd)
1089      DEALLOCATE(ep)
1090      DEALLOCATE(da, mp )
1091      DEALLOCATE(phi )
1092      DEALLOCATE(wght_cvfd )
1093      DEALLOCATE(phi2 )
1094      DEALLOCATE(d1a, dam)
1095      DEALLOCATE(ev )
1096      DEALLOCATE(elij )
1097      DEALLOCATE(qtaa )
1098      DEALLOCATE(clw )
1099      DEALLOCATE(epmlmMm, eplaMm )
1100      DEALLOCATE(sij )
1101
1102
1103      DEALLOCATE(prfl, psfl, fraca, Vprecip)
1104      DEALLOCATE(zw2)
1105
1106      DEALLOCATE(fluxu, fluxv)
1107      DEALLOCATE(fluxt)
1108
1109      DEALLOCATE(uwriteSTD, vwriteSTD)
1110      DEALLOCATE(wwriteSTD, phiwriteSTD)
1111      DEALLOCATE(qwriteSTD, twriteSTD, rhwriteSTD)
1112
1113! ug et d'autres encore:
1114      DEALLOCATE(beta_prec)
1115      DEALLOCATE(rneb)
1116      DEALLOCATE (zxsnow,snowhgt,qsnow,to_ice,sissnow,runoff,albsol3_lic)
1117
1118      DEALLOCATE (p_tropopause)
1119      DEALLOCATE (z_tropopause)
1120      DEALLOCATE (t_tropopause)
1121
1122#ifdef CPP_StratAer
1123! variables for strat. aerosol CK
1124      DEALLOCATE (R2SO4)
1125      DEALLOCATE (DENSO4)
1126      DEALLOCATE (f_r_wet)
1127      DEALLOCATE (decfluxaer)
1128      DEALLOCATE (mdw)
1129      DEALLOCATE (SO2_lifetime)
1130      DEALLOCATE (OCS_lifetime)
1131      DEALLOCATE (alpha_bin)
1132      DEALLOCATE (piz_bin)
1133      DEALLOCATE (cg_bin)
1134      DEALLOCATE (tau_strat_550)
1135      DEALLOCATE (tau_strat_1020)
1136      DEALLOCATE (tausum_strat)
1137      DEALLOCATE (surf_PM25_sulf)
1138      DEALLOCATE (vsed_aer)
1139      DEALLOCATE (budg_3D_ocs_to_so2)
1140      DEALLOCATE (budg_3D_so2_to_h2so4)
1141      DEALLOCATE (budg_3D_backgr_ocs)
1142      DEALLOCATE (budg_3D_backgr_so2)
1143      DEALLOCATE (budg_3D_nucl)
1144      DEALLOCATE (budg_3D_cond_evap)
1145      DEALLOCATE (budg_dep_dry_ocs)
1146      DEALLOCATE (budg_dep_wet_ocs)
1147      DEALLOCATE (budg_dep_dry_so2)
1148      DEALLOCATE (budg_dep_wet_so2)
1149      DEALLOCATE (budg_dep_dry_h2so4)
1150      DEALLOCATE (budg_dep_wet_h2so4)
1151      DEALLOCATE (budg_dep_dry_part)
1152      DEALLOCATE (budg_dep_wet_part)
1153      DEALLOCATE (budg_emi_ocs)
1154      DEALLOCATE (budg_emi_so2)
1155      DEALLOCATE (budg_emi_h2so4)
1156      DEALLOCATE (budg_emi_part)
1157      DEALLOCATE (budg_ocs_to_so2)
1158      DEALLOCATE (budg_so2_to_h2so4)
1159      DEALLOCATE (budg_h2so4_to_part)
1160      DEALLOCATE (budg_sed_part)
1161#endif
1162
1163END SUBROUTINE phys_local_var_end
1164
1165END MODULE phys_local_var_mod
Note: See TracBrowser for help on using the repository browser.