source: LMDZ6/branches/LMDZ-tracers/libf/phylmd/phys_local_var_mod.F90 @ 3871

Last change on this file since 3871 was 3851, checked in by dcugnet, 4 years ago

Update the branch to the current trunk.

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