source: LMDZ5/branches/IPSLCM6.0.10/libf/phylmd/phys_local_var_mod.F90 @ 5445

Last change on this file since 5445 was 2879, checked in by Laurent Fairhead, 8 years ago

Inclusion of r2877 corrections in CM6.0.10-LR branch

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