source: LMDZ6/branches/Ocean_skin/libf/phylmdiso/phys_local_var_mod.F90 @ 4232

Last change on this file since 4232 was 4009, checked in by evignon, 3 years ago

! Prise en compte de l'orographie sous maille, des heterogeneites de surface
! sur le ratqs + nouvelle version des ratqs interactifs de Louis
! Le tout est dan un module: calcratqs_multi_mod.
! Pour l'instant, les nouvelles contributions peuvent s'activer
! uniquement de facon separee

File size: 58.5 KB
Line 
1!
2! $Id: phys_local_var_mod.F90 3888 2021-05-05 10:50:37Z jyg $
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(:,:,:), wprime(:,:,:)
19      !$OMP THREADPRIVATE(l_mixmin, l_mix, tke_dissip, wprime)
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#ifdef ISO
108      REAL, SAVE, ALLOCATABLE :: xt_seri(:,:,:)
109      !$OMP THREADPRIVATE( xt_seri)
110      REAL, SAVE, ALLOCATABLE :: xtl_seri(:,:,:)
111      !$OMP THREADPRIVATE( xtl_seri)
112      REAL, SAVE, ALLOCATABLE :: xts_seri(:,:,:)
113      !$OMP THREADPRIVATE( xts_seri)
114      REAL, SAVE, ALLOCATABLE :: d_xt_eva(:,:,:)
115      !$OMP THREADPRIVATE( d_xt_eva)
116      REAL, SAVE, ALLOCATABLE :: d_xtl_eva(:,:,:)
117      !$OMP THREADPRIVATE( d_xtl_eva)
118      REAL, SAVE, ALLOCATABLE :: d_xti_eva(:,:,:)
119      !$OMP THREADPRIVATE( d_xti_eva)
120      REAL, SAVE, ALLOCATABLE :: d_xt_vdf(:,:,:)
121      !$OMP THREADPRIVATE( d_xt_vdf)
122      REAL, SAVE, ALLOCATABLE :: d_xt_dyn(:,:,:)
123      !$OMP THREADPRIVATE( d_xt_dyn)
124      REAL, SAVE, ALLOCATABLE :: d_xtl_dyn(:,:,:), d_xts_dyn(:,:,:)
125      !$OMP THREADPRIVATE(d_xtl_dyn, d_xts_dyn)
126      REAL, SAVE, ALLOCATABLE :: d_xt_con(:,:,:)
127      !$OMP THREADPRIVATE( d_xt_con)
128      REAL, SAVE, ALLOCATABLE :: d_xt_wake(:,:,:)
129      !$OMP THREADPRIVATE( d_xt_wake)
130      REAL, SAVE, ALLOCATABLE :: d_xt_lsc(:,:,:),d_xtl_lsc(:,:,:),d_xti_lsc(:,:,:)
131      !$OMP THREADPRIVATE( d_xt_lsc,d_xtl_lsc,d_xti_lsc)
132      REAL, SAVE, ALLOCATABLE :: d_xt_ajsb(:,:,:)
133      !$OMP THREADPRIVATE( d_xt_ajsb)
134      REAL, SAVE, ALLOCATABLE :: d_xt_ajs(:,:,:)
135      !$OMP THREADPRIVATE( d_xt_ajs)
136      REAL, SAVE, ALLOCATABLE :: d_xt_ajs_w(:,:,:), d_xt_ajs_x(:,:,:)
137      !$OMP THREADPRIVATE(d_xt_ajs_w, d_xt_ajs_x)
138      REAL, SAVE, ALLOCATABLE :: d_xt_vdf_w(:,:,:), d_xt_vdf_x(:,:,:)
139      !$OMP THREADPRIVATE(d_xt_vdf_w, d_xt_vdf_x)
140      REAL, SAVE, ALLOCATABLE :: d_xt_ch4(:,:,:)
141      !$OMP THREADPRIVATE( d_xt_ch4)
142      REAL, SAVE, ALLOCATABLE :: d_xt_prod_nucl(:,:,:)
143      !$OMP THREADPRIVATE( d_xt_prod_nucl)
144      REAL, SAVE, ALLOCATABLE :: d_xt_cosmo(:,:,:)
145      !$OMP THREADPRIVATE( d_xt_cosmo)
146      REAL, SAVE, ALLOCATABLE :: d_xt_decroiss(:,:,:)
147      !$OMP THREADPRIVATE( d_xt_decroiss)
148#endif
149
150! tendance du a la conersion Ec -> E thermique
151      REAL, SAVE, ALLOCATABLE :: d_t_ec(:,:)
152      !$OMP THREADPRIVATE(d_t_ec)
153      REAL, SAVE, ALLOCATABLE :: d_ts(:,:), d_tr(:,:,:)
154      !$OMP THREADPRIVATE(d_ts, d_tr)
155
156! diagnostique pour le rayonnement
157      REAL, SAVE, ALLOCATABLE :: topswad_aero(:),  solswad_aero(:)      ! diag
158      !$OMP THREADPRIVATE(topswad_aero,solswad_aero)
159      REAL, SAVE, ALLOCATABLE :: topswai_aero(:),  solswai_aero(:)      ! diag
160      !$OMP THREADPRIVATE(topswai_aero,solswai_aero)
161      REAL, SAVE, ALLOCATABLE :: topswad0_aero(:), solswad0_aero(:)     ! diag
162      !$OMP THREADPRIVATE(topswad0_aero,solswad0_aero)
163      REAL, SAVE, ALLOCATABLE :: topsw_aero(:,:),  solsw_aero(:,:)      ! diag
164      !$OMP THREADPRIVATE(topsw_aero,solsw_aero)
165      REAL, SAVE, ALLOCATABLE :: topsw0_aero(:,:), solsw0_aero(:,:)     ! diag
166      !$OMP THREADPRIVATE(topsw0_aero,solsw0_aero)
167      REAL, SAVE, ALLOCATABLE :: topswcf_aero(:,:),  solswcf_aero(:,:)  ! diag
168      !$OMP THREADPRIVATE(topswcf_aero,solswcf_aero)
169! LW radiation diagnostics CK
170      REAL, SAVE, ALLOCATABLE :: toplwad_aero(:),  sollwad_aero(:)      ! diag
171      !$OMP THREADPRIVATE(toplwad_aero,sollwad_aero)
172      REAL, SAVE, ALLOCATABLE :: toplwai_aero(:),  sollwai_aero(:)      ! diag
173      !$OMP THREADPRIVATE(toplwai_aero,sollwai_aero)
174      REAL, SAVE, ALLOCATABLE :: toplwad0_aero(:), sollwad0_aero(:)     ! diag
175      !$OMP THREADPRIVATE(toplwad0_aero,sollwad0_aero)
176! Special RRTM
177      REAL, SAVE, ALLOCATABLE :: ZLWFT0_i(:,:),  ZSWFT0_i(:,:)      ! diag
178      !$OMP THREADPRIVATE(ZLWFT0_i,ZSWFT0_i)
179      REAL, SAVE, ALLOCATABLE :: ZFLDN0(:,:),  ZFLUP0(:,:)      ! diag
180      !$OMP THREADPRIVATE(ZFLDN0,ZFLUP0)
181      REAL, SAVE, ALLOCATABLE :: ZFSDN0(:,:),  ZFSUP0(:,:)      ! diag
182      !$OMP THREADPRIVATE(ZFSDN0,ZFSUP0)
183!
184      REAL, SAVE, ALLOCATABLE :: stratomask(:,:)
185      !$OMP THREADPRIVATE(stratomask)
186      REAL, SAVE, ALLOCATABLE :: tausum_aero(:,:,:)
187      !$OMP THREADPRIVATE(tausum_aero)
188      REAL, SAVE, ALLOCATABLE :: drytausum_aero(:,:)
189      !$OMP THREADPRIVATE(drytausum_aero)
190      REAL, SAVE, ALLOCATABLE :: tau3d_aero(:,:,:,:)
191      !$OMP THREADPRIVATE(tau3d_aero)
192      REAL, SAVE, ALLOCATABLE :: scdnc(:,:)
193      !$OMP THREADPRIVATE(scdnc)
194      REAL, SAVE, ALLOCATABLE :: dNovrN(:)
195      !$OMP THREADPRIVATE(dNovrN)
196      REAL, SAVE, ALLOCATABLE :: cldncl(:)
197      !$OMP THREADPRIVATE(cldncl)
198      REAL, SAVE, ALLOCATABLE :: reffclwtop(:)
199      !$OMP THREADPRIVATE(reffclwtop)
200      REAL, SAVE, ALLOCATABLE :: lcc(:)
201      !$OMP THREADPRIVATE(lcc)
202      REAL, SAVE, ALLOCATABLE :: reffclws(:,:)
203      !$OMP THREADPRIVATE(reffclws)
204      REAL, SAVE, ALLOCATABLE :: reffclwc(:,:)
205      !$OMP THREADPRIVATE(reffclwc)
206      REAL, SAVE, ALLOCATABLE :: cldnvi(:)
207      !$OMP THREADPRIVATE(cldnvi)
208      REAL, SAVE, ALLOCATABLE :: lcc3d(:,:)
209      !$OMP THREADPRIVATE(lcc3d)
210      REAL, SAVE, ALLOCATABLE :: lcc3dcon(:,:)
211      !$OMP THREADPRIVATE(lcc3dcon)
212      REAL, SAVE, ALLOCATABLE :: lcc3dstra(:,:)
213      !$OMP THREADPRIVATE(lcc3dstra)
214      REAL, SAVE, ALLOCATABLE :: icc3dcon(:,:)
215      !$OMP THREADPRIVATE(icc3dcon)
216      REAL, SAVE, ALLOCATABLE :: icc3dstra(:,:)
217      !$OMP THREADPRIVATE(icc3dstra)
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!Ajout de celles n??cessaires au phys_output_write_mod
304      REAL, SAVE, ALLOCATABLE :: tal1(:), pal1(:), pab1(:), pab2(:)
305!$OMP THREADPRIVATE(tal1, pal1, pab1, pab2)
306      REAL, SAVE, ALLOCATABLE :: ptstar(:), pt0(:), slp(:)
307!$OMP THREADPRIVATE(ptstar, pt0, slp)
308      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sens, flwp, fiwp
309!$OMP THREADPRIVATE(sens, flwp, fiwp)
310!!
311!!         Wake variables
312      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: alp_wake
313!$OMP THREADPRIVATE(alp_wake)           
314!!jyg!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h,wake_k
315      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h
316      INTEGER,ALLOCATABLE,SAVE,DIMENSION(:)         :: wake_k
317!$OMP THREADPRIVATE(wake_h,wake_k)                       
318    REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)            :: wake_omg
319!$OMP THREADPRIVATE(wake_omg)                     
320    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_wk, d_deltaq_wk
321!$OMP THREADPRIVATE(d_deltat_wk, d_deltaq_wk)
322      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: d_s_wk, d_dens_a_wk, d_dens_wk
323!$OMP THREADPRIVATE(d_s_wk, d_dens_a_wk, d_dens_wk)
324    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_wk_gw, d_deltaq_wk_gw
325!$OMP THREADPRIVATE(d_deltat_wk_gw, d_deltaq_wk_gw)
326    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_vdf, d_deltaq_vdf
327!$OMP THREADPRIVATE(d_deltat_vdf, d_deltaq_vdf)
328!!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_vdf, d_dens_vdf
329!!!OMP THREADPRIVATE(d_s_vdf, d_dens_vdf)
330    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_the, d_deltaq_the
331!$OMP THREADPRIVATE(d_deltat_the, d_deltaq_the)
332!!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_the, d_dens_the
333!!!OMP THREADPRIVATE(d_s_the, d_dens_the)
334      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)           :: d_deltat_ajs_cv, d_deltaq_ajs_cv
335!$OMP THREADPRIVATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)                       
336#ifdef ISO
337    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:,:)          :: d_deltaxt_wk
338!$OMP THREADPRIVATE(d_deltaxt_wk)
339    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:,:)          :: d_deltaxt_wk_gw
340!$OMP THREADPRIVATE(d_deltaxt_wk_gw)
341    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:,:)          ::  d_deltaxt_the
342!$OMP THREADPRIVATE(d_deltaxt_the)
343    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:,:)          ::  d_deltaxt_vdf
344!$OMP THREADPRIVATE(d_deltaxt_vdf)
345      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)           ::  d_deltaxt_ajs_cv
346!$OMP THREADPRIVATE(d_deltaxt_ajs_cv)
347#endif                       
348!!         End of Wake variables
349!!
350      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: bils
351!$OMP THREADPRIVATE(bils)
352      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragm, cdragh
353!$OMP THREADPRIVATE(cdragm, cdragh)
354      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cldh, cldl, cldm, cldq, cldt, qsat2m
355!$OMP THREADPRIVATE(cldh, cldl, cldm, cldq, cldt, qsat2m )
356!AS: cldhjn, cldljn, cldmjn,cldtjn pas utilisés en tant que variables, juste noms de diagnostics
357      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: JrNt
358!$OMP THREADPRIVATE(JrNt)
359      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: dthmin, evap, fder, plcl, plfc, prw, prlw, prsw
360!$OMP THREADPRIVATE(dthmin, evap, fder, plcl, plfc, prw, prlw, prsw)
361      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zustar, zu10m, zv10m, rh2m
362!$OMP THREADPRIVATE(zustar, zu10m, zv10m, rh2m)
363      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_lcl, s_pblh, s_pblt, s_therm
364!$OMP THREADPRIVATE(s_lcl, s_pblh, s_pblt, s_therm)
365!
366!nrlmd+jyg<
367      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_pblh_x, s_pblh_w
368!$OMP THREADPRIVATE(s_pblh_x, s_pblh_w)
369      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_lcl_x, s_lcl_w
370!$OMP THREADPRIVATE(s_lcl_x, s_lcl_w)
371!>nrlmd+jyg
372!
373      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: slab_wfbils
374!$OMP THREADPRIVATE(slab_wfbils)
375      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte
376!$OMP THREADPRIVATE(tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte)
377      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfqcalving
378!$OMP THREADPRIVATE(zxfqcalving)
379      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfluxlat, zxtsol, snow_lsc, zxfqfonte
380!$OMP THREADPRIVATE(zxfluxlat, zxtsol, snow_lsc, zxfqfonte)
381      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxrunofflic
382!$OMP THREADPRIVATE(zxrunofflic)
383      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxqsurf, rain_lsc, rain_num
384!$OMP THREADPRIVATE(zxqsurf, rain_lsc, rain_num)
385#ifdef ISO
386      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: xtevap,xtprw
387!$OMP THREADPRIVATE(xtevap,xtprw)
388      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: h1_diag,runoff_diag
389      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: xtrunoff_diag
390!$OMP THREADPRIVATE(h1_diag,runoff_diag,xtrunoff_diag)
391      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zxfxtcalving
392!$OMP THREADPRIVATE(zxfxtcalving)
393      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: xtsnow_lsc, zxfxtfonte
394!$OMP THREADPRIVATE(xtsnow_lsc, zxfxtfonte)
395      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zxxtrunofflic
396!$OMP THREADPRIVATE(zxxtrunofflic)
397      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: xtrain_lsc
398!$OMP THREADPRIVATE(xtrain_lsc)
399#endif
400!
401!jyg+nrlmd<
402!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
403!                                                                          c
404!       Declarations liees a la couche limite differentiee w-x             c
405!                                                                          c
406!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
407      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sens_x, sens_w
408!$OMP THREADPRIVATE(sens_x, sens_w)
409      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfluxlat_x, zxfluxlat_w
410!$OMP THREADPRIVATE(zxfluxlat_x, zxfluxlat_w)
411      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: delta_qsurf
412!$OMP THREADPRIVATE(delta_qsurf)
413!jyg<
414!!! Entrees supplementaires couche-limite
415!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t_x, t_w
416!!!$OMP THREADPRIVATE(t_x, t_w)
417!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: q_x, q_w
418!!!$OMP THREADPRIVATE(q_x, q_w)
419!>jyg
420!!! Sorties ferret
421      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dtvdf_x, dtvdf_w
422!$OMP THREADPRIVATE(dtvdf_x, dtvdf_w)
423      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dqvdf_x, dqvdf_w
424!$OMP THREADPRIVATE(dqvdf_x, dqvdf_w)
425! Variables supplementaires dans physiq.F relative au splitting de la surface
426      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: pbl_tke_input
427!$OMP THREADPRIVATE(pbl_tke_input)
428! Entree supplementaire Thermiques :
429      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t_therm, q_therm, u_therm, v_therm
430!$OMP THREADPRIVATE(t_therm, q_therm, u_therm, v_therm)
431      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragh_x, cdragh_w
432!$OMP THREADPRIVATE(cdragh_x, cdragh_w)
433      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragm_x, cdragm_w
434!$OMP THREADPRIVATE(cdragm_x, cdragm_w)
435      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: kh, kh_x, kh_w
436!$OMP THREADPRIVATE(kh, kh_x, kh_w)
437#ifdef ISO
438      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: dxtvdf_x, dxtvdf_w
439!$OMP THREADPRIVATE(dxtvdf_x, dxtvdf_w)
440      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: xt_therm
441!$OMP THREADPRIVATE(xt_therm)
442#endif
443!!!
444!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
445      LOGICAL, SAVE, ALLOCATABLE :: ptconv(:,:)
446      !$OMP THREADPRIVATE(ptconv)
447      REAL, SAVE, ALLOCATABLE :: ratqsc(:,:)
448      !$OMP THREADPRIVATE(ratqsc)
449!>jyg+nrlmd
450  !
451      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: wbeff, convoccur, zmax_th, zq2m, zt2m
452!$OMP THREADPRIVATE(wbeff, convoccur, zmax_th, zq2m, zt2m)
453      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zt2m_min_mon, zt2m_max_mon
454!$OMP THREADPRIVATE(zt2m_min_mon, zt2m_max_mon)
455      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: t2m_min_mon, t2m_max_mon
456!$OMP THREADPRIVATE(t2m_min_mon, t2m_max_mon)
457      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: weak_inversion
458!$OMP THREADPRIVATE(weak_inversion)
459      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_conv,alp_bl_det
460!$OMP THREADPRIVATE(alp_bl_conv,alp_bl_det)
461      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_fluct_m,alp_bl_fluct_tke
462!$OMP THREADPRIVATE(alp_bl_fluct_m,alp_bl_fluct_tke)
463      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_stat, n2, s2
464!$OMP THREADPRIVATE(alp_bl_stat, n2, s2)
465      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: proba_notrig, random_notrig
466!$OMP THREADPRIVATE(proba_notrig, random_notrig)
467      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cv_gen
468!$OMP THREADPRIVATE(cv_gen)
469      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: fsolsw, wfbils, wfbilo
470!$OMP THREADPRIVATE(fsolsw, wfbils, wfbilo)
471      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: wfevap, wfrain, wfsnow
472!$OMP THREADPRIVATE(wfevap,wfrain,wfsnow)
473      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: t2m, fluxlat, fsollw,evap_pot
474!$OMP THREADPRIVATE(t2m, fluxlat, fsollw,evap_pot)
475      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dnwd0, omega
476!$OMP THREADPRIVATE(dnwd0, omega)
477      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: epmax_diag ! epmax_cape
478!$OMP THREADPRIVATE(epmax_diag)
479!
480!  Deep convective variables used in phytrac
481      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: ep ! epmax_cape
482!$OMP THREADPRIVATE(ep)
483      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: dnwd, upwd
484!$OMP THREADPRIVATE(dnwd, upwd)
485      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: pmflxr, pmflxs
486!$OMP THREADPRIVATE(pmflxr, pmflxs)
487      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: wdtrainA, wdtrainS, wdtrainM
488!$OMP THREADPRIVATE(wdtrainA, wdtrainS, wdtrainM)
489      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: da, mp
490!$OMP THREADPRIVATE(da, mp)
491      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: wght_cvfd
492!$OMP THREADPRIVATE(wght_cvfd)
493      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:):: phi, phi2, elij, epmlmMm
494!$OMP THREADPRIVATE(phi, phi2, elij, epmlmMm)
495      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: d1a, dam
496!$OMP THREADPRIVATE(d1a, dam)
497      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: ev
498!$OMP THREADPRIVATE(ev)
499      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: qtaa
500!$OMP THREADPRIVATE(qtaa)
501      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: clw
502!$OMP THREADPRIVATE(clw)
503      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: eplaMm
504!$OMP THREADPRIVATE(eplaMm)
505      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:):: sij
506!$OMP THREADPRIVATE(sij)
507#ifdef ISO
508      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: xtwdtrainA
509!$OMP THREADPRIVATE(xtwdtrainA)
510      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: xtev
511!$OMP THREADPRIVATE(xtev)
512      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: xttaa
513!$OMP THREADPRIVATE(xttaa)
514      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: xtclw
515!$OMP THREADPRIVATE(xtclw)
516#ifdef DIAGISO
517      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: qlp
518!$OMP THREADPRIVATE(qlp)
519      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: qvp
520!$OMP THREADPRIVATE(qvp)
521      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: fq_detrainement
522!$OMP THREADPRIVATE(fq_detrainement)
523      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: fq_ddft
524!$OMP THREADPRIVATE(fq_ddft)
525      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: fq_fluxmasse
526!$OMP THREADPRIVATE(fq_fluxmasse)
527      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: fq_evapprecip
528!$OMP THREADPRIVATE(fq_evapprecip)
529      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: f_detrainement
530!$OMP THREADPRIVATE(f_detrainement)
531      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: q_detrainement
532!$OMP THREADPRIVATE(q_detrainement)
533      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: xt_detrainement
534!$OMP THREADPRIVATE(xt_detrainement)
535      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: xtlp
536!$OMP THREADPRIVATE(xtlp)
537      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: xtvp
538!$OMP THREADPRIVATE(xtvp)
539      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: q_the
540!$OMP THREADPRIVATE(q_the)
541      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: xt_the
542!$OMP THREADPRIVATE(xt_the)
543      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: fxt_detrainement
544!$OMP THREADPRIVATE(fxt_detrainement)
545      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: fxt_ddft
546!$OMP THREADPRIVATE(fxt_ddft)
547      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: fxt_fluxmasse
548!$OMP THREADPRIVATE(fxt_fluxmasse)
549      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: fxt_evapprecip
550!$OMP THREADPRIVATE(fxt_evapprecip)
551#endif
552#endif
553!
554!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: coefh, coefm, lambda_th
555      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: lambda_th
556!$OMP THREADPRIVATE(lambda_th)
557      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: cldemi, cldfra, cldtau, fiwc, fl, re, flwc
558!$OMP THREADPRIVATE(cldemi, cldfra, cldtau, fiwc, fl, re, flwc)
559      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: qlth, qith
560!$OMP THREADPRIVATE(qlth, qith)
561      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ref_liq, ref_ice, theta, zphi
562!$OMP THREADPRIVATE(ref_liq, ref_ice, theta, zphi)
563      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ref_liq_pi, ref_ice_pi
564!$OMP THREADPRIVATE(ref_liq_pi, ref_ice_pi)
565      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zx_rh, zx_rhl, zx_rhi
566!$OMP THREADPRIVATE(zx_rh, zx_rhl, zx_rhi)
567      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: prfl, psfl, fraca
568!$OMP THREADPRIVATE(prfl, psfl, fraca)
569      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: Vprecip, zw2
570!$OMP THREADPRIVATE(Vprecip, zw2)
571      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: pmfd, pmfu
572!$OMP THREADPRIVATE(pmfd, pmfu)
573      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: fluxt, fluxu, fluxv
574!$OMP THREADPRIVATE(fluxt, fluxu, fluxv)
575      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: uwriteSTD, vwriteSTD, wwriteSTD
576!$OMP THREADPRIVATE(uwriteSTD, vwriteSTD, wwriteSTD)
577      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD
578!$OMP THREADPRIVATE(phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD)
579
580! ug et d'autres encore:
581      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: beta_prec
582!$OMP THREADPRIVATE(beta_prec)
583      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: rneb,rnebjn,rneblsvol
584!$OMP THREADPRIVATE(rneb,rnebjn,rneblsvol)
585
586! variables de sorties MM
587      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxsnow,snowhgt,qsnow,to_ice
588      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: sissnow,runoff,albsol3_lic
589!$OMP THREADPRIVATE(zxsnow,snowhgt,qsnow,to_ice)
590!$OMP THREADPRIVATE(sissnow,runoff,albsol3_lic)
591#ifdef ISO
592      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: zxxtsnow
593!$OMP THREADPRIVATE(zxxtsnow)     
594      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: xtVprecip,xtVprecipi
595!$OMP THREADPRIVATE(xtVprecip,xtVprecipi)
596      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: pxtrfl, pxtsfl
597!$OMP THREADPRIVATE(pxtrfl, pxtsfl)
598#endif
599
600      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: p_tropopause, z_tropopause, t_tropopause
601!$OMP THREADPRIVATE(p_tropopause, z_tropopause, t_tropopause)
602
603      INTEGER,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zn2mout
604!$OMP THREADPRIVATE(zn2mout)
605
606#ifdef CPP_StratAer
607!
608! variables for stratospheric aerosol
609      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: R2SO4
610!$OMP THREADPRIVATE(R2SO4)
611      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: DENSO4
612!$OMP THREADPRIVATE(DENSO4)
613      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: f_r_wet
614!$OMP THREADPRIVATE(f_r_wet)
615      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: decfluxaer
616!$OMP THREADPRIVATE(decfluxaer)
617      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: mdw
618!$OMP THREADPRIVATE(mdw)
619      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: OCS_lifetime
620!$OMP THREADPRIVATE(OCS_lifetime)
621      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: SO2_lifetime
622!$OMP THREADPRIVATE(SO2_lifetime)
623      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: alpha_bin
624!$OMP THREADPRIVATE(alpha_bin)
625      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: piz_bin
626!$OMP THREADPRIVATE(piz_bin)
627      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: cg_bin
628!$OMP THREADPRIVATE(cg_bin)
629      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tau_strat_550
630!$OMP THREADPRIVATE(tau_strat_550)
631      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tau_strat_1020
632!$OMP THREADPRIVATE(tau_strat_1020)
633      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tausum_strat
634!$OMP THREADPRIVATE(tausum_strat)
635      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: surf_PM25_sulf
636!$OMP THREADPRIVATE(surf_PM25_sulf)
637      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vsed_aer
638!$OMP THREADPRIVATE(vsed_aer)
639!
640!---3D budget variables
641      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_nucl
642!$OMP THREADPRIVATE(budg_3D_nucl)
643      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_cond_evap
644!$OMP THREADPRIVATE(budg_3D_cond_evap)
645      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_ocs_to_so2
646!$OMP THREADPRIVATE(budg_3D_ocs_to_so2)
647      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_so2_to_h2so4
648!$OMP THREADPRIVATE(budg_3D_so2_to_h2so4)
649      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_backgr_ocs
650!$OMP THREADPRIVATE(budg_3D_backgr_ocs)
651      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_backgr_so2
652!$OMP THREADPRIVATE(budg_3D_backgr_so2)
653!
654!---2D budget variables
655      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_ocs
656      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_so2
657      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_h2so4
658      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_part
659!$OMP THREADPRIVATE(budg_dep_dry_ocs,budg_dep_dry_so2,budg_dep_dry_h2so4,budg_dep_dry_part)
660      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_ocs
661      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_so2
662      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_h2so4
663      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_part
664!$OMP THREADPRIVATE(budg_dep_wet_ocs,budg_dep_wet_so2,budg_dep_wet_h2so4,budg_dep_wet_part)
665      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_ocs
666      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_so2
667      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_h2so4
668      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_part
669!$OMP THREADPRIVATE(budg_emi_ocs,budg_emi_so2,budg_emi_h2so4,budg_emi_part)
670      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_ocs_to_so2
671      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_so2_to_h2so4
672      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_h2so4_to_part
673!$OMP THREADPRIVATE(budg_ocs_to_so2,budg_so2_to_h2so4,budg_h2so4_to_part)
674      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_sed_part
675!$OMP THREADPRIVATE(budg_sed_part)
676#endif
677
678CONTAINS
679
680!======================================================================
681SUBROUTINE phys_local_var_init
682USE dimphy
683USE infotrac_phy, ONLY : nbtr
684#ifdef ISO
685USE infotrac_phy, ONLY : ntraciso,niso
686#endif
687USE aero_mod
688USE indice_sol_mod
689USE phys_output_var_mod
690USE phys_state_var_mod
691
692IMPLICIT NONE
693      ALLOCATE(t_seri(klon,klev),q_seri(klon,klev),ql_seri(klon,klev),qs_seri(klon,klev))
694      ALLOCATE(u_seri(klon,klev),v_seri(klon,klev))
695      ALLOCATE(l_mixmin(klon,klev+1,nbsrf), l_mix(klon,klev+1,nbsrf), tke_dissip(klon,klev+1,nbsrf), wprime(klon,klev+1,nbsrf))
696      l_mix(:,:,:)=0. ; l_mixmin(:,:,:)=0. ; tke_dissip(:,:,:)=0. ; wprime(:,:,:)=0. ! doit etre initialse car pas toujours remplis
697
698      ALLOCATE(tr_seri(klon,klev,nbtr))
699      ALLOCATE(d_t_dyn(klon,klev),d_q_dyn(klon,klev))
700      ALLOCATE(d_ql_dyn(klon,klev),d_qs_dyn(klon,klev))
701      ALLOCATE(d_q_dyn2d(klon),d_ql_dyn2d(klon),d_qs_dyn2d(klon))
702      ALLOCATE(d_u_dyn(klon,klev),d_v_dyn(klon,klev))
703      ALLOCATE(d_tr_dyn(klon,klev,nbtr))                   !RomP
704      ALLOCATE(d_t_con(klon,klev),d_q_con(klon,klev))
705      ALLOCATE(d_u_con(klon,klev),d_v_con(klon,klev))
706      ALLOCATE(d_t_wake(klon,klev),d_q_wake(klon,klev))
707      ALLOCATE(d_t_lsc(klon,klev),d_q_lsc(klon,klev))
708      ALLOCATE(d_t_lwr(klon,klev),d_t_lw0(klon,klev))
709      ALLOCATE(d_t_swr(klon,klev),d_t_sw0(klon,klev))
710      ALLOCATE(d_ql_lsc(klon,klev),d_qi_lsc(klon,klev))
711      ALLOCATE(d_t_ajsb(klon,klev),d_q_ajsb(klon,klev))
712      ALLOCATE(d_t_ajs(klon,klev),d_q_ajs(klon,klev))
713!nrlmd<
714      ALLOCATE(d_t_ajs_w(klon,klev),d_q_ajs_w(klon,klev))
715      ALLOCATE(d_t_ajs_x(klon,klev),d_q_ajs_x(klon,klev))
716!>nrlmd
717      ALLOCATE(d_u_ajs(klon,klev),d_v_ajs(klon,klev))
718      ALLOCATE(d_t_eva(klon,klev),d_q_eva(klon,klev))
719      ALLOCATE(d_ql_eva(klon,klev),d_qi_eva(klon,klev))
720      ALLOCATE(d_t_lscst(klon,klev),d_q_lscst(klon,klev))
721      ALLOCATE(d_t_lscth(klon,klev),d_q_lscth(klon,klev))
722      ALLOCATE(plul_st(klon),plul_th(klon))
723      ALLOCATE(d_t_vdf(klon,klev),d_q_vdf(klon,klev),d_t_diss(klon,klev))
724
725      ALLOCATE(d_t_vdf_w(klon,klev),d_q_vdf_w(klon,klev))
726      ALLOCATE(d_t_vdf_x(klon,klev),d_q_vdf_x(klon,klev))
727#ifdef ISO
728      allocate(xt_seri(ntraciso,klon,klev))
729      allocate(xtl_seri(ntraciso,klon,klev))
730      allocate(xts_seri(ntraciso,klon,klev))
731      allocate(d_xt_dyn(ntraciso,klon,klev))
732      allocate(d_xtl_dyn(ntraciso,klon,klev))
733      allocate(d_xts_dyn(ntraciso,klon,klev))
734      allocate(d_xt_con(ntraciso,klon,klev))
735      allocate(d_xt_wake(ntraciso,klon,klev))
736      allocate(d_xt_lsc(ntraciso,klon,klev))
737      allocate(d_xtl_lsc(ntraciso,klon,klev))
738      allocate(d_xti_lsc(ntraciso,klon,klev))
739      allocate(d_xt_ajsb(ntraciso,klon,klev))
740      allocate(d_xt_ajs(ntraciso,klon,klev))
741      allocate(d_xt_ajs_w(ntraciso,klon,klev))
742      allocate(d_xt_ajs_x(ntraciso,klon,klev))
743      allocate(d_xt_eva(ntraciso,klon,klev))
744      allocate(d_xtl_eva(ntraciso,klon,klev))
745      allocate(d_xti_eva(ntraciso,klon,klev))
746      allocate(d_xt_vdf(ntraciso,klon,klev)) 
747      allocate(d_xt_vdf_w(ntraciso,klon,klev))
748      allocate(d_xt_vdf_x(ntraciso,klon,klev))
749      allocate(d_xt_ch4(ntraciso,klon,klev))
750      allocate(d_xt_prod_nucl(ntraciso,klon,klev))
751      allocate(d_xt_cosmo(ntraciso,klon,klev))
752      allocate(d_xt_decroiss(ntraciso,klon,klev))
753#endif
754
755      ALLOCATE(d_u_vdf(klon,klev),d_v_vdf(klon,klev))
756      ALLOCATE(d_t_oli(klon,klev),d_t_oro(klon,klev))
757      ALLOCATE(d_u_oli(klon,klev),d_v_oli(klon,klev))
758      ALLOCATE(d_u_oro(klon,klev),d_v_oro(klon,klev))
759      ALLOCATE(d_u_oro_gw(klon,klev),d_v_oro_gw(klon,klev))
760      ALLOCATE(d_t_oro_gw(klon,klev))
761      ALLOCATE(d_t_lif(klon,klev),d_t_ec(klon,klev))
762      ALLOCATE(d_u_lif(klon,klev),d_v_lif(klon,klev))
763      ALLOCATE(d_ts(klon,nbsrf), d_tr(klon,klev,nbtr))
764! Special RRTM
765      ALLOCATE(ZLWFT0_i(klon,klev+1),ZSWFT0_i(klon,klev+1),ZFLDN0(klon,klev+1))
766      ZFLDN0= 0.
767      ALLOCATE(ZFLUP0(klon,klev+1),ZFSDN0(klon,klev+1),ZFSUP0(klon,klev+1))
768!
769      ALLOCATE(topswad_aero(klon), solswad_aero(klon))
770      ALLOCATE(topswai_aero(klon), solswai_aero(klon))
771      ALLOCATE(topswad0_aero(klon), solswad0_aero(klon))
772      ALLOCATE(toplwad_aero(klon), sollwad_aero(klon))
773      ALLOCATE(toplwai_aero(klon), sollwai_aero(klon))
774      ALLOCATE(toplwad0_aero(klon), sollwad0_aero(klon))
775      ALLOCATE(topsw_aero(klon,naero_grp), solsw_aero(klon,naero_grp))
776      ALLOCATE(topsw0_aero(klon,naero_grp), solsw0_aero(klon,naero_grp))
777      ALLOCATE(topswcf_aero(klon,3), solswcf_aero(klon,3))
778      ALLOCATE(du_gwd_hines(klon,klev),dv_gwd_hines(klon,klev))
779      ALLOCATE(dv_gwd_rando(klon,klev),dv_gwd_front(klon,klev))
780      ALLOCATE(east_gwstress(klon,klev),west_gwstress(klon,klev))
781      east_gwstress(:,:)=0 !ym missing init
782      west_gwstress(:,:)=0 !ym missing init
783      ALLOCATE(d_t_hin(klon,klev))
784      ALLOCATE(d_q_ch4(klon,klev))
785      ALLOCATE(stratomask(klon,klev))
786      ALLOCATE(tausum_aero(klon,nwave,naero_tot))
787      ALLOCATE(drytausum_aero(klon,naero_tot))
788      ALLOCATE(tau3d_aero(klon,klev,nwave,naero_tot))
789      ALLOCATE(scdnc(klon, klev))
790      ALLOCATE(dNovrN(klon))
791      ALLOCATE(cldncl(klon))
792      ALLOCATE(reffclwtop(klon))
793      ALLOCATE(lcc(klon))
794      ALLOCATE(reffclws(klon, klev))
795      ALLOCATE(reffclwc(klon, klev))
796      ALLOCATE(cldnvi(klon))
797      ALLOCATE(lcc3d(klon, klev))
798      ALLOCATE(lcc3dcon(klon, klev))
799      ALLOCATE(lcc3dstra(klon, klev))
800      ALLOCATE(icc3dcon(klon, klev))
801      ALLOCATE(icc3dstra(klon, klev))
802      ALLOCATE(zfice(klon, klev))
803      ALLOCATE(od443aer(klon))
804      ALLOCATE(od550aer(klon))
805      ALLOCATE(od865aer(klon))
806      ALLOCATE(dryod550aer(klon))
807      dryod550aer(:) = 0.
808      ALLOCATE(abs550aer(klon))
809      abs550aer(:) = 0.
810      ALLOCATE(ec550aer(klon,klev))
811      ALLOCATE(od550lt1aer(klon))
812      ALLOCATE(sconcso4(klon))
813      ALLOCATE(sconcno3(klon))
814      ALLOCATE(sconcoa(klon))
815      ALLOCATE(sconcbc(klon))
816      ALLOCATE(sconcss(klon))
817      ALLOCATE(sconcdust(klon))
818      ALLOCATE(concso4(klon,klev))
819      ALLOCATE(concno3(klon,klev))
820      ALLOCATE(concoa(klon,klev))
821      ALLOCATE(concbc(klon,klev))
822      ALLOCATE(concss(klon,klev))
823      ALLOCATE(concdust(klon,klev))
824      ALLOCATE(loadso4(klon))
825      ALLOCATE(loadoa(klon))
826      ALLOCATE(loadbc(klon))
827      ALLOCATE(loadss(klon))
828      ALLOCATE(loaddust(klon))
829      ALLOCATE(loadno3(klon))
830      ALLOCATE(load_tmp1(klon))
831      ALLOCATE(load_tmp2(klon))
832      ALLOCATE(load_tmp3(klon))
833      ALLOCATE(load_tmp4(klon))
834      ALLOCATE(load_tmp5(klon))
835      ALLOCATE(load_tmp6(klon))
836      ALLOCATE(load_tmp7(klon))
837      ALLOCATE(load_tmp8(klon))
838      ALLOCATE(load_tmp9(klon))
839      ALLOCATE(load_tmp10(klon))
840
841!IM ajout variables CFMIP2/CMIP5
842      ALLOCATE(topswad_aerop(klon), solswad_aerop(klon))
843      ALLOCATE(topswai_aerop(klon), solswai_aerop(klon))
844      ALLOCATE(topswad0_aerop(klon), solswad0_aerop(klon))
845      ALLOCATE(topsw_aerop(klon,naero_grp), topsw0_aerop(klon,naero_grp))
846      ALLOCATE(solsw_aerop(klon,naero_grp), solsw0_aerop(klon,naero_grp))
847      ALLOCATE(topswcf_aerop(klon,naero_grp), solswcf_aerop(klon,naero_grp))
848
849! additional LW variables CK
850      ALLOCATE(toplwad_aerop(klon), sollwad_aerop(klon))
851      ALLOCATE(toplwai_aerop(klon), sollwai_aerop(klon))
852      ALLOCATE(toplwad0_aerop(klon), sollwad0_aerop(klon))
853
854! FH Ajout de celles necessaires au phys_output_write_mod
855
856      ALLOCATE(tal1(klon), pal1(klon), pab1(klon), pab2(klon))
857      ALLOCATE(ptstar(klon),pt0(klon),slp(klon))
858!!
859!!          Wake variables
860      ALLOCATE(alp_wake(klon))
861      ALLOCATE(wake_h(klon),wake_k(klon))
862      ALLOCATE(wake_omg(klon, klev))
863      ALLOCATE(d_deltat_wk(klon, klev), d_deltaq_wk(klon, klev))
864      ALLOCATE(d_s_wk(klon), d_dens_a_wk(klon), d_dens_wk(klon))
865      ALLOCATE(d_deltat_wk_gw(klon, klev), d_deltaq_wk_gw(klon, klev))
866      ALLOCATE(d_deltat_vdf(klon, klev), d_deltaq_vdf(klon, klev))
867!!      ALLOCATE( d_s_vdf(klon), d_dens_vdf(klon))
868      ALLOCATE(d_deltat_the(klon, klev), d_deltaq_the(klon, klev))
869!!      ALLOCATE( d_s_the(klon), d_dens_the(klon))
870      ALLOCATE(d_deltat_ajs_cv(klon, klev), d_deltaq_ajs_cv(klon, klev))
871#ifdef ISO
872      ALLOCATE(d_deltaxt_wk(ntraciso,klon, klev))
873      ALLOCATE(d_deltaxt_wk_gw(ntraciso,klon, klev))
874      ALLOCATE(d_deltaxt_the(ntraciso,klon, klev))
875      ALLOCATE(d_deltaxt_vdf(ntraciso,klon, klev))
876      ALLOCATE(d_deltaxt_ajs_cv(ntraciso,klon, klev))
877#endif
878!!         End of wake variables
879!!
880      ALLOCATE(bils(klon))
881      ALLOCATE(cdragm(klon), cdragh(klon), cldh(klon), cldl(klon))
882      ALLOCATE(cldm(klon), cldq(klon), cldt(klon), qsat2m(klon))
883      ALLOCATE(JrNt(klon))
884      ALLOCATE(dthmin(klon), evap(klon), fder(klon), plcl(klon), plfc(klon))
885      ALLOCATE(prw(klon), prlw(klon), prsw(klon), zustar(klon), zu10m(klon), zv10m(klon), rh2m(klon))
886      ALLOCATE(s_lcl(klon))
887      ALLOCATE(s_pblh(klon), s_pblt(klon), s_therm(klon))
888!
889!nrlmd+jyg<
890      ALLOCATE(s_pblh_x(klon), s_pblh_w(klon))
891      ALLOCATE(s_lcl_x(klon), s_lcl_w(klon))
892!>nrlmd+jyg
893!
894      ALLOCATE(slab_wfbils(klon), tpot(klon), tpote(klon), ue(klon))
895      ALLOCATE(uq(klon), ve(klon), vq(klon), zxffonte(klon))
896      ALLOCATE(uwat(klon), vwat(klon))
897      ALLOCATE(zxfqcalving(klon), zxfluxlat(klon))
898      ALLOCATE(zxtsol(klon), snow_lsc(klon), zxfqfonte(klon), zxqsurf(klon))
899      ALLOCATE(zxrunofflic(klon))
900      ALLOCATE(rain_lsc(klon))
901      ALLOCATE(rain_num(klon))
902      ALLOCATE(qlth(klon,klev), qith(klon,klev))
903      !
904#ifdef ISO
905      ALLOCATE(xtevap(ntraciso,klon))
906      ALLOCATE(xtprw(ntraciso,klon))
907      ALLOCATE(zxfxtcalving(niso,klon))
908      ALLOCATE(xtsnow_lsc(ntraciso,klon), zxfxtfonte(niso,klon))
909      ALLOCATE(zxxtrunofflic(niso,klon))
910      ALLOCATE(xtrain_lsc(ntraciso,klon))
911      ALLOCATE(xtrunoff_diag(niso,klon))
912      ALLOCATE(h1_diag(klon),runoff_diag(klon))
913#endif
914!
915      ALLOCATE(sens_x(klon), sens_w(klon))
916      ALLOCATE(zxfluxlat_x(klon), zxfluxlat_w(klon))
917      ALLOCATE(delta_qsurf(klon))
918!jyg<
919!!      ALLOCATE(t_x(klon,klev), t_w(klon,klev))
920!!      ALLOCATE(q_x(klon,klev), q_w(klon,klev))
921!>jyg
922      ALLOCATE(dtvdf_x(klon,klev), dtvdf_w(klon,klev))
923      dtvdf_x = 0 ; dtvdf_w=0 ;   !ym missing init
924      ALLOCATE(dqvdf_x(klon,klev), dqvdf_w(klon,klev))
925      dqvdf_x = 0 ; dqvdf_w=0 ;   !ym missing init
926      ALLOCATE(pbl_tke_input(klon,klev+1,nbsrf))
927      ALLOCATE(t_therm(klon,klev), q_therm(klon,klev),u_therm(klon,klev), v_therm(klon,klev))
928      ALLOCATE(cdragh_x(klon), cdragh_w(klon))
929      ALLOCATE(cdragm_x(klon), cdragm_w(klon))
930      ALLOCATE(kh(klon), kh_x(klon), kh_w(klon))
931#ifdef ISO
932      ALLOCATE(dxtvdf_x(ntraciso,klon,klev), dxtvdf_w(ntraciso,klon,klev))
933      ALLOCATE(xt_therm(ntraciso,klon,klev))
934#endif
935!
936      ALLOCATE(ptconv(klon,klev))
937      ALLOCATE(ratqsc(klon,klev))
938!
939      ALLOCATE(wbeff(klon), convoccur(klon), zmax_th(klon))
940      ALLOCATE(zq2m(klon), zt2m(klon), weak_inversion(klon))
941      ALLOCATE(zt2m_min_mon(klon), zt2m_max_mon(klon))
942      ALLOCATE(t2m_min_mon(klon), t2m_max_mon(klon))
943      ALLOCATE(sens(klon), flwp(klon), fiwp(klon))
944      ALLOCATE(alp_bl_conv(klon), alp_bl_det(klon))
945      alp_bl_conv(:)=0 ;  alp_bl_det(:)=0
946      ALLOCATE(alp_bl_fluct_m(klon), alp_bl_fluct_tke(klon))
947      alp_bl_fluct_m(:)=0 ; alp_bl_fluct_tke(:)= 0.
948      ALLOCATE(alp_bl_stat(klon), n2(klon), s2(klon))
949      alp_bl_stat(:)=0
950      ALLOCATE(proba_notrig(klon), random_notrig(klon))
951      ALLOCATE(cv_gen(klon))
952
953      ALLOCATE(dnwd0(klon, klev))
954!      ALLOCATE(upwd(klon, klev), omega(klon, klev), coefh(klon, klev))
955      ALLOCATE(omega(klon, klev))
956      ALLOCATE(epmax_diag(klon)) ! epmax_cape
957!      ALLOCATE(coefm(klon, klev), lambda_th(klon, klev), cldemi(klon, klev))
958      ALLOCATE(lambda_th(klon, klev), cldemi(klon, klev))
959      ALLOCATE(cldfra(klon, klev), cldtau(klon, klev), fiwc(klon, klev))
960      ALLOCATE(fl(klon, klev), re(klon, klev), flwc(klon, klev))
961      ALLOCATE(ref_liq(klon, klev), ref_ice(klon, klev), theta(klon, klev))
962      ALLOCATE(ref_liq_pi(klon, klev), ref_ice_pi(klon, klev))
963      ALLOCATE(zphi(klon, klev), zx_rh(klon, klev), zx_rhl(klon,klev), zx_rhi(klon,klev))
964      ALLOCATE(pmfd(klon, klev), pmfu(klon, klev))
965
966      ALLOCATE(t2m(klon, nbsrf), fluxlat(klon, nbsrf))
967      ALLOCATE(fsollw(klon, nbsrf))
968      ALLOCATE(fsolsw(klon, nbsrf), wfbils(klon, nbsrf), wfbilo(klon, nbsrf))
969      ALLOCATE(wfevap(klon, nbsrf), wfrain(klon,nbsrf), wfsnow(klon, nbsrf))
970      ALLOCATE(evap_pot(klon, nbsrf))
971!
972!  Deep convective variables used in phytrac
973      ALLOCATE(pmflxr(klon, klev+1), pmflxs(klon, klev+1))
974      ALLOCATE(wdtrainA(klon,klev),wdtrainS(klon,klev),wdtrainM(klon,klev))
975      ALLOCATE(dnwd(klon, klev), upwd(klon, klev) )
976      ALLOCATE(ep(klon,klev))                          ! epmax_cape
977      ALLOCATE(da(klon,klev), mp(klon,klev) )
978      ALLOCATE(phi(klon,klev,klev) )
979      ALLOCATE(wght_cvfd(klon,klev) )
980      ALLOCATE(phi2(klon,klev,klev) )
981      ALLOCATE(d1a(klon,klev), dam(klon,klev))
982      ALLOCATE(ev(klon,klev) )
983      ALLOCATE(elij(klon,klev,klev) )
984      ALLOCATE(qtaa(klon,klev) )
985      ALLOCATE(clw(klon,klev) )
986      ALLOCATE(epmlmMm(klon,klev,klev), eplaMm(klon,klev) )
987      ALLOCATE(sij(klon,klev,klev) )
988#ifdef ISO
989      ALLOCATE(xtwdtrainA(ntraciso,klon,klev))
990      ALLOCATE(xtev(ntraciso,klon,klev) )
991      ALLOCATE(xttaa(ntraciso,klon,klev) )
992      ALLOCATE(xtclw(ntraciso,klon,klev) )
993#ifdef DIAGISO
994      ALLOCATE(qlp(klon,klev))
995      ALLOCATE(qvp(klon,klev))
996      ALLOCATE(fq_detrainement(klon,klev))
997      ALLOCATE(fq_ddft(klon,klev))
998      ALLOCATE(fq_fluxmasse(klon,klev))
999      ALLOCATE(fq_evapprecip(klon,klev))
1000      ALLOCATE(f_detrainement(klon,klev), q_detrainement(klon,klev))
1001      ALLOCATE(xtlp(ntraciso,klon,klev))
1002      ALLOCATE(xtvp(ntraciso,klon,klev))
1003      ALLOCATE(q_the(klon,klev), xt_the(ntraciso,klon,klev))
1004      ALLOCATE(fxt_detrainement(ntraciso,klon,klev))
1005      ALLOCATE(fxt_ddft(ntraciso,klon,klev))
1006      ALLOCATE(fxt_fluxmasse(ntraciso,klon,klev))
1007      ALLOCATE(fxt_evapprecip(ntraciso,klon,klev))
1008      ALLOCATE(xt_detrainement(ntraciso,klon,klev))
1009#endif
1010#endif
1011
1012      ALLOCATE(prfl(klon, klev+1))
1013      ALLOCATE(psfl(klon, klev+1), fraca(klon, klev+1), Vprecip(klon, klev+1))
1014      ALLOCATE(zw2(klon, klev+1))
1015
1016      ALLOCATE(fluxu(klon, klev, nbsrf), fluxv(klon, klev, nbsrf))
1017      ALLOCATE(fluxt(klon, klev, nbsrf))
1018
1019      ALLOCATE(uwriteSTD(klon,nlevSTD,nfiles), vwriteSTD(klon,nlevSTD,nfiles))
1020      ALLOCATE(wwriteSTD(klon,nlevSTD,nfiles), phiwriteSTD(klon,nlevSTD,nfiles))
1021      ALLOCATE(qwriteSTD(klon,nlevSTD,nfiles), twriteSTD(klon,nlevSTD,nfiles))
1022      ALLOCATE(rhwriteSTD(klon,nlevSTD,nfiles))
1023
1024! ug et d'autres encore:
1025      ALLOCATE(beta_prec(klon,klev))
1026      ALLOCATE(rneb(klon,klev),rnebjn(klon,klev),rneblsvol(klon,klev))
1027
1028
1029      ALLOCATE (zxsnow(klon),snowhgt(klon),qsnow(klon),to_ice(klon))
1030      ALLOCATE (sissnow(klon),runoff(klon),albsol3_lic(klon))
1031#ifdef ISO
1032      ALLOCATE (zxxtsnow(niso,klon))
1033      ALLOCATE(xtVprecip(ntraciso,klon, klev+1),xtVprecipi(ntraciso,klon, klev+1))
1034      ALLOCATE(pxtsfl(ntraciso,klon, klev+1),pxtrfl(ntraciso,klon, klev+1))
1035#endif
1036
1037      ALLOCATE (p_tropopause(klon))
1038      ALLOCATE (z_tropopause(klon))
1039      ALLOCATE (t_tropopause(klon))
1040
1041      ALLOCATE(zn2mout(klon,6))
1042
1043#ifdef CPP_StratAer
1044      ALLOCATE (R2SO4(klon,klev))
1045      ALLOCATE (DENSO4(klon,klev))
1046      ALLOCATE (f_r_wet(klon,klev))
1047      ALLOCATE (decfluxaer(klon,nbtr))
1048      ALLOCATE (mdw(nbtr))
1049      ALLOCATE (budg_3D_nucl(klon,klev))
1050      ALLOCATE (budg_3D_cond_evap(klon,klev))
1051      ALLOCATE (budg_3D_ocs_to_so2(klon,klev))
1052      ALLOCATE (budg_3D_so2_to_h2so4(klon,klev))
1053      ALLOCATE (budg_3D_backgr_ocs(klon,klev))
1054      ALLOCATE (budg_3D_backgr_so2(klon,klev))
1055      ALLOCATE (OCS_lifetime(klon,klev))
1056      ALLOCATE (SO2_lifetime(klon,klev))
1057      ALLOCATE (alpha_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave,nbtr))
1058      ALLOCATE (piz_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave,nbtr))
1059      ALLOCATE (cg_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave,nbtr))
1060      ALLOCATE (tau_strat_550(klon,klev))
1061      ALLOCATE (tau_strat_1020(klon,klev))
1062      ALLOCATE (tausum_strat(klon,3))
1063      ALLOCATE (budg_dep_dry_ocs(klon))
1064      ALLOCATE (budg_dep_wet_ocs(klon))
1065      ALLOCATE (budg_dep_dry_so2(klon))
1066      ALLOCATE (budg_dep_wet_so2(klon))
1067      ALLOCATE (budg_dep_dry_h2so4(klon))
1068      ALLOCATE (budg_dep_wet_h2so4(klon))
1069      ALLOCATE (budg_dep_dry_part(klon))
1070      ALLOCATE (budg_dep_wet_part(klon))
1071      ALLOCATE (budg_emi_ocs(klon))
1072      ALLOCATE (budg_emi_so2(klon))
1073      ALLOCATE (budg_emi_h2so4(klon))
1074      ALLOCATE (budg_emi_part(klon))
1075      ALLOCATE (budg_ocs_to_so2(klon))
1076      ALLOCATE (budg_so2_to_h2so4(klon))
1077      ALLOCATE (budg_h2so4_to_part(klon))
1078      ALLOCATE (budg_sed_part(klon))
1079      ALLOCATE (surf_PM25_sulf(klon))
1080      ALLOCATE (vsed_aer(klon,klev))
1081#endif
1082
1083END SUBROUTINE phys_local_var_init
1084
1085!======================================================================
1086SUBROUTINE phys_local_var_end
1087USE dimphy
1088USE indice_sol_mod
1089IMPLICIT NONE
1090      DEALLOCATE(t_seri,q_seri,ql_seri,qs_seri)
1091      DEALLOCATE(u_seri,v_seri)
1092      DEALLOCATE(l_mixmin,l_mix, tke_dissip, wprime)
1093
1094      DEALLOCATE(tr_seri)
1095      DEALLOCATE(d_t_dyn,d_q_dyn)
1096      DEALLOCATE(d_ql_dyn,d_qs_dyn)
1097      DEALLOCATE(d_q_dyn2d,d_ql_dyn2d,d_qs_dyn2d)
1098      DEALLOCATE(d_u_dyn,d_v_dyn)
1099      DEALLOCATE(d_tr_dyn)                      !RomP
1100      DEALLOCATE(d_t_con,d_q_con)
1101      DEALLOCATE(d_u_con,d_v_con)
1102      DEALLOCATE(d_t_wake,d_q_wake)
1103      DEALLOCATE(d_t_lsc,d_q_lsc)
1104      DEALLOCATE(d_t_lwr,d_t_lw0)
1105      DEALLOCATE(d_t_swr,d_t_sw0)
1106      DEALLOCATE(d_ql_lsc,d_qi_lsc)
1107      DEALLOCATE(d_t_ajsb,d_q_ajsb)
1108      DEALLOCATE(d_t_ajs,d_q_ajs)
1109!nrlmd<
1110      DEALLOCATE(d_t_ajs_w,d_q_ajs_w)
1111      DEALLOCATE(d_t_ajs_x,d_q_ajs_x)
1112!>nrlmd
1113      DEALLOCATE(d_u_ajs,d_v_ajs)
1114      DEALLOCATE(d_t_eva,d_q_eva)
1115      DEALLOCATE(d_ql_eva,d_qi_eva)
1116      DEALLOCATE(d_t_lscst,d_q_lscst)
1117      DEALLOCATE(d_t_lscth,d_q_lscth)
1118      DEALLOCATE(plul_st,plul_th)
1119      DEALLOCATE(d_t_vdf,d_q_vdf,d_t_diss)
1120#ifdef ISO
1121      deallocate(xt_seri,xtl_seri,xts_seri)
1122      DEALLOCATE(d_xtl_eva,d_xti_eva)
1123      deallocate(d_xt_dyn,d_xtl_dyn,d_xts_dyn)
1124      deallocate(d_xt_con)
1125      deallocate(d_xt_wake)
1126      deallocate(d_xt_lsc)
1127      deallocate(d_xtl_lsc,d_xti_lsc)
1128      deallocate(d_xt_ajsb)
1129      deallocate(d_xt_ajs)
1130      deallocate(d_xt_ajs_w,d_xt_ajs_x)
1131      deallocate(d_xt_eva)
1132      deallocate(d_xtl_eva)
1133      deallocate(d_xti_eva)
1134      deallocate(d_xt_vdf)
1135      deallocate(d_xt_vdf_w,d_xt_vdf_x)
1136      deallocate(d_xt_ch4)
1137      deallocate(d_xt_prod_nucl)
1138      deallocate(d_xt_cosmo)
1139      deallocate(d_xt_decroiss)
1140#endif
1141
1142      DEALLOCATE(d_u_vdf,d_v_vdf)
1143      DEALLOCATE(d_t_oli,d_t_oro)
1144      DEALLOCATE(d_u_oli,d_v_oli)
1145      DEALLOCATE(d_u_oro,d_v_oro)
1146      DEALLOCATE(d_t_oro_gw)
1147      DEALLOCATE(d_u_oro_gw,d_v_oro_gw)
1148      DEALLOCATE(d_t_lif,d_t_ec)
1149      DEALLOCATE(d_u_lif,d_v_lif)
1150      DEALLOCATE(d_ts, d_tr)
1151      DEALLOCATE(topswad_aero,solswad_aero)
1152      DEALLOCATE(topswai_aero,solswai_aero)
1153      DEALLOCATE(topswad0_aero,solswad0_aero)
1154      DEALLOCATE(toplwad_aero,sollwad_aero)
1155      DEALLOCATE(toplwai_aero,sollwai_aero)
1156      DEALLOCATE(toplwad0_aero,sollwad0_aero)
1157      DEALLOCATE(topsw_aero,solsw_aero)
1158      DEALLOCATE(topsw0_aero,solsw0_aero)
1159      DEALLOCATE(topswcf_aero,solswcf_aero)
1160      DEALLOCATE(stratomask)
1161      DEALLOCATE(tausum_aero)
1162      DEALLOCATE(drytausum_aero)
1163      DEALLOCATE(tau3d_aero)
1164      DEALLOCATE(scdnc)
1165      DEALLOCATE(dNovrN)
1166      DEALLOCATE(cldncl)
1167      DEALLOCATE(reffclwtop)
1168      DEALLOCATE(lcc)
1169      DEALLOCATE(reffclws)
1170      DEALLOCATE(reffclwc)
1171      DEALLOCATE(cldnvi)
1172      DEALLOCATE(lcc3d)
1173      DEALLOCATE(lcc3dcon)
1174      DEALLOCATE(lcc3dstra)
1175      DEALLOCATE(icc3dcon)
1176      DEALLOCATE(icc3dstra)
1177      DEALLOCATE(zfice)
1178      DEALLOCATE(od443aer)
1179      DEALLOCATE(od550aer)
1180      DEALLOCATE(od865aer)
1181      DEALLOCATE(dryod550aer)
1182      DEALLOCATE(abs550aer)
1183      DEALLOCATE(ec550aer)
1184      DEALLOCATE(od550lt1aer)
1185      DEALLOCATE(sconcso4)
1186      DEALLOCATE(sconcno3)
1187      DEALLOCATE(sconcoa)
1188      DEALLOCATE(sconcbc)
1189      DEALLOCATE(sconcss)
1190      DEALLOCATE(sconcdust)
1191      DEALLOCATE(concso4)
1192      DEALLOCATE(concno3)
1193      DEALLOCATE(concoa)
1194      DEALLOCATE(concbc)
1195      DEALLOCATE(concss)
1196      DEALLOCATE(concdust)
1197      DEALLOCATE(loadso4)
1198      DEALLOCATE(loadoa)
1199      DEALLOCATE(loadbc)
1200      DEALLOCATE(loadss)
1201      DEALLOCATE(loaddust)
1202      DEALLOCATE(loadno3)
1203      DEALLOCATE(load_tmp1)
1204      DEALLOCATE(load_tmp2)
1205      DEALLOCATE(load_tmp3)
1206      DEALLOCATE(load_tmp4)
1207      DEALLOCATE(load_tmp5)
1208      DEALLOCATE(load_tmp6)
1209      DEALLOCATE(load_tmp7)
1210      DEALLOCATE(load_tmp8)
1211      DEALLOCATE(load_tmp9)
1212      DEALLOCATE(load_tmp10)
1213      DEALLOCATE(du_gwd_hines,dv_gwd_hines,d_t_hin)
1214      DEALLOCATE(d_q_ch4)
1215      DEALLOCATE(dv_gwd_rando,dv_gwd_front)
1216      DEALLOCATE(east_gwstress,west_gwstress)
1217
1218!IM ajout variables CFMIP2/CMIP5
1219      DEALLOCATE(topswad_aerop, solswad_aerop)
1220      DEALLOCATE(topswai_aerop, solswai_aerop)
1221      DEALLOCATE(topswad0_aerop, solswad0_aerop)
1222      DEALLOCATE(topsw_aerop, topsw0_aerop)
1223      DEALLOCATE(solsw_aerop, solsw0_aerop)
1224      DEALLOCATE(topswcf_aerop, solswcf_aerop)
1225
1226!CK LW diagnostics
1227      DEALLOCATE(toplwad_aerop, sollwad_aerop)
1228      DEALLOCATE(toplwai_aerop, sollwai_aerop)
1229      DEALLOCATE(toplwad0_aerop, sollwad0_aerop)
1230
1231! FH Ajout de celles necessaires au phys_output_write_mod
1232      DEALLOCATE(tal1, pal1, pab1, pab2)
1233      DEALLOCATE(ptstar, pt0, slp)
1234!
1235      DEALLOCATE(alp_wake)
1236      DEALLOCATE(wake_h,wake_k)
1237      DEALLOCATE(wake_omg)
1238      DEALLOCATE(d_deltat_wk, d_deltaq_wk)
1239      DEALLOCATE(d_s_wk, d_dens_a_wk, d_dens_wk)
1240      DEALLOCATE(d_deltat_wk_gw, d_deltaq_wk_gw)
1241      DEALLOCATE(d_deltat_vdf, d_deltaq_vdf)
1242!!      DEALLOCATE( d_s_vdf, d_dens_vdf)
1243      DEALLOCATE(d_deltat_the, d_deltaq_the)
1244!!      DEALLOCATE( d_s_the, d_dens_the)
1245      DEALLOCATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)
1246#ifdef ISO
1247      DEALLOCATE(d_deltaxt_wk)
1248      DEALLOCATE(d_deltaxt_wk_gw)
1249      DEALLOCATE(d_deltaxt_ajs_cv)
1250      DEALLOCATE(d_deltaxt_vdf)
1251#endif
1252!
1253      DEALLOCATE(bils)
1254      DEALLOCATE(cdragm, cdragh, cldh, cldl)
1255      DEALLOCATE(cldm, cldq, cldt, qsat2m)
1256      DEALLOCATE(JrNt)
1257      DEALLOCATE(dthmin, evap, fder, plcl, plfc)
1258      DEALLOCATE(prw, prlw, prsw, zustar, zu10m, zv10m, rh2m, s_lcl)
1259      DEALLOCATE(s_pblh, s_pblt, s_therm)
1260!
1261!nrlmd+jyg<
1262      DEALLOCATE(s_pblh_x, s_pblh_w)
1263      DEALLOCATE(s_lcl_x, s_lcl_w)
1264!>nrlmd+jyg
1265!
1266      DEALLOCATE(slab_wfbils, tpot, tpote, ue)
1267      DEALLOCATE(uq, ve, vq, zxffonte)
1268      DEALLOCATE(uwat, vwat)
1269      DEALLOCATE(zxfqcalving, zxfluxlat)
1270      DEALLOCATE(zxrunofflic)
1271      DEALLOCATE(zxtsol, snow_lsc, zxfqfonte, zxqsurf)
1272      DEALLOCATE(rain_lsc)
1273      DEALLOCATE(rain_num)
1274      DEALLOCATE(qlth, qith)
1275!
1276      DEALLOCATE(sens_x, sens_w)
1277      DEALLOCATE(zxfluxlat_x, zxfluxlat_w)
1278      DEALLOCATE(delta_qsurf)
1279!jyg<
1280!!      DEALLOCATE(t_x, t_w)
1281!!      DEALLOCATE(q_x, q_w)
1282!>jyg
1283      DEALLOCATE(d_t_vdf_x, d_t_vdf_w)
1284      DEALLOCATE(d_q_vdf_x, d_q_vdf_w)
1285      DEALLOCATE(pbl_tke_input)
1286      DEALLOCATE(t_therm, q_therm, u_therm, v_therm)
1287      DEALLOCATE(cdragh_x, cdragh_w)
1288      DEALLOCATE(cdragm_x, cdragm_w)
1289      DEALLOCATE(kh, kh_x, kh_w)
1290#ifdef ISO
1291      DEALLOCATE(xtevap,xtprw)
1292      DEALLOCATE(zxfxtcalving)
1293      DEALLOCATE(zxxtrunofflic)
1294      DEALLOCATE(xtsnow_lsc, zxfxtfonte)
1295      DEALLOCATE(xtrain_lsc)
1296      DEALLOCATE(dxtvdf_x, dxtvdf_w)
1297      DEALLOCATE(xt_therm)
1298      DEALLOCATE(h1_diag,runoff_diag,xtrunoff_diag)
1299#endif
1300!
1301      DEALLOCATE(ptconv)
1302      DEALLOCATE(ratqsc)
1303!
1304      DEALLOCATE(wbeff, convoccur, zmax_th)
1305      DEALLOCATE(zq2m, zt2m, weak_inversion)
1306      DEALLOCATE(zt2m_min_mon, zt2m_max_mon)
1307      DEALLOCATE(t2m_min_mon, t2m_max_mon)
1308      DEALLOCATE(sens, flwp, fiwp)
1309      DEALLOCATE(alp_bl_conv,alp_bl_det)
1310      DEALLOCATE(alp_bl_fluct_m,alp_bl_fluct_tke)
1311      DEALLOCATE(alp_bl_stat, n2, s2)
1312      DEALLOCATE(proba_notrig, random_notrig)
1313      DEALLOCATE(cv_gen)
1314
1315      DEALLOCATE(dnwd0)
1316!      DEALLOCATE(upwd, omega, coefh)
1317      DEALLOCATE(omega)
1318      DEALLOCATE(epmax_diag)
1319!      DEALLOCATE(coefm, lambda_th, cldemi)
1320      DEALLOCATE(lambda_th, cldemi)
1321      DEALLOCATE(cldfra, cldtau, fiwc)
1322      DEALLOCATE(fl, re, flwc)
1323      DEALLOCATE(ref_liq, ref_ice, theta)
1324      DEALLOCATE(ref_liq_pi, ref_ice_pi)
1325      DEALLOCATE(zphi, zx_rh, zx_rhl, zx_rhi)
1326      DEALLOCATE(pmfd, pmfu)
1327
1328      DEALLOCATE(t2m, fluxlat)
1329      DEALLOCATE(fsollw, evap_pot)
1330      DEALLOCATE(fsolsw, wfbils, wfbilo)
1331      DEALLOCATE(wfevap,wfrain,wfsnow)
1332
1333      DEALLOCATE(pmflxr, pmflxs)
1334      DEALLOCATE(wdtrainA, wdtrainS, wdtrainM)
1335      DEALLOCATE(upwd, dnwd)
1336      DEALLOCATE(ep)
1337      DEALLOCATE(da, mp )
1338      DEALLOCATE(phi )
1339      DEALLOCATE(wght_cvfd )
1340      DEALLOCATE(phi2 )
1341      DEALLOCATE(d1a, dam)
1342      DEALLOCATE(ev )
1343      DEALLOCATE(elij )
1344      DEALLOCATE(qtaa )
1345      DEALLOCATE(clw )
1346      DEALLOCATE(epmlmMm, eplaMm )
1347      DEALLOCATE(sij )
1348#ifdef ISO
1349      DEALLOCATE(xtwdtrainA)
1350      DEALLOCATE(xttaa )
1351      DEALLOCATE(xtclw )
1352      DEALLOCATE(xtev )
1353#ifdef DIAGISO
1354      DEALLOCATE(qlp)
1355      DEALLOCATE(qvp)
1356      DEALLOCATE(fq_detrainement)
1357      DEALLOCATE(fq_ddft)
1358      DEALLOCATE(fq_fluxmasse)
1359      DEALLOCATE(fq_evapprecip)
1360      DEALLOCATE(f_detrainement,q_detrainement)
1361      DEALLOCATE(xtlp)
1362      DEALLOCATE(xtvp)
1363      DEALLOCATE(q_the,xt_the)
1364      DEALLOCATE(fxt_detrainement)
1365      DEALLOCATE(fxt_ddft)
1366      DEALLOCATE(fxt_fluxmasse)
1367      DEALLOCATE(fxt_evapprecip)
1368      DEALLOCATE(xt_detrainement)
1369#endif
1370#endif
1371
1372
1373      DEALLOCATE(prfl, psfl, fraca, Vprecip)
1374      DEALLOCATE(zw2)
1375
1376      DEALLOCATE(fluxu, fluxv)
1377      DEALLOCATE(fluxt)
1378
1379      DEALLOCATE(uwriteSTD, vwriteSTD)
1380      DEALLOCATE(wwriteSTD, phiwriteSTD)
1381      DEALLOCATE(qwriteSTD, twriteSTD, rhwriteSTD)
1382
1383! ug et d'autres encore:
1384      DEALLOCATE(beta_prec)
1385      DEALLOCATE(rneb)
1386      DEALLOCATE (zxsnow,snowhgt,qsnow,to_ice,sissnow,runoff,albsol3_lic)
1387#ifdef ISO
1388      DEALLOCATE (zxxtsnow,xtVprecip,xtVprecipi,pxtrfl,pxtsfl)
1389#endif
1390
1391      DEALLOCATE (p_tropopause)
1392      DEALLOCATE (z_tropopause)
1393      DEALLOCATE (t_tropopause)
1394      DEALLOCATE(zn2mout)
1395
1396#ifdef CPP_StratAer
1397! variables for strat. aerosol CK
1398      DEALLOCATE (R2SO4)
1399      DEALLOCATE (DENSO4)
1400      DEALLOCATE (f_r_wet)
1401      DEALLOCATE (decfluxaer)
1402      DEALLOCATE (mdw)
1403      DEALLOCATE (SO2_lifetime)
1404      DEALLOCATE (OCS_lifetime)
1405      DEALLOCATE (alpha_bin)
1406      DEALLOCATE (piz_bin)
1407      DEALLOCATE (cg_bin)
1408      DEALLOCATE (tau_strat_550)
1409      DEALLOCATE (tau_strat_1020)
1410      DEALLOCATE (tausum_strat)
1411      DEALLOCATE (surf_PM25_sulf)
1412      DEALLOCATE (vsed_aer)
1413      DEALLOCATE (budg_3D_ocs_to_so2)
1414      DEALLOCATE (budg_3D_so2_to_h2so4)
1415      DEALLOCATE (budg_3D_backgr_ocs)
1416      DEALLOCATE (budg_3D_backgr_so2)
1417      DEALLOCATE (budg_3D_nucl)
1418      DEALLOCATE (budg_3D_cond_evap)
1419      DEALLOCATE (budg_dep_dry_ocs)
1420      DEALLOCATE (budg_dep_wet_ocs)
1421      DEALLOCATE (budg_dep_dry_so2)
1422      DEALLOCATE (budg_dep_wet_so2)
1423      DEALLOCATE (budg_dep_dry_h2so4)
1424      DEALLOCATE (budg_dep_wet_h2so4)
1425      DEALLOCATE (budg_dep_dry_part)
1426      DEALLOCATE (budg_dep_wet_part)
1427      DEALLOCATE (budg_emi_ocs)
1428      DEALLOCATE (budg_emi_so2)
1429      DEALLOCATE (budg_emi_h2so4)
1430      DEALLOCATE (budg_emi_part)
1431      DEALLOCATE (budg_ocs_to_so2)
1432      DEALLOCATE (budg_so2_to_h2so4)
1433      DEALLOCATE (budg_h2so4_to_part)
1434      DEALLOCATE (budg_sed_part)
1435#endif
1436
1437END SUBROUTINE phys_local_var_end
1438
1439END MODULE phys_local_var_mod
Note: See TracBrowser for help on using the repository browser.