source: LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phys_local_var_mod.F90 @ 3356

Last change on this file since 3356 was 3356, checked in by Laurent Fairhead, 6 years ago

First attempt at merging with trunk

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