source: LMDZ6/branches/blowing_snow/libf/phylmd/phys_local_var_mod.F90 @ 5018

Last change on this file since 5018 was 4485, checked in by evignon, 19 months ago

premier commit pour l'ajout de la neige soufflee sur la nouvelle branche

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