source: LMDZ6/trunk/libf/phylmdiso/phys_local_var_mod.F90 @ 4160

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