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

Last change on this file since 5134 was 5131, checked in by acozic, 5 months ago

update to write mass flow files in physiq - work begin with rev[4608]

  • 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 Id
File size: 72.8 KB
Line 
1!
2! $Id: phys_local_var_mod.F90 5131 2024-07-26 07:43:31Z abarral $
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! SN 15/07/2024 ISO 4D
17      REAL, SAVE, ALLOCATABLE :: qx_seri(:,:,:)
18      !$OMP THREADPRIVATE(qx_seri)
19! SN
20      REAL, SAVE, ALLOCATABLE :: qbs_seri(:,:)
21      !$OMP THREADPRIVATE(qbs_seri)
22      REAL, SAVE, ALLOCATABLE :: u_seri(:,:), v_seri(:,:)
23      !$OMP THREADPRIVATE(u_seri, v_seri)
24      REAL, SAVE, ALLOCATABLE :: rneb_seri(:,:)
25      !$OMP THREADPRIVATE(rneb_seri)
26      REAL, SAVE, ALLOCATABLE :: d_rneb_dyn(:,:)
27      !$OMP THREADPRIVATE(d_rneb_dyn)
28      REAL, SAVE, ALLOCATABLE :: l_mixmin(:,:,:),l_mix(:,:,:),wprime(:,:,:)
29      !$OMP THREADPRIVATE(l_mixmin, l_mix, wprime)
30      REAL, SAVE, ALLOCATABLE :: pbl_eps(:,:,:)
31      !$OMP THREADPRIVATE(pbl_eps)
32      REAL, SAVE, ALLOCATABLE :: tke_shear(:,:,:), tke_buoy(:,:,:), tke_trans(:,:,:)
33      !$OMP THREADPRIVATE(tke_shear,tke_buoy,tke_trans)
34      REAL, SAVE, ALLOCATABLE :: tr_seri(:,:,:)
35      !$OMP THREADPRIVATE(tr_seri)
36      REAL, SAVE, ALLOCATABLE :: rhcl(:,:)
37      !$OMP THREADPRIVATE(rhcl)
38      REAL, SAVE, ALLOCATABLE :: d_t_dyn(:,:), d_q_dyn(:,:)
39      !$OMP THREADPRIVATE(d_t_dyn, d_q_dyn)
40      REAL, SAVE, ALLOCATABLE :: d_ql_dyn(:,:), d_qs_dyn(:,:), d_qbs_dyn(:,:)
41      !$OMP THREADPRIVATE(d_ql_dyn, d_qs_dyn, d_qbs_dyn)
42      REAL, SAVE, ALLOCATABLE :: d_q_dyn2d(:), d_ql_dyn2d(:), d_qs_dyn2d(:), d_qbs_dyn2d(:)
43      !$OMP THREADPRIVATE(d_q_dyn2d, d_ql_dyn2d, d_qs_dyn2d, d_qbs_dyn2d)
44      REAL, SAVE, ALLOCATABLE :: d_u_dyn(:,:), d_v_dyn(:,:)
45      !$OMP THREADPRIVATE(d_u_dyn, d_v_dyn)
46      REAL, SAVE, ALLOCATABLE :: d_tr_dyn(:,:,:)
47      !$OMP THREADPRIVATE(d_tr_dyn)
48      REAL, SAVE, ALLOCATABLE :: d_t_con(:,:),d_q_con(:,:),d_q_con_zmasse(:,:)
49      !$OMP THREADPRIVATE(d_t_con,d_q_con,d_q_con_zmasse)
50      REAL, SAVE, ALLOCATABLE :: d_u_con(:,:),d_v_con(:,:)
51      !$OMP THREADPRIVATE(d_u_con,d_v_con)
52      REAL, SAVE, ALLOCATABLE :: d_t_wake(:,:),d_q_wake(:,:)
53      !$OMP THREADPRIVATE( d_t_wake,d_q_wake)
54      REAL, SAVE, ALLOCATABLE :: d_t_lsc(:,:),d_q_lsc(:,:),d_ql_lsc(:,:),d_qi_lsc(:,:)
55      !$OMP THREADPRIVATE(d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc)
56      REAL, SAVE, ALLOCATABLE :: d_t_lwr(:,:),d_t_lw0(:,:),d_t_swr(:,:),d_t_sw0(:,:)
57      !$OMP THREADPRIVATE(d_t_lwr,d_t_lw0,d_t_swr,d_t_sw0)
58      REAL, SAVE, ALLOCATABLE :: d_t_ajsb(:,:), d_q_ajsb(:,:)
59      !$OMP THREADPRIVATE(d_t_ajsb, d_q_ajsb)
60      REAL, SAVE, ALLOCATABLE :: d_t_ajs(:,:), d_q_ajs(:,:)
61      !$OMP THREADPRIVATE(d_t_ajs, d_q_ajs)
62      REAL, SAVE, ALLOCATABLE :: d_u_ajs(:,:), d_v_ajs(:,:)
63      !$OMP THREADPRIVATE(d_u_ajs, d_v_ajs)
64!nrlmd<
65      REAL, SAVE, ALLOCATABLE :: d_t_ajs_w(:,:), d_q_ajs_w(:,:)
66      !$OMP THREADPRIVATE(d_t_ajs_w, d_q_ajs_w)
67      REAL, SAVE, ALLOCATABLE :: d_t_ajs_x(:,:), d_q_ajs_x(:,:)
68      !$OMP THREADPRIVATE(d_t_ajs_x, d_q_ajs_x)
69!>nrlmd
70      REAL, SAVE, ALLOCATABLE :: d_t_eva(:,:),d_q_eva(:,:),d_ql_eva(:,:),d_qi_eva(:,:)
71      !$OMP THREADPRIVATE(d_t_eva,d_q_eva,d_ql_eva,d_qi_eva)
72! SN 15/07/2024 ISO 4D
73      REAL, SAVE, ALLOCATABLE :: d_qx_eva(:,:,:)
74      !$OMP THREADPRIVATE(d_qx_eva)
75! SN
76      REAL, SAVE, ALLOCATABLE :: d_t_lscst(:,:),d_q_lscst(:,:)
77      !$OMP THREADPRIVATE(d_t_lscst,d_q_lscst)
78      REAL, SAVE, ALLOCATABLE :: d_t_lscth(:,:),d_q_lscth(:,:)
79      !$OMP THREADPRIVATE(d_t_lscth,d_q_lscth)
80      REAL, SAVE, ALLOCATABLE :: plul_th(:),plul_st(:)
81      !$OMP THREADPRIVATE(plul_th,plul_st)
82!tendances dues a oro et lif
83      REAL, SAVE, ALLOCATABLE :: d_t_oli(:,:)
84      !$OMP THREADPRIVATE(d_t_oli)
85      REAL, SAVE, ALLOCATABLE :: d_u_oli(:,:), d_v_oli(:,:)
86      !$OMP THREADPRIVATE(d_u_oli, d_v_oli)
87      REAL, SAVE, ALLOCATABLE :: d_t_vdf(:,:), d_q_vdf(:,:), d_qbs_vdf(:,:), d_t_diss(:,:)
88      !$OMP THREADPRIVATE( d_t_vdf, d_q_vdf, d_qbs_vdf, d_t_diss)
89      REAL, SAVE, ALLOCATABLE :: d_u_vdf(:,:), d_v_vdf(:,:)
90      !$OMP THREADPRIVATE(d_u_vdf, d_v_vdf)
91!nrlmd+jyg<
92      REAL, SAVE, ALLOCATABLE :: d_t_vdf_w(:,:), d_q_vdf_w(:,:)
93      !$OMP THREADPRIVATE( d_t_vdf_w, d_q_vdf_w)
94      REAL, SAVE, ALLOCATABLE :: d_t_vdf_x(:,:), d_q_vdf_x(:,:)
95      !$OMP THREADPRIVATE( d_t_vdf_x, d_q_vdf_x)
96      REAL, SAVE, ALLOCATABLE :: d_t_bsss(:,:), d_q_bsss(:,:), d_qbs_bsss(:,:)
97      !$OMP THREADPRIVATE( d_t_bsss,d_q_bsss, d_qbs_bsss)
98!>nrlmd+jyg
99      REAL, SAVE, ALLOCATABLE :: d_t_oro(:,:)
100      !$OMP THREADPRIVATE(d_t_oro)
101      REAL, SAVE, ALLOCATABLE :: d_u_oro(:,:), d_v_oro(:,:)
102      !$OMP THREADPRIVATE(d_u_oro, d_v_oro)
103      REAL, SAVE, ALLOCATABLE :: d_t_oro_gw(:,:)
104      !$OMP THREADPRIVATE(d_t_oro_gw)
105      REAL, SAVE, ALLOCATABLE :: d_u_oro_gw(:,:), d_v_oro_gw(:,:)
106      !$OMP THREADPRIVATE(d_u_oro_gw, d_v_oro_gw)
107      REAL, SAVE, ALLOCATABLE :: d_t_lif(:,:)
108      !$OMP THREADPRIVATE(d_t_lif)
109      REAL, SAVE, ALLOCATABLE :: d_u_lif(:,:), d_v_lif(:,:)
110      !$OMP THREADPRIVATE(d_u_lif, d_v_lif)
111! Tendances Ondes de G non oro (runs strato).
112      REAL, SAVE, ALLOCATABLE :: du_gwd_hines(:,:)
113      !$OMP THREADPRIVATE(du_gwd_hines)
114      REAL, SAVE, ALLOCATABLE :: dv_gwd_hines(:,:)
115      !$OMP THREADPRIVATE(dv_gwd_hines)
116      REAL, SAVE, ALLOCATABLE :: dv_gwd_rando(:,:)
117      !$OMP THREADPRIVATE(dv_gwd_rando)
118      REAL, SAVE, ALLOCATABLE :: dv_gwd_front(:,:)
119      !$OMP THREADPRIVATE(dv_gwd_front)
120      REAL, SAVE, ALLOCATABLE :: east_gwstress(:,:)
121      !$OMP THREADPRIVATE(east_gwstress)
122      REAL, SAVE, ALLOCATABLE :: west_gwstress(:,:)
123      !$OMP THREADPRIVATE(west_gwstress)
124      REAL, SAVE, ALLOCATABLE :: d_t_hin(:,:)
125      !$OMP THREADPRIVATE(d_t_hin)
126! tendance due a l'oxydation du methane
127      REAL, SAVE, ALLOCATABLE :: d_q_ch4(:,:)
128      !$OMP THREADPRIVATE(d_q_ch4)
129#ifdef ISO
130      REAL, SAVE, ALLOCATABLE :: xt_seri(:,:,:)
131      !$OMP THREADPRIVATE( xt_seri)
132      REAL, SAVE, ALLOCATABLE :: xtl_seri(:,:,:)
133      !$OMP THREADPRIVATE( xtl_seri)
134      REAL, SAVE, ALLOCATABLE :: xts_seri(:,:,:)
135      !$OMP THREADPRIVATE( xts_seri)
136      REAL, SAVE, ALLOCATABLE :: xtbs_seri(:,:,:)
137      !$OMP THREADPRIVATE( xtbs_seri)
138      REAL, SAVE, ALLOCATABLE :: d_xt_eva(:,:,:)
139      !$OMP THREADPRIVATE( d_xt_eva)
140      REAL, SAVE, ALLOCATABLE :: d_xtl_eva(:,:,:)
141      !$OMP THREADPRIVATE( d_xtl_eva)
142      REAL, SAVE, ALLOCATABLE :: d_xti_eva(:,:,:)
143      !$OMP THREADPRIVATE( d_xti_eva)
144      REAL, SAVE, ALLOCATABLE :: d_xt_vdf(:,:,:)
145      !$OMP THREADPRIVATE( d_xt_vdf)
146      REAL, SAVE, ALLOCATABLE :: d_xt_dyn(:,:,:)
147      !$OMP THREADPRIVATE( d_xt_dyn)
148      REAL, SAVE, ALLOCATABLE :: d_xtl_dyn(:,:,:), d_xts_dyn(:,:,:), d_xtbs_dyn(:,:,:)
149      !$OMP THREADPRIVATE(d_xtl_dyn, d_xts_dyn, d_xtbs_dyn)
150      REAL, SAVE, ALLOCATABLE :: d_xt_con(:,:,:)
151      !$OMP THREADPRIVATE( d_xt_con)
152      REAL, SAVE, ALLOCATABLE :: d_xt_wake(:,:,:)
153      !$OMP THREADPRIVATE( d_xt_wake)
154      REAL, SAVE, ALLOCATABLE :: d_xt_lsc(:,:,:),d_xtl_lsc(:,:,:),d_xti_lsc(:,:,:)
155      !$OMP THREADPRIVATE( d_xt_lsc,d_xtl_lsc,d_xti_lsc)
156      REAL, SAVE, ALLOCATABLE :: d_xt_ajsb(:,:,:)
157      !$OMP THREADPRIVATE( d_xt_ajsb)
158      REAL, SAVE, ALLOCATABLE :: d_xt_ajs(:,:,:)
159      !$OMP THREADPRIVATE( d_xt_ajs)
160      REAL, SAVE, ALLOCATABLE :: d_xt_ajs_w(:,:,:), d_xt_ajs_x(:,:,:)
161      !$OMP THREADPRIVATE(d_xt_ajs_w, d_xt_ajs_x)
162      REAL, SAVE, ALLOCATABLE :: d_xt_vdf_w(:,:,:), d_xt_vdf_x(:,:,:)
163      !$OMP THREADPRIVATE(d_xt_vdf_w, d_xt_vdf_x)
164      REAL, SAVE, ALLOCATABLE :: d_xt_ch4(:,:,:)
165      !$OMP THREADPRIVATE( d_xt_ch4)
166      REAL, SAVE, ALLOCATABLE :: d_xt_prod_nucl(:,:,:)
167      !$OMP THREADPRIVATE( d_xt_prod_nucl)
168      REAL, SAVE, ALLOCATABLE :: d_xt_cosmo(:,:,:)
169      !$OMP THREADPRIVATE( d_xt_cosmo)
170      REAL, SAVE, ALLOCATABLE :: d_xt_decroiss(:,:,:)
171      !$OMP THREADPRIVATE( d_xt_decroiss)
172#endif
173
174! tendance du a la conersion Ec -> E thermique
175      REAL, SAVE, ALLOCATABLE :: d_t_ec(:,:)
176      !$OMP THREADPRIVATE(d_t_ec)
177      REAL, SAVE, ALLOCATABLE :: d_ts(:,:), d_tr(:,:,:)
178      !$OMP THREADPRIVATE(d_ts, d_tr)
179
180! diagnostique pour le rayonnement
181      REAL, SAVE, ALLOCATABLE :: topswad_aero(:),  solswad_aero(:)      ! diag
182      !$OMP THREADPRIVATE(topswad_aero,solswad_aero)
183      REAL, SAVE, ALLOCATABLE :: topswai_aero(:),  solswai_aero(:)      ! diag
184      !$OMP THREADPRIVATE(topswai_aero,solswai_aero)
185      REAL, SAVE, ALLOCATABLE :: topswad0_aero(:), solswad0_aero(:)     ! diag
186      !$OMP THREADPRIVATE(topswad0_aero,solswad0_aero)
187      REAL, SAVE, ALLOCATABLE :: topsw_aero(:,:),  solsw_aero(:,:)      ! diag
188      !$OMP THREADPRIVATE(topsw_aero,solsw_aero)
189      REAL, SAVE, ALLOCATABLE :: topsw0_aero(:,:), solsw0_aero(:,:)     ! diag
190      !$OMP THREADPRIVATE(topsw0_aero,solsw0_aero)
191      REAL, SAVE, ALLOCATABLE :: topswcf_aero(:,:),  solswcf_aero(:,:)  ! diag
192      !$OMP THREADPRIVATE(topswcf_aero,solswcf_aero)
193! LW radiation diagnostics CK
194      REAL, SAVE, ALLOCATABLE :: toplwad_aero(:),  sollwad_aero(:)      ! diag
195      !$OMP THREADPRIVATE(toplwad_aero,sollwad_aero)
196      REAL, SAVE, ALLOCATABLE :: toplwai_aero(:),  sollwai_aero(:)      ! diag
197      !$OMP THREADPRIVATE(toplwai_aero,sollwai_aero)
198      REAL, SAVE, ALLOCATABLE :: toplwad0_aero(:), sollwad0_aero(:)     ! diag
199      !$OMP THREADPRIVATE(toplwad0_aero,sollwad0_aero)
200! Special RRTM
201      REAL, SAVE, ALLOCATABLE :: ZLWFT0_i(:,:),  ZSWFT0_i(:,:)      ! diag
202      !$OMP THREADPRIVATE(ZLWFT0_i,ZSWFT0_i)
203      REAL, SAVE, ALLOCATABLE :: ZFLDN0(:,:),  ZFLUP0(:,:)      ! diag
204      !$OMP THREADPRIVATE(ZFLDN0,ZFLUP0)
205      REAL, SAVE, ALLOCATABLE :: ZFSDN0(:,:),  ZFSUP0(:,:)      ! diag
206      !$OMP THREADPRIVATE(ZFSDN0,ZFSUP0)
207!
208      REAL, SAVE, ALLOCATABLE :: stratomask(:,:)
209      !$OMP THREADPRIVATE(stratomask)
210      REAL, SAVE, ALLOCATABLE :: tausum_aero(:,:,:)
211      !$OMP THREADPRIVATE(tausum_aero)
212      REAL, SAVE, ALLOCATABLE :: drytausum_aero(:,:)
213      !$OMP THREADPRIVATE(drytausum_aero)
214      REAL, SAVE, ALLOCATABLE :: tau3d_aero(:,:,:,:)
215      !$OMP THREADPRIVATE(tau3d_aero)
216      REAL, SAVE, ALLOCATABLE :: dNovrN(:)
217      !$OMP THREADPRIVATE(dNovrN)
218      REAL, SAVE, ALLOCATABLE :: zfice(:,:)
219      !$OMP THREADPRIVATE(zfice)
220      REAL, SAVE, ALLOCATABLE :: od443aer(:)
221      !$OMP THREADPRIVATE(od443aer)
222      REAL, SAVE, ALLOCATABLE :: od550aer(:)
223      !$OMP THREADPRIVATE(od550aer)
224      REAL, SAVE, ALLOCATABLE :: dryod550aer(:)
225      !$OMP THREADPRIVATE(dryod550aer)
226      REAL, SAVE, ALLOCATABLE :: abs550aer(:)
227      !$OMP THREADPRIVATE(abs550aer)
228      REAL, SAVE, ALLOCATABLE :: od865aer(:)
229      !$OMP THREADPRIVATE(od865aer)
230      REAL, SAVE, ALLOCATABLE :: ec550aer(:,:)
231      !$OMP THREADPRIVATE(ec550aer)
232      REAL, SAVE, ALLOCATABLE :: od550lt1aer(:)
233      !$OMP THREADPRIVATE(od550lt1aer)
234      REAL, SAVE, ALLOCATABLE :: sconcso4(:)
235      !$OMP THREADPRIVATE(sconcso4)
236      REAL, SAVE, ALLOCATABLE :: sconcno3(:)
237      !$OMP THREADPRIVATE(sconcno3)
238      REAL, SAVE, ALLOCATABLE :: sconcoa(:)
239      !$OMP THREADPRIVATE(sconcoa)
240      REAL, SAVE, ALLOCATABLE :: sconcbc(:)
241      !$OMP THREADPRIVATE(sconcbc)
242      REAL, SAVE, ALLOCATABLE :: sconcss(:)
243      !$OMP THREADPRIVATE(sconcss)
244      REAL, SAVE, ALLOCATABLE :: sconcdust(:)
245      !$OMP THREADPRIVATE(sconcdust)
246      REAL, SAVE, ALLOCATABLE :: concso4(:,:)
247      !$OMP THREADPRIVATE(concso4)
248      REAL, SAVE, ALLOCATABLE :: concno3(:,:)
249      !$OMP THREADPRIVATE(concno3)
250      REAL, SAVE, ALLOCATABLE :: concoa(:,:)
251      !$OMP THREADPRIVATE(concoa)
252      REAL, SAVE, ALLOCATABLE :: concbc(:,:)
253      !$OMP THREADPRIVATE(concbc)
254      REAL, SAVE, ALLOCATABLE :: concss(:,:)
255      !$OMP THREADPRIVATE(concss)
256      REAL, SAVE, ALLOCATABLE :: concdust(:,:)
257      !$OMP THREADPRIVATE(concdust)
258      REAL, SAVE, ALLOCATABLE :: loadso4(:)
259      !$OMP THREADPRIVATE(loadso4)
260      REAL, SAVE, ALLOCATABLE :: loadoa(:)
261      !$OMP THREADPRIVATE(loadoa)
262      REAL, SAVE, ALLOCATABLE :: loadbc(:)
263      !$OMP THREADPRIVATE(loadbc)
264      REAL, SAVE, ALLOCATABLE :: loadss(:)
265      !$OMP THREADPRIVATE(loadss)
266      REAL, SAVE, ALLOCATABLE :: loaddust(:)
267      !$OMP THREADPRIVATE(loaddust)
268      REAL, SAVE, ALLOCATABLE :: loadno3(:)
269      !$OMP THREADPRIVATE(loadno3)
270      REAL, SAVE, ALLOCATABLE :: load_tmp1(:), load_tmp2(:)
271      !$OMP THREADPRIVATE(load_tmp1, load_tmp2)
272      REAL, SAVE, ALLOCATABLE :: load_tmp3(:), load_tmp4(:)
273      !$OMP THREADPRIVATE(load_tmp3, load_tmp4)
274      REAL, SAVE, ALLOCATABLE :: load_tmp5(:), load_tmp6(:)
275      !$OMP THREADPRIVATE(load_tmp5, load_tmp6)
276      REAL, SAVE, ALLOCATABLE :: load_tmp7(:), load_tmp8(:)
277      !$OMP THREADPRIVATE(load_tmp7, load_tmp8)
278      REAL, SAVE, ALLOCATABLE :: load_tmp9(:), load_tmp10(:)
279      !$OMP THREADPRIVATE(load_tmp9, load_tmp10)
280
281!IM ajout variables CFMIP2/CMIP5
282      REAL,ALLOCATABLE,SAVE :: topswad_aerop(:), solswad_aerop(:)
283!$OMP THREADPRIVATE(topswad_aerop, solswad_aerop)
284      REAL,ALLOCATABLE,SAVE :: topswai_aerop(:), solswai_aerop(:)
285!$OMP THREADPRIVATE(topswai_aerop, solswai_aerop)
286      REAL,ALLOCATABLE,SAVE :: topswad0_aerop(:), solswad0_aerop(:)
287!$OMP THREADPRIVATE(topswad0_aerop, solswad0_aerop)
288      REAL,ALLOCATABLE,SAVE :: topsw_aerop(:,:), topsw0_aerop(:,:) 
289!$OMP THREADPRIVATE(topsw_aerop, topsw0_aerop)
290      REAL,ALLOCATABLE,SAVE :: solsw_aerop(:,:), solsw0_aerop(:,:)
291!$OMP THREADPRIVATE(solsw_aerop, solsw0_aerop)
292      REAL,ALLOCATABLE,SAVE :: topswcf_aerop(:,:), solswcf_aerop(:,:)
293!$OMP THREADPRIVATE(topswcf_aerop, solswcf_aerop)
294
295! additional LW variables CK
296      REAL,ALLOCATABLE,SAVE :: toplwad_aerop(:), sollwad_aerop(:)
297!$OMP THREADPRIVATE(toplwad_aerop, sollwad_aerop)
298      REAL,ALLOCATABLE,SAVE :: toplwai_aerop(:), sollwai_aerop(:)
299!$OMP THREADPRIVATE(toplwai_aerop, sollwai_aerop)
300      REAL,ALLOCATABLE,SAVE :: toplwad0_aerop(:), sollwad0_aerop(:)
301!$OMP THREADPRIVATE(toplwad0_aerop, sollwad0_aerop)
302
303!AI 08 2023 ajout pour Ecrad
304      REAL,ALLOCATABLE,SAVE :: topswad_aero_s2(:), solswad_aero_s2(:)
305!$OMP THREADPRIVATE(topswad_aero_s2, solswad_aero_s2)
306      REAL,ALLOCATABLE,SAVE :: topswai_aero_s2(:), solswai_aero_s2(:)
307!$OMP THREADPRIVATE(topswai_aero_s2, solswai_aero_s2)
308      REAL,ALLOCATABLE,SAVE :: topswad0_aero_s2(:), solswad0_aero_s2(:)
309!$OMP THREADPRIVATE(topswad0_aero_s2, solswad0_aero_s2)
310      REAL,ALLOCATABLE,SAVE :: topsw_aero_s2(:,:), topsw0_aero_s2(:,:)
311!$OMP THREADPRIVATE(topsw_aero_s2, topsw0_aero_s2)
312      REAL,ALLOCATABLE,SAVE :: solsw_aero_s2(:,:), solsw0_aero_s2(:,:)
313!$OMP THREADPRIVATE(solsw_aero_s2, solsw0_aero_s2)
314      REAL,ALLOCATABLE,SAVE :: topswcf_aero_s2(:,:), solswcf_aero_s2(:,:)
315!$OMP THREADPRIVATE(topswcf_aero_s2, solswcf_aero_s2)
316! additional LW variables CK
317      REAL,ALLOCATABLE,SAVE :: toplwad_aero_s2(:), sollwad_aero_s2(:)
318!$OMP THREADPRIVATE(toplwad_aero_s2, sollwad_aero_s2)
319      REAL,ALLOCATABLE,SAVE :: toplwai_aero_s2(:), sollwai_aero_s2(:)
320!$OMP THREADPRIVATE(toplwai_aero_s2, sollwai_aero_s2)
321      REAL,ALLOCATABLE,SAVE :: toplwad0_aero_s2(:), sollwad0_aero_s2(:)
322!$OMP THREADPRIVATE(toplwad0_aero_s2, sollwad0_aero_s2)
323
324!Ajout de celles n??cessaires au phys_output_write_mod
325      REAL, SAVE, ALLOCATABLE :: tal1(:), pal1(:), pab1(:), pab2(:)
326!$OMP THREADPRIVATE(tal1, pal1, pab1, pab2)
327      REAL, SAVE, ALLOCATABLE :: ptstar(:), pt0(:), slp(:)
328!$OMP THREADPRIVATE(ptstar, pt0, slp)
329      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sens, flwp, fiwp
330!$OMP THREADPRIVATE(sens, flwp, fiwp)
331!!
332!FC
333      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zxfluxt, zxfluxq
334!$OMP THREADPRIVATE(zxfluxt, zxfluxq)
335!FC
336!!         Wake variables
337      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: alp_wake
338!$OMP THREADPRIVATE(alp_wake)           
339!!jyg!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h,wake_k
340      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h
341      INTEGER,ALLOCATABLE,SAVE,DIMENSION(:)         :: wake_k
342!$OMP THREADPRIVATE(wake_h,wake_k)                       
343    REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)            :: wake_omg
344!$OMP THREADPRIVATE(wake_omg)                     
345    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_wk, d_deltaq_wk
346!$OMP THREADPRIVATE(d_deltat_wk, d_deltaq_wk)
347      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: d_s_wk, d_s_a_wk, d_dens_wk, d_dens_a_wk
348!$OMP THREADPRIVATE(d_s_wk, d_s_a_wk, d_dens_wk, d_dens_a_wk)
349    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_wk_gw, d_deltaq_wk_gw
350!$OMP THREADPRIVATE(d_deltat_wk_gw, d_deltaq_wk_gw)
351    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_vdf, d_deltaq_vdf
352!$OMP THREADPRIVATE(d_deltat_vdf, d_deltaq_vdf)
353!!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_vdf, d_dens_vdf
354!!!OMP THREADPRIVATE(d_s_vdf, d_dens_vdf)
355    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_the, d_deltaq_the
356!$OMP THREADPRIVATE(d_deltat_the, d_deltaq_the)
357!!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_the, d_dens_the
358!!!OMP THREADPRIVATE(d_s_the, d_dens_the)
359      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)           :: d_deltat_ajs_cv, d_deltaq_ajs_cv
360!$OMP THREADPRIVATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)
361#ifdef ISO
362    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:,:)          :: d_deltaxt_wk
363!$OMP THREADPRIVATE(d_deltaxt_wk)
364    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:,:)          :: d_deltaxt_wk_gw
365!$OMP THREADPRIVATE(d_deltaxt_wk_gw)
366    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:,:)          ::  d_deltaxt_the
367!$OMP THREADPRIVATE(d_deltaxt_the)
368    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:,:)          ::  d_deltaxt_vdf
369!$OMP THREADPRIVATE(d_deltaxt_vdf)
370      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)           ::  d_deltaxt_ajs_cv
371!$OMP THREADPRIVATE(d_deltaxt_ajs_cv)
372#endif                       
373!!         End of Wake variables
374!!
375      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: bils
376!$OMP THREADPRIVATE(bils)
377      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragm, cdragh
378!$OMP THREADPRIVATE(cdragm, cdragh)
379      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cldh, cldl, cldm, cldq, cldt, qsat2m
380!$OMP THREADPRIVATE(cldh, cldl, cldm, cldq, cldt, qsat2m)
381!AS: cldhjn, cldljn, cldmjn,cldtjn pas utilisés en tant que variables, juste noms de diagnostics
382      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: JrNt
383!$OMP THREADPRIVATE(JrNt)
384      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: dthmin, evap, snowerosion, fder, plcl, plfc, prw, prlw, prsw, prbsw, water_budget
385!$OMP THREADPRIVATE(dthmin, evap, snowerosion, fder, plcl, plfc, prw, prlw, prsw, prbsw, water_budget)
386      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zustar, zu10m, zv10m, rh2m
387!$OMP THREADPRIVATE(zustar, zu10m, zv10m, rh2m)
388      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_lcl, s_pblh, s_pblt, s_therm
389!$OMP THREADPRIVATE(s_lcl, s_pblh, s_pblt, s_therm)
390!
391!nrlmd+jyg<
392      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_pblh_x, s_pblh_w
393!$OMP THREADPRIVATE(s_pblh_x, s_pblh_w)
394      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_lcl_x, s_lcl_w
395!$OMP THREADPRIVATE(s_lcl_x, s_lcl_w)
396!>nrlmd+jyg
397!
398      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: slab_wfbils
399!$OMP THREADPRIVATE(slab_wfbils)
400      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte
401!$OMP THREADPRIVATE(tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte)
402      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxustartlic, zxrhoslic, zxqsaltlic
403!$OMP THREADPRIVATE(zxustartlic, zxrhoslic, zxqsaltlic)
404      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfqcalving
405!$OMP THREADPRIVATE(zxfqcalving)
406      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfluxlat, zxtsol, snow_lsc, zxfqfonte
407!$OMP THREADPRIVATE(zxfluxlat, zxtsol, snow_lsc, zxfqfonte)
408!SN runoffdiag
409      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxrunofflic, runoff_diag
410!$OMP THREADPRIVATE(zxrunofflic, runoff_diag)
411      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxqsurf, rain_lsc, rain_num
412!$OMP THREADPRIVATE(zxqsurf, rain_lsc, rain_num)
413#ifdef ISO
414      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: xtevap,xtprw
415!$OMP THREADPRIVATE(xtevap,xtprw)
416      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: h1_diag
417      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: xtrunoff_diag
418!$OMP THREADPRIVATE(h1_diagv,xtrunoff_diag)
419      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zxfxtcalving
420!$OMP THREADPRIVATE(zxfxtcalving)
421      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: xtsnow_lsc, zxfxtfonte
422!$OMP THREADPRIVATE(xtsnow_lsc, zxfxtfonte)
423      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zxxtrunofflic
424!$OMP THREADPRIVATE(zxxtrunofflic)
425      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: xtrain_lsc
426!$OMP THREADPRIVATE(xtrain_lsc)
427#endif
428!
429!jyg+nrlmd<
430!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
431!                                                                          c
432!       Declarations liees a la couche limite differentiee w-x             c
433!                                                                          c
434!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
435      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sens_x, sens_w
436!$OMP THREADPRIVATE(sens_x, sens_w)
437      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfluxlat_x, zxfluxlat_w
438!$OMP THREADPRIVATE(zxfluxlat_x, zxfluxlat_w)
439      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: delta_qsurf
440!$OMP THREADPRIVATE(delta_qsurf)
441!jyg<
442!!! Entrees supplementaires couche-limite
443!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t_x, t_w
444!!!$OMP THREADPRIVATE(t_x, t_w)
445!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: q_x, q_w
446!!!$OMP THREADPRIVATE(q_x, q_w)
447!>jyg
448!!! Sorties ferret
449      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dtvdf_x, dtvdf_w
450!$OMP THREADPRIVATE(dtvdf_x, dtvdf_w)
451      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dqvdf_x, dqvdf_w
452!$OMP THREADPRIVATE(dqvdf_x, dqvdf_w)
453! Variables supplementaires dans physiq.F relative au splitting de la surface
454      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: pbl_tke_input
455!$OMP THREADPRIVATE(pbl_tke_input)
456! Entree supplementaire Thermiques :
457      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t_therm, q_therm, u_therm, v_therm
458!$OMP THREADPRIVATE(t_therm, q_therm, u_therm, v_therm)
459      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragh_x, cdragh_w
460!$OMP THREADPRIVATE(cdragh_x, cdragh_w)
461      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragm_x, cdragm_w
462!$OMP THREADPRIVATE(cdragm_x, cdragm_w)
463      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: kh, kh_x, kh_w
464!$OMP THREADPRIVATE(kh, kh_x, kh_w)
465#ifdef ISO
466      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: dxtvdf_x, dxtvdf_w
467!$OMP THREADPRIVATE(dxtvdf_x, dxtvdf_w)
468      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: xt_therm
469!$OMP THREADPRIVATE(xt_therm)
470#endif
471!!!
472!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
473      LOGICAL, SAVE, ALLOCATABLE :: ptconv(:,:)
474      !$OMP THREADPRIVATE(ptconv)
475      REAL, SAVE, ALLOCATABLE :: ratqsc(:,:)
476      !$OMP THREADPRIVATE(ratqsc)
477!>jyg+nrlmd
478  !
479      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: wbeff, convoccur, zmax_th, zq2m, zt2m
480!$OMP THREADPRIVATE(wbeff, convoccur, zmax_th, zq2m, zt2m)
481      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zt2m_min_mon, zt2m_max_mon
482!$OMP THREADPRIVATE(zt2m_min_mon, zt2m_max_mon)
483      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: t2m_min_mon, t2m_max_mon
484!$OMP THREADPRIVATE(t2m_min_mon, t2m_max_mon)
485      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: weak_inversion
486!$OMP THREADPRIVATE(weak_inversion)
487      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_conv,alp_bl_det
488!$OMP THREADPRIVATE(alp_bl_conv,alp_bl_det)
489      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_fluct_m,alp_bl_fluct_tke
490!$OMP THREADPRIVATE(alp_bl_fluct_m,alp_bl_fluct_tke)
491      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_stat, n2, s2, strig, zcong, zlcl_th
492!$OMP THREADPRIVATE(alp_bl_stat, n2, s2, strig, zcong, zlcl_th)
493      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: proba_notrig, random_notrig
494!$OMP THREADPRIVATE(proba_notrig, random_notrig)
495      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: fsolsw, wfbils
496!$OMP THREADPRIVATE(fsolsw, wfbils)
497      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: wfevap
498!$OMP THREADPRIVATE(wfevap)
499      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: t2m, fluxlat, fsollw,evap_pot
500!$OMP THREADPRIVATE(t2m, fluxlat, fsollw,evap_pot)
501      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dnwd0, omega
502!$OMP THREADPRIVATE(dnwd0, omega)
503      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: epmax_diag ! epmax_cape
504!$OMP THREADPRIVATE(epmax_diag)
505!
506!  Deep convective variables used in phytrac
507      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: ep ! epmax_cape
508!$OMP THREADPRIVATE(ep)
509      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: dnwd, upwd
510!$OMP THREADPRIVATE(dnwd, upwd)
511      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: pmflxr, pmflxs
512!$OMP THREADPRIVATE(pmflxr, pmflxs)
513      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: wdtrainA, wdtrainS, wdtrainM
514!$OMP THREADPRIVATE(wdtrainA, wdtrainS, wdtrainM)
515      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: da, mp
516!$OMP THREADPRIVATE(da, mp)
517      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: wght_cvfd
518!$OMP THREADPRIVATE(wght_cvfd)
519      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:):: phi, phi2, elij, epmlmMm
520!$OMP THREADPRIVATE(phi, phi2, elij, epmlmMm)
521      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: d1a, dam
522!$OMP THREADPRIVATE(d1a, dam)
523      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: ev
524!$OMP THREADPRIVATE(ev)
525      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: qtaa
526!$OMP THREADPRIVATE(qtaa)
527      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: clw
528!$OMP THREADPRIVATE(clw)
529      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: eplaMm
530!$OMP THREADPRIVATE(eplaMm)
531      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:):: sij
532!$OMP THREADPRIVATE(sij)
533#ifdef ISO
534      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: xtwdtrainA
535!$OMP THREADPRIVATE(xtwdtrainA)
536      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: xtev
537!$OMP THREADPRIVATE(xtev)
538      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: xttaa
539!$OMP THREADPRIVATE(xttaa)
540      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: xtclw
541!$OMP THREADPRIVATE(xtclw)
542#ifdef DIAGISO
543      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: qlp
544!$OMP THREADPRIVATE(qlp)
545      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: qvp
546!$OMP THREADPRIVATE(qvp)
547      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: fq_detrainement
548!$OMP THREADPRIVATE(fq_detrainement)
549      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: fq_ddft
550!$OMP THREADPRIVATE(fq_ddft)
551      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: fq_fluxmasse
552!$OMP THREADPRIVATE(fq_fluxmasse)
553      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: fq_evapprecip
554!$OMP THREADPRIVATE(fq_evapprecip)
555      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: f_detrainement
556!$OMP THREADPRIVATE(f_detrainement)
557      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: q_detrainement
558!$OMP THREADPRIVATE(q_detrainement)
559      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: xt_detrainement
560!$OMP THREADPRIVATE(xt_detrainement)
561      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: xtlp
562!$OMP THREADPRIVATE(xtlp)
563      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: xtvp
564!$OMP THREADPRIVATE(xtvp)
565      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: q_the
566!$OMP THREADPRIVATE(q_the)
567      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: xt_the
568!$OMP THREADPRIVATE(xt_the)
569      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: fxt_detrainement
570!$OMP THREADPRIVATE(fxt_detrainement)
571      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: fxt_ddft
572!$OMP THREADPRIVATE(fxt_ddft)
573      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: fxt_fluxmasse
574!$OMP THREADPRIVATE(fxt_fluxmasse)
575      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: fxt_evapprecip
576!$OMP THREADPRIVATE(fxt_evapprecip)
577#endif
578#endif
579!
580!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: coefh, coefm, lambda_th
581      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: lambda_th
582!$OMP THREADPRIVATE(lambda_th)
583      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: cldemi, cldfra, cldtau, fiwc, fl, re, flwc
584!$OMP THREADPRIVATE(cldemi, cldfra, cldtau, fiwc, fl, re, flwc)
585      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: qlth, qith, qsith, wiceth
586!$OMP THREADPRIVATE(qlth, qith, qsith, wiceth)
587      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ref_liq, ref_ice, theta, zphi
588!$OMP THREADPRIVATE(ref_liq, ref_ice, theta, zphi)
589      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ref_liq_pi, ref_ice_pi
590!$OMP THREADPRIVATE(ref_liq_pi, ref_ice_pi)
591      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zx_rh, zx_rhl, zx_rhi
592!$OMP THREADPRIVATE(zx_rh, zx_rhl, zx_rhi)
593      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: prfl, psfl, fraca, bsfl
594!$OMP THREADPRIVATE(prfl, psfl, fraca, bsfl)
595      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: Vprecip, zw2
596!$OMP THREADPRIVATE(Vprecip, zw2)
597      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: pmfd, pmfu
598!$OMP THREADPRIVATE(pmfd, pmfu)
599      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: fluxt, fluxu, fluxv
600!$OMP THREADPRIVATE(fluxt, fluxu, fluxv)
601      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: uwriteSTD, vwriteSTD, wwriteSTD
602!$OMP THREADPRIVATE(uwriteSTD, vwriteSTD, wwriteSTD)
603      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD
604!$OMP THREADPRIVATE(phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD)
605
606
607! ug et d'autres encore:
608      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: beta_prec
609!$OMP THREADPRIVATE(beta_prec)
610      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: rneb,rnebjn,rneblsvol
611!$OMP THREADPRIVATE(rneb,rnebjn,rneblsvol)
612      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: pfraclr,pfracld
613!$OMP THREADPRIVATE(pfraclr,pfracld)
614      REAL, SAVE, ALLOCATABLE :: cldfraliq(:,:)
615!$OMP THREADPRIVATE(cldfraliq)
616      REAL, SAVE, ALLOCATABLE ::mean_icefracturb(:,:)
617!$OMP THREADPRIVATE(mean_icefracturb)
618      REAL, SAVE, ALLOCATABLE :: sigma2_icefracturb(:,:)
619!$OMP THREADPRIVATE(sigma2_icefracturb)
620
621! variables de sorties MM
622      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxsnow,snowhgt,qsnow,to_ice
623      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: sissnow,runoff,albsol3_lic
624!$OMP THREADPRIVATE(zxsnow,snowhgt,qsnow,to_ice)
625!$OMP THREADPRIVATE(sissnow,runoff,albsol3_lic)
626#ifdef ISO
627      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: zxxtsnow
628!$OMP THREADPRIVATE(zxxtsnow)     
629      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: xtVprecip,xtVprecipi
630!$OMP THREADPRIVATE(xtVprecip,xtVprecipi)
631      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: pxtrfl, pxtsfl
632!$OMP THREADPRIVATE(pxtrfl, pxtsfl)
633#endif
634
635      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: p_tropopause, z_tropopause, t_tropopause
636!$OMP THREADPRIVATE(p_tropopause, z_tropopause, t_tropopause)
637
638      INTEGER,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zn2mout
639!$OMP THREADPRIVATE(zn2mout)
640
641      REAL, SAVE, ALLOCATABLE :: qclr(:,:)
642      !$OMP THREADPRIVATE(qclr)
643      REAL, SAVE, ALLOCATABLE :: qcld(:,:)
644      !$OMP THREADPRIVATE(qcld)
645      REAL, SAVE, ALLOCATABLE :: qss(:,:)
646      !$OMP THREADPRIVATE(qss)
647      REAL, SAVE, ALLOCATABLE :: qvc(:,:)
648      !$OMP THREADPRIVATE(qvc)
649      REAL, SAVE, ALLOCATABLE :: rnebclr(:,:)
650      !$OMP THREADPRIVATE(rnebclr)
651      REAL, SAVE, ALLOCATABLE :: rnebss(:,:)
652      !$OMP THREADPRIVATE(rnebss)
653      REAL, SAVE, ALLOCATABLE :: gamma_ss(:,:)
654      !$OMP THREADPRIVATE(gamma_ss)
655      REAL, SAVE, ALLOCATABLE :: N1_ss(:,:)
656      !$OMP THREADPRIVATE(N1_ss)
657      REAL, SAVE, ALLOCATABLE :: N2_ss(:,:)
658      !$OMP THREADPRIVATE(N2_ss)
659      REAL, SAVE, ALLOCATABLE :: drneb_sub(:,:)
660      !$OMP THREADPRIVATE(drneb_sub)
661      REAL, SAVE, ALLOCATABLE :: drneb_con(:,:)
662      !$OMP THREADPRIVATE(drneb_con)
663      REAL, SAVE, ALLOCATABLE :: drneb_tur(:,:)
664      !$OMP THREADPRIVATE(drneb_tur)
665      REAL, SAVE, ALLOCATABLE :: drneb_avi(:,:)
666      !$OMP THREADPRIVATE(drneb_avi)
667      REAL, SAVE, ALLOCATABLE :: zqsatl(:,:)
668      !$OMP THREADPRIVATE(zqsatl)
669      REAL, SAVE, ALLOCATABLE :: zqsats(:,:)
670      !$OMP THREADPRIVATE(zqsats)
671      REAL, SAVE, ALLOCATABLE :: Tcontr(:,:)
672      !$OMP THREADPRIVATE(Tcontr)
673      REAL, SAVE, ALLOCATABLE :: qcontr(:,:)
674      !$OMP THREADPRIVATE(qcontr)
675      REAL, SAVE, ALLOCATABLE :: qcontr2(:,:)
676      !$OMP THREADPRIVATE(qcontr2)
677      REAL, SAVE, ALLOCATABLE :: fcontrN(:,:)
678      !$OMP THREADPRIVATE(fcontrN)
679      REAL, SAVE, ALLOCATABLE :: fcontrP(:,:)
680      !$OMP THREADPRIVATE(fcontrP)
681      REAL, SAVE, ALLOCATABLE :: distcltop(:,:)
682      !$OMP THREADPRIVATE(distcltop)
683      REAL, SAVE, ALLOCATABLE :: temp_cltop(:,:)
684      !$OMP THREADPRIVATE(temp_cltop)
685
686
687!--POPRECIP variables
688      REAL, SAVE, ALLOCATABLE :: qraindiag(:,:)
689      !$OMP THREADPRIVATE(qraindiag)
690      REAL, SAVE, ALLOCATABLE :: qsnowdiag(:,:)
691      !$OMP THREADPRIVATE(qsnowdiag)
692      REAL, SAVE, ALLOCATABLE :: dqreva(:,:)
693      !$OMP THREADPRIVATE(dqreva)
694      REAL, SAVE, ALLOCATABLE :: dqrauto(:,:)
695      !$OMP THREADPRIVATE(dqrauto)
696      REAL, SAVE, ALLOCATABLE :: dqrcol(:,:)
697      !$OMP THREADPRIVATE(dqrcol)
698      REAL, SAVE, ALLOCATABLE :: dqrmelt(:,:)
699      !$OMP THREADPRIVATE(dqrmelt)
700       REAL, SAVE, ALLOCATABLE :: dqrfreez(:,:)
701      !$OMP THREADPRIVATE(dqrfreez)
702      REAL, SAVE, ALLOCATABLE :: dqssub(:,:)
703      !$OMP THREADPRIVATE(dqssub)
704      REAL, SAVE, ALLOCATABLE :: dqsauto(:,:)
705      !$OMP THREADPRIVATE(dqsauto)
706      REAL, SAVE, ALLOCATABLE :: dqsagg(:,:)
707      !$OMP THREADPRIVATE(dqsagg)
708      REAL, SAVE, ALLOCATABLE :: dqsrim(:,:)
709      !$OMP THREADPRIVATE(dqsrim)
710      REAL, SAVE, ALLOCATABLE :: dqsmelt(:,:)
711      !$OMP THREADPRIVATE(dqsmelt)
712      REAL, SAVE, ALLOCATABLE :: dqsfreez(:,:)
713      !$OMP THREADPRIVATE(dqsfreez)
714
715
716     
717
718
719#ifdef CPP_StratAer
720!
721! variables for stratospheric aerosol
722      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: d_q_emiss
723!$OMP THREADPRIVATE(d_q_emiss)
724      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: R2SO4
725!$OMP THREADPRIVATE(R2SO4)
726      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: R2SO4B
727!$OMP THREADPRIVATE(R2SO4B)
728      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: DENSO4
729!$OMP THREADPRIVATE(DENSO4)
730      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:, :) :: DENSO4B
731!$OMP THREADPRIVATE(DENSO4B)     
732      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: f_r_wet
733!$OMP THREADPRIVATE(f_r_wet)
734      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:, :) :: f_r_wetB
735!$OMP THREADPRIVATE(f_r_wetB)
736      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: decfluxaer
737!$OMP THREADPRIVATE(decfluxaer)
738      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: mdw
739!$OMP THREADPRIVATE(mdw)
740      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: OCS_lifetime
741!$OMP THREADPRIVATE(OCS_lifetime)
742      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: SO2_lifetime
743!$OMP THREADPRIVATE(SO2_lifetime)
744      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: H2SO4_lifetime
745!$OMP THREADPRIVATE(H2SO4_lifetime)
746      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: O3_clim
747!$OMP THREADPRIVATE(O3_clim)
748      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: alpha_bin
749!$OMP THREADPRIVATE(alpha_bin)
750      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: piz_bin
751!$OMP THREADPRIVATE(piz_bin)
752      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: cg_bin
753!$OMP THREADPRIVATE(cg_bin)
754      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tau_strat_550
755!$OMP THREADPRIVATE(tau_strat_550)
756      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tau_strat_1020
757!$OMP THREADPRIVATE(tau_strat_1020)
758      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tausum_strat
759!$OMP THREADPRIVATE(tausum_strat)
760      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: surf_PM25_sulf
761!$OMP THREADPRIVATE(surf_PM25_sulf)
762      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vsed_aer
763!$OMP THREADPRIVATE(vsed_aer)
764!     Sulfate aerosol concentration (dry mixing ratio) (condensed H2SO4 mmr)
765      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sulfmmr
766!$OMP THREADPRIVATE(sulfmmr)
767!     SAD all aerosols (cm2/cm3)
768      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: SAD_sulfate
769!$OMP THREADPRIVATE(SAD_sulfate)
770!     sulfate MMR in different modes (based on sulfmmr, it must be dry mmr)
771      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: sulfmmr_mode
772!$OMP THREADPRIVATE(sulfmmr_mode)
773!     particle concentration in different modes (part/m3)
774      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: nd_mode
775!$OMP THREADPRIVATE(nd_mode)
776!
777!---3D budget variables
778      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_nucl
779!$OMP THREADPRIVATE(budg_3D_nucl)
780      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_cond_evap
781!$OMP THREADPRIVATE(budg_3D_cond_evap)
782      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_ocs_to_so2
783!$OMP THREADPRIVATE(budg_3D_ocs_to_so2)
784      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_so2_to_h2so4
785!$OMP THREADPRIVATE(budg_3D_so2_to_h2so4)
786      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_backgr_ocs
787!$OMP THREADPRIVATE(budg_3D_backgr_ocs)
788      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_backgr_so2
789!$OMP THREADPRIVATE(budg_3D_backgr_so2)
790!
791!---2D budget variables
792      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_ocs
793      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_so2
794      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_h2so4
795      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_part
796!$OMP THREADPRIVATE(budg_dep_dry_ocs,budg_dep_dry_so2,budg_dep_dry_h2so4,budg_dep_dry_part)
797      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_ocs
798      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_so2
799      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_h2so4
800      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_part
801!$OMP THREADPRIVATE(budg_dep_wet_ocs,budg_dep_wet_so2,budg_dep_wet_h2so4,budg_dep_wet_part)
802      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_ocs
803      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_so2
804      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_h2so4
805      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_part
806!$OMP THREADPRIVATE(budg_emi_ocs,budg_emi_so2,budg_emi_h2so4,budg_emi_part)
807      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_ocs_to_so2
808      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_so2_to_h2so4
809      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_h2so4_to_part
810!$OMP THREADPRIVATE(budg_ocs_to_so2,budg_so2_to_h2so4,budg_h2so4_to_part)
811      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_sed_part
812!$OMP THREADPRIVATE(budg_sed_part)
813#endif
814#ifdef REPROBUS
815      REAL,SAVE,ALLOCATABLE    :: d_q_emiss(:,:)
816!$OMP THREADPRIVATE(d_q_emiss)
817#endif
818
819      ! --- Offline -----------------------------------------------------------
820      LOGICAL, SAVE :: write_offline
821      !$OMP THREADPRIVATE(write_offline)
822      REAL,ALLOCATABLE,SAVE :: ftsol_stok(:,:)  ! flux de masse dans le panache montant
823      REAL,ALLOCATABLE,SAVE :: pctsrf_stok(:,:)  ! flux de masse dans le panache descendant
824      !$OMP THREADPRIVATE(ftsol_stok,pctsrf_stok)
825      REAL,ALLOCATABLE,SAVE :: mfu_stok(:,:)  ! flux de masse dans le panache montant
826      REAL,ALLOCATABLE,SAVE :: mfd_stok(:,:)  ! flux de masse dans le panache descendant
827      REAL,ALLOCATABLE,SAVE :: de_u_stok(:,:) ! flux de traine dans le panache montant
828      REAL,ALLOCATABLE,SAVE :: en_d_stok(:,:) ! flux en traine dans le panache descendant
829      REAL,ALLOCATABLE,SAVE :: de_d_stok(:,:) ! flux de traine dans le panache montant
830      REAL,ALLOCATABLE,SAVE :: en_u_stok(:,:) ! flux en traine dans le panache descendant
831      REAL,ALLOCATABLE,SAVE :: coefh_stok(:,:) ! flux de traine dans le panache descendant
832      !$OMP THREADPRIVATE(mfu_stok,mfd_stok,de_u_stok,en_d_stok,de_d_stok)
833      !$OMP THREADPRIVATE(en_u_stok,coefh_stok)
834      REAL,ALLOCATABLE,SAVE :: entr_therm_stok(:,:) ! Les Thermiques :(Abderr25 1102)
835      REAL,ALLOCATABLE,SAVE :: fm_therm_stok(:,:)   ! Les Thermiques :(Abderr25 1102)
836      !$OMP THREADPRIVATE(entr_therm_stok, fm_therm_stok)
837      REAL,DIMENSION(:), ALLOCATABLE,SAVE     :: yu1_stok
838      REAL,DIMENSION(:), ALLOCATABLE,SAVE   :: yv1_stok
839      !$OMP THREADPRIVATE(yu1_stok, yv1_stok)
840      REAL,DIMENSION(:,:), ALLOCATABLE,SAVE     :: da_stok
841      REAL,DIMENSION(:,:,:), ALLOCATABLE,SAVE   :: phi_stok
842      REAL,DIMENSION(:,:), ALLOCATABLE,SAVE     :: mp_stok
843      REAL,DIMENSION(:,:), ALLOCATABLE,SAVE     :: upwd_stok
844      REAL,DIMENSION(:,:), ALLOCATABLE,SAVE     :: dnwd_stok
845      REAL,DIMENSION(:,:), ALLOCATABLE,SAVE     :: wght_stok
846      !$OMPTHREADPRIVATE(da_stok,phi_stok,mp_stok,upwd_stok,dnwd_stok,wght_stok)
847      REAL,ALLOCATABLE,SAVE :: t_stok(:,:)   ! convection
848      REAL,ALLOCATABLE,SAVE :: sh_stok(:,:)   ! convection
849      !$OMP THREADPRIVATE(t_stok,sh_stok)
850      ! -----------------------------------------------------------------------
851
852
853     
854CONTAINS
855
856!======================================================================
857SUBROUTINE phys_local_var_init
858USE dimphy
859USE infotrac_phy, ONLY : nbtr,nqtot
860#ifdef ISO
861USE infotrac_phy, ONLY : ntraciso=>ntiso,niso
862#endif
863USE aero_mod
864USE indice_sol_mod
865USE phys_output_var_mod
866USE phys_state_var_mod
867#ifdef CPP_StratAer
868USE infotrac_phy, ONLY : nbtr_bin
869#endif
870
871IMPLICIT NONE
872      ALLOCATE(t_seri(klon,klev),q_seri(klon,klev),ql_seri(klon,klev),qs_seri(klon,klev), qbs_seri(klon,klev))
873! SN 4D ISO
874      ALLOCATE(qx_seri(klon,klev,nqtot))
875! SN
876      ALLOCATE(u_seri(klon,klev),v_seri(klon,klev))
877      ALLOCATE(l_mixmin(klon,klev+1,nbsrf),l_mix(klon,klev+1,nbsrf),wprime(klon,klev+1,nbsrf))
878      ALLOCATE(pbl_eps(klon,klev+1,nbsrf+1))
879      ALLOCATE(tke_shear(klon,klev+1,nbsrf), tke_buoy(klon,klev+1,nbsrf), tke_trans(klon,klev+1,nbsrf))
880      pbl_eps(:,:,:)=0.
881      tke_shear(:,:,:)=0.; tke_buoy(:,:,:)=0.; tke_trans(:,:,:)=0.
882      l_mix(:,:,:)=0.;l_mixmin(:,:,:)=0.;wprime(:,:,:)=0. ! doit etre initialse car pas toujours remplis
883      ALLOCATE(rhcl(klon,klev))
884      ALLOCATE(tr_seri(klon,klev,nbtr))
885      ALLOCATE(d_t_dyn(klon,klev),d_q_dyn(klon,klev))
886      ALLOCATE(d_ql_dyn(klon,klev),d_qs_dyn(klon,klev), d_qbs_dyn(klon,klev))
887      ALLOCATE(d_q_dyn2d(klon),d_ql_dyn2d(klon),d_qs_dyn2d(klon), d_qbs_dyn2d(klon))
888      ALLOCATE(d_u_dyn(klon,klev),d_v_dyn(klon,klev))
889      ALLOCATE(d_tr_dyn(klon,klev,nbtr))                   !RomP
890      ALLOCATE(d_t_con(klon,klev),d_q_con(klon,klev),d_q_con_zmasse(klon,klev))
891      ALLOCATE(d_u_con(klon,klev),d_v_con(klon,klev))
892      ALLOCATE(d_t_wake(klon,klev),d_q_wake(klon,klev))
893      ALLOCATE(d_t_lsc(klon,klev),d_q_lsc(klon,klev))
894      ALLOCATE(d_t_lwr(klon,klev),d_t_lw0(klon,klev))
895      ALLOCATE(d_t_swr(klon,klev),d_t_sw0(klon,klev))
896      ALLOCATE(d_ql_lsc(klon,klev),d_qi_lsc(klon,klev))
897      ALLOCATE(d_t_ajsb(klon,klev),d_q_ajsb(klon,klev))
898      ALLOCATE(d_t_ajs(klon,klev),d_q_ajs(klon,klev))
899!nrlmd<
900      ALLOCATE(d_t_ajs_w(klon,klev),d_q_ajs_w(klon,klev))
901      ALLOCATE(d_t_ajs_x(klon,klev),d_q_ajs_x(klon,klev))
902!>nrlmd
903      ALLOCATE(d_u_ajs(klon,klev),d_v_ajs(klon,klev))
904      ALLOCATE(d_t_eva(klon,klev),d_q_eva(klon,klev))
905! SN 4D ISO
906      ALLOCATE(d_qx_eva(klon,klev,nqtot))
907! SN
908      ALLOCATE(d_ql_eva(klon,klev),d_qi_eva(klon,klev))
909      ALLOCATE(d_t_lscst(klon,klev),d_q_lscst(klon,klev))
910      ALLOCATE(d_t_lscth(klon,klev),d_q_lscth(klon,klev))
911      ALLOCATE(plul_st(klon),plul_th(klon))
912      ALLOCATE(d_t_vdf(klon,klev),d_q_vdf(klon,klev),d_t_diss(klon,klev))
913      ALLOCATE (d_qbs_vdf(klon,klev))
914      ALLOCATE(d_t_bsss(klon,klev),d_q_bsss(klon,klev),d_qbs_bsss(klon,klev))
915      ALLOCATE(d_t_vdf_w(klon,klev),d_q_vdf_w(klon,klev))
916      ALLOCATE(d_t_vdf_x(klon,klev),d_q_vdf_x(klon,klev))
917#ifdef ISO
918      allocate(xt_seri(ntraciso,klon,klev))
919      allocate(xtl_seri(ntraciso,klon,klev))
920      allocate(xts_seri(ntraciso,klon,klev))
921      allocate(xtbs_seri(ntraciso,klon,klev))
922      allocate(d_xt_dyn(ntraciso,klon,klev))
923      allocate(d_xtl_dyn(ntraciso,klon,klev))
924      allocate(d_xts_dyn(ntraciso,klon,klev))
925      allocate(d_xtbs_dyn(ntraciso,klon,klev))
926      allocate(d_xt_con(ntraciso,klon,klev))
927      allocate(d_xt_wake(ntraciso,klon,klev))
928      allocate(d_xt_lsc(ntraciso,klon,klev))
929      allocate(d_xtl_lsc(ntraciso,klon,klev))
930      allocate(d_xti_lsc(ntraciso,klon,klev))
931      allocate(d_xt_ajsb(ntraciso,klon,klev))
932      allocate(d_xt_ajs(ntraciso,klon,klev))
933      allocate(d_xt_ajs_w(ntraciso,klon,klev))
934      allocate(d_xt_ajs_x(ntraciso,klon,klev))
935      allocate(d_xt_eva(ntraciso,klon,klev))
936      allocate(d_xtl_eva(ntraciso,klon,klev))
937      allocate(d_xti_eva(ntraciso,klon,klev))
938      allocate(d_xt_vdf(ntraciso,klon,klev)) 
939      allocate(d_xt_vdf_w(ntraciso,klon,klev))
940      allocate(d_xt_vdf_x(ntraciso,klon,klev))
941      allocate(d_xt_ch4(ntraciso,klon,klev))
942      allocate(d_xt_prod_nucl(ntraciso,klon,klev))
943      allocate(d_xt_cosmo(ntraciso,klon,klev))
944      allocate(d_xt_decroiss(ntraciso,klon,klev))
945#endif
946
947      ALLOCATE(d_u_vdf(klon,klev),d_v_vdf(klon,klev))
948      ALLOCATE(d_t_oli(klon,klev),d_t_oro(klon,klev))
949      ALLOCATE(d_u_oli(klon,klev),d_v_oli(klon,klev))
950      ALLOCATE(d_u_oro(klon,klev),d_v_oro(klon,klev))
951      ALLOCATE(d_u_oro_gw(klon,klev),d_v_oro_gw(klon,klev))
952      ALLOCATE(d_t_oro_gw(klon,klev))
953      ALLOCATE(d_t_lif(klon,klev),d_t_ec(klon,klev))
954      ALLOCATE(d_u_lif(klon,klev),d_v_lif(klon,klev))
955      ALLOCATE(d_ts(klon,nbsrf), d_tr(klon,klev,nbtr))
956
957! Special RRTM
958      ALLOCATE(ZLWFT0_i(klon,klev+1),ZSWFT0_i(klon,klev+1),ZFLDN0(klon,klev+1))
959      ZFLDN0= 0.
960      ALLOCATE(ZFLUP0(klon,klev+1),ZFSDN0(klon,klev+1),ZFSUP0(klon,klev+1))
961!
962      ALLOCATE(topswad_aero(klon), solswad_aero(klon))
963      ALLOCATE(topswai_aero(klon), solswai_aero(klon))
964      ALLOCATE(topswad0_aero(klon), solswad0_aero(klon))
965      ALLOCATE(toplwad_aero(klon), sollwad_aero(klon))
966      ALLOCATE(toplwai_aero(klon), sollwai_aero(klon))
967      ALLOCATE(toplwad0_aero(klon), sollwad0_aero(klon))
968      ALLOCATE(topsw_aero(klon,naero_grp), solsw_aero(klon,naero_grp))
969      ALLOCATE(topsw0_aero(klon,naero_grp), solsw0_aero(klon,naero_grp))
970      ALLOCATE(topswcf_aero(klon,3), solswcf_aero(klon,3))
971      ALLOCATE(du_gwd_hines(klon,klev),dv_gwd_hines(klon,klev))
972      ALLOCATE(dv_gwd_rando(klon,klev),dv_gwd_front(klon,klev))
973      ALLOCATE(east_gwstress(klon,klev),west_gwstress(klon,klev))
974      east_gwstress(:,:)=0 !ym missing init
975      west_gwstress(:,:)=0 !ym missing init
976      ALLOCATE(d_t_hin(klon,klev))
977      ALLOCATE(d_q_ch4(klon,klev))
978      ALLOCATE(stratomask(klon,klev))
979      ALLOCATE(tausum_aero(klon,nwave,naero_tot))
980      ALLOCATE(drytausum_aero(klon,naero_tot))
981      ALLOCATE(tau3d_aero(klon,klev,nwave,naero_tot))
982      ALLOCATE(dNovrN(klon))
983      ALLOCATE(zfice(klon, klev))
984      ALLOCATE(od443aer(klon))
985      ALLOCATE(od550aer(klon))
986      ALLOCATE(od865aer(klon))
987      ALLOCATE(dryod550aer(klon))
988      dryod550aer(:) = 0.
989      ALLOCATE(abs550aer(klon))
990      abs550aer(:) = 0.
991      ALLOCATE(ec550aer(klon,klev))
992      ALLOCATE(od550lt1aer(klon))
993      ALLOCATE(sconcso4(klon))
994      ALLOCATE(sconcno3(klon))
995      ALLOCATE(sconcoa(klon))
996      ALLOCATE(sconcbc(klon))
997      ALLOCATE(sconcss(klon))
998      ALLOCATE(sconcdust(klon))
999      ALLOCATE(concso4(klon,klev))
1000      ALLOCATE(concno3(klon,klev))
1001      ALLOCATE(concoa(klon,klev))
1002      ALLOCATE(concbc(klon,klev))
1003      ALLOCATE(concss(klon,klev))
1004      ALLOCATE(concdust(klon,klev))
1005      ALLOCATE(loadso4(klon))
1006      ALLOCATE(loadoa(klon))
1007      ALLOCATE(loadbc(klon))
1008      ALLOCATE(loadss(klon))
1009      ALLOCATE(loaddust(klon))
1010      ALLOCATE(loadno3(klon))
1011      ALLOCATE(load_tmp1(klon))
1012      ALLOCATE(load_tmp2(klon))
1013      ALLOCATE(load_tmp3(klon))
1014      ALLOCATE(load_tmp4(klon))
1015      ALLOCATE(load_tmp5(klon))
1016      ALLOCATE(load_tmp6(klon))
1017      ALLOCATE(load_tmp7(klon))
1018      ALLOCATE(load_tmp8(klon))
1019      ALLOCATE(load_tmp9(klon))
1020      ALLOCATE(load_tmp10(klon))
1021
1022!IM ajout variables CFMIP2/CMIP5
1023      ALLOCATE(topswad_aerop(klon), solswad_aerop(klon))
1024      ALLOCATE(topswai_aerop(klon), solswai_aerop(klon))
1025      ALLOCATE(topswad0_aerop(klon), solswad0_aerop(klon))
1026      ALLOCATE(topsw_aerop(klon,naero_grp), topsw0_aerop(klon,naero_grp))
1027      ALLOCATE(solsw_aerop(klon,naero_grp), solsw0_aerop(klon,naero_grp))
1028      ALLOCATE(topswcf_aerop(klon,naero_grp), solswcf_aerop(klon,naero_grp))
1029
1030! additional LW variables CK
1031      ALLOCATE(toplwad_aerop(klon), sollwad_aerop(klon))
1032      ALLOCATE(toplwai_aerop(klon), sollwai_aerop(klon))
1033      ALLOCATE(toplwad0_aerop(klon), sollwad0_aerop(klon))
1034
1035!AI Ajout Ecrad (3Deffect)
1036      ALLOCATE(topswad_aero_s2(klon), solswad_aero_s2(klon))
1037      ALLOCATE(topswai_aero_s2(klon), solswai_aero_s2(klon))
1038      ALLOCATE(topswad0_aero_s2(klon), solswad0_aero_s2(klon))
1039      ALLOCATE(topsw_aero_s2(klon,naero_grp), topsw0_aero_s2(klon,naero_grp))
1040      ALLOCATE(solsw_aero_s2(klon,naero_grp), solsw0_aero_s2(klon,naero_grp))
1041      ALLOCATE(topswcf_aero_s2(klon,naero_grp), solswcf_aero_s2(klon,naero_grp))
1042! additional LW variables CK
1043      ALLOCATE(toplwad_aero_s2(klon), sollwad_aero_s2(klon))
1044      ALLOCATE(toplwai_aero_s2(klon), sollwai_aero_s2(klon))
1045      ALLOCATE(toplwad0_aero_s2(klon), sollwad0_aero_s2(klon))
1046
1047! FH Ajout de celles necessaires au phys_output_write_mod
1048
1049      ALLOCATE(tal1(klon), pal1(klon), pab1(klon), pab2(klon))
1050      ALLOCATE(ptstar(klon),pt0(klon),slp(klon))
1051!!
1052!!          Wake variables
1053      ALLOCATE(alp_wake(klon))
1054      ALLOCATE(wake_h(klon),wake_k(klon))
1055      ALLOCATE(wake_omg(klon, klev))
1056      ALLOCATE(d_deltat_wk(klon, klev), d_deltaq_wk(klon, klev))
1057      ALLOCATE(d_s_wk(klon), d_s_a_wk(klon), d_dens_wk(klon), d_dens_a_wk(klon))
1058      ALLOCATE(d_deltat_wk_gw(klon, klev), d_deltaq_wk_gw(klon, klev))
1059      ALLOCATE(d_deltat_vdf(klon, klev), d_deltaq_vdf(klon, klev))
1060!!      ALLOCATE( d_s_vdf(klon), d_dens_vdf(klon))
1061      ALLOCATE(d_deltat_the(klon, klev), d_deltaq_the(klon, klev))
1062!!      ALLOCATE( d_s_the(klon), d_dens_the(klon))
1063      ALLOCATE(d_deltat_ajs_cv(klon, klev), d_deltaq_ajs_cv(klon, klev))
1064#ifdef ISO
1065      ALLOCATE(d_deltaxt_wk(ntraciso,klon, klev))
1066      ALLOCATE(d_deltaxt_wk_gw(ntraciso,klon, klev))
1067      ALLOCATE(d_deltaxt_the(ntraciso,klon, klev))
1068      ALLOCATE(d_deltaxt_vdf(ntraciso,klon, klev))
1069      ALLOCATE(d_deltaxt_ajs_cv(ntraciso,klon, klev))
1070#endif
1071!!         End of wake variables
1072!!
1073      ALLOCATE(bils(klon))
1074      ALLOCATE(cdragm(klon), cdragh(klon), cldh(klon), cldl(klon))
1075      ALLOCATE(cldm(klon), cldq(klon), cldt(klon), qsat2m(klon))
1076      ALLOCATE(JrNt(klon))
1077      ALLOCATE(dthmin(klon), evap(klon), snowerosion(klon), fder(klon), plcl(klon), plfc(klon))
1078      ALLOCATE(prw(klon), prlw(klon), prsw(klon), prbsw(klon), water_budget(klon), zustar(klon), zu10m(klon), zv10m(klon), rh2m(klon))
1079      ALLOCATE(s_lcl(klon))
1080      ALLOCATE(s_pblh(klon), s_pblt(klon), s_therm(klon))
1081!
1082!nrlmd+jyg<
1083      ALLOCATE(s_pblh_x(klon), s_pblh_w(klon))
1084      ALLOCATE(s_lcl_x(klon), s_lcl_w(klon))
1085!>nrlmd+jyg
1086!
1087      ALLOCATE(slab_wfbils(klon), tpot(klon), tpote(klon), ue(klon))
1088      ALLOCATE(uq(klon), ve(klon), vq(klon), zxffonte(klon))
1089      ALLOCATE(uwat(klon), vwat(klon))
1090      ALLOCATE(zxfqcalving(klon), zxfluxlat(klon))
1091      ALLOCATE(zxtsol(klon), snow_lsc(klon), zxfqfonte(klon), zxqsurf(klon))
1092! SN add runoff_diag
1093      ALLOCATE(zxrunofflic(klon), runoff_diag(klon))
1094      runoff_diag(:)=0.
1095      ALLOCATE(zxustartlic(klon), zxrhoslic(klon), zxqsaltlic(klon))
1096      zxustartlic(:)=0. ; zxrhoslic(:)=0. ; zxqsaltlic(:)=0.
1097      ALLOCATE(rain_lsc(klon))
1098      ALLOCATE(rain_num(klon))
1099      ALLOCATE(qlth(klon,klev), qith(klon,klev), qsith(klon,klev), wiceth(klon,klev))
1100      !
1101#ifdef ISO
1102      ALLOCATE(xtevap(ntraciso,klon))
1103      ALLOCATE(xtprw(ntraciso,klon))
1104      ALLOCATE(zxfxtcalving(niso,klon))
1105      ALLOCATE(xtsnow_lsc(ntraciso,klon), zxfxtfonte(niso,klon))
1106      ALLOCATE(zxxtrunofflic(niso,klon))
1107      ALLOCATE(xtrain_lsc(ntraciso,klon))
1108      ALLOCATE(xtrunoff_diag(niso,klon))
1109      ALLOCATE(h1_diag(klon))
1110!SN
1111      xtrunoff_diag(:,:)=0. ! because variables are only given values on knon grid points
1112#endif
1113!
1114      ALLOCATE(sens_x(klon), sens_w(klon))
1115      ALLOCATE(zxfluxlat_x(klon), zxfluxlat_w(klon))
1116      ALLOCATE(delta_qsurf(klon))
1117!jyg<
1118!!      ALLOCATE(t_x(klon,klev), t_w(klon,klev))
1119!!      ALLOCATE(q_x(klon,klev), q_w(klon,klev))
1120!>jyg
1121      ALLOCATE(dtvdf_x(klon,klev), dtvdf_w(klon,klev))
1122      dtvdf_x = 0 ; dtvdf_w=0 ;   !ym missing init
1123      ALLOCATE(dqvdf_x(klon,klev), dqvdf_w(klon,klev))
1124      dqvdf_x = 0 ; dqvdf_w=0 ;   !ym missing init
1125      ALLOCATE(pbl_tke_input(klon,klev+1,nbsrf))
1126      ALLOCATE(t_therm(klon,klev), q_therm(klon,klev),u_therm(klon,klev), v_therm(klon,klev))
1127      ALLOCATE(cdragh_x(klon), cdragh_w(klon))
1128      ALLOCATE(cdragm_x(klon), cdragm_w(klon))
1129      ALLOCATE(kh(klon), kh_x(klon), kh_w(klon))
1130#ifdef ISO
1131      ALLOCATE(dxtvdf_x(ntraciso,klon,klev), dxtvdf_w(ntraciso,klon,klev))
1132      ALLOCATE(xt_therm(ntraciso,klon,klev))
1133#endif
1134!
1135      ALLOCATE(ptconv(klon,klev))
1136      ALLOCATE(ratqsc(klon,klev))
1137!
1138      ALLOCATE(wbeff(klon), convoccur(klon), zmax_th(klon))
1139      ALLOCATE(zq2m(klon), zt2m(klon), weak_inversion(klon))
1140      ALLOCATE(zt2m_min_mon(klon), zt2m_max_mon(klon))
1141      ALLOCATE(t2m_min_mon(klon), t2m_max_mon(klon))
1142      ALLOCATE(sens(klon), flwp(klon), fiwp(klon))
1143      ALLOCATE(alp_bl_conv(klon), alp_bl_det(klon))
1144      alp_bl_conv(:)=0 ;  alp_bl_det(:)=0
1145      ALLOCATE(alp_bl_fluct_m(klon), alp_bl_fluct_tke(klon))
1146      alp_bl_fluct_m(:)=0 ; alp_bl_fluct_tke(:)= 0.
1147      ALLOCATE(alp_bl_stat(klon), n2(klon), s2(klon), strig(klon), zcong(klon), zlcl_th(klon))
1148      alp_bl_stat(:)=0
1149      ALLOCATE(proba_notrig(klon), random_notrig(klon))
1150
1151      ALLOCATE(dnwd0(klon, klev))
1152!      ALLOCATE(upwd(klon, klev), omega(klon, klev), coefh(klon, klev))
1153      ALLOCATE(omega(klon, klev))
1154      ALLOCATE(epmax_diag(klon)) ! epmax_cape
1155!      ALLOCATE(coefm(klon, klev), lambda_th(klon, klev), cldemi(klon, klev))
1156      ALLOCATE(lambda_th(klon, klev), cldemi(klon, klev))
1157      ALLOCATE(cldfra(klon, klev), cldtau(klon, klev), fiwc(klon, klev))
1158      ALLOCATE(fl(klon, klev), re(klon, klev), flwc(klon, klev))
1159      ALLOCATE(ref_liq(klon, klev), ref_ice(klon, klev), theta(klon, klev))
1160      ALLOCATE(ref_liq_pi(klon, klev), ref_ice_pi(klon, klev))
1161      ALLOCATE(zphi(klon, klev), zx_rh(klon, klev), zx_rhl(klon,klev), zx_rhi(klon,klev))
1162      zx_rhl(:,:)=0.; zx_rhi(:,:)=0. ! because not always defined
1163      ALLOCATE(pmfd(klon, klev), pmfu(klon, klev))
1164
1165      ALLOCATE(t2m(klon, nbsrf), fluxlat(klon, nbsrf))
1166      ALLOCATE(fsollw(klon, nbsrf))
1167      ALLOCATE(fsolsw(klon, nbsrf), wfbils(klon, nbsrf))
1168      ALLOCATE(wfevap(klon, nbsrf))
1169      ALLOCATE(evap_pot(klon, nbsrf))
1170! FC
1171      ALLOCATE(zxfluxq(klon,klev),zxfluxt(klon,klev))
1172!
1173!  Deep convective variables used in phytrac
1174      ALLOCATE(pmflxr(klon, klev+1), pmflxs(klon, klev+1))
1175      ALLOCATE(wdtrainA(klon,klev),wdtrainS(klon,klev),wdtrainM(klon,klev))
1176      ALLOCATE(dnwd(klon, klev), upwd(klon, klev))
1177      ALLOCATE(ep(klon,klev))                          ! epmax_cape
1178      ALLOCATE(da(klon,klev), mp(klon,klev))
1179      ALLOCATE(phi(klon,klev,klev))
1180      ALLOCATE(wght_cvfd(klon,klev))
1181      ALLOCATE(phi2(klon,klev,klev))
1182      ALLOCATE(d1a(klon,klev), dam(klon,klev))
1183      ALLOCATE(ev(klon,klev))
1184      ALLOCATE(elij(klon,klev,klev))
1185      ALLOCATE(qtaa(klon,klev))
1186      ALLOCATE(clw(klon,klev))
1187      ALLOCATE(epmlmMm(klon,klev,klev), eplaMm(klon,klev))
1188      ALLOCATE(sij(klon,klev,klev))
1189#ifdef ISO
1190      ALLOCATE(xtwdtrainA(ntraciso,klon,klev))
1191      ALLOCATE(xtev(ntraciso,klon,klev) )
1192      ALLOCATE(xttaa(ntraciso,klon,klev) )
1193      ALLOCATE(xtclw(ntraciso,klon,klev) )
1194#ifdef DIAGISO
1195      ALLOCATE(qlp(klon,klev))
1196      ALLOCATE(qvp(klon,klev))
1197      ALLOCATE(fq_detrainement(klon,klev))
1198      ALLOCATE(fq_ddft(klon,klev))
1199      ALLOCATE(fq_fluxmasse(klon,klev))
1200      ALLOCATE(fq_evapprecip(klon,klev))
1201      ALLOCATE(f_detrainement(klon,klev), q_detrainement(klon,klev))
1202      ALLOCATE(xtlp(ntraciso,klon,klev))
1203      ALLOCATE(xtvp(ntraciso,klon,klev))
1204      ALLOCATE(q_the(klon,klev), xt_the(ntraciso,klon,klev))
1205      ALLOCATE(fxt_detrainement(ntraciso,klon,klev))
1206      ALLOCATE(fxt_ddft(ntraciso,klon,klev))
1207      ALLOCATE(fxt_fluxmasse(ntraciso,klon,klev))
1208      ALLOCATE(fxt_evapprecip(ntraciso,klon,klev))
1209      ALLOCATE(xt_detrainement(ntraciso,klon,klev))
1210#endif
1211#endif
1212
1213      ALLOCATE(prfl(klon, klev+1))
1214      ALLOCATE(psfl(klon, klev+1), fraca(klon, klev+1), Vprecip(klon, klev+1))
1215      ALLOCATE(bsfl(klon,klev+1))
1216      ALLOCATE(zw2(klon, klev+1))
1217
1218      ALLOCATE(fluxu(klon, klev, nbsrf), fluxv(klon, klev, nbsrf))
1219      ALLOCATE(fluxt(klon, klev, nbsrf))
1220
1221      ALLOCATE(uwriteSTD(klon,nlevSTD,nfiles), vwriteSTD(klon,nlevSTD,nfiles))
1222      ALLOCATE(wwriteSTD(klon,nlevSTD,nfiles), phiwriteSTD(klon,nlevSTD,nfiles))
1223      ALLOCATE(qwriteSTD(klon,nlevSTD,nfiles), twriteSTD(klon,nlevSTD,nfiles))
1224      ALLOCATE(rhwriteSTD(klon,nlevSTD,nfiles))
1225
1226! ug et d'autres encore:
1227      ALLOCATE(beta_prec(klon,klev))
1228      ALLOCATE(rneb(klon,klev),rnebjn(klon,klev),rneblsvol(klon,klev))
1229      ALLOCATE(pfraclr(klon,klev),pfracld(klon,klev))
1230      pfraclr(:,:)=0. ; pfracld(:,:)=0. ! because not always defined
1231      ALLOCATE(cldfraliq(klon,klev))
1232      ALLOCATE(sigma2_icefracturb(klon,klev))
1233      ALLOCATE(mean_icefracturb(klon,klev))
1234      ALLOCATE(distcltop(klon,klev))
1235      ALLOCATE(temp_cltop(klon,klev))
1236
1237
1238      ALLOCATE (zxsnow(klon),snowhgt(klon),qsnow(klon),to_ice(klon))
1239      ALLOCATE (sissnow(klon),runoff(klon),albsol3_lic(klon))
1240#ifdef ISO
1241      ALLOCATE (zxxtsnow(niso,klon))
1242      ALLOCATE(xtVprecip(ntraciso,klon, klev+1),xtVprecipi(ntraciso,klon, klev+1))
1243      ALLOCATE(pxtsfl(ntraciso,klon, klev+1),pxtrfl(ntraciso,klon, klev+1))
1244#endif
1245
1246      ALLOCATE (p_tropopause(klon))
1247      ALLOCATE (z_tropopause(klon))
1248      ALLOCATE (t_tropopause(klon))
1249
1250      ALLOCATE(zn2mout(klon,6))
1251
1252! Supersaturation
1253      ALLOCATE(rneb_seri(klon,klev))
1254      ALLOCATE(d_rneb_dyn(klon,klev))
1255      ALLOCATE(qclr(klon,klev), qcld(klon,klev), qss(klon,klev), qvc(klon,klev))
1256      ALLOCATE(rnebclr(klon,klev), rnebss(klon,klev), gamma_ss(klon,klev))
1257      ALLOCATE(N1_ss(klon,klev), N2_ss(klon,klev))
1258      ALLOCATE(drneb_sub(klon,klev), drneb_con(klon,klev), drneb_tur(klon,klev), drneb_avi(klon,klev))
1259      ALLOCATE(zqsatl(klon,klev), zqsats(klon,klev))
1260      ALLOCATE(Tcontr(klon,klev), qcontr(klon,klev), qcontr2(klon,klev), fcontrN(klon,klev), fcontrP(klon,klev))
1261
1262!--POPRECIP variables
1263      ALLOCATE(qraindiag(klon,klev), qsnowdiag(klon,klev))
1264      ALLOCATE(dqreva(klon,klev), dqssub(klon,klev))
1265      ALLOCATE(dqrauto(klon,klev), dqrcol(klon,klev), dqrmelt(klon,klev), dqrfreez(klon,klev))
1266      ALLOCATE(dqsauto(klon,klev), dqsagg(klon,klev), dqsrim(klon,klev), dqsmelt(klon,klev), dqsfreez(klon,klev))
1267
1268#ifdef CPP_StratAer
1269      ALLOCATE (d_q_emiss(klon,klev))
1270      ALLOCATE (R2SO4(klon,klev))
1271      ALLOCATE (R2SO4B(klon,klev,nbtr_bin))
1272      ALLOCATE (DENSO4(klon,klev))
1273      ALLOCATE (DENSO4B(klon,klev,nbtr_bin))
1274      ALLOCATE (f_r_wet(klon,klev))
1275      ALLOCATE (f_r_wetB(klon,klev,nbtr_bin))
1276      ALLOCATE (decfluxaer(klon,nbtr))
1277      ALLOCATE (mdw(nbtr))
1278      ALLOCATE (budg_3D_nucl(klon,klev))
1279      ALLOCATE (budg_3D_cond_evap(klon,klev))
1280      ALLOCATE (budg_3D_ocs_to_so2(klon,klev))
1281      ALLOCATE (budg_3D_so2_to_h2so4(klon,klev))
1282      ALLOCATE (budg_3D_backgr_ocs(klon,klev))
1283      ALLOCATE (budg_3D_backgr_so2(klon,klev))
1284      ALLOCATE (OCS_lifetime(klon,klev))
1285      ALLOCATE (SO2_lifetime(klon,klev))
1286      ALLOCATE (H2SO4_lifetime(klon,klev))
1287      ALLOCATE (O3_clim(klon,klev))
1288      ALLOCATE (alpha_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave,nbtr))
1289      ALLOCATE (piz_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave,nbtr))
1290      ALLOCATE (cg_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave,nbtr))
1291      ALLOCATE (tau_strat_550(klon,klev))
1292      ALLOCATE (tau_strat_1020(klon,klev))
1293      ALLOCATE (tausum_strat(klon,3))
1294      ALLOCATE (budg_dep_dry_ocs(klon))
1295      ALLOCATE (budg_dep_wet_ocs(klon))
1296      ALLOCATE (budg_dep_dry_so2(klon))
1297      ALLOCATE (budg_dep_wet_so2(klon))
1298      ALLOCATE (budg_dep_dry_h2so4(klon))
1299      ALLOCATE (budg_dep_wet_h2so4(klon))
1300      ALLOCATE (budg_dep_dry_part(klon))
1301      ALLOCATE (budg_dep_wet_part(klon))
1302      ALLOCATE (budg_emi_ocs(klon))
1303      ALLOCATE (budg_emi_so2(klon))
1304      ALLOCATE (budg_emi_h2so4(klon))
1305      ALLOCATE (budg_emi_part(klon))
1306      ALLOCATE (budg_ocs_to_so2(klon))
1307      ALLOCATE (budg_so2_to_h2so4(klon))
1308      ALLOCATE (budg_h2so4_to_part(klon))
1309      ALLOCATE (budg_sed_part(klon))
1310      ALLOCATE (surf_PM25_sulf(klon))
1311      ALLOCATE (vsed_aer(klon,klev))
1312      ALLOCATE (sulfmmr(klon,klev))
1313      ALLOCATE (SAD_sulfate(klon,klev))
1314      ALLOCATE (sulfmmr_mode(klon,klev,nbtr_bin))
1315      ALLOCATE (nd_mode(klon,klev,nbtr_bin))
1316#endif
1317
1318      ! --- Offline -----------------------------------------------------------
1319      ALLOCATE(t_stok(klon,klev))
1320      ALLOCATE(sh_stok(klon,klev))
1321      ALLOCATE(mfu_stok(klon,klev))
1322      ALLOCATE(mfd_stok(klon,klev))
1323      ALLOCATE(de_u_stok(klon,klev))
1324      ALLOCATE(en_d_stok(klon,klev))
1325      ALLOCATE(de_d_stok(klon,klev))
1326      ALLOCATE(en_u_stok(klon,klev))
1327      ALLOCATE(coefh_stok(klon,klev))
1328      ALLOCATE(entr_therm_stok(klon,klev))
1329      ALLOCATE(fm_therm_stok(klon,klev))
1330      ALLOCATE(da_stok(klon,klev))
1331      ALLOCATE(phi_stok(klon,klev,klev))
1332      ALLOCATE(mp_stok(klon,klev))
1333      ALLOCATE(upwd_stok(klon,klev))
1334      ALLOCATE(dnwd_stok(klon,klev))
1335      ALLOCATE(wght_stok(klon,klev))
1336      ALLOCATE(yu1_stok(klon))
1337      ALLOCATE(yv1_stok(klon))
1338      ALLOCATE(ftsol_stok(klon,nbsrf))
1339      ALLOCATE(pctsrf_stok(klon,nbsrf))
1340      ! -----------------------------------------------------------------------
1341
1342
1343     
1344END SUBROUTINE phys_local_var_init
1345
1346!======================================================================
1347SUBROUTINE phys_local_var_end
1348USE dimphy
1349USE indice_sol_mod
1350IMPLICIT NONE
1351      DEALLOCATE(t_seri,q_seri,ql_seri,qs_seri, qbs_seri)
1352! SN 4D ISO
1353      DEALLOCATE(qx_seri)
1354! SN
1355      DEALLOCATE(u_seri,v_seri)
1356      DEALLOCATE(l_mixmin,l_mix,wprime)
1357      DEALLOCATE(tke_shear,tke_buoy,tke_trans)
1358      DEALLOCATE(pbl_eps)
1359      DEALLOCATE(rhcl)
1360      DEALLOCATE(tr_seri)
1361      DEALLOCATE(d_t_dyn,d_q_dyn)
1362      DEALLOCATE(d_ql_dyn,d_qs_dyn, d_qbs_dyn)
1363      DEALLOCATE(d_q_dyn2d,d_ql_dyn2d,d_qs_dyn2d, d_qbs_dyn2d)
1364      DEALLOCATE(d_u_dyn,d_v_dyn)
1365      DEALLOCATE(d_tr_dyn)                      !RomP
1366      DEALLOCATE(d_t_con,d_q_con,d_q_con_zmasse)
1367      DEALLOCATE(d_u_con,d_v_con)
1368      DEALLOCATE(d_t_wake,d_q_wake)
1369      DEALLOCATE(d_t_lsc,d_q_lsc)
1370      DEALLOCATE(d_t_lwr,d_t_lw0)
1371      DEALLOCATE(d_t_swr,d_t_sw0)
1372      DEALLOCATE(d_ql_lsc,d_qi_lsc)
1373      DEALLOCATE(d_t_ajsb,d_q_ajsb)
1374      DEALLOCATE(d_t_ajs,d_q_ajs)
1375!nrlmd<
1376      DEALLOCATE(d_t_ajs_w,d_q_ajs_w)
1377      DEALLOCATE(d_t_ajs_x,d_q_ajs_x)
1378!>nrlmd
1379      DEALLOCATE(d_u_ajs,d_v_ajs)
1380      DEALLOCATE(d_t_eva,d_q_eva)
1381! SN 4D ISO
1382      DEALLOCATE(d_qx_eva)
1383! SN
1384      DEALLOCATE(d_ql_eva,d_qi_eva)
1385      DEALLOCATE(d_t_lscst,d_q_lscst)
1386      DEALLOCATE(d_t_lscth,d_q_lscth)
1387      DEALLOCATE(plul_st,plul_th)
1388      DEALLOCATE(d_t_vdf,d_q_vdf,d_t_diss)
1389      DEALLOCATE(d_qbs_vdf)
1390      DEALLOCATE(d_t_bsss,d_q_bsss,d_qbs_bsss)
1391#ifdef ISO
1392      deallocate(xt_seri,xtl_seri,xts_seri,xtbs_seri)
1393      DEALLOCATE(d_xtl_eva,d_xti_eva)
1394      deallocate(d_xt_dyn,d_xtl_dyn,d_xts_dyn,d_xtbs_dyn)
1395      deallocate(d_xt_con)
1396      deallocate(d_xt_wake)
1397      deallocate(d_xt_lsc)
1398      deallocate(d_xtl_lsc,d_xti_lsc)
1399      deallocate(d_xt_ajsb)
1400      deallocate(d_xt_ajs)
1401      deallocate(d_xt_ajs_w,d_xt_ajs_x)
1402      deallocate(d_xt_eva)
1403      deallocate(d_xtl_eva)
1404      deallocate(d_xti_eva)
1405      deallocate(d_xt_vdf)
1406      deallocate(d_xt_vdf_w,d_xt_vdf_x)
1407      deallocate(d_xt_ch4)
1408      deallocate(d_xt_prod_nucl)
1409      deallocate(d_xt_cosmo)
1410      deallocate(d_xt_decroiss)
1411#endif
1412
1413      DEALLOCATE(d_u_vdf,d_v_vdf)
1414      DEALLOCATE(d_t_oli,d_t_oro)
1415      DEALLOCATE(d_u_oli,d_v_oli)
1416      DEALLOCATE(d_u_oro,d_v_oro)
1417      DEALLOCATE(d_t_oro_gw)
1418      DEALLOCATE(d_u_oro_gw,d_v_oro_gw)
1419      DEALLOCATE(d_t_lif,d_t_ec)
1420      DEALLOCATE(d_u_lif,d_v_lif)
1421      DEALLOCATE(d_ts, d_tr)
1422      DEALLOCATE(topswad_aero,solswad_aero)
1423      DEALLOCATE(topswai_aero,solswai_aero)
1424      DEALLOCATE(topswad0_aero,solswad0_aero)
1425      DEALLOCATE(toplwad_aero,sollwad_aero)
1426      DEALLOCATE(toplwai_aero,sollwai_aero)
1427      DEALLOCATE(toplwad0_aero,sollwad0_aero)
1428      DEALLOCATE(topsw_aero,solsw_aero)
1429      DEALLOCATE(topsw0_aero,solsw0_aero)
1430      DEALLOCATE(topswcf_aero,solswcf_aero)
1431      DEALLOCATE(stratomask)
1432      DEALLOCATE(tausum_aero)
1433      DEALLOCATE(drytausum_aero)
1434      DEALLOCATE(tau3d_aero)
1435      DEALLOCATE(dNovrN)
1436      DEALLOCATE(zfice)
1437      DEALLOCATE(od443aer)
1438      DEALLOCATE(od550aer)
1439      DEALLOCATE(od865aer)
1440      DEALLOCATE(dryod550aer)
1441      DEALLOCATE(abs550aer)
1442      DEALLOCATE(ec550aer)
1443      DEALLOCATE(od550lt1aer)
1444      DEALLOCATE(sconcso4)
1445      DEALLOCATE(sconcno3)
1446      DEALLOCATE(sconcoa)
1447      DEALLOCATE(sconcbc)
1448      DEALLOCATE(sconcss)
1449      DEALLOCATE(sconcdust)
1450      DEALLOCATE(concso4)
1451      DEALLOCATE(concno3)
1452      DEALLOCATE(concoa)
1453      DEALLOCATE(concbc)
1454      DEALLOCATE(concss)
1455      DEALLOCATE(concdust)
1456      DEALLOCATE(loadso4)
1457      DEALLOCATE(loadoa)
1458      DEALLOCATE(loadbc)
1459      DEALLOCATE(loadss)
1460      DEALLOCATE(loaddust)
1461      DEALLOCATE(loadno3)
1462      DEALLOCATE(load_tmp1)
1463      DEALLOCATE(load_tmp2)
1464      DEALLOCATE(load_tmp3)
1465      DEALLOCATE(load_tmp4)
1466      DEALLOCATE(load_tmp5)
1467      DEALLOCATE(load_tmp6)
1468      DEALLOCATE(load_tmp7)
1469      DEALLOCATE(load_tmp8)
1470      DEALLOCATE(load_tmp9)
1471      DEALLOCATE(load_tmp10)
1472      DEALLOCATE(du_gwd_hines,dv_gwd_hines,d_t_hin)
1473      DEALLOCATE(d_q_ch4)
1474      DEALLOCATE(dv_gwd_rando,dv_gwd_front)
1475      DEALLOCATE(east_gwstress,west_gwstress)
1476
1477!IM ajout variables CFMIP2/CMIP5
1478      DEALLOCATE(topswad_aerop, solswad_aerop)
1479      DEALLOCATE(topswai_aerop, solswai_aerop)
1480      DEALLOCATE(topswad0_aerop, solswad0_aerop)
1481      DEALLOCATE(topsw_aerop, topsw0_aerop)
1482      DEALLOCATE(solsw_aerop, solsw0_aerop)
1483      DEALLOCATE(topswcf_aerop, solswcf_aerop)
1484!CK LW diagnostics
1485      DEALLOCATE(toplwad_aerop, sollwad_aerop)
1486      DEALLOCATE(toplwai_aerop, sollwai_aerop)
1487      DEALLOCATE(toplwad0_aerop, sollwad0_aerop)
1488
1489!AI Ajout pour Ecrad (3Deffect)
1490      DEALLOCATE(topswad_aero_s2, solswad_aero_s2)
1491      DEALLOCATE(topswai_aero_s2, solswai_aero_s2)
1492      DEALLOCATE(topswad0_aero_s2, solswad0_aero_s2)
1493      DEALLOCATE(topsw_aero_s2, topsw0_aero_s2)
1494      DEALLOCATE(solsw_aero_s2, solsw0_aero_s2)
1495      DEALLOCATE(topswcf_aero_s2, solswcf_aero_s2)
1496!CK LW diagnostics
1497      DEALLOCATE(toplwad_aero_s2, sollwad_aero_s2)
1498      DEALLOCATE(toplwai_aero_s2, sollwai_aero_s2)
1499      DEALLOCATE(toplwad0_aero_s2, sollwad0_aero_s2)     
1500
1501! FH Ajout de celles necessaires au phys_output_write_mod
1502      DEALLOCATE(tal1, pal1, pab1, pab2)
1503      DEALLOCATE(ptstar, pt0, slp)
1504!
1505      DEALLOCATE(alp_wake)
1506      DEALLOCATE(wake_h,wake_k)
1507      DEALLOCATE(wake_omg)
1508      DEALLOCATE(d_deltat_wk, d_deltaq_wk)
1509      DEALLOCATE(d_s_wk, d_s_a_wk, d_dens_wk, d_dens_a_wk)
1510      DEALLOCATE(d_deltat_wk_gw, d_deltaq_wk_gw)
1511      DEALLOCATE(d_deltat_vdf, d_deltaq_vdf)
1512!!      DEALLOCATE( d_s_vdf, d_dens_vdf)
1513      DEALLOCATE(d_deltat_the, d_deltaq_the)
1514!!      DEALLOCATE( d_s_the, d_dens_the)
1515      DEALLOCATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)
1516#ifdef ISO
1517      DEALLOCATE(d_deltaxt_wk)
1518      DEALLOCATE(d_deltaxt_wk_gw)
1519      DEALLOCATE(d_deltaxt_ajs_cv)
1520      DEALLOCATE(d_deltaxt_vdf)
1521#endif
1522!
1523      DEALLOCATE(bils)
1524      DEALLOCATE(cdragm, cdragh, cldh, cldl)
1525      DEALLOCATE(cldm, cldq, cldt, qsat2m)
1526      DEALLOCATE(JrNt)
1527      DEALLOCATE(dthmin, evap, snowerosion, fder, plcl, plfc)
1528      DEALLOCATE(prw, prlw, prsw, prbsw, water_budget, zustar, zu10m, zv10m, rh2m, s_lcl)
1529      DEALLOCATE(s_pblh, s_pblt, s_therm)
1530!
1531!nrlmd+jyg<
1532      DEALLOCATE(s_pblh_x, s_pblh_w)
1533      DEALLOCATE(s_lcl_x, s_lcl_w)
1534!>nrlmd+jyg
1535!
1536      DEALLOCATE(slab_wfbils, tpot, tpote, ue)
1537      DEALLOCATE(uq, ve, vq, zxffonte)
1538      DEALLOCATE(uwat, vwat)
1539      DEALLOCATE(zxfqcalving, zxfluxlat)
1540! SN runoff_diag
1541      DEALLOCATE(zxrunofflic, runoff_diag)
1542      DEALLOCATE(zxustartlic, zxrhoslic, zxqsaltlic)
1543      DEALLOCATE(zxtsol, snow_lsc, zxfqfonte, zxqsurf)
1544      DEALLOCATE(rain_lsc)
1545      DEALLOCATE(rain_num)
1546      DEALLOCATE(qlth, qith, qsith, wiceth)
1547!
1548      DEALLOCATE(sens_x, sens_w)
1549      DEALLOCATE(zxfluxlat_x, zxfluxlat_w)
1550      DEALLOCATE(delta_qsurf)
1551!jyg<
1552!!      DEALLOCATE(t_x, t_w)
1553!!      DEALLOCATE(q_x, q_w)
1554!>jyg
1555      DEALLOCATE(d_t_vdf_x, d_t_vdf_w)
1556      DEALLOCATE(d_q_vdf_x, d_q_vdf_w)
1557      DEALLOCATE(pbl_tke_input)
1558      DEALLOCATE(t_therm, q_therm, u_therm, v_therm)
1559      DEALLOCATE(cdragh_x, cdragh_w)
1560      DEALLOCATE(cdragm_x, cdragm_w)
1561      DEALLOCATE(kh, kh_x, kh_w)
1562#ifdef ISO
1563      DEALLOCATE(xtevap,xtprw)
1564      DEALLOCATE(zxfxtcalving)
1565      DEALLOCATE(zxxtrunofflic)
1566      DEALLOCATE(xtsnow_lsc, zxfxtfonte)
1567      DEALLOCATE(xtrain_lsc)
1568      DEALLOCATE(dxtvdf_x, dxtvdf_w)
1569      DEALLOCATE(xt_therm)
1570      DEALLOCATE(h1_diag,xtrunoff_diag)
1571#endif
1572!
1573      DEALLOCATE(ptconv)
1574      DEALLOCATE(ratqsc)
1575!
1576      DEALLOCATE(wbeff, convoccur, zmax_th)
1577      DEALLOCATE(zq2m, zt2m, weak_inversion)
1578      DEALLOCATE(zt2m_min_mon, zt2m_max_mon)
1579      DEALLOCATE(t2m_min_mon, t2m_max_mon)
1580      DEALLOCATE(sens, flwp, fiwp)
1581      DEALLOCATE(alp_bl_conv,alp_bl_det)
1582      DEALLOCATE(alp_bl_fluct_m,alp_bl_fluct_tke)
1583      DEALLOCATE(alp_bl_stat, n2, s2, strig, zcong, zlcl_th)
1584      DEALLOCATE(proba_notrig, random_notrig)
1585!FC
1586      DEALLOCATE(zxfluxq,zxfluxt)
1587
1588      DEALLOCATE(dnwd0)
1589!      DEALLOCATE(upwd, omega, coefh)
1590      DEALLOCATE(omega)
1591      DEALLOCATE(epmax_diag)
1592!      DEALLOCATE(coefm, lambda_th, cldemi)
1593      DEALLOCATE(lambda_th, cldemi)
1594      DEALLOCATE(cldfra, cldtau, fiwc)
1595      DEALLOCATE(fl, re, flwc)
1596      DEALLOCATE(ref_liq, ref_ice, theta)
1597      DEALLOCATE(ref_liq_pi, ref_ice_pi)
1598      DEALLOCATE(zphi, zx_rh, zx_rhl, zx_rhi)
1599      DEALLOCATE(pmfd, pmfu)
1600
1601      DEALLOCATE(t2m, fluxlat)
1602      DEALLOCATE(fsollw, evap_pot)
1603      DEALLOCATE(fsolsw, wfbils)
1604      DEALLOCATE(wfevap)
1605
1606      DEALLOCATE(pmflxr, pmflxs)
1607      DEALLOCATE(wdtrainA, wdtrainS, wdtrainM)
1608      DEALLOCATE(upwd, dnwd)
1609      DEALLOCATE(ep)
1610      DEALLOCATE(da, mp)
1611      DEALLOCATE(phi)
1612      DEALLOCATE(wght_cvfd)
1613      DEALLOCATE(phi2)
1614      DEALLOCATE(d1a, dam)
1615      DEALLOCATE(ev)
1616      DEALLOCATE(elij)
1617      DEALLOCATE(qtaa)
1618      DEALLOCATE(clw)
1619      DEALLOCATE(epmlmMm, eplaMm)
1620      DEALLOCATE(sij)
1621#ifdef ISO
1622      DEALLOCATE(xtwdtrainA)
1623      DEALLOCATE(xttaa )
1624      DEALLOCATE(xtclw )
1625      DEALLOCATE(xtev )
1626#ifdef DIAGISO
1627      DEALLOCATE(qlp)
1628      DEALLOCATE(qvp)
1629      DEALLOCATE(fq_detrainement)
1630      DEALLOCATE(fq_ddft)
1631      DEALLOCATE(fq_fluxmasse)
1632      DEALLOCATE(fq_evapprecip)
1633      DEALLOCATE(f_detrainement,q_detrainement)
1634      DEALLOCATE(xtlp)
1635      DEALLOCATE(xtvp)
1636      DEALLOCATE(q_the,xt_the)
1637      DEALLOCATE(fxt_detrainement)
1638      DEALLOCATE(fxt_ddft)
1639      DEALLOCATE(fxt_fluxmasse)
1640      DEALLOCATE(fxt_evapprecip)
1641      DEALLOCATE(xt_detrainement)
1642#endif
1643#endif
1644
1645
1646      DEALLOCATE(prfl, psfl, bsfl, fraca, Vprecip)
1647      DEALLOCATE(zw2)
1648
1649      DEALLOCATE(fluxu, fluxv)
1650      DEALLOCATE(fluxt)
1651
1652      DEALLOCATE(uwriteSTD, vwriteSTD)
1653      DEALLOCATE(wwriteSTD, phiwriteSTD)
1654      DEALLOCATE(qwriteSTD, twriteSTD, rhwriteSTD)
1655
1656! ug et d'autres encore:
1657      DEALLOCATE(beta_prec)
1658      DEALLOCATE(rneb)
1659      DEALLOCATE(pfraclr,pfracld)
1660      DEALLOCATE(cldfraliq)
1661      DEALLOCATE(sigma2_icefracturb)
1662      DEALLOCATE(mean_icefracturb)
1663      DEALLOCATE (zxsnow,snowhgt,qsnow,to_ice,sissnow,runoff,albsol3_lic)
1664      DEALLOCATE(distcltop)
1665      DEALLOCATE(temp_cltop)
1666#ifdef ISO
1667      DEALLOCATE (zxxtsnow,xtVprecip,xtVprecipi,pxtrfl,pxtsfl)
1668#endif
1669
1670      DEALLOCATE (p_tropopause)
1671      DEALLOCATE (z_tropopause)
1672      DEALLOCATE (t_tropopause)
1673      DEALLOCATE(zn2mout)
1674
1675! Supersaturation
1676      DEALLOCATE(rneb_seri)
1677      DEALLOCATE(d_rneb_dyn)
1678      DEALLOCATE(qclr, qcld, qss, qvc)
1679      DEALLOCATE(rnebclr, rnebss, gamma_ss)
1680      DEALLOCATE(N1_ss, N2_ss)
1681      DEALLOCATE(drneb_sub, drneb_con, drneb_tur, drneb_avi)
1682      DEALLOCATE(zqsatl, zqsats)
1683      DEALLOCATE(Tcontr, qcontr, qcontr2, fcontrN, fcontrP)
1684
1685!--POPRECIP variables
1686      DEALLOCATE(qraindiag, qsnowdiag)
1687      DEALLOCATE(dqreva, dqssub)
1688      DEALLOCATE(dqrauto, dqrcol, dqrmelt, dqrfreez)
1689      DEALLOCATE(dqsauto, dqsagg, dqsrim, dqsmelt, dqsfreez)
1690
1691#ifdef CPP_StratAer
1692! variables for strat. aerosol CK
1693      DEALLOCATE (d_q_emiss)
1694      DEALLOCATE (R2SO4, R2SO4B)
1695      DEALLOCATE (DENSO4, DENSO4B)
1696      DEALLOCATE (f_r_wet, f_r_wetB)
1697      DEALLOCATE (decfluxaer)
1698      DEALLOCATE (mdw)
1699      DEALLOCATE (SO2_lifetime)
1700      DEALLOCATE (OCS_lifetime)
1701      DEALLOCATE (H2SO4_lifetime)
1702      DEALLOCATE (O3_clim)
1703      DEALLOCATE (alpha_bin)
1704      DEALLOCATE (piz_bin)
1705      DEALLOCATE (cg_bin)
1706      DEALLOCATE (tau_strat_550)
1707      DEALLOCATE (tau_strat_1020)
1708      DEALLOCATE (tausum_strat)
1709      DEALLOCATE (surf_PM25_sulf)
1710      DEALLOCATE (vsed_aer)
1711      DEALLOCATE (sulfmmr)
1712      DEALLOCATE (SAD_sulfate)
1713      DEALLOCATE (sulfmmr_mode)
1714      DEALLOCATE (nd_mode)
1715      DEALLOCATE (budg_3D_ocs_to_so2)
1716      DEALLOCATE (budg_3D_so2_to_h2so4)
1717      DEALLOCATE (budg_3D_backgr_ocs)
1718      DEALLOCATE (budg_3D_backgr_so2)
1719      DEALLOCATE (budg_3D_nucl)
1720      DEALLOCATE (budg_3D_cond_evap)
1721      DEALLOCATE (budg_dep_dry_ocs)
1722      DEALLOCATE (budg_dep_wet_ocs)
1723      DEALLOCATE (budg_dep_dry_so2)
1724      DEALLOCATE (budg_dep_wet_so2)
1725      DEALLOCATE (budg_dep_dry_h2so4)
1726      DEALLOCATE (budg_dep_wet_h2so4)
1727      DEALLOCATE (budg_dep_dry_part)
1728      DEALLOCATE (budg_dep_wet_part)
1729      DEALLOCATE (budg_emi_ocs)
1730      DEALLOCATE (budg_emi_so2)
1731      DEALLOCATE (budg_emi_h2so4)
1732      DEALLOCATE (budg_emi_part)
1733      DEALLOCATE (budg_ocs_to_so2)
1734      DEALLOCATE (budg_so2_to_h2so4)
1735      DEALLOCATE (budg_h2so4_to_part)
1736      DEALLOCATE (budg_sed_part)
1737#endif
1738
1739            ! --- Offline -----------------------------------------------------------
1740      DEALLOCATE(t_stok)
1741      DEALLOCATE(sh_stok)
1742      DEALLOCATE(mfu_stok)
1743      DEALLOCATE(mfd_stok)
1744      DEALLOCATE(de_u_stok)
1745      DEALLOCATE(en_d_stok)
1746      DEALLOCATE(de_d_stok)
1747      DEALLOCATE(en_u_stok)
1748      DEALLOCATE(coefh_stok)
1749      DEALLOCATE(entr_therm_stok)
1750      DEALLOCATE(fm_therm_stok)
1751      DEALLOCATE(da_stok)
1752      DEALLOCATE(phi_stok)
1753      DEALLOCATE(mp_stok)
1754      DEALLOCATE(upwd_stok)
1755      DEALLOCATE(dnwd_stok)
1756      DEALLOCATE(wght_stok)
1757      DEALLOCATE(yu1_stok)
1758      DEALLOCATE(yv1_stok)
1759      DEALLOCATE(ftsol_stok)
1760      DEALLOCATE(pctsrf_stok)
1761      ! -----------------------------------------------------------------------
1762
1763END SUBROUTINE phys_local_var_end
1764
1765END MODULE phys_local_var_mod
Note: See TracBrowser for help on using the repository browser.