source: LMDZ5/trunk/libf/phylmd/phys_local_var_mod.F90 @ 2678

Last change on this file since 2678 was 2670, checked in by oboucher, 8 years ago

adding new diagnostics for evap/rain/snow weighted by surface types
this parallels what was done for wbilo (net flux)
new diagnostics are wevap_??? wrain_??? wsnow_???
where ??? is ter, oce, lic or sic.

  • 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: 36.7 KB
Line 
1!
2! $Id: phys_local_var_mod.F90 2670 2016-10-16 09:17:32Z oboucher $
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!!!!
32      REAL, SAVE, ALLOCATABLE :: d_tr_dyn(:,:,:)
33      !$OMP THREADPRIVATE(d_tr_dyn)
34!!!!
35      REAL, SAVE, ALLOCATABLE :: d_t_con(:,:),d_q_con(:,:)
36      !$OMP THREADPRIVATE(d_t_con,d_q_con)
37      REAL, SAVE, ALLOCATABLE :: d_u_con(:,:),d_v_con(:,:)
38      !$OMP THREADPRIVATE(d_u_con,d_v_con)
39      REAL, SAVE, ALLOCATABLE :: d_t_wake(:,:),d_q_wake(:,:)
40      !$OMP THREADPRIVATE( d_t_wake,d_q_wake)
41      REAL, SAVE, ALLOCATABLE :: d_t_lsc(:,:),d_q_lsc(:,:),d_ql_lsc(:,:),d_qi_lsc(:,:)
42      !$OMP THREADPRIVATE(d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc)
43      REAL, SAVE, ALLOCATABLE :: d_t_lwr(:,:),d_t_lw0(:,:),d_t_swr(:,:),d_t_sw0(:,:)
44      !$OMP THREADPRIVATE(d_t_lwr,d_t_lw0,d_t_swr,d_t_sw0)
45      REAL, SAVE, ALLOCATABLE :: d_t_ajsb(:,:), d_q_ajsb(:,:)
46      !$OMP THREADPRIVATE(d_t_ajsb, d_q_ajsb)
47      REAL, SAVE, ALLOCATABLE :: d_t_ajs(:,:), d_q_ajs(:,:)
48      !$OMP THREADPRIVATE(d_t_ajs, d_q_ajs)
49      REAL, SAVE, ALLOCATABLE :: d_u_ajs(:,:), d_v_ajs(:,:)
50      !$OMP THREADPRIVATE(d_u_ajs, d_v_ajs)
51!nrlmd<
52      REAL, SAVE, ALLOCATABLE :: d_t_ajs_w(:,:), d_q_ajs_w(:,:)
53      !$OMP THREADPRIVATE(d_t_ajs_w, d_q_ajs_w)
54      REAL, SAVE, ALLOCATABLE :: d_t_ajs_x(:,:), d_q_ajs_x(:,:)
55      !$OMP THREADPRIVATE(d_t_ajs_x, d_q_ajs_x)
56!>nrlmd
57      REAL, SAVE, ALLOCATABLE :: d_t_eva(:,:),d_q_eva(:,:)
58      !$OMP THREADPRIVATE(d_t_eva,d_q_eva)
59      REAL, SAVE, ALLOCATABLE :: d_t_lscst(:,:),d_q_lscst(:,:)
60      !$OMP THREADPRIVATE(d_t_lscst,d_q_lscst)
61      REAL, SAVE, ALLOCATABLE :: d_t_lscth(:,:),d_q_lscth(:,:)
62      !$OMP THREADPRIVATE(d_t_lscth,d_q_lscth)
63      REAL, SAVE, ALLOCATABLE :: plul_th(:),plul_st(:)
64      !$OMP THREADPRIVATE(plul_th,plul_st)
65!tendances dues a oro et lif
66      REAL, SAVE, ALLOCATABLE :: d_t_oli(:,:)
67      !$OMP THREADPRIVATE(d_t_oli)
68      REAL, SAVE, ALLOCATABLE :: d_u_oli(:,:), d_v_oli(:,:)
69      !$OMP THREADPRIVATE(d_u_oli, d_v_oli)
70      REAL, SAVE, ALLOCATABLE :: d_t_vdf(:,:), d_q_vdf(:,:), d_t_diss(:,:)
71      !$OMP THREADPRIVATE( d_t_vdf, d_q_vdf,d_t_diss)
72      REAL, SAVE, ALLOCATABLE :: d_u_vdf(:,:), d_v_vdf(:,:)
73      !$OMP THREADPRIVATE(d_u_vdf, d_v_vdf)
74!nrlmd+jyg<
75      REAL, SAVE, ALLOCATABLE :: d_t_vdf_w(:,:), d_q_vdf_w(:,:)
76      !$OMP THREADPRIVATE( d_t_vdf_w, d_q_vdf_w)
77      REAL, SAVE, ALLOCATABLE :: d_t_vdf_x(:,:), d_q_vdf_x(:,:)
78      !$OMP THREADPRIVATE( d_t_vdf_x, d_q_vdf_x)
79!>nrlmd+jyg
80      REAL, SAVE, ALLOCATABLE :: d_t_oro(:,:)
81      !$OMP THREADPRIVATE(d_t_oro)
82      REAL, SAVE, ALLOCATABLE :: d_u_oro(:,:), d_v_oro(:,:)
83      !$OMP THREADPRIVATE(d_u_oro, d_v_oro)
84      REAL, SAVE, ALLOCATABLE :: d_t_lif(:,:)
85      !$OMP THREADPRIVATE(d_t_lif)
86      REAL, SAVE, ALLOCATABLE :: d_u_lif(:,:), d_v_lif(:,:)
87      !$OMP THREADPRIVATE(d_u_lif, d_v_lif)
88! Tendances Ondes de G non oro (runs strato).
89      REAL, SAVE, ALLOCATABLE :: du_gwd_hines(:,:)
90      !$OMP THREADPRIVATE(du_gwd_hines)
91      REAL, SAVE, ALLOCATABLE :: dv_gwd_hines(:,:)
92      !$OMP THREADPRIVATE(dv_gwd_hines)
93      REAL, SAVE, ALLOCATABLE :: dv_gwd_rando(:,:)
94      !$OMP THREADPRIVATE(dv_gwd_rando)
95      REAL, SAVE, ALLOCATABLE :: dv_gwd_front(:,:)
96      !$OMP THREADPRIVATE(dv_gwd_front)
97      REAL, SAVE, ALLOCATABLE :: east_gwstress(:,:)
98      !$OMP THREADPRIVATE(east_gwstress)
99      REAL, SAVE, ALLOCATABLE :: west_gwstress(:,:)
100      !$OMP THREADPRIVATE(west_gwstress)
101      REAL, SAVE, ALLOCATABLE :: d_t_hin(:,:)
102      !$OMP THREADPRIVATE(d_t_hin)
103! tendance due a l'oxydation du methane
104      REAL, SAVE, ALLOCATABLE :: d_q_ch4(:,:)
105      !$OMP THREADPRIVATE(d_q_ch4)
106
107! tendance du a la conersion Ec -> E thermique
108      REAL, SAVE, ALLOCATABLE :: d_t_ec(:,:)
109      !$OMP THREADPRIVATE(d_t_ec)
110      REAL, SAVE, ALLOCATABLE :: d_ts(:,:), d_tr(:,:,:)
111      !$OMP THREADPRIVATE(d_ts, d_tr)
112
113! diagnostique pour le rayonnement
114      REAL, SAVE, ALLOCATABLE :: topswad_aero(:),  solswad_aero(:)      ! diag
115      !$OMP THREADPRIVATE(topswad_aero,solswad_aero)
116      REAL, SAVE, ALLOCATABLE :: topswai_aero(:),  solswai_aero(:)      ! diag
117      !$OMP THREADPRIVATE(topswai_aero,solswai_aero)
118      REAL, SAVE, ALLOCATABLE :: topswad0_aero(:), solswad0_aero(:)     ! diag
119      !$OMP THREADPRIVATE(topswad0_aero,solswad0_aero)
120      REAL, SAVE, ALLOCATABLE :: topsw_aero(:,:),  solsw_aero(:,:)      ! diag
121      !$OMP THREADPRIVATE(topsw_aero,solsw_aero)
122      REAL, SAVE, ALLOCATABLE :: topsw0_aero(:,:), solsw0_aero(:,:)     ! diag
123      !$OMP THREADPRIVATE(topsw0_aero,solsw0_aero)
124      REAL, SAVE, ALLOCATABLE :: topswcf_aero(:,:),  solswcf_aero(:,:)  ! diag
125      !$OMP THREADPRIVATE(topswcf_aero,solswcf_aero)
126! LW radiation diagnostics CK
127      REAL, SAVE, ALLOCATABLE :: toplwad_aero(:),  sollwad_aero(:)      ! diag
128      !$OMP THREADPRIVATE(toplwad_aero,sollwad_aero)
129      REAL, SAVE, ALLOCATABLE :: toplwai_aero(:),  sollwai_aero(:)      ! diag
130      !$OMP THREADPRIVATE(toplwai_aero,sollwai_aero)
131      REAL, SAVE, ALLOCATABLE :: toplwad0_aero(:), sollwad0_aero(:)     ! diag
132      !$OMP THREADPRIVATE(toplwad0_aero,sollwad0_aero)
133! Special RRTM
134      REAL, SAVE, ALLOCATABLE :: ZLWFT0_i(:,:),  ZSWFT0_i(:,:)      ! diag
135      !$OMP THREADPRIVATE(ZLWFT0_i,ZSWFT0_i)
136      REAL, SAVE, ALLOCATABLE :: ZFLDN0(:,:),  ZFLUP0(:,:)      ! diag
137      !$OMP THREADPRIVATE(ZFLDN0,ZFLUP0)
138      REAL, SAVE, ALLOCATABLE :: ZFSDN0(:,:),  ZFSUP0(:,:)      ! diag
139      !$OMP THREADPRIVATE(ZFSDN0,ZFSUP0)
140!
141      REAL, SAVE, ALLOCATABLE :: stratomask(:,:)
142      !$OMP THREADPRIVATE(stratomask)
143      REAL, SAVE, ALLOCATABLE :: tausum_aero(:,:,:)
144      !$OMP THREADPRIVATE(tausum_aero)
145      REAL, SAVE, ALLOCATABLE :: tau3d_aero(:,:,:,:)
146      !$OMP THREADPRIVATE(tau3d_aero)
147      REAL, SAVE, ALLOCATABLE :: scdnc(:,:)
148      !$OMP THREADPRIVATE(scdnc)
149      REAL, SAVE, ALLOCATABLE :: cldncl(:)
150      !$OMP THREADPRIVATE(cldncl)
151      REAL, SAVE, ALLOCATABLE :: reffclwtop(:)
152      !$OMP THREADPRIVATE(reffclwtop)
153      REAL, SAVE, ALLOCATABLE :: lcc(:)
154      !$OMP THREADPRIVATE(lcc)
155      REAL, SAVE, ALLOCATABLE :: reffclws(:,:)
156      !$OMP THREADPRIVATE(reffclws)
157      REAL, SAVE, ALLOCATABLE :: reffclwc(:,:)
158      !$OMP THREADPRIVATE(reffclwc)
159      REAL, SAVE, ALLOCATABLE :: cldnvi(:)
160      !$OMP THREADPRIVATE(cldnvi)
161      REAL, SAVE, ALLOCATABLE :: lcc3d(:,:)
162      !$OMP THREADPRIVATE(lcc3d)
163      REAL, SAVE, ALLOCATABLE :: lcc3dcon(:,:)
164      !$OMP THREADPRIVATE(lcc3dcon)
165      REAL, SAVE, ALLOCATABLE :: lcc3dstra(:,:)
166      !$OMP THREADPRIVATE(lcc3dstra)
167      REAL, SAVE, ALLOCATABLE :: od550aer(:)
168      !$OMP THREADPRIVATE(od550aer)
169      REAL, SAVE, ALLOCATABLE :: absvisaer(:)
170      !$OMP THREADPRIVATE(absvisaer)
171      REAL, SAVE, ALLOCATABLE :: od865aer(:)
172      !$OMP THREADPRIVATE(od865aer)
173      REAL, SAVE, ALLOCATABLE :: ec550aer(:,:)
174      !$OMP THREADPRIVATE(ec550aer)
175      REAL, SAVE, ALLOCATABLE :: od550lt1aer(:)
176      !$OMP THREADPRIVATE(od550lt1aer)
177      REAL, SAVE, ALLOCATABLE :: sconcso4(:)
178      !$OMP THREADPRIVATE(sconcso4)
179      REAL, SAVE, ALLOCATABLE :: sconcno3(:)
180      !$OMP THREADPRIVATE(sconcno3)
181      REAL, SAVE, ALLOCATABLE :: sconcoa(:)
182      !$OMP THREADPRIVATE(sconcoa)
183      REAL, SAVE, ALLOCATABLE :: sconcbc(:)
184      !$OMP THREADPRIVATE(sconcbc)
185      REAL, SAVE, ALLOCATABLE :: sconcss(:)
186      !$OMP THREADPRIVATE(sconcss)
187      REAL, SAVE, ALLOCATABLE :: sconcdust(:)
188      !$OMP THREADPRIVATE(sconcdust)
189      REAL, SAVE, ALLOCATABLE :: concso4(:,:)
190      !$OMP THREADPRIVATE(concso4)
191      REAL, SAVE, ALLOCATABLE :: concno3(:,:)
192      !$OMP THREADPRIVATE(concno3)
193      REAL, SAVE, ALLOCATABLE :: concoa(:,:)
194      !$OMP THREADPRIVATE(concoa)
195      REAL, SAVE, ALLOCATABLE :: concbc(:,:)
196      !$OMP THREADPRIVATE(concbc)
197      REAL, SAVE, ALLOCATABLE :: concss(:,:)
198      !$OMP THREADPRIVATE(concss)
199      REAL, SAVE, ALLOCATABLE :: concdust(:,:)
200      !$OMP THREADPRIVATE(concdust)
201      REAL, SAVE, ALLOCATABLE :: loadso4(:)
202      !$OMP THREADPRIVATE(loadso4)
203      REAL, SAVE, ALLOCATABLE :: loadoa(:)
204      !$OMP THREADPRIVATE(loadoa)
205      REAL, SAVE, ALLOCATABLE :: loadbc(:)
206      !$OMP THREADPRIVATE(loadbc)
207      REAL, SAVE, ALLOCATABLE :: loadss(:)
208      !$OMP THREADPRIVATE(loadss)
209      REAL, SAVE, ALLOCATABLE :: loaddust(:)
210      !$OMP THREADPRIVATE(loaddust)
211      REAL, SAVE, ALLOCATABLE :: load_tmp1(:)
212      !$OMP THREADPRIVATE(load_tmp1)
213      REAL, SAVE, ALLOCATABLE :: load_tmp2(:)
214      !$OMP THREADPRIVATE(load_tmp2)
215      REAL, SAVE, ALLOCATABLE :: load_tmp3(:)
216      !$OMP THREADPRIVATE(load_tmp3)
217      REAL, SAVE, ALLOCATABLE :: load_tmp4(:)
218      !$OMP THREADPRIVATE(load_tmp4)
219      REAL, SAVE, ALLOCATABLE :: load_tmp5(:)
220      !$OMP THREADPRIVATE(load_tmp5)
221      REAL, SAVE, ALLOCATABLE :: load_tmp6(:)
222      !$OMP THREADPRIVATE(load_tmp6)
223      REAL, SAVE, ALLOCATABLE :: load_tmp7(:)
224      !$OMP THREADPRIVATE(load_tmp7)
225
226!IM ajout variables CFMIP2/CMIP5
227      REAL,ALLOCATABLE,SAVE :: topswad_aerop(:), solswad_aerop(:)
228!$OMP THREADPRIVATE(topswad_aerop, solswad_aerop)
229      REAL,ALLOCATABLE,SAVE :: topswai_aerop(:), solswai_aerop(:)
230!$OMP THREADPRIVATE(topswai_aerop, solswai_aerop)
231      REAL,ALLOCATABLE,SAVE :: topswad0_aerop(:), solswad0_aerop(:)
232!$OMP THREADPRIVATE(topswad0_aerop, solswad0_aerop)
233      REAL,ALLOCATABLE,SAVE :: topsw_aerop(:,:), topsw0_aerop(:,:) 
234!$OMP THREADPRIVATE(topsw_aerop, topsw0_aerop)
235      REAL,ALLOCATABLE,SAVE :: solsw_aerop(:,:), solsw0_aerop(:,:)
236!$OMP THREADPRIVATE(solsw_aerop, solsw0_aerop)
237      REAL,ALLOCATABLE,SAVE :: topswcf_aerop(:,:), solswcf_aerop(:,:)
238!$OMP THREADPRIVATE(topswcf_aerop, solswcf_aerop)
239
240! additional LW variables CK
241      REAL,ALLOCATABLE,SAVE :: toplwad_aerop(:), sollwad_aerop(:)
242!$OMP THREADPRIVATE(toplwad_aerop, sollwad_aerop)
243      REAL,ALLOCATABLE,SAVE :: toplwai_aerop(:), sollwai_aerop(:)
244!$OMP THREADPRIVATE(toplwai_aerop, sollwai_aerop)
245      REAL,ALLOCATABLE,SAVE :: toplwad0_aerop(:), sollwad0_aerop(:)
246!$OMP THREADPRIVATE(toplwad0_aerop, sollwad0_aerop)
247
248!Ajout de celles nécessaires au phys_output_write_mod
249      REAL, SAVE, ALLOCATABLE :: tal1(:), pal1(:), pab1(:), pab2(:)
250!$OMP THREADPRIVATE(tal1, pal1, pab1, pab2)
251      REAL, SAVE, ALLOCATABLE :: ptstar(:), pt0(:), slp(:)
252!$OMP THREADPRIVATE(ptstar, pt0, slp)
253      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sens, flwp, fiwp
254!$OMP THREADPRIVATE(sens, flwp, fiwp)
255!!
256!!         Wake variables
257      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: ale_wake, alp_wake
258!$OMP THREADPRIVATE(ale_wake, alp_wake)           
259      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h
260!$OMP THREADPRIVATE(wake_h)                       
261    REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)            :: wake_omg
262!$OMP THREADPRIVATE(wake_omg)                     
263    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_wk, d_deltaq_wk
264!$OMP THREADPRIVATE(d_deltat_wk, d_deltaq_wk)
265      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: d_s_wk, d_dens_wk
266!$OMP THREADPRIVATE(d_s_wk, d_dens_wk)
267    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_wk_gw, d_deltaq_wk_gw
268!$OMP THREADPRIVATE(d_deltat_wk_gw, d_deltaq_wk_gw)
269    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_vdf, d_deltaq_vdf
270!$OMP THREADPRIVATE(d_deltat_vdf, d_deltaq_vdf)
271!!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_vdf, d_dens_vdf
272!!!OMP THREADPRIVATE(d_s_vdf, d_dens_vdf)
273    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_the, d_deltaq_the
274!$OMP THREADPRIVATE(d_deltat_the, d_deltaq_the)
275!!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_the, d_dens_the
276!!!OMP THREADPRIVATE(d_s_the, d_dens_the)
277      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)           :: d_deltat_ajs_cv, d_deltaq_ajs_cv
278!$OMP THREADPRIVATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)                       
279!!         End of Wake variables
280!!
281      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: bils
282!$OMP THREADPRIVATE(bils)
283      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragm, cdragh
284!$OMP THREADPRIVATE(cdragm, cdragh)
285      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cldh, cldl, cldm, cldq, cldt, qsat2m
286!$OMP THREADPRIVATE(cldh, cldl, cldm, cldq, cldt, qsat2m )
287      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cldhjn, cldljn, cldmjn,cldtjn
288!$OMP THREADPRIVATE(cldhjn, cldljn, cldmjn, cldtjn)
289      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: JrNt
290!$OMP THREADPRIVATE(JrNt)
291      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: dthmin, evap, fder, plcl, plfc, prw, prlw, prsw
292!$OMP THREADPRIVATE(dthmin, evap, fder, plcl, plfc, prw, prlw, prsw)
293      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zustar, zu10m, zv10m, rh2m
294!$OMP THREADPRIVATE(zustar, zu10m, zv10m, rh2m)
295      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_lcl, s_pblh, s_pblt, s_therm
296!$OMP THREADPRIVATE(s_lcl, s_pblh, s_pblt, s_therm)
297!
298!nrlmd+jyg<
299      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_pblh_x, s_pblh_w
300!$OMP THREADPRIVATE(s_pblh_x, s_pblh_w)
301      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_lcl_x, s_lcl_w
302!$OMP THREADPRIVATE(s_lcl_x, s_lcl_w)
303!>nrlmd+jyg
304!
305      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: slab_wfbils
306!$OMP THREADPRIVATE(slab_wfbils)
307      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: tpot, tpote, ue, uq, ve, vq, zxffonte
308!$OMP THREADPRIVATE(tpot, tpote, ue, uq, ve, vq, zxffonte)
309      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfqcalving
310!$OMP THREADPRIVATE(zxfqcalving)
311      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfluxlat, zxtsol, snow_lsc, zxfqfonte
312!$OMP THREADPRIVATE(zxfluxlat, zxtsol, snow_lsc, zxfqfonte)
313      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxrunofflic
314!$OMP THREADPRIVATE(zxrunofflic)
315      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxqsurf, rain_lsc, rain_num
316!$OMP THREADPRIVATE(zxqsurf, rain_lsc, rain_num)
317!
318!jyg+nrlmd<
319!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
320!                                                                          c
321!       Declarations liees a la couche limite differentiee w-x             c
322!                                                                          c
323!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
324      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sens_x, sens_w
325!$OMP THREADPRIVATE(sens_x, sens_w)
326      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfluxlat_x, zxfluxlat_w
327!$OMP THREADPRIVATE(zxfluxlat_x, zxfluxlat_w)
328!jyg<
329!!! Entrées supplémentaires couche-limite
330!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t_x, t_w
331!!!$OMP THREADPRIVATE(t_x, t_w)
332!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: q_x, q_w
333!!!$OMP THREADPRIVATE(q_x, q_w)
334!>jyg
335!!! Sorties ferret
336      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dtvdf_x, dtvdf_w
337!$OMP THREADPRIVATE(dtvdf_x, dtvdf_w)
338      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dqvdf_x, dqvdf_w
339!$OMP THREADPRIVATE(dqvdf_x, dqvdf_w)
340! Variables supplémentaires dans physiq.F relative au splitting de la surface
341      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: pbl_tke_input
342!$OMP THREADPRIVATE(pbl_tke_input)
343! Entree supplementaire Thermiques :
344      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t_therm, q_therm, u_therm, v_therm
345!$OMP THREADPRIVATE(t_therm, q_therm, u_therm, v_therm)
346      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragh_x, cdragh_w
347!$OMP THREADPRIVATE(cdragh_x, cdragh_w)
348      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragm_x, cdragm_w
349!$OMP THREADPRIVATE(cdragm_x, cdragm_w)
350      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: kh, kh_x, kh_w
351!$OMP THREADPRIVATE(kh, kh_x, kh_w)
352!!!
353!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
354!>jyg+nrlmd
355  !
356      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: wbeff, zmax_th, zq2m, zt2m
357!$OMP THREADPRIVATE(wbeff, zmax_th, zq2m, zt2m)
358      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zt2m_min_mon, zt2m_max_mon
359!$OMP THREADPRIVATE(zt2m_min_mon, zt2m_max_mon)
360      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: t2m_min_mon, t2m_max_mon
361!$OMP THREADPRIVATE(t2m_min_mon, t2m_max_mon)
362      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: weak_inversion
363!$OMP THREADPRIVATE(weak_inversion)
364      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: ale_bl_stat,alp_bl_conv,alp_bl_det
365!$OMP THREADPRIVATE(ale_bl_stat,alp_bl_conv,alp_bl_det)
366      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_fluct_m,alp_bl_fluct_tke
367!$OMP THREADPRIVATE(alp_bl_fluct_m,alp_bl_fluct_tke)
368      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_stat, n2, s2
369!$OMP THREADPRIVATE(alp_bl_stat, n2, s2)
370      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: proba_notrig, random_notrig
371!$OMP THREADPRIVATE(proba_notrig, random_notrig)
372      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: fsolsw, wfbils, wfbilo
373!$OMP THREADPRIVATE(fsolsw, wfbils, wfbilo)
374      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: wfevap, wfrain, wfsnow
375!$OMP THREADPRIVATE(wfevap,wfrain,wfsnow)
376      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: t2m, fluxlat, fsollw,evap_pot
377!$OMP THREADPRIVATE(t2m, fluxlat, fsollw,evap_pot)
378      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dnwd, dnwd0, upwd, omega
379!$OMP THREADPRIVATE(dnwd, dnwd0, upwd, omega)
380      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: epmax_diag ! epmax_cape
381!$OMP THREADPRIVATE(epmax_diag)
382      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ep ! epmax_cape
383!$OMP THREADPRIVATE(ep)
384!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: coefh, coefm, lambda_th
385      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: lambda_th
386!$OMP THREADPRIVATE(lambda_th)
387      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: cldemi, cldfra, cldtau, fiwc, fl, re, flwc
388!$OMP THREADPRIVATE(cldemi, cldfra, cldtau, fiwc, fl, re, flwc)
389      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ref_liq, ref_ice, theta, zphi
390!$OMP THREADPRIVATE(ref_liq, ref_ice, theta, zphi)
391      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ref_liq_pi, ref_ice_pi
392!$OMP THREADPRIVATE(ref_liq_pi, ref_ice_pi)
393      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zx_rh
394!$OMP THREADPRIVATE(zx_rh)
395      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: pmflxr, pmflxs, prfl, psfl, fraca
396!$OMP THREADPRIVATE(pmflxr, pmflxs, prfl, psfl, fraca)
397      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: Vprecip, zw2
398!$OMP THREADPRIVATE(Vprecip, zw2)
399      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: pmfd, pmfu
400!$OMP THREADPRIVATE(pmfd, pmfu)
401      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: fluxt, fluxu, fluxv
402!$OMP THREADPRIVATE(fluxt, fluxu, fluxv)
403      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: uwriteSTD, vwriteSTD, wwriteSTD
404!$OMP THREADPRIVATE(uwriteSTD, vwriteSTD, wwriteSTD)
405      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD
406!$OMP THREADPRIVATE(phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD)
407
408! ug et d'autres encore:
409      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: wdtrainA, wdtrainM
410!$OMP THREADPRIVATE(wdtrainA, wdtrainM)
411      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: beta_prec
412!$OMP THREADPRIVATE(beta_prec)
413      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: rneb,rnebjn
414!$OMP THREADPRIVATE(rneb,rnebjn)
415
416! variables de sorties MM
417      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxsnow,snowhgt,qsnow,to_ice
418      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: sissnow,runoff,albsol3_lic
419!$OMP THREADPRIVATE(zxsnow,snowhgt,qsnow,to_ice)
420!$OMP THREADPRIVATE(sissnow,runoff,albsol3_lic)
421
422CONTAINS
423
424!======================================================================
425SUBROUTINE phys_local_var_init
426USE dimphy
427USE infotrac_phy, ONLY : nbtr
428USE aero_mod
429USE indice_sol_mod
430USE phys_output_var_mod
431USE phys_state_var_mod
432
433IMPLICIT NONE
434      allocate(t_seri(klon,klev),q_seri(klon,klev),ql_seri(klon,klev),qs_seri(klon,klev))
435      allocate(u_seri(klon,klev),v_seri(klon,klev))
436      allocate(l_mixmin(klon,klev,nbsrf), l_mix(klon,klev,nbsrf))
437      l_mix(:,:,:)=0. ; l_mixmin(:,:,:)=0. ! doit etre initialse car pas toujours remplis
438
439      allocate(tr_seri(klon,klev,nbtr))
440      allocate(d_t_dyn(klon,klev),d_q_dyn(klon,klev))
441      allocate(d_ql_dyn(klon,klev),d_qs_dyn(klon,klev))
442      allocate(d_q_dyn2d(klon),d_ql_dyn2d(klon),d_qs_dyn2d(klon))
443      allocate(d_u_dyn(klon,klev),d_v_dyn(klon,klev))
444      allocate(d_tr_dyn(klon,klev,nbtr))                   !RomP
445      allocate(d_t_con(klon,klev),d_q_con(klon,klev))
446      allocate(d_u_con(klon,klev),d_v_con(klon,klev))
447      allocate(d_t_wake(klon,klev),d_q_wake(klon,klev))
448      allocate(d_t_lsc(klon,klev),d_q_lsc(klon,klev))
449      allocate(d_t_lwr(klon,klev),d_t_lw0(klon,klev))
450      allocate(d_t_swr(klon,klev),d_t_sw0(klon,klev))
451      allocate(d_ql_lsc(klon,klev),d_qi_lsc(klon,klev))
452      allocate(d_t_ajsb(klon,klev),d_q_ajsb(klon,klev))
453      allocate(d_t_ajs(klon,klev),d_q_ajs(klon,klev))
454!nrlmd<
455      allocate(d_t_ajs_w(klon,klev),d_q_ajs_w(klon,klev))
456      allocate(d_t_ajs_x(klon,klev),d_q_ajs_x(klon,klev))
457!>nrlmd
458      allocate(d_u_ajs(klon,klev),d_v_ajs(klon,klev))
459      allocate(d_t_eva(klon,klev),d_q_eva(klon,klev))
460      allocate(d_t_lscst(klon,klev),d_q_lscst(klon,klev))
461      allocate(d_t_lscth(klon,klev),d_q_lscth(klon,klev))
462      allocate(plul_st(klon),plul_th(klon))
463      allocate(d_t_vdf(klon,klev),d_q_vdf(klon,klev),d_t_diss(klon,klev))
464!nrlmd+jyg<
465      allocate(d_t_vdf_w(klon,klev),d_q_vdf_w(klon,klev))
466      allocate(d_t_vdf_x(klon,klev),d_q_vdf_x(klon,klev))
467!>nrlmd+jyg
468      allocate(d_u_vdf(klon,klev),d_v_vdf(klon,klev))
469      allocate(d_t_oli(klon,klev),d_t_oro(klon,klev))
470      allocate(d_u_oli(klon,klev),d_v_oli(klon,klev))
471      allocate(d_u_oro(klon,klev),d_v_oro(klon,klev))
472      allocate(d_t_lif(klon,klev),d_t_ec(klon,klev))
473      allocate(d_u_lif(klon,klev),d_v_lif(klon,klev))
474      allocate(d_ts(klon,nbsrf), d_tr(klon,klev,nbtr))
475! Special RRTM
476      allocate(ZLWFT0_i(klon,klev+1),ZSWFT0_i(klon,klev+1),ZFLDN0(klon,klev+1))
477      allocate(ZFLUP0(klon,klev+1),ZFSDN0(klon,klev+1),ZFSUP0(klon,klev+1))
478!
479      allocate(topswad_aero(klon), solswad_aero(klon))
480      allocate(topswai_aero(klon), solswai_aero(klon))
481      allocate(topswad0_aero(klon), solswad0_aero(klon))
482     ! LW diagnostics CK
483      allocate(toplwad_aero(klon), sollwad_aero(klon))
484      allocate(toplwai_aero(klon), sollwai_aero(klon))
485      allocate(toplwad0_aero(klon), sollwad0_aero(klon))
486      ! end
487      allocate(topsw_aero(klon,naero_grp), solsw_aero(klon,naero_grp))
488      allocate(topsw0_aero(klon,naero_grp), solsw0_aero(klon,naero_grp))
489      allocate(topswcf_aero(klon,3), solswcf_aero(klon,3))
490      allocate(du_gwd_hines(klon,klev),dv_gwd_hines(klon,klev))
491      allocate(dv_gwd_rando(klon,klev),dv_gwd_front(klon,klev))
492      allocate(east_gwstress(klon,klev),west_gwstress(klon,klev))
493      allocate(d_t_hin(klon,klev))
494      allocate(d_q_ch4(klon,klev))
495!      allocate(tausum_aero(klon,nwave,naero_spc))
496!      allocate(tau3d_aero(klon,klev,nwave,naero_spc))
497      allocate(stratomask(klon,klev))
498!--correction mini bug OB
499      allocate(tausum_aero(klon,nwave,naero_tot))
500      allocate(tau3d_aero(klon,klev,nwave,naero_tot))
501      allocate(scdnc(klon, klev))
502      allocate(cldncl(klon))
503      allocate(reffclwtop(klon))
504      allocate(lcc(klon))
505      allocate(reffclws(klon, klev))
506      allocate(reffclwc(klon, klev))
507      allocate(cldnvi(klon))
508      allocate(lcc3d(klon, klev))
509      allocate(lcc3dcon(klon, klev))
510      allocate(lcc3dstra(klon, klev))
511      allocate(od550aer(klon))
512      allocate(od865aer(klon))
513      allocate(absvisaer(klon))
514      allocate(ec550aer(klon,klev))
515      allocate(od550lt1aer(klon))
516      allocate(sconcso4(klon))
517      allocate(sconcno3(klon))
518      allocate(sconcoa(klon))
519      allocate(sconcbc(klon))
520      allocate(sconcss(klon))
521      allocate(sconcdust(klon))
522      allocate(concso4(klon,klev))
523      allocate(concno3(klon,klev))
524      allocate(concoa(klon,klev))
525      allocate(concbc(klon,klev))
526      allocate(concss(klon,klev))
527      allocate(concdust(klon,klev))
528      allocate(loadso4(klon))
529      allocate(loadoa(klon))
530      allocate(loadbc(klon))
531      allocate(loadss(klon))
532      allocate(loaddust(klon))
533      allocate(load_tmp1(klon))
534      allocate(load_tmp2(klon))
535      allocate(load_tmp3(klon))
536      allocate(load_tmp4(klon))
537      allocate(load_tmp5(klon))
538      allocate(load_tmp6(klon))
539      allocate(load_tmp7(klon))
540
541!IM ajout variables CFMIP2/CMIP5
542      ALLOCATE(topswad_aerop(klon), solswad_aerop(klon))
543      ALLOCATE(topswai_aerop(klon), solswai_aerop(klon))
544      ALLOCATE(topswad0_aerop(klon), solswad0_aerop(klon))
545      ALLOCATE(topsw_aerop(klon,naero_grp), topsw0_aerop(klon,naero_grp))
546      ALLOCATE(solsw_aerop(klon,naero_grp), solsw0_aerop(klon,naero_grp))
547      ALLOCATE(topswcf_aerop(klon,naero_grp), solswcf_aerop(klon,naero_grp))
548
549! additional LW variables CK
550      ALLOCATE(toplwad_aerop(klon), sollwad_aerop(klon))
551      ALLOCATE(toplwai_aerop(klon), sollwai_aerop(klon))
552      ALLOCATE(toplwad0_aerop(klon), sollwad0_aerop(klon))
553
554! FH Ajout de celles nécessaires au phys_output_write_mod
555
556      ALLOCATE(tal1(klon), pal1(klon), pab1(klon), pab2(klon))
557      ALLOCATE(ptstar(klon),pt0(klon),slp(klon))
558!!
559!!          Wake variables
560      ALLOCATE(ale_wake(klon), alp_wake(klon))
561      ALLOCATE(wake_h(klon))
562      ALLOCATE(wake_omg(klon, klev))
563      ALLOCATE(d_deltat_wk(klon, klev), d_deltaq_wk(klon, klev))
564      ALLOCATE(d_s_wk(klon), d_dens_wk(klon))
565      ALLOCATE(d_deltat_wk_gw(klon, klev), d_deltaq_wk_gw(klon, klev))
566      ALLOCATE(d_deltat_vdf(klon, klev), d_deltaq_vdf(klon, klev))
567!!      ALLOCATE( d_s_vdf(klon), d_dens_vdf(klon))
568      ALLOCATE(d_deltat_the(klon, klev), d_deltaq_the(klon, klev))
569!!      ALLOCATE( d_s_the(klon), d_dens_the(klon))
570      ALLOCATE(d_deltat_ajs_cv(klon, klev), d_deltaq_ajs_cv(klon, klev))
571!!         End of wake variables
572!!
573      ALLOCATE(bils(klon))
574      ALLOCATE(cdragm(klon), cdragh(klon), cldh(klon), cldl(klon))
575      ALLOCATE(cldm(klon), cldq(klon), cldt(klon), qsat2m(klon))
576      ALLOCATE(cldhjn(klon), cldljn(klon), cldmjn(klon), cldtjn(klon))
577      ALLOCATE(JrNt(klon))
578      ALLOCATE(dthmin(klon), evap(klon), fder(klon), plcl(klon), plfc(klon))
579      ALLOCATE(prw(klon), prlw(klon), prsw(klon), zustar(klon), zu10m(klon), zv10m(klon), rh2m(klon))
580      ALLOCATE(s_lcl(klon))
581      ALLOCATE(s_pblh(klon), s_pblt(klon), s_therm(klon))
582!
583!nrlmd+jyg<
584      ALLOCATE(s_pblh_x(klon), s_pblh_w(klon))
585      ALLOCATE(s_lcl_x(klon), s_lcl_w(klon))
586!>nrlmd+jyg
587!
588      ALLOCATE(slab_wfbils(klon), tpot(klon), tpote(klon), ue(klon))
589      ALLOCATE(uq(klon), ve(klon), vq(klon), zxffonte(klon))
590      ALLOCATE(zxfqcalving(klon), zxfluxlat(klon))
591      ALLOCATE(zxtsol(klon), snow_lsc(klon), zxfqfonte(klon), zxqsurf(klon))
592      ALLOCATE(zxrunofflic(klon))
593      ALLOCATE(rain_lsc(klon))
594      ALLOCATE(rain_num(klon))
595!
596      ALLOCATE(sens_x(klon), sens_w(klon))
597      ALLOCATE(zxfluxlat_x(klon), zxfluxlat_w(klon))
598!jyg<
599!!      ALLOCATE(t_x(klon,klev), t_w(klon,klev))
600!!      ALLOCATE(q_x(klon,klev), q_w(klon,klev))
601!>jyg
602      ALLOCATE(dtvdf_x(klon,klev), dtvdf_w(klon,klev))
603      ALLOCATE(dqvdf_x(klon,klev), dqvdf_w(klon,klev))
604      ALLOCATE(pbl_tke_input(klon,klev+1,nbsrf))
605      ALLOCATE(t_therm(klon,klev), q_therm(klon,klev),u_therm(klon,klev), v_therm(klon,klev))
606      ALLOCATE(cdragh_x(klon), cdragh_w(klon))
607      ALLOCATE(cdragm_x(klon), cdragm_w(klon))
608      ALLOCATE(kh(klon), kh_x(klon), kh_w(klon))
609!
610      ALLOCATE(wbeff(klon), zmax_th(klon))
611      ALLOCATE(zq2m(klon), zt2m(klon), weak_inversion(klon))
612      ALLOCATE(zt2m_min_mon(klon), zt2m_max_mon(klon))
613      ALLOCATE(t2m_min_mon(klon), t2m_max_mon(klon))
614      ALLOCATE(sens(klon), flwp(klon), fiwp(klon))
615      ALLOCATE(ale_bl_stat(klon), alp_bl_conv(klon), alp_bl_det(klon))
616      ALLOCATE(alp_bl_fluct_m(klon), alp_bl_fluct_tke(klon))
617      ALLOCATE(alp_bl_stat(klon), n2(klon), s2(klon))
618      ALLOCATE(proba_notrig(klon), random_notrig(klon))
619
620      ALLOCATE(dnwd(klon, klev), dnwd0(klon, klev))
621!      ALLOCATE(upwd(klon, klev), omega(klon, klev), coefh(klon, klev))
622      ALLOCATE(upwd(klon, klev), omega(klon, klev))
623      ALLOCATE(epmax_diag(klon)) ! epmax_cape
624      ALLOCATE(ep(klon,klev)) ! epmax_cape
625!      ALLOCATE(coefm(klon, klev), lambda_th(klon, klev), cldemi(klon, klev))
626      ALLOCATE(lambda_th(klon, klev), cldemi(klon, klev))
627      ALLOCATE(cldfra(klon, klev), cldtau(klon, klev), fiwc(klon, klev))
628      ALLOCATE(fl(klon, klev), re(klon, klev), flwc(klon, klev))
629      ALLOCATE(ref_liq(klon, klev), ref_ice(klon, klev), theta(klon, klev))
630      ALLOCATE(ref_liq_pi(klon, klev), ref_ice_pi(klon, klev))
631      ALLOCATE(zphi(klon, klev), zx_rh(klon, klev))
632      ALLOCATE(pmfd(klon, klev), pmfu(klon, klev))
633
634      ALLOCATE(t2m(klon, nbsrf), fluxlat(klon, nbsrf))
635      ALLOCATE(fsollw(klon, nbsrf))
636      ALLOCATE(fsolsw(klon, nbsrf), wfbils(klon, nbsrf), wfbilo(klon, nbsrf))
637      ALLOCATE(wfevap(klon, nbsrf), wfrain(klon,nbsrf), wfsnow(klon, nbsrf))
638      ALLOCATE(evap_pot(klon, nbsrf))
639
640      ALLOCATE(pmflxr(klon, klev+1), pmflxs(klon, klev+1), prfl(klon, klev+1))
641      ALLOCATE(psfl(klon, klev+1), fraca(klon, klev+1), Vprecip(klon, klev+1))
642      ALLOCATE(zw2(klon, klev+1))
643
644      ALLOCATE(fluxu(klon, klev, nbsrf), fluxv(klon, klev, nbsrf))
645      ALLOCATE(fluxt(klon, klev, nbsrf))
646
647      ALLOCATE(uwriteSTD(klon,nlevSTD,nfiles), vwriteSTD(klon,nlevSTD,nfiles))
648      ALLOCATE(wwriteSTD(klon,nlevSTD,nfiles), phiwriteSTD(klon,nlevSTD,nfiles))
649      ALLOCATE(qwriteSTD(klon,nlevSTD,nfiles), twriteSTD(klon,nlevSTD,nfiles))
650      ALLOCATE(rhwriteSTD(klon,nlevSTD,nfiles))
651
652! ug et d'autres encore:
653      ALLOCATE(wdtrainA(klon,klev),wdtrainM(klon,klev))
654      ALLOCATE(beta_prec(klon,klev))
655      ALLOCATE(rneb(klon,klev),rnebjn(klon,klev))
656
657
658      ALLOCATE (zxsnow(klon),snowhgt(klon),qsnow(klon),to_ice(klon))
659      ALLOCATE (sissnow(klon),runoff(klon),albsol3_lic(klon))
660
661
662
663END SUBROUTINE phys_local_var_init
664
665!======================================================================
666SUBROUTINE phys_local_var_end
667USE dimphy
668USE indice_sol_mod
669IMPLICIT NONE
670      deallocate(t_seri,q_seri,ql_seri,qs_seri)
671      deallocate(u_seri,v_seri)
672      deallocate(l_mixmin,l_mix)
673
674      deallocate(tr_seri)
675      deallocate(d_t_dyn,d_q_dyn)
676      deallocate(d_ql_dyn,d_qs_dyn)
677      deallocate(d_q_dyn2d,d_ql_dyn2d,d_qs_dyn2d)
678      deallocate(d_u_dyn,d_v_dyn)
679      deallocate(d_tr_dyn)                      !RomP
680      deallocate(d_t_con,d_q_con)
681      deallocate(d_u_con,d_v_con)
682      deallocate(d_t_wake,d_q_wake)
683      deallocate(d_t_lsc,d_q_lsc)
684      deallocate(d_t_lwr,d_t_lw0)
685      deallocate(d_t_swr,d_t_sw0)
686      deallocate(d_ql_lsc,d_qi_lsc)
687      deallocate(d_t_ajsb,d_q_ajsb)
688      deallocate(d_t_ajs,d_q_ajs)
689!nrlmd<
690      deallocate(d_t_ajs_w,d_q_ajs_w)
691      deallocate(d_t_ajs_x,d_q_ajs_x)
692!>nrlmd
693      deallocate(d_u_ajs,d_v_ajs)
694      deallocate(d_t_eva,d_q_eva)
695      deallocate(d_t_lscst,d_q_lscst)
696      deallocate(d_t_lscth,d_q_lscth)
697      deallocate(plul_st,plul_th)
698      deallocate(d_t_vdf,d_q_vdf,d_t_diss)
699!nrlmd+jyg<
700      deallocate(d_t_vdf_w,d_q_vdf_w)
701      deallocate(d_t_vdf_x,d_q_vdf_x)
702!>nrlmd+jyg
703      deallocate(d_u_vdf,d_v_vdf)
704      deallocate(d_t_oli,d_t_oro)
705      deallocate(d_u_oli,d_v_oli)
706      deallocate(d_u_oro,d_v_oro)
707      deallocate(d_t_lif,d_t_ec)
708      deallocate(d_u_lif,d_v_lif)
709      deallocate(d_ts, d_tr)
710      deallocate(topswad_aero,solswad_aero)
711      deallocate(topswai_aero,solswai_aero)
712      deallocate(topswad0_aero,solswad0_aero)
713      ! LW additional CK
714      deallocate(toplwad_aero,sollwad_aero)
715      deallocate(toplwai_aero,sollwai_aero)
716      deallocate(toplwad0_aero,sollwad0_aero)
717      ! end
718      deallocate(topsw_aero,solsw_aero)
719      deallocate(topsw0_aero,solsw0_aero)
720      deallocate(topswcf_aero,solswcf_aero)
721      deallocate(stratomask)
722      deallocate(tausum_aero)
723      deallocate(tau3d_aero)
724      deallocate(scdnc)
725      deallocate(cldncl)
726      deallocate(reffclwtop)
727      deallocate(lcc)
728      deallocate(reffclws)
729      deallocate(reffclwc)
730      deallocate(cldnvi)
731      deallocate(lcc3d)
732      deallocate(lcc3dcon)
733      deallocate(lcc3dstra)
734      deallocate(od550aer)
735      deallocate(od865aer)
736      deallocate(absvisaer)
737      deallocate(ec550aer)
738      deallocate(od550lt1aer)
739      deallocate(sconcso4)
740      deallocate(sconcno3)
741      deallocate(sconcoa)
742      deallocate(sconcbc)
743      deallocate(sconcss)
744      deallocate(sconcdust)
745      deallocate(concso4)
746      deallocate(concno3)
747      deallocate(concoa)
748      deallocate(concbc)
749      deallocate(concss)
750      deallocate(concdust)
751      deallocate(loadso4)
752      deallocate(loadoa)
753      deallocate(loadbc)
754      deallocate(loadss)
755      deallocate(loaddust)
756      deallocate(load_tmp1)
757      deallocate(load_tmp2)
758      deallocate(load_tmp3)
759      deallocate(load_tmp4)
760      deallocate(load_tmp5)
761      deallocate(load_tmp6)
762      deallocate(load_tmp7)
763      deallocate(du_gwd_hines,dv_gwd_hines,d_t_hin)
764      deallocate(d_q_ch4)
765      deallocate(dv_gwd_rando,dv_gwd_front)
766      deallocate(east_gwstress,west_gwstress)
767
768!IM ajout variables CFMIP2/CMIP5
769      deallocate(topswad_aerop, solswad_aerop)
770      deallocate(topswai_aerop, solswai_aerop)
771      deallocate(topswad0_aerop, solswad0_aerop)
772      deallocate(topsw_aerop, topsw0_aerop)
773      deallocate(solsw_aerop, solsw0_aerop)
774      deallocate(topswcf_aerop, solswcf_aerop)
775
776!CK LW diagnostics
777      deallocate(toplwad_aerop, sollwad_aerop)
778      deallocate(toplwai_aerop, sollwai_aerop)
779      deallocate(toplwad0_aerop, sollwad0_aerop)
780
781! FH Ajout de celles nécessaires au phys_output_write_mod
782      DEALLOCATE(tal1, pal1, pab1, pab2)
783      DEALLOCATE(ptstar, pt0, slp)
784!
785      DEALLOCATE(ale_wake, alp_wake)
786      DEALLOCATE(wake_h)
787      DEALLOCATE(wake_omg)
788      DEALLOCATE(d_deltat_wk, d_deltaq_wk)
789      DEALLOCATE(d_s_wk, d_dens_wk)
790      DEALLOCATE(d_deltat_wk_gw, d_deltaq_wk_gw)
791      DEALLOCATE(d_deltat_vdf, d_deltaq_vdf)
792!!      DEALLOCATE( d_s_vdf, d_dens_vdf)
793      DEALLOCATE(d_deltat_the, d_deltaq_the)
794!!      DEALLOCATE( d_s_the, d_dens_the)
795      DEALLOCATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)
796!
797      DEALLOCATE(bils)
798      DEALLOCATE(cdragm, cdragh, cldh, cldl)
799      DEALLOCATE(cldm, cldq, cldt, qsat2m)
800      DEALLOCATE(cldljn, cldmjn, cldhjn, cldtjn, JrNt)
801      DEALLOCATE(dthmin, evap, fder, plcl, plfc)
802      DEALLOCATE(prw, prlw, prsw, zustar, zu10m, zv10m, rh2m, s_lcl)
803      DEALLOCATE(s_pblh, s_pblt, s_therm)
804!
805!nrlmd+jyg<
806      DEALLOCATE(s_pblh_x, s_pblh_w)
807      DEALLOCATE(s_lcl_x, s_lcl_w)
808!>nrlmd+jyg
809!
810      DEALLOCATE(slab_wfbils, tpot, tpote, ue)
811      DEALLOCATE(uq, ve, vq, zxffonte)
812      DEALLOCATE(zxfqcalving, zxfluxlat)
813      DEALLOCATE(zxrunofflic)
814      DEALLOCATE(zxtsol, snow_lsc, zxfqfonte, zxqsurf)
815      DEALLOCATE(rain_lsc)
816      DEALLOCATE(rain_num)
817!
818      DEALLOCATE(sens_x, sens_w)
819      DEALLOCATE(zxfluxlat_x, zxfluxlat_w)
820!jyg<
821!!      DEALLOCATE(t_x, t_w)
822!!      DEALLOCATE(q_x, q_w)
823!>jyg
824      DEALLOCATE(dtvdf_x, dtvdf_w)
825      DEALLOCATE(dqvdf_x, dqvdf_w)
826      DEALLOCATE(pbl_tke_input)
827      DEALLOCATE(t_therm, q_therm, u_therm, v_therm)
828      DEALLOCATE(cdragh_x, cdragh_w)
829      DEALLOCATE(cdragm_x, cdragm_w)
830      DEALLOCATE(kh, kh_x, kh_w)
831!
832      DEALLOCATE(wbeff, zmax_th)
833      DEALLOCATE(zq2m, zt2m, weak_inversion)
834      DEALLOCATE(zt2m_min_mon, zt2m_max_mon)
835      DEALLOCATE(t2m_min_mon, t2m_max_mon)
836      DEALLOCATE(sens, flwp, fiwp)
837      DEALLOCATE(ale_bl_stat,alp_bl_conv,alp_bl_det)
838      DEALLOCATE(alp_bl_fluct_m,alp_bl_fluct_tke)
839      DEALLOCATE(alp_bl_stat, n2, s2)
840      DEALLOCATE(proba_notrig, random_notrig)
841
842      DEALLOCATE(dnwd, dnwd0)
843!      DEALLOCATE(upwd, omega, coefh)
844      DEALLOCATE(upwd, omega)
845      DEALLOCATE(epmax_diag)
846      DEALLOCATE(ep)
847!      DEALLOCATE(coefm, lambda_th, cldemi)
848      DEALLOCATE(lambda_th, cldemi)
849      DEALLOCATE(cldfra, cldtau, fiwc)
850      DEALLOCATE(fl, re, flwc)
851      DEALLOCATE(ref_liq, ref_ice, theta)
852      DEALLOCATE(ref_liq_pi, ref_ice_pi)
853      DEALLOCATE(zphi, zx_rh)
854      DEALLOCATE(pmfd, pmfu)
855
856      DEALLOCATE(t2m, fluxlat)
857      DEALLOCATE(fsollw, evap_pot)
858      DEALLOCATE(fsolsw, wfbils, wfbilo)
859      DEALLOCATE(wfevap,wfrain,wfsnow)
860
861      DEALLOCATE(pmflxr, pmflxs, prfl)
862      DEALLOCATE(psfl, fraca, Vprecip)
863      DEALLOCATE(zw2)
864
865      DEALLOCATE(fluxu, fluxv)
866      DEALLOCATE(fluxt)
867
868      DEALLOCATE(uwriteSTD, vwriteSTD)
869      DEALLOCATE(wwriteSTD, phiwriteSTD)
870      DEALLOCATE(qwriteSTD, twriteSTD, rhwriteSTD)
871
872! ug et d'autres encore:
873      DEALLOCATE(wdtrainA, wdtrainM)
874      DEALLOCATE(beta_prec)
875      DEALLOCATE(rneb)
876      DEALLOCATE (zxsnow,snowhgt,qsnow,to_ice,sissnow,runoff,albsol3_lic)
877
878END SUBROUTINE phys_local_var_end
879
880END MODULE phys_local_var_mod
Note: See TracBrowser for help on using the repository browser.