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

Last change on this file since 4440 was 4118, checked in by evignon, 3 years ago

correction variable with

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