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

Last change on this file since 3239 was 3208, checked in by jyg, 7 years ago

Implementation of a first crude model of the
dynamic of wake population.

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